@telorun/templating 0.106.0 → 0.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtins.d.ts +9 -0
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +10 -0
- package/dist/cel/analyze.d.ts +6 -6
- package/dist/cel/analyze.d.ts.map +1 -1
- package/dist/cel/analyze.js +138 -183
- package/dist/cel/compile.d.ts +50 -12
- package/dist/cel/compile.d.ts.map +1 -1
- package/dist/cel/compile.js +140 -48
- package/dist/cel/diagnose.d.ts +52 -56
- package/dist/cel/diagnose.d.ts.map +1 -1
- package/dist/cel/diagnose.js +69 -291
- package/dist/cel/environment.d.ts +33 -33
- package/dist/cel/environment.d.ts.map +1 -1
- package/dist/cel/environment.js +54 -80
- package/dist/cel/module-call.d.ts +68 -79
- package/dist/cel/module-call.d.ts.map +1 -1
- package/dist/cel/module-call.js +118 -194
- package/dist/cel/value-brands.d.ts +18 -0
- package/dist/cel/value-brands.d.ts.map +1 -0
- package/dist/cel/value-brands.js +33 -0
- package/dist/cel/verdict-codes.d.ts +40 -0
- package/dist/cel/verdict-codes.d.ts.map +1 -0
- package/dist/cel/verdict-codes.js +43 -0
- package/dist/engine.d.ts +18 -3
- package/dist/engine.d.ts.map +1 -1
- package/dist/engines/cel.d.ts +6 -5
- package/dist/engines/cel.d.ts.map +1 -1
- package/dist/engines/cel.js +57 -82
- package/dist/engines/hole-analysis.d.ts +7 -3
- package/dist/engines/hole-analysis.d.ts.map +1 -1
- package/dist/engines/hole-analysis.js +7 -1
- package/dist/engines/include.js +1 -1
- package/dist/engines/interpolate.d.ts.map +1 -1
- package/dist/engines/interpolate.js +17 -11
- package/dist/engines/module-path.js +1 -1
- package/dist/engines/sql.d.ts.map +1 -1
- package/dist/engines/sql.js +4 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -6
- package/package.json +6 -6
- package/src/builtins.ts +12 -0
- package/src/cel/analyze.ts +152 -193
- package/src/cel/compile.ts +166 -47
- package/src/cel/diagnose.ts +116 -370
- package/src/cel/environment.ts +66 -82
- package/src/cel/module-call.ts +129 -292
- package/src/cel/value-brands.ts +34 -0
- package/src/cel/verdict-codes.ts +66 -0
- package/src/engine.ts +19 -3
- package/src/engines/cel.ts +62 -95
- package/src/engines/hole-analysis.ts +16 -16
- package/src/engines/include.ts +1 -1
- package/src/engines/interpolate.ts +33 -19
- package/src/engines/module-path.ts +1 -1
- package/src/engines/sql.ts +11 -1
- package/src/index.ts +11 -11
- package/dist/cel/catalog.d.ts +0 -67
- package/dist/cel/catalog.d.ts.map +0 -1
- package/dist/cel/catalog.js +0 -1253
- package/dist/cel/value-identity.d.ts +0 -18
- package/dist/cel/value-identity.d.ts.map +0 -1
- package/dist/cel/value-identity.js +0 -25
- package/src/cel/catalog.ts +0 -1379
- package/src/cel/value-identity.ts +0 -34
package/dist/cel/catalog.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/** Host-injected functions that need platform APIs the templating package must
|
|
2
|
-
* not import directly (Node `crypto` / `Buffer`), keeping it browser-safe. The
|
|
3
|
-
* kernel supplies real implementations; the analyzer omits them (the stubs
|
|
4
|
-
* throw, since static analysis never executes these). */
|
|
5
|
-
export interface CelHandlers {
|
|
6
|
-
sha256: (s: string) => string;
|
|
7
|
-
md5: (s: string) => string;
|
|
8
|
-
sha1: (s: string) => string;
|
|
9
|
-
sha512: (s: string) => string;
|
|
10
|
-
hmac: (algorithm: string, key: string, message: string) => string;
|
|
11
|
-
base64Encode: (s: string) => string;
|
|
12
|
-
base64Decode: (s: string) => string;
|
|
13
|
-
json: (value: unknown) => string;
|
|
14
|
-
/** Join a relative path onto a base with the HOST's path rules. */
|
|
15
|
-
joinPath: (base: string, relative: string) => string;
|
|
16
|
-
}
|
|
17
|
-
export type CelFunctionCategory = "conversion" | "time" | "uuid" | "string" | "math" | "collection" | "json" | "encoding" | "hashing" | "formatting" | "null";
|
|
18
|
-
/** One entry in the CEL standard library — the single source of truth that both
|
|
19
|
-
* registers the function (`build`) and documents it (everything else). `telo
|
|
20
|
-
* cel functions` and `celFunctionCatalog()` read the metadata; `buildCelEnvironment`
|
|
21
|
-
* calls `build`. */
|
|
22
|
-
export interface CelFunctionDoc {
|
|
23
|
-
/** Bare function name (`nowIso`, `uuidv4`). */
|
|
24
|
-
readonly name: string;
|
|
25
|
-
/** Human-facing signature for docs (`nowIso(tz?): string`). May use `?` for
|
|
26
|
-
* optional args even though cel-js itself has no optional syntax. */
|
|
27
|
-
readonly signature: string;
|
|
28
|
-
/** Actual cel-js signatures to register — one per arity for an overloaded
|
|
29
|
-
* function. When omitted, `deriveSignatures(signature)` is used: if the
|
|
30
|
-
* signature contains `type?`-marked optional params (e.g. `fn(string?): T`),
|
|
31
|
-
* it auto-expands to one registration per arity. Set `register` explicitly
|
|
32
|
-
* only when the auto-derivation is insufficient. */
|
|
33
|
-
readonly register?: readonly string[];
|
|
34
|
-
readonly category: CelFunctionCategory;
|
|
35
|
-
readonly summary: string;
|
|
36
|
-
/** False → re-evaluates per call; in an `x-telo-eval: compile` field it bakes
|
|
37
|
-
* once at load. */
|
|
38
|
-
readonly deterministic: boolean;
|
|
39
|
-
/** Needs a `CelHandlers` implementation (Node `crypto` / `Buffer`); the
|
|
40
|
-
* analyzer's stub throws if such a function is actually evaluated. */
|
|
41
|
-
readonly hostBacked: boolean;
|
|
42
|
-
readonly build: (h: CelHandlers) => (...args: any[]) => unknown;
|
|
43
|
-
/**
|
|
44
|
-
* Check the arguments that were written as LITERALS, at analysis time.
|
|
45
|
-
*
|
|
46
|
-
* A type is all a signature can constrain, so a guard over a value —
|
|
47
|
-
* an unparseable format specifier, a decimal count out of range, a day length
|
|
48
|
-
* of zero, an unknown IANA zone — fires only when the expression is evaluated.
|
|
49
|
-
* That puts a defect the manifest states in plain sight behind a run, which is
|
|
50
|
-
* the opposite of what static analysis is for.
|
|
51
|
-
*
|
|
52
|
-
* `literals[i]` is the value of argument `i` when it was written as a literal,
|
|
53
|
-
* and `undefined` when it is an expression whose value is not statically
|
|
54
|
-
* known — so a checker MUST skip an `undefined` rather than judge it.
|
|
55
|
-
* Returns a message, or `undefined` when there is nothing to report.
|
|
56
|
-
*
|
|
57
|
-
* Implementations call the SAME guard the runtime calls, so the static and
|
|
58
|
-
* dynamic answers cannot drift into disagreement.
|
|
59
|
-
*/
|
|
60
|
-
readonly checkArgs?: (literals: readonly unknown[]) => string | undefined;
|
|
61
|
-
}
|
|
62
|
-
/** Public, build-free view of a catalog entry (for `--json` / docs). */
|
|
63
|
-
export type CelFunctionInfo = Omit<CelFunctionDoc, "build">;
|
|
64
|
-
export declare const CEL_FUNCTIONS: readonly CelFunctionDoc[];
|
|
65
|
-
/** Build-free catalog for the CLI / docs (`telo cel functions`). */
|
|
66
|
-
export declare function celFunctionCatalog(): CelFunctionInfo[];
|
|
67
|
-
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/cel/catalog.ts"],"names":[],"mappings":"AAKA;;;0DAG0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAClE,YAAY,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,YAAY,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,IAA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