@requence/service 0.8.2-edge.1156 → 0.8.2-edge.1157
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/README.md +163 -0
- package/build/index.js +289 -50
- package/build/index.js.map +13 -11
- package/build/types/helpers/src/utils/requenceCallback.d.ts +153 -3
- package/build/types/helpers/src/utils/requenceCallback.d.ts.map +1 -1
- package/build/types/service/src/boundary.d.ts +9 -0
- package/build/types/service/src/boundary.d.ts.map +1 -1
- package/build/types/service/src/callbackGrowth.d.ts +102 -0
- package/build/types/service/src/callbackGrowth.d.ts.map +1 -0
- package/build/types/service/src/createAmqpConnection.d.ts +1 -0
- package/build/types/service/src/createAmqpConnection.d.ts.map +1 -1
- package/build/types/service/src/durableCallback.d.ts +223 -0
- package/build/types/service/src/durableCallback.d.ts.map +1 -0
- package/build/types/service/src/helpers.d.ts +6 -5
- package/build/types/service/src/helpers.d.ts.map +1 -1
- package/build/types/service/src/index.d.ts +1 -0
- package/build/types/service/src/index.d.ts.map +1 -1
- package/build/types/service/src/surfaceHandler.d.ts.map +1 -1
- package/build/types/service/src/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,167 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The reference tag of a **callback** — a function a service emitted alongside
|
|
4
|
+
* its data, which a downstream node may invoke back at the emitting service.
|
|
5
|
+
*
|
|
6
|
+
* One tag, not one per lifetime: what a consumer receives is an invokable
|
|
7
|
+
* function either way, and the position it addresses in the node's declared
|
|
8
|
+
* output schema is the same. Deliberately still separate from a
|
|
9
|
+
* `RequenceHandler` (`surfaceHandler.ts` says why in both directions).
|
|
10
|
+
*/
|
|
11
|
+
export declare const REQUENCE_CALLBACK_TAG = "RequenceCallback";
|
|
12
|
+
/**
|
|
13
|
+
* How long a callback can be reached, decided by **where the function was
|
|
14
|
+
* written** — the same rule surfaces established for handler props (#59), and
|
|
15
|
+
* the only thing that actually bounds the closure's life:
|
|
16
|
+
*
|
|
17
|
+
* - `connection` — a function written inline in the handler. It closes over the
|
|
18
|
+
* running message, so only that process can serve it and it dies when the
|
|
19
|
+
* delivery settles. Addressed by the registering connection plus an id in its
|
|
20
|
+
* registry.
|
|
21
|
+
* - `durable` — a function declared once at module scope with
|
|
22
|
+
* `createDurableCallback`, addressed by the stable name it was declared under
|
|
23
|
+
* and carrying the per-emission data the author *bound* to it instead of
|
|
24
|
+
* capturing. It names no connection at all, so any instance of the service
|
|
25
|
+
* version can run it, now or after a redeploy (#147).
|
|
26
|
+
*
|
|
27
|
+
* `outputName`/`propertyPath` ride on every arm. The durable arm does not need
|
|
28
|
+
* them to be *routed*, but they are what the operator's existing invocation-
|
|
29
|
+
* argument validation addresses — same reasoning as `uiId`/`path` on both
|
|
30
|
+
* surface-handler arms.
|
|
31
|
+
*/
|
|
32
|
+
declare const callbackObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
__REQUENCE_type: z.ZodLiteral<"RequenceCallback">;
|
|
34
|
+
lifetime: z.ZodLiteral<"connection">;
|
|
4
35
|
outputName: z.ZodNullable<z.ZodString>;
|
|
5
36
|
propertyPath: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
37
|
+
sourceId: z.ZodString;
|
|
6
38
|
callbackId: z.ZodUUID;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
40
|
__REQUENCE_type: z.ZodLiteral<"RequenceCallback">;
|
|
8
|
-
|
|
41
|
+
lifetime: z.ZodLiteral<"durable">;
|
|
42
|
+
outputName: z.ZodNullable<z.ZodString>;
|
|
43
|
+
propertyPath: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
nodeId: z.ZodString;
|
|
46
|
+
bound: z.ZodOptional<z.ZodUnknown>;
|
|
47
|
+
}, z.core.$strip>], "lifetime">;
|
|
9
48
|
export type CallbackObject = z.infer<typeof callbackObjectSchema>;
|
|
49
|
+
export type CallbackLifetime = CallbackObject['lifetime'];
|
|
10
50
|
export declare function isCallbackObject(data: unknown): data is CallbackObject;
|
|
11
51
|
export type RequenceCallback<T> = (arg: T) => void;
|
|
12
52
|
export type WrappedRequenceCallback<T> = RequenceCallback<T> & {
|
|
13
53
|
response(): Promise<T>;
|
|
14
54
|
};
|
|
15
55
|
export declare function createCallback<T>(callback?: (arg: T) => void): WrappedRequenceCallback<T>;
|
|
56
|
+
/**
|
|
57
|
+
* What a `.for(bound)` reference carries before the boundary completes it: the
|
|
58
|
+
* declaration's name and the data bound to this emission. The position
|
|
59
|
+
* (`outputName`/`propertyPath`) is added where it is known — the value walk —
|
|
60
|
+
* exactly as it is for the connection arm.
|
|
61
|
+
*/
|
|
62
|
+
export interface DurableCallbackBinding {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly bound: unknown;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Mints the value an author emits in place of a closure — the thing
|
|
68
|
+
* `createDurableCallback(...).for(bound)` returns (#147).
|
|
69
|
+
*
|
|
70
|
+
* It is a **function** carrying the binding on a symbol, rather than the wire
|
|
71
|
+
* object it will become, for two reasons that both come from the transformer:
|
|
72
|
+
*
|
|
73
|
+
* - The egress walk only offers *complex* values to a handler, and a plain
|
|
74
|
+
* object is traversable structure — a literal reference would be walked
|
|
75
|
+
* straight through and emitted without the `outputName`/`propertyPath` the
|
|
76
|
+
* operator validates against, which no schema parse downstream would accept.
|
|
77
|
+
* A function is complex, and the callback handler already claims every one.
|
|
78
|
+
* - The walk memoizes object-identity values at their *first* path, so one
|
|
79
|
+
* reference reused at two positions would carry the wrong `propertyPath` for
|
|
80
|
+
* the second. Functions bypass that memo by design.
|
|
81
|
+
*
|
|
82
|
+
* It also matches the type it is cast to: the property a consumer reads is
|
|
83
|
+
* declared `RequenceCallback<Arg>`, and a consumer calls it. Calling it *here*,
|
|
84
|
+
* in the emitting service, is the author's mistake — a durable callback runs
|
|
85
|
+
* where the invocation is delivered, never inline — so it says so rather than
|
|
86
|
+
* doing nothing.
|
|
87
|
+
*/
|
|
88
|
+
export declare function createDurableCallbackReference<Arg>(binding: DurableCallbackBinding): RequenceCallback<Arg>;
|
|
89
|
+
/**
|
|
90
|
+
* The binding a value carries, or `undefined` when it is an ordinary function —
|
|
91
|
+
* which is how the callback handler tells the two lifetimes apart on egress.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readDurableCallbackBinding(value: unknown): DurableCallbackBinding | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The per-version **callbacks queue**: where a durable invocation waits until
|
|
96
|
+
* some instance of that service version consumes it.
|
|
97
|
+
*
|
|
98
|
+
* Derived from the version's dispatch queue rather than composed from the
|
|
99
|
+
* service and version names, for the reason `serviceHandlerQueueName` is: the
|
|
100
|
+
* two can then never drift, and a dev-overlay connection — which consumes a
|
|
101
|
+
* rewritten dispatch queue — gets a callbacks queue of its own for free.
|
|
102
|
+
*/
|
|
103
|
+
export declare function serviceCallbackQueueName(dispatchQueue: string): string;
|
|
104
|
+
export declare function isDevOverlayCallbackQueue(queueName: string): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* How long a durable invocation may wait in the callbacks queue before the
|
|
107
|
+
* broker drops it.
|
|
108
|
+
*
|
|
109
|
+
* The queue is **not a mailbox**. A callback invoked today and run whenever
|
|
110
|
+
* somebody next deploys is the silent-effect outcome #116 removed for surfaces,
|
|
111
|
+
* and it is worse here: nothing checks reachability before a graph calls
|
|
112
|
+
* `context.input.delete()`, so the TTL is the only bound there is. All it has to
|
|
113
|
+
* bridge is a rolling redeploy, a scale-to-zero that started a moment ago or a
|
|
114
|
+
* replica that took the invocation and died — the same seconds the surface
|
|
115
|
+
* handler queue bridges, hence the same number.
|
|
116
|
+
*
|
|
117
|
+
* Expiry is not a drop: the queue dead-letters to `error`, so an expired
|
|
118
|
+
* invocation comes back to the operator carrying its own task and is reported on
|
|
119
|
+
* the node the callback belongs to.
|
|
120
|
+
*/
|
|
121
|
+
export declare const DURABLE_CALLBACK_INVOCATION_TTL_MS = 60000;
|
|
122
|
+
/**
|
|
123
|
+
* The callbacks queue's declaration arguments, as **one** object, because two
|
|
124
|
+
* parties declare that queue — ui/backend's provisioner and the service SDK on
|
|
125
|
+
* connect — and a broker answers a mismatch with a 406 that kills the declaring
|
|
126
|
+
* channel. Anything short of a shared literal is a service that will not start.
|
|
127
|
+
*
|
|
128
|
+
* Note for whoever changes this: declaring a queue with a dead-letter exchange
|
|
129
|
+
* needs WRITE permission on that exchange, so the service AMQP user is granted
|
|
130
|
+
* it (`assertService`). It costs nothing — `error` is an internal exchange and
|
|
131
|
+
* the broker refuses a client publish to one however the permissions read.
|
|
132
|
+
*/
|
|
133
|
+
export declare const DURABLE_CALLBACK_QUEUE_ARGUMENTS: {
|
|
134
|
+
readonly messageTtl: 60000;
|
|
135
|
+
readonly deadLetterExchange: 'error';
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* The header a durable callback invocation is stamped with, for the same reason
|
|
139
|
+
* a durable surface handler invocation carries one
|
|
140
|
+
* (`SURFACE_HANDLER_INVOCATION_HEADER`): it is published `mandatory` into the
|
|
141
|
+
* `service` exchange, so one whose queue is gone comes back to the operator
|
|
142
|
+
* looking like any other undeliverable service message — and every other arm
|
|
143
|
+
* there fails the node.
|
|
144
|
+
*
|
|
145
|
+
* A callback the graph chose to call is not the node's failure, so this is what
|
|
146
|
+
* tells that consumer to *report* instead. A header rather than the routing key's
|
|
147
|
+
* `-callbacks` suffix, which a service actually named `…-callbacks` would forge.
|
|
148
|
+
*/
|
|
149
|
+
export declare const DURABLE_CALLBACK_INVOCATION_HEADER = "durableCallbackInvocation";
|
|
150
|
+
/**
|
|
151
|
+
* One durable callback invocation, as it travels on the queue above.
|
|
152
|
+
*
|
|
153
|
+
* `name` is the whole address: the consuming instance looks it up in the
|
|
154
|
+
* process-global registry `createDurableCallback` writes and calls what it
|
|
155
|
+
* finds. Everything else is either the handler's arguments or the way back.
|
|
156
|
+
*/
|
|
157
|
+
export declare const durableCallbackInvocationSchema: z.ZodObject<{
|
|
158
|
+
taskId: z.ZodUUID;
|
|
159
|
+
nodeId: z.ZodString;
|
|
160
|
+
name: z.ZodString;
|
|
161
|
+
bound: z.ZodOptional<z.ZodUnknown>;
|
|
162
|
+
arg: z.ZodOptional<z.ZodUnknown>;
|
|
163
|
+
configuration: z.ZodOptional<z.ZodUnknown>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
export type DurableCallbackInvocation = z.infer<typeof durableCallbackInvocationSchema>;
|
|
16
166
|
export {};
|
|
17
167
|
//# sourceMappingURL=requenceCallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requenceCallback.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/requenceCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,QAAA,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"requenceCallback.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/requenceCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,qBAAqB,CAAA;AAIvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;+BAoDxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAEzD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,cAAc,CAEtE;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC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 export interface OutboundBoundaryOptions {
|
|
|
21
21
|
* answer for the deferred path, which has no dispatch to echo.
|
|
22
22
|
*/
|
|
23
23
|
wireCodec?: WireCodec;
|
|
24
|
+
/**
|
|
25
|
+
* The node this boundary emits for, as the operator dispatched it
|
|
26
|
+
* (`options.nodeId`, and the defer key on the `act()` path).
|
|
27
|
+
*
|
|
28
|
+
* Constant for the whole message, which is why it sits here rather than in
|
|
29
|
+
* `OutboundSendOptions`: it is the address a **durable** callback reference is
|
|
30
|
+
* routed and configured by (#150), not something one emission decides.
|
|
31
|
+
*/
|
|
32
|
+
nodeId?: string;
|
|
24
33
|
signal?: AbortSignal;
|
|
25
34
|
fetch?: typeof globalThis.fetch;
|
|
26
35
|
/** Sink for best-effort degradation notices. Defaults to `logger.warn`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../../../src/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAI1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAqB,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAcjE,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3D,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,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A;CACxB;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,uBAAuB,GAC5B,gBAAgB,CAqGlB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IAC/B,kEAAkE;IAClE,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IAC7D;;;;OAIG;IACH,WAAW,CAAC,EAAE;QAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,CAAA;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;CAC9D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,sBAA2B,UAE7D,OAAO,SACP,qBAAqB,KAC1B,OAAO,CAAC,OAAO,CAAC,CAiBpB"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { TransformPath } from '@requence/transformer';
|
|
2
|
+
/**
|
|
3
|
+
* Where the first warning lands under a **dev overlay**.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately low, and that is the point of the whole feature (#151): a hundred
|
|
6
|
+
* emissions in a `bun run dev` session already means a generator is minting
|
|
7
|
+
* closures in a loop, and catching it there is worth far more than catching it in
|
|
8
|
+
* production. A one-shot fan-out never reaches it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEV_OVERLAY_FIRST_WARNING = 100;
|
|
11
|
+
/**
|
|
12
|
+
* Where the first warning lands for a **deployed** version.
|
|
13
|
+
*
|
|
14
|
+
* A thousand entries is ~200 KB of registry — well below any real concern, and
|
|
15
|
+
* far above any legitimate one-shot fan-out. It is the step count, not this
|
|
16
|
+
* number, that makes the growth visible.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DEPLOYED_FIRST_WARNING = 1000;
|
|
19
|
+
export interface CallbackGrowthOptions {
|
|
20
|
+
/**
|
|
21
|
+
* How this service names itself in a log line — `<service>@<version>`, the
|
|
22
|
+
* dispatch queue's own name, so the line matches what the deployment calls it.
|
|
23
|
+
*/
|
|
24
|
+
readonly service: string;
|
|
25
|
+
/** A dev overlay warns ten times earlier. See {@link DEV_OVERLAY_FIRST_WARNING}. */
|
|
26
|
+
readonly devOverlay: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The live size of the **connection's** registry.
|
|
29
|
+
*
|
|
30
|
+
* Read rather than counted, so it includes everything the connection holds —
|
|
31
|
+
* other deliveries' callbacks and rendered handler props alike — and shrinks
|
|
32
|
+
* when a delivery settles. Read *after* the registration that prompted it, so
|
|
33
|
+
* the number in the warning is the number the process is holding.
|
|
34
|
+
*/
|
|
35
|
+
readonly connectionCount: () => number;
|
|
36
|
+
/**
|
|
37
|
+
* Where a crossing goes: the running service's own log, and nothing else.
|
|
38
|
+
*
|
|
39
|
+
* This warning is for the person writing the service, in the terminal they are
|
|
40
|
+
* writing it in. It is not a task event — nobody watching a run can act on it,
|
|
41
|
+
* and the author is the only one who can.
|
|
42
|
+
*/
|
|
43
|
+
readonly warn: (message: string) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface DeliveryGrowthOptions {
|
|
46
|
+
/** The task this delivery belongs to, so the warning can be traced to a run. */
|
|
47
|
+
readonly taskId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface DeliveryGrowth {
|
|
50
|
+
/**
|
|
51
|
+
* One **connection-bound** registration, at the position it was written.
|
|
52
|
+
* Called after the entry is in the registry, so the connection count a warning
|
|
53
|
+
* states is the number the process is holding.
|
|
54
|
+
*
|
|
55
|
+
* A durable reference never reaches it: it registers nothing, so there is
|
|
56
|
+
* nothing to count and nothing to warn about.
|
|
57
|
+
*/
|
|
58
|
+
record(path: TransformPath): void;
|
|
59
|
+
}
|
|
60
|
+
export interface CallbackGrowthWatch {
|
|
61
|
+
/** A recorder for one delivery, whose counter is its own. */
|
|
62
|
+
forDelivery(options: DeliveryGrowthOptions): DeliveryGrowth;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Tells the author of a service whose inline closures are piling up — and tells
|
|
66
|
+
* them **which `yield`** is doing it (#151).
|
|
67
|
+
*
|
|
68
|
+
* Shipping `createDurableCallback` does not stop anyone writing an inline closure
|
|
69
|
+
* in a generator, and that is still the easier thing to write. This warning is
|
|
70
|
+
* therefore also the migration path: it is what moves existing services over,
|
|
71
|
+
* with no deprecation and no dual code path.
|
|
72
|
+
*
|
|
73
|
+
* It goes to the **service's own log** and nowhere else. It is not a task event:
|
|
74
|
+
* the only person who can act on it is the one writing the service, and putting
|
|
75
|
+
* it on a run would show it to everyone who cannot.
|
|
76
|
+
*
|
|
77
|
+
* **Two counters**, because they answer different questions and both are O(1):
|
|
78
|
+
*
|
|
79
|
+
* - **per delivery** — identifies the one generator doing it. This is the
|
|
80
|
+
* teaching signal, and it is what the property paths belong to.
|
|
81
|
+
* - **per connection** — what actually threatens the process: a worker holding
|
|
82
|
+
* fifty concurrent tasks at nine hundred callbacks each is at forty-five
|
|
83
|
+
* thousand without any single delivery tripping its own threshold.
|
|
84
|
+
*
|
|
85
|
+
* Both are stated in one warning, and a registration that crosses both emits it
|
|
86
|
+
* **once** — a fresh connection running one generator crosses them on the same
|
|
87
|
+
* registration, and two near-identical warnings would read as a bug in the
|
|
88
|
+
* warning rather than as a bug in the service.
|
|
89
|
+
*
|
|
90
|
+
* **Steps, not a line per registration**, which would be a line per email: the
|
|
91
|
+
* crossing, then each power of ten above it. A threshold jumps straight past a
|
|
92
|
+
* count it is already below, so a connection that arrives at forty-five thousand
|
|
93
|
+
* says so once rather than climbing there one decade per registration.
|
|
94
|
+
*
|
|
95
|
+
* **No cap and no eviction.** A hard cap is the rejected bounded-registry
|
|
96
|
+
* alternative wearing a different hat: it kills a legitimate long-lived handle at
|
|
97
|
+
* an arbitrary number, the author cannot exempt one, and it becomes a tuning knob
|
|
98
|
+
* nobody can set correctly. Loud and degrading beats silent and truncating — so
|
|
99
|
+
* nothing here refuses a registration or returns anything a caller could act on.
|
|
100
|
+
*/
|
|
101
|
+
export declare function createCallbackGrowthWatch({ service, devOverlay, connectionCount, warn, }: CallbackGrowthOptions): CallbackGrowthWatch;
|
|
102
|
+
//# sourceMappingURL=callbackGrowth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbackGrowth.d.ts","sourceRoot":"","sources":["../../../../src/callbackGrowth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,OAAQ,CAAA;AAK3C,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,MAAM,CAAA;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAA;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAAA;CAC5D;AAiED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,UAAU,EACV,eAAe,EACf,IAAI,GACL,EAAE,qBAAqB,GAAG,mBAAmB,CA2C7C"}
|
|
@@ -90,6 +90,7 @@ export declare const messageKeySchema: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString
|
|
|
90
90
|
streamUrl: string | undefined;
|
|
91
91
|
maxPayloadSize: number | undefined;
|
|
92
92
|
maxFileSize: number | undefined;
|
|
93
|
+
nodeId: string | undefined;
|
|
93
94
|
}, [string, string, ...string[]]>>;
|
|
94
95
|
export declare const connectionOptionsSchema: z.ZodObject<{
|
|
95
96
|
url: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAmqpConnection.d.ts","sourceRoot":"","sources":["../../../../src/createAmqpConnection.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"createAmqpConnection.d.ts","sourceRoot":"","sources":["../../../../src/createAmqpConnection.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,YAAY,EAclB,MAAM,mBAAmB,CAAA;AAiB1B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAiB1B,OAA4B,EAE1B,KAAK,aAAa,EAClB,KAAK,SAAS,EAKf,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAOtD,KAAK,mBAAmB,GAAG,2BAA2B,CAAA;AAatD,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,eAAe,CAAC,OAAO,IAChD,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AACrC,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,eAAe,CAAC,OAAO,IACxD,eAAe,CAAC,OAAO,CAAC,CAAC,CA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CACZ,yBAAyB,CAAC,CAAC,CAAC,EAC5B,yBAAyB,CAAC,CAAC,CAAC,GAAG,IAAI,EACnC,IAAI,CACL,CAAA;AACD,KAAK,4BAA4B,CAAC,CAAC,IAAI,CACrC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAC9B,cAAc,CACjB,yBAAyB,CAAC,CAAC,CAAC,EAC5B,yBAAyB,CAAC,CAAC,CAAC,GAAG,IAAI,EACnC,IAAI,CACL,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,eAAe,CAAC,OAAO,GACnE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GACjD,sBAAsB,CAAC,CAAC,CAAC,GAErB,4BAA4B,CAAC,CAAC,CAAC,GAC/B,uBAAuB,CAAC,CAAC,CAAC,GAC1B,sBAAsB,CAAC,CAAC,CAAC,GAE3B,4BAA4B,CAAC,CAAC,CAAC,GAC/B,uBAAuB,CAAC,CAAC,CAAC,GAC1B,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAmHjC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,EACxC,EACE,GAAG,EACH,OAAO,EACP,QAAY,EACZ,MAAc,EACd,iBAAiB,EAKjB,iBAAkD,EAClD,iBAAiB,EACjB,IAAI,EACJ,UAAe,EACf,cAAc,EACd,uBAAuB,EACvB,GAAG,IAAI,EACR,EAAE,iBAAiB,GAAG;IAAE,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAAE,EAC5E,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,oBA4yDlC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { RequenceCallback } from '../../helpers/src/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The node configuration a durable callback is handed, named **either way**:
|
|
4
|
+
* write the type, or write the name of the service **version** it belongs to
|
|
5
|
+
* and have it looked up.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* ConfigurationOf<ImapOptions> // → ImapOptions
|
|
9
|
+
* ConfigurationOf<'receiver'> // → the `receiver` version's configuration
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* The version-name form is the one to prefer: the type is generated into
|
|
13
|
+
* `requence-env.d.ts` beside the version it belongs to, so naming the version
|
|
14
|
+
* is the only form that cannot drift from what the node actually sends.
|
|
15
|
+
*
|
|
16
|
+
* A name that matches no version resolves to **itself**, which is deliberate
|
|
17
|
+
* rather than an oversight: a typo then fails at the first use with the
|
|
18
|
+
* misspelling quoted in the error (`Property 'host' does not exist on type
|
|
19
|
+
* '"recevier"'`), which says more than a `never` would — and it leaves a
|
|
20
|
+
* service whose configuration genuinely is a string alone.
|
|
21
|
+
*
|
|
22
|
+
* `Versions` exists only so this is testable. The SDK's own `global.d.ts`
|
|
23
|
+
* declares `RequenceService.Version` **empty** — a generated
|
|
24
|
+
* `requence-env.d.ts` is what fills it in a service's package — and merging a
|
|
25
|
+
* version into it from inside this package breaks the SDK's own generics, which
|
|
26
|
+
* only compile because the table has no keys. So the table is a defaulted
|
|
27
|
+
* parameter rather than a hard reference, and nobody passes it.
|
|
28
|
+
*/
|
|
29
|
+
export type ConfigurationOf<T, Versions = RequenceService.Version> = T extends keyof Versions ? Versions[T] extends {
|
|
30
|
+
configuration: infer C;
|
|
31
|
+
} ? C : unknown : T;
|
|
32
|
+
/**
|
|
33
|
+
* The one key a durable callback may not bind, because the context already has
|
|
34
|
+
* it.
|
|
35
|
+
*
|
|
36
|
+
* There is exactly one, and it is checked rather than worked around: a
|
|
37
|
+
* precedence rule ("configuration wins", "bound wins") would mean an author's
|
|
38
|
+
* data silently disappearing or a node's credentials silently replaced, and
|
|
39
|
+
* neither is something a reader of the handler could see.
|
|
40
|
+
*/
|
|
41
|
+
declare const RESERVED_CONTEXT_KEY = "configuration";
|
|
42
|
+
/**
|
|
43
|
+
* What a durable callback is told about the invocation it is running — and
|
|
44
|
+
* deliberately all of it (#147).
|
|
45
|
+
*
|
|
46
|
+
* There is no message here, no task, no connection. That is exactly what makes
|
|
47
|
+
* a durable callback durable: it may run in an instance that never saw the
|
|
48
|
+
* emission, started after the emitting process died. What it does get is the
|
|
49
|
+
* two things that survive that:
|
|
50
|
+
*
|
|
51
|
+
* - the bound data itself, spread across the context — what the emitting
|
|
52
|
+
* handler attached at `.for(…)` in place of capturing it.
|
|
53
|
+
* - `configuration` — the node's **static** configuration, so the callback can
|
|
54
|
+
* rebuild whatever the emitting handler had open (an IMAP connection, an API
|
|
55
|
+
* client) rather than hold it.
|
|
56
|
+
*
|
|
57
|
+
* The bound data is spread rather than parked under a field of its own, so
|
|
58
|
+
* there is no second word to keep consistent with `.for(…)`:
|
|
59
|
+
* `deleteMail.for({ uid })` is read as `{ uid }`. The cost is the one reserved
|
|
60
|
+
* key above, and it is a compile error and a throw rather than a shadow.
|
|
61
|
+
*
|
|
62
|
+
* Computed configuration (`configurationFunctions`, evaluated per dispatch) is
|
|
63
|
+
* not available: it is a property of one dispatch, and this call belongs to
|
|
64
|
+
* none.
|
|
65
|
+
*/
|
|
66
|
+
export type DurableCallbackContext<Bound, Configuration> = Bound extends object ? Bound & {
|
|
67
|
+
readonly configuration: Configuration;
|
|
68
|
+
} : {
|
|
69
|
+
readonly configuration: Configuration;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The bound data as `.for(…)` takes it: the declared shape, minus the one key
|
|
73
|
+
* the context has already spent.
|
|
74
|
+
*
|
|
75
|
+
* A `void` binding passes through untouched rather than intersected, which is
|
|
76
|
+
* what keeps `notify.for()` callable with no argument at all.
|
|
77
|
+
*/
|
|
78
|
+
export type Bindable<Bound> = Bound extends object ? Bound & {
|
|
79
|
+
[K in typeof RESERVED_CONTEXT_KEY]?: never;
|
|
80
|
+
} : Bound;
|
|
81
|
+
/**
|
|
82
|
+
* The author's function.
|
|
83
|
+
*
|
|
84
|
+
* `arg` comes first because it is the *consumer's* half — what a downstream
|
|
85
|
+
* node passed when it called `context.input.delete(…)`, and the only parameter
|
|
86
|
+
* the emitted `RequenceCallback<Arg>` declares. Everything the emitting service
|
|
87
|
+
* put there is the context, because from the running callback's point of view
|
|
88
|
+
* the bound data and the node's configuration are the same kind of thing: what
|
|
89
|
+
* this invocation was given, none of it written here.
|
|
90
|
+
*/
|
|
91
|
+
export type DurableCallbackHandler<Arg, Bound, Configuration> = (arg: Arg, context: DurableCallbackContext<Bound, Configuration>) => unknown;
|
|
92
|
+
/**
|
|
93
|
+
* A callback declared once at module scope, and what to do with it.
|
|
94
|
+
*/
|
|
95
|
+
export interface DurableCallbackHandle<Arg, Bound> {
|
|
96
|
+
/** The stable address this was declared under. */
|
|
97
|
+
readonly name: string;
|
|
98
|
+
/**
|
|
99
|
+
* Binds this emission's data and returns the value to emit — a reference
|
|
100
|
+
* naming the declaration and carrying the data, not a closure over it.
|
|
101
|
+
*
|
|
102
|
+
* Typed as the `RequenceCallback<Arg>` a consumer receives, because that is
|
|
103
|
+
* what the position in the node's output schema declares and what a downstream
|
|
104
|
+
* logic node holds. The value is not callable here: a durable callback runs
|
|
105
|
+
* where its invocation is delivered.
|
|
106
|
+
*/
|
|
107
|
+
for(bound: Bindable<Bound>): RequenceCallback<Arg>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* What {@link createDurableCallback} hands back.
|
|
111
|
+
*
|
|
112
|
+
* With nothing to bind (`Bound` at its `void` default) the declaration **is**
|
|
113
|
+
* the value to emit, so `.for()` can be left off entirely:
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* yield { subject: mail.subject, acknowledge } // no binding
|
|
117
|
+
* yield { delete: deleteMail.for({ uid: mail.uid }) } // a binding
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* That is not a special case at runtime — the handle is a reference that bound
|
|
121
|
+
* nothing, which is exactly what `.for()` would have produced. It is the type
|
|
122
|
+
* that is careful: the call signature appears **only** when `Bound` is `void`,
|
|
123
|
+
* so a callback that needs a binding cannot be emitted without one. Without
|
|
124
|
+
* that gate the omission would compile and the handler would destructure
|
|
125
|
+
* `undefined` off a context that was never given its data.
|
|
126
|
+
*/
|
|
127
|
+
export type DurableCallback<Arg, Bound> = Bound extends void ? DurableCallbackHandle<Arg, Bound> & RequenceCallback<Arg> : DurableCallbackHandle<Arg, Bound>;
|
|
128
|
+
interface Registration {
|
|
129
|
+
handler: DurableCallbackHandler<any, any, any>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Declares a callback **once**, so what a service emits per message is a
|
|
133
|
+
* reference rather than a closure (#147).
|
|
134
|
+
*
|
|
135
|
+
* ```ts
|
|
136
|
+
* const deleteMail = createDurableCallback<void, { uid: string }, 'receiver'>(
|
|
137
|
+
* 'deleteMail',
|
|
138
|
+
* async (_arg, { uid, configuration }) => {
|
|
139
|
+
* const client = await connect(configuration) // rebuilt, never captured
|
|
140
|
+
* await client.messageDelete(uid)
|
|
141
|
+
* client.close()
|
|
142
|
+
* },
|
|
143
|
+
* )
|
|
144
|
+
*
|
|
145
|
+
* createService('receiver', async function* () {
|
|
146
|
+
* for await (const mail of mails) {
|
|
147
|
+
* yield { subject: mail.subject, delete: deleteMail.for({ uid: mail.uid }) }
|
|
148
|
+
* }
|
|
149
|
+
* })
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* A callback with nothing to bind is emitted as itself — see
|
|
153
|
+
* {@link DurableCallback}:
|
|
154
|
+
*
|
|
155
|
+
* ```ts
|
|
156
|
+
* const acknowledge = createDurableCallback('acknowledge', async () => …)
|
|
157
|
+
*
|
|
158
|
+
* yield { subject: mail.subject, acknowledge }
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* **Where you write the function decides how long it lives** — the rule surfaces
|
|
162
|
+
* established for handler props (#59). A function written inline in the handler
|
|
163
|
+
* closes over the running message: only that process can serve it, it dies when
|
|
164
|
+
* the delivery settles, and until then it is held in the connection's registry
|
|
165
|
+
* along with everything it captured. For a CONTINUOUS handler that is one
|
|
166
|
+
* delivery holding a generator for the life of the task, so the registry grows
|
|
167
|
+
* by one entry per emitted function per emission and nothing frees it for weeks.
|
|
168
|
+
* Declared here instead, there is one entry per declaration however many
|
|
169
|
+
* messages go by, and an invocation can be served by an instance started after
|
|
170
|
+
* the emitting one died.
|
|
171
|
+
*
|
|
172
|
+
* Write it inline when it genuinely needs the live process — a handle on an open
|
|
173
|
+
* stream, a client the handler is mid-conversation with. Declare it here when it
|
|
174
|
+
* needs only data, and bind that data with `.for(…)`.
|
|
175
|
+
*
|
|
176
|
+
* The three type arguments are the three things the two sides disagree about,
|
|
177
|
+
* in the order the *reader* meets them:
|
|
178
|
+
*
|
|
179
|
+
* 1. `Arg` — what a consumer passes. This is the emitted
|
|
180
|
+
* `RequenceCallback<Arg>`, so it is what the node's output schema declares.
|
|
181
|
+
* Defaults to `void`: a callback the graph calls with nothing.
|
|
182
|
+
* 2. `Bound` — what `.for(…)` attaches per emission, and what the handler's
|
|
183
|
+
* context is made of. An object (it is spread) or `void`, which lets the
|
|
184
|
+
* declaration be emitted with no `.for()` at all. A scalar is refused,
|
|
185
|
+
* because a spread has nowhere to put one.
|
|
186
|
+
* 3. `Configuration` — the node's configuration, given as a type **or** as the
|
|
187
|
+
* name of the version to look it up from ({@link ConfigurationOf}).
|
|
188
|
+
*
|
|
189
|
+
* `Configuration` does not infer from an annotated handler, because it is
|
|
190
|
+
* resolved through a conditional type. Naming the version is both shorter and
|
|
191
|
+
* the only form that cannot drift, so state all three.
|
|
192
|
+
*
|
|
193
|
+
* A second declaration under the same name **throws**, for the reason a
|
|
194
|
+
* duplicate `createUI` id does: the name is the whole address, so an ambiguous
|
|
195
|
+
* one is an invocation reaching the *wrong* handler — which reads like a bug in
|
|
196
|
+
* the handler — and that is worse than a service that refuses to start.
|
|
197
|
+
*/
|
|
198
|
+
export declare function createDurableCallback<Arg = void, Bound extends object | void = void, Configuration = unknown>(name: string, handler: DurableCallbackHandler<Arg, Bound, ConfigurationOf<Configuration>>): DurableCallback<Arg, Bound>;
|
|
199
|
+
/**
|
|
200
|
+
* The callback a durable invocation names, or `undefined` when this process
|
|
201
|
+
* declared none under that name.
|
|
202
|
+
*/
|
|
203
|
+
export declare function findDurableCallback(name: string): Registration | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* The context an invocation runs against: its bound data, with the node's
|
|
206
|
+
* configuration beside it.
|
|
207
|
+
*
|
|
208
|
+
* Built here rather than at the consume site so the reserved-key check and the
|
|
209
|
+
* spread stay in one place — `bound` comes off the wire as `unknown`, so this is
|
|
210
|
+
* the second party that has to enforce what {@link DurableCallback.for} enforced
|
|
211
|
+
* on the way out. Another SDK, or a hand-published invocation, has not been
|
|
212
|
+
* through that.
|
|
213
|
+
*/
|
|
214
|
+
export declare function durableCallbackContext(name: string, bound: unknown, configuration: unknown): Record<string, unknown>;
|
|
215
|
+
/**
|
|
216
|
+
* How many callbacks this process has declared.
|
|
217
|
+
*
|
|
218
|
+
* Not exported from the package: it exists so the invariant the feature is for —
|
|
219
|
+
* one entry per declaration, whatever the emission count — is assertable.
|
|
220
|
+
*/
|
|
221
|
+
export declare function durableCallbackCount(): number;
|
|
222
|
+
export {};
|
|
223
|
+
//# sourceMappingURL=durableCallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durableCallback.d.ts","sourceRoot":"","sources":["../../../../src/durableCallback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,eAAe,CACzB,CAAC,EACD,QAAQ,GAAG,eAAe,CAAC,OAAO,IAChC,CAAC,SAAS,MAAM,QAAQ,GACxB,QAAQ,CAAC,CAAC,CAAC,SAAS;IAAE,aAAa,EAAE,MAAM,CAAC,CAAA;CAAE,GAC5C,CAAC,GACD,OAAO,GACT,CAAC,CAAA;AAEL;;;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;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,GAAG,IAAI,EACV,KAAK,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,EAClC,aAAa,GAAG,OAAO,EAEvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC,GAC1E,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,CAwB7B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,OAAO,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
|
@@ -50,11 +50,12 @@ export default function createContextHelper(options: {
|
|
|
50
50
|
passthroughByteReferences?: boolean;
|
|
51
51
|
onLog: (method: 'log' | 'warn' | 'info' | 'error', data: any[]) => void;
|
|
52
52
|
onDefer: (reason?: string) => string;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Dispatches an invocation of a callback the handler received in its input.
|
|
55
|
+
* Takes the whole reference — both lifetimes ride the one tag (#147) and only
|
|
56
|
+
* the caller knows how to route each arm.
|
|
57
|
+
*/
|
|
58
|
+
onCallback: (payload: CallbackObject & {
|
|
58
59
|
arg: unknown;
|
|
59
60
|
}) => void;
|
|
60
61
|
onRender: (params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/help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,CAAC,KAAK,CAAC,kBACT;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;;QAUtC,GAAG,UAAU,GAAG,EAAE;QAGlB,IAAI,UAAU,GAAG,EAAE;QAGnB,IAAI,UAAU,GAAG,EAAE;QAGnB,KAAK,UAAU,GAAG,EAAE;;kBAIR,MAAM;mBAGL,MAAM;;;;;EAwB2C,CAAA"}
|
|
@@ -2,6 +2,7 @@ import type { AmqpConnectionManagerOptions } from 'amqp-connection-manager';
|
|
|
2
2
|
import { type ConnectionApi, type ConnectionStateListener, type MessageHandler } from './createAmqpConnection.ts';
|
|
3
3
|
export { RequenceFile, RequenceStream } from '@requence/files';
|
|
4
4
|
export { createCallback, type RequenceCallback, type WrappedRequenceCallback, } from '../../helpers/src/index.js';
|
|
5
|
+
export { type Bindable, type ConfigurationOf, type DurableCallback, type DurableCallbackContext, type DurableCallbackHandle, type DurableCallbackHandler, createDurableCallback, } from './durableCallback.ts';
|
|
5
6
|
export * from './errors.ts';
|
|
6
7
|
export type { ButtonProps, CheckboxProps, SelectOption, SelectProps, StackProps, SurfaceSpace, TextFieldProps, TextProps, } from './surfaceUi.ts';
|
|
7
8
|
export * from './ui.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAE3E,OAA6B,EAC3B,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,mBAAmB,CAAA;AAC1B,cAAc,aAAa,CAAA;AAK3B,YAAY,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WA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Root":"","sources":["../../../../src/surfaceHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAM7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,+EAA+E;AAC/E,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;;;;OAYG;IACH,gBAAgB,CACd,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EACrC,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,GACnC,oBAAoB,CAAA;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gCAAgC,IAAI,YAAY,CAC9D,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAC5B,oBAAoB,EACpB,2BAA2B,CAC5B,CA+BA"}
|