@telorun/sdk 0.33.0 → 0.36.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 +6 -0
- package/dist/compiled-value.d.ts.map +1 -1
- package/dist/evaluation-context.d.ts +5 -0
- package/dist/evaluation-context.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/type-schema-ref.d.ts +28 -0
- package/dist/type-schema-ref.d.ts.map +1 -0
- package/dist/type-schema-ref.js +31 -0
- package/package.json +1 -1
- package/src/compiled-value.ts +6 -0
- package/src/evaluation-context.ts +5 -0
- package/src/index.ts +1 -0
- package/src/type-schema-ref.ts +38 -0
package/dist/compiled-value.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ export interface CompiledValue {
|
|
|
11
11
|
* that need each interpolation as a separate value (e.g. SQL bind
|
|
12
12
|
* parameters) read this instead of the joined `call()` result. */
|
|
13
13
|
readonly parts?: ReadonlyArray<string | CompiledValue>;
|
|
14
|
+
/** Root variable identifiers the expression reads, extracted from the CEL AST
|
|
15
|
+
* at compile time (e.g. `["self", "request"]` for
|
|
16
|
+
* `self.table + request.id`). Lets consumers decide what scope an expression
|
|
17
|
+
* needs without re-parsing or string-matching the source. Absent for engines
|
|
18
|
+
* that don't surface an AST. */
|
|
19
|
+
readonly refs?: readonly string[];
|
|
14
20
|
call(ctx: Record<string, unknown>): unknown;
|
|
15
21
|
}
|
|
16
22
|
export declare function isCompiledValue(v: unknown): v is CompiledValue;
|
|
@@ -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,C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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"}
|
|
@@ -85,6 +85,11 @@ export interface EvaluationContext {
|
|
|
85
85
|
hasManifest(name: string): boolean;
|
|
86
86
|
registerManifest(resource: ResourceManifest): void;
|
|
87
87
|
spawnChild<T extends EvaluationContext>(child: T): T;
|
|
88
|
+
/** Spawn a fresh child context attached to this one — the isolated scope a
|
|
89
|
+
* templated definition registers its `resources:` into. Rooted here so child
|
|
90
|
+
* kinds/refs resolve against THIS context's imports (the defining library),
|
|
91
|
+
* not the consumer's. */
|
|
92
|
+
spawnChildContext(): EvaluationContext;
|
|
88
93
|
initializeResources(): Promise<void>;
|
|
89
94
|
withManifests<T>(manifests: any[], fn: () => T): T;
|
|
90
95
|
createScopeHandle(manifests: ResourceManifest[]): ScopeHandle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation-context.d.ts","sourceRoot":"","sources":["../src/evaluation-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,GAAG,EACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA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E,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./cancellation.js";
|
|
|
2
2
|
export * from "./compiled-value.js";
|
|
3
3
|
export * from "./capabilities/invokable.js";
|
|
4
4
|
export * from "./ref.js";
|
|
5
|
+
export * from "./type-schema-ref.js";
|
|
5
6
|
export * from "./invoke-step.js";
|
|
6
7
|
export * from "./dispatch-invoke-ref.js";
|
|
7
8
|
export * from "./capabilities/provider.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./cancellation.js";
|
|
|
2
2
|
export * from "./compiled-value.js";
|
|
3
3
|
export * from "./capabilities/invokable.js";
|
|
4
4
|
export * from "./ref.js";
|
|
5
|
+
export * from "./type-schema-ref.js";
|
|
5
6
|
export * from "./invoke-step.js";
|
|
6
7
|
export * from "./dispatch-invoke-ref.js";
|
|
7
8
|
export * from "./capabilities/provider.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-scoped schema references for JSON Schema `$ref`.
|
|
3
|
+
*
|
|
4
|
+
* A `Type.JsonSchema` (or any `Telo.Type`) resource registers its schema under a
|
|
5
|
+
* canonical URI `$id` of `telo://<module>/<typeName>`, so other schemas can
|
|
6
|
+
* reference it with a standard JSON Schema `$ref`. Authors write the reference
|
|
7
|
+
* through an import — `telo://Self/<typeName>` for the declaring module's own
|
|
8
|
+
* type, or `telo://<Alias>/<typeName>` for an imported module's type — and the
|
|
9
|
+
* loader rewrites the authority (`Self` / alias) to the resolved module name.
|
|
10
|
+
* The version is carried by the `imports:` entry, never by the URI: only the
|
|
11
|
+
* pinned version is ever loaded, so the canonical id stays version-free.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TELO_TYPE_SCHEME = "telo://";
|
|
14
|
+
/** The canonical, alias-resolved `$id` a named type schema is registered under. */
|
|
15
|
+
export declare function canonicalTypeSchemaId(moduleName: string, typeName: string): string;
|
|
16
|
+
/** Parsed parts of a `telo://<authority>/<typeName>` schema reference. */
|
|
17
|
+
export interface TeloTypeRef {
|
|
18
|
+
authority: string;
|
|
19
|
+
typeName: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse a `telo://<authority>/<typeName>` schema `$ref`. Returns null for any
|
|
23
|
+
* other string — notably fragment-bearing built-ins like
|
|
24
|
+
* `telo://manifest#/$defs/ResourceRef`, which carry no `authority/type` path and
|
|
25
|
+
* must be left untouched.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseTeloTypeRef(ref: unknown): TeloTypeRef | null;
|
|
28
|
+
//# sourceMappingURL=type-schema-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-schema-ref.d.ts","sourceRoot":"","sources":["../src/type-schema-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElF;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAKjE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-scoped schema references for JSON Schema `$ref`.
|
|
3
|
+
*
|
|
4
|
+
* A `Type.JsonSchema` (or any `Telo.Type`) resource registers its schema under a
|
|
5
|
+
* canonical URI `$id` of `telo://<module>/<typeName>`, so other schemas can
|
|
6
|
+
* reference it with a standard JSON Schema `$ref`. Authors write the reference
|
|
7
|
+
* through an import — `telo://Self/<typeName>` for the declaring module's own
|
|
8
|
+
* type, or `telo://<Alias>/<typeName>` for an imported module's type — and the
|
|
9
|
+
* loader rewrites the authority (`Self` / alias) to the resolved module name.
|
|
10
|
+
* The version is carried by the `imports:` entry, never by the URI: only the
|
|
11
|
+
* pinned version is ever loaded, so the canonical id stays version-free.
|
|
12
|
+
*/
|
|
13
|
+
export const TELO_TYPE_SCHEME = "telo://";
|
|
14
|
+
/** The canonical, alias-resolved `$id` a named type schema is registered under. */
|
|
15
|
+
export function canonicalTypeSchemaId(moduleName, typeName) {
|
|
16
|
+
return `${TELO_TYPE_SCHEME}${moduleName}/${typeName}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Parse a `telo://<authority>/<typeName>` schema `$ref`. Returns null for any
|
|
20
|
+
* other string — notably fragment-bearing built-ins like
|
|
21
|
+
* `telo://manifest#/$defs/ResourceRef`, which carry no `authority/type` path and
|
|
22
|
+
* must be left untouched.
|
|
23
|
+
*/
|
|
24
|
+
export function parseTeloTypeRef(ref) {
|
|
25
|
+
if (typeof ref !== "string")
|
|
26
|
+
return null;
|
|
27
|
+
const match = /^telo:\/\/([^/#]+)\/([^#/]+)$/.exec(ref);
|
|
28
|
+
if (!match)
|
|
29
|
+
return null;
|
|
30
|
+
return { authority: match[1], typeName: match[2] };
|
|
31
|
+
}
|
package/package.json
CHANGED
package/src/compiled-value.ts
CHANGED
|
@@ -11,6 +11,12 @@ export interface CompiledValue {
|
|
|
11
11
|
* that need each interpolation as a separate value (e.g. SQL bind
|
|
12
12
|
* parameters) read this instead of the joined `call()` result. */
|
|
13
13
|
readonly parts?: ReadonlyArray<string | CompiledValue>;
|
|
14
|
+
/** Root variable identifiers the expression reads, extracted from the CEL AST
|
|
15
|
+
* at compile time (e.g. `["self", "request"]` for
|
|
16
|
+
* `self.table + request.id`). Lets consumers decide what scope an expression
|
|
17
|
+
* needs without re-parsing or string-matching the source. Absent for engines
|
|
18
|
+
* that don't surface an AST. */
|
|
19
|
+
readonly refs?: readonly string[];
|
|
14
20
|
call(ctx: Record<string, unknown>): unknown;
|
|
15
21
|
}
|
|
16
22
|
|
|
@@ -118,6 +118,11 @@ export interface EvaluationContext {
|
|
|
118
118
|
hasManifest(name: string): boolean;
|
|
119
119
|
registerManifest(resource: ResourceManifest): void;
|
|
120
120
|
spawnChild<T extends EvaluationContext>(child: T): T;
|
|
121
|
+
/** Spawn a fresh child context attached to this one — the isolated scope a
|
|
122
|
+
* templated definition registers its `resources:` into. Rooted here so child
|
|
123
|
+
* kinds/refs resolve against THIS context's imports (the defining library),
|
|
124
|
+
* not the consumer's. */
|
|
125
|
+
spawnChildContext(): EvaluationContext;
|
|
121
126
|
initializeResources(): Promise<void>;
|
|
122
127
|
withManifests<T>(manifests: any[], fn: () => T): T;
|
|
123
128
|
createScopeHandle(manifests: ResourceManifest[]): ScopeHandle;
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./cancellation.js";
|
|
|
2
2
|
export * from "./compiled-value.js";
|
|
3
3
|
export * from "./capabilities/invokable.js";
|
|
4
4
|
export * from "./ref.js";
|
|
5
|
+
export * from "./type-schema-ref.js";
|
|
5
6
|
export * from "./invoke-step.js";
|
|
6
7
|
export * from "./dispatch-invoke-ref.js";
|
|
7
8
|
export * from "./capabilities/provider.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-scoped schema references for JSON Schema `$ref`.
|
|
3
|
+
*
|
|
4
|
+
* A `Type.JsonSchema` (or any `Telo.Type`) resource registers its schema under a
|
|
5
|
+
* canonical URI `$id` of `telo://<module>/<typeName>`, so other schemas can
|
|
6
|
+
* reference it with a standard JSON Schema `$ref`. Authors write the reference
|
|
7
|
+
* through an import — `telo://Self/<typeName>` for the declaring module's own
|
|
8
|
+
* type, or `telo://<Alias>/<typeName>` for an imported module's type — and the
|
|
9
|
+
* loader rewrites the authority (`Self` / alias) to the resolved module name.
|
|
10
|
+
* The version is carried by the `imports:` entry, never by the URI: only the
|
|
11
|
+
* pinned version is ever loaded, so the canonical id stays version-free.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const TELO_TYPE_SCHEME = "telo://";
|
|
15
|
+
|
|
16
|
+
/** The canonical, alias-resolved `$id` a named type schema is registered under. */
|
|
17
|
+
export function canonicalTypeSchemaId(moduleName: string, typeName: string): string {
|
|
18
|
+
return `${TELO_TYPE_SCHEME}${moduleName}/${typeName}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Parsed parts of a `telo://<authority>/<typeName>` schema reference. */
|
|
22
|
+
export interface TeloTypeRef {
|
|
23
|
+
authority: string;
|
|
24
|
+
typeName: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Parse a `telo://<authority>/<typeName>` schema `$ref`. Returns null for any
|
|
29
|
+
* other string — notably fragment-bearing built-ins like
|
|
30
|
+
* `telo://manifest#/$defs/ResourceRef`, which carry no `authority/type` path and
|
|
31
|
+
* must be left untouched.
|
|
32
|
+
*/
|
|
33
|
+
export function parseTeloTypeRef(ref: unknown): TeloTypeRef | null {
|
|
34
|
+
if (typeof ref !== "string") return null;
|
|
35
|
+
const match = /^telo:\/\/([^/#]+)\/([^#/]+)$/.exec(ref);
|
|
36
|
+
if (!match) return null;
|
|
37
|
+
return { authority: match[1], typeName: match[2] };
|
|
38
|
+
}
|