@context-action/core 1.0.0 → 1.1.1
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/CHANGELOG.md +863 -0
- package/README.md +93 -20
- package/dist/index.cjs +59 -32
- package/dist/index.d.cts +6 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -32
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -173,7 +173,48 @@ const actions = new ActionRegister<MyActions>({
|
|
|
173
173
|
// should be treated as a programming error.
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
-
##
|
|
176
|
+
## v1.1 Pipeline Contract
|
|
177
|
+
|
|
178
|
+
### Phase-specific registration
|
|
179
|
+
|
|
180
|
+
New pipelines should make their role explicit: guards decide admission, result
|
|
181
|
+
handlers contribute typed results, and observers run after the terminal result.
|
|
182
|
+
|
|
183
|
+
<!-- @context-action-compile -->
|
|
184
|
+
```typescript
|
|
185
|
+
import { ActionRegister, type ActionPayloadMap } from '@context-action/core';
|
|
186
|
+
|
|
187
|
+
interface AppActions extends ActionPayloadMap {
|
|
188
|
+
save: { id: string; valid: boolean };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
interface AppResults {
|
|
192
|
+
save: { persisted: true };
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const registry = new ActionRegister<AppActions, AppResults>({ name: 'App' });
|
|
196
|
+
|
|
197
|
+
registry.registerGuard('save', payload => {
|
|
198
|
+
if (!payload.valid) throw new Error('Save requires valid input');
|
|
199
|
+
}, { id: 'validate-save' });
|
|
200
|
+
|
|
201
|
+
registry.registerResult('save', async payload => {
|
|
202
|
+
await Promise.resolve(payload);
|
|
203
|
+
return { persisted: true };
|
|
204
|
+
}, {
|
|
205
|
+
id: 'persist-save',
|
|
206
|
+
scheduling: 'await-before-next',
|
|
207
|
+
errorPolicy: 'fatal',
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
registry.registerObserver('save', event => {
|
|
211
|
+
console.info(event.outcome);
|
|
212
|
+
}, { when: 'always' });
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
`register()` and `HandlerConfig.blocking` remain supported compatibility APIs
|
|
216
|
+
in 1.x. Prefer the phase-specific methods plus explicit `scheduling` and
|
|
217
|
+
`errorPolicy` for new code.
|
|
177
218
|
|
|
178
219
|
### Advanced Filtering System
|
|
179
220
|
|
|
@@ -218,7 +259,8 @@ await actions.dispatch('complexAction', data, {
|
|
|
218
259
|
actions.register('myAction', handler, {
|
|
219
260
|
priority: 10,
|
|
220
261
|
id: 'my-handler',
|
|
221
|
-
|
|
262
|
+
scheduling: 'await-before-next',
|
|
263
|
+
errorPolicy: 'fatal',
|
|
222
264
|
once: false,
|
|
223
265
|
debounce: 300,
|
|
224
266
|
throttle: 1000,
|
|
@@ -474,6 +516,9 @@ registry.destroy();
|
|
|
474
516
|
|
|
475
517
|
// Or await proof that started handlers settled and cleanup callbacks ran.
|
|
476
518
|
await registry.destroyAsync();
|
|
519
|
+
|
|
520
|
+
// Close admission now but defer user cleanup until the next microtask.
|
|
521
|
+
await registry.destroyAsync({ deferCleanup: true });
|
|
477
522
|
```
|
|
478
523
|
|
|
479
524
|
## API Reference
|
|
@@ -481,7 +526,10 @@ await registry.destroyAsync();
|
|
|
481
526
|
### ActionRegister<T>
|
|
482
527
|
|
|
483
528
|
#### Registration Methods
|
|
484
|
-
- `
|
|
529
|
+
- `registerGuard<K>(action, handler, config?)` - Register admission logic
|
|
530
|
+
- `registerResult<K>(action, handler, config?)` - Register a typed result handler
|
|
531
|
+
- `registerObserver<K>(action, handler, config?)` - Register a post-result observer
|
|
532
|
+
- `register<K>(action, handler, config?)` - Compatibility registration API
|
|
485
533
|
- `clearAction(action)` - Remove all handlers for action
|
|
486
534
|
- `clearAll()` - Remove all handlers
|
|
487
535
|
|
|
@@ -505,7 +553,7 @@ await registry.destroyAsync();
|
|
|
505
553
|
- `getName()` - Get registry name
|
|
506
554
|
- `isDebugEnabled()` - Check if debug mode is enabled
|
|
507
555
|
- `destroy()` - Begin terminal cleanup without waiting
|
|
508
|
-
- `destroyAsync()` - Resolve after started handlers settle and cleanup completes
|
|
556
|
+
- `destroyAsync({ deferCleanup? })` - Resolve after started handlers settle and cleanup completes
|
|
509
557
|
|
|
510
558
|
### Configuration Interfaces
|
|
511
559
|
|
|
@@ -513,7 +561,9 @@ await registry.destroyAsync();
|
|
|
513
561
|
interface HandlerConfig {
|
|
514
562
|
priority?: number; // Handler priority (higher = first)
|
|
515
563
|
id?: string; // Unique handler identifier
|
|
516
|
-
blocking?: boolean; //
|
|
564
|
+
blocking?: boolean; // Compatibility 1.x shorthand
|
|
565
|
+
scheduling?: 'await-before-next' | 'start-and-continue';
|
|
566
|
+
errorPolicy?: 'fatal' | 'collect';
|
|
517
567
|
once?: boolean; // Remove after first execution
|
|
518
568
|
debounce?: number; // Debounce delay in ms
|
|
519
569
|
throttle?: number; // Throttle delay in ms
|
|
@@ -581,27 +631,50 @@ await actions.dispatch('setUser', { id: '1' }); // Missing required fields
|
|
|
581
631
|
await actions.dispatch('invalidAction'); // Unknown action
|
|
582
632
|
```
|
|
583
633
|
|
|
584
|
-
##
|
|
634
|
+
## Registration compatibility
|
|
585
635
|
|
|
586
|
-
|
|
636
|
+
Existing `register()` calls remain supported in 1.x. Migrate individual
|
|
637
|
+
pipelines to explicit phase registration when you need typed results,
|
|
638
|
+
admission guards, or terminal observers:
|
|
587
639
|
|
|
640
|
+
<!-- @context-action-compile -->
|
|
588
641
|
```typescript
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
642
|
+
import {
|
|
643
|
+
ActionRegister,
|
|
644
|
+
type ActionPayloadMap,
|
|
645
|
+
type ActionResultMap,
|
|
646
|
+
} from '@context-action/core';
|
|
647
|
+
|
|
648
|
+
interface AppActions extends ActionPayloadMap {
|
|
649
|
+
myAction: { id: string };
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
interface AppResults extends ActionResultMap<AppActions> {
|
|
653
|
+
myAction: { persisted: true };
|
|
654
|
+
}
|
|
598
655
|
|
|
599
|
-
|
|
600
|
-
|
|
656
|
+
const legacyActions = new ActionRegister<AppActions, AppResults>();
|
|
657
|
+
const handler = (_payload: AppActions['myAction']) => ({ persisted: true } as const);
|
|
658
|
+
|
|
659
|
+
// Existing registration — still supported
|
|
660
|
+
legacyActions.register('myAction', handler, { id: 'persist' });
|
|
661
|
+
await legacyActions.dispatch('myAction', { id: 'example' });
|
|
662
|
+
|
|
663
|
+
// Or replace that registration in your application with an explicit result phase.
|
|
664
|
+
const migratedActions = new ActionRegister<AppActions, AppResults>();
|
|
665
|
+
migratedActions.registerResult('myAction', handler, {
|
|
666
|
+
id: 'persist',
|
|
667
|
+
scheduling: 'await-before-next',
|
|
668
|
+
errorPolicy: 'fatal',
|
|
601
669
|
});
|
|
602
670
|
|
|
603
|
-
//
|
|
604
|
-
|
|
671
|
+
// Add a guard or observer only when the pipeline needs that phase.
|
|
672
|
+
migratedActions.registerGuard('myAction', payload => {
|
|
673
|
+
if (!payload.id) throw new Error('An id is required');
|
|
674
|
+
});
|
|
675
|
+
migratedActions.registerObserver('myAction', event => {
|
|
676
|
+
console.info(event.outcome);
|
|
677
|
+
}, { when: 'always' });
|
|
605
678
|
```
|
|
606
679
|
|
|
607
680
|
## Performance Tips
|
package/dist/index.cjs
CHANGED
|
@@ -1416,7 +1416,7 @@ var ActionRegister = class {
|
|
|
1416
1416
|
return newUnregister;
|
|
1417
1417
|
} else {
|
|
1418
1418
|
if (!existing) throw new Error("Internal error: existing handler should be defined in duplicate handler block");
|
|
1419
|
-
this.log(`Handler duplicate ignored, returning
|
|
1419
|
+
this.log(`Handler duplicate ignored, returning no-op unregister: ${String(action)}`, {
|
|
1420
1420
|
handlerId,
|
|
1421
1421
|
existingPriority: existing.config.priority,
|
|
1422
1422
|
newPriority: config.priority,
|
|
@@ -1424,12 +1424,7 @@ var ActionRegister = class {
|
|
|
1424
1424
|
newBlocking: config.blocking,
|
|
1425
1425
|
note: "Use replaceExisting:true to replace"
|
|
1426
1426
|
}, "warn");
|
|
1427
|
-
|
|
1428
|
-
else {
|
|
1429
|
-
const newUnregister = this.createUnregisterFunction(action, handlerId, existing);
|
|
1430
|
-
actionUnregisterFunctions.set(handlerId, newUnregister);
|
|
1431
|
-
return newUnregister;
|
|
1432
|
-
}
|
|
1427
|
+
return () => {};
|
|
1433
1428
|
}
|
|
1434
1429
|
}
|
|
1435
1430
|
pipeline.push(registration);
|
|
@@ -1453,7 +1448,8 @@ var ActionRegister = class {
|
|
|
1453
1448
|
const attemptState = { count: 0 };
|
|
1454
1449
|
const plan = this.resolveDispatchPlan(action, options);
|
|
1455
1450
|
const hasTimingGuard = plan.debounceMs !== void 0 || plan.throttleMs !== void 0;
|
|
1456
|
-
|
|
1451
|
+
const notifiedObservers = /* @__PURE__ */ new Set();
|
|
1452
|
+
const notifiedObserverOutcomes = /* @__PURE__ */ new Set();
|
|
1457
1453
|
let terminalErrorReported = false;
|
|
1458
1454
|
const reportTerminalError = (error) => {
|
|
1459
1455
|
if (terminalErrorReported) return;
|
|
@@ -1461,9 +1457,9 @@ var ActionRegister = class {
|
|
|
1461
1457
|
this.invokeErrorHandler(error, action, payload, options, attemptState.count);
|
|
1462
1458
|
};
|
|
1463
1459
|
const notifyObservers = async (event) => {
|
|
1464
|
-
if (
|
|
1465
|
-
|
|
1466
|
-
await this.executeObservers(action, plan, event);
|
|
1460
|
+
if (notifiedObserverOutcomes.has(event.outcome)) return;
|
|
1461
|
+
notifiedObserverOutcomes.add(event.outcome);
|
|
1462
|
+
await this.executeObservers(action, plan, event, notifiedObservers);
|
|
1467
1463
|
};
|
|
1468
1464
|
const pipelineOperation = async () => {
|
|
1469
1465
|
const guard = plan.guards.length > 0 ? await this.executeGuardPhase(action, payload, timeoutScope.options, plan, dispatchHandlerPromises) : {
|
|
@@ -1498,6 +1494,18 @@ var ActionRegister = class {
|
|
|
1498
1494
|
this.cleanupOneTimeHandlers(action, executedHandlers, dispatchHandlerPromises);
|
|
1499
1495
|
}
|
|
1500
1496
|
}, timeoutScope.options, attemptState, (result) => result.outcome === "failed", () => this.getAttemptHandlers(action, plan).length > 0, void 0, this.shouldDrainBeforeRetry(plan, timeoutScope.options) ? () => this.drainAttemptHandlers(dispatchHandlerPromises) : void 0);
|
|
1497
|
+
if (timeoutScope.options?.signal?.aborted) {
|
|
1498
|
+
if (timeoutScope.options.signal.reason instanceof ActionTimeoutError) throw timeoutScope.options.signal.reason;
|
|
1499
|
+
await notifyObservers({
|
|
1500
|
+
action: String(action),
|
|
1501
|
+
payload: guard.payload,
|
|
1502
|
+
outcome: "cancelled",
|
|
1503
|
+
result: void 0,
|
|
1504
|
+
errors: execution.errors,
|
|
1505
|
+
signal: timeoutScope.options.signal
|
|
1506
|
+
});
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1501
1509
|
if (execution.outcome === "failed") throw execution.errors[execution.errors.length - 1]?.error ?? /* @__PURE__ */ new Error(`Action "${String(action)}" failed`);
|
|
1502
1510
|
const result = this.processResults(execution.results, execution.terminated, execution.terminated ? execution.result : void 0, options?.result);
|
|
1503
1511
|
await notifyObservers({
|
|
@@ -1597,7 +1605,7 @@ var ActionRegister = class {
|
|
|
1597
1605
|
}
|
|
1598
1606
|
const observedPromise = this.raceWithTimeout(observedDispatchPromise, timeoutScope, dispatchHandlerPromises).catch(async (error) => {
|
|
1599
1607
|
reportTerminalError(error);
|
|
1600
|
-
|
|
1608
|
+
this.trackGlobalHandlerPromise(notifyObservers({
|
|
1601
1609
|
action: String(action),
|
|
1602
1610
|
payload,
|
|
1603
1611
|
outcome: "failed",
|
|
@@ -1609,7 +1617,9 @@ var ActionRegister = class {
|
|
|
1609
1617
|
severity: "blocking"
|
|
1610
1618
|
}],
|
|
1611
1619
|
signal: timeoutScope.options?.signal
|
|
1612
|
-
}))
|
|
1620
|
+
})).catch((observerError) => {
|
|
1621
|
+
this.log(`Failure observer delivery failed for ${String(action)}`, observerError, "warn");
|
|
1622
|
+
});
|
|
1613
1623
|
throw error;
|
|
1614
1624
|
});
|
|
1615
1625
|
observedPromise.catch(() => {});
|
|
@@ -1957,12 +1967,18 @@ var ActionRegister = class {
|
|
|
1957
1967
|
/** Observers run after the canonical result has been constructed. Their
|
|
1958
1968
|
* failures are isolated from that immutable result; detached observers are
|
|
1959
1969
|
* still tracked for registry shutdown. */
|
|
1960
|
-
async executeObservers(action, plan, event) {
|
|
1970
|
+
async executeObservers(action, plan, event, notifiedObservers = /* @__PURE__ */ new Set()) {
|
|
1961
1971
|
const observerEvent = this.safeSnapshotObserverEvent(event);
|
|
1972
|
+
const selectedObservers = [];
|
|
1962
1973
|
for (const [registration, observerEntry] of this.getObservers(action, plan)) {
|
|
1974
|
+
if (notifiedObservers.has(registration)) continue;
|
|
1963
1975
|
const successful = observerEvent.outcome === "completed" || observerEvent.outcome === "completed_with_errors";
|
|
1964
1976
|
if (observerEntry.when === "success" && !successful) continue;
|
|
1965
1977
|
if (observerEntry.when === "failure" && successful) continue;
|
|
1978
|
+
notifiedObservers.add(registration);
|
|
1979
|
+
selectedObservers.push([registration, observerEntry]);
|
|
1980
|
+
}
|
|
1981
|
+
for (const [registration, observerEntry] of selectedObservers) {
|
|
1966
1982
|
let shouldRun = true;
|
|
1967
1983
|
try {
|
|
1968
1984
|
shouldRun = registration.config.condition?.(observerEvent.payload) ?? true;
|
|
@@ -2229,13 +2245,16 @@ var ActionRegister = class {
|
|
|
2229
2245
|
this.cleanupOneTimeHandlers(action, executedHandlers, dispatchHandlerPromises);
|
|
2230
2246
|
}
|
|
2231
2247
|
}, timeoutScope.options, attemptState, (result) => result.outcome === "failed", () => this.getAttemptHandlers(action, plan).length > 0, retryTelemetry, this.shouldDrainBeforeRetry(plan, timeoutScope.options) ? () => this.drainAttemptHandlers(dispatchHandlerPromises) : void 0);
|
|
2232
|
-
if (timeoutScope.options?.signal?.aborted)
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2248
|
+
if (timeoutScope.options?.signal?.aborted) {
|
|
2249
|
+
if (timeoutScope.options.signal.reason instanceof ActionTimeoutError) throw timeoutScope.options.signal.reason;
|
|
2250
|
+
return {
|
|
2251
|
+
...rawExecution,
|
|
2252
|
+
success: false,
|
|
2253
|
+
aborted: true,
|
|
2254
|
+
abortReason: typeof timeoutScope.options.signal.reason === "string" ? timeoutScope.options.signal.reason : "Action dispatch aborted by signal",
|
|
2255
|
+
outcome: "cancelled"
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2239
2258
|
const executionWithGuards = {
|
|
2240
2259
|
...rawExecution,
|
|
2241
2260
|
handlers: [...guard.outcomes.map((outcome) => ({
|
|
@@ -2296,7 +2315,8 @@ var ActionRegister = class {
|
|
|
2296
2315
|
timeoutScope.onTimeout((error) => queued.cancel(error));
|
|
2297
2316
|
return queued.promise;
|
|
2298
2317
|
};
|
|
2299
|
-
|
|
2318
|
+
const notifiedObservers = /* @__PURE__ */ new Set();
|
|
2319
|
+
const notifiedObserverOutcomes = /* @__PURE__ */ new Set();
|
|
2300
2320
|
let terminalErrorReported = false;
|
|
2301
2321
|
const reportTerminalError = (error) => {
|
|
2302
2322
|
if (terminalErrorReported) return;
|
|
@@ -2304,9 +2324,9 @@ var ActionRegister = class {
|
|
|
2304
2324
|
this.invokeErrorHandler(error, action, payload, options, attemptState.count);
|
|
2305
2325
|
};
|
|
2306
2326
|
const notifyObservers = async (event) => {
|
|
2307
|
-
if (
|
|
2308
|
-
|
|
2309
|
-
await this.executeObservers(action, plan, event);
|
|
2327
|
+
if (notifiedObserverOutcomes.has(event.outcome)) return;
|
|
2328
|
+
notifiedObserverOutcomes.add(event.outcome);
|
|
2329
|
+
await this.executeObservers(action, plan, event, notifiedObservers);
|
|
2310
2330
|
};
|
|
2311
2331
|
let dispatchPromise;
|
|
2312
2332
|
let observedDispatchPromise;
|
|
@@ -2364,7 +2384,7 @@ var ActionRegister = class {
|
|
|
2364
2384
|
}
|
|
2365
2385
|
const observedPromise = this.raceWithTimeout(observedDispatchPromise, timeoutScope, dispatchHandlerPromises).catch(async (error) => {
|
|
2366
2386
|
reportTerminalError(error);
|
|
2367
|
-
|
|
2387
|
+
this.trackGlobalHandlerPromise(notifyObservers({
|
|
2368
2388
|
action: String(action),
|
|
2369
2389
|
payload: observerPayload,
|
|
2370
2390
|
outcome: "failed",
|
|
@@ -2376,7 +2396,9 @@ var ActionRegister = class {
|
|
|
2376
2396
|
severity: "blocking"
|
|
2377
2397
|
}],
|
|
2378
2398
|
signal: timeoutScope.options?.signal
|
|
2379
|
-
}))
|
|
2399
|
+
})).catch((observerError) => {
|
|
2400
|
+
this.log(`Failure observer delivery failed for ${String(action)}`, observerError, "warn");
|
|
2401
|
+
});
|
|
2380
2402
|
throw error;
|
|
2381
2403
|
});
|
|
2382
2404
|
observedPromise.catch(() => {});
|
|
@@ -2616,7 +2638,7 @@ var ActionRegister = class {
|
|
|
2616
2638
|
if (resultOptions.maxResults !== void 0 && (!Number.isSafeInteger(resultOptions.maxResults) || resultOptions.maxResults < 0)) throw new RangeError("maxResults must be a non-negative safe integer.");
|
|
2617
2639
|
}
|
|
2618
2640
|
processResults(results, terminated, terminationResult, resultOptions) {
|
|
2619
|
-
if (terminated
|
|
2641
|
+
if (terminated) return terminationResult;
|
|
2620
2642
|
if (!resultOptions) return results.length > 0 ? results[results.length - 1] : void 0;
|
|
2621
2643
|
if (!resultOptions.collect && !resultOptions.strategy) return;
|
|
2622
2644
|
const collectedResults = results.filter((result) => result !== void 0);
|
|
@@ -2990,7 +3012,7 @@ var ActionRegister = class {
|
|
|
2990
3012
|
cancelPendingDispatches() {
|
|
2991
3013
|
this.dispatchQueue?.clear({ rejectPending: true });
|
|
2992
3014
|
}
|
|
2993
|
-
beginShutdown() {
|
|
3015
|
+
beginShutdown(deferCleanup = false) {
|
|
2994
3016
|
if (this.destroyAsyncPromise) return this.destroyAsyncPromise;
|
|
2995
3017
|
if (this.lifecycleState === "destroyed") {
|
|
2996
3018
|
this.destroyAsyncPromise = Promise.resolve();
|
|
@@ -3010,7 +3032,7 @@ var ActionRegister = class {
|
|
|
3010
3032
|
rejectPending: true,
|
|
3011
3033
|
reason: shutdownError
|
|
3012
3034
|
});
|
|
3013
|
-
if (this.dispatchConstructionDepth === 0 && this.activeDispatches.size === 0 && this.activeHandlerPromises.size === 0) {
|
|
3035
|
+
if (!deferCleanup && this.dispatchConstructionDepth === 0 && this.activeDispatches.size === 0 && this.activeHandlerPromises.size === 0) {
|
|
3014
3036
|
this.finalizeDestroy();
|
|
3015
3037
|
resolveShutdown();
|
|
3016
3038
|
return this.destroyAsyncPromise;
|
|
@@ -3048,13 +3070,18 @@ var ActionRegister = class {
|
|
|
3048
3070
|
* Begin terminal shutdown and resolve after all started handlers have settled
|
|
3049
3071
|
* and their registered cleanup functions have run.
|
|
3050
3072
|
*
|
|
3073
|
+
* `deferCleanup` closes the register synchronously while deferring final
|
|
3074
|
+
* registered cleanup until the next microtask. This is useful for React
|
|
3075
|
+
* commit phases that must invalidate stale dispatchers immediately without
|
|
3076
|
+
* invoking user cleanup code inside the commit hook itself.
|
|
3077
|
+
*
|
|
3051
3078
|
* Repeated calls return the same promise. New registrations and dispatches are
|
|
3052
3079
|
* rejected as soon as shutdown begins.
|
|
3053
3080
|
*
|
|
3054
3081
|
* @public
|
|
3055
3082
|
*/
|
|
3056
|
-
destroyAsync() {
|
|
3057
|
-
return this.beginShutdown();
|
|
3083
|
+
destroyAsync(options = {}) {
|
|
3084
|
+
return this.beginShutdown(options.deferCleanup ?? false);
|
|
3058
3085
|
}
|
|
3059
3086
|
};
|
|
3060
3087
|
|
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,7 @@ interface ActionSchemaLike {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
type ActionNames<T extends ActionPayloadMap> = Extract<keyof T, string>;
|
|
18
|
+
type ActionPayload<T extends ActionPayloadMap, K extends keyof T> = T[K];
|
|
18
19
|
type ActionResultMap<T extends ActionPayloadMap> = Partial<Record<ActionNames<T>, unknown>>;
|
|
19
20
|
type ActionResult<TResultMap extends ActionPayloadMap, K extends PropertyKey> = K extends keyof TResultMap ? TResultMap[K] : void;
|
|
20
21
|
interface PipelineController<T = unknown, R = void> {
|
|
@@ -263,6 +264,7 @@ type UnregisterFunction = () => void;
|
|
|
263
264
|
type DispatchArgs<P> = [P] extends [void] ? [payload?: undefined, options?: DispatchOptions] : [payload: P, options?: DispatchOptions];
|
|
264
265
|
type ReservedActionKey = 'then' | 'catch' | 'finally' | 'toJSON' | 'constructor' | '__proto__' | 'prototype';
|
|
265
266
|
type ProxyActionKey<T extends ActionPayloadMap> = Exclude<ActionNames<T>, ReservedActionKey>;
|
|
267
|
+
type ActionDispatcherWithResult<T extends ActionPayloadMap, TResultMap extends ActionResultMap<T> = {}> = <K extends ActionNames<T>, R = ActionResult<TResultMap, K>>(action: K, ...args: DispatchArgs<T[K]>) => Promise<ExecutionResult<R>>;
|
|
266
268
|
type ActionDispatcher<T extends ActionPayloadMap> = <K extends ActionNames<T>>(action: K, ...args: DispatchArgs<T[K]>) => Promise<void>;
|
|
267
269
|
interface ActionRegistryInfo<T extends ActionPayloadMap> {
|
|
268
270
|
name: string;
|
|
@@ -395,7 +397,9 @@ declare class ActionRegister<T extends ActionPayloadMap = Record<string, unknown
|
|
|
395
397
|
private beginShutdown;
|
|
396
398
|
private finalizeDestroy;
|
|
397
399
|
destroy(): void;
|
|
398
|
-
destroyAsync(
|
|
400
|
+
destroyAsync(options?: {
|
|
401
|
+
deferCleanup?: boolean;
|
|
402
|
+
}): Promise<void>;
|
|
399
403
|
}
|
|
400
404
|
//#endregion
|
|
401
405
|
//#region src/action-guard.d.ts
|
|
@@ -488,5 +492,5 @@ declare function executeSequential<T, R = void>(context: PipelineContext<T, R>,
|
|
|
488
492
|
declare function executeParallel<T, R = void>(context: PipelineContext<T, R>, createController: (registration: HandlerRegistration<T, R>, index: number, state: PipelineControllerState<T, R>) => PipelineController<T, R>): Promise<void>;
|
|
489
493
|
declare function executeRace<T, R = void>(context: PipelineContext<T, R>, createController: (registration: HandlerRegistration<T, R>, index: number, state: PipelineControllerState<T, R>) => PipelineController<T, R>): Promise<void>;
|
|
490
494
|
//#endregion
|
|
491
|
-
export { ActionAttemptSupersededError, type ActionDispatcher, type ActionEffectController, type ActionEffectHandler, ActionGuard, type ActionGuardController, type ActionGuardHandler, type ActionHandler, type ActionNames, type ActionObserverEvent, type ActionObserverHandler, type ActionPayloadMap, ActionRegister, type ActionRegisterConfig, ActionRegisterDestroyedError, type ActionResult, type ActionResultController, type ActionResultHandler, type ActionResultMap, ActionResultProcessingError, type ActionSchemaLike, ActionTimeoutError, ActionValidationError, type DispatchArgs, type DispatchOptions, type EffectConfig, type ExecutionMode, type ExecutionResult, type GuardConfig, type HandlerConfig, type HandlerErrorPolicy, type HandlerRegistration, type HandlerRole, type HandlerScheduling, type ObserverConfig, type PipelineContext, type PipelineController, type ProxyActionKey, type ReservedActionKey, type ResolvedHandlerConfig, type UnregisterFunction, executeParallel, executeRace, executeSequential, isActionRegisterDestroyedError, isActionResultProcessingError, isActionTimeoutError, isActionValidationError, resolveHandlerConfig };
|
|
495
|
+
export { ActionAttemptSupersededError, type ActionDispatcher, type ActionDispatcherWithResult, type ActionEffectController, type ActionEffectHandler, ActionGuard, type ActionGuardController, type ActionGuardHandler, type ActionHandler, type ActionHandlerStats, type ActionNames, type ActionObserverEvent, type ActionObserverHandler, type ActionPayload, type ActionPayloadMap, ActionRegister, type ActionRegisterConfig, ActionRegisterDestroyedError, type ActionRegistryInfo, type ActionResult, type ActionResultController, type ActionResultHandler, type ActionResultMap, ActionResultProcessingError, type ActionSchemaLike, ActionTimeoutError, ActionValidationError, type DispatchArgs, type DispatchOptions, type EffectConfig, type ExecutionMode, type ExecutionResult, type GuardConfig, type HandlerConfig, type HandlerError, type HandlerErrorPolicy, type HandlerExecutionOutcome, type HandlerExecutionStatus, type HandlerRegistration, type HandlerRole, type HandlerScheduling, type ObserverConfig, type PipelineContext, type PipelineController, type ProxyActionKey, type ReservedActionKey, type ResolvedHandlerConfig, type UnregisterFunction, executeParallel, executeRace, executeSequential, isActionRegisterDestroyedError, isActionResultProcessingError, isActionTimeoutError, isActionValidationError, resolveHandlerConfig };
|
|
492
496
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/errors.ts","../src/execution-modes.ts"],"mappings":";KAmBY;UASK;EACf,UAAU;IACJ;IAAe;;IAEf;IACA;MACE;MACA;QAAmB;;;;;KAsKjB,YAAY,UAAU,oBAAoB,cAAc;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/errors.ts","../src/execution-modes.ts"],"mappings":";KAmBY;UASK;EACf,UAAU;IACJ;IAAe;;IAEf;IACA;MACE;MACA;QAAmB;;;;;KAsKjB,YAAY,UAAU,oBAAoB,cAAc;KAaxD,cAAc,UAAU,kBAAkB,gBAAgB,KAAK,EAAE;KASjE,gBAAgB,UAAU,oBAAoB,QACxD,OAAO,YAAY;KAIT,aACV,mBAAmB,kBACnB,UAAU,eACR,gBAAgB,aAAa,WAAW;UAgE3B,mBAAmB,aAAa;WAQtC,SAAS;EAGlB,MAAM;EAGN,cAAc,WAAW,SAAS,MAAM;EAGxC,cAAc;EA+Bd,eAAe;EAIf,OAAO,QAAQ,IAAI;EAGnB,UAAU,QAAQ;EAGlB,cAAc;EAGd,YAAY,SAAS,iBAAiB,KAAK,eAAe,MAAM;;UAIjD,uBAAuB;WAC7B,SAAS;EAClB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;;iBAcJ,wBACd,iBACC,SAAS;iBAKI,qBACd,iBACC,SAAS;iBAKI,+BACd,iBACC,SAAS;;;iBChHU,kBAAkB,GAAG,UACzC,SAAS,gBAAgB,GAAG,IAC5B,mBAAmB,cAAc,oBAAoB,GAAG,IAAI,kBAAkB,mBAAmB,GAAG,KACnG;iBA2NmB,gBAAgB,GAAG,UACvC,SAAS,gBAAgB,GAAG,IAC5B,mBACE,cAAc,oBAAoB,GAAG,IACrC,eACA,OAAO,wBAAwB,GAAG,OAC/B,mBAAmB,GAAG,KAC1B;iBAuJmB,YAAY,GAAG,UACnC,SAAS,gBAAgB,GAAG,IAC5B,mBACE,cAAc,oBAAoB,GAAG,IACrC,eACA,OAAO,wBAAwB,GAAG,OAC/B,mBAAmB,GAAG,KAC1B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ interface ActionSchemaLike {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
type ActionNames<T extends ActionPayloadMap> = Extract<keyof T, string>;
|
|
18
|
+
type ActionPayload<T extends ActionPayloadMap, K extends keyof T> = T[K];
|
|
18
19
|
type ActionResultMap<T extends ActionPayloadMap> = Partial<Record<ActionNames<T>, unknown>>;
|
|
19
20
|
type ActionResult<TResultMap extends ActionPayloadMap, K extends PropertyKey> = K extends keyof TResultMap ? TResultMap[K] : void;
|
|
20
21
|
interface PipelineController<T = unknown, R = void> {
|
|
@@ -263,6 +264,7 @@ type UnregisterFunction = () => void;
|
|
|
263
264
|
type DispatchArgs<P> = [P] extends [void] ? [payload?: undefined, options?: DispatchOptions] : [payload: P, options?: DispatchOptions];
|
|
264
265
|
type ReservedActionKey = 'then' | 'catch' | 'finally' | 'toJSON' | 'constructor' | '__proto__' | 'prototype';
|
|
265
266
|
type ProxyActionKey<T extends ActionPayloadMap> = Exclude<ActionNames<T>, ReservedActionKey>;
|
|
267
|
+
type ActionDispatcherWithResult<T extends ActionPayloadMap, TResultMap extends ActionResultMap<T> = {}> = <K extends ActionNames<T>, R = ActionResult<TResultMap, K>>(action: K, ...args: DispatchArgs<T[K]>) => Promise<ExecutionResult<R>>;
|
|
266
268
|
type ActionDispatcher<T extends ActionPayloadMap> = <K extends ActionNames<T>>(action: K, ...args: DispatchArgs<T[K]>) => Promise<void>;
|
|
267
269
|
interface ActionRegistryInfo<T extends ActionPayloadMap> {
|
|
268
270
|
name: string;
|
|
@@ -395,7 +397,9 @@ declare class ActionRegister<T extends ActionPayloadMap = Record<string, unknown
|
|
|
395
397
|
private beginShutdown;
|
|
396
398
|
private finalizeDestroy;
|
|
397
399
|
destroy(): void;
|
|
398
|
-
destroyAsync(
|
|
400
|
+
destroyAsync(options?: {
|
|
401
|
+
deferCleanup?: boolean;
|
|
402
|
+
}): Promise<void>;
|
|
399
403
|
}
|
|
400
404
|
//#endregion
|
|
401
405
|
//#region src/action-guard.d.ts
|
|
@@ -488,5 +492,5 @@ declare function executeSequential<T, R = void>(context: PipelineContext<T, R>,
|
|
|
488
492
|
declare function executeParallel<T, R = void>(context: PipelineContext<T, R>, createController: (registration: HandlerRegistration<T, R>, index: number, state: PipelineControllerState<T, R>) => PipelineController<T, R>): Promise<void>;
|
|
489
493
|
declare function executeRace<T, R = void>(context: PipelineContext<T, R>, createController: (registration: HandlerRegistration<T, R>, index: number, state: PipelineControllerState<T, R>) => PipelineController<T, R>): Promise<void>;
|
|
490
494
|
//#endregion
|
|
491
|
-
export { ActionAttemptSupersededError, type ActionDispatcher, type ActionEffectController, type ActionEffectHandler, ActionGuard, type ActionGuardController, type ActionGuardHandler, type ActionHandler, type ActionNames, type ActionObserverEvent, type ActionObserverHandler, type ActionPayloadMap, ActionRegister, type ActionRegisterConfig, ActionRegisterDestroyedError, type ActionResult, type ActionResultController, type ActionResultHandler, type ActionResultMap, ActionResultProcessingError, type ActionSchemaLike, ActionTimeoutError, ActionValidationError, type DispatchArgs, type DispatchOptions, type EffectConfig, type ExecutionMode, type ExecutionResult, type GuardConfig, type HandlerConfig, type HandlerErrorPolicy, type HandlerRegistration, type HandlerRole, type HandlerScheduling, type ObserverConfig, type PipelineContext, type PipelineController, type ProxyActionKey, type ReservedActionKey, type ResolvedHandlerConfig, type UnregisterFunction, executeParallel, executeRace, executeSequential, isActionRegisterDestroyedError, isActionResultProcessingError, isActionTimeoutError, isActionValidationError, resolveHandlerConfig };
|
|
495
|
+
export { ActionAttemptSupersededError, type ActionDispatcher, type ActionDispatcherWithResult, type ActionEffectController, type ActionEffectHandler, ActionGuard, type ActionGuardController, type ActionGuardHandler, type ActionHandler, type ActionHandlerStats, type ActionNames, type ActionObserverEvent, type ActionObserverHandler, type ActionPayload, type ActionPayloadMap, ActionRegister, type ActionRegisterConfig, ActionRegisterDestroyedError, type ActionRegistryInfo, type ActionResult, type ActionResultController, type ActionResultHandler, type ActionResultMap, ActionResultProcessingError, type ActionSchemaLike, ActionTimeoutError, ActionValidationError, type DispatchArgs, type DispatchOptions, type EffectConfig, type ExecutionMode, type ExecutionResult, type GuardConfig, type HandlerConfig, type HandlerError, type HandlerErrorPolicy, type HandlerExecutionOutcome, type HandlerExecutionStatus, type HandlerRegistration, type HandlerRole, type HandlerScheduling, type ObserverConfig, type PipelineContext, type PipelineController, type ProxyActionKey, type ReservedActionKey, type ResolvedHandlerConfig, type UnregisterFunction, executeParallel, executeRace, executeSequential, isActionRegisterDestroyedError, isActionResultProcessingError, isActionTimeoutError, isActionValidationError, resolveHandlerConfig };
|
|
492
496
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/errors.ts","../src/execution-modes.ts"],"mappings":";KAmBY;UASK;EACf,UAAU;IACJ;IAAe;;IAEf;IACA;MACE;MACA;QAAmB;;;;;KAsKjB,YAAY,UAAU,oBAAoB,cAAc;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.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