@btravstack/temporal-worker 0.26.0 → 0.27.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/README.md +0 -1
- package/dist/index.d.mts +13 -9
- package/dist/index.mjs +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -113,7 +113,6 @@ const ActivityUnit = Module("ActivityUnit")({
|
|
|
113
113
|
// there is nothing to name). What the leaves read off `context.unit` is
|
|
114
114
|
// declared once, beside `inject`.
|
|
115
115
|
const orderActivities = TemporalActivities(contract)({
|
|
116
|
-
inject: {},
|
|
117
116
|
unit: { place: PlaceOrder },
|
|
118
117
|
sync: () => ({
|
|
119
118
|
placeOrder: {
|
package/dist/index.d.mts
CHANGED
|
@@ -91,12 +91,14 @@ type ScopedActivitiesOf<C extends ContractDefinition, K extends ActivitiesKeyOf<
|
|
|
91
91
|
* out of the fork the attempt opened; the root's `unit.activity` module must
|
|
92
92
|
* export every one of them.
|
|
93
93
|
*/
|
|
94
|
-
export declare const TemporalWorkflowActivities: <C extends ContractDefinition, const K extends ActivitiesKeyOf<C>>(contract: C, key: K) => <const D extends Readonly<Record<string, AnyPort
|
|
95
|
-
readonly inject
|
|
94
|
+
export declare const TemporalWorkflowActivities: <C extends ContractDefinition, const K extends ActivitiesKeyOf<C>>(contract: C, key: K) => <const D extends Readonly<Record<string, AnyPort>> = Record<never, never>, const U extends Readonly<Record<string, AnyPort>> = Record<never, never>>(options: {
|
|
95
|
+
readonly inject?: D;
|
|
96
96
|
/** The unit-scoped ports these activities read off `context.unit`. */
|
|
97
97
|
readonly unit?: U;
|
|
98
98
|
readonly sync: (services: { readonly [N in keyof D]: ServiceOf<InstanceType<D[N]>>; }) => ScopedActivitiesOf<C, K, U>;
|
|
99
|
-
}
|
|
99
|
+
} & ([keyof D] extends [never] ? unknown : {
|
|
100
|
+
readonly inject: D;
|
|
101
|
+
})) => MintedActivities<C, K, InstanceType<D[keyof D]>, U>;
|
|
100
102
|
//#endregion
|
|
101
103
|
//#region src/temporal-runtime.d.ts
|
|
102
104
|
/** What the worker publishes once it is polling, read back through `RunningApp.runtimeInfo()`. */
|
|
@@ -292,21 +294,23 @@ type Uncovered<C extends ContractDefinition, T extends readonly PieceOf<C>[]> =
|
|
|
292
294
|
* The record arm: the whole activities record from one `sync`, with one `unit:`
|
|
293
295
|
* record shared by every entry in it.
|
|
294
296
|
*
|
|
295
|
-
* It is `{ inject
|
|
297
|
+
* It is `{ inject?, unit?, sync }` — di's other arms are gone — for PARITY, not
|
|
296
298
|
* for a type-system reason: `value` could have carried the record just as well,
|
|
297
299
|
* since `U` infers from `unit` and never from the arm. `@btravstack/http-server`'s
|
|
298
|
-
* `api.OrpcRouter(contract)` is `{ inject
|
|
300
|
+
* `api.OrpcRouter(contract)` is `{ inject?, unit?, sync }` and so are all three
|
|
299
301
|
* packages' piece factories, so one arm across the family is one surface to
|
|
300
302
|
* learn and one to keep.
|
|
301
303
|
*/
|
|
302
|
-
type Whole<C extends ContractDefinition> = <const D extends Readonly<Record<string, AnyPort
|
|
303
|
-
readonly inject
|
|
304
|
+
type Whole<C extends ContractDefinition> = <const D extends Readonly<Record<string, AnyPort>> = Record<never, never>, const U extends Readonly<Record<string, AnyPort>> = Record<never, never>>(options: {
|
|
305
|
+
readonly inject?: D;
|
|
304
306
|
/** The unit-scoped ports every activity in the record reads off `context.unit`. */
|
|
305
307
|
readonly unit?: U;
|
|
306
308
|
readonly sync: (services: { readonly [N in keyof D]: ServiceOf<InstanceType<D[N]>>; }) => ActivitiesOf<C, {
|
|
307
309
|
readonly unit: UnitRecordOf<U>;
|
|
308
310
|
}>;
|
|
309
|
-
}
|
|
311
|
+
} & ([keyof D] extends [never] ? unknown : {
|
|
312
|
+
readonly inject: D;
|
|
313
|
+
})) => Provider<ActivitiesInstanceOf<C>, never, InstanceType<D[keyof D]>> & {
|
|
310
314
|
readonly port: ActivitiesPortOf<C>;
|
|
311
315
|
/** Phantom: the declared ports, which `TemporalModule` gates `unit.activity` against. */
|
|
312
316
|
readonly _declaredUnit?: InstanceType<U[keyof U]>;
|
|
@@ -333,7 +337,7 @@ type Compose<C extends ContractDefinition> = <const T extends readonly PieceOf<C
|
|
|
333
337
|
* TemporalActivities(orderContract)([fulfillOrder, chargeOrder])
|
|
334
338
|
* ```
|
|
335
339
|
*
|
|
336
|
-
* The first is `{ inject
|
|
340
|
+
* The first is `{ inject?, unit?, sync }`, whose `sync` hands back the whole
|
|
337
341
|
* activities record — one `unit:` record for every entry in it. The second
|
|
338
342
|
* takes the pieces `TemporalWorkflowActivities(contract, key)` builds: they are
|
|
339
343
|
* the provider's deps, keyed by the contract key each piece's port id carries,
|
package/dist/index.mjs
CHANGED
|
@@ -333,7 +333,7 @@ const TemporalModule = (name) => (options) => {
|
|
|
333
333
|
* TemporalActivities(orderContract)([fulfillOrder, chargeOrder])
|
|
334
334
|
* ```
|
|
335
335
|
*
|
|
336
|
-
* The first is `{ inject
|
|
336
|
+
* The first is `{ inject?, unit?, sync }`, whose `sync` hands back the whole
|
|
337
337
|
* activities record — one `unit:` record for every entry in it. The second
|
|
338
338
|
* takes the pieces `TemporalWorkflowActivities(contract, key)` builds: they are
|
|
339
339
|
* the provider's deps, keyed by the contract key each piece's port id carries,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btravstack/temporal-worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "The Temporal worker runtime for @btravstack/core: one unit per activity attempt, and a drain that honours the kernel's deadline",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graceful-shutdown",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@btravstack/config": "0.
|
|
50
|
-
"@btravstack/core": "0.
|
|
51
|
-
"@btravstack/di": "0.
|
|
49
|
+
"@btravstack/config": "0.27.0",
|
|
50
|
+
"@btravstack/core": "0.27.0",
|
|
51
|
+
"@btravstack/di": "0.27.0",
|
|
52
52
|
"@btravstack/internal-test-infra": "0.0.0",
|
|
53
|
-
"@btravstack/testing": "0.
|
|
53
|
+
"@btravstack/testing": "0.27.0",
|
|
54
54
|
"@btravstack/tsconfig": "0.4.0",
|
|
55
55
|
"@temporal-contract/client": "8.0.0-beta.11",
|
|
56
56
|
"@temporal-contract/contract": "8.0.0-beta.11",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"zod": "4.6.5"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@btravstack/config": "^0.
|
|
75
|
-
"@btravstack/core": "^0.
|
|
76
|
-
"@btravstack/di": "^0.
|
|
74
|
+
"@btravstack/config": "^0.27.0",
|
|
75
|
+
"@btravstack/core": "^0.27.0",
|
|
76
|
+
"@btravstack/di": "^0.27.0",
|
|
77
77
|
"@temporal-contract/client": "^8.0.0-beta.9",
|
|
78
78
|
"@temporal-contract/contract": "^8.0.0-beta.9",
|
|
79
79
|
"@temporal-contract/worker": "^8.0.0-beta.9",
|