@powerhousedao/reactor-workflow 6.2.3-dev.34 → 6.2.3-dev.36
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 +23 -1
- package/dist/index.d.ts +21 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +280 -68
- package/dist/index.js.map +1 -1
- package/dist/{piece-registry-CAMLtGeP.js → piece-registry-BCaD5pxR.js} +29 -11
- package/dist/piece-registry-BCaD5pxR.js.map +1 -0
- package/dist/{piece-registry-ohYcOXd-.d.ts → piece-registry-Bt1Cd3ly.d.ts} +39 -3
- package/dist/piece-registry-Bt1Cd3ly.d.ts.map +1 -0
- package/dist/{redact-LRWHJGW9.js → redact-DW7W5rrV.js} +5 -4
- package/dist/{redact-LRWHJGW9.js.map → redact-DW7W5rrV.js.map} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/worker-entry.js +172 -10
- package/dist/worker-entry.js.map +1 -1
- package/package.json +8 -6
- package/dist/piece-registry-CAMLtGeP.js.map +0 -1
- package/dist/piece-registry-ohYcOXd-.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -104,7 +104,29 @@ the cursor never passes an event that is not yet durable.
|
|
|
104
104
|
A workflow document's `DELETE_DOCUMENT` disarms it as disabling does: its
|
|
105
105
|
deliveries stop once the operation is indexed, a piece trigger's `onDisable`
|
|
106
106
|
runs, and then its trigger row, its FLOW `ctx.store` partition, its webhook
|
|
107
|
-
token and its dedupe keys are deleted. A restart finds nothing to re-arm.
|
|
107
|
+
token and its dedupe keys are deleted. A restart finds nothing to re-arm. Its
|
|
108
|
+
`PURGE_DOCUMENT` marker does the same whether or not the deletion was seen, and
|
|
109
|
+
also drops the trigger-test store partitions; the read model awaits it, so a
|
|
110
|
+
failure holds the cursor below the marker.
|
|
111
|
+
|
|
112
|
+
A document's purge (`PURGE_DOCUMENT`) deletes every run that carried it: the
|
|
113
|
+
runs `run_document` ties to it, the runs whose trigger payload names it as
|
|
114
|
+
`documentId`, `driveId` or `parentId`, the test runs whose sample (a step's
|
|
115
|
+
`output`, a payload or a list of them) names it the same way, a purged
|
|
116
|
+
workflow's own runs (`run.workflow_id`, test runs included), and every rerun
|
|
117
|
+
of those, transitively. Their
|
|
118
|
+
`step_execution` and `run_document` rows go with them; a `trigger_dedupe` row
|
|
119
|
+
they claimed keeps its key and loses its `run_id`. A run erased while it is
|
|
120
|
+
still executing journals nothing more from this process. The read model's
|
|
121
|
+
fence is `"skip"`: the journal lives on the relational handle, not the
|
|
122
|
+
reactor's, so a run the purge races can still be written after the marker was
|
|
123
|
+
applied; a rescan from just below the marker repairs it.
|
|
124
|
+
|
|
125
|
+
Not erased, because nothing ties it to a document: another workflow's
|
|
126
|
+
`trigger_state.store_state` (vestigial, but an unmigrated legacy blob may
|
|
127
|
+
remain), `trigger_dedupe.dedupe_key` (an operation key, which can embed a
|
|
128
|
+
document id) and `piece_store.value` (whatever a piece stored), and a test
|
|
129
|
+
run's step output that names the id anywhere but those payload fields.
|
|
108
130
|
|
|
109
131
|
`runsPage` pages newest first on when a run was journaled (`enqueued_at`),
|
|
110
132
|
which starting a PENDING run leaves alone, so a run keeps its place between
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as BlockResolution, C as PieceResolver, E as EgressPolicy, b as PieceWorkerResult, f as SecretStore, g as WorkflowRunResult, h as StepExecutionRecord, j as PieceOrigin, k as BlockMatch, l as ConnectionRequest, m as PropertySettingDef, n as packagePieces, o as AttachmentPort, r as CORE_PIECE_NAME, t as PieceRegistry, y as PieceWorker } from "./piece-registry-
|
|
1
|
+
import { A as BlockResolution, C as PieceResolver, E as EgressPolicy, b as PieceWorkerResult, f as SecretStore, g as WorkflowRunResult, h as StepExecutionRecord, j as PieceOrigin, k as BlockMatch, l as ConnectionRequest, m as PropertySettingDef, n as packagePieces, o as AttachmentPort, r as CORE_PIECE_NAME, t as PieceRegistry, y as PieceWorker } from "./piece-registry-Bt1Cd3ly.js";
|
|
2
2
|
import { ActionBase, TriggerBase } from "@powerhousedao/pieces-framework";
|
|
3
3
|
import { ILogger, OperationWithContext } from "document-model";
|
|
4
4
|
import { BlockIdentity, BlockRef } from "@powerhousedao/pieces-framework/block-type";
|
|
@@ -260,6 +260,12 @@ interface WorkflowRuntimeDB {
|
|
|
260
260
|
trigger_dedupe: TriggerDedupeRow;
|
|
261
261
|
piece_store: PieceStoreRow;
|
|
262
262
|
}
|
|
263
|
+
interface ErasedRuns {
|
|
264
|
+
runs: number;
|
|
265
|
+
steps: number;
|
|
266
|
+
documents: number;
|
|
267
|
+
dedupeKeysUnlinked: number;
|
|
268
|
+
}
|
|
263
269
|
interface RunKey {
|
|
264
270
|
enqueuedAt: string;
|
|
265
271
|
id: string;
|
|
@@ -327,6 +333,7 @@ declare class WorkflowRunStore {
|
|
|
327
333
|
claimDedupe(workflowId: string, dedupeKey: string, ttlMs: number, nowIso: string): Promise<boolean>;
|
|
328
334
|
deleteDedupe(workflowId: string): Promise<void>;
|
|
329
335
|
pruneFinishedRuns(cutoffIso: string, batchSize?: number): Promise<number>;
|
|
336
|
+
eraseRunsForDocuments(documentIds: string[]): Promise<ErasedRuns>;
|
|
330
337
|
pruneDedupe(cutoffIso: string): Promise<number>;
|
|
331
338
|
getPieceStoreValue(scope: string, scopeKey: string, key: string): Promise<unknown>;
|
|
332
339
|
setPieceStoreValue(scope: string, scopeKey: string, key: string, value: unknown): Promise<void>;
|
|
@@ -494,7 +501,12 @@ export declare class WorkflowRuntimeService {
|
|
|
494
501
|
private readonly attachments?;
|
|
495
502
|
private executor?;
|
|
496
503
|
private pieceWorkers?;
|
|
497
|
-
private
|
|
504
|
+
private storePromise;
|
|
505
|
+
private storeError?;
|
|
506
|
+
private storeOpening;
|
|
507
|
+
private storeReopenAt;
|
|
508
|
+
private storeReopenMs;
|
|
509
|
+
private retentionSweep?;
|
|
498
510
|
private secretsPromise?;
|
|
499
511
|
private oauthAttemptsPromise?;
|
|
500
512
|
private tokenRefresher?;
|
|
@@ -506,6 +518,7 @@ export declare class WorkflowRuntimeService {
|
|
|
506
518
|
private startRetention;
|
|
507
519
|
private sweepRetention;
|
|
508
520
|
store(): Promise<WorkflowRunStore | undefined>;
|
|
521
|
+
private openStore;
|
|
509
522
|
secrets(): Promise<SecretStore>;
|
|
510
523
|
private secretProvider;
|
|
511
524
|
private oauthAttempts;
|
|
@@ -546,7 +559,10 @@ export declare class WorkflowRuntimeService {
|
|
|
546
559
|
private readonly seenOps;
|
|
547
560
|
private readonly seenOpsQueue;
|
|
548
561
|
private alreadySeen;
|
|
562
|
+
onDocumentsPurged(markers: OperationWithContext[]): Promise<ErasedRuns>;
|
|
549
563
|
onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
564
|
+
private readonly unjournaledFires;
|
|
565
|
+
private fireUnjournaled;
|
|
550
566
|
private enqueueFire;
|
|
551
567
|
private fireFromTrigger;
|
|
552
568
|
private readonly firedLifecycle;
|
|
@@ -559,6 +575,9 @@ export declare class WorkflowRuntimeService {
|
|
|
559
575
|
private driveIdFromParent;
|
|
560
576
|
private forgetDeletedWorkflow;
|
|
561
577
|
private disarmDeleted;
|
|
578
|
+
private dropDeleted;
|
|
579
|
+
private releaseDeleted;
|
|
580
|
+
private erasePurgedWorkflow;
|
|
562
581
|
private matchDocumentLifecycle;
|
|
563
582
|
private matchDriveLifecycle;
|
|
564
583
|
private triggerSupervisor?;
|