@powerhousedao/reactor-workflow 6.2.3-dev.30 → 6.2.3-dev.32
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 +183 -9
- package/dist/index.d.ts +214 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6880 -660
- package/dist/index.js.map +1 -1
- package/dist/loader-Gkx6I_Bo.js +91 -0
- package/dist/loader-Gkx6I_Bo.js.map +1 -0
- package/dist/{piece-registry-CAS4wiSA.js → piece-registry-BAm8pRDY.js} +1126 -167
- package/dist/piece-registry-BAm8pRDY.js.map +1 -0
- package/dist/{piece-registry-DbYbKifY.d.ts → piece-registry-iXg2XQxp.d.ts} +124 -23
- package/dist/piece-registry-iXg2XQxp.d.ts.map +1 -0
- package/dist/{redact-DM3JhxdF.js → redact-LRWHJGW9.js} +245 -5
- package/dist/redact-LRWHJGW9.js.map +1 -0
- package/dist/testing.d.ts +4 -15
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +4 -4
- package/dist/worker-entry.js +18 -8
- package/dist/worker-entry.js.map +1 -1
- package/package.json +9 -7
- package/dist/descriptor-BImUIBMP.js +0 -256
- package/dist/descriptor-BImUIBMP.js.map +0 -1
- package/dist/piece-registry-CAS4wiSA.js.map +0 -1
- package/dist/piece-registry-DbYbKifY.d.ts.map +0 -1
- package/dist/redact-DM3JhxdF.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
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-iXg2XQxp.js";
|
|
2
2
|
import { ActionBase, TriggerBase } from "@powerhousedao/pieces-framework";
|
|
3
3
|
import { ILogger, OperationWithContext } from "document-model";
|
|
4
|
+
import { BlockIdentity, BlockRef } from "@powerhousedao/pieces-framework/block-type";
|
|
5
|
+
import "@powerhousedao/workflow/document-models/workflow";
|
|
4
6
|
import { BaseReadModel, DocumentViewDatabase, IConsistencyTracker, IOperationIndex, IReactorClient, IWriteCache, ReadModelRegistrationStage } from "@powerhousedao/reactor";
|
|
5
7
|
import { AuthSubject } from "@powerhousedao/shared/document-model";
|
|
6
8
|
import { IRelationalDb, IWebhookScope, WebhookField, WebhookHashAlgorithm, WebhookPolicy, WebhookReply, WebhookRequest, WebhookSignatureEncoding } from "@powerhousedao/shared/processors";
|
|
9
|
+
//#region src/pieces/core/version.d.ts
|
|
10
|
+
export declare const CORE_PIECE_VERSION: string;
|
|
11
|
+
//#endregion
|
|
7
12
|
//#region src/reactor/attachment-port.d.ts
|
|
8
13
|
interface AttachmentClientLike {
|
|
9
14
|
upload(input: {
|
|
@@ -47,6 +52,22 @@ interface WorkflowRuntimeHostDeps {
|
|
|
47
52
|
secrets?: SecretStore;
|
|
48
53
|
secretsKeyFile?: string | false;
|
|
49
54
|
logger?: ILogger;
|
|
55
|
+
syncWaitMs?: number;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/reactor/oauth.d.ts
|
|
59
|
+
type OAuthAttemptStatus = "PENDING" | "EXCHANGING" | "OK" | "ERROR";
|
|
60
|
+
interface OAuthStart {
|
|
61
|
+
state: string;
|
|
62
|
+
authorizationUrl: string;
|
|
63
|
+
redirectUri: string;
|
|
64
|
+
expiresAt: string;
|
|
65
|
+
}
|
|
66
|
+
interface OAuthAttemptView {
|
|
67
|
+
connectionId: string;
|
|
68
|
+
status: OAuthAttemptStatus;
|
|
69
|
+
error: string | null;
|
|
70
|
+
returnUrl: string | null;
|
|
50
71
|
}
|
|
51
72
|
//#endregion
|
|
52
73
|
//#region src/reactor/output-tree.d.ts
|
|
@@ -57,8 +78,11 @@ interface OutputTreeNode {
|
|
|
57
78
|
children?: OutputTreeNode[];
|
|
58
79
|
}
|
|
59
80
|
interface OutputTree {
|
|
60
|
-
source: "schema" | "sample" | "static" | "none";
|
|
81
|
+
source: "schema" | "sample" | "static" | "none" | "test";
|
|
61
82
|
nodes: OutputTreeNode[];
|
|
83
|
+
sample?: unknown;
|
|
84
|
+
testedAt?: string;
|
|
85
|
+
runId?: string;
|
|
62
86
|
}
|
|
63
87
|
//#endregion
|
|
64
88
|
//#region src/reactor/piece-catalog.d.ts
|
|
@@ -74,12 +98,12 @@ interface PieceSummary {
|
|
|
74
98
|
auth: unknown;
|
|
75
99
|
unsupported?: string;
|
|
76
100
|
deprecated?: boolean;
|
|
101
|
+
publishedVersion?: string;
|
|
77
102
|
}
|
|
78
103
|
interface PieceActionEntry {
|
|
79
104
|
name: string;
|
|
80
105
|
displayName: string;
|
|
81
106
|
description: string;
|
|
82
|
-
blockType: string;
|
|
83
107
|
audience: string | null;
|
|
84
108
|
unsupported?: string;
|
|
85
109
|
}
|
|
@@ -95,7 +119,6 @@ interface PieceTriggerEntry {
|
|
|
95
119
|
displayName: string;
|
|
96
120
|
description: string;
|
|
97
121
|
strategy: string;
|
|
98
|
-
blockType: string;
|
|
99
122
|
unsupported?: string;
|
|
100
123
|
}
|
|
101
124
|
interface PieceTriggersResult {
|
|
@@ -109,8 +132,9 @@ interface PieceTriggersResult {
|
|
|
109
132
|
//#region src/reactor/block-search.d.ts
|
|
110
133
|
type BlockSearchKind = "action" | "trigger";
|
|
111
134
|
interface BlockSearchHit {
|
|
112
|
-
blockType: string;
|
|
113
135
|
pieceName: string;
|
|
136
|
+
pieceVersion: string;
|
|
137
|
+
name: string;
|
|
114
138
|
pieceDisplayName: string;
|
|
115
139
|
logoUrl: string;
|
|
116
140
|
displayName: string;
|
|
@@ -127,6 +151,26 @@ interface BlockSearchResult {
|
|
|
127
151
|
error: string | null;
|
|
128
152
|
}
|
|
129
153
|
//#endregion
|
|
154
|
+
//#region src/reactor/sync-wait.d.ts
|
|
155
|
+
export declare const WORKFLOW_SYNCING_MESSAGE = "Workflow is still syncing; try again in a moment";
|
|
156
|
+
export declare class WorkflowSyncingError extends Error {
|
|
157
|
+
readonly code = "WORKFLOW_SYNCING";
|
|
158
|
+
readonly retryable = true;
|
|
159
|
+
constructor();
|
|
160
|
+
}
|
|
161
|
+
interface WorkflowAccessOptions {
|
|
162
|
+
driveId?: string;
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/reactor/step-test.d.ts
|
|
166
|
+
interface StepTestResult {
|
|
167
|
+
runId: string | null;
|
|
168
|
+
status: "SUCCEEDED" | "FAILED";
|
|
169
|
+
output?: unknown;
|
|
170
|
+
error?: string;
|
|
171
|
+
durationMs: number;
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
130
174
|
//#region src/reactor/store.d.ts
|
|
131
175
|
interface RunRow {
|
|
132
176
|
id: string;
|
|
@@ -137,9 +181,12 @@ interface RunRow {
|
|
|
137
181
|
trigger_payload: string | null;
|
|
138
182
|
status: string;
|
|
139
183
|
error: string | null;
|
|
184
|
+
enqueued_at: string;
|
|
140
185
|
started_at: string;
|
|
141
186
|
ended_at: string | null;
|
|
142
187
|
rerun_of: string | null;
|
|
188
|
+
warnings: number;
|
|
189
|
+
warning_notes: string | null;
|
|
143
190
|
}
|
|
144
191
|
interface StepExecutionRow {
|
|
145
192
|
id: string;
|
|
@@ -147,7 +194,8 @@ interface StepExecutionRow {
|
|
|
147
194
|
ordinal: number;
|
|
148
195
|
step_id: string;
|
|
149
196
|
step_key: string;
|
|
150
|
-
|
|
197
|
+
piece_name: string;
|
|
198
|
+
block_name: string;
|
|
151
199
|
status: string;
|
|
152
200
|
input: string | null;
|
|
153
201
|
output: string | null;
|
|
@@ -155,6 +203,11 @@ interface StepExecutionRow {
|
|
|
155
203
|
error: string | null;
|
|
156
204
|
started_at: string | null;
|
|
157
205
|
ended_at: string | null;
|
|
206
|
+
piece_version: string | null;
|
|
207
|
+
piece_source: string | null;
|
|
208
|
+
version_match: string | null;
|
|
209
|
+
version_note: string | null;
|
|
210
|
+
config_hash: string | null;
|
|
158
211
|
}
|
|
159
212
|
interface RunDocumentRow {
|
|
160
213
|
run_id: string;
|
|
@@ -162,7 +215,8 @@ interface RunDocumentRow {
|
|
|
162
215
|
}
|
|
163
216
|
interface TriggerStateRow {
|
|
164
217
|
workflow_id: string;
|
|
165
|
-
|
|
218
|
+
piece_name: string;
|
|
219
|
+
trigger_name: string;
|
|
166
220
|
config_hash: string;
|
|
167
221
|
status: string;
|
|
168
222
|
store_state: string;
|
|
@@ -174,7 +228,16 @@ interface TriggerStateRow {
|
|
|
174
228
|
lease_owner: string | null;
|
|
175
229
|
lease_expires_at: string | null;
|
|
176
230
|
updated_at: string;
|
|
177
|
-
|
|
231
|
+
piece_version: string | null;
|
|
232
|
+
piece_source: string | null;
|
|
233
|
+
version_match: string | null;
|
|
234
|
+
version_note: string | null;
|
|
235
|
+
next_renew_at: string | null;
|
|
236
|
+
renew_error: string | null;
|
|
237
|
+
renew_failures: number;
|
|
238
|
+
}
|
|
239
|
+
type DefaultedTriggerColumn = "piece_version" | "piece_source" | "version_match" | "version_note" | "next_renew_at" | "renew_error" | "renew_failures";
|
|
240
|
+
type TriggerStateInput = Omit<TriggerStateRow, DefaultedTriggerColumn> & Partial<Pick<TriggerStateRow, DefaultedTriggerColumn>>;
|
|
178
241
|
interface TriggerDedupeRow {
|
|
179
242
|
workflow_id: string;
|
|
180
243
|
dedupe_key: string;
|
|
@@ -196,6 +259,14 @@ interface WorkflowRuntimeDB {
|
|
|
196
259
|
trigger_dedupe: TriggerDedupeRow;
|
|
197
260
|
piece_store: PieceStoreRow;
|
|
198
261
|
}
|
|
262
|
+
interface RunKey {
|
|
263
|
+
enqueuedAt: string;
|
|
264
|
+
id: string;
|
|
265
|
+
}
|
|
266
|
+
interface ListRunsOptions {
|
|
267
|
+
after?: RunKey;
|
|
268
|
+
excludeTriggerKinds?: string[];
|
|
269
|
+
}
|
|
199
270
|
interface EnqueueRunOptions {
|
|
200
271
|
workflowId: string;
|
|
201
272
|
triggerKind: string;
|
|
@@ -220,6 +291,8 @@ declare class WorkflowRunStore {
|
|
|
220
291
|
recoverOrphanedRuns(): Promise<number>;
|
|
221
292
|
recoverAbandonedRuns(): Promise<number>;
|
|
222
293
|
enqueueRun(options: EnqueueRunOptions): Promise<string>;
|
|
294
|
+
claimAndEnqueueRun(dedupeKey: string, ttlMs: number, nowIso: string, options: EnqueueRunOptions): Promise<string | null>;
|
|
295
|
+
private insertPendingRun;
|
|
223
296
|
beginRun(runId: string, details: {
|
|
224
297
|
workflowName: string;
|
|
225
298
|
workflowVersion: number;
|
|
@@ -229,20 +302,31 @@ declare class WorkflowRunStore {
|
|
|
229
302
|
finishRun(runId: string, result: WorkflowRunResult, executionOrder?: ReadonlyMap<string, number>): Promise<void>;
|
|
230
303
|
private sweepSteps;
|
|
231
304
|
failRun(runId: string, error: string): Promise<void>;
|
|
232
|
-
listRuns(workflowId?: string | string[], limit?: number): Promise<RunRow[]>;
|
|
305
|
+
listRuns(workflowId?: string | string[], limit?: number, options?: ListRunsOptions): Promise<RunRow[]>;
|
|
233
306
|
getRun(id: string): Promise<RunRow | undefined>;
|
|
234
307
|
getSteps(runId: string): Promise<StepExecutionRow[]>;
|
|
308
|
+
getStepsForRuns(runIds: string[], options?: {
|
|
309
|
+
withData?: boolean;
|
|
310
|
+
}): Promise<Map<string, StepExecutionRow[]>>;
|
|
235
311
|
recordRunDocuments(runId: string, documentIds: string[]): Promise<void>;
|
|
236
312
|
getRunDocuments(runId: string): Promise<string[]>;
|
|
313
|
+
getRunDocumentsForRuns(runIds: string[]): Promise<Map<string, string[]>>;
|
|
237
314
|
getTriggerState(workflowId: string): Promise<TriggerStateRow | undefined>;
|
|
238
|
-
upsertTriggerState(row:
|
|
315
|
+
upsertTriggerState(row: TriggerStateInput): Promise<void>;
|
|
239
316
|
setTriggerStatus(workflowId: string, status: string, error?: string): Promise<void>;
|
|
240
317
|
listDueTriggerStates(nowIso: string): Promise<TriggerStateRow[]>;
|
|
318
|
+
listDueTriggerRenewals(nowIso: string): Promise<TriggerStateRow[]>;
|
|
319
|
+
setTriggerRenewAt(workflowId: string, nextRenewAtIso: string | null): Promise<void>;
|
|
320
|
+
recordRenewSuccess(workflowId: string, nowIso: string, nextRenewAtIso: string): Promise<void>;
|
|
321
|
+
recordRenewFailure(workflowId: string, error: string, nowIso: string, nextRenewAtIso: string, renewFailures: number): Promise<void>;
|
|
322
|
+
deleteTriggerState(workflowId: string): Promise<void>;
|
|
241
323
|
listTriggerStates(): Promise<TriggerStateRow[]>;
|
|
242
324
|
recordPollSuccess(workflowId: string, storeState: string, nowIso: string, nextPollAtIso: string | null): Promise<void>;
|
|
243
325
|
recordPollFailure(workflowId: string, error: string, nowIso: string, nextPollAtIso: string, consecutiveFailures: number): Promise<void>;
|
|
244
326
|
claimDedupe(workflowId: string, dedupeKey: string, ttlMs: number, nowIso: string): Promise<boolean>;
|
|
245
|
-
|
|
327
|
+
deleteDedupe(workflowId: string): Promise<void>;
|
|
328
|
+
pruneFinishedRuns(cutoffIso: string, batchSize?: number): Promise<number>;
|
|
329
|
+
pruneDedupe(cutoffIso: string): Promise<number>;
|
|
246
330
|
getPieceStoreValue(scope: string, scopeKey: string, key: string): Promise<unknown>;
|
|
247
331
|
setPieceStoreValue(scope: string, scopeKey: string, key: string, value: unknown): Promise<void>;
|
|
248
332
|
deletePieceStoreValue(scope: string, scopeKey: string, key: string): Promise<void>;
|
|
@@ -250,25 +334,26 @@ declare class WorkflowRunStore {
|
|
|
250
334
|
deletePieceStore(scope: string, scopeKey: string): Promise<void>;
|
|
251
335
|
}
|
|
252
336
|
//#endregion
|
|
253
|
-
//#region src/reactor/schedule.d.ts
|
|
254
|
-
declare const SCHEDULE_BLOCK = "core#schedule";
|
|
255
|
-
//#endregion
|
|
256
337
|
//#region src/reactor/trigger-supervisor.d.ts
|
|
257
338
|
interface PieceTriggerBinding {
|
|
258
339
|
kind?: "piece";
|
|
259
340
|
workflowId: string;
|
|
260
|
-
|
|
341
|
+
block: BlockRef;
|
|
261
342
|
packageName: string;
|
|
262
343
|
version: string;
|
|
263
344
|
triggerName: string;
|
|
264
345
|
config: Record<string, unknown>;
|
|
265
346
|
connectionId?: string | null;
|
|
266
347
|
pollIntervalMs?: number;
|
|
348
|
+
propertySettings?: PropertySettingDef[];
|
|
349
|
+
source?: PieceOrigin;
|
|
350
|
+
match?: BlockMatch;
|
|
351
|
+
note?: string;
|
|
267
352
|
}
|
|
268
353
|
interface ScheduleTriggerBinding {
|
|
269
354
|
kind: "schedule";
|
|
270
355
|
workflowId: string;
|
|
271
|
-
|
|
356
|
+
block: BlockRef;
|
|
272
357
|
config: Record<string, unknown>;
|
|
273
358
|
}
|
|
274
359
|
type TriggerBinding = PieceTriggerBinding | ScheduleTriggerBinding;
|
|
@@ -311,7 +396,9 @@ declare class TriggerSupervisor {
|
|
|
311
396
|
private readonly enableRetries;
|
|
312
397
|
upsert(binding: TriggerBinding): Promise<void>;
|
|
313
398
|
remove(workflowId: string): Promise<void>;
|
|
314
|
-
|
|
399
|
+
forget(workflowId: string): Promise<void>;
|
|
400
|
+
private unbind;
|
|
401
|
+
reject(workflowId: string, block: BlockIdentity, config: unknown, message: string, retryAt?: Date): Promise<void>;
|
|
315
402
|
private recordRejection;
|
|
316
403
|
test(binding: PieceTriggerBinding): Promise<unknown>;
|
|
317
404
|
private dropTestPartitions;
|
|
@@ -319,8 +406,9 @@ declare class TriggerSupervisor {
|
|
|
319
406
|
deliverWebhook(workflowId: string, payload: unknown): Promise<void>;
|
|
320
407
|
private cursorRewind;
|
|
321
408
|
private hook;
|
|
322
|
-
private
|
|
409
|
+
private deliveryFor;
|
|
323
410
|
private enable;
|
|
411
|
+
private renewAtAfterEnable;
|
|
324
412
|
private webhookUrlOrThrow;
|
|
325
413
|
private deferToStoredRetry;
|
|
326
414
|
private releaseRegistration;
|
|
@@ -331,6 +419,8 @@ declare class TriggerSupervisor {
|
|
|
331
419
|
tick(): Promise<void>;
|
|
332
420
|
private retryOneEnable;
|
|
333
421
|
private pollDue;
|
|
422
|
+
private renewDue;
|
|
423
|
+
private renew;
|
|
334
424
|
private fireSchedule;
|
|
335
425
|
private poll;
|
|
336
426
|
private fireItem;
|
|
@@ -358,6 +448,38 @@ interface RunRecord {
|
|
|
358
448
|
row: RunRow;
|
|
359
449
|
steps: StepExecutionRow[];
|
|
360
450
|
}
|
|
451
|
+
interface RunsArgs {
|
|
452
|
+
workflowId?: string;
|
|
453
|
+
driveId?: string;
|
|
454
|
+
limit?: number;
|
|
455
|
+
excludeTriggerKinds?: string[];
|
|
456
|
+
withStepData?: boolean;
|
|
457
|
+
}
|
|
458
|
+
interface RunsPageArgs extends RunsArgs {
|
|
459
|
+
cursor?: string | null;
|
|
460
|
+
}
|
|
461
|
+
interface RunPage {
|
|
462
|
+
records: RunRecord[];
|
|
463
|
+
hasNextPage: boolean;
|
|
464
|
+
cursor: string | null;
|
|
465
|
+
}
|
|
466
|
+
/** One draft block as this reactor resolves it. */
|
|
467
|
+
interface BlockResolutionRecord {
|
|
468
|
+
stepId: string;
|
|
469
|
+
pieceName: string;
|
|
470
|
+
pieceVersion: string;
|
|
471
|
+
name: string;
|
|
472
|
+
kind: "action" | "trigger";
|
|
473
|
+
resolvedVersion: string | null;
|
|
474
|
+
source: string | null;
|
|
475
|
+
match: string;
|
|
476
|
+
note: string | null;
|
|
477
|
+
latestVersion: string | null;
|
|
478
|
+
}
|
|
479
|
+
interface TriggerTestOptions extends WorkflowAccessOptions {
|
|
480
|
+
payload?: unknown;
|
|
481
|
+
timeoutMs?: number;
|
|
482
|
+
}
|
|
361
483
|
interface WebhookEndpointRecord {
|
|
362
484
|
workflowId: string;
|
|
363
485
|
url: string;
|
|
@@ -373,13 +495,20 @@ export declare class WorkflowRuntimeService {
|
|
|
373
495
|
private pieceWorkers?;
|
|
374
496
|
private readonly storePromise;
|
|
375
497
|
private secretsPromise?;
|
|
498
|
+
private oauthAttemptsPromise?;
|
|
499
|
+
private tokenRefresher?;
|
|
376
500
|
private readonly registry;
|
|
377
501
|
private readonly seedPromise;
|
|
378
502
|
private seedError?;
|
|
379
503
|
constructor(host: WorkflowRuntimeHostDeps);
|
|
504
|
+
private retentionTimer?;
|
|
505
|
+
private startRetention;
|
|
506
|
+
private sweepRetention;
|
|
380
507
|
store(): Promise<WorkflowRunStore | undefined>;
|
|
381
508
|
secrets(): Promise<SecretStore>;
|
|
382
509
|
private secretProvider;
|
|
510
|
+
private oauthAttempts;
|
|
511
|
+
private oauthRefresher;
|
|
383
512
|
/** The seeding failure a restart is needed to clear, or undefined while the
|
|
384
513
|
* registry is seeded. Resolves once seeding has finished either way. */
|
|
385
514
|
seedFailure(): Promise<unknown>;
|
|
@@ -387,15 +516,25 @@ export declare class WorkflowRuntimeService {
|
|
|
387
516
|
private seedRegistry;
|
|
388
517
|
private endpointCount;
|
|
389
518
|
private hasWebhookEndpoints;
|
|
519
|
+
private readonly registeredAs;
|
|
390
520
|
private updateRegistration;
|
|
521
|
+
private applyRegistration;
|
|
391
522
|
private enableSupervised;
|
|
392
523
|
private registerPieceTrigger;
|
|
393
524
|
private pieceDelivery;
|
|
525
|
+
private refusePieceTrigger;
|
|
394
526
|
private registerWebhook;
|
|
395
527
|
private supervisedBinding;
|
|
396
528
|
private pieceBinding;
|
|
397
|
-
private
|
|
398
|
-
private
|
|
529
|
+
private readonly blockResolver;
|
|
530
|
+
private versionHasBlock;
|
|
531
|
+
private readonly loggedResolutions;
|
|
532
|
+
resolveBlock(block: BlockRef, options?: {
|
|
533
|
+
fresh?: boolean;
|
|
534
|
+
latest?: boolean;
|
|
535
|
+
}): Promise<BlockResolution>;
|
|
536
|
+
private logResolution;
|
|
537
|
+
private resolvedPiece;
|
|
399
538
|
private readonly unarmed;
|
|
400
539
|
private reportUnarmedTrigger;
|
|
401
540
|
private readonly resolutionRetries;
|
|
@@ -417,6 +556,8 @@ export declare class WorkflowRuntimeService {
|
|
|
417
556
|
private fireLifecycle;
|
|
418
557
|
private readonly driveParentCache;
|
|
419
558
|
private driveIdFromParent;
|
|
559
|
+
private forgetDeletedWorkflow;
|
|
560
|
+
private disarmDeleted;
|
|
420
561
|
private matchDocumentLifecycle;
|
|
421
562
|
private matchDriveLifecycle;
|
|
422
563
|
private triggerSupervisor?;
|
|
@@ -437,7 +578,8 @@ export declare class WorkflowRuntimeService {
|
|
|
437
578
|
/** The per-document policy the service enforces before a delivery reaches this code;
|
|
438
579
|
* undefined means the workflow is not armed, answered exactly as an unknown token is. */
|
|
439
580
|
webhookPolicy(workflowId: string): Promise<WebhookPolicy | undefined>;
|
|
440
|
-
|
|
581
|
+
private policyOf;
|
|
582
|
+
webhookEndpoint(workflowId: string, ctx?: WorkflowCaller, access?: WorkflowAccessOptions): Promise<WebhookEndpointRecord | null>;
|
|
441
583
|
private mintWebhookEndpoint;
|
|
442
584
|
/** A delivery the service has already rate-limited, verified, de-duplicated and
|
|
443
585
|
* answered any challenge for; all that is left is deciding what it means. */
|
|
@@ -449,31 +591,42 @@ export declare class WorkflowRuntimeService {
|
|
|
449
591
|
private readonly descriptors;
|
|
450
592
|
private designWorker?;
|
|
451
593
|
private designEgress;
|
|
594
|
+
private readonly describing;
|
|
452
595
|
private pieceDescriptor;
|
|
596
|
+
private describe;
|
|
453
597
|
driveWorkflowIds(driveId: string, ctx?: WorkflowCaller): Promise<string[]>;
|
|
454
|
-
runs(args:
|
|
455
|
-
|
|
456
|
-
driveId?: string;
|
|
457
|
-
limit?: number;
|
|
458
|
-
}, ctx?: WorkflowCaller): Promise<RunRecord[]>;
|
|
598
|
+
runs(args: RunsArgs, ctx?: WorkflowCaller): Promise<RunRecord[]>;
|
|
599
|
+
runsPage(args: RunsPageArgs, ctx?: WorkflowCaller): Promise<RunPage>;
|
|
459
600
|
run(runId: string, ctx?: WorkflowCaller): Promise<RunRecord | null>;
|
|
460
601
|
connections(ctx?: WorkflowCaller): Promise<ConnectionSummary[]>;
|
|
461
602
|
checkConnection(connectionId: string, ctx?: WorkflowCaller): Promise<ConnectionCheckResult>;
|
|
462
|
-
private
|
|
463
|
-
private
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
603
|
+
private connectionDocument;
|
|
604
|
+
private checkConnectionDocument;
|
|
605
|
+
startOAuth(connectionId: string, ctx: WorkflowCaller | undefined, options: {
|
|
606
|
+
redirectUri: string;
|
|
607
|
+
returnUrl?: string;
|
|
608
|
+
}): Promise<OAuthStart>;
|
|
609
|
+
oauthAttempt(state: string, ctx: WorkflowCaller | undefined): Promise<OAuthAttemptView | null>;
|
|
610
|
+
completeOAuth(callback: {
|
|
611
|
+
state: string;
|
|
612
|
+
code?: string;
|
|
613
|
+
error?: string;
|
|
614
|
+
errorDescription?: string;
|
|
615
|
+
}): Promise<{
|
|
616
|
+
ok: boolean;
|
|
617
|
+
detail: string | null;
|
|
618
|
+
returnUrl: string | null;
|
|
619
|
+
}>;
|
|
468
620
|
private recordCheckResult;
|
|
469
621
|
private localPieces;
|
|
470
622
|
private localPiece;
|
|
471
623
|
pieceCatalog(): Promise<PieceSummary[]>;
|
|
472
|
-
pieceActions(packageName: string): Promise<PieceActionsResult>;
|
|
473
|
-
pieceTriggers(packageName: string): Promise<PieceTriggersResult>;
|
|
624
|
+
pieceActions(packageName: string, version?: string): Promise<PieceActionsResult>;
|
|
625
|
+
pieceTriggers(packageName: string, version?: string): Promise<PieceTriggersResult>;
|
|
474
626
|
searchBlocks(query: string, limit?: number): Promise<BlockSearchResult>;
|
|
475
|
-
pieceDetail(packageName: string): Promise<unknown>;
|
|
476
|
-
|
|
627
|
+
pieceDetail(packageName: string, version?: string): Promise<unknown>;
|
|
628
|
+
private localPieceAt;
|
|
629
|
+
blockDescriptor(block: BlockRef): Promise<unknown>;
|
|
477
630
|
private readableDocuments;
|
|
478
631
|
private readableRows;
|
|
479
632
|
private canReadDocument;
|
|
@@ -481,12 +634,22 @@ export declare class WorkflowRuntimeService {
|
|
|
481
634
|
private servesDocuments;
|
|
482
635
|
private servesRunDocument;
|
|
483
636
|
private assertCanReadDocument;
|
|
637
|
+
private assertCanReadWorkflow;
|
|
484
638
|
private assertCanWriteDocument;
|
|
485
|
-
blockOptions(
|
|
486
|
-
blockOutputTree(
|
|
639
|
+
blockOptions(block: BlockRef, propName: string, input?: unknown, connectionId?: string, ctx?: WorkflowCaller, searchValue?: string): Promise<unknown>;
|
|
640
|
+
blockOutputTree(block: BlockRef, config?: unknown): Promise<OutputTree>;
|
|
487
641
|
private stateFields;
|
|
488
642
|
private operationInputFields;
|
|
489
|
-
testTrigger(workflowId: string, ctx?: WorkflowCaller): Promise<unknown>;
|
|
643
|
+
testTrigger(workflowId: string, ctx?: WorkflowCaller, options?: TriggerTestOptions): Promise<unknown>;
|
|
644
|
+
private triggerTest;
|
|
645
|
+
private readonly webhookTests;
|
|
646
|
+
private awaitWebhookTest;
|
|
647
|
+
/** Stops a waiting webhook test; false when none was waiting. */
|
|
648
|
+
cancelTriggerTest(workflowId: string, reason?: string): boolean;
|
|
649
|
+
cancelTriggerTestFor(workflowId: string, ctx?: WorkflowCaller): Promise<boolean>;
|
|
650
|
+
private recordTest;
|
|
651
|
+
private noteLastTest;
|
|
652
|
+
private blockExecutor;
|
|
490
653
|
private workers;
|
|
491
654
|
fire(workflowId: string, triggerPayload?: unknown, triggerKind?: string, resume?: {
|
|
492
655
|
completedSteps: Map<string, {
|
|
@@ -496,10 +659,21 @@ export declare class WorkflowRuntimeService {
|
|
|
496
659
|
rerunOf: string;
|
|
497
660
|
}, ctx?: WorkflowCaller, enqueuedRunId?: string): Promise<PersistedRunResult>;
|
|
498
661
|
rerun(runId: string, ctx?: WorkflowCaller): Promise<PersistedRunResult>;
|
|
662
|
+
testStep(workflowId: string, stepId: string, ctx?: WorkflowCaller, access?: WorkflowAccessOptions): Promise<StepTestResult>;
|
|
663
|
+
private testScope;
|
|
664
|
+
private lastTestSample;
|
|
665
|
+
stepOutputTree(workflowId: string, stepId: string, ctx?: WorkflowCaller): Promise<OutputTree>;
|
|
666
|
+
blockResolutions(workflowId: string, ctx?: WorkflowCaller): Promise<BlockResolutionRecord[]>;
|
|
667
|
+
private draftOf;
|
|
499
668
|
}
|
|
500
669
|
/** The runtime a host composes: one instance, its lifetime the host's. */
|
|
501
670
|
export declare function createWorkflowRuntime(deps: WorkflowRuntimeHostDeps): WorkflowRuntimeService;
|
|
502
671
|
//#endregion
|
|
672
|
+
//#region src/reactor/run-cursor.d.ts
|
|
673
|
+
export declare class InvalidRunCursorError extends Error {
|
|
674
|
+
constructor();
|
|
675
|
+
}
|
|
676
|
+
//#endregion
|
|
503
677
|
//#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/operation-node/operation-node.d.ts
|
|
504
678
|
type OperationNodeKind = 'IdentifierNode' | 'SchemableIdentifierNode' | 'RawNode' | 'SelectQueryNode' | 'SelectionNode' | 'ReferenceNode' | 'ColumnNode' | 'TableNode' | 'AliasNode' | 'FromNode' | 'SelectAllNode' | 'AndNode' | 'OrNode' | 'ParensNode' | 'ValueNode' | 'ValueListNode' | 'PrimitiveValueListNode' | 'JoinNode' | 'OperatorNode' | 'WhereNode' | 'InsertQueryNode' | 'DeleteQueryNode' | 'ReturningNode' | 'CreateTableNode' | 'ColumnDefinitionNode' | 'AddColumnNode' | 'DropTableNode' | 'DataTypeNode' | 'OrderByNode' | 'OrderByItemNode' | 'GroupByNode' | 'GroupByItemNode' | 'UpdateQueryNode' | 'ColumnUpdateNode' | 'LimitNode' | 'OffsetNode' | 'OnConflictNode' | 'OnDuplicateKeyNode' | 'CreateIndexNode' | 'DropIndexNode' | 'ListNode' | 'ReferencesNode' | 'PrimaryKeyConstraintNode' | 'UniqueConstraintNode' | 'CheckConstraintNode' | 'ForeignKeyConstraintNode' | 'WithNode' | 'CommonTableExpressionNode' | 'HavingNode' | 'CreateSchemaNode' | 'DropSchemaNode' | 'AlterTableNode' | 'ModifyColumnNode' | 'DropColumnNode' | 'RenameColumnNode' | 'AlterColumnNode' | 'AddConstraintNode' | 'DropConstraintNode' | 'CreateViewNode' | 'RefreshMaterializedViewNode' | 'DropViewNode' | 'GeneratedNode' | 'DefaultValueNode' | 'OnNode' | 'ValuesNode' | 'CommonTableExpressionNameNode' | 'SelectModifierNode' | 'CreateTypeNode' | 'DropTypeNode' | 'ExplainNode' | 'DefaultInsertValueNode' | 'AggregateFunctionNode' | 'OverNode' | 'PartitionByNode' | 'PartitionByItemNode' | 'SetOperationNode' | 'BinaryOperationNode' | 'UnaryOperationNode' | 'UsingNode' | 'FunctionNode' | 'CaseNode' | 'WhenNode' | 'JSONReferenceNode' | 'JSONPathNode' | 'JSONPathLegNode' | 'JSONOperatorChainNode' | 'TupleNode' | 'MergeQueryNode' | 'MatchedNode' | 'AddIndexNode' | 'CastNode' | 'FetchNode' | 'TopNode' | 'OutputNode' | 'OrActionNode' | 'CollateNode' | 'RenameConstraintNode';
|
|
505
679
|
interface OperationNode {
|
|
@@ -19099,6 +19273,6 @@ interface WebhookPayload {
|
|
|
19099
19273
|
body: unknown;
|
|
19100
19274
|
}
|
|
19101
19275
|
//#endregion
|
|
19102
|
-
export { type AttachmentClientLike, type ConnectionCheckResult, type ConnectionSummary, type PersistedRunResult, PieceRegistry, type PieceStoreRow, type PieceTriggerBinding, type RunRow, type ScheduleTriggerBinding, type StepExecutionRow, type TriggerBinding, type TriggerDedupeRow, type TriggerStateRow, type WebhookConfig, type WebhookPayload, type WorkflowCaller, type WorkflowRuntimeDB, type WorkflowRuntimeHostDeps, packagePieces };
|
|
19276
|
+
export { type AttachmentClientLike, type BlockResolutionRecord, CORE_PIECE_NAME, type ConnectionCheckResult, type ConnectionSummary, type OAuthAttemptStatus, type OAuthAttemptView, type OAuthStart, type OutputTree, type OutputTreeNode, type PersistedRunResult, PieceRegistry, type PieceStoreRow, type PieceTriggerBinding, type RunPage, type RunRecord, type RunRow, type RunsArgs, type RunsPageArgs, type ScheduleTriggerBinding, type StepExecutionRow, type StepTestResult, type TriggerBinding, type TriggerDedupeRow, type TriggerStateRow, type WebhookConfig, type WebhookPayload, type WorkflowAccessOptions, type WorkflowCaller, type WorkflowRuntimeDB, type WorkflowRuntimeHostDeps, packagePieces };
|
|
19103
19277
|
export {};
|
|
19104
19278
|
//# sourceMappingURL=index.d.ts.map
|