@powerhousedao/reactor-workflow 6.2.3-dev.85 → 6.2.3-dev.87
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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -7
- package/dist/index.js.map +1 -1
- package/dist/{piece-registry-DNIk31Vv.d.ts → piece-registry-C1Pc0hD6.d.ts} +2 -1
- package/dist/{piece-registry-DNIk31Vv.d.ts.map → piece-registry-C1Pc0hD6.d.ts.map} +1 -1
- package/dist/{telemetry-B5OOpfCS.js → telemetry-B5nuWvdf.js} +20 -2
- package/dist/telemetry-B5nuWvdf.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/worker-entry.js +5 -1
- package/dist/worker-entry.js.map +1 -1
- package/package.json +7 -7
- package/dist/telemetry-B5OOpfCS.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as containsRedactedMarker, A as AttachmentCache, B as SecretCreatorMismatchError, C as blockLabel, Ct as isIndeterminateError, D as describeBuiltinPiece, E as builtinPiece, F as shapeConnection, G as secretRefFromId, H as SecretNotFoundError, I as resolveStepInput, J as PieceWorkerPool, K as stepBlock, L as expressionsIn, N as declaredConnectionIds, O as CORE_PIECE_NAME, P as declaredReactorConnectionIds, Q as PieceWorkerTimeoutError, R as unavailableValue, S as storeHandlers, St as setPieceRegistryUrl, T as blockPorts, U as SecretOwnerMismatchError, V as SecretDeletedError, W as parseSecretRef, X as PieceWorkerDisposedError, Y as PieceWorker, Z as PieceWorkerError, _ as effectiveRetryPolicy, _t as unsupportedTrigger, a as PieceRegistry, at as isPrivateAddress, b as isHostBound, bt as npmRegistryBaseUrl, c as packagePieces, ct as FileTooLargeError, d as runWorkflow, dt as pieceModuleRef, et as redact, f as canonicalJson, ft as sourcedResolver, g as checkDynamicProperties, gt as unsupportedAuth, h as DynamicPropertiesError, ht as authMethodFor, i as tracedSteps, it as DEFAULT_EGRESS_POLICY, j as BoundConnectionResolver, k as CORE_PIECE_VERSION, lt as maxFileBytes, m as stepConfigHash, mt as UnsupportedPieceFeatureError, n as WorkflowTelemetry, nt as rememberSecrets, o as installedPiece, ot as parseAddress, p as hashOf, q as triggerBlock, r as tracedMethods, rt as secretsFor, s as installedPieces, st as extractDedupeKey, t as TELEMETRY_SCOPE, tt as redactMessage, u as errorNameOf, ut as bundleResolver, v as ActivepiecesBlockExecutor, w as unpinnedNote, x as resolvedBlock, xt as pieceRegistrySource, y as CompositeBlockExecutor } from "./telemetry-
|
|
1
|
+
import { $ as containsRedactedMarker, A as AttachmentCache, B as SecretCreatorMismatchError, C as blockLabel, Ct as isIndeterminateError, D as describeBuiltinPiece, E as builtinPiece, F as shapeConnection, G as secretRefFromId, H as SecretNotFoundError, I as resolveStepInput, J as PieceWorkerPool, K as stepBlock, L as expressionsIn, N as declaredConnectionIds, O as CORE_PIECE_NAME, P as declaredReactorConnectionIds, Q as PieceWorkerTimeoutError, R as unavailableValue, S as storeHandlers, St as setPieceRegistryUrl, T as blockPorts, U as SecretOwnerMismatchError, V as SecretDeletedError, W as parseSecretRef, X as PieceWorkerDisposedError, Y as PieceWorker, Z as PieceWorkerError, _ as effectiveRetryPolicy, _t as unsupportedTrigger, a as PieceRegistry, at as isPrivateAddress, b as isHostBound, bt as npmRegistryBaseUrl, c as packagePieces, ct as FileTooLargeError, d as runWorkflow, dt as pieceModuleRef, et as redact, f as canonicalJson, ft as sourcedResolver, g as checkDynamicProperties, gt as unsupportedAuth, h as DynamicPropertiesError, ht as authMethodFor, i as tracedSteps, it as DEFAULT_EGRESS_POLICY, j as BoundConnectionResolver, k as CORE_PIECE_VERSION, lt as maxFileBytes, m as stepConfigHash, mt as UnsupportedPieceFeatureError, n as WorkflowTelemetry, nt as rememberSecrets, o as installedPiece, ot as parseAddress, p as hashOf, q as triggerBlock, r as tracedMethods, rt as secretsFor, s as installedPieces, st as extractDedupeKey, t as TELEMETRY_SCOPE, tt as redactMessage, u as errorNameOf, ut as bundleResolver, v as ActivepiecesBlockExecutor, w as unpinnedNote, x as resolvedBlock, xt as pieceRegistrySource, y as CompositeBlockExecutor } from "./telemetry-B5nuWvdf.js";
|
|
2
2
|
import { DENIED_ACTION_INDEXES, ReactorAccessDeniedError, ReactorAccessDeniedError as ReactorAccessDeniedError$1, ReactorJobFailedError, ReactorJobPendingError as ReactorJobPendingError$1, WebhookHandshakeStrategy, assertActionsApplied } from "@powerhousedao/pieces-framework";
|
|
3
3
|
import { mkdirSync, openAsBlob, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { open, readFile, readdir, rm, stat } from "node:fs/promises";
|
|
@@ -12,6 +12,7 @@ import net from "node:net";
|
|
|
12
12
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13
13
|
import { hostname } from "node:os";
|
|
14
14
|
import { blockKey, compareVersions, isExactVersion, rankClosestVersions } from "@powerhousedao/pieces-framework/block-type";
|
|
15
|
+
import { BaseReadModel, JobStatus, PropagationMode, WriteHandleFactory, createEmptyDocument, defaultReadModelIndexingConfig, deleteDocumentAction, isPurgeMarker, jobIdsOf, placeholderJob, registerTelemetryGauge, remoteStagePort } from "@powerhousedao/reactor";
|
|
15
16
|
import { actions, isReactorConnectorId, parseReactorConnectionConfig } from "@powerhousedao/workflow/document-models/connection";
|
|
16
17
|
import http, { validateHeaderName, validateHeaderValue } from "node:http";
|
|
17
18
|
import https from "node:https";
|
|
@@ -19,7 +20,6 @@ import { actions as actions$1, reducer, utils } from "@powerhousedao/workflow/do
|
|
|
19
20
|
import { Kind, parse } from "graphql";
|
|
20
21
|
import { ReactorHostServer } from "@powerhousedao/reactor/rpc";
|
|
21
22
|
import { SpanStatusCode, context } from "@opentelemetry/api";
|
|
22
|
-
import { BaseReadModel, JobStatus, PropagationMode, WriteHandleFactory, createEmptyDocument, defaultReadModelIndexingConfig, deleteDocumentAction, isPurgeMarker, jobIdsOf, placeholderJob, remoteStagePort } from "@powerhousedao/reactor";
|
|
23
23
|
import { isFolderNode } from "@powerhousedao/shared/document-drive";
|
|
24
24
|
import { DOCUMENT_SCOPE_ACTION_TYPES, initializeAuth, normalizeDocumentModelVersion, withSignaturePolicy } from "@powerhousedao/shared/document-model";
|
|
25
25
|
import { performance as performance$1 } from "node:perf_hooks";
|
|
@@ -439,6 +439,12 @@ function tokenSetFrom(response, context, previous) {
|
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
|
+
function relayEgress(egress) {
|
|
443
|
+
return {
|
|
444
|
+
...egress,
|
|
445
|
+
allowPrivateAddresses: true
|
|
446
|
+
};
|
|
447
|
+
}
|
|
442
448
|
async function exchangeCode(attempt, code, clientSecret, egress, fromRegistry = false) {
|
|
443
449
|
const method = authorizationMethod(attempt.authorization_method);
|
|
444
450
|
const auth = clientAuth$1(method, attempt.client_id, clientSecret);
|
|
@@ -448,7 +454,7 @@ async function exchangeCode(attempt, code, clientSecret, egress, fromRegistry =
|
|
|
448
454
|
redirect_uri: attempt.redirect_uri,
|
|
449
455
|
...attempt.code_verifier ? { code_verifier: attempt.code_verifier } : {},
|
|
450
456
|
...auth.form
|
|
451
|
-
}, auth.headers, egress), {
|
|
457
|
+
}, auth.headers, clientSecret === null ? relayEgress(egress) : egress), {
|
|
452
458
|
token_url: attempt.token_url,
|
|
453
459
|
authorization_method: method,
|
|
454
460
|
redirect_url: attempt.redirect_uri,
|
|
@@ -523,7 +529,7 @@ var StoreTokenRefresher = class {
|
|
|
523
529
|
grant_type: "refresh_token",
|
|
524
530
|
refresh_token: tokens.refresh_token,
|
|
525
531
|
...auth.form
|
|
526
|
-
}, auth.headers, this.egress);
|
|
532
|
+
}, auth.headers, tokens.relayed ? relayEgress(this.egress) : this.egress);
|
|
527
533
|
} catch (error) {
|
|
528
534
|
const detail = error instanceof Error ? error.message : String(error);
|
|
529
535
|
if (!tokenExpired(tokens, Math.round(Date.now() / 1e3))) {
|
|
@@ -2585,7 +2591,11 @@ const REFUSED_WRITE = {
|
|
|
2585
2591
|
removeRelationship: true,
|
|
2586
2592
|
moveRelationship: true,
|
|
2587
2593
|
deleteDocuments: true,
|
|
2588
|
-
loadBatch: true
|
|
2594
|
+
loadBatch: true,
|
|
2595
|
+
undo: true,
|
|
2596
|
+
redo: true,
|
|
2597
|
+
undoRedoTargets: true,
|
|
2598
|
+
undoRedoAvailability: true
|
|
2589
2599
|
};
|
|
2590
2600
|
const SERVED_READ = {
|
|
2591
2601
|
waitForJob: true,
|
|
@@ -2614,7 +2624,11 @@ const REFUSED = {
|
|
|
2614
2624
|
isDocumentIdTaken: true,
|
|
2615
2625
|
isServed: true,
|
|
2616
2626
|
getCreateSignaturePolicy: true,
|
|
2617
|
-
getCreateProtocolVersions: true
|
|
2627
|
+
getCreateProtocolVersions: true,
|
|
2628
|
+
undo: true,
|
|
2629
|
+
redo: true,
|
|
2630
|
+
undoRedoTargets: true,
|
|
2631
|
+
undoRedoAvailability: true
|
|
2618
2632
|
};
|
|
2619
2633
|
function servedClient(client) {
|
|
2620
2634
|
const facade = served(client, SERVED, REFUSED, "");
|
|
@@ -13480,7 +13494,12 @@ var WorkflowRuntimeService = class {
|
|
|
13480
13494
|
pool.dispose();
|
|
13481
13495
|
return this.pieceWorkers = pool;
|
|
13482
13496
|
}
|
|
13483
|
-
|
|
13497
|
+
const unobservePool = this.telemetry.observeWorkerPool(() => pool.stats());
|
|
13498
|
+
const unregisterGauge = registerTelemetryGauge("workflow.pool", () => pool.memoryStats());
|
|
13499
|
+
this.unobservePool = () => {
|
|
13500
|
+
unobservePool();
|
|
13501
|
+
unregisterGauge();
|
|
13502
|
+
};
|
|
13484
13503
|
return this.pieceWorkers = pool;
|
|
13485
13504
|
}
|
|
13486
13505
|
dispatcher() {
|