@powerhousedao/reactor-workflow 6.2.3-dev.13 → 6.2.3-dev.15
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/dist/{descriptor-DXbWuxhE.js → descriptor-CRkDqx3C.js} +2 -2
- package/dist/descriptor-CRkDqx3C.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -17
- package/dist/index.js.map +1 -1
- package/dist/{piece-registry-CE0UFmDA.d.ts → piece-registry-DxYByELl.d.ts} +3 -7
- package/dist/piece-registry-DxYByELl.d.ts.map +1 -0
- package/dist/{piece-registry-BWWihLyp.js → piece-registry-fpNdxNLr.js} +32 -169
- package/dist/piece-registry-fpNdxNLr.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/worker-entry.js +1 -1
- package/package.json +6 -6
- package/dist/descriptor-DXbWuxhE.js.map +0 -1
- package/dist/piece-registry-BWWihLyp.js.map +0 -1
- package/dist/piece-registry-CE0UFmDA.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as FileTooLargeError, a as redactMessage, c as DEFAULT_EGRESS_POLICY, f as extractDedupeKey, n as containsRedactedMarker, o as rememberSecrets, r as redact, s as secretsFor, y as maxFileBytes } from "./redact-C7LWgAyD.js";
|
|
2
|
-
import { C as pieceModuleRef, S as localFirstResolver, _ as secretRefFromId, a as CompositeBlockExecutor, b as PieceWorkerError, c as storeHandlers, d as declaredConnectionIds, f as shapeConnection, g as parseSecretRef, h as SecretNotFoundError, i as ActivepiecesBlockExecutor, l as BoundConnectionResolver, m as SecretDeletedError, n as packagePieces, o as parseBlockType, r as runWorkflow, s as reactorHandlers, t as PieceRegistry, v as PieceWorkerPool, w as ensurePieceBundle, x as PieceWorkerTimeoutError, y as PieceWorker } from "./piece-registry-
|
|
2
|
+
import { C as pieceModuleRef, S as localFirstResolver, _ as secretRefFromId, a as CompositeBlockExecutor, b as PieceWorkerError, c as storeHandlers, d as declaredConnectionIds, f as shapeConnection, g as parseSecretRef, h as SecretNotFoundError, i as ActivepiecesBlockExecutor, l as BoundConnectionResolver, m as SecretDeletedError, n as packagePieces, o as parseBlockType, r as runWorkflow, s as reactorHandlers, t as PieceRegistry, v as PieceWorkerPool, w as ensurePieceBundle, x as PieceWorkerTimeoutError, y as PieceWorker } from "./piece-registry-fpNdxNLr.js";
|
|
3
3
|
import { WebhookHandshakeStrategy } from "@powerhousedao/pieces-framework";
|
|
4
4
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { open, readFile, rm } from "node:fs/promises";
|
|
@@ -997,10 +997,7 @@ function fetchingResolver(cacheDir) {
|
|
|
997
997
|
} };
|
|
998
998
|
}
|
|
999
999
|
function pieceResolver() {
|
|
1000
|
-
return resolver ??= localFirstResolver(
|
|
1001
|
-
await packagePieces.ready();
|
|
1002
|
-
return packagePieces.lookup(name);
|
|
1003
|
-
}, fetchingResolver(BUNDLE_CACHE_DIR));
|
|
1000
|
+
return resolver ??= localFirstResolver((name) => packagePieces.lookup(name), fetchingResolver(BUNDLE_CACHE_DIR));
|
|
1004
1001
|
}
|
|
1005
1002
|
function boundConnections(inner) {
|
|
1006
1003
|
return new BoundConnectionResolver(inner, currentBoundConnections, (connectionId, request) => {
|
|
@@ -1013,10 +1010,7 @@ function createBlockExecutor(host, secrets, attachments, pieceStore) {
|
|
|
1013
1010
|
egress: configuredEgress(),
|
|
1014
1011
|
worker: currentPieceWorker,
|
|
1015
1012
|
resolver: pieceResolver(),
|
|
1016
|
-
packages:
|
|
1017
|
-
await packagePieces.ready();
|
|
1018
|
-
return packagePieces.versions();
|
|
1019
|
-
},
|
|
1013
|
+
packages: () => Promise.resolve(packagePieces.versions()),
|
|
1020
1014
|
reactor: new SubgraphReactorPort(host),
|
|
1021
1015
|
connections: boundConnections(new DocumentConnectionResolver(host, secrets)),
|
|
1022
1016
|
...pieceStore ? { pieceStore } : {},
|
|
@@ -2663,7 +2657,6 @@ var WorkflowRuntimeService = class {
|
|
|
2663
2657
|
return await this.endpointCount() > 0;
|
|
2664
2658
|
}
|
|
2665
2659
|
async updateRegistration(workflowId, state) {
|
|
2666
|
-
await packagePieces.ready();
|
|
2667
2660
|
const trigger = state.status === "ENABLED" ? state.trigger : void 0;
|
|
2668
2661
|
if (trigger?.blockType === "core#webhook") {
|
|
2669
2662
|
await this.registerWebhook(workflowId, trigger.config);
|
|
@@ -3340,7 +3333,6 @@ var WorkflowRuntimeService = class {
|
|
|
3340
3333
|
});
|
|
3341
3334
|
}
|
|
3342
3335
|
async pieceVersion(packageName) {
|
|
3343
|
-
await packagePieces.ready();
|
|
3344
3336
|
const local = packagePieces.lookup(packageName);
|
|
3345
3337
|
if (local) return local.version;
|
|
3346
3338
|
try {
|
|
@@ -3361,7 +3353,6 @@ var WorkflowRuntimeService = class {
|
|
|
3361
3353
|
return result;
|
|
3362
3354
|
}
|
|
3363
3355
|
async localPieces() {
|
|
3364
|
-
await packagePieces.ready();
|
|
3365
3356
|
return (await Promise.all(packagePieces.entries().map(async (piece) => {
|
|
3366
3357
|
try {
|
|
3367
3358
|
return {
|
|
@@ -3375,7 +3366,6 @@ var WorkflowRuntimeService = class {
|
|
|
3375
3366
|
}))).filter((entry) => entry !== void 0);
|
|
3376
3367
|
}
|
|
3377
3368
|
async localPiece(packageName) {
|
|
3378
|
-
await packagePieces.ready();
|
|
3379
3369
|
const piece = packagePieces.lookup(packageName);
|
|
3380
3370
|
if (!piece) return void 0;
|
|
3381
3371
|
return {
|
|
@@ -3418,7 +3408,6 @@ var WorkflowRuntimeService = class {
|
|
|
3418
3408
|
return local ? detailResult(local.descriptor, local.piece.name, local.piece.version) : fetchPieceDetail(packageName);
|
|
3419
3409
|
}
|
|
3420
3410
|
async blockDescriptor(blockType) {
|
|
3421
|
-
await packagePieces.ready();
|
|
3422
3411
|
const parsed = parseBlockType(blockType, packagePieces.versions());
|
|
3423
3412
|
if (!parsed) return null;
|
|
3424
3413
|
const descriptor = await this.pieceDescriptor(parsed.packageName, parsed.version);
|
|
@@ -3463,7 +3452,6 @@ var WorkflowRuntimeService = class {
|
|
|
3463
3452
|
await this.host.assertCanWrite(documentId, ctx);
|
|
3464
3453
|
}
|
|
3465
3454
|
async blockOptions(blockType, propName, input, connectionId, ctx) {
|
|
3466
|
-
await packagePieces.ready();
|
|
3467
3455
|
const parsed = parseBlockType(blockType, packagePieces.versions());
|
|
3468
3456
|
if (!parsed) throw new Error(`Not a piece block type: "${blockType}"`);
|
|
3469
3457
|
let auth;
|
|
@@ -3488,7 +3476,6 @@ var WorkflowRuntimeService = class {
|
|
|
3488
3476
|
}, piece.local ? { hostCalls: reactorHandlers(new ScopedDesignTimeReactorPort(this.host, ctx)) } : {})).output;
|
|
3489
3477
|
}
|
|
3490
3478
|
async blockOutputTree(blockType, config) {
|
|
3491
|
-
await packagePieces.ready();
|
|
3492
3479
|
const record = config ?? {};
|
|
3493
3480
|
switch (blockType) {
|
|
3494
3481
|
case "core#manual": return {
|
|
@@ -3613,7 +3600,6 @@ var WorkflowRuntimeService = class {
|
|
|
3613
3600
|
const trigger = (await this.host.reactorClient.get(workflowId)).state.global.trigger;
|
|
3614
3601
|
if (!trigger) throw new Error("Workflow has no trigger");
|
|
3615
3602
|
if (trigger.connectionId) await this.assertCanReadDocument(trigger.connectionId, ctx);
|
|
3616
|
-
await packagePieces.ready();
|
|
3617
3603
|
const binding = this.pieceBinding(workflowId, trigger);
|
|
3618
3604
|
if (!binding) throw new Error(`"${trigger.blockType}" is not a piece trigger`);
|
|
3619
3605
|
return this.supervisor().test(binding);
|