@fluidgrids/workflows 2026.1028.2 → 2026.1030.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/README.md +181 -11
- package/dist/{activation-BBh1p82z.d.cts → activation-DqUfpHzk.d.cts} +1 -1
- package/dist/{activation-DnhG7SmF.d.ts → activation-xpx1oWuo.d.ts} +1 -1
- package/dist/{chunk-VRHHBPT6.js → chunk-2D3MYIIF.js} +1212 -128
- package/dist/chunk-3U2NU7YC.cjs +124 -0
- package/dist/{chunk-NEIUQASE.cjs → chunk-4QKB4ARC.cjs} +3 -3
- package/dist/{chunk-GBQ33SIZ.cjs → chunk-54FLQNUM.cjs} +12 -1
- package/dist/chunk-5HIVIV53.js +330 -0
- package/dist/chunk-5MFVJM76.js +1222 -0
- package/dist/{chunk-JD2VQIDZ.cjs → chunk-672KMMBK.cjs} +2 -2
- package/dist/{chunk-C5OLWZ42.js → chunk-6A2FGSUS.js} +22 -14
- package/dist/{chunk-XKJA7KX3.js → chunk-6OLN6BMB.js} +52 -3
- package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
- package/dist/{chunk-2J6TF7YI.cjs → chunk-A5SXCA62.cjs} +10 -3
- package/dist/{chunk-BO6OVILK.js → chunk-AC6ZEXVR.js} +10 -4
- package/dist/{chunk-ABFZWYHT.js → chunk-AE5Q6ZAJ.js} +315 -50
- package/dist/chunk-C4F5KJTI.js +293 -0
- package/dist/{chunk-IISBRUWJ.js → chunk-G5H32GIG.js} +1 -1
- package/dist/chunk-GEQDGUGB.cjs +2719 -0
- package/dist/{chunk-XHXIDVEC.js → chunk-HCM7ZC7Q.js} +1 -1
- package/dist/chunk-HMZUGSMU.cjs +1554 -0
- package/dist/{chunk-SAOBPYYJ.cjs → chunk-IQPXHQQQ.cjs} +8 -4
- package/dist/{chunk-P6TA5EZT.cjs → chunk-ISOIA7NV.cjs} +335 -58
- package/dist/chunk-JSC75O5C.cjs +167 -0
- package/dist/chunk-M272AHEX.js +25 -0
- package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
- package/dist/chunk-ODZ2IAR2.cjs +1247 -0
- package/dist/chunk-Q4MWQNJK.cjs +28 -0
- package/dist/{chunk-HWJZVOG7.js → chunk-SR7TR5KX.js} +6 -2
- package/dist/{chunk-FEW3JBYA.cjs → chunk-TCTE7DX5.cjs} +3 -3
- package/dist/{chunk-623FVQSN.cjs → chunk-TYF56RGB.cjs} +123 -0
- package/dist/chunk-VA4OFR72.cjs +324 -0
- package/dist/chunk-VU5S5A7V.js +150 -0
- package/dist/chunk-YEHR4NNE.js +1522 -0
- package/dist/{chunk-FMSW2HDF.cjs → chunk-ZCGKGDCL.cjs} +23 -15
- package/dist/codegen/index.d.cts +2 -2
- package/dist/codegen/index.d.ts +2 -2
- package/dist/collect-6NIEufHd.d.ts +103 -0
- package/dist/collect-CcTCKqx6.d.cts +103 -0
- package/dist/{file-BOoHZgoQ.d.cts → file-BxYpwjRQ.d.cts} +1007 -21
- package/dist/{file-yuPCFU5b.d.ts → file-CFdPQJI9.d.ts} +1007 -21
- package/dist/history/index.cjs +375 -86
- package/dist/history/index.d.cts +590 -12
- package/dist/history/index.d.ts +590 -12
- package/dist/history/index.js +50 -4
- package/dist/index.cjs +156 -50
- package/dist/index.d.cts +38 -58
- package/dist/index.d.ts +38 -58
- package/dist/index.js +6 -4
- package/dist/interceptors-CNcr2dlk.d.ts +159 -0
- package/dist/interceptors-CqkNZVfI.d.cts +159 -0
- package/dist/ir/index.cjs +362 -38
- package/dist/ir/index.d.cts +282 -7
- package/dist/ir/index.d.ts +282 -7
- package/dist/ir/index.js +329 -23
- package/dist/{lower-BzmUz0sq.d.cts → lower-BtRfIW2A.d.cts} +56 -8
- package/dist/{lower-_-iT4HYs.d.ts → lower-CpsMFOFX.d.ts} +56 -8
- package/dist/{manifest-C8N6HDYl.d.ts → manifest-D-I_twys.d.ts} +1 -1
- package/dist/{manifest-0OLw0i7k.d.cts → manifest-DahBQVM8.d.cts} +1 -1
- package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
- package/dist/node-evaluator-LEEVD7H7.js +14 -0
- package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
- package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
- package/dist/quickjs/index.cjs +28 -27
- package/dist/quickjs/index.d.cts +6 -6
- package/dist/quickjs/index.d.ts +6 -6
- package/dist/quickjs/index.js +10 -9
- package/dist/roundtrip/index.cjs +259 -51
- package/dist/roundtrip/index.d.cts +100 -9
- package/dist/roundtrip/index.d.ts +100 -9
- package/dist/roundtrip/index.js +177 -11
- package/dist/runtime/index.cjs +21 -20
- package/dist/runtime/index.d.cts +184 -15
- package/dist/runtime/index.d.ts +184 -15
- package/dist/runtime/index.js +8 -7
- package/dist/testing/index.cjs +1122 -115
- package/dist/testing/index.d.cts +294 -13
- package/dist/testing/index.d.ts +294 -13
- package/dist/testing/index.js +1086 -84
- package/dist/{types-DV-HX_Gt.d.ts → types-Bv2i4cBX.d.cts} +244 -33
- package/dist/{types-CpBBjaGX.d.cts → types-DGx-b9eq.d.ts} +244 -33
- package/dist/{types-BGoPzgcl.d.ts → types-V7jEEUaL.d.cts} +20 -1
- package/dist/{types-BGoPzgcl.d.cts → types-V7jEEUaL.d.ts} +20 -1
- package/dist/{workflow-Bpr3vnA_.d.ts → workflow-B18OeF7g.d.ts} +2 -2
- package/dist/workflow-BGnv8SS6.d.ts +803 -0
- package/dist/{workflow-FXUkpIBc.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
- package/dist/workflow-DS32Gtws.d.cts +803 -0
- package/fixtures/histories/activity-options-updated.history.json +159 -0
- package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
- package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
- package/fixtures/histories/benign-failure.history.json +146 -0
- package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
- package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
- package/fixtures/histories/child-options-roundtrip.history.json +192 -0
- package/fixtures/histories/codec-opaque.history.json +229 -0
- package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
- package/fixtures/histories/continue-as-new-options.history.json +99 -0
- package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
- package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
- package/fixtures/histories/dynamic-workflow.history.json +150 -0
- package/fixtures/histories/execution-timeout-chain.history.json +98 -0
- package/fixtures/histories/external-cancel-resolved.history.json +123 -0
- package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
- package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
- package/fixtures/histories/handler-drain-warn.history.json +222 -0
- package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
- package/fixtures/histories/interceptor-headers.history.json +339 -0
- package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
- package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
- package/fixtures/histories/local-activity-completed.history.json +157 -0
- package/fixtures/histories/local-activity-failed.history.json +93 -0
- package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
- package/fixtures/histories/query-custom.history.json +213 -0
- package/fixtures/histories/query-default-handler.history.json +120 -0
- package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
- package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
- package/fixtures/histories/run-retry-last-failure.history.json +90 -0
- package/fixtures/histories/run-timeout.history.json +159 -0
- package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
- package/fixtures/histories/search-attributes-upserted.history.json +177 -0
- package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
- package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
- package/fixtures/histories/update-accepted-completed.history.json +45 -30
- package/fixtures/histories/update-default-handler.history.json +246 -0
- package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
- package/fixtures/histories/update-not-handled.history.json +138 -0
- package/fixtures/histories/update-rejected-no-event.history.json +190 -0
- package/fixtures/histories/update-with-start-admitted.history.json +150 -0
- package/fixtures/histories/user-activity-cancel.history.json +149 -0
- package/fixtures/histories/user-activity-retry.history.json +143 -0
- package/fixtures/histories/user-activity.history.json +149 -0
- package/package.json +1 -1
- package/schema/bridge-v2.schema.json +1062 -0
- package/schema/history-file.schema.json +538 -83
- package/schema/ir-v2.schema.json +290 -0
- package/schema/payload-fields.json +162 -0
- package/schema/run-event.schema.json +503 -82
- package/schema/workflow-command.schema.json +372 -69
- package/schema/workflow-task.schema.json +924 -171
- package/dist/assemble-BLqQ8lSu.d.cts +0 -39
- package/dist/assemble-DWgaXHd-.d.ts +0 -39
- package/dist/chunk-DHTLALBL.cjs +0 -80
- package/dist/chunk-DJYMDLV5.js +0 -227
- package/dist/chunk-I5LR3D2K.js +0 -869
- package/dist/chunk-M4BBAERY.cjs +0 -1635
- package/dist/chunk-N23SKIG4.js +0 -73
- package/dist/chunk-PZCVF76Q.cjs +0 -868
- package/dist/chunk-QQ6ULXHI.cjs +0 -885
- package/dist/chunk-UK3WM7YZ.cjs +0 -75
- package/dist/chunk-VOKMAAJP.js +0 -848
- package/dist/node-evaluator-4MSDKWOG.cjs +0 -22
- package/dist/node-evaluator-SX4LEYQC.js +0 -12
- package/dist/workflow-C2a05WUJ.d.ts +0 -444
- package/dist/workflow-J-yYixny.d.cts +0 -444
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// src/history/payload-fields.ts
|
|
2
|
+
var ENCODED_PAYLOAD_MARKER = "$fgp";
|
|
3
|
+
var ENCODED_PAYLOAD_VERSION = 1;
|
|
4
|
+
var PAYLOAD_ENCODINGS = [
|
|
5
|
+
"json/plain",
|
|
6
|
+
"binary/plain",
|
|
7
|
+
"binary/encrypted",
|
|
8
|
+
"kms/envelope"
|
|
9
|
+
];
|
|
10
|
+
var ENCODED_KEYS = /* @__PURE__ */ new Set(["$fgp", "encoding", "metadata", "data"]);
|
|
11
|
+
var BASE64 = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
12
|
+
function isEncodedPayload(value) {
|
|
13
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
14
|
+
const record = value;
|
|
15
|
+
if (record[ENCODED_PAYLOAD_MARKER] !== ENCODED_PAYLOAD_VERSION) return false;
|
|
16
|
+
if (!Object.keys(record).every((key) => ENCODED_KEYS.has(key))) return false;
|
|
17
|
+
const encoding = record["encoding"];
|
|
18
|
+
if (typeof encoding !== "string" || encoding === "" || encoding === "json/plain") return false;
|
|
19
|
+
const data = record["data"];
|
|
20
|
+
if (typeof data !== "string" || data.length % 4 !== 0 || !BASE64.test(data)) return false;
|
|
21
|
+
const metadata = record["metadata"];
|
|
22
|
+
if (metadata === void 0) return true;
|
|
23
|
+
if (typeof metadata !== "object" || metadata === null || Array.isArray(metadata)) return false;
|
|
24
|
+
return Object.values(metadata).every((entry) => typeof entry === "string");
|
|
25
|
+
}
|
|
26
|
+
function payloadEncodingOf(value) {
|
|
27
|
+
return isEncodedPayload(value) ? value.encoding : "json/plain";
|
|
28
|
+
}
|
|
29
|
+
var PAYLOAD_FIELDS = {
|
|
30
|
+
WORKFLOW_STARTED: ["/input", "/lastCompletionResult", "/context"],
|
|
31
|
+
ACTIVITY_SCHEDULED: ["/args"],
|
|
32
|
+
ACTIVITY_HEARTBEAT: ["/details"],
|
|
33
|
+
ACTIVITY_COMPLETED: ["/result"],
|
|
34
|
+
ACTIVITY_CANCELLED: ["/details"],
|
|
35
|
+
SIGNAL_RECEIVED: ["/payload"],
|
|
36
|
+
UPDATE_ADMITTED: ["/args"],
|
|
37
|
+
UPDATE_ACCEPTED: ["/args"],
|
|
38
|
+
UPDATE_COMPLETED: ["/result"],
|
|
39
|
+
CHILD_RUN_INITIATED: ["/input", "/options/context"],
|
|
40
|
+
CHILD_RUN_COMPLETED: ["/result"],
|
|
41
|
+
EXTERNAL_RUN_SIGNALED: ["/payload"],
|
|
42
|
+
SIDE_EFFECT_RECORDED: ["/value"],
|
|
43
|
+
LOCAL_ACTIVITY_COMPLETED: ["/result"],
|
|
44
|
+
CONTEXT_UPSERTED: ["/entries"],
|
|
45
|
+
MARKER_RECORDED: ["/data/currentDetails"],
|
|
46
|
+
WORKFLOW_COMPLETED: ["/output"],
|
|
47
|
+
WORKFLOW_CANCELLED: ["/details"],
|
|
48
|
+
WORKFLOW_CONTINUED_AS_NEW: ["/input", "/options/context"]
|
|
49
|
+
};
|
|
50
|
+
var FAILURE_FIELDS = {
|
|
51
|
+
WORKFLOW_STARTED: ["/lastFailure"],
|
|
52
|
+
ACTIVITY_FAILED: ["/failure"],
|
|
53
|
+
ACTIVITY_TIMED_OUT: ["/failure"],
|
|
54
|
+
UPDATE_COMPLETED: ["/failure"],
|
|
55
|
+
CHILD_RUN_FAILED: ["/failure"],
|
|
56
|
+
EXTERNAL_RUN_SIGNALED: ["/failure"],
|
|
57
|
+
EXTERNAL_RUN_CANCEL_RESOLVED: ["/failure"],
|
|
58
|
+
LOCAL_ACTIVITY_FAILED: ["/failure"],
|
|
59
|
+
WORKFLOW_FAILED: ["/failure"],
|
|
60
|
+
WORKFLOW_TIMED_OUT: ["/failure"]
|
|
61
|
+
};
|
|
62
|
+
var COMMAND_PAYLOAD_FIELDS = {
|
|
63
|
+
SCHEDULE_ACTIVITY: ["/args"],
|
|
64
|
+
START_CHILD_RUN: ["/input", "/options/context"],
|
|
65
|
+
SIGNAL_RUN: ["/payload"],
|
|
66
|
+
RECORD_SIDE_EFFECT: ["/value"],
|
|
67
|
+
RECORD_MARKER: ["/data/currentDetails"],
|
|
68
|
+
COMPLETE_WORKFLOW: ["/output"],
|
|
69
|
+
UPSERT_CONTEXT: ["/entries"],
|
|
70
|
+
RECORD_LOCAL_ACTIVITY: ["/result"],
|
|
71
|
+
CONTINUE_AS_NEW: ["/input", "/options/context"],
|
|
72
|
+
COMPLETE_UPDATE: ["/result"]
|
|
73
|
+
};
|
|
74
|
+
var COMMAND_FAILURE_FIELDS = {
|
|
75
|
+
FAIL_WORKFLOW: ["/failure"],
|
|
76
|
+
RECORD_LOCAL_ACTIVITY: ["/failure"],
|
|
77
|
+
REJECT_UPDATE: ["/failure"],
|
|
78
|
+
COMPLETE_UPDATE: ["/failure"]
|
|
79
|
+
};
|
|
80
|
+
var FAILURE_PAYLOAD_FIELDS = ["/details"];
|
|
81
|
+
var FAILURE_CAUSE_FIELD = "/cause";
|
|
82
|
+
var PAYLOAD_FIELDS_FORMAT = "fluidgrids.payload-fields";
|
|
83
|
+
var PAYLOAD_FIELDS_DOCUMENT = {
|
|
84
|
+
format: PAYLOAD_FIELDS_FORMAT,
|
|
85
|
+
formatVersion: 2,
|
|
86
|
+
description: 'JSON pointers of user payloads per event type (relative to the payload) and per command type (relative to the command). `events` and `commands` are plain payload pointers. `eventFailures` and `commandFailures` point at failure objects: the payloads of a failure are the `failure.payloads` pointers relative to it, and the same rule applies again to the failure at `failure.cause` (recursively, to the end of the cause chain). Payload codecs and the at-rest envelope apply to these pointers only; everything else stays in clear text. A value that is not plain JSON is carried as {"$fgp": 1, "encoding", "metadata"?, "data" (base64)}.',
|
|
87
|
+
encodedMarker: ENCODED_PAYLOAD_MARKER,
|
|
88
|
+
encodedVersion: ENCODED_PAYLOAD_VERSION,
|
|
89
|
+
encodings: [...PAYLOAD_ENCODINGS],
|
|
90
|
+
events: PAYLOAD_FIELDS,
|
|
91
|
+
commands: COMMAND_PAYLOAD_FIELDS,
|
|
92
|
+
eventFailures: FAILURE_FIELDS,
|
|
93
|
+
commandFailures: COMMAND_FAILURE_FIELDS,
|
|
94
|
+
failure: { payloads: FAILURE_PAYLOAD_FIELDS, cause: FAILURE_CAUSE_FIELD }
|
|
95
|
+
};
|
|
96
|
+
function tokensOf(pointer) {
|
|
97
|
+
if (pointer === "") return [];
|
|
98
|
+
return pointer.slice(1).split("/").map((token) => token.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
99
|
+
}
|
|
100
|
+
function locate(root, pointer) {
|
|
101
|
+
const tokens = tokensOf(pointer);
|
|
102
|
+
const key = tokens.pop();
|
|
103
|
+
if (key === void 0) return void 0;
|
|
104
|
+
let holder = root;
|
|
105
|
+
for (const token of tokens) {
|
|
106
|
+
if (typeof holder !== "object" || holder === null || Array.isArray(holder)) return void 0;
|
|
107
|
+
holder = holder[token];
|
|
108
|
+
}
|
|
109
|
+
if (typeof holder !== "object" || holder === null || Array.isArray(holder)) return void 0;
|
|
110
|
+
const parent = holder;
|
|
111
|
+
if (!Object.hasOwn(parent, key) || parent[key] === void 0) return void 0;
|
|
112
|
+
return { parent, key };
|
|
113
|
+
}
|
|
114
|
+
function mapAt(root, pointer, fn) {
|
|
115
|
+
const found = locate(root, pointer);
|
|
116
|
+
if (found === void 0) return;
|
|
117
|
+
const current = found.parent[found.key];
|
|
118
|
+
if (current !== void 0) found.parent[found.key] = fn(current, pointer);
|
|
119
|
+
}
|
|
120
|
+
function mapFailureAt(root, pointer, fn) {
|
|
121
|
+
let failure = pointer;
|
|
122
|
+
for (; ; ) {
|
|
123
|
+
const found = locate(root, failure);
|
|
124
|
+
if (found === void 0) return;
|
|
125
|
+
const value = found.parent[found.key];
|
|
126
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return;
|
|
127
|
+
for (const field of FAILURE_PAYLOAD_FIELDS) mapAt(root, failure + field, fn);
|
|
128
|
+
failure += FAILURE_CAUSE_FIELD;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function mapPayloadFields(record, pointers, fn, failures = []) {
|
|
132
|
+
const copy = JSON.parse(JSON.stringify(record));
|
|
133
|
+
for (const pointer of pointers) mapAt(copy, pointer, fn);
|
|
134
|
+
for (const pointer of failures) mapFailureAt(copy, pointer, fn);
|
|
135
|
+
return copy;
|
|
136
|
+
}
|
|
137
|
+
function mapEventPayloads(type, payload, fn) {
|
|
138
|
+
return mapPayloadFields(payload, PAYLOAD_FIELDS[type] ?? [], fn, FAILURE_FIELDS[type] ?? []);
|
|
139
|
+
}
|
|
140
|
+
function mapCommandPayloads(command, fn) {
|
|
141
|
+
const record = command;
|
|
142
|
+
return mapPayloadFields(
|
|
143
|
+
record,
|
|
144
|
+
COMMAND_PAYLOAD_FIELDS[command.type] ?? [],
|
|
145
|
+
fn,
|
|
146
|
+
COMMAND_FAILURE_FIELDS[command.type] ?? []
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export { COMMAND_FAILURE_FIELDS, COMMAND_PAYLOAD_FIELDS, ENCODED_PAYLOAD_MARKER, ENCODED_PAYLOAD_VERSION, FAILURE_CAUSE_FIELD, FAILURE_FIELDS, FAILURE_PAYLOAD_FIELDS, PAYLOAD_ENCODINGS, PAYLOAD_FIELDS, PAYLOAD_FIELDS_DOCUMENT, PAYLOAD_FIELDS_FORMAT, isEncodedPayload, mapCommandPayloads, mapEventPayloads, mapPayloadFields, payloadEncodingOf };
|