@oomol-lab/open-flow 0.1.0-beta.68 → 0.1.0-beta.69
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/{ContentIcon-Sx9bywU-.js → ContentIcon-CsECY5id.js} +14 -7
- package/dist/browser/{FlowCanvas-CXpaeurx.js → FlowCanvas-C5X22xQ7.js} +18 -18
- package/dist/browser/{createResourceDialog-BKmimKA_.js → createResourceDialog-Di5BBrQv.js} +2 -2
- package/dist/browser/{dialog-ZmfcwuMS.js → dialog-Bjo-r9B0.js} +85 -8
- package/dist/browser/event-sources.d.ts +4 -2
- package/dist/browser/{exportSvg-D4CqCcx2.js → exportSvg-Cj6Spxx-.js} +2 -2
- package/dist/browser/flow-authoring-node.d.ts +3 -1
- package/dist/browser/flow-authoring.js +68 -7
- package/dist/browser/flow-change-schema.d.ts +3 -1
- package/dist/browser/flow-change.d.ts +17 -2
- package/dist/browser/flow-change.js +82 -9
- package/dist/browser/{flowChanges-B5tZMcGr.js → flowChanges-Dp-rcEJ6.js} +737 -1180
- package/dist/browser/{flowWorkspace-zFBFtZPo.js → flowWorkspace-CB1QACku.js} +440 -70
- package/dist/browser/preview.css +49 -41
- package/dist/browser/preview.js +2229 -2359
- package/dist/browser/{typeScriptSession-D0bjYDeg.js → typeScriptSession-B0hC-C8y.js} +1 -1
- package/dist/browser/ui.css +8 -0
- package/dist/browser/workbench.css +53 -41
- package/dist/browser/workbench.js +74 -32
- package/dist/browser/{workbenchSelect-CChdgugI.js → workbenchSelect-C3hxUcYm.js} +1 -1
- package/dist/command/index.js +55 -51
- package/dist/common/authoring.d.ts +20 -0
- package/dist/common/authoringSchema.d.ts +243 -0
- package/dist/common/connector-proxy.d.ts +4 -0
- package/dist/common/control-api-conformance.js +147 -33
- package/dist/common/control-api.d.ts +14 -7
- package/dist/common/control-api.js +130 -15
- package/dist/common/control-requests.d.ts +32 -19
- package/dist/common/control-requests.js +2854 -152
- package/dist/common/decision.js +27 -3
- package/dist/common/engine-contract.d.ts +2 -2
- package/dist/common/event-source-definition.d.ts +34 -16
- package/dist/common/event-source.d.ts +63 -5
- package/dist/common/event-source.js +5744 -261
- package/dist/common/event-sources.d.ts +99 -6
- package/dist/common/flow-encoding.js +49 -10
- package/dist/common/flow-errorHandling.d.ts +36 -0
- package/dist/common/flow-graph.d.ts +4 -2
- package/dist/common/flow-retry.d.ts +19 -0
- package/dist/common/flow-semantics.js +94 -10
- package/dist/common/{fr-Du5gv3kM.js → fr-CNTSedYU.js} +259 -18
- package/dist/common/integration-trigger.d.ts +1 -1
- package/dist/common/integration-trigger.js +27 -3
- package/dist/common/{ja-D2wyPdTF.js → ja-CxQBHr2J.js} +259 -18
- package/dist/common/{ko-Cuu2AOaC.js → ko-D1Exiv1h.js} +259 -18
- package/dist/common/mcp.d.ts +30 -0
- package/dist/common/mcp.js +132 -17
- package/dist/common/openapi.js +27 -3
- package/dist/common/poll-trigger.js +27 -3
- package/dist/common/provider-triggers.d.ts +0 -2
- package/dist/common/provider-triggers.js +358 -155
- package/dist/common/{ru-BjI_JSsx.js → ru-BzLZv0B7.js} +259 -18
- package/dist/common/run-events.d.ts +2 -0
- package/dist/common/run-events.js +4 -2
- package/dist/common/runtime-contract.d.ts +1 -0
- package/dist/common/runtime-contract.js +4 -4
- package/dist/common/scheduler.d.ts +13 -2
- package/dist/common/scheduler.js +288 -98
- package/dist/common/webhook-trigger.js +27 -3
- package/dist/common/workflow.js +27 -3
- package/dist/common/{zh-CN-CnnXkzLh.js → zh-CN-Dg_xSGde.js} +259 -18
- package/dist/common/{zh-TW-CJnR2dgF.js → zh-TW-oxuLwsV0.js} +259 -18
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/common/event-source-feishu.d.ts +0 -3
- package/dist/common/feishu-events.d.ts +0 -19
- package/dist/common/feishu-subscriptions.d.ts +0 -6
|
@@ -22,6 +22,35 @@ function dequal(foo, bar) {
|
|
|
22
22
|
return foo !== foo && bar !== bar;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
+
//#region src/execution/common/engineContract.ts
|
|
26
|
+
var currentEngineContract = "open-flow-engine/v6";
|
|
27
|
+
`${JSON.stringify(currentEngineContract)}`, new Set([
|
|
28
|
+
"assert",
|
|
29
|
+
"assert/strict",
|
|
30
|
+
"buffer",
|
|
31
|
+
"console",
|
|
32
|
+
"constants",
|
|
33
|
+
"crypto",
|
|
34
|
+
"events",
|
|
35
|
+
"fs",
|
|
36
|
+
"fs/promises",
|
|
37
|
+
"os",
|
|
38
|
+
"path",
|
|
39
|
+
"path/posix",
|
|
40
|
+
"process",
|
|
41
|
+
"punycode",
|
|
42
|
+
"querystring",
|
|
43
|
+
"stream",
|
|
44
|
+
"stream/promises",
|
|
45
|
+
"stream/web",
|
|
46
|
+
"string_decoder",
|
|
47
|
+
"timers",
|
|
48
|
+
"timers/promises",
|
|
49
|
+
"url",
|
|
50
|
+
"util",
|
|
51
|
+
"zlib"
|
|
52
|
+
].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v6/nodejs-compat-v1")}`;
|
|
53
|
+
//#endregion
|
|
25
54
|
//#region src/openapi/common/authBindings.ts
|
|
26
55
|
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
27
56
|
function assertOpenApiAuthBindings(document) {
|
|
@@ -8550,6 +8579,18 @@ function checkJsonDepth(value, depth = 0) {
|
|
|
8550
8579
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
8551
8580
|
}
|
|
8552
8581
|
//#endregion
|
|
8582
|
+
//#region src/flow/common/retry.ts
|
|
8583
|
+
var nodeRetryLimits = {
|
|
8584
|
+
maxRetries: 5,
|
|
8585
|
+
minIntervalMs: 1e3,
|
|
8586
|
+
maxIntervalMs: 6e4,
|
|
8587
|
+
intervalStepMs: 1e3
|
|
8588
|
+
};
|
|
8589
|
+
var retryConfigurationSchema = strictObject({
|
|
8590
|
+
maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
|
|
8591
|
+
intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
|
|
8592
|
+
});
|
|
8593
|
+
//#endregion
|
|
8553
8594
|
//#region src/flow/common/triggerScheduleSchema.ts
|
|
8554
8595
|
var triggerScheduleSchema = array(union([object({
|
|
8555
8596
|
type: literal("cron"),
|
|
@@ -8598,6 +8639,7 @@ var source = union([object({
|
|
|
8598
8639
|
kind: literal("node"),
|
|
8599
8640
|
nodeId: text,
|
|
8600
8641
|
output: text,
|
|
8642
|
+
system: literal(true).optional(),
|
|
8601
8643
|
field: text.optional()
|
|
8602
8644
|
}), object({
|
|
8603
8645
|
kind: literal("binding"),
|
|
@@ -8856,7 +8898,9 @@ var base = {
|
|
|
8856
8898
|
name: text.optional(),
|
|
8857
8899
|
description: text.optional(),
|
|
8858
8900
|
icon: text.optional(),
|
|
8859
|
-
timeoutMs: number().optional()
|
|
8901
|
+
timeoutMs: number().optional(),
|
|
8902
|
+
retry: retryConfigurationSchema.optional(),
|
|
8903
|
+
onError: _enum(["stop", "error"]).optional()
|
|
8860
8904
|
};
|
|
8861
8905
|
var node = union([
|
|
8862
8906
|
strictObject({
|
|
@@ -8992,7 +9036,8 @@ var revision = object({
|
|
|
8992
9036
|
literal(5),
|
|
8993
9037
|
literal(6),
|
|
8994
9038
|
literal(7),
|
|
8995
|
-
literal(8)
|
|
9039
|
+
literal(8),
|
|
9040
|
+
literal(9)
|
|
8996
9041
|
]),
|
|
8997
9042
|
document,
|
|
8998
9043
|
modules: record$3(text, module)
|
|
@@ -9061,6 +9106,13 @@ var shapes = {
|
|
|
9061
9106
|
},
|
|
9062
9107
|
"graph.node.delete": at,
|
|
9063
9108
|
"graph.node.field.set": union([
|
|
9109
|
+
object({
|
|
9110
|
+
...at,
|
|
9111
|
+
kind: literal("graph.node.field.set"),
|
|
9112
|
+
field: literal("retry"),
|
|
9113
|
+
before: retryConfigurationSchema.optional(),
|
|
9114
|
+
value: retryConfigurationSchema.optional()
|
|
9115
|
+
}),
|
|
9064
9116
|
object({
|
|
9065
9117
|
...at,
|
|
9066
9118
|
kind: literal("graph.node.field.set"),
|
|
@@ -9074,7 +9126,8 @@ var shapes = {
|
|
|
9074
9126
|
field: _enum([
|
|
9075
9127
|
"description",
|
|
9076
9128
|
"icon",
|
|
9077
|
-
"name"
|
|
9129
|
+
"name",
|
|
9130
|
+
"onError"
|
|
9078
9131
|
]),
|
|
9079
9132
|
before: text.optional(),
|
|
9080
9133
|
value: text.optional()
|
|
@@ -9179,6 +9232,12 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9179
9232
|
...shape
|
|
9180
9233
|
})])).values()])).min(1);
|
|
9181
9234
|
function checkModelVersion(content) {
|
|
9235
|
+
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
|
|
9236
|
+
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
|
|
9237
|
+
if (candidateNode.onError != null) return true;
|
|
9238
|
+
if ([...Object.values("inputs" in candidateNode ? candidateNode.inputs : {}), ...Object.values(candidateNode.kind == "outputs" ? candidateNode.outputMappings : {})].some((candidateMapping) => candidateMapping.kind == "sources" && candidateMapping.sources.some((candidateSource) => candidateSource.kind == "node" && candidateSource.system))) return true;
|
|
9239
|
+
return candidateNode.kind == "condition" && candidateNode.cases.some((item) => item.groups.some((candidateGroup) => candidateGroup.expressions.some((expression) => [expression.left, expression.right].some((candidateOperand) => candidateOperand?.kind == "source" && candidateOperand.source.kind == "node" && candidateOperand.source.system))));
|
|
9240
|
+
})) throw new TypeError("Node error handling requires Flow model version 9.");
|
|
9182
9241
|
if (content.modelVersion < 8 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "outputs")) throw new TypeError("Workflow outputs require Flow model version 8.");
|
|
9183
9242
|
if (content.modelVersion < 7 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "start")) throw new TypeError("Start Triggers require Flow model version 7.");
|
|
9184
9243
|
if (content.modelVersion < 6 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task)) throw new TypeError("Node-owned managed Tasks require Flow model version 6.");
|
|
@@ -9215,10 +9274,10 @@ function upgradeRevisionContent(content) {
|
|
|
9215
9274
|
function upgradeDecodedRevisionContent(content) {
|
|
9216
9275
|
const graph = content.document.graph;
|
|
9217
9276
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9218
|
-
if (!hasManual && content.modelVersion ==
|
|
9277
|
+
if (!hasManual && content.modelVersion == 9) return content;
|
|
9219
9278
|
return {
|
|
9220
9279
|
...content,
|
|
9221
|
-
modelVersion:
|
|
9280
|
+
modelVersion: 9,
|
|
9222
9281
|
document: {
|
|
9223
9282
|
...content.document,
|
|
9224
9283
|
graph: hasManual ? {
|
|
@@ -9331,12 +9390,19 @@ var output = strictObject({
|
|
|
9331
9390
|
port: id$1.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
|
|
9332
9391
|
field: string$1().optional()
|
|
9333
9392
|
});
|
|
9393
|
+
var system = strictObject({
|
|
9394
|
+
kind: literal("system"),
|
|
9395
|
+
node: referenceSchema,
|
|
9396
|
+
port: literal("error"),
|
|
9397
|
+
field: string$1().optional()
|
|
9398
|
+
});
|
|
9334
9399
|
var variable$1 = strictObject({
|
|
9335
9400
|
kind: literal("variable"),
|
|
9336
9401
|
name: id$1
|
|
9337
9402
|
});
|
|
9338
9403
|
var authoringSourceSchema = union([
|
|
9339
9404
|
output,
|
|
9405
|
+
system,
|
|
9340
9406
|
variable$1,
|
|
9341
9407
|
strictObject({
|
|
9342
9408
|
kind: literal("value"),
|
|
@@ -9346,7 +9412,11 @@ var authoringSourceSchema = union([
|
|
|
9346
9412
|
strictObject({ kind: literal("default") }),
|
|
9347
9413
|
strictObject({
|
|
9348
9414
|
kind: literal("sources"),
|
|
9349
|
-
sources: array(union([
|
|
9415
|
+
sources: array(union([
|
|
9416
|
+
output,
|
|
9417
|
+
system,
|
|
9418
|
+
variable$1
|
|
9419
|
+
])).min(1)
|
|
9350
9420
|
})
|
|
9351
9421
|
]);
|
|
9352
9422
|
var operand = union([
|
|
@@ -9356,6 +9426,7 @@ var operand = union([
|
|
|
9356
9426
|
schema: json$2.optional()
|
|
9357
9427
|
}),
|
|
9358
9428
|
output,
|
|
9429
|
+
system,
|
|
9359
9430
|
variable$1
|
|
9360
9431
|
]);
|
|
9361
9432
|
var agentTool = authoringDefinitionSchemas.agent.shape.tools.element.omit({
|
|
@@ -9447,11 +9518,13 @@ var authoringConfigurations = {
|
|
|
9447
9518
|
approval: strictObject({ inputs: inputFields })
|
|
9448
9519
|
};
|
|
9449
9520
|
var updates = strictObject({
|
|
9521
|
+
onError: _enum(["stop", "error"]).optional(),
|
|
9450
9522
|
name: id$1.optional(),
|
|
9451
9523
|
description: string$1().optional(),
|
|
9452
9524
|
icon: string$1().optional(),
|
|
9453
9525
|
maxExecutions: int().positive().optional(),
|
|
9454
9526
|
timeoutMs: number().nonnegative().optional(),
|
|
9527
|
+
retry: retryConfigurationSchema.partial().optional().describe("Node retry policy for Code, Connector, OpenAPI, LLM and AI Decision. Omitted update fields preserve the policy; use clear: [[\"retry\"]] to disable it. maxRetries counts additional attempts; intervalMs is 1000–60000 in whole seconds."),
|
|
9455
9528
|
config: patch.optional().describe("Recursively merge configuration; omitted fields remain unchanged and arrays replace as a whole. This includes schema objects: {} does not clear an existing schema. Use clear paths to remove fields, e.g. [\"config\",\"inputs\",\"amount\",\"schema\",\"type\"].")
|
|
9456
9529
|
});
|
|
9457
9530
|
var authoringEditSchema = discriminatedUnion("op", [
|
|
@@ -9460,6 +9533,8 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
9460
9533
|
as: id$1.regex(/^[A-Za-z][\w-]*$/).describe("Unique batch-local alias without the $ prefix. Later edits must reference this new node as $alias; the bare alias is not its node ID."),
|
|
9461
9534
|
type,
|
|
9462
9535
|
name: id$1,
|
|
9536
|
+
onError: _enum(["stop", "error"]).optional(),
|
|
9537
|
+
retry: retryConfigurationSchema.optional(),
|
|
9463
9538
|
config: patch.optional(),
|
|
9464
9539
|
inputs: record$3(id$1, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
|
|
9465
9540
|
code: string$1().optional(),
|
|
@@ -10556,22 +10631,44 @@ function connectorProvider(value) {
|
|
|
10556
10631
|
//#endregion
|
|
10557
10632
|
//#region src/control/common/eventSources.ts
|
|
10558
10633
|
var id = string$1().min(1).max(256);
|
|
10559
|
-
var eventType = string$1().regex(/^[a-z][a-z0-9_
|
|
10634
|
+
var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
|
|
10560
10635
|
var name = string$1().trim().min(1).max(128);
|
|
10561
10636
|
var eventSourceSchema = object({
|
|
10562
10637
|
version: literal(1),
|
|
10563
10638
|
sourceId: id,
|
|
10564
10639
|
revision: int().positive(),
|
|
10565
10640
|
name,
|
|
10566
|
-
provider: _enum([
|
|
10567
|
-
|
|
10641
|
+
provider: _enum([
|
|
10642
|
+
"feishu",
|
|
10643
|
+
"feishu_app_bot",
|
|
10644
|
+
"slackbot",
|
|
10645
|
+
"intercom",
|
|
10646
|
+
"sentry",
|
|
10647
|
+
"zoom",
|
|
10648
|
+
"fireflies",
|
|
10649
|
+
"jira"
|
|
10650
|
+
]),
|
|
10651
|
+
appId: id.nullable(),
|
|
10652
|
+
workspaceId: id.optional(),
|
|
10653
|
+
installationId: id.optional(),
|
|
10654
|
+
organizationId: id.optional(),
|
|
10655
|
+
projectId: id.optional(),
|
|
10656
|
+
projectKey: id.optional(),
|
|
10657
|
+
subscriptionStatus: _enum([
|
|
10658
|
+
"idle",
|
|
10659
|
+
"pending",
|
|
10660
|
+
"ready",
|
|
10661
|
+
"error"
|
|
10662
|
+
]).optional(),
|
|
10663
|
+
lastError: string$1().optional(),
|
|
10664
|
+
signingSecretConfigured: boolean().optional(),
|
|
10568
10665
|
connectionId: id,
|
|
10569
10666
|
teamId: id.nullable(),
|
|
10570
10667
|
enabled: boolean(),
|
|
10571
10668
|
eventTypes: array(eventType),
|
|
10572
|
-
manageSubscriptions: boolean(),
|
|
10573
|
-
verificationTokenConfigured: boolean(),
|
|
10574
|
-
encryptKeyConfigured: boolean(),
|
|
10669
|
+
manageSubscriptions: boolean().nullable(),
|
|
10670
|
+
verificationTokenConfigured: boolean().nullable(),
|
|
10671
|
+
encryptKeyConfigured: boolean().nullable(),
|
|
10575
10672
|
endpointUrl: string$1().nullable(),
|
|
10576
10673
|
verifiedAt: string$1().nullable(),
|
|
10577
10674
|
lastReceivedAt: string$1().nullable(),
|
|
@@ -10582,6 +10679,21 @@ var eventSourceSchema = object({
|
|
|
10582
10679
|
triggerNodeId: id
|
|
10583
10680
|
}))
|
|
10584
10681
|
});
|
|
10682
|
+
eventSourceSchema.pick({
|
|
10683
|
+
appId: true,
|
|
10684
|
+
workspaceId: true,
|
|
10685
|
+
installationId: true,
|
|
10686
|
+
organizationId: true,
|
|
10687
|
+
projectId: true,
|
|
10688
|
+
projectKey: true,
|
|
10689
|
+
subscriptionStatus: true,
|
|
10690
|
+
lastError: true,
|
|
10691
|
+
signingSecretConfigured: true,
|
|
10692
|
+
manageSubscriptions: true,
|
|
10693
|
+
verificationTokenConfigured: true,
|
|
10694
|
+
encryptKeyConfigured: true,
|
|
10695
|
+
verifiedAt: true
|
|
10696
|
+
});
|
|
10585
10697
|
function decodeEventSource(value) {
|
|
10586
10698
|
return eventSourceSchema.parse(value);
|
|
10587
10699
|
}
|
|
@@ -11436,6 +11548,7 @@ function decodeRunEvent(value) {
|
|
|
11436
11548
|
kind,
|
|
11437
11549
|
payload: {
|
|
11438
11550
|
...node,
|
|
11551
|
+
...payload.systemOutputs === void 0 ? {} : { systemOutputs: Object.fromEntries(Object.entries(record$1(payload.systemOutputs)).map(([key, item]) => [key, jsonValue(item)])) },
|
|
11439
11552
|
outputs: Object.fromEntries(Object.entries(record$1(payload.outputs)).map(([key, item]) => [key, jsonValue(item)]))
|
|
11440
11553
|
}
|
|
11441
11554
|
};
|
|
@@ -11446,6 +11559,8 @@ function decodeRunEvent(value) {
|
|
|
11446
11559
|
kind,
|
|
11447
11560
|
payload: {
|
|
11448
11561
|
...node,
|
|
11562
|
+
...payload.handled === true ? { handled: true } : {},
|
|
11563
|
+
...payload.systemOutputs === void 0 ? {} : { systemOutputs: Object.fromEntries(Object.entries(record$1(payload.systemOutputs)).map(([key, item]) => [key, jsonValue(item)])) },
|
|
11449
11564
|
error: {
|
|
11450
11565
|
code: string(error.code),
|
|
11451
11566
|
message: string(error.message)
|
|
@@ -11552,8 +11667,8 @@ var ControlClient = class {
|
|
|
11552
11667
|
async listEventSources(flowId, signal) {
|
|
11553
11668
|
return decodeEventSources(await this.request("/v1/event-sources" + (flowId == null ? "" : `?flowId=${segment(flowId)}`), { signal }));
|
|
11554
11669
|
}
|
|
11555
|
-
async listEventSourceConnections(teamId, signal) {
|
|
11556
|
-
const source = record$1(await this.request(`/v1/event-sources/connections${teamId == null ? "" :
|
|
11670
|
+
async listEventSourceConnections(teamId, signal, kind = "feishu") {
|
|
11671
|
+
const source = record$1(await this.request(`/v1/event-sources/connections?kind=${kind}${teamId == null ? "" : `&teamId=${segment(teamId)}`}`, { signal }));
|
|
11557
11672
|
requiredFields(source, ["version", "connections"]);
|
|
11558
11673
|
if (source.version != 1 || !Array.isArray(source.connections)) return invalidResponse();
|
|
11559
11674
|
return source.connections.map(connection);
|
|
@@ -12016,7 +12131,7 @@ var ControlClient = class {
|
|
|
12016
12131
|
async checkFlow(flowId, revisionId) {
|
|
12017
12132
|
return flowCheck(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/check`, {
|
|
12018
12133
|
body: JSON.stringify({
|
|
12019
|
-
engineContract:
|
|
12134
|
+
engineContract: currentEngineContract,
|
|
12020
12135
|
version: 1
|
|
12021
12136
|
}),
|
|
12022
12137
|
method: "POST"
|
|
@@ -12041,7 +12156,7 @@ var ControlClient = class {
|
|
|
12041
12156
|
async createDraftRun(flowId, revisionId, options) {
|
|
12042
12157
|
const created = runDetails(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/runs`, {
|
|
12043
12158
|
body: JSON.stringify({
|
|
12044
|
-
engineContract:
|
|
12159
|
+
engineContract: currentEngineContract,
|
|
12045
12160
|
inputs: options.inputs ?? {},
|
|
12046
12161
|
trigger: options.trigger,
|
|
12047
12162
|
version: 2
|
|
@@ -12083,7 +12198,7 @@ var ControlClient = class {
|
|
|
12083
12198
|
async publishFlow(flowId, revisionId, expectedLivePublicationId, options = {}) {
|
|
12084
12199
|
return publishOperation(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/publications`, {
|
|
12085
12200
|
body: JSON.stringify({
|
|
12086
|
-
engineContract:
|
|
12201
|
+
engineContract: currentEngineContract,
|
|
12087
12202
|
expectedLivePublicationId,
|
|
12088
12203
|
version: 1
|
|
12089
12204
|
}),
|
|
@@ -12200,7 +12315,6 @@ var ControlClient = class {
|
|
|
12200
12315
|
};
|
|
12201
12316
|
//#endregion
|
|
12202
12317
|
//#region src/control/common/conformance.ts
|
|
12203
|
-
var engineContract = "open-flow-engine/v5";
|
|
12204
12318
|
function fail(message) {
|
|
12205
12319
|
throw new Error(message);
|
|
12206
12320
|
}
|
|
@@ -12315,7 +12429,7 @@ function changedRevisionId(change, message) {
|
|
|
12315
12429
|
function publishRequest(harness, flowId, revisionId, expectedLivePublicationId, key) {
|
|
12316
12430
|
return request(harness, `/v1/flows/${encodeURIComponent(flowId)}/revisions/${encodeURIComponent(revisionId)}/publications`, {
|
|
12317
12431
|
body: JSON.stringify({
|
|
12318
|
-
engineContract,
|
|
12432
|
+
engineContract: currentEngineContract,
|
|
12319
12433
|
expectedLivePublicationId,
|
|
12320
12434
|
version: 1
|
|
12321
12435
|
}),
|
|
@@ -12558,7 +12672,7 @@ var controlApiConformanceCases = [
|
|
|
12558
12672
|
method: "POST",
|
|
12559
12673
|
headers: { "idempotency-key": key },
|
|
12560
12674
|
body: JSON.stringify({
|
|
12561
|
-
engineContract,
|
|
12675
|
+
engineContract: currentEngineContract,
|
|
12562
12676
|
inputs: {},
|
|
12563
12677
|
trigger: {
|
|
12564
12678
|
nodeId,
|
|
@@ -12611,7 +12725,7 @@ var controlApiConformanceCases = [
|
|
|
12611
12725
|
method: "POST",
|
|
12612
12726
|
headers: { "idempotency-key": "concurrent-run" },
|
|
12613
12727
|
body: JSON.stringify({
|
|
12614
|
-
engineContract,
|
|
12728
|
+
engineContract: currentEngineContract,
|
|
12615
12729
|
inputs: {},
|
|
12616
12730
|
trigger: {
|
|
12617
12731
|
nodeId: "start",
|
|
@@ -12955,7 +13069,7 @@ var controlApiConformanceCases = [
|
|
|
12955
13069
|
equal((await json(await request(harness, `${path}/check`, {
|
|
12956
13070
|
method: "POST",
|
|
12957
13071
|
body: JSON.stringify({
|
|
12958
|
-
engineContract,
|
|
13072
|
+
engineContract: currentEngineContract,
|
|
12959
13073
|
version: 1
|
|
12960
13074
|
})
|
|
12961
13075
|
}), 200, "Check entire Draft")).valid, false, "Entire Draft remains invalid");
|
|
@@ -12963,7 +13077,7 @@ var controlApiConformanceCases = [
|
|
|
12963
13077
|
method: "POST",
|
|
12964
13078
|
headers: { "idempotency-key": `partial-${nodeId}` },
|
|
12965
13079
|
body: JSON.stringify({
|
|
12966
|
-
engineContract,
|
|
13080
|
+
engineContract: currentEngineContract,
|
|
12967
13081
|
inputs: {},
|
|
12968
13082
|
trigger: {
|
|
12969
13083
|
nodeId,
|
|
@@ -12990,7 +13104,7 @@ var controlApiConformanceCases = [
|
|
|
12990
13104
|
const draftRevisionId = await addStartTrigger(harness, flowId, requiredString(flow.draftRevisionId, "Run Flow revisionId"));
|
|
12991
13105
|
equal((await json(await request(harness, `/v1/flows/${flowId}/revisions/${draftRevisionId}/check`, {
|
|
12992
13106
|
body: JSON.stringify({
|
|
12993
|
-
engineContract,
|
|
13107
|
+
engineContract: currentEngineContract,
|
|
12994
13108
|
version: 1
|
|
12995
13109
|
}),
|
|
12996
13110
|
method: "POST"
|
|
@@ -13008,7 +13122,7 @@ var controlApiConformanceCases = [
|
|
|
13008
13122
|
}
|
|
13009
13123
|
]) await error(await request(harness, runPath, {
|
|
13010
13124
|
body: JSON.stringify({
|
|
13011
|
-
engineContract,
|
|
13125
|
+
engineContract: currentEngineContract,
|
|
13012
13126
|
inputs: {},
|
|
13013
13127
|
trigger,
|
|
13014
13128
|
version: 2
|
|
@@ -13018,7 +13132,7 @@ var controlApiConformanceCases = [
|
|
|
13018
13132
|
}), 400, "run.invalid", "Reject invalid start node or payload");
|
|
13019
13133
|
const create = () => request(harness, runPath, {
|
|
13020
13134
|
body: JSON.stringify({
|
|
13021
|
-
engineContract,
|
|
13135
|
+
engineContract: currentEngineContract,
|
|
13022
13136
|
inputs: {},
|
|
13023
13137
|
trigger: {
|
|
13024
13138
|
nodeId: "start",
|
|
@@ -13034,7 +13148,7 @@ var controlApiConformanceCases = [
|
|
|
13034
13148
|
equal(await json(await create(), 200, "Replay Draft Run"), run, "Replayed Draft Run");
|
|
13035
13149
|
await error(await request(harness, runPath, {
|
|
13036
13150
|
body: JSON.stringify({
|
|
13037
|
-
engineContract,
|
|
13151
|
+
engineContract: currentEngineContract,
|
|
13038
13152
|
inputs: {},
|
|
13039
13153
|
trigger: {
|
|
13040
13154
|
nodeId: "another",
|
|
@@ -13048,7 +13162,7 @@ var controlApiConformanceCases = [
|
|
|
13048
13162
|
await error(await request(harness, `/v1/runs/${runId}/result`), 409, "run.not-terminal", "Read queued Run result");
|
|
13049
13163
|
const secondRunId = requiredString((await json(await request(harness, runPath, {
|
|
13050
13164
|
body: JSON.stringify({
|
|
13051
|
-
engineContract,
|
|
13165
|
+
engineContract: currentEngineContract,
|
|
13052
13166
|
inputs: {},
|
|
13053
13167
|
trigger: {
|
|
13054
13168
|
nodeId: "start",
|
|
@@ -13138,7 +13252,7 @@ var controlApiConformanceCases = [
|
|
|
13138
13252
|
}]), 200, "Create Wait"), "Wait Revision")}/runs`;
|
|
13139
13253
|
const create = async (key, message) => json(await request(harness, runPath, {
|
|
13140
13254
|
body: JSON.stringify({
|
|
13141
|
-
engineContract,
|
|
13255
|
+
engineContract: currentEngineContract,
|
|
13142
13256
|
inputs: {},
|
|
13143
13257
|
trigger: {
|
|
13144
13258
|
nodeId: "start",
|
|
@@ -13258,7 +13372,7 @@ var controlApiConformanceCases = [
|
|
|
13258
13372
|
method: "POST"
|
|
13259
13373
|
});
|
|
13260
13374
|
await error(await check(revisionId, "unsupported-engine/v1"), 409, "engine.unsupported", "Check unsupported Engine");
|
|
13261
|
-
await error(await check(missingRevision,
|
|
13375
|
+
await error(await check(missingRevision, currentEngineContract), 404, "flow.not-found", "Check missing Revision");
|
|
13262
13376
|
const run = (targetRevision, contract, key) => request(harness, `/v1/flows/${flowId}/revisions/${targetRevision}/runs`, {
|
|
13263
13377
|
body: JSON.stringify({
|
|
13264
13378
|
engineContract: contract,
|
|
@@ -13273,7 +13387,7 @@ var controlApiConformanceCases = [
|
|
|
13273
13387
|
method: "POST"
|
|
13274
13388
|
});
|
|
13275
13389
|
await error(await run(revisionId, "unsupported-engine/v1", "unsupported-run"), 409, "engine.unsupported", "Run unsupported Engine");
|
|
13276
|
-
await error(await run(missingRevision,
|
|
13390
|
+
await error(await run(missingRevision, currentEngineContract, "missing-revision-run"), 404, "flow.not-found", "Run missing Revision");
|
|
13277
13391
|
}
|
|
13278
13392
|
}
|
|
13279
13393
|
];
|
|
@@ -13311,7 +13425,7 @@ var publicationControlApiConformanceCases = [
|
|
|
13311
13425
|
method: "POST",
|
|
13312
13426
|
headers: { "idempotency-key": "disabled-draft" },
|
|
13313
13427
|
body: JSON.stringify({
|
|
13314
|
-
engineContract,
|
|
13428
|
+
engineContract: currentEngineContract,
|
|
13315
13429
|
inputs: {},
|
|
13316
13430
|
trigger: {
|
|
13317
13431
|
nodeId: "start",
|
|
@@ -13729,7 +13843,7 @@ function selectableConnectorAccessControlApiConformanceCases(fixture) {
|
|
|
13729
13843
|
const revisionId = await addStartTrigger(harness, flowId, requiredString(created.draftRevisionId, "Draft Revision ID"));
|
|
13730
13844
|
equal((await json(await request(harness, `/v1/flows/${flowId}/revisions/${revisionId}/runs`, {
|
|
13731
13845
|
body: JSON.stringify({
|
|
13732
|
-
engineContract,
|
|
13846
|
+
engineContract: currentEngineContract,
|
|
13733
13847
|
inputs: {},
|
|
13734
13848
|
trigger: {
|
|
13735
13849
|
nodeId: "start",
|
|
@@ -520,12 +520,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
520
520
|
readonly sequence: number;
|
|
521
521
|
readonly kind: "run.queued";
|
|
522
522
|
readonly payload: {
|
|
523
|
+
nodeId?: undefined;
|
|
523
524
|
readonly flowId?: undefined;
|
|
524
525
|
readonly scopeId?: undefined;
|
|
525
526
|
readonly progress?: undefined;
|
|
526
527
|
readonly waitIds?: undefined;
|
|
527
528
|
readonly expiresAt?: undefined;
|
|
528
|
-
readonly nodeId?: undefined;
|
|
529
529
|
readonly waitingSince?: undefined;
|
|
530
530
|
readonly action?: undefined;
|
|
531
531
|
readonly comment?: undefined;
|
|
@@ -538,13 +538,13 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
538
538
|
readonly sequence: number;
|
|
539
539
|
readonly kind: "run.started";
|
|
540
540
|
readonly payload: {
|
|
541
|
+
nodeId?: undefined;
|
|
541
542
|
readonly flowId: string;
|
|
542
543
|
readonly scopeId: string;
|
|
543
544
|
readonly parentScopeId?: string | undefined;
|
|
544
545
|
readonly progress?: undefined;
|
|
545
546
|
readonly waitIds?: undefined;
|
|
546
547
|
readonly expiresAt?: undefined;
|
|
547
|
-
readonly nodeId?: undefined;
|
|
548
548
|
readonly waitingSince?: undefined;
|
|
549
549
|
readonly action?: undefined;
|
|
550
550
|
readonly comment?: undefined;
|
|
@@ -557,12 +557,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
557
557
|
readonly sequence: number;
|
|
558
558
|
readonly kind: "run.progress";
|
|
559
559
|
readonly payload: {
|
|
560
|
+
nodeId?: undefined;
|
|
560
561
|
readonly flowId: string;
|
|
561
562
|
readonly scopeId: string;
|
|
562
563
|
readonly progress: number;
|
|
563
564
|
readonly waitIds?: undefined;
|
|
564
565
|
readonly expiresAt?: undefined;
|
|
565
|
-
readonly nodeId?: undefined;
|
|
566
566
|
readonly waitingSince?: undefined;
|
|
567
567
|
readonly action?: undefined;
|
|
568
568
|
readonly comment?: undefined;
|
|
@@ -575,12 +575,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
575
575
|
readonly sequence: number;
|
|
576
576
|
readonly kind: "run.waiting";
|
|
577
577
|
readonly payload: {
|
|
578
|
+
nodeId?: undefined;
|
|
578
579
|
readonly flowId?: undefined;
|
|
579
580
|
readonly scopeId?: undefined;
|
|
580
581
|
readonly progress?: undefined;
|
|
581
582
|
readonly waitIds: string[];
|
|
582
583
|
readonly expiresAt?: undefined;
|
|
583
|
-
readonly nodeId?: undefined;
|
|
584
584
|
readonly waitingSince?: undefined;
|
|
585
585
|
readonly action?: undefined;
|
|
586
586
|
readonly comment?: undefined;
|
|
@@ -611,12 +611,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
611
611
|
readonly sequence: number;
|
|
612
612
|
readonly kind: "run.resolved";
|
|
613
613
|
readonly payload: {
|
|
614
|
+
nodeId?: undefined;
|
|
614
615
|
readonly flowId?: undefined;
|
|
615
616
|
readonly scopeId?: undefined;
|
|
616
617
|
readonly progress?: undefined;
|
|
617
618
|
readonly waitIds?: undefined;
|
|
618
619
|
readonly expiresAt?: undefined;
|
|
619
|
-
readonly nodeId?: undefined;
|
|
620
620
|
readonly waitingSince?: undefined;
|
|
621
621
|
readonly action: "approve" | "continue" | "reject";
|
|
622
622
|
readonly comment: string | null;
|
|
@@ -629,12 +629,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
629
629
|
readonly sequence: number;
|
|
630
630
|
readonly kind: "run.canceled" | "run.completed" | "run.failed" | "run.indeterminate";
|
|
631
631
|
readonly payload: {
|
|
632
|
+
nodeId?: undefined;
|
|
632
633
|
readonly flowId?: undefined;
|
|
633
634
|
readonly scopeId?: undefined;
|
|
634
635
|
readonly progress?: undefined;
|
|
635
636
|
readonly waitIds?: undefined;
|
|
636
637
|
readonly expiresAt?: undefined;
|
|
637
|
-
readonly nodeId?: undefined;
|
|
638
638
|
readonly waitingSince?: undefined;
|
|
639
639
|
readonly action?: undefined;
|
|
640
640
|
readonly comment?: undefined;
|
|
@@ -689,6 +689,9 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
689
689
|
readonly scopeId: string;
|
|
690
690
|
readonly nodeId: string;
|
|
691
691
|
readonly executionId: string;
|
|
692
|
+
readonly systemOutputs?: {
|
|
693
|
+
[k: string]: JsonValue;
|
|
694
|
+
} | undefined;
|
|
692
695
|
readonly outputs: {
|
|
693
696
|
[k: string]: JsonValue;
|
|
694
697
|
};
|
|
@@ -711,6 +714,10 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
711
714
|
readonly scopeId: string;
|
|
712
715
|
readonly nodeId: string;
|
|
713
716
|
readonly executionId: string;
|
|
717
|
+
readonly handled?: true | undefined;
|
|
718
|
+
readonly systemOutputs?: {
|
|
719
|
+
[k: string]: JsonValue;
|
|
720
|
+
} | undefined;
|
|
714
721
|
readonly error: {
|
|
715
722
|
readonly code: string;
|
|
716
723
|
readonly message: string;
|
|
@@ -808,7 +815,7 @@ export declare class ControlClient {
|
|
|
808
815
|
readonly sources: readonly EventSource[];
|
|
809
816
|
readonly teamId?: string | null;
|
|
810
817
|
}>;
|
|
811
|
-
listEventSourceConnections(teamId: string | null, signal?: AbortSignal): Promise<readonly ConnectorConnection[]>;
|
|
818
|
+
listEventSourceConnections(teamId: string | null, signal?: AbortSignal, kind?: 'feishu' | 'slack' | 'intercom' | 'sentry' | 'zoom' | 'fireflies' | 'jira'): Promise<readonly ConnectorConnection[]>;
|
|
812
819
|
createEventSource(input: CreateEventSource): Promise<EventSource>;
|
|
813
820
|
updateEventSource(sourceId: string, input: UpdateEventSource): Promise<EventSource>;
|
|
814
821
|
deleteEventSource(sourceId: string, expectedRevision: number): Promise<void>;
|