@telorun/sdk 0.54.0 → 0.56.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/dispatch-invoke-ref.js +1 -1
- package/dist/ref.d.ts +1 -1
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js +1 -1
- package/dist/resolve-ref-instance.d.ts +2 -2
- package/dist/resolve-ref-instance.js +2 -2
- package/dist/resource-context.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/dispatch-invoke-ref.ts +1 -1
- package/src/ref.ts +1 -1
- package/src/resolve-ref-instance.ts +2 -2
- package/src/resource-context.ts +1 -1
- package/src/types.ts +1 -1
|
@@ -12,7 +12,7 @@ import { getRefIdentity } from "./resource-instance.js";
|
|
|
12
12
|
* invocation context applies unchanged.
|
|
13
13
|
*/
|
|
14
14
|
export function resolveInvocableDispatcher(field, ctx, describe) {
|
|
15
|
-
const target = resolveRefInstance(field, ctx, isInvocableInstance, () => `${describe()}: 'invoke'`, "
|
|
15
|
+
const target = resolveRefInstance(field, ctx, isInvocableInstance, () => `${describe()}: 'invoke'`, "Telo.Invocable");
|
|
16
16
|
// Dispatch through the traced chokepoint needs the target's kind+name: from
|
|
17
17
|
// the `!ref` identity the kernel stamped at injection, else from the raw ref.
|
|
18
18
|
const id = getRefIdentity(target) ?? field;
|
package/dist/ref.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type Injected<T> = {
|
|
|
44
44
|
/** Returns a schema node that emits `x-telo-ref` for buildReferenceFieldMap and carries
|
|
45
45
|
* KindRef<T> as its TypeScript type. For TypeBox schemas use Type.Unsafe<KindRef<T>>(Ref(...)).
|
|
46
46
|
*
|
|
47
|
-
* @param ref
|
|
47
|
+
* @param ref The slot's `x-telo-ref` constraint, e.g. "Sql.Connection" or "Telo.Invocable" */
|
|
48
48
|
export declare const Ref: <T = ResourceInstance>(ref: string) => KindRef<T>;
|
|
49
49
|
/** Returns a schema node that emits `x-telo-scope` for buildReferenceFieldMap and carries
|
|
50
50
|
* ScopeRef as its TypeScript type. For TypeBox schemas use Type.Unsafe<ScopeRef>(Scope(...)).
|
package/dist/ref.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../src/ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;;;;;gFAOgF;AAChF,MAAM,WAAW,OAAO,CAAC,CAAC,GAAG,gBAAgB;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;CACrB;AAED;6DAC6D;AAC7D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;CACxB;AAED,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B;;;;;uEAKmE;IACnE,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC7D;AAED;oFACoF;AACpF,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC7D;AAED;;;;qCAIqC;AACrC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GACzC,CAAC,GACD,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE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C,MAAM,CAAC,CAAC,EAAE,GAC7B,CAAC,EAAE,GACH,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAChC,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GACrC,CAAC,CAAC,CAAC,CAAC;CACb,CAAC;AAEF;;;+FAG+F;AAC/F,eAAO,MAAM,GAAG,GAAI,CAAC,GAAG,gBAAgB,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,CAAC,CACf,CAAC;AAEnD;;;;wEAIwE;AACxE,eAAO,MAAM,KAAK,GAAI,gBAAgB,MAAM,GAAG,MAAM,EAAE,KAAG,QACG,CAAC"}
|
package/dist/ref.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Returns a schema node that emits `x-telo-ref` for buildReferenceFieldMap and carries
|
|
2
2
|
* KindRef<T> as its TypeScript type. For TypeBox schemas use Type.Unsafe<KindRef<T>>(Ref(...)).
|
|
3
3
|
*
|
|
4
|
-
* @param ref
|
|
4
|
+
* @param ref The slot's `x-telo-ref` constraint, e.g. "Sql.Connection" or "Telo.Invocable" */
|
|
5
5
|
export const Ref = (ref) => ({ "x-telo-ref": ref });
|
|
6
6
|
/** Returns a schema node that emits `x-telo-scope` for buildReferenceFieldMap and carries
|
|
7
7
|
* ScopeRef as its TypeScript type. For TypeBox schemas use Type.Unsafe<ScopeRef>(Scope(...)).
|
|
@@ -26,13 +26,13 @@ export interface RefResolveContext {
|
|
|
26
26
|
* on the methods the caller will actually invoke, so a mis-wired ref fails with a
|
|
27
27
|
* clear message here rather than as `undefined is not a function` later.
|
|
28
28
|
* `describe` labels the owning resource and slot; `expects` names the contract
|
|
29
|
-
* the slot wants — the slot's own `x-telo-ref` string (`
|
|
29
|
+
* the slot wants — the slot's own `x-telo-ref` string (`Cache.Store`) — so
|
|
30
30
|
* the message says what was missing, not just that something was.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* const store = resolveRefInstance(
|
|
34
34
|
* this.resource.store, this.ctx, isKvStore,
|
|
35
|
-
* () => `Idempotency.Once "${name}": 'store'`, "
|
|
35
|
+
* () => `Idempotency.Once "${name}": 'store'`, "KvStore.Store",
|
|
36
36
|
* );
|
|
37
37
|
*/
|
|
38
38
|
export declare function resolveRefInstance<T>(value: unknown, ctx: RefResolveContext, guard: (candidate: unknown) => candidate is T, describe: () => string, expects?: string): T;
|
|
@@ -22,13 +22,13 @@ import { RuntimeError } from "./types.js";
|
|
|
22
22
|
* on the methods the caller will actually invoke, so a mis-wired ref fails with a
|
|
23
23
|
* clear message here rather than as `undefined is not a function` later.
|
|
24
24
|
* `describe` labels the owning resource and slot; `expects` names the contract
|
|
25
|
-
* the slot wants — the slot's own `x-telo-ref` string (`
|
|
25
|
+
* the slot wants — the slot's own `x-telo-ref` string (`Cache.Store`) — so
|
|
26
26
|
* the message says what was missing, not just that something was.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* const store = resolveRefInstance(
|
|
30
30
|
* this.resource.store, this.ctx, isKvStore,
|
|
31
|
-
* () => `Idempotency.Once "${name}": 'store'`, "
|
|
31
|
+
* () => `Idempotency.Once "${name}": 'store'`, "KvStore.Store",
|
|
32
32
|
* );
|
|
33
33
|
*/
|
|
34
34
|
export function resolveRefInstance(value, ctx, guard, describe, expects) {
|
|
@@ -95,7 +95,7 @@ export interface ResourceContext extends ControllerContext {
|
|
|
95
95
|
* Resolve a `!ref` config field to a live instance of `T`. See
|
|
96
96
|
* {@link resolveRefInstance} — this is the same resolution, reached through
|
|
97
97
|
* the context a controller already holds. `expects` names the contract the
|
|
98
|
-
* slot wants — its `x-telo-ref` string (`
|
|
98
|
+
* slot wants — its `x-telo-ref` string (`Cache.Store`) — so a mis-wire
|
|
99
99
|
* says what was missing.
|
|
100
100
|
*/
|
|
101
101
|
resolveRef<T>(value: unknown, guard: (candidate: unknown) => candidate is T, describe: () => string, expects?: string): T;
|
package/dist/types.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export interface ResourceDefinition {
|
|
|
45
45
|
* Resolved against the declaring file's `Telo.Import` declarations — same pattern as
|
|
46
46
|
* kind prefixes (`kind: Http.Api`). Orthogonal to `capability` (lifecycle role); the
|
|
47
47
|
* analyzer populates its `extendedBy` index from this field so references typed via
|
|
48
|
-
* `x-telo-ref:
|
|
48
|
+
* `x-telo-ref: <Alias>.<Abstract>` accept this definition. */
|
|
49
49
|
extends?: string;
|
|
50
50
|
/** Type reference (named, inline `Type.JsonSchema`, or raw schema) for the
|
|
51
51
|
* resource's `invoke()` inputs / outputs. Read by the analyzer's CEL typing
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;0CAE0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5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"
|
|
41
|
+
"Telo.Invocable",
|
|
42
42
|
);
|
|
43
43
|
// Dispatch through the traced chokepoint needs the target's kind+name: from
|
|
44
44
|
// the `!ref` identity the kernel stamped at injection, else from the raw ref.
|
package/src/ref.ts
CHANGED
|
@@ -56,7 +56,7 @@ export type Injected<T> = {
|
|
|
56
56
|
/** Returns a schema node that emits `x-telo-ref` for buildReferenceFieldMap and carries
|
|
57
57
|
* KindRef<T> as its TypeScript type. For TypeBox schemas use Type.Unsafe<KindRef<T>>(Ref(...)).
|
|
58
58
|
*
|
|
59
|
-
* @param ref
|
|
59
|
+
* @param ref The slot's `x-telo-ref` constraint, e.g. "Sql.Connection" or "Telo.Invocable" */
|
|
60
60
|
export const Ref = <T = ResourceInstance>(ref: string): KindRef<T> =>
|
|
61
61
|
({ "x-telo-ref": ref } as unknown as KindRef<T>);
|
|
62
62
|
|
|
@@ -30,13 +30,13 @@ export interface RefResolveContext {
|
|
|
30
30
|
* on the methods the caller will actually invoke, so a mis-wired ref fails with a
|
|
31
31
|
* clear message here rather than as `undefined is not a function` later.
|
|
32
32
|
* `describe` labels the owning resource and slot; `expects` names the contract
|
|
33
|
-
* the slot wants — the slot's own `x-telo-ref` string (`
|
|
33
|
+
* the slot wants — the slot's own `x-telo-ref` string (`Cache.Store`) — so
|
|
34
34
|
* the message says what was missing, not just that something was.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* const store = resolveRefInstance(
|
|
38
38
|
* this.resource.store, this.ctx, isKvStore,
|
|
39
|
-
* () => `Idempotency.Once "${name}": 'store'`, "
|
|
39
|
+
* () => `Idempotency.Once "${name}": 'store'`, "KvStore.Store",
|
|
40
40
|
* );
|
|
41
41
|
*/
|
|
42
42
|
export function resolveRefInstance<T>(
|
package/src/resource-context.ts
CHANGED
|
@@ -107,7 +107,7 @@ export interface ResourceContext extends ControllerContext {
|
|
|
107
107
|
* Resolve a `!ref` config field to a live instance of `T`. See
|
|
108
108
|
* {@link resolveRefInstance} — this is the same resolution, reached through
|
|
109
109
|
* the context a controller already holds. `expects` names the contract the
|
|
110
|
-
* slot wants — its `x-telo-ref` string (`
|
|
110
|
+
* slot wants — its `x-telo-ref` string (`Cache.Store`) — so a mis-wire
|
|
111
111
|
* says what was missing.
|
|
112
112
|
*/
|
|
113
113
|
resolveRef<T>(
|
package/src/types.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface ResourceDefinition {
|
|
|
51
51
|
* Resolved against the declaring file's `Telo.Import` declarations — same pattern as
|
|
52
52
|
* kind prefixes (`kind: Http.Api`). Orthogonal to `capability` (lifecycle role); the
|
|
53
53
|
* analyzer populates its `extendedBy` index from this field so references typed via
|
|
54
|
-
* `x-telo-ref:
|
|
54
|
+
* `x-telo-ref: <Alias>.<Abstract>` accept this definition. */
|
|
55
55
|
extends?: string;
|
|
56
56
|
/** Type reference (named, inline `Type.JsonSchema`, or raw schema) for the
|
|
57
57
|
* resource's `invoke()` inputs / outputs. Read by the analyzer's CEL typing
|