@oomol-lab/open-flow 0.1.0-beta.10 → 0.1.0-beta.11
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/browser/DesignerIcon-ckcKnxxJ.js +2267 -0
- package/dist/browser/createResourceDialog-DhIU-HYW.js +111 -0
- package/dist/browser/{dist-meg_oHVR.js → dist-BZ5PTFAs.js} +335 -335
- package/dist/browser/dist-Bmb2mZvW.js +795 -0
- package/dist/browser/{dist-Cc0y2Pli.js → dist-Ce71Szg7.js} +622 -622
- package/dist/browser/dist-DSe6KRsr.js +1224 -0
- package/dist/browser/{dist-Dg_VXC8f.js → dist-DY4qlXTK.js} +134 -134
- package/dist/browser/{esm-yhVU_KbQ.js → esm-C64_h7HF.js} +59 -59
- package/dist/browser/flow-authoring-node.d.ts +11 -4
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +5018 -275
- package/dist/browser/flow-change-schema.d.ts +3 -0
- package/dist/browser/flow-change.d.ts +21 -8
- package/dist/browser/flow-change.js +5030 -155
- package/dist/browser/{flowChanges-B2ttnaj9.js → flowChanges-BINNGoug.js} +4397 -3766
- package/dist/browser/{flowRunInputEditorStore-DDidwd8h.js → flowRunInputEditorStore-NPGePkvP.js} +679 -689
- package/dist/browser/flowWorkspace-Dp_b8KXF.js +158409 -0
- package/dist/browser/{getPseudoElementBounds-5LArT6Xc.js → getPseudoElementBounds-Dfqo78k7.js} +691 -687
- package/dist/browser/{languages-DgJehE1g.js → languages-i3Xmpt6S.js} +6 -15
- package/dist/browser/licenses.md +82 -0
- package/dist/browser/{markdownContent-DUfLdnUt.js → markdownContent-BawLYUjh.js} +23 -23
- package/dist/browser/select-CbQHq-GM.js +6851 -0
- package/dist/browser/theme.css +34 -34
- package/dist/browser/{typeScriptSession-_TgJ_7Oq.js → typeScriptSession-BoV-FDl3.js} +257 -257
- package/dist/browser/waitNotificationInputs-fzyKN6mk.js +29 -0
- package/dist/browser/workbench-contract.d.ts +8 -2
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +1256 -1006
- package/dist/browser/workbenchSelect-BjbJjlNd.js +435 -0
- package/dist/common/control-api-conformance.js +234 -85
- package/dist/common/control-api.d.ts +37 -10
- package/dist/common/control-api.js +421 -342
- package/dist/common/engine-contract.d.ts +1 -1
- package/dist/common/flow-encoding.js +9 -7
- package/dist/common/flow-graph.d.ts +6 -0
- package/dist/common/flow-modules.d.ts +20 -0
- package/dist/common/flow-schema.d.ts +8 -0
- package/dist/common/flow-semantics.d.ts +6 -5
- package/dist/common/flow-semantics.js +14651 -9824
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/run-events.d.ts +2 -2
- package/dist/common/run-events.js +8 -15
- package/dist/common/runtime-contract.d.ts +9 -1
- package/dist/common/runtime-contract.js +137 -27
- package/dist/common/scheduler.d.ts +11 -33
- package/dist/common/scheduler.js +7227 -428
- package/dist/index.d.ts +5 -5
- package/package.json +1 -1
- package/dist/browser/DesignerIcon-DjgOMYI5.js +0 -2065
- package/dist/browser/createResourceDialog-DNBueSYZ.js +0 -505
- package/dist/browser/dist-BMRLCebL.js +0 -1893
- package/dist/browser/flowWorkspace-Dr8-Hut9.js +0 -45541
- package/dist/browser/icons-KIOgjHpD.js +0 -730
- package/dist/browser/waitNotificationInputs-BPulOxYt.js +0 -26
- package/dist/browser/workbenchSelect-CbXrdwxW.js +0 -1375
|
@@ -80,36 +80,57 @@ var e = {
|
|
|
80
80
|
"running",
|
|
81
81
|
"starting",
|
|
82
82
|
"waiting"
|
|
83
|
-
]
|
|
83
|
+
];
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/control/common/random.ts
|
|
86
|
+
function r() {
|
|
87
|
+
let e = globalThis.crypto;
|
|
88
|
+
if (e != null) {
|
|
89
|
+
try {
|
|
90
|
+
if (typeof e.randomUUID == "function") return e.randomUUID();
|
|
91
|
+
} catch {}
|
|
92
|
+
if (typeof e.getRandomValues == "function") {
|
|
93
|
+
let t = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
94
|
+
t[6] = (t[6] ?? 0) & 15 | 64, t[8] = (t[8] ?? 0) & 63 | 128;
|
|
95
|
+
let n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
96
|
+
return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/control/common/api.ts
|
|
103
|
+
var i = class extends Error {
|
|
84
104
|
constructor(e, t, n) {
|
|
85
105
|
super(n), this.code = t, this.name = "ApiError", this.status = e;
|
|
86
106
|
}
|
|
87
107
|
};
|
|
88
|
-
function
|
|
89
|
-
throw new
|
|
90
|
-
}
|
|
91
|
-
function a(e) {
|
|
92
|
-
return typeof e != "object" || !e || Array.isArray(e) ? i() : e;
|
|
108
|
+
function a() {
|
|
109
|
+
throw new i(502, "response.invalid", "The Control API returned an invalid response.");
|
|
93
110
|
}
|
|
94
111
|
function o(e) {
|
|
95
|
-
return typeof e
|
|
112
|
+
return typeof e != "object" || !e || Array.isArray(e) ? a() : e;
|
|
96
113
|
}
|
|
97
|
-
function s(e
|
|
98
|
-
|
|
99
|
-
(n.length != t.length || n.some((e) => !t.includes(e))) && i();
|
|
114
|
+
function s(e) {
|
|
115
|
+
return typeof e == "string" && e.length > 0 ? e : a();
|
|
100
116
|
}
|
|
101
|
-
function c(e) {
|
|
102
|
-
|
|
117
|
+
function c(e, t) {
|
|
118
|
+
let n = Object.keys(e);
|
|
119
|
+
(n.length != t.length || n.some((e) => !t.includes(e))) && a();
|
|
103
120
|
}
|
|
104
121
|
function l(e) {
|
|
105
|
-
|
|
106
|
-
if (Array.isArray(e)) return e.map(l);
|
|
107
|
-
let t = a(e);
|
|
108
|
-
return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, l(t)]));
|
|
122
|
+
return Number.isSafeInteger(e) ? e : a();
|
|
109
123
|
}
|
|
110
124
|
function u(e) {
|
|
111
|
-
|
|
112
|
-
|
|
125
|
+
if (e === null || typeof e == "boolean" || typeof e == "string" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
126
|
+
if (Array.isArray(e)) return e.map(u);
|
|
127
|
+
let t = o(e);
|
|
128
|
+
return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, u(t)]));
|
|
129
|
+
}
|
|
130
|
+
function d(e) {
|
|
131
|
+
let t = o(e);
|
|
132
|
+
c(t, [
|
|
133
|
+
...Object.hasOwn(t, "alias") ? ["alias"] : [],
|
|
113
134
|
"connectionId",
|
|
114
135
|
"displayName",
|
|
115
136
|
"isDefault",
|
|
@@ -117,40 +138,43 @@ function u(e) {
|
|
|
117
138
|
"status"
|
|
118
139
|
]);
|
|
119
140
|
let n = t.status;
|
|
120
|
-
return n != "active" && n != "disconnected" && n != "error" && n != "reauth_required" || typeof t.isDefault != "boolean" ?
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
return n != "active" && n != "disconnected" && n != "error" && n != "reauth_required" || typeof t.isDefault != "boolean" ? a() : {
|
|
142
|
+
...t.alias === void 0 ? {} : { alias: s(t.alias) },
|
|
143
|
+
connectionId: s(t.connectionId),
|
|
144
|
+
displayName: s(t.displayName),
|
|
123
145
|
isDefault: t.isDefault,
|
|
124
|
-
serviceId:
|
|
146
|
+
serviceId: s(t.serviceId),
|
|
125
147
|
status: n
|
|
126
148
|
};
|
|
127
149
|
}
|
|
128
|
-
function
|
|
129
|
-
let n =
|
|
130
|
-
return
|
|
150
|
+
function f(e, t = !1) {
|
|
151
|
+
let n = o(e), r = n.description, i = t && Object.hasOwn(n, "value");
|
|
152
|
+
return c(n, [
|
|
131
153
|
"jsonSchema",
|
|
132
154
|
"nullable",
|
|
133
155
|
...r == null ? [] : ["description"],
|
|
134
|
-
...
|
|
135
|
-
]), r != null && typeof r != "string" || typeof n.nullable != "boolean" ?
|
|
156
|
+
...i ? ["value"] : []
|
|
157
|
+
]), r != null && typeof r != "string" || typeof n.nullable != "boolean" ? a() : {
|
|
136
158
|
...r == null ? {} : { description: r },
|
|
137
|
-
jsonSchema:
|
|
159
|
+
jsonSchema: u(n.jsonSchema),
|
|
138
160
|
nullable: n.nullable,
|
|
139
|
-
...
|
|
161
|
+
...i ? { value: u(n.value) } : {}
|
|
140
162
|
};
|
|
141
163
|
}
|
|
142
|
-
function
|
|
143
|
-
return
|
|
164
|
+
function p(e) {
|
|
165
|
+
return f(e, !0);
|
|
144
166
|
}
|
|
145
|
-
function
|
|
146
|
-
return Object.fromEntries(Object.entries(
|
|
167
|
+
function m(e, t) {
|
|
168
|
+
return Object.fromEntries(Object.entries(o(e)).map(([e, n]) => [e, t(n)]));
|
|
147
169
|
}
|
|
148
|
-
function
|
|
149
|
-
let t =
|
|
150
|
-
if (
|
|
170
|
+
function h(e) {
|
|
171
|
+
let t = o(e), n = t.homepageUrl, r = t.icon, i = t.defaultConnection != null;
|
|
172
|
+
if (c(t, [
|
|
151
173
|
"actionId",
|
|
174
|
+
...Object.hasOwn(t, "inputSchema") ? ["inputSchema"] : [],
|
|
175
|
+
...Object.hasOwn(t, "outputSchema") ? ["outputSchema"] : [],
|
|
152
176
|
"authenticated",
|
|
153
|
-
...
|
|
177
|
+
...i ? ["defaultConnection"] : [],
|
|
154
178
|
"description",
|
|
155
179
|
...n == null ? [] : ["homepageUrl"],
|
|
156
180
|
...r == null ? [] : ["icon"],
|
|
@@ -159,65 +183,67 @@ function m(e) {
|
|
|
159
183
|
"outputs",
|
|
160
184
|
"serviceId",
|
|
161
185
|
"serviceName"
|
|
162
|
-
]), n != null && typeof n != "string" || r != null && typeof r != "string") return
|
|
186
|
+
]), n != null && typeof n != "string" || r != null && typeof r != "string") return a();
|
|
163
187
|
let l = {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
188
|
+
...t.inputSchema === void 0 ? {} : { inputSchema: u(t.inputSchema) },
|
|
189
|
+
...t.outputSchema === void 0 ? {} : { outputSchema: u(t.outputSchema) },
|
|
190
|
+
actionId: s(t.actionId),
|
|
191
|
+
authenticated: typeof t.authenticated == "boolean" ? t.authenticated : a(),
|
|
192
|
+
...i ? { defaultConnection: d(t.defaultConnection) } : {},
|
|
193
|
+
description: typeof t.description == "string" ? t.description : a(),
|
|
168
194
|
...n == null ? {} : { homepageUrl: n },
|
|
169
195
|
...r == null ? {} : { icon: r },
|
|
170
|
-
inputs:
|
|
171
|
-
name:
|
|
172
|
-
outputs:
|
|
173
|
-
serviceId:
|
|
174
|
-
serviceName:
|
|
196
|
+
inputs: m(t.inputs, p),
|
|
197
|
+
name: s(t.name),
|
|
198
|
+
outputs: m(t.outputs, f),
|
|
199
|
+
serviceId: s(t.serviceId),
|
|
200
|
+
serviceName: s(t.serviceName)
|
|
175
201
|
};
|
|
176
|
-
return l.defaultConnection != null && (l.defaultConnection.serviceId != l.serviceId || l.defaultConnection.status != "active") ?
|
|
202
|
+
return l.defaultConnection != null && (l.defaultConnection.serviceId != l.serviceId || l.defaultConnection.status != "active") ? a() : l;
|
|
177
203
|
}
|
|
178
|
-
function
|
|
179
|
-
let t =
|
|
180
|
-
return
|
|
204
|
+
function g(e) {
|
|
205
|
+
let t = o(e), n = t.homepageUrl, r = t.icon;
|
|
206
|
+
return c(t, [
|
|
181
207
|
"serviceId",
|
|
182
208
|
"serviceName",
|
|
183
209
|
...n == null ? [] : ["homepageUrl"],
|
|
184
210
|
...r == null ? [] : ["icon"]
|
|
185
|
-
]), n != null && typeof n != "string" || r != null && typeof r != "string" ?
|
|
211
|
+
]), n != null && typeof n != "string" || r != null && typeof r != "string" ? a() : {
|
|
186
212
|
...n == null ? {} : { homepageUrl: n },
|
|
187
213
|
...r == null ? {} : { icon: r },
|
|
188
|
-
serviceId:
|
|
189
|
-
serviceName:
|
|
214
|
+
serviceId: s(t.serviceId),
|
|
215
|
+
serviceName: s(t.serviceName)
|
|
190
216
|
};
|
|
191
217
|
}
|
|
192
|
-
function
|
|
193
|
-
let t =
|
|
194
|
-
return n != "integration" && n != "poll" ?
|
|
195
|
-
description: typeof t.description == "string" ? t.description :
|
|
196
|
-
displayName:
|
|
197
|
-
key:
|
|
198
|
-
name:
|
|
199
|
-
provider:
|
|
218
|
+
function _(e) {
|
|
219
|
+
let t = o(e), n = t.type;
|
|
220
|
+
return n != "integration" && n != "poll" ? a() : {
|
|
221
|
+
description: typeof t.description == "string" ? t.description : a(),
|
|
222
|
+
displayName: s(t.displayName),
|
|
223
|
+
key: s(t.key),
|
|
224
|
+
name: s(t.name),
|
|
225
|
+
provider: s(t.provider),
|
|
200
226
|
type: n
|
|
201
227
|
};
|
|
202
228
|
}
|
|
203
|
-
function
|
|
204
|
-
let t =
|
|
205
|
-
configSchema:
|
|
206
|
-
definitionVersion:
|
|
229
|
+
function v(e) {
|
|
230
|
+
let t = o(e), n = _(t), r = {
|
|
231
|
+
configSchema: u(t.configSchema),
|
|
232
|
+
definitionVersion: l(t.definitionVersion),
|
|
207
233
|
description: n.description,
|
|
208
234
|
displayName: n.displayName,
|
|
209
235
|
key: n.key,
|
|
210
236
|
name: n.name,
|
|
211
|
-
payloadSchema:
|
|
237
|
+
payloadSchema: u(t.payloadSchema),
|
|
212
238
|
provider: n.provider
|
|
213
239
|
};
|
|
214
240
|
if (n.type == "poll") return {
|
|
215
241
|
...r,
|
|
216
242
|
type: "poll"
|
|
217
243
|
};
|
|
218
|
-
let
|
|
219
|
-
if (!Array.isArray(
|
|
220
|
-
let d =
|
|
244
|
+
let i = o(t.endpoint), c = o(i.body);
|
|
245
|
+
if (!Array.isArray(i.methods) || !Array.isArray(c.formats) || typeof c.allowArray != "boolean" || typeof c.allowEmpty != "boolean") return a();
|
|
246
|
+
let d = i.methods.map(s), f = c.formats.map(s), p = l(i.successStatus);
|
|
221
247
|
return d.some((e) => ![
|
|
222
248
|
"DELETE",
|
|
223
249
|
"GET",
|
|
@@ -230,12 +256,12 @@ function _(e) {
|
|
|
230
256
|
"json",
|
|
231
257
|
"multipart",
|
|
232
258
|
"text"
|
|
233
|
-
].includes(e)) || p < 200 || p > 299 ?
|
|
259
|
+
].includes(e)) || p < 200 || p > 299 ? a() : {
|
|
234
260
|
...r,
|
|
235
261
|
endpoint: {
|
|
236
262
|
body: {
|
|
237
|
-
allowArray:
|
|
238
|
-
allowEmpty:
|
|
263
|
+
allowArray: c.allowArray,
|
|
264
|
+
allowEmpty: c.allowEmpty,
|
|
239
265
|
formats: f
|
|
240
266
|
},
|
|
241
267
|
methods: d,
|
|
@@ -244,18 +270,18 @@ function _(e) {
|
|
|
244
270
|
type: "integration"
|
|
245
271
|
};
|
|
246
272
|
}
|
|
247
|
-
var
|
|
273
|
+
var y = /* @__PURE__ */ new Set([
|
|
248
274
|
"cron",
|
|
249
275
|
"integration",
|
|
250
276
|
"poll",
|
|
251
277
|
"webhook"
|
|
252
|
-
]),
|
|
278
|
+
]), b = /* @__PURE__ */ new Set([
|
|
253
279
|
"failed",
|
|
254
280
|
"healthy",
|
|
255
281
|
"initializing",
|
|
256
282
|
"needs_reauth",
|
|
257
283
|
"suspended"
|
|
258
|
-
]),
|
|
284
|
+
]), x = /* @__PURE__ */ new Set([
|
|
259
285
|
"delivery.failed",
|
|
260
286
|
"health.failed",
|
|
261
287
|
"health.needs_reauth",
|
|
@@ -264,173 +290,194 @@ var v = /* @__PURE__ */ new Set([
|
|
|
264
290
|
"operator.paused",
|
|
265
291
|
"operator.resumed"
|
|
266
292
|
]);
|
|
267
|
-
function x(e) {
|
|
268
|
-
if (e != null) return o(e);
|
|
269
|
-
}
|
|
270
293
|
function S(e) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
294
|
+
if (e != null) return s(e);
|
|
295
|
+
}
|
|
296
|
+
function C(e) {
|
|
297
|
+
let t = o(e), n = t.health, r = t.kind, i = t.operatorState, c = l(t.runtimeVersion);
|
|
298
|
+
return t.version != 1 || typeof n != "string" || !b.has(n) || typeof r != "string" || !y.has(r) || i != "active" && i != "paused" || c <= 0 ? a() : {
|
|
299
|
+
...t.currentPublicationId == null ? {} : { currentPublicationId: s(t.currentPublicationId) },
|
|
300
|
+
...t.currentRevisionId == null ? {} : { currentRevisionId: s(t.currentRevisionId) },
|
|
301
|
+
...t.endpointUrl == null ? {} : { endpointUrl: s(t.endpointUrl) },
|
|
302
|
+
flowId: s(t.flowId),
|
|
277
303
|
health: n,
|
|
278
304
|
kind: r,
|
|
279
|
-
...t.lastErrorCode == null ? {} : { lastErrorCode:
|
|
280
|
-
operatorState:
|
|
281
|
-
runtimeVersion:
|
|
282
|
-
triggerNodeId:
|
|
283
|
-
updatedAt:
|
|
305
|
+
...t.lastErrorCode == null ? {} : { lastErrorCode: s(t.lastErrorCode) },
|
|
306
|
+
operatorState: i,
|
|
307
|
+
runtimeVersion: c,
|
|
308
|
+
triggerNodeId: s(t.triggerNodeId),
|
|
309
|
+
updatedAt: s(t.updatedAt),
|
|
284
310
|
version: 1
|
|
285
311
|
};
|
|
286
312
|
}
|
|
287
|
-
function
|
|
288
|
-
let t =
|
|
313
|
+
function ee(e) {
|
|
314
|
+
let t = o(e);
|
|
289
315
|
return t.version == 1 ? {
|
|
290
|
-
binding:
|
|
316
|
+
binding: C(t.binding),
|
|
291
317
|
version: 1
|
|
292
|
-
} :
|
|
318
|
+
} : a();
|
|
293
319
|
}
|
|
294
|
-
function
|
|
295
|
-
let t =
|
|
296
|
-
if (typeof n != "string" || !
|
|
297
|
-
let r =
|
|
298
|
-
return
|
|
299
|
-
activityId:
|
|
300
|
-
createdAt:
|
|
320
|
+
function te(e) {
|
|
321
|
+
let t = o(e), n = t.kind;
|
|
322
|
+
if (typeof n != "string" || !x.has(n)) return a();
|
|
323
|
+
let r = S(t.errorCode), i = S(t.errorMessage);
|
|
324
|
+
return i != null && i.length > 512 ? a() : {
|
|
325
|
+
activityId: s(t.activityId),
|
|
326
|
+
createdAt: s(t.createdAt),
|
|
301
327
|
...r == null ? {} : { errorCode: r },
|
|
302
|
-
...
|
|
328
|
+
...i == null ? {} : { errorMessage: i },
|
|
303
329
|
kind: n
|
|
304
330
|
};
|
|
305
331
|
}
|
|
306
|
-
function
|
|
307
|
-
let t =
|
|
308
|
-
return t.version != 1 || !Array.isArray(t.activities) ?
|
|
309
|
-
activities: t.activities.map(
|
|
332
|
+
function w(e) {
|
|
333
|
+
let t = o(e), n = S(t.nextCursor);
|
|
334
|
+
return t.version != 1 || !Array.isArray(t.activities) ? a() : {
|
|
335
|
+
activities: t.activities.map(te),
|
|
310
336
|
...n == null ? {} : { nextCursor: n },
|
|
311
337
|
version: 1
|
|
312
338
|
};
|
|
313
339
|
}
|
|
314
|
-
function
|
|
315
|
-
let t =
|
|
316
|
-
return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ?
|
|
340
|
+
function T(e) {
|
|
341
|
+
let t = o(e), n = l(t.filtered);
|
|
342
|
+
return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? a() : {
|
|
317
343
|
events: t.events.map((e) => {
|
|
318
|
-
let t =
|
|
319
|
-
return Object.fromEntries(Object.entries(t).map(([e, t]) => [e,
|
|
344
|
+
let t = o(e);
|
|
345
|
+
return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, u(t)]));
|
|
320
346
|
}),
|
|
321
347
|
filtered: n,
|
|
322
348
|
hasMore: t.hasMore,
|
|
323
349
|
version: 1
|
|
324
350
|
};
|
|
325
351
|
}
|
|
326
|
-
function
|
|
327
|
-
let t =
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
352
|
+
function E(e) {
|
|
353
|
+
let t = o(e), n = t.status;
|
|
354
|
+
if (t.version != 1 || n != "active" && n != "retiring") return a();
|
|
355
|
+
let r = t.live == null ? void 0 : o(t.live);
|
|
356
|
+
return r != null && typeof r.enabled != "boolean" ? a() : {
|
|
357
|
+
...r == null ? {} : { live: {
|
|
358
|
+
enabled: r.enabled,
|
|
359
|
+
publicationId: s(r.publicationId),
|
|
360
|
+
revisionId: s(r.revisionId)
|
|
361
|
+
} },
|
|
362
|
+
createdAt: s(t.createdAt),
|
|
363
|
+
draftRevisionId: s(t.draftRevisionId),
|
|
364
|
+
flowId: s(t.flowId),
|
|
365
|
+
name: s(t.name),
|
|
333
366
|
status: n,
|
|
334
|
-
updatedAt:
|
|
367
|
+
updatedAt: s(t.updatedAt),
|
|
335
368
|
version: 1
|
|
336
369
|
};
|
|
337
370
|
}
|
|
338
|
-
function
|
|
339
|
-
let t =
|
|
340
|
-
if (t.version != 1 || !Array.isArray(t.flows)) return
|
|
371
|
+
function D(e) {
|
|
372
|
+
let t = o(e);
|
|
373
|
+
if (t.version != 1 || !Array.isArray(t.flows)) return a();
|
|
341
374
|
let n = t.nextCursor, r = t.total;
|
|
342
|
-
return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ?
|
|
375
|
+
return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? a() : {
|
|
343
376
|
...n == null ? {} : { nextCursor: n },
|
|
344
|
-
flows: t.flows.map(
|
|
377
|
+
flows: t.flows.map(E),
|
|
345
378
|
...r == null ? {} : { total: r },
|
|
346
379
|
version: 1
|
|
347
380
|
};
|
|
348
381
|
}
|
|
349
|
-
function
|
|
350
|
-
let t =
|
|
351
|
-
if (
|
|
382
|
+
function O(e) {
|
|
383
|
+
let t = o(e);
|
|
384
|
+
if (c(t, [
|
|
352
385
|
"name",
|
|
353
386
|
"updatedAt",
|
|
354
387
|
"value",
|
|
355
388
|
"version"
|
|
356
|
-
]), t.version != 1 || typeof t.value != "string") return
|
|
357
|
-
let n =
|
|
389
|
+
]), t.version != 1 || typeof t.value != "string") return a();
|
|
390
|
+
let n = s(t.updatedAt);
|
|
358
391
|
try {
|
|
359
|
-
if (new Date(n).toISOString() != n) return
|
|
392
|
+
if (new Date(n).toISOString() != n) return a();
|
|
360
393
|
} catch {
|
|
361
|
-
return
|
|
394
|
+
return a();
|
|
362
395
|
}
|
|
363
396
|
return {
|
|
364
|
-
name:
|
|
397
|
+
name: s(t.name),
|
|
365
398
|
updatedAt: n,
|
|
366
399
|
value: t.value,
|
|
367
400
|
version: 1
|
|
368
401
|
};
|
|
369
402
|
}
|
|
370
|
-
function
|
|
371
|
-
let t =
|
|
372
|
-
return t.version != 1 || n !== null && typeof n != "string" ?
|
|
373
|
-
actorId:
|
|
374
|
-
createdAt:
|
|
375
|
-
digest:
|
|
376
|
-
flowId:
|
|
377
|
-
modelVersion:
|
|
403
|
+
function k(e) {
|
|
404
|
+
let t = o(e), n = t.parentRevisionId;
|
|
405
|
+
return t.version != 1 || n !== null && typeof n != "string" ? a() : {
|
|
406
|
+
actorId: s(t.actorId),
|
|
407
|
+
createdAt: s(t.createdAt),
|
|
408
|
+
digest: s(t.digest),
|
|
409
|
+
flowId: s(t.flowId),
|
|
410
|
+
modelVersion: l(t.modelVersion),
|
|
378
411
|
parentRevisionId: n,
|
|
379
|
-
revisionId:
|
|
412
|
+
revisionId: s(t.revisionId),
|
|
380
413
|
version: 1
|
|
381
414
|
};
|
|
382
415
|
}
|
|
383
|
-
function
|
|
384
|
-
let t =
|
|
385
|
-
return n.modelVersion == 1 ? (
|
|
386
|
-
...
|
|
416
|
+
function A(e) {
|
|
417
|
+
let t = o(e), n = o(t.content);
|
|
418
|
+
return n.modelVersion == 1 ? (o(n.document), o(n.modules), {
|
|
419
|
+
...k(t),
|
|
387
420
|
content: t.content
|
|
388
|
-
}) :
|
|
421
|
+
}) : a();
|
|
422
|
+
}
|
|
423
|
+
function j(e) {
|
|
424
|
+
let t = o(e);
|
|
425
|
+
return c(t, [
|
|
426
|
+
"revision",
|
|
427
|
+
"updatedAt",
|
|
428
|
+
"value",
|
|
429
|
+
"version"
|
|
430
|
+
]), t.version != 1 || l(t.revision) < 1 ? a() : {
|
|
431
|
+
revision: l(t.revision),
|
|
432
|
+
updatedAt: s(t.updatedAt),
|
|
433
|
+
value: Object.fromEntries(Object.entries(o(t.value)).map(([e, t]) => [e, u(t)])),
|
|
434
|
+
version: 1
|
|
435
|
+
};
|
|
389
436
|
}
|
|
390
437
|
function M(e) {
|
|
391
|
-
let t =
|
|
438
|
+
let t = o(e);
|
|
392
439
|
return t.version == 1 ? {
|
|
393
|
-
revision:
|
|
440
|
+
revision: k(t.revision),
|
|
394
441
|
version: 1
|
|
395
|
-
} :
|
|
442
|
+
} : a();
|
|
396
443
|
}
|
|
397
444
|
function N(e) {
|
|
398
|
-
let t =
|
|
399
|
-
return t.version != 1 || t.kind != "snapshot" ?
|
|
400
|
-
draft:
|
|
445
|
+
let t = o(e);
|
|
446
|
+
return t.version != 1 || t.kind != "snapshot" ? a() : {
|
|
447
|
+
draft: A(t.draft),
|
|
401
448
|
kind: "snapshot",
|
|
402
449
|
version: 1
|
|
403
450
|
};
|
|
404
451
|
}
|
|
405
452
|
function P(e) {
|
|
406
|
-
let t =
|
|
407
|
-
return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ?
|
|
408
|
-
actorId:
|
|
409
|
-
closureDigest:
|
|
410
|
-
createdAt:
|
|
411
|
-
engineContract:
|
|
412
|
-
flowId:
|
|
413
|
-
modelVersion:
|
|
453
|
+
let t = o(e), n = t.operation, r = t.sourcePublicationId;
|
|
454
|
+
return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ? a() : {
|
|
455
|
+
actorId: s(t.actorId),
|
|
456
|
+
closureDigest: s(t.closureDigest),
|
|
457
|
+
createdAt: s(t.createdAt),
|
|
458
|
+
engineContract: s(t.engineContract),
|
|
459
|
+
flowId: s(t.flowId),
|
|
460
|
+
modelVersion: l(t.modelVersion),
|
|
414
461
|
operation: n,
|
|
415
|
-
publicationId:
|
|
416
|
-
revisionDigest:
|
|
417
|
-
revisionId:
|
|
462
|
+
publicationId: s(t.publicationId),
|
|
463
|
+
revisionDigest: s(t.revisionDigest),
|
|
464
|
+
revisionId: s(t.revisionId),
|
|
418
465
|
...r == null ? {} : { sourcePublicationId: r },
|
|
419
466
|
version: 1
|
|
420
467
|
};
|
|
421
468
|
}
|
|
422
469
|
function F(e) {
|
|
423
|
-
let t =
|
|
424
|
-
createdAt:
|
|
425
|
-
flowId:
|
|
426
|
-
operationId:
|
|
427
|
-
revisionId:
|
|
428
|
-
updatedAt:
|
|
470
|
+
let t = o(e), n = t.status, r = {
|
|
471
|
+
createdAt: s(t.createdAt),
|
|
472
|
+
flowId: s(t.flowId),
|
|
473
|
+
operationId: s(t.operationId),
|
|
474
|
+
revisionId: s(t.revisionId),
|
|
475
|
+
updatedAt: s(t.updatedAt),
|
|
429
476
|
version: 1
|
|
430
477
|
};
|
|
431
|
-
if (t.version != 1) return
|
|
478
|
+
if (t.version != 1) return a();
|
|
432
479
|
switch (n) {
|
|
433
|
-
case "pending": return
|
|
480
|
+
case "pending": return c(t, [
|
|
434
481
|
"createdAt",
|
|
435
482
|
"flowId",
|
|
436
483
|
"operationId",
|
|
@@ -442,7 +489,7 @@ function F(e) {
|
|
|
442
489
|
...r,
|
|
443
490
|
status: n
|
|
444
491
|
};
|
|
445
|
-
case "succeeded": return
|
|
492
|
+
case "succeeded": return c(t, [
|
|
446
493
|
"createdAt",
|
|
447
494
|
"flowId",
|
|
448
495
|
"operationId",
|
|
@@ -453,11 +500,11 @@ function F(e) {
|
|
|
453
500
|
"version"
|
|
454
501
|
]), {
|
|
455
502
|
...r,
|
|
456
|
-
publicationId:
|
|
503
|
+
publicationId: s(t.publicationId),
|
|
457
504
|
status: n
|
|
458
505
|
};
|
|
459
506
|
case "failed": {
|
|
460
|
-
|
|
507
|
+
c(t, [
|
|
461
508
|
"createdAt",
|
|
462
509
|
"flowId",
|
|
463
510
|
"issue",
|
|
@@ -467,63 +514,63 @@ function F(e) {
|
|
|
467
514
|
"updatedAt",
|
|
468
515
|
"version"
|
|
469
516
|
]);
|
|
470
|
-
let e =
|
|
471
|
-
return
|
|
517
|
+
let e = o(t.issue), i = e.nodeId;
|
|
518
|
+
return c(e, [
|
|
472
519
|
"code",
|
|
473
520
|
"message",
|
|
474
521
|
...i == null ? [] : ["nodeId"]
|
|
475
522
|
]), {
|
|
476
523
|
...r,
|
|
477
524
|
issue: {
|
|
478
|
-
code:
|
|
479
|
-
message:
|
|
480
|
-
...i == null ? {} : { nodeId:
|
|
525
|
+
code: s(e.code),
|
|
526
|
+
message: s(e.message),
|
|
527
|
+
...i == null ? {} : { nodeId: s(i) }
|
|
481
528
|
},
|
|
482
529
|
status: n
|
|
483
530
|
};
|
|
484
531
|
}
|
|
485
|
-
default: return
|
|
532
|
+
default: return a();
|
|
486
533
|
}
|
|
487
534
|
}
|
|
488
535
|
function I(e) {
|
|
489
|
-
let t =
|
|
536
|
+
let t = o(e), n = t.values == null ? void 0 : o(t.values);
|
|
490
537
|
return {
|
|
491
|
-
code:
|
|
492
|
-
column:
|
|
493
|
-
line:
|
|
494
|
-
message:
|
|
495
|
-
path: typeof t.path == "string" ? t.path :
|
|
496
|
-
...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t :
|
|
538
|
+
code: s(t.code),
|
|
539
|
+
column: l(t.column),
|
|
540
|
+
line: l(t.line),
|
|
541
|
+
message: s(t.message),
|
|
542
|
+
path: typeof t.path == "string" ? t.path : a(),
|
|
543
|
+
...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : a()])) }
|
|
497
544
|
};
|
|
498
545
|
}
|
|
499
546
|
function L(e) {
|
|
500
|
-
let t =
|
|
501
|
-
return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ?
|
|
502
|
-
closureDigest:
|
|
547
|
+
let t = o(e);
|
|
548
|
+
return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? a() : {
|
|
549
|
+
closureDigest: s(t.closureDigest),
|
|
503
550
|
diagnostics: t.diagnostics.map(I),
|
|
504
|
-
engineContract:
|
|
505
|
-
flowId:
|
|
506
|
-
modelVersion:
|
|
507
|
-
revisionDigest:
|
|
508
|
-
revisionId:
|
|
551
|
+
engineContract: s(t.engineContract),
|
|
552
|
+
flowId: s(t.flowId),
|
|
553
|
+
modelVersion: l(t.modelVersion),
|
|
554
|
+
revisionDigest: s(t.revisionDigest),
|
|
555
|
+
revisionId: s(t.revisionId),
|
|
509
556
|
valid: t.valid,
|
|
510
557
|
version: 1
|
|
511
558
|
};
|
|
512
559
|
}
|
|
513
560
|
function R(e) {
|
|
514
|
-
let t =
|
|
515
|
-
return t.version != 1 || typeof t.hasUnpublishedChanges != "boolean" || n != "not-published" && n != "runnable" && n != "suspended" || n == "not-published" && r !== null || n != "not-published" && r === null ?
|
|
516
|
-
flowId:
|
|
561
|
+
let t = o(e), n = t.status, r = t.publication;
|
|
562
|
+
return t.version != 1 || typeof t.hasUnpublishedChanges != "boolean" || n != "not-published" && n != "runnable" && n != "suspended" || n == "not-published" && r !== null || n != "not-published" && r === null ? a() : {
|
|
563
|
+
flowId: s(t.flowId),
|
|
517
564
|
hasUnpublishedChanges: t.hasUnpublishedChanges,
|
|
518
565
|
publication: r === null ? null : P(r),
|
|
519
|
-
revision:
|
|
566
|
+
revision: l(t.revision),
|
|
520
567
|
status: n,
|
|
521
568
|
version: 1
|
|
522
569
|
};
|
|
523
570
|
}
|
|
524
571
|
function z(e) {
|
|
525
|
-
let t =
|
|
526
|
-
return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ?
|
|
572
|
+
let t = o(e), n = t.nextCursor, r = t.total;
|
|
573
|
+
return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? a() : {
|
|
527
574
|
...n == null ? {} : { nextCursor: n },
|
|
528
575
|
publications: t.publications.map(P),
|
|
529
576
|
...r == null ? {} : { total: r },
|
|
@@ -532,16 +579,16 @@ function z(e) {
|
|
|
532
579
|
}
|
|
533
580
|
var B = new Set(n);
|
|
534
581
|
function V(e) {
|
|
535
|
-
return typeof e == "string" && B.has(e) ? e :
|
|
582
|
+
return typeof e == "string" && B.has(e) ? e : a();
|
|
536
583
|
}
|
|
537
584
|
function H(e) {
|
|
538
|
-
let t =
|
|
539
|
-
return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" ||
|
|
540
|
-
createdAt:
|
|
541
|
-
...
|
|
542
|
-
flowId:
|
|
543
|
-
revisionId:
|
|
544
|
-
runId:
|
|
585
|
+
let t = o(e), n = t.source, r = t.startedAt, i = t.finishedAt;
|
|
586
|
+
return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || i != null && typeof i != "string" ? a() : {
|
|
587
|
+
createdAt: s(t.createdAt),
|
|
588
|
+
...i == null ? {} : { finishedAt: i },
|
|
589
|
+
flowId: s(t.flowId),
|
|
590
|
+
revisionId: s(t.revisionId),
|
|
591
|
+
runId: s(t.runId),
|
|
545
592
|
source: n,
|
|
546
593
|
...r == null ? {} : { startedAt: r },
|
|
547
594
|
status: V(t.status),
|
|
@@ -549,8 +596,8 @@ function H(e) {
|
|
|
549
596
|
};
|
|
550
597
|
}
|
|
551
598
|
function U(e) {
|
|
552
|
-
let t =
|
|
553
|
-
|
|
599
|
+
let t = o(e);
|
|
600
|
+
c(t, [
|
|
554
601
|
"actions",
|
|
555
602
|
"expiresAt",
|
|
556
603
|
"nodeId",
|
|
@@ -559,51 +606,51 @@ function U(e) {
|
|
|
559
606
|
"waitingSince"
|
|
560
607
|
]);
|
|
561
608
|
let n = t.actions;
|
|
562
|
-
return !Array.isArray(n) || !(n.length == 1 && n[0] == "continue" || n.length == 2 && n[0] == "approve" && n[1] == "reject") ?
|
|
609
|
+
return !Array.isArray(n) || !(n.length == 1 && n[0] == "continue" || n.length == 2 && n[0] == "approve" && n[1] == "reject") ? a() : {
|
|
563
610
|
actions: n,
|
|
564
|
-
expiresAt:
|
|
565
|
-
nodeId:
|
|
566
|
-
prompt:
|
|
567
|
-
waitId:
|
|
568
|
-
waitingSince:
|
|
611
|
+
expiresAt: s(t.expiresAt),
|
|
612
|
+
nodeId: s(t.nodeId),
|
|
613
|
+
prompt: s(t.prompt),
|
|
614
|
+
waitId: s(t.waitId),
|
|
615
|
+
waitingSince: s(t.waitingSince)
|
|
569
616
|
};
|
|
570
617
|
}
|
|
571
618
|
function W(e) {
|
|
572
|
-
let t =
|
|
573
|
-
if (r != null && typeof r != "string" || n.status != "waiting" && t.waiting !== void 0) return
|
|
574
|
-
let
|
|
619
|
+
let t = o(e), n = H(t), r = t.eventsExpiresAt;
|
|
620
|
+
if (r != null && typeof r != "string" || n.status != "waiting" && t.waiting !== void 0) return a();
|
|
621
|
+
let i = n.status == "waiting" ? U(t.waiting) : void 0, c = {
|
|
575
622
|
...n,
|
|
576
|
-
closureDigest:
|
|
577
|
-
engineContract:
|
|
578
|
-
engineDigest:
|
|
623
|
+
closureDigest: s(t.closureDigest),
|
|
624
|
+
engineContract: s(t.engineContract),
|
|
625
|
+
engineDigest: s(t.engineDigest),
|
|
579
626
|
...r == null ? {} : { eventsExpiresAt: r },
|
|
580
|
-
modelVersion:
|
|
581
|
-
revisionDigest:
|
|
582
|
-
...
|
|
627
|
+
modelVersion: l(t.modelVersion),
|
|
628
|
+
revisionDigest: s(t.revisionDigest),
|
|
629
|
+
...i == null ? {} : { waiting: i }
|
|
583
630
|
};
|
|
584
631
|
switch (n.source) {
|
|
585
632
|
case "draft": return {
|
|
586
|
-
...
|
|
633
|
+
...c,
|
|
587
634
|
source: "draft"
|
|
588
635
|
};
|
|
589
636
|
case "live": return {
|
|
590
|
-
...
|
|
591
|
-
publicationId:
|
|
637
|
+
...c,
|
|
638
|
+
publicationId: s(t.publicationId),
|
|
592
639
|
source: "live"
|
|
593
640
|
};
|
|
594
641
|
case "trigger": return {
|
|
595
|
-
...
|
|
596
|
-
occurrenceId:
|
|
597
|
-
publicationId:
|
|
642
|
+
...c,
|
|
643
|
+
occurrenceId: s(t.occurrenceId),
|
|
644
|
+
publicationId: s(t.publicationId),
|
|
598
645
|
source: "trigger",
|
|
599
|
-
triggerNodeId:
|
|
646
|
+
triggerNodeId: s(t.triggerNodeId)
|
|
600
647
|
};
|
|
601
648
|
}
|
|
602
649
|
}
|
|
603
650
|
function G(e) {
|
|
604
|
-
let t =
|
|
605
|
-
return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ?
|
|
606
|
-
flowId:
|
|
651
|
+
let t = o(e), n = t.nextCursor;
|
|
652
|
+
return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? a() : {
|
|
653
|
+
flowId: s(t.flowId),
|
|
607
654
|
...n == null ? {} : { nextCursor: n },
|
|
608
655
|
runs: t.runs.map(H),
|
|
609
656
|
version: 1
|
|
@@ -614,7 +661,6 @@ var K = /* @__PURE__ */ new Set([
|
|
|
614
661
|
"node.completed",
|
|
615
662
|
"node.failed",
|
|
616
663
|
"node.log",
|
|
617
|
-
"node.output",
|
|
618
664
|
"node.progress",
|
|
619
665
|
"node.started",
|
|
620
666
|
"run.canceled",
|
|
@@ -629,39 +675,39 @@ var K = /* @__PURE__ */ new Set([
|
|
|
629
675
|
"run.waiting"
|
|
630
676
|
]);
|
|
631
677
|
function q(e) {
|
|
632
|
-
let t =
|
|
633
|
-
return typeof n != "string" || !K.has(n) || r < 0 ||
|
|
634
|
-
createdAt:
|
|
678
|
+
let t = o(e), n = t.kind, r = l(t.sequence), i = t.sourceSequence;
|
|
679
|
+
return typeof n != "string" || !K.has(n) || r < 0 || i != null && (!Number.isSafeInteger(i) || i < 0) ? a() : {
|
|
680
|
+
createdAt: s(t.createdAt),
|
|
635
681
|
kind: n,
|
|
636
|
-
payload:
|
|
682
|
+
payload: o(t.payload),
|
|
637
683
|
sequence: r,
|
|
638
|
-
...
|
|
684
|
+
...i == null ? {} : { sourceSequence: i }
|
|
639
685
|
};
|
|
640
686
|
}
|
|
641
687
|
function J(e) {
|
|
642
|
-
let t =
|
|
643
|
-
return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ?
|
|
688
|
+
let t = o(e), n = t.eventsExpiresAt, r = l(t.nextAfter);
|
|
689
|
+
return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? a() : {
|
|
644
690
|
done: t.done,
|
|
645
691
|
events: t.events.map(q),
|
|
646
692
|
...n == null ? {} : { eventsExpiresAt: n },
|
|
647
693
|
historyComplete: t.historyComplete,
|
|
648
694
|
nextAfter: r,
|
|
649
|
-
runId:
|
|
695
|
+
runId: s(t.runId),
|
|
650
696
|
version: 1
|
|
651
697
|
};
|
|
652
698
|
}
|
|
653
699
|
function Y(e) {
|
|
654
|
-
let t =
|
|
655
|
-
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ?
|
|
700
|
+
let t = o(e), n = V(t.status);
|
|
701
|
+
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? a() : {
|
|
656
702
|
cancelAccepted: t.cancelAccepted,
|
|
657
|
-
runId:
|
|
703
|
+
runId: s(t.runId),
|
|
658
704
|
status: n,
|
|
659
705
|
version: 1
|
|
660
706
|
};
|
|
661
707
|
}
|
|
662
708
|
function X(e) {
|
|
663
|
-
let t =
|
|
664
|
-
|
|
709
|
+
let t = o(e);
|
|
710
|
+
c(t, [
|
|
665
711
|
"action",
|
|
666
712
|
"resolutionAccepted",
|
|
667
713
|
"resolvedAt",
|
|
@@ -671,62 +717,62 @@ function X(e) {
|
|
|
671
717
|
"waitId"
|
|
672
718
|
]);
|
|
673
719
|
let n = t.action, r = t.resolvedAt;
|
|
674
|
-
return t.version != 1 || typeof t.resolutionAccepted != "boolean" || n !== null && n != "approve" && n != "continue" && n != "reject" || r !== null && typeof r != "string" || n === null != (r === null) || t.resolutionAccepted && n === null ?
|
|
720
|
+
return t.version != 1 || typeof t.resolutionAccepted != "boolean" || n !== null && n != "approve" && n != "continue" && n != "reject" || r !== null && typeof r != "string" || n === null != (r === null) || t.resolutionAccepted && n === null ? a() : {
|
|
675
721
|
action: n,
|
|
676
722
|
resolutionAccepted: t.resolutionAccepted,
|
|
677
723
|
resolvedAt: r,
|
|
678
|
-
runId:
|
|
724
|
+
runId: s(t.runId),
|
|
679
725
|
status: V(t.status),
|
|
680
726
|
version: 1,
|
|
681
|
-
waitId:
|
|
727
|
+
waitId: s(t.waitId)
|
|
682
728
|
};
|
|
683
729
|
}
|
|
684
730
|
function Z(e) {
|
|
685
|
-
let t =
|
|
686
|
-
if (t.version != 1) return
|
|
731
|
+
let t = o(e), n = t.status;
|
|
732
|
+
if (t.version != 1) return a();
|
|
687
733
|
let r = {
|
|
688
|
-
finishedAt:
|
|
689
|
-
runId:
|
|
734
|
+
finishedAt: s(t.finishedAt),
|
|
735
|
+
runId: s(t.runId),
|
|
690
736
|
version: 1
|
|
691
737
|
};
|
|
692
738
|
if (n == "completed") return Object.hasOwn(t, "result") ? {
|
|
693
739
|
...r,
|
|
694
740
|
result: t.result,
|
|
695
741
|
status: "completed"
|
|
696
|
-
} :
|
|
742
|
+
} : a();
|
|
697
743
|
if (n == "canceled") return {
|
|
698
744
|
...r,
|
|
699
745
|
status: "canceled"
|
|
700
746
|
};
|
|
701
747
|
if (n == "failed") {
|
|
702
|
-
let e =
|
|
748
|
+
let e = o(t.error);
|
|
703
749
|
return {
|
|
704
750
|
...r,
|
|
705
751
|
error: {
|
|
706
|
-
code:
|
|
707
|
-
message:
|
|
752
|
+
code: s(e.code),
|
|
753
|
+
message: s(e.message)
|
|
708
754
|
},
|
|
709
755
|
status: "failed"
|
|
710
756
|
};
|
|
711
757
|
}
|
|
712
758
|
if (n == "indeterminate") {
|
|
713
|
-
let e =
|
|
759
|
+
let e = o(t.error);
|
|
714
760
|
return {
|
|
715
761
|
...r,
|
|
716
762
|
error: {
|
|
717
|
-
code:
|
|
718
|
-
message:
|
|
763
|
+
code: s(e.code),
|
|
764
|
+
message: s(e.message)
|
|
719
765
|
},
|
|
720
766
|
status: "indeterminate"
|
|
721
767
|
};
|
|
722
768
|
}
|
|
723
|
-
return
|
|
769
|
+
return a();
|
|
724
770
|
}
|
|
725
771
|
var Q = encodeURIComponent;
|
|
726
772
|
function $(e) {
|
|
727
|
-
return `${e}-${
|
|
773
|
+
return `${e}-${r()}`;
|
|
728
774
|
}
|
|
729
|
-
var
|
|
775
|
+
var ne = class {
|
|
730
776
|
constructor(e) {
|
|
731
777
|
this.requestControl = e;
|
|
732
778
|
}
|
|
@@ -734,30 +780,30 @@ var ee = class {
|
|
|
734
780
|
let t = new URLSearchParams();
|
|
735
781
|
e.cursor != null && t.set("cursor", e.cursor), e.limit != null && t.set("limit", String(e.limit)), e.includeTotal != null && t.set("includeTotal", String(e.includeTotal));
|
|
736
782
|
let n = t.size == 0 ? "" : `?${t}`;
|
|
737
|
-
return
|
|
783
|
+
return D(await this.request(`/v1/flows${n}`));
|
|
738
784
|
}
|
|
739
785
|
async listVariables() {
|
|
740
|
-
let e =
|
|
741
|
-
return
|
|
742
|
-
variables: e.variables.map(
|
|
786
|
+
let e = o(await this.request("/v1/variables"));
|
|
787
|
+
return c(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? a() : {
|
|
788
|
+
variables: e.variables.map(O),
|
|
743
789
|
version: 1
|
|
744
790
|
};
|
|
745
791
|
}
|
|
746
792
|
async getVariable(e) {
|
|
747
|
-
return
|
|
793
|
+
return O(await this.request(`/v1/variables/${Q(e)}`));
|
|
748
794
|
}
|
|
749
795
|
async putVariable(e, t) {
|
|
750
|
-
return
|
|
796
|
+
return O(await this.request(`/v1/variables/${Q(e)}`, {
|
|
751
797
|
body: JSON.stringify({ value: t }),
|
|
752
798
|
method: "PUT"
|
|
753
799
|
}));
|
|
754
800
|
}
|
|
755
801
|
async deleteVariable(e) {
|
|
756
|
-
let t =
|
|
757
|
-
if (
|
|
802
|
+
let t = o(await this.request(`/v1/variables/${Q(e)}`, { method: "DELETE" }));
|
|
803
|
+
if (c(t, ["version"]), t.version != 1) return a();
|
|
758
804
|
}
|
|
759
|
-
async createFlow(e, t = `flow-${
|
|
760
|
-
return
|
|
805
|
+
async createFlow(e, t = `flow-${r()}`) {
|
|
806
|
+
return E(await this.request("/v1/flows", {
|
|
761
807
|
body: JSON.stringify({
|
|
762
808
|
name: e,
|
|
763
809
|
version: 1
|
|
@@ -767,10 +813,10 @@ var ee = class {
|
|
|
767
813
|
}));
|
|
768
814
|
}
|
|
769
815
|
async getFlow(e) {
|
|
770
|
-
return
|
|
816
|
+
return E(await this.request(`/v1/flows/${Q(e)}`));
|
|
771
817
|
}
|
|
772
818
|
async renameFlow(e, t) {
|
|
773
|
-
return
|
|
819
|
+
return E(await this.request(`/v1/flows/${Q(e)}`, {
|
|
774
820
|
body: JSON.stringify({
|
|
775
821
|
name: t,
|
|
776
822
|
version: 1
|
|
@@ -779,63 +825,84 @@ var ee = class {
|
|
|
779
825
|
}));
|
|
780
826
|
}
|
|
781
827
|
async deleteFlow(e) {
|
|
782
|
-
return
|
|
828
|
+
return E(await this.request(`/v1/flows/${Q(e)}`, { method: "DELETE" }));
|
|
783
829
|
}
|
|
784
830
|
async listTriggerKeys(e) {
|
|
785
|
-
let t =
|
|
786
|
-
return t.version != 1 || !Array.isArray(t.keys) ?
|
|
831
|
+
let t = o(await this.request("/v1/trigger-keys", { signal: e }));
|
|
832
|
+
return t.version != 1 || !Array.isArray(t.keys) ? a() : t.keys.map(_);
|
|
787
833
|
}
|
|
788
834
|
async listTriggerDefinitions(e) {
|
|
789
|
-
let t =
|
|
790
|
-
return t.version != 1 || !Array.isArray(t.definitions) ?
|
|
835
|
+
let t = o(await this.request("/v1/trigger-keys/catalog", { signal: e }));
|
|
836
|
+
return t.version != 1 || !Array.isArray(t.definitions) ? a() : t.definitions.map(v);
|
|
791
837
|
}
|
|
792
838
|
async getTriggerKey(e, t) {
|
|
793
|
-
let n =
|
|
794
|
-
return n.version == 1 ?
|
|
839
|
+
let n = o(await this.request(`/v1/trigger-keys/${Q(e)}`, { signal: t }));
|
|
840
|
+
return n.version == 1 ? v(n.definition) : a();
|
|
795
841
|
}
|
|
796
|
-
async listFlowTriggerBindings(e) {
|
|
797
|
-
let
|
|
798
|
-
return
|
|
842
|
+
async listFlowTriggerBindings(e, t) {
|
|
843
|
+
let n = o(await this.request(`/v1/flows/${Q(e)}/triggers`, { signal: t }));
|
|
844
|
+
return n.version != 1 || s(n.flowId) != e || !Array.isArray(n.bindings) ? a() : n.bindings.map(C);
|
|
799
845
|
}
|
|
800
846
|
async getFlowTriggerBinding(e, t) {
|
|
801
|
-
return
|
|
847
|
+
return ee(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}`));
|
|
802
848
|
}
|
|
803
849
|
async listFlowTriggerActivities(e, t, n = {}) {
|
|
804
850
|
let r = new URLSearchParams();
|
|
805
851
|
n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
|
|
806
852
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
807
|
-
return
|
|
853
|
+
return w(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/activities${i}`));
|
|
808
854
|
}
|
|
809
855
|
async pauseFlowTrigger(e, t) {
|
|
810
|
-
return
|
|
856
|
+
return C(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/pause`, {
|
|
811
857
|
body: JSON.stringify({ version: 1 }),
|
|
812
858
|
method: "POST"
|
|
813
859
|
}));
|
|
814
860
|
}
|
|
815
861
|
async resumeFlowTrigger(e, t) {
|
|
816
|
-
return
|
|
862
|
+
return C(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/resume`, {
|
|
817
863
|
body: JSON.stringify({ version: 1 }),
|
|
818
864
|
method: "POST"
|
|
819
865
|
}));
|
|
820
866
|
}
|
|
821
867
|
async testFlowPollTrigger(e, t) {
|
|
822
|
-
return
|
|
868
|
+
return T(await this.request(`/v1/flows/${Q(e)}/triggers/${Q(t)}/test`, {
|
|
823
869
|
body: JSON.stringify({ version: 1 }),
|
|
824
870
|
method: "POST"
|
|
825
871
|
}));
|
|
826
872
|
}
|
|
873
|
+
async getEditor(e) {
|
|
874
|
+
let t = o(await this.request(`/v1/flows/${Q(e)}/editor`));
|
|
875
|
+
if (c(t, [
|
|
876
|
+
"flow",
|
|
877
|
+
"draft",
|
|
878
|
+
"live",
|
|
879
|
+
"presentation",
|
|
880
|
+
"version"
|
|
881
|
+
]), t.version != 1) return a();
|
|
882
|
+
let n = {
|
|
883
|
+
flow: E(t.flow),
|
|
884
|
+
draft: A(t.draft),
|
|
885
|
+
live: R(t.live),
|
|
886
|
+
presentation: j(t.presentation),
|
|
887
|
+
version: 1
|
|
888
|
+
};
|
|
889
|
+
return n.flow.flowId != e || n.draft.flowId != e || n.live.flowId != e || n.flow.draftRevisionId != n.draft.revisionId ? a() : n;
|
|
890
|
+
}
|
|
891
|
+
async getPresentation(e) {
|
|
892
|
+
return j(await this.request(`/v1/flows/${Q(e)}/presentation`));
|
|
893
|
+
}
|
|
827
894
|
async getDraft(e) {
|
|
828
|
-
return
|
|
895
|
+
return A(await this.request(`/v1/flows/${Q(e)}/draft`));
|
|
829
896
|
}
|
|
830
897
|
async syncDraft(e) {
|
|
831
898
|
return N(await this.request(`/v1/flows/${Q(e)}/draft/sync`));
|
|
832
899
|
}
|
|
833
900
|
async getRevision(e, t) {
|
|
834
|
-
return
|
|
901
|
+
return A(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}`));
|
|
835
902
|
}
|
|
836
903
|
async listConnectorProviders(e, t) {
|
|
837
|
-
let n =
|
|
838
|
-
return
|
|
904
|
+
let n = o(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Q(t)}`}`, { signal: e }));
|
|
905
|
+
return c(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? a() : n.providers.map(g);
|
|
839
906
|
}
|
|
840
907
|
async listConnectorActions(e, t, n) {
|
|
841
908
|
return await this.connectorActions({
|
|
@@ -850,28 +917,28 @@ var ee = class {
|
|
|
850
917
|
}, t);
|
|
851
918
|
}
|
|
852
919
|
async getConnectorAction(e, t, n) {
|
|
853
|
-
let r =
|
|
854
|
-
return
|
|
920
|
+
let r = o(await this.request(`/v1/connector/actions/${Q(e)}${n == null ? "" : `?flowId=${Q(n)}`}`, { signal: t }));
|
|
921
|
+
return c(r, ["action", "version"]), r.version == 1 ? h(r.action) : a();
|
|
855
922
|
}
|
|
856
923
|
async listConnectorConnections(e, t, n) {
|
|
857
|
-
let r =
|
|
858
|
-
return
|
|
924
|
+
let r = o(await this.request(`/v1/connector/connections/${Q(e)}${n == null ? "" : `?flowId=${Q(n)}`}`, { signal: t }));
|
|
925
|
+
return c(r, [
|
|
859
926
|
"connections",
|
|
860
927
|
"serviceId",
|
|
861
928
|
"version"
|
|
862
|
-
]), r.version != 1 ||
|
|
929
|
+
]), r.version != 1 || s(r.serviceId) != e || !Array.isArray(r.connections) ? a() : r.connections.map(d);
|
|
863
930
|
}
|
|
864
931
|
async createConnectorConnectionPage(e, t) {
|
|
865
|
-
let n =
|
|
932
|
+
let n = o(await this.request(`/v1/connector/connections/${Q(e)}/page${t == null ? "" : `?flowId=${Q(t)}`}`, {
|
|
866
933
|
body: JSON.stringify({ version: 1 }),
|
|
867
934
|
method: "POST"
|
|
868
935
|
}));
|
|
869
|
-
if (
|
|
936
|
+
if (c(n, ["url", "version"]), n.version != 1) return a();
|
|
870
937
|
try {
|
|
871
|
-
let e = new URL(
|
|
872
|
-
return e.protocol != "http:" && e.protocol != "https:" ?
|
|
938
|
+
let e = new URL(s(n.url));
|
|
939
|
+
return e.protocol != "http:" && e.protocol != "https:" ? a() : e.href;
|
|
873
940
|
} catch {
|
|
874
|
-
return
|
|
941
|
+
return a();
|
|
875
942
|
}
|
|
876
943
|
}
|
|
877
944
|
async changeDraft(e, t, n, r = $("change")) {
|
|
@@ -888,49 +955,61 @@ var ee = class {
|
|
|
888
955
|
async checkFlow(e, t) {
|
|
889
956
|
return L(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/check`, {
|
|
890
957
|
body: JSON.stringify({
|
|
891
|
-
engineContract: "open-flow-engine/
|
|
958
|
+
engineContract: "open-flow-engine/v2",
|
|
892
959
|
version: 1
|
|
893
960
|
}),
|
|
894
961
|
method: "POST"
|
|
895
962
|
}));
|
|
896
963
|
}
|
|
897
|
-
async getLive(e) {
|
|
898
|
-
return R(await this.request(`/v1/flows/${Q(e)}/live
|
|
964
|
+
async getLive(e, t) {
|
|
965
|
+
return R(await this.request(`/v1/flows/${Q(e)}/live`, { signal: t }));
|
|
899
966
|
}
|
|
900
|
-
async listPublications(e, t = {}) {
|
|
901
|
-
let
|
|
902
|
-
t.cursor != null &&
|
|
903
|
-
let
|
|
904
|
-
return z(await this.request(`/v1/flows/${Q(e)}/publications${
|
|
967
|
+
async listPublications(e, t = {}, n) {
|
|
968
|
+
let r = new URLSearchParams();
|
|
969
|
+
t.cursor != null && r.set("cursor", t.cursor), t.limit != null && r.set("limit", String(t.limit)), t.includeTotal != null && r.set("includeTotal", String(t.includeTotal));
|
|
970
|
+
let i = r.size == 0 ? "" : `?${r}`;
|
|
971
|
+
return z(await this.request(`/v1/flows/${Q(e)}/publications${i}`, { signal: n }));
|
|
905
972
|
}
|
|
906
|
-
async createDraftRun(e, t, n
|
|
973
|
+
async createDraftRun(e, t, n) {
|
|
907
974
|
let r = W(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/runs`, {
|
|
908
975
|
body: JSON.stringify({
|
|
909
|
-
engineContract: "open-flow-engine/
|
|
976
|
+
engineContract: "open-flow-engine/v2",
|
|
910
977
|
inputs: n.inputs ?? {},
|
|
978
|
+
trigger: n.trigger,
|
|
911
979
|
version: 1
|
|
912
980
|
}),
|
|
913
981
|
headers: { "idempotency-key": n.idempotencyKey ?? $("run") },
|
|
914
982
|
method: "POST"
|
|
915
983
|
}));
|
|
916
|
-
return r.source == "draft" ? r :
|
|
984
|
+
return r.source == "draft" ? r : a();
|
|
917
985
|
}
|
|
918
|
-
async createLiveRun(e, t
|
|
986
|
+
async createLiveRun(e, t) {
|
|
919
987
|
let n = W(await this.request("/v1/runs", {
|
|
920
988
|
body: JSON.stringify({
|
|
921
989
|
inputs: t.inputs ?? {},
|
|
990
|
+
trigger: t.trigger,
|
|
922
991
|
publicationId: e,
|
|
923
992
|
version: 1
|
|
924
993
|
}),
|
|
925
994
|
headers: { "idempotency-key": t.idempotencyKey ?? $("run") },
|
|
926
995
|
method: "POST"
|
|
927
996
|
}));
|
|
928
|
-
return n.source == "live" ? n :
|
|
997
|
+
return n.source == "live" ? n : a();
|
|
998
|
+
}
|
|
999
|
+
async setFlowEnabled(e, t, n) {
|
|
1000
|
+
return E(await this.request(`/v1/flows/${Q(e)}/enabled`, {
|
|
1001
|
+
method: "PUT",
|
|
1002
|
+
body: JSON.stringify({
|
|
1003
|
+
enabled: n,
|
|
1004
|
+
expectedPublicationId: t,
|
|
1005
|
+
version: 1
|
|
1006
|
+
})
|
|
1007
|
+
}));
|
|
929
1008
|
}
|
|
930
1009
|
async publishFlow(e, t, n, r = {}) {
|
|
931
1010
|
return F(await this.request(`/v1/flows/${Q(e)}/revisions/${Q(t)}/publications`, {
|
|
932
1011
|
body: JSON.stringify({
|
|
933
|
-
engineContract: "open-flow-engine/
|
|
1012
|
+
engineContract: "open-flow-engine/v2",
|
|
934
1013
|
expectedLivePublicationId: n,
|
|
935
1014
|
version: 1
|
|
936
1015
|
}),
|
|
@@ -938,8 +1017,8 @@ var ee = class {
|
|
|
938
1017
|
method: "POST"
|
|
939
1018
|
}));
|
|
940
1019
|
}
|
|
941
|
-
async getPublishOperation(e, t) {
|
|
942
|
-
return F(await this.request(`/v1/flows/${Q(e)}/publish-operations/${Q(t)}
|
|
1020
|
+
async getPublishOperation(e, t, n) {
|
|
1021
|
+
return F(await this.request(`/v1/flows/${Q(e)}/publish-operations/${Q(t)}`, { signal: n }));
|
|
943
1022
|
}
|
|
944
1023
|
async rollbackFlow(e, t, n, r = {}) {
|
|
945
1024
|
return P(await this.request(`/v1/flows/${Q(e)}/publications/${Q(t)}/rollback`, {
|
|
@@ -951,8 +1030,8 @@ var ee = class {
|
|
|
951
1030
|
method: "POST"
|
|
952
1031
|
}));
|
|
953
1032
|
}
|
|
954
|
-
async getRun(e) {
|
|
955
|
-
return W(await this.request(`/v1/runs/${Q(e)}
|
|
1033
|
+
async getRun(e, t) {
|
|
1034
|
+
return W(await this.request(`/v1/runs/${Q(e)}`, { signal: t }));
|
|
956
1035
|
}
|
|
957
1036
|
async listRuns(e, t = {}) {
|
|
958
1037
|
let n = new URLSearchParams();
|
|
@@ -960,14 +1039,14 @@ var ee = class {
|
|
|
960
1039
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
961
1040
|
return G(await this.request(`/v1/flows/${Q(e)}/runs${r}`));
|
|
962
1041
|
}
|
|
963
|
-
async getRunEvents(e, t = {}) {
|
|
964
|
-
let
|
|
965
|
-
t.after != null &&
|
|
966
|
-
let
|
|
967
|
-
return J(await this.request(`/v1/runs/${Q(e)}/events${
|
|
1042
|
+
async getRunEvents(e, t = {}, n) {
|
|
1043
|
+
let r = new URLSearchParams();
|
|
1044
|
+
t.after != null && r.set("after", String(t.after)), t.limit != null && r.set("limit", String(t.limit));
|
|
1045
|
+
let i = r.size == 0 ? "" : `?${r}`;
|
|
1046
|
+
return J(await this.request(`/v1/runs/${Q(e)}/events${i}`, { signal: n }));
|
|
968
1047
|
}
|
|
969
|
-
async getRunResult(e) {
|
|
970
|
-
return Z(await this.request(`/v1/runs/${Q(e)}/result
|
|
1048
|
+
async getRunResult(e, t) {
|
|
1049
|
+
return Z(await this.request(`/v1/runs/${Q(e)}/result`, { signal: t }));
|
|
971
1050
|
}
|
|
972
1051
|
async cancelRun(e) {
|
|
973
1052
|
return Y(await this.request(`/v1/runs/${Q(e)}/cancel`, {
|
|
@@ -985,27 +1064,27 @@ var ee = class {
|
|
|
985
1064
|
}));
|
|
986
1065
|
}
|
|
987
1066
|
async connectorActions(e, t) {
|
|
988
|
-
let n = Object.entries(e).map(([e, t]) => `${Q(e)}=${Q(t)}`).join("&"), r = n == "" ? "" : `?${n}`,
|
|
989
|
-
return
|
|
1067
|
+
let n = Object.entries(e).map(([e, t]) => `${Q(e)}=${Q(t)}`).join("&"), r = n == "" ? "" : `?${n}`, i = o(await this.request(`/v1/connector/actions${r}`, { signal: t }));
|
|
1068
|
+
return c(i, ["actions", "version"]), i.version != 1 || !Array.isArray(i.actions) ? a() : i.actions.map(h);
|
|
990
1069
|
}
|
|
991
1070
|
async request(e, t = {}) {
|
|
992
1071
|
let n = new Headers(t.headers);
|
|
993
1072
|
t.body != null && n.set("content-type", "application/json");
|
|
994
|
-
let
|
|
1073
|
+
let r = await this.requestControl(e, {
|
|
995
1074
|
...t,
|
|
996
1075
|
headers: n
|
|
997
1076
|
}), s;
|
|
998
1077
|
try {
|
|
999
|
-
s = await
|
|
1078
|
+
s = await r.json();
|
|
1000
1079
|
} catch {
|
|
1001
|
-
return
|
|
1080
|
+
return a();
|
|
1002
1081
|
}
|
|
1003
|
-
if (!
|
|
1004
|
-
let e =
|
|
1005
|
-
throw new r
|
|
1082
|
+
if (!r.ok) {
|
|
1083
|
+
let e = o(s).error, t = e == null ? void 0 : o(e);
|
|
1084
|
+
throw new i(r.status, typeof t?.code == "string" ? t.code : "request.failed", typeof t?.message == "string" ? t.message : `Request failed with status ${r.status}.`);
|
|
1006
1085
|
}
|
|
1007
1086
|
return s;
|
|
1008
1087
|
}
|
|
1009
1088
|
};
|
|
1010
1089
|
//#endregion
|
|
1011
|
-
export {
|
|
1090
|
+
export { i as ApiError, ne as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
|