@telorun/sdk 0.19.0 → 0.21.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/compiled-value.d.ts
CHANGED
|
@@ -5,7 +5,25 @@ export interface CompiledValue {
|
|
|
5
5
|
readonly __compiled: true;
|
|
6
6
|
/** Original expression source text (e.g. "env.PORT"), if available. */
|
|
7
7
|
readonly source?: string;
|
|
8
|
+
/** For an interpolated string ("a ${{ x }} b"), the ordered literal
|
|
9
|
+
* fragments and embedded expression segments before they are joined into a
|
|
10
|
+
* single string by `call()`. Absent for a bare single expression. Consumers
|
|
11
|
+
* that need each interpolation as a separate value (e.g. SQL bind
|
|
12
|
+
* parameters) read this instead of the joined `call()` result. */
|
|
13
|
+
readonly parts?: ReadonlyArray<string | CompiledValue>;
|
|
8
14
|
call(ctx: Record<string, unknown>): unknown;
|
|
9
15
|
}
|
|
10
16
|
export declare function isCompiledValue(v: unknown): v is CompiledValue;
|
|
17
|
+
/** The value a parameterized template (the `!sql` engine) evaluates to: literal
|
|
18
|
+
* text fragments plus the separately-evaluated value of each embedded `${{ }}`
|
|
19
|
+
* interpolation, with `fragments.length === values.length + 1`. A consumer emits
|
|
20
|
+
* its own placeholder between fragments and binds the values — never splicing
|
|
21
|
+
* them into the text. Single source of truth for the marker contract shared
|
|
22
|
+
* across the producing engine and any consuming controller. */
|
|
23
|
+
export interface ParameterizedSql {
|
|
24
|
+
readonly __teloParameterized: true;
|
|
25
|
+
readonly fragments: string[];
|
|
26
|
+
readonly values: unknown[];
|
|
27
|
+
}
|
|
28
|
+
export declare function isParameterizedSql(v: unknown): v is ParameterizedSql;
|
|
11
29
|
//# sourceMappingURL=compiled-value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiled-value.d.ts","sourceRoot":"","sources":["../src/compiled-value.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;CAC7C;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAE9D"}
|
|
1
|
+
{"version":3,"file":"compiled-value.d.ts","sourceRoot":"","sources":["../src/compiled-value.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;uEAImE;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,aAAa,CAAC,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;CAC7C;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAE9D;AAED;;;;;gEAKgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,gBAAgB,CAIpE"}
|
package/dist/compiled-value.js
CHANGED
package/package.json
CHANGED
package/src/compiled-value.ts
CHANGED
|
@@ -5,9 +5,33 @@ export interface CompiledValue {
|
|
|
5
5
|
readonly __compiled: true;
|
|
6
6
|
/** Original expression source text (e.g. "env.PORT"), if available. */
|
|
7
7
|
readonly source?: string;
|
|
8
|
+
/** For an interpolated string ("a ${{ x }} b"), the ordered literal
|
|
9
|
+
* fragments and embedded expression segments before they are joined into a
|
|
10
|
+
* single string by `call()`. Absent for a bare single expression. Consumers
|
|
11
|
+
* that need each interpolation as a separate value (e.g. SQL bind
|
|
12
|
+
* parameters) read this instead of the joined `call()` result. */
|
|
13
|
+
readonly parts?: ReadonlyArray<string | CompiledValue>;
|
|
8
14
|
call(ctx: Record<string, unknown>): unknown;
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export function isCompiledValue(v: unknown): v is CompiledValue {
|
|
12
18
|
return v !== null && typeof v === "object" && (v as any).__compiled === true;
|
|
13
19
|
}
|
|
20
|
+
|
|
21
|
+
/** The value a parameterized template (the `!sql` engine) evaluates to: literal
|
|
22
|
+
* text fragments plus the separately-evaluated value of each embedded `${{ }}`
|
|
23
|
+
* interpolation, with `fragments.length === values.length + 1`. A consumer emits
|
|
24
|
+
* its own placeholder between fragments and binds the values — never splicing
|
|
25
|
+
* them into the text. Single source of truth for the marker contract shared
|
|
26
|
+
* across the producing engine and any consuming controller. */
|
|
27
|
+
export interface ParameterizedSql {
|
|
28
|
+
readonly __teloParameterized: true;
|
|
29
|
+
readonly fragments: string[];
|
|
30
|
+
readonly values: unknown[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function isParameterizedSql(v: unknown): v is ParameterizedSql {
|
|
34
|
+
return (
|
|
35
|
+
v !== null && typeof v === "object" && (v as any).__teloParameterized === true
|
|
36
|
+
);
|
|
37
|
+
}
|