MCPcopy Create free account
hub / github.com/bytebase/bytebase / batchConvertCELStringToParsedExpr

Function batchConvertCELStringToParsedExpr

frontend/src/utils/v1/cel.ts:24–43  ·  view source on GitHub ↗
(
  celList: string[]
)

Source from the content-addressed store, hash-verified

22 .replace(/\t/g, "\\t");
23
24export const batchConvertCELStringToParsedExpr = async (
25 celList: string[]
26): Promise<Expr[]> => {
27 try {
28 const request = create(BatchParseRequestSchema, {
29 expressions: celList,
30 });
31 const response = await celServiceClientConnect.batchParse(request, {
32 contextValues: createContextValues().set(silentContextKey, true),
33 });
34
35 // Convert new Expr array to old Expr array for compatibility
36 return response.expressions;
37 } catch (error) {
38 console.error(error);
39 return Array.from({ length: celList.length }).map((_) =>
40 create(ExprSchema, {})
41 );
42 }
43};
44
45export const batchConvertParsedExprToCELString = async (
46 parsedExprList: Expr[]

Callers 7

DatabaseGroupFormFunction · 0.90
RuleEditSheetFunction · 0.90
GrantAccessDialogFunction · 0.90
MaskingRuleConfigFunction · 0.90
convertFromCELStringFunction · 0.90

Calls 1

setMethod · 0.45

Tested by

no test coverage detected