@oomol-lab/open-flow 0.1.0-beta.30 → 0.1.0-beta.32
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/{createResourceDialog-_y2xHaUA.js → createResourceDialog-DRB0OEtr.js} +2 -2
- package/dist/browser/{editorComponent-Dq4IKp5R.js → editorComponent-bXA-KosC.js} +2765 -1113
- package/dist/browser/flow-authoring-node.d.ts +5 -3
- package/dist/browser/flow-authoring.js +1575 -1472
- package/dist/browser/flow-change.d.ts +47 -20
- package/dist/browser/flow-change.js +1728 -1602
- package/dist/browser/flow-input-value.d.ts +6 -0
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/flowChanges-FiZJreeB.js +9855 -0
- package/dist/browser/{flowRunInputEditorStore-CTORQcA2.js → flowRunInputEditorStore-Bgb5vSeS.js} +3 -3
- package/dist/browser/flowWorkspace-CBo6Ih_c.js +40987 -0
- package/dist/browser/{inputValues-DJfFraxG.js → inputValues-CUyjbECo.js} +2 -2
- package/dist/browser/licenses.md +0 -58
- package/dist/browser/{lite-BuKZ8joP.js → lite-BA96NG4M.js} +8 -4
- package/dist/browser/theme.css +2 -0
- package/dist/browser/ui.css +2 -1
- package/dist/browser/ui.d.ts +31 -3
- package/dist/browser/ui.js +3547 -772
- package/dist/browser/{value-DPg_9yXB.js → value-B_yE9ean.js} +22 -14
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +3944 -1077
- package/dist/browser/{workbenchSelect-BDPIQxYK.js → workbenchSelect-DNteZJYP.js} +1698 -1470
- package/dist/common/control-api-conformance.d.ts +6 -0
- package/dist/common/control-api-conformance.js +510 -394
- package/dist/common/control-api-errors.d.ts +16 -0
- package/dist/common/control-api.d.ts +64 -7
- package/dist/common/control-api.js +1724 -1568
- package/dist/common/control-requests.d.ts +16 -0
- package/dist/common/control-requests.js +685 -651
- package/dist/common/event-sources.d.ts +0 -1
- package/dist/common/feishu-events.d.ts +0 -1
- package/dist/common/flow-encoding.js +1168 -1140
- package/dist/common/flow-graph.d.ts +16 -9
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-semantics.d.ts +2 -2
- package/dist/common/flow-semantics.js +2223 -1954
- package/dist/common/fr-ClB96SQY.js +298 -0
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/integration-trigger.js +7572 -88
- package/dist/common/ja-BJF-VrP2.js +298 -0
- package/dist/common/ko-Bght_VaB.js +298 -0
- package/dist/common/mcp.d.ts +1 -0
- package/dist/common/mcp.js +1727 -1574
- package/dist/common/poll-trigger.d.ts +3 -1
- package/dist/common/poll-trigger.js +7512 -28
- package/dist/common/provider-triggers.js +6806 -3525
- package/dist/common/ru-DrP4BRM5.js +298 -0
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +41 -27
- package/dist/common/scheduler.d.ts +7 -1
- package/dist/common/scheduler.js +981 -792
- package/dist/common/trigger-catalog.d.ts +3 -1
- package/dist/common/trigger-config.d.ts +7 -0
- package/dist/common/zh-CN-D2od3TNw.js +298 -0
- package/dist/common/zh-TW-CRmc3FMz.js +298 -0
- package/package.json +1 -1
- package/dist/browser/flowChanges-AdN0Iqma.js +0 -12304
- package/dist/browser/flowWorkspace-BrtzLKWB.js +0 -153066
- package/dist/common/fr-iv1541dF.js +0 -93
- package/dist/common/ja-Bq-ZDOD4.js +0 -93
- package/dist/common/ko-Z-k9R2c6.js +0 -93
- package/dist/common/ru-B4gFecYZ.js +0 -93
- package/dist/common/zh-CN-ByQ6nYam.js +0 -93
- package/dist/common/zh-TW-QjIarvX9.js +0 -93
|
@@ -4208,7 +4208,6 @@ j({
|
|
|
4208
4208
|
name: Bs,
|
|
4209
4209
|
provider: P(["feishu", "feishu_app_bot"]),
|
|
4210
4210
|
appId: Rs,
|
|
4211
|
-
tenantKey: Rs,
|
|
4212
4211
|
connectionId: Rs,
|
|
4213
4212
|
teamId: Rs.nullable(),
|
|
4214
4213
|
enabled: O(),
|
|
@@ -4241,6 +4240,10 @@ var I = {
|
|
|
4241
4240
|
authorizationDenied: "authorization.denied",
|
|
4242
4241
|
bindingUnresolved: "binding.unresolved",
|
|
4243
4242
|
connectorActionNotFound: "connector.action-not-found",
|
|
4243
|
+
connectorAccessConflict: "connector.access-conflict",
|
|
4244
|
+
connectorAccessInvalid: "connector.access-invalid",
|
|
4245
|
+
connectorAccessRequired: "connector.access-required",
|
|
4246
|
+
connectorAccessUnsupported: "connector.access-unsupported",
|
|
4244
4247
|
connectorUnconfigured: "connector.unconfigured",
|
|
4245
4248
|
connectorUnavailable: "connector.unavailable",
|
|
4246
4249
|
connectorConsoleUnconfigured: "connector.console-unconfigured",
|
|
@@ -4280,7 +4283,7 @@ var I = {
|
|
|
4280
4283
|
variableLimitReached: "variable.limit-reached",
|
|
4281
4284
|
variableNotFound: "variable.not-found"
|
|
4282
4285
|
};
|
|
4283
|
-
I.eventSourceInvalid, I.eventSourceIdentityUnavailable, I.eventSourceNotFound, I.eventSourceConflict, I.authenticationRequired, I.authorizationDenied, I.bindingUnresolved, I.connectorActionNotFound, I.connectorUnconfigured, I.connectorUnavailable, I.connectorConsoleUnconfigured, I.engineUnavailable, I.engineUnsupported, I.flowInvalid, I.flowRepairRequired, I.flowUpgradeRequired, I.flowNotFound, I.flowBusy, I.flowConflict, I.flowPresentationConflict, I.flowRevisionConflict, I.liveConflict, I.liveNotFound, I.pageInvalidCursor, I.publicationConflict, I.publicationNotFound, I.publicationUnsupported, I.publishOperationNotFound, I.routeNotFound, I.runConflict, I.runEventsExpired, I.runInvalid, I.runNotFound, I.runNotTerminal, I.runOverloaded, I.runWaitNotFound, I.triggerKeyInvalid, I.triggerKeyNotFound, I.triggerNotFound, I.variableInvalid, I.variableLimitReached, I.variableNotFound;
|
|
4286
|
+
I.eventSourceInvalid, I.eventSourceIdentityUnavailable, I.eventSourceNotFound, I.eventSourceConflict, I.authenticationRequired, I.authorizationDenied, I.bindingUnresolved, I.connectorActionNotFound, I.connectorAccessConflict, I.connectorAccessInvalid, I.connectorAccessRequired, I.connectorAccessUnsupported, I.connectorUnconfigured, I.connectorUnavailable, I.connectorConsoleUnconfigured, I.engineUnavailable, I.engineUnsupported, I.flowInvalid, I.flowRepairRequired, I.flowUpgradeRequired, I.flowNotFound, I.flowBusy, I.flowConflict, I.flowPresentationConflict, I.flowRevisionConflict, I.liveConflict, I.liveNotFound, I.pageInvalidCursor, I.publicationConflict, I.publicationNotFound, I.publicationUnsupported, I.publishOperationNotFound, I.routeNotFound, I.runConflict, I.runEventsExpired, I.runInvalid, I.runNotFound, I.runNotTerminal, I.runOverloaded, I.runWaitNotFound, I.triggerKeyInvalid, I.triggerKeyNotFound, I.triggerNotFound, I.variableInvalid, I.variableLimitReached, I.variableNotFound;
|
|
4284
4287
|
var Vs = class extends Error {
|
|
4285
4288
|
constructor(e, t, n) {
|
|
4286
4289
|
super(n), this.code = t, this.name = "ApiError", this.status = e;
|
|
@@ -4306,7 +4309,16 @@ function Ws(e) {
|
|
|
4306
4309
|
let t = Hs(e);
|
|
4307
4310
|
return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, Ws(t)]));
|
|
4308
4311
|
}
|
|
4309
|
-
j({
|
|
4312
|
+
M([j({
|
|
4313
|
+
handle: T().min(1),
|
|
4314
|
+
description: T().optional(),
|
|
4315
|
+
jsonSchema: Ls(),
|
|
4316
|
+
nullable: O(),
|
|
4317
|
+
value: Ls().optional()
|
|
4318
|
+
}), j({
|
|
4319
|
+
group: T(),
|
|
4320
|
+
collapsed: O().optional()
|
|
4321
|
+
})]), j({
|
|
4310
4322
|
pointer: T().max(4096).default(""),
|
|
4311
4323
|
offset: D().int().nonnegative().default(0),
|
|
4312
4324
|
limit: D().int().min(1).max(100).default(20),
|
|
@@ -4370,58 +4382,67 @@ var Ys = k(M([A({
|
|
|
4370
4382
|
"week"
|
|
4371
4383
|
]),
|
|
4372
4384
|
value: D()
|
|
4373
|
-
})])), z = T(),
|
|
4385
|
+
})])), z = T(), Xs = Ls(), Zs = k(z), Qs = A({
|
|
4374
4386
|
description: z.optional(),
|
|
4375
|
-
jsonSchema:
|
|
4387
|
+
jsonSchema: Xs,
|
|
4376
4388
|
nullable: O(),
|
|
4377
4389
|
handle: z
|
|
4378
|
-
}),
|
|
4390
|
+
}), B = Qs.extend({ value: Xs.optional() }), $s = A({
|
|
4379
4391
|
collapsed: O().optional(),
|
|
4380
4392
|
group: z
|
|
4381
|
-
}),
|
|
4393
|
+
}), ec = A({
|
|
4382
4394
|
kind: F("node"),
|
|
4383
4395
|
nodeId: z,
|
|
4384
|
-
output: z
|
|
4385
|
-
|
|
4396
|
+
output: z,
|
|
4397
|
+
field: z.optional()
|
|
4398
|
+
}), tc = A({
|
|
4386
4399
|
kind: F("flow"),
|
|
4387
4400
|
input: z
|
|
4388
|
-
}),
|
|
4389
|
-
$s,
|
|
4401
|
+
}), nc = M([
|
|
4390
4402
|
ec,
|
|
4403
|
+
tc,
|
|
4391
4404
|
A({
|
|
4392
4405
|
kind: F("binding"),
|
|
4393
4406
|
bindingId: z
|
|
4394
4407
|
})
|
|
4395
|
-
]),
|
|
4408
|
+
]), rc = M([A({ kind: F("unset") }), A({
|
|
4396
4409
|
kind: F("value"),
|
|
4397
|
-
value:
|
|
4398
|
-
}), A({
|
|
4410
|
+
value: Xs
|
|
4411
|
+
})]), ic = M([rc, A({
|
|
4399
4412
|
kind: F("sources"),
|
|
4400
|
-
sources: k(
|
|
4401
|
-
})]),
|
|
4402
|
-
inputs: k(M([
|
|
4403
|
-
outputs: k(M([
|
|
4404
|
-
},
|
|
4413
|
+
sources: k(nc)
|
|
4414
|
+
})]), ac = N(z, ic), oc = {
|
|
4415
|
+
inputs: k(M([B, $s])),
|
|
4416
|
+
outputs: k(M([Qs, $s]))
|
|
4417
|
+
}, sc = M([j({
|
|
4405
4418
|
kind: F("connector"),
|
|
4406
4419
|
action: z,
|
|
4407
4420
|
connectionId: z.optional(),
|
|
4408
|
-
connections: k(
|
|
4421
|
+
connections: k(j({
|
|
4409
4422
|
connectionId: z,
|
|
4410
4423
|
alias: z.optional()
|
|
4411
4424
|
}))
|
|
4412
|
-
}),
|
|
4413
|
-
|
|
4425
|
+
}), j({
|
|
4426
|
+
kind: F("connector"),
|
|
4427
|
+
actionHints: k(z).optional(),
|
|
4428
|
+
connectionHints: k(j({
|
|
4429
|
+
action: z,
|
|
4430
|
+
connectionId: z,
|
|
4431
|
+
alias: z.optional()
|
|
4432
|
+
})).optional()
|
|
4433
|
+
})]), cc = A({
|
|
4434
|
+
...oc,
|
|
4414
4435
|
name: z,
|
|
4415
4436
|
moduleId: z,
|
|
4416
|
-
capabilities: k(
|
|
4417
|
-
}),
|
|
4437
|
+
capabilities: k(sc).optional()
|
|
4438
|
+
}), lc = M([A({
|
|
4418
4439
|
kind: F("value"),
|
|
4419
|
-
value:
|
|
4440
|
+
value: Xs
|
|
4420
4441
|
}), A({
|
|
4421
4442
|
kind: F("input"),
|
|
4422
4443
|
input: z
|
|
4423
|
-
})]),
|
|
4424
|
-
...
|
|
4444
|
+
})]), uc = M([lc, A({ kind: F("model") })]), dc = A({
|
|
4445
|
+
...oc,
|
|
4425
4446
|
name: z,
|
|
4426
4447
|
executor: M([
|
|
4427
4448
|
A({
|
|
@@ -4437,7 +4458,7 @@ var Ys = k(M([A({
|
|
|
4437
4458
|
kind: F("agent"),
|
|
4438
4459
|
code: O().optional(),
|
|
4439
4460
|
model: z,
|
|
4440
|
-
prompt:
|
|
4461
|
+
prompt: lc,
|
|
4441
4462
|
system: z,
|
|
4442
4463
|
maxRounds: D(),
|
|
4443
4464
|
tools: k(A({
|
|
@@ -4447,22 +4468,29 @@ var Ys = k(M([A({
|
|
|
4447
4468
|
action: z,
|
|
4448
4469
|
connectionId: z.optional(),
|
|
4449
4470
|
approval: O(),
|
|
4450
|
-
inputs: k(
|
|
4471
|
+
inputs: k(B.extend({ source: uc }))
|
|
4451
4472
|
})),
|
|
4452
4473
|
notification: A({
|
|
4453
4474
|
taskId: z,
|
|
4454
4475
|
messageHandle: z,
|
|
4455
|
-
inputs: N(z,
|
|
4476
|
+
inputs: N(z, lc)
|
|
4456
4477
|
}).optional()
|
|
4457
4478
|
})
|
|
4458
4479
|
])
|
|
4459
|
-
}),
|
|
4460
|
-
|
|
4480
|
+
}), fc = M([A({
|
|
4481
|
+
kind: F("value"),
|
|
4482
|
+
value: Xs.optional(),
|
|
4483
|
+
jsonSchema: Xs.optional()
|
|
4484
|
+
}), A({
|
|
4485
|
+
kind: F("source"),
|
|
4486
|
+
source: nc
|
|
4487
|
+
})]), pc = {
|
|
4488
|
+
matchMode: P(["first", "all"]),
|
|
4461
4489
|
cases: k(A({
|
|
4490
|
+
description: z.optional(),
|
|
4462
4491
|
output: z,
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
input: z,
|
|
4492
|
+
groups: k(A({ expressions: k(A({
|
|
4493
|
+
left: fc,
|
|
4466
4494
|
operator: P([
|
|
4467
4495
|
"!=",
|
|
4468
4496
|
"<",
|
|
@@ -4485,30 +4513,32 @@ var Ys = k(M([A({
|
|
|
4485
4513
|
"notHasValue",
|
|
4486
4514
|
"startsWith"
|
|
4487
4515
|
]),
|
|
4488
|
-
|
|
4489
|
-
}))
|
|
4490
|
-
}))
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4516
|
+
right: fc.optional()
|
|
4517
|
+
})) }))
|
|
4518
|
+
}))
|
|
4519
|
+
}, mc = {
|
|
4520
|
+
inputDefinitions: k(B),
|
|
4521
|
+
prompt: z
|
|
4522
|
+
}, hc = {
|
|
4523
|
+
bodyFields: k(B),
|
|
4494
4524
|
options: A({
|
|
4495
|
-
allowedMethods:
|
|
4496
|
-
allowedOrigins:
|
|
4525
|
+
allowedMethods: Zs.optional(),
|
|
4526
|
+
allowedOrigins: Zs.optional(),
|
|
4497
4527
|
noResponseBody: O().optional(),
|
|
4498
4528
|
responseData: z.optional(),
|
|
4499
4529
|
responseHeaders: N(z, z).optional(),
|
|
4500
4530
|
responseStatusCode: D().optional()
|
|
4501
4531
|
}).optional()
|
|
4502
|
-
},
|
|
4503
|
-
|
|
4532
|
+
}, gc = {
|
|
4533
|
+
configInputs: oc.inputs,
|
|
4504
4534
|
definitionVersion: F(2),
|
|
4505
4535
|
description: z,
|
|
4506
4536
|
displayName: z,
|
|
4507
4537
|
key: z,
|
|
4508
4538
|
name: z,
|
|
4509
|
-
outputs: k(
|
|
4539
|
+
outputs: k(Qs).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
|
|
4510
4540
|
provider: z
|
|
4511
|
-
},
|
|
4541
|
+
}, _c = A({
|
|
4512
4542
|
body: A({
|
|
4513
4543
|
allowArray: O(),
|
|
4514
4544
|
allowEmpty: O(),
|
|
@@ -4528,136 +4558,135 @@ var Ys = k(M([A({
|
|
|
4528
4558
|
"PUT"
|
|
4529
4559
|
])),
|
|
4530
4560
|
successStatus: D()
|
|
4531
|
-
}),
|
|
4561
|
+
}), vc = {
|
|
4532
4562
|
name: z,
|
|
4533
4563
|
description: z.optional(),
|
|
4534
4564
|
icon: z.optional()
|
|
4535
|
-
},
|
|
4565
|
+
}, yc = {
|
|
4536
4566
|
maxExecutions: D().int().positive().max(2 ** 53 - 1).optional(),
|
|
4537
|
-
inputs:
|
|
4567
|
+
inputs: ac,
|
|
4538
4568
|
name: z.optional(),
|
|
4539
4569
|
description: z.optional(),
|
|
4540
4570
|
icon: z.optional(),
|
|
4541
4571
|
timeoutMs: D().optional()
|
|
4542
|
-
},
|
|
4572
|
+
}, bc = M([
|
|
4543
4573
|
A({
|
|
4544
|
-
...
|
|
4574
|
+
...yc,
|
|
4575
|
+
inputs: N(z, ts()),
|
|
4545
4576
|
kind: F("condition"),
|
|
4546
|
-
...
|
|
4577
|
+
...pc
|
|
4547
4578
|
}),
|
|
4548
4579
|
A({
|
|
4549
|
-
...
|
|
4580
|
+
...yc,
|
|
4550
4581
|
inputs: $o().transform(() => ({})).default({}),
|
|
4551
4582
|
kind: F("value"),
|
|
4552
|
-
values: k(
|
|
4583
|
+
values: k(B)
|
|
4553
4584
|
}),
|
|
4554
4585
|
A({
|
|
4555
|
-
...
|
|
4586
|
+
...yc,
|
|
4556
4587
|
kind: F("subflow"),
|
|
4557
4588
|
subflowId: z
|
|
4558
4589
|
}),
|
|
4559
4590
|
A({
|
|
4560
|
-
...
|
|
4591
|
+
...yc,
|
|
4561
4592
|
kind: F("task"),
|
|
4562
|
-
task:
|
|
4563
|
-
additionalInputs: k(
|
|
4593
|
+
task: cc,
|
|
4594
|
+
additionalInputs: k(B).optional()
|
|
4564
4595
|
}),
|
|
4565
4596
|
A({
|
|
4566
|
-
...
|
|
4597
|
+
...yc,
|
|
4567
4598
|
kind: F("task"),
|
|
4568
4599
|
taskId: z,
|
|
4569
|
-
additionalInputs: k(
|
|
4600
|
+
additionalInputs: k(B).optional()
|
|
4570
4601
|
}),
|
|
4571
4602
|
j({
|
|
4572
|
-
...
|
|
4603
|
+
...yc,
|
|
4573
4604
|
kind: F("approval"),
|
|
4574
|
-
|
|
4575
|
-
...dc
|
|
4605
|
+
...mc
|
|
4576
4606
|
}).omit({ timeoutMs: !0 }),
|
|
4577
4607
|
j({
|
|
4578
|
-
...
|
|
4608
|
+
...yc,
|
|
4579
4609
|
kind: F("wait"),
|
|
4580
|
-
|
|
4581
|
-
...dc
|
|
4610
|
+
...mc
|
|
4582
4611
|
}).omit({ timeoutMs: !0 }),
|
|
4583
4612
|
A({
|
|
4584
|
-
...
|
|
4613
|
+
...vc,
|
|
4585
4614
|
kind: F("manual")
|
|
4586
4615
|
}),
|
|
4587
4616
|
A({
|
|
4588
|
-
...
|
|
4617
|
+
...vc,
|
|
4589
4618
|
kind: F("webhook"),
|
|
4590
|
-
...
|
|
4619
|
+
...hc
|
|
4591
4620
|
}),
|
|
4592
4621
|
A({
|
|
4593
|
-
...
|
|
4622
|
+
...vc,
|
|
4594
4623
|
kind: F("cron"),
|
|
4595
4624
|
cronTimes: Ys
|
|
4596
4625
|
}),
|
|
4597
4626
|
A({
|
|
4598
|
-
...
|
|
4627
|
+
...vc,
|
|
4599
4628
|
kind: F("poll"),
|
|
4600
4629
|
bindingId: z,
|
|
4601
|
-
config: N(z,
|
|
4630
|
+
config: N(z, rc),
|
|
4602
4631
|
definition: A({
|
|
4603
|
-
...
|
|
4632
|
+
...gc,
|
|
4604
4633
|
type: F("poll")
|
|
4605
4634
|
}),
|
|
4606
4635
|
pollTimes: Ys
|
|
4607
4636
|
}),
|
|
4608
4637
|
A({
|
|
4609
|
-
...
|
|
4638
|
+
...vc,
|
|
4610
4639
|
kind: F("integration"),
|
|
4611
4640
|
bindingId: z,
|
|
4612
|
-
config: N(z,
|
|
4641
|
+
config: N(z, rc),
|
|
4613
4642
|
definition: A({
|
|
4614
|
-
...
|
|
4643
|
+
...gc,
|
|
4615
4644
|
type: F("integration"),
|
|
4616
|
-
endpoint:
|
|
4645
|
+
endpoint: _c
|
|
4617
4646
|
})
|
|
4618
4647
|
})
|
|
4619
|
-
]),
|
|
4648
|
+
]), xc = M([A({ kind: F("flow") }), A({
|
|
4620
4649
|
kind: F("subflow"),
|
|
4621
4650
|
id: z
|
|
4622
|
-
})]),
|
|
4651
|
+
})]), Sc = A({
|
|
4623
4652
|
source: z,
|
|
4624
4653
|
target: z,
|
|
4625
4654
|
sourceHandle: z.optional()
|
|
4626
|
-
}),
|
|
4655
|
+
}), V = {
|
|
4627
4656
|
nodeId: z,
|
|
4628
|
-
target:
|
|
4629
|
-
},
|
|
4657
|
+
target: xc
|
|
4658
|
+
}, Cc = A({
|
|
4630
4659
|
name: z,
|
|
4631
|
-
inputs: k(
|
|
4632
|
-
outputs: k(
|
|
4633
|
-
}),
|
|
4634
|
-
nodes: N(z,
|
|
4635
|
-
edges: k(
|
|
4636
|
-
}),
|
|
4660
|
+
inputs: k(B),
|
|
4661
|
+
outputs: k(Qs.extend({ sources: k(M([ec, tc])) }))
|
|
4662
|
+
}), wc = A({
|
|
4663
|
+
nodes: N(z, bc),
|
|
4664
|
+
edges: k(Sc).default([])
|
|
4665
|
+
}), Tc = A({
|
|
4637
4666
|
kind: P(["connection", "variable"]),
|
|
4638
4667
|
target: z
|
|
4639
|
-
}),
|
|
4668
|
+
}), Ec = A({
|
|
4640
4669
|
name: z,
|
|
4641
|
-
imports:
|
|
4670
|
+
imports: Zs,
|
|
4642
4671
|
source: z
|
|
4643
|
-
}),
|
|
4644
|
-
bindings: N(z,
|
|
4645
|
-
graph:
|
|
4646
|
-
subflows: N(z,
|
|
4647
|
-
tasks: N(z,
|
|
4648
|
-
}), Tc = A({
|
|
4649
|
-
modelVersion: M([F(2), F(3)]),
|
|
4650
|
-
document: wc,
|
|
4651
|
-
modules: N(z, Cc)
|
|
4672
|
+
}), Dc = A({
|
|
4673
|
+
bindings: N(z, Tc),
|
|
4674
|
+
graph: wc,
|
|
4675
|
+
subflows: N(z, Cc.extend({ graph: wc })),
|
|
4676
|
+
tasks: N(z, dc)
|
|
4652
4677
|
});
|
|
4653
|
-
|
|
4678
|
+
A({
|
|
4679
|
+
modelVersion: M([F(2), F(3)]),
|
|
4680
|
+
document: Dc,
|
|
4681
|
+
modules: N(z, Ec)
|
|
4682
|
+
}).extend({
|
|
4654
4683
|
kind: F("open-flow-flow-revision"),
|
|
4655
4684
|
version: F(1)
|
|
4656
4685
|
});
|
|
4657
|
-
var
|
|
4686
|
+
var Oc = {
|
|
4658
4687
|
"binding.create": {
|
|
4659
4688
|
bindingId: z,
|
|
4660
|
-
binding:
|
|
4689
|
+
binding: Tc
|
|
4661
4690
|
},
|
|
4662
4691
|
"binding.delete": { bindingId: z },
|
|
4663
4692
|
"binding.target.set": {
|
|
@@ -4666,21 +4695,21 @@ var Ec = {
|
|
|
4666
4695
|
value: z
|
|
4667
4696
|
},
|
|
4668
4697
|
"graph.edge.connect": {
|
|
4669
|
-
target:
|
|
4670
|
-
edge:
|
|
4698
|
+
target: xc,
|
|
4699
|
+
edge: Sc
|
|
4671
4700
|
},
|
|
4672
4701
|
"graph.edge.disconnect": {
|
|
4673
|
-
target:
|
|
4674
|
-
edge:
|
|
4702
|
+
target: xc,
|
|
4703
|
+
edge: Sc
|
|
4675
4704
|
},
|
|
4676
4705
|
"graph.node.create": {
|
|
4677
|
-
...
|
|
4678
|
-
node:
|
|
4706
|
+
...V,
|
|
4707
|
+
node: bc
|
|
4679
4708
|
},
|
|
4680
|
-
"graph.node.delete":
|
|
4709
|
+
"graph.node.delete": V,
|
|
4681
4710
|
"graph.node.field.set": M([
|
|
4682
4711
|
A({
|
|
4683
|
-
...
|
|
4712
|
+
...V,
|
|
4684
4713
|
kind: F("graph.node.field.set"),
|
|
4685
4714
|
field: P([
|
|
4686
4715
|
"description",
|
|
@@ -4691,14 +4720,14 @@ var Ec = {
|
|
|
4691
4720
|
value: z.optional()
|
|
4692
4721
|
}),
|
|
4693
4722
|
A({
|
|
4694
|
-
...
|
|
4723
|
+
...V,
|
|
4695
4724
|
kind: F("graph.node.field.set"),
|
|
4696
4725
|
field: F("maxExecutions"),
|
|
4697
4726
|
before: D().int().positive().max(2 ** 53 - 1).optional(),
|
|
4698
4727
|
value: D().int().positive().max(2 ** 53 - 1).optional()
|
|
4699
4728
|
}),
|
|
4700
4729
|
A({
|
|
4701
|
-
...
|
|
4730
|
+
...V,
|
|
4702
4731
|
kind: F("graph.node.field.set"),
|
|
4703
4732
|
field: F("timeoutMs"),
|
|
4704
4733
|
before: D().optional(),
|
|
@@ -4706,58 +4735,58 @@ var Ec = {
|
|
|
4706
4735
|
})
|
|
4707
4736
|
]),
|
|
4708
4737
|
"graph.node.input.set": {
|
|
4709
|
-
...
|
|
4738
|
+
...V,
|
|
4710
4739
|
handle: z,
|
|
4711
|
-
before:
|
|
4712
|
-
value:
|
|
4740
|
+
before: ic.optional(),
|
|
4741
|
+
value: ic.optional()
|
|
4713
4742
|
},
|
|
4714
4743
|
"graph.node.additional-inputs.set": {
|
|
4715
|
-
...
|
|
4716
|
-
before: k(
|
|
4717
|
-
value: k(
|
|
4744
|
+
...V,
|
|
4745
|
+
before: k(B).optional(),
|
|
4746
|
+
value: k(B).optional()
|
|
4718
4747
|
},
|
|
4719
4748
|
"graph.node.condition.set": {
|
|
4720
|
-
...
|
|
4721
|
-
before: A(
|
|
4722
|
-
value: A(
|
|
4749
|
+
...V,
|
|
4750
|
+
before: A(pc),
|
|
4751
|
+
value: A(pc)
|
|
4723
4752
|
},
|
|
4724
4753
|
"graph.node.values.set": {
|
|
4725
|
-
...
|
|
4726
|
-
before: k(
|
|
4727
|
-
value: k(
|
|
4754
|
+
...V,
|
|
4755
|
+
before: k(B),
|
|
4756
|
+
value: k(B)
|
|
4728
4757
|
},
|
|
4729
4758
|
"graph.node.resolution.set": {
|
|
4730
|
-
...
|
|
4759
|
+
...V,
|
|
4731
4760
|
target: A({ kind: F("flow") }),
|
|
4732
|
-
before: A(
|
|
4733
|
-
value: A(
|
|
4761
|
+
before: A(mc),
|
|
4762
|
+
value: A(mc)
|
|
4734
4763
|
},
|
|
4735
4764
|
"graph.node.webhook.set": {
|
|
4736
|
-
...
|
|
4765
|
+
...V,
|
|
4737
4766
|
target: A({ kind: F("flow") }),
|
|
4738
|
-
before: A(
|
|
4739
|
-
value: A(
|
|
4767
|
+
before: A(hc),
|
|
4768
|
+
value: A(hc)
|
|
4740
4769
|
},
|
|
4741
4770
|
"graph.node.task.ports.set": {
|
|
4742
|
-
...
|
|
4743
|
-
before: A(
|
|
4744
|
-
value: A(
|
|
4771
|
+
...V,
|
|
4772
|
+
before: A(oc),
|
|
4773
|
+
value: A(oc)
|
|
4745
4774
|
},
|
|
4746
4775
|
"graph.node.task.name.set": {
|
|
4747
|
-
...
|
|
4776
|
+
...V,
|
|
4748
4777
|
before: z,
|
|
4749
4778
|
value: z
|
|
4750
4779
|
},
|
|
4751
4780
|
"graph.node.task.capabilities.set": {
|
|
4752
|
-
...
|
|
4753
|
-
before: k(
|
|
4754
|
-
value: k(
|
|
4781
|
+
...V,
|
|
4782
|
+
before: k(sc).optional(),
|
|
4783
|
+
value: k(sc).optional()
|
|
4755
4784
|
},
|
|
4756
4785
|
"graph.trigger.config.set": {
|
|
4757
4786
|
nodeId: z,
|
|
4758
4787
|
name: z,
|
|
4759
|
-
before:
|
|
4760
|
-
value:
|
|
4788
|
+
before: rc.optional(),
|
|
4789
|
+
value: rc.optional()
|
|
4761
4790
|
},
|
|
4762
4791
|
"graph.trigger.schedule.set": {
|
|
4763
4792
|
nodeId: z,
|
|
@@ -4766,7 +4795,7 @@ var Ec = {
|
|
|
4766
4795
|
},
|
|
4767
4796
|
"module.create": {
|
|
4768
4797
|
moduleId: z,
|
|
4769
|
-
module:
|
|
4798
|
+
module: Ec
|
|
4770
4799
|
},
|
|
4771
4800
|
"module.delete": { moduleId: z },
|
|
4772
4801
|
"module.rename": {
|
|
@@ -4776,24 +4805,24 @@ var Ec = {
|
|
|
4776
4805
|
},
|
|
4777
4806
|
"module.source.replace": {
|
|
4778
4807
|
moduleId: z,
|
|
4779
|
-
beforeImports:
|
|
4808
|
+
beforeImports: Zs,
|
|
4780
4809
|
beforeSource: z,
|
|
4781
|
-
imports:
|
|
4810
|
+
imports: Zs,
|
|
4782
4811
|
source: z
|
|
4783
4812
|
},
|
|
4784
4813
|
"subflow.create": {
|
|
4785
4814
|
subflowId: z,
|
|
4786
|
-
subflow:
|
|
4815
|
+
subflow: Cc.extend({ graph: wc })
|
|
4787
4816
|
},
|
|
4788
4817
|
"subflow.definition.set": {
|
|
4789
4818
|
subflowId: z,
|
|
4790
|
-
before:
|
|
4791
|
-
definition:
|
|
4819
|
+
before: Cc,
|
|
4820
|
+
definition: Cc
|
|
4792
4821
|
},
|
|
4793
4822
|
"subflow.delete": { subflowId: z },
|
|
4794
4823
|
"task.create": {
|
|
4795
4824
|
taskId: z,
|
|
4796
|
-
task:
|
|
4825
|
+
task: dc
|
|
4797
4826
|
},
|
|
4798
4827
|
"task.delete": { taskId: z },
|
|
4799
4828
|
"task.connector.connection.set": {
|
|
@@ -4803,8 +4832,8 @@ var Ec = {
|
|
|
4803
4832
|
},
|
|
4804
4833
|
"task.agent.set": {
|
|
4805
4834
|
taskId: z,
|
|
4806
|
-
before:
|
|
4807
|
-
value:
|
|
4835
|
+
before: dc,
|
|
4836
|
+
value: dc
|
|
4808
4837
|
},
|
|
4809
4838
|
"task.llm.mode.set": {
|
|
4810
4839
|
taskId: z,
|
|
@@ -4817,16 +4846,16 @@ var Ec = {
|
|
|
4817
4846
|
value: z
|
|
4818
4847
|
}
|
|
4819
4848
|
};
|
|
4820
|
-
k(M([...new Map(Object.entries(
|
|
4849
|
+
k(M([...new Map(Object.entries(Oc).map(([e, t]) => [e, t instanceof w ? t : A({
|
|
4821
4850
|
kind: F(e),
|
|
4822
4851
|
...t
|
|
4823
4852
|
})])).values()])).min(1), new TextEncoder();
|
|
4824
|
-
var
|
|
4853
|
+
var kc = N(T(), $o()), Ac = A({
|
|
4825
4854
|
jsonSchema: $o(),
|
|
4826
4855
|
nullable: O(),
|
|
4827
4856
|
value: $o().optional(),
|
|
4828
4857
|
description: T().optional()
|
|
4829
|
-
}).strict(),
|
|
4858
|
+
}).strict(), jc = N(T(), Ac), Mc = M([A({
|
|
4830
4859
|
kind: F("value"),
|
|
4831
4860
|
value: $o()
|
|
4832
4861
|
}).strict(), A({
|
|
@@ -4836,36 +4865,36 @@ var Dc = N(T(), $o()), Oc = A({
|
|
|
4836
4865
|
nodeId: T(),
|
|
4837
4866
|
output: T()
|
|
4838
4867
|
}).strict())
|
|
4839
|
-
}).strict()]),
|
|
4868
|
+
}).strict()]), Nc = {
|
|
4840
4869
|
name: T().optional(),
|
|
4841
4870
|
description: T().optional(),
|
|
4842
4871
|
icon: T().optional()
|
|
4843
|
-
},
|
|
4872
|
+
}, Pc = M([
|
|
4844
4873
|
A({
|
|
4845
|
-
...
|
|
4874
|
+
...Nc,
|
|
4846
4875
|
kind: F("cron"),
|
|
4847
4876
|
cronTimes: k($o())
|
|
4848
4877
|
}).strict(),
|
|
4849
4878
|
A({
|
|
4850
|
-
...
|
|
4879
|
+
...Nc,
|
|
4851
4880
|
kind: F("manual")
|
|
4852
4881
|
}).strict(),
|
|
4853
4882
|
A({
|
|
4854
|
-
...
|
|
4883
|
+
...Nc,
|
|
4855
4884
|
kind: F("task"),
|
|
4856
4885
|
concurrency: F(1).optional(),
|
|
4857
|
-
inputs: N(T(),
|
|
4886
|
+
inputs: N(T(), Mc),
|
|
4858
4887
|
task: A({
|
|
4859
4888
|
name: T(),
|
|
4860
4889
|
moduleId: T(),
|
|
4861
|
-
inputs:
|
|
4862
|
-
outputs: N(T(),
|
|
4890
|
+
inputs: jc,
|
|
4891
|
+
outputs: N(T(), Ac.omit({ value: !0 }))
|
|
4863
4892
|
}).strict()
|
|
4864
4893
|
}).strict()
|
|
4865
4894
|
]);
|
|
4866
4895
|
A({
|
|
4867
4896
|
name: T(),
|
|
4868
|
-
graph: A({ nodes: N(T(),
|
|
4897
|
+
graph: A({ nodes: N(T(), Pc) }).strict()
|
|
4869
4898
|
}).strict(), A({
|
|
4870
4899
|
kind: F("open-flow-project-revision"),
|
|
4871
4900
|
version: F(1),
|
|
@@ -4876,15 +4905,15 @@ A({
|
|
|
4876
4905
|
imports: k(T())
|
|
4877
4906
|
}).strict()),
|
|
4878
4907
|
document: A({
|
|
4879
|
-
bindings:
|
|
4880
|
-
flows:
|
|
4881
|
-
subflows:
|
|
4882
|
-
tasks:
|
|
4908
|
+
bindings: kc,
|
|
4909
|
+
flows: kc,
|
|
4910
|
+
subflows: kc,
|
|
4911
|
+
tasks: kc
|
|
4883
4912
|
}).strict()
|
|
4884
4913
|
}).strict();
|
|
4885
4914
|
//#endregion
|
|
4886
4915
|
//#region src/control/common/api.ts
|
|
4887
|
-
function
|
|
4916
|
+
function Fc(e) {
|
|
4888
4917
|
let t = Hs(e), n = Us(t.sequence);
|
|
4889
4918
|
if (n < 0) return L();
|
|
4890
4919
|
let r = {
|
|
@@ -4912,7 +4941,7 @@ function Nc(e) {
|
|
|
4912
4941
|
payload: {
|
|
4913
4942
|
flowId: R(i.flowId),
|
|
4914
4943
|
scopeId: R(i.scopeId),
|
|
4915
|
-
progress:
|
|
4944
|
+
progress: Ic(i.progress)
|
|
4916
4945
|
}
|
|
4917
4946
|
};
|
|
4918
4947
|
case "run.waiting": return Array.isArray(i.waitIds) ? {
|
|
@@ -4932,11 +4961,12 @@ function Nc(e) {
|
|
|
4932
4961
|
};
|
|
4933
4962
|
case "run.resolved": {
|
|
4934
4963
|
let e = i.action;
|
|
4935
|
-
return e !== "approve" && e !== "continue" && e !== "reject" ? L() : {
|
|
4964
|
+
return e !== "approve" && e !== "continue" && e !== "reject" || i.comment !== null && typeof i.comment != "string" ? L() : {
|
|
4936
4965
|
...r,
|
|
4937
4966
|
kind: a,
|
|
4938
4967
|
payload: {
|
|
4939
4968
|
action: e,
|
|
4969
|
+
comment: i.comment,
|
|
4940
4970
|
resolvedAt: R(i.resolvedAt),
|
|
4941
4971
|
waitId: R(i.waitId)
|
|
4942
4972
|
}
|
|
@@ -5020,7 +5050,7 @@ function Nc(e) {
|
|
|
5020
5050
|
kind: a,
|
|
5021
5051
|
payload: {
|
|
5022
5052
|
...e,
|
|
5023
|
-
progress:
|
|
5053
|
+
progress: Ic(i.progress)
|
|
5024
5054
|
}
|
|
5025
5055
|
};
|
|
5026
5056
|
case "node.artifact": {
|
|
@@ -5046,45 +5076,45 @@ function Nc(e) {
|
|
|
5046
5076
|
default: return L();
|
|
5047
5077
|
}
|
|
5048
5078
|
}
|
|
5049
|
-
function
|
|
5079
|
+
function Ic(e) {
|
|
5050
5080
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : L();
|
|
5051
5081
|
}
|
|
5052
5082
|
//#endregion
|
|
5053
5083
|
//#region src/control/common/conformance.ts
|
|
5054
|
-
var
|
|
5055
|
-
function
|
|
5084
|
+
var H = "open-flow-engine/v5";
|
|
5085
|
+
function U(e) {
|
|
5056
5086
|
throw Error(e);
|
|
5057
5087
|
}
|
|
5058
|
-
function
|
|
5059
|
-
t(e, n) ||
|
|
5088
|
+
function W(e, n, r) {
|
|
5089
|
+
t(e, n) || U(`${r}: expected ${JSON.stringify(n)}, received ${JSON.stringify(e)}.`);
|
|
5090
|
+
}
|
|
5091
|
+
function G(e, t) {
|
|
5092
|
+
return (typeof e != "object" || !e || Array.isArray(e)) && U(`${t}: expected an object.`), e;
|
|
5060
5093
|
}
|
|
5061
5094
|
function K(e, t) {
|
|
5062
|
-
return
|
|
5095
|
+
return Array.isArray(e) || U(`${t}: expected an array.`), e;
|
|
5063
5096
|
}
|
|
5064
5097
|
function q(e, t) {
|
|
5065
|
-
return
|
|
5098
|
+
return (typeof e != "string" || e.length == 0) && U(`${t}: expected a non-empty string.`), e;
|
|
5066
5099
|
}
|
|
5067
|
-
function J(e, t) {
|
|
5068
|
-
return (
|
|
5100
|
+
async function J(e, t, n) {
|
|
5101
|
+
return W(e.status, t, `${n} status`), G(await e.json().catch(() => U(`${n} body: expected JSON.`)), `${n} body`);
|
|
5069
5102
|
}
|
|
5070
|
-
async function Y(e, t, n) {
|
|
5071
|
-
|
|
5103
|
+
async function Y(e, t, n, r, i) {
|
|
5104
|
+
let a = await J(e, t, r), o = G(a.error, `${r} error`);
|
|
5105
|
+
W(o.code, n, `${r} error code`);
|
|
5106
|
+
let s = q(o.message, `${r} error message`);
|
|
5107
|
+
i != null && !s.includes(i) && U(`${r} error message: expected ${JSON.stringify(i)} in ${JSON.stringify(s)}.`), W(a.version, 1, `${r} version`);
|
|
5072
5108
|
}
|
|
5073
|
-
|
|
5074
|
-
let a = await Y(e, t, r), o = K(a.error, `${r} error`);
|
|
5075
|
-
G(o.code, n, `${r} error code`);
|
|
5076
|
-
let s = J(o.message, `${r} error message`);
|
|
5077
|
-
i != null && !s.includes(i) && W(`${r} error message: expected ${JSON.stringify(i)} in ${JSON.stringify(s)}.`), G(a.version, 1, `${r} version`);
|
|
5078
|
-
}
|
|
5079
|
-
function Z(e, t, n = {}) {
|
|
5109
|
+
function X(e, t, n = {}) {
|
|
5080
5110
|
let r = new Headers(n.headers);
|
|
5081
5111
|
return n.body != null && !r.has("content-type") && r.set("content-type", "application/json"), e.request(new Request(new URL(t, e.origin), {
|
|
5082
5112
|
...n,
|
|
5083
5113
|
headers: r
|
|
5084
5114
|
}));
|
|
5085
5115
|
}
|
|
5086
|
-
function
|
|
5087
|
-
return
|
|
5116
|
+
function Lc(e, t, n) {
|
|
5117
|
+
return X(e, "/v1/flows", {
|
|
5088
5118
|
body: JSON.stringify({
|
|
5089
5119
|
name: t,
|
|
5090
5120
|
version: 1
|
|
@@ -5093,11 +5123,11 @@ function Fc(e, t, n) {
|
|
|
5093
5123
|
method: "POST"
|
|
5094
5124
|
});
|
|
5095
5125
|
}
|
|
5096
|
-
async function
|
|
5097
|
-
return
|
|
5126
|
+
async function Z(e, t, n) {
|
|
5127
|
+
return J(await Lc(e, t, n), 201, "Create Flow");
|
|
5098
5128
|
}
|
|
5099
|
-
function
|
|
5100
|
-
return
|
|
5129
|
+
function Rc(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
|
|
5130
|
+
return X(e, `/v1/flows/${encodeURIComponent(t)}/draft/changes`, {
|
|
5101
5131
|
body: JSON.stringify({
|
|
5102
5132
|
expectedRevisionId: n,
|
|
5103
5133
|
operations: r,
|
|
@@ -5107,8 +5137,8 @@ function Ic(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
|
|
|
5107
5137
|
method: "POST"
|
|
5108
5138
|
});
|
|
5109
5139
|
}
|
|
5110
|
-
function
|
|
5111
|
-
return
|
|
5140
|
+
function Q(e, t, n, r = "marker", i) {
|
|
5141
|
+
return Rc(e, t, n, [{
|
|
5112
5142
|
kind: "graph.node.create",
|
|
5113
5143
|
node: {
|
|
5114
5144
|
inputs: {},
|
|
@@ -5125,8 +5155,8 @@ function $(e, t, n, r = "marker", i) {
|
|
|
5125
5155
|
target: { kind: "flow" }
|
|
5126
5156
|
}], i);
|
|
5127
5157
|
}
|
|
5128
|
-
async function
|
|
5129
|
-
return
|
|
5158
|
+
async function zc(e, t, n) {
|
|
5159
|
+
return Bc(await J(await Rc(e, t, n, [{
|
|
5130
5160
|
kind: "graph.node.create",
|
|
5131
5161
|
node: {
|
|
5132
5162
|
kind: "manual",
|
|
@@ -5136,13 +5166,13 @@ async function Lc(e, t, n) {
|
|
|
5136
5166
|
target: { kind: "flow" }
|
|
5137
5167
|
}]), 200, "Add manual trigger"), "Manual trigger Revision");
|
|
5138
5168
|
}
|
|
5139
|
-
function
|
|
5140
|
-
return
|
|
5169
|
+
function Bc(e, t) {
|
|
5170
|
+
return q(G(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
|
|
5141
5171
|
}
|
|
5142
|
-
function
|
|
5143
|
-
return
|
|
5172
|
+
function $(e, t, n, r, i) {
|
|
5173
|
+
return X(e, `/v1/flows/${encodeURIComponent(t)}/revisions/${encodeURIComponent(n)}/publications`, {
|
|
5144
5174
|
body: JSON.stringify({
|
|
5145
|
-
engineContract:
|
|
5175
|
+
engineContract: H,
|
|
5146
5176
|
expectedLivePublicationId: r,
|
|
5147
5177
|
version: 1
|
|
5148
5178
|
}),
|
|
@@ -5150,18 +5180,18 @@ function zc(e, t, n, r, i) {
|
|
|
5150
5180
|
method: "POST"
|
|
5151
5181
|
});
|
|
5152
5182
|
}
|
|
5153
|
-
async function
|
|
5154
|
-
let i = await
|
|
5155
|
-
for (let t = 0; i.status == "pending" && t < 100; t += 1) await new Promise((e) => setTimeout(e, 10)), i = await
|
|
5156
|
-
|
|
5157
|
-
let o =
|
|
5158
|
-
return
|
|
5183
|
+
async function Vc(e, t, n, r) {
|
|
5184
|
+
let i = await J(t, n, r), a = q(i.operationId, `${r} operationId`);
|
|
5185
|
+
for (let t = 0; i.status == "pending" && t < 100; t += 1) await new Promise((e) => setTimeout(e, 10)), i = await J(await X(e, `/v1/flows/${q(i.flowId, `${r} flowId`)}/publish-operations/${a}`), 200, `${r} operation`);
|
|
5186
|
+
W(i.status, "succeeded", `${r} terminal status`);
|
|
5187
|
+
let o = q(i.publicationId, `${r} publicationId`), s = G((await J(await X(e, `/v1/flows/${q(i.flowId, `${r} flowId`)}/live`), 200, `${r} Live`)).publication, `${r} Publication`);
|
|
5188
|
+
return W(s.publicationId, o, `${r} Live Publication`), {
|
|
5159
5189
|
operation: i,
|
|
5160
5190
|
publication: s
|
|
5161
5191
|
};
|
|
5162
5192
|
}
|
|
5163
|
-
function
|
|
5164
|
-
return
|
|
5193
|
+
function Hc(e, t, n, r, i) {
|
|
5194
|
+
return X(e, `/v1/flows/${encodeURIComponent(t)}/publications/${encodeURIComponent(n)}/rollback`, {
|
|
5165
5195
|
body: JSON.stringify({
|
|
5166
5196
|
expectedLivePublicationId: r,
|
|
5167
5197
|
version: 1
|
|
@@ -5170,8 +5200,8 @@ function Vc(e, t, n, r, i) {
|
|
|
5170
5200
|
method: "POST"
|
|
5171
5201
|
});
|
|
5172
5202
|
}
|
|
5173
|
-
function
|
|
5174
|
-
return
|
|
5203
|
+
function Uc(e, t, n) {
|
|
5204
|
+
return X(e, "/v1/runs", {
|
|
5175
5205
|
body: JSON.stringify({
|
|
5176
5206
|
inputs: {},
|
|
5177
5207
|
trigger: {
|
|
@@ -5185,15 +5215,15 @@ function Hc(e, t, n) {
|
|
|
5185
5215
|
method: "POST"
|
|
5186
5216
|
});
|
|
5187
5217
|
}
|
|
5188
|
-
var
|
|
5218
|
+
var Wc = [
|
|
5189
5219
|
{
|
|
5190
5220
|
name: "admits simultaneous retries as one Run and preserves its Trigger identity",
|
|
5191
5221
|
async verify(e) {
|
|
5192
|
-
let t = await
|
|
5222
|
+
let t = await Z(e, "Concurrent Run", "concurrent-run-flow"), n = q(t.flowId, "Flow ID"), r = await zc(e, n, q(t.draftRevisionId, "Revision ID")), i = (t = {}) => X(e, `/v1/flows/${n}/revisions/${r}/runs`, {
|
|
5193
5223
|
method: "POST",
|
|
5194
5224
|
headers: { "idempotency-key": "concurrent-run" },
|
|
5195
5225
|
body: JSON.stringify({
|
|
5196
|
-
engineContract:
|
|
5226
|
+
engineContract: H,
|
|
5197
5227
|
inputs: {},
|
|
5198
5228
|
trigger: {
|
|
5199
5229
|
nodeId: "start",
|
|
@@ -5207,69 +5237,69 @@ var Uc = [
|
|
|
5207
5237
|
i(),
|
|
5208
5238
|
i()
|
|
5209
5239
|
]);
|
|
5210
|
-
|
|
5240
|
+
W(a.map((e) => e.status).toSorted(), [
|
|
5211
5241
|
200,
|
|
5212
5242
|
200,
|
|
5213
5243
|
200,
|
|
5214
5244
|
202
|
|
5215
5245
|
], "One Run is admitted");
|
|
5216
|
-
let o = await Promise.all(a.map((e) => e.json())), s =
|
|
5217
|
-
for (let e of o) G(
|
|
5218
|
-
await
|
|
5246
|
+
let o = await Promise.all(a.map((e) => e.json())), s = q(G(o[0], "Run").runId, "Run ID");
|
|
5247
|
+
for (let e of o) W(G(e, "Run").runId, s, "Concurrent Run identity");
|
|
5248
|
+
await Y(await i({ changed: !0 }), 409, "run.conflict", "Reject changed Trigger replay"), W(K((await J(await X(e, `/v1/flows/${n}/runs`), 200, "List admitted Runs")).runs, "Runs").length, 1, "No duplicate Run");
|
|
5219
5249
|
}
|
|
5220
5250
|
},
|
|
5221
5251
|
{
|
|
5222
5252
|
name: "deduplicates simultaneous creation and lost-response retries",
|
|
5223
5253
|
async verify(e) {
|
|
5224
|
-
let t = await Promise.all(Array.from({ length: 4 }, () =>
|
|
5225
|
-
|
|
5254
|
+
let t = await Promise.all(Array.from({ length: 4 }, () => Lc(e, "Concurrent Flow", "concurrent-create")));
|
|
5255
|
+
W(t.map((e) => e.status).toSorted(), [
|
|
5226
5256
|
200,
|
|
5227
5257
|
200,
|
|
5228
5258
|
200,
|
|
5229
5259
|
201
|
|
5230
5260
|
], "One creation commits");
|
|
5231
5261
|
let n = await Promise.all(t.map((e) => e.json()));
|
|
5232
|
-
for (let e of n)
|
|
5233
|
-
|
|
5262
|
+
for (let e of n) W(e, n[0], "Concurrent replay identity");
|
|
5263
|
+
W(await J(await Lc(e, "Concurrent Flow", "concurrent-create"), 200, "Retry lost creation response"), n[0], "Lost-response replay"), await Y(await Lc(e, "Different Flow", "concurrent-create"), 409, "flow.conflict", "Reject changed retry");
|
|
5234
5264
|
}
|
|
5235
5265
|
},
|
|
5236
5266
|
{
|
|
5237
5267
|
name: "commits one concurrent Draft change and replays the winning key",
|
|
5238
5268
|
async verify(e) {
|
|
5239
|
-
let t = await
|
|
5240
|
-
|
|
5241
|
-
let a = i.findIndex((e) => e.status == 200), o = await
|
|
5242
|
-
await
|
|
5269
|
+
let t = await Z(e, "Concurrent Draft", "concurrent-draft"), n = q(t.flowId, "Flow ID"), r = q(t.draftRevisionId, "Revision ID"), i = await Promise.all([Q(e, n, r, "left", "concurrent-left"), Q(e, n, r, "right", "concurrent-right")]);
|
|
5270
|
+
W(i.map((e) => e.status).toSorted(), [200, 412], "One Draft CAS commits");
|
|
5271
|
+
let a = i.findIndex((e) => e.status == 200), o = await J(i[a] ?? U("Missing winning response"), 200, "Winning Draft change");
|
|
5272
|
+
await Y(i[1 - a] ?? U("Missing losing response"), 412, "flow.revision-conflict", "Losing Draft change");
|
|
5243
5273
|
let s = a == 0 ? "left" : "right";
|
|
5244
|
-
|
|
5245
|
-
let c =
|
|
5246
|
-
|
|
5274
|
+
W(await J(await Q(e, n, r, s, `concurrent-${s}`), 200, "Replay winning change"), o, "Replay precedes stale Revision check");
|
|
5275
|
+
let c = G(G(G((await J(await X(e, `/v1/flows/${n}/draft`), 200, "Read authoritative Draft")).content, "Content").document, "Document").graph, "Graph").nodes;
|
|
5276
|
+
W(Object.keys(G(c, "Nodes")), [s], "No partial losing edit");
|
|
5247
5277
|
}
|
|
5248
5278
|
},
|
|
5249
5279
|
{
|
|
5250
5280
|
name: "manages deployment Variables with stable limits and exact-case identity",
|
|
5251
5281
|
async verify(e) {
|
|
5252
|
-
|
|
5282
|
+
W(await J(await X(e, "/v1/variables"), 200, "List empty Variables"), {
|
|
5253
5283
|
variables: [],
|
|
5254
5284
|
version: 1
|
|
5255
5285
|
}, "Empty Variables");
|
|
5256
|
-
let t = (t, n, r = { value: n }) =>
|
|
5286
|
+
let t = (t, n, r = { value: n }) => X(e, `/v1/variables/${encodeURIComponent(t)}`, {
|
|
5257
5287
|
body: JSON.stringify(r),
|
|
5258
5288
|
method: "PUT"
|
|
5259
|
-
}), n = await
|
|
5260
|
-
|
|
5289
|
+
}), n = await J(await t("Token", ""), 200, "Create Variable");
|
|
5290
|
+
W(Object.keys(n).toSorted(), [
|
|
5261
5291
|
"name",
|
|
5262
5292
|
"updatedAt",
|
|
5263
5293
|
"value",
|
|
5264
5294
|
"version"
|
|
5265
|
-
], "Variable fields"),
|
|
5295
|
+
], "Variable fields"), W(n.name, "Token", "Variable name"), W(n.value, "", "Empty Variable value"), W(n.version, 1, "Variable version"), q(n.updatedAt, "Variable updatedAt"), W(await J(await X(e, "/v1/variables/Token"), 200, "Read Variable"), n, "Read Variable"), W(await J(await t("Token", ""), 200, "Put same Variable"), n, "Same Variable update");
|
|
5266
5296
|
for (let e of [
|
|
5267
5297
|
"A",
|
|
5268
5298
|
"Z",
|
|
5269
5299
|
"a",
|
|
5270
5300
|
"token"
|
|
5271
|
-
]) await
|
|
5272
|
-
|
|
5301
|
+
]) await J(await t(e, e), 200, `Create ${e} Variable`);
|
|
5302
|
+
W(K((await J(await X(e, "/v1/variables"), 200, "List Variables")).variables, "Variables").map((e) => G(e, "Variable").name), [
|
|
5273
5303
|
"A",
|
|
5274
5304
|
"Token",
|
|
5275
5305
|
"Z",
|
|
@@ -5277,38 +5307,38 @@ var Uc = [
|
|
|
5277
5307
|
"token"
|
|
5278
5308
|
], "Variable binary order");
|
|
5279
5309
|
let r = `${"值".repeat(21845)}x`;
|
|
5280
|
-
|
|
5310
|
+
W(new TextEncoder().encode(r).byteLength, 65536, "Variable UTF-8 boundary fixture"), await J(await t("BIG", r), 200, "Create maximum Variable value"), await Y(await t("BIG", `${r}x`), 400, "variable.invalid", "Reject oversized Variable value"), await Y(await t("OO_TOKEN", "value"), 400, "variable.invalid", "Reject reserved Variable name"), await Y(await t("bad-name", "value"), 400, "variable.invalid", "Reject invalid Variable name"), await Y(await t("EXTRA", "value", {
|
|
5281
5311
|
extra: !0,
|
|
5282
5312
|
value: "value"
|
|
5283
|
-
}), 400, "variable.invalid", "Reject extra Variable field"), await
|
|
5284
|
-
for (let e = 0; e < 195; e += 1) await
|
|
5285
|
-
await
|
|
5313
|
+
}), 400, "variable.invalid", "Reject extra Variable field"), await Y(await X(e, "/v1/variables/MISSING"), 404, "variable.not-found", "Read missing Variable"), await Y(await X(e, "/v1/variables/MISSING", { method: "DELETE" }), 404, "variable.not-found", "Delete missing Variable"), W(await J(await X(e, "/v1/variables/Token", { method: "DELETE" }), 200, "Delete Variable"), { version: 1 }, "Delete response");
|
|
5314
|
+
for (let e = 0; e < 195; e += 1) await J(await t(`V${String(e).padStart(3, "0")}`, "value"), 200, `Fill Variable ${e}`);
|
|
5315
|
+
await Y(await t("V195", "value"), 409, "variable.limit-reached", "Reject Variable over limit"), W((await J(await t("A", "updated"), 200, "Update full Variable catalog")).value, "updated", "Full catalog update");
|
|
5286
5316
|
}
|
|
5287
5317
|
},
|
|
5288
5318
|
{
|
|
5289
5319
|
name: "creates, replays, lists, reads, renames, and retires a Flow",
|
|
5290
5320
|
async verify(e) {
|
|
5291
|
-
let t = await
|
|
5292
|
-
|
|
5293
|
-
let i = await
|
|
5294
|
-
|
|
5295
|
-
let a = await
|
|
5296
|
-
|
|
5297
|
-
let s =
|
|
5298
|
-
|
|
5321
|
+
let t = await Z(e, "Control flow", "flow-lifecycle"), n = q(t.flowId, "Created Flow flowId"), r = q(t.draftRevisionId, "Created Flow draftRevisionId");
|
|
5322
|
+
W(t.name, "Control flow", "Created Flow name"), W(t.status, "active", "Created Flow status"), W(await J(await Lc(e, "Control flow", "flow-lifecycle"), 200, "Replay Flow"), t, "Replayed Flow"), await Y(await Lc(e, "Different flow", "flow-lifecycle"), 409, "flow.conflict", "Conflicting Flow"), W(await J(await X(e, `/v1/flows/${n}`), 200, "Read Flow"), t, "Read Flow");
|
|
5323
|
+
let i = await J(await X(e, "/v1/flows?includeTotal=true"), 200, "List Flows");
|
|
5324
|
+
W(i.flows, [t], "Listed Flows"), W(i.total, 1, "Flow total");
|
|
5325
|
+
let a = await Z(e, "Second control flow", "flow-lifecycle-second"), o = await J(await X(e, "/v1/flows?limit=1"), 200, "List first Flow page");
|
|
5326
|
+
W(o.flows, [t], "First Flow page");
|
|
5327
|
+
let s = q(o.nextCursor, "Flow cursor");
|
|
5328
|
+
W((await J(await X(e, `/v1/flows?limit=1&cursor=${encodeURIComponent(s)}`), 200, "List second Flow page")).flows, [a], "Second Flow page"), W((await J(await X(e, `/v1/flows/${n}`, {
|
|
5299
5329
|
body: JSON.stringify({
|
|
5300
5330
|
name: "Renamed flow",
|
|
5301
5331
|
version: 1
|
|
5302
5332
|
}),
|
|
5303
5333
|
method: "PATCH"
|
|
5304
|
-
}), 200, "Rename Flow")).name, "Renamed flow", "Renamed Flow name"),
|
|
5334
|
+
}), 200, "Rename Flow")).name, "Renamed flow", "Renamed Flow name"), W((await J(await X(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow")).status, "retiring", "Retired Flow status"), await Y(await Q(e, n, r), 409, "flow.busy", "Mutation after retirement");
|
|
5305
5335
|
}
|
|
5306
5336
|
},
|
|
5307
5337
|
{
|
|
5308
5338
|
name: "commits immutable Draft Revisions for one Flow",
|
|
5309
5339
|
async verify(e) {
|
|
5310
|
-
let t = await
|
|
5311
|
-
G(
|
|
5340
|
+
let t = await Z(e, "Draft flow", "draft-flow"), n = q(t.flowId, "Draft Flow flowId"), r = q(t.draftRevisionId, "Draft Flow revisionId"), i = await J(await Q(e, n, r, "marker", "draft-change"), 200, "Change Draft"), a = Bc(i, "Changed Draft");
|
|
5341
|
+
W(G(i.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), W(await J(await Q(e, n, r, "marker", "draft-change"), 200, "Replay Draft change"), i, "Replayed Draft change"), await Y(await Q(e, n, r, "another-marker", "draft-change"), 409, "flow.conflict", "Conflicting Draft change replay"), await Y(await Q(e, n, a, "marker"), 400, "flow.invalid", "Duplicate Draft Node", "A Node with this ID already exists"), await Y(await Rc(e, n, a, [{
|
|
5312
5342
|
before: [{
|
|
5313
5343
|
handle: "ready",
|
|
5314
5344
|
jsonSchema: { type: "boolean" },
|
|
@@ -5324,15 +5354,15 @@ var Uc = [
|
|
|
5324
5354
|
nullable: !1,
|
|
5325
5355
|
value: !0
|
|
5326
5356
|
}]
|
|
5327
|
-
}]), 400, "flow.invalid", "No-op Draft change"), await
|
|
5328
|
-
let o = await
|
|
5329
|
-
|
|
5357
|
+
}]), 400, "flow.invalid", "No-op Draft change"), await Y(await Q(e, n, r, "stale"), 412, "flow.revision-conflict", "Stale Draft change"), W(G(G(G(G((await J(await X(e, `/v1/flows/${n}/revisions/${r}`), 200, "Read old Revision")).content, "Old content").document, "Old document").graph, "Old graph").nodes, "Old nodes"), {}, "Old Revision nodes"), W((await J(await X(e, `/v1/flows/${n}/draft`), 200, "Read Draft")).revisionId, a, "Draft revisionId");
|
|
5358
|
+
let o = await J(await X(e, `/v1/flows/${n}/draft/sync`), 200, "Sync Draft");
|
|
5359
|
+
W(o.kind, "snapshot", "Draft sync kind"), W(G(o.draft, "Draft snapshot").revisionId, a, "Draft snapshot revisionId");
|
|
5330
5360
|
}
|
|
5331
5361
|
},
|
|
5332
5362
|
{
|
|
5333
5363
|
name: "loads the current editor without changing Draft or Presentation",
|
|
5334
5364
|
async verify(e) {
|
|
5335
|
-
let t = await
|
|
5365
|
+
let t = await Z(e, "Editor flow", "editor-flow"), n = q(t.flowId, "Editor Flow identity"), r = await J(await Q(e, n, q(t.draftRevisionId, "Editor Draft identity"), "marker"), 200, "Change editor Draft"), i = await J(await X(e, `/v1/flows/${n}/presentation`, {
|
|
5336
5366
|
method: "PUT",
|
|
5337
5367
|
body: JSON.stringify({
|
|
5338
5368
|
expectedRevision: 1,
|
|
@@ -5342,8 +5372,8 @@ var Uc = [
|
|
|
5342
5372
|
} } },
|
|
5343
5373
|
version: 1
|
|
5344
5374
|
})
|
|
5345
|
-
}), 200, "Update editor Presentation"), a = await
|
|
5346
|
-
|
|
5375
|
+
}), 200, "Update editor Presentation"), a = await J(await X(e, `/v1/flows/${n}/editor`), 200, "Read editor");
|
|
5376
|
+
W(a.version, 1, "Editor version"), W(G(a.flow, "Editor Flow").draftRevisionId, Bc(r, "Editor change"), "Editor Draft head");
|
|
5347
5377
|
for (let t of [
|
|
5348
5378
|
"flow",
|
|
5349
5379
|
"draft",
|
|
@@ -5351,21 +5381,21 @@ var Uc = [
|
|
|
5351
5381
|
"presentation"
|
|
5352
5382
|
]) {
|
|
5353
5383
|
let r = t == "flow" ? `/v1/flows/${n}` : `/v1/flows/${n}/${t}`;
|
|
5354
|
-
|
|
5384
|
+
W(a[t], await J(await X(e, r), 200, `Read editor ${t}`), `Editor ${t}`);
|
|
5355
5385
|
}
|
|
5356
|
-
|
|
5386
|
+
W(a.presentation, i, "Reading editor preserves Presentation"), await Y(await X(e, "/v1/flows/missing-editor/editor"), 404, "flow.not-found", "Read missing editor");
|
|
5357
5387
|
}
|
|
5358
5388
|
},
|
|
5359
5389
|
{
|
|
5360
5390
|
name: "keeps Presentation CAS independent from the Draft head",
|
|
5361
5391
|
async verify(e) {
|
|
5362
|
-
let t = await
|
|
5392
|
+
let t = await Z(e, "Presentation flow", "presentation-flow"), n = q(t.flowId, "Presentation Flow flowId"), r = q(t.draftRevisionId, "Presentation Flow revisionId"), i = `/v1/flows/${n}/presentation`, a = {
|
|
5363
5393
|
edges: [],
|
|
5364
5394
|
nodes: { task: {
|
|
5365
5395
|
x: 120,
|
|
5366
5396
|
y: 80
|
|
5367
5397
|
} }
|
|
5368
|
-
}, o = await
|
|
5398
|
+
}, o = await J(await X(e, i, {
|
|
5369
5399
|
body: JSON.stringify({
|
|
5370
5400
|
expectedRevision: 1,
|
|
5371
5401
|
value: a,
|
|
@@ -5373,27 +5403,27 @@ var Uc = [
|
|
|
5373
5403
|
}),
|
|
5374
5404
|
method: "PUT"
|
|
5375
5405
|
}), 200, "Update Presentation");
|
|
5376
|
-
|
|
5406
|
+
W(o.revision, 2, "Presentation revision"), W(o.value, a, "Presentation value"), await Y(await X(e, i, {
|
|
5377
5407
|
body: JSON.stringify({
|
|
5378
5408
|
expectedRevision: 1,
|
|
5379
5409
|
value: {},
|
|
5380
5410
|
version: 1
|
|
5381
5411
|
}),
|
|
5382
5412
|
method: "PUT"
|
|
5383
|
-
}), 412, "flow.presentation-conflict", "Stale Presentation update"),
|
|
5413
|
+
}), 412, "flow.presentation-conflict", "Stale Presentation update"), W((await J(await X(e, i), 200, "Read Presentation")).value, a, "Presentation value after conflict"), await J(await X(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Presentation Flow"), await Y(await X(e, i, {
|
|
5384
5414
|
body: JSON.stringify({
|
|
5385
5415
|
expectedRevision: 2,
|
|
5386
5416
|
value: {},
|
|
5387
5417
|
version: 1
|
|
5388
5418
|
}),
|
|
5389
5419
|
method: "PUT"
|
|
5390
|
-
}), 409, "flow.busy", "Update retired Presentation"),
|
|
5420
|
+
}), 409, "flow.busy", "Update retired Presentation"), W((await J(await X(e, `/v1/flows/${n}`), 200, "Read Flow")).draftRevisionId, r, "Draft head");
|
|
5391
5421
|
}
|
|
5392
5422
|
},
|
|
5393
5423
|
{
|
|
5394
5424
|
name: "admits a Draft entry while unrelated branches remain invalid",
|
|
5395
5425
|
async verify(e) {
|
|
5396
|
-
let t = await
|
|
5426
|
+
let t = await Z(e, "Partial Draft", "partial-draft"), n = q(t.flowId, "Partial Flow identity"), r = Bc(await J(await Rc(e, n, await zc(e, n, q(t.draftRevisionId, "Partial Draft identity")), [
|
|
5397
5427
|
{
|
|
5398
5428
|
kind: "graph.node.create",
|
|
5399
5429
|
nodeId: "other",
|
|
@@ -5429,18 +5459,18 @@ var Uc = [
|
|
|
5429
5459
|
}
|
|
5430
5460
|
}
|
|
5431
5461
|
]), 200, "Add unfinished branch"), "Partial Draft"), i = `/v1/flows/${n}/revisions/${r}`;
|
|
5432
|
-
|
|
5462
|
+
W((await J(await X(e, `${i}/check`, {
|
|
5433
5463
|
method: "POST",
|
|
5434
5464
|
body: JSON.stringify({
|
|
5435
|
-
engineContract:
|
|
5465
|
+
engineContract: H,
|
|
5436
5466
|
version: 1
|
|
5437
5467
|
})
|
|
5438
5468
|
}), 200, "Check entire Draft")).valid, !1, "Entire Draft remains invalid");
|
|
5439
|
-
let a = (t) =>
|
|
5469
|
+
let a = (t) => X(e, `${i}/runs`, {
|
|
5440
5470
|
method: "POST",
|
|
5441
5471
|
headers: { "idempotency-key": `partial-${t}` },
|
|
5442
5472
|
body: JSON.stringify({
|
|
5443
|
-
engineContract:
|
|
5473
|
+
engineContract: H,
|
|
5444
5474
|
inputs: {},
|
|
5445
5475
|
trigger: {
|
|
5446
5476
|
nodeId: t,
|
|
@@ -5454,16 +5484,16 @@ var Uc = [
|
|
|
5454
5484
|
version: 2
|
|
5455
5485
|
})
|
|
5456
5486
|
});
|
|
5457
|
-
await
|
|
5487
|
+
await J(await a("start"), 202, "Run valid entry"), await Y(await a("other"), 400, "flow.invalid", "Reject invalid entry branch"), await Y(await $(e, n, r, null, "partial-publish"), 400, "flow.invalid", "Reject incomplete publication");
|
|
5458
5488
|
}
|
|
5459
5489
|
},
|
|
5460
5490
|
{
|
|
5461
5491
|
name: "validates, admits, lists, and cancels one Draft Run",
|
|
5462
5492
|
async verify(e) {
|
|
5463
|
-
let t = await
|
|
5464
|
-
|
|
5493
|
+
let t = await Z(e, "Run flow", "run-flow"), n = q(t.flowId, "Run Flow flowId"), r = await zc(e, n, q(t.draftRevisionId, "Run Flow revisionId"));
|
|
5494
|
+
W((await J(await X(e, `/v1/flows/${n}/revisions/${r}/check`, {
|
|
5465
5495
|
body: JSON.stringify({
|
|
5466
|
-
engineContract:
|
|
5496
|
+
engineContract: H,
|
|
5467
5497
|
version: 1
|
|
5468
5498
|
}),
|
|
5469
5499
|
method: "POST"
|
|
@@ -5479,9 +5509,9 @@ var Uc = [
|
|
|
5479
5509
|
nodeId: "start",
|
|
5480
5510
|
outputs: { payload: { unexpected: !0 } }
|
|
5481
5511
|
}
|
|
5482
|
-
]) await
|
|
5512
|
+
]) await Y(await X(e, i, {
|
|
5483
5513
|
body: JSON.stringify({
|
|
5484
|
-
engineContract:
|
|
5514
|
+
engineContract: H,
|
|
5485
5515
|
inputs: {},
|
|
5486
5516
|
trigger: t,
|
|
5487
5517
|
version: 2
|
|
@@ -5489,9 +5519,9 @@ var Uc = [
|
|
|
5489
5519
|
headers: { "idempotency-key": `invalid-entry-${JSON.stringify(t)}` },
|
|
5490
5520
|
method: "POST"
|
|
5491
5521
|
}), 400, "run.invalid", "Reject invalid start node or payload");
|
|
5492
|
-
let a = () =>
|
|
5522
|
+
let a = () => X(e, i, {
|
|
5493
5523
|
body: JSON.stringify({
|
|
5494
|
-
engineContract:
|
|
5524
|
+
engineContract: H,
|
|
5495
5525
|
inputs: {},
|
|
5496
5526
|
trigger: {
|
|
5497
5527
|
nodeId: "start",
|
|
@@ -5501,10 +5531,10 @@ var Uc = [
|
|
|
5501
5531
|
}),
|
|
5502
5532
|
headers: { "idempotency-key": "draft-run" },
|
|
5503
5533
|
method: "POST"
|
|
5504
|
-
}), o = await
|
|
5505
|
-
|
|
5534
|
+
}), o = await J(await a(), 202, "Create Draft Run"), s = q(o.runId, "Draft Run runId");
|
|
5535
|
+
W(await J(await a(), 200, "Replay Draft Run"), o, "Replayed Draft Run"), await Y(await X(e, i, {
|
|
5506
5536
|
body: JSON.stringify({
|
|
5507
|
-
engineContract:
|
|
5537
|
+
engineContract: H,
|
|
5508
5538
|
inputs: {},
|
|
5509
5539
|
trigger: {
|
|
5510
5540
|
nodeId: "another",
|
|
@@ -5514,10 +5544,10 @@ var Uc = [
|
|
|
5514
5544
|
}),
|
|
5515
5545
|
headers: { "idempotency-key": "draft-run" },
|
|
5516
5546
|
method: "POST"
|
|
5517
|
-
}), 409, "run.conflict", "Changing the entry conflicts with the original Run request"), await
|
|
5518
|
-
let c =
|
|
5547
|
+
}), 409, "run.conflict", "Changing the entry conflicts with the original Run request"), await Y(await X(e, `/v1/runs/${s}/result`), 409, "run.not-terminal", "Read queued Run result");
|
|
5548
|
+
let c = q((await J(await X(e, i, {
|
|
5519
5549
|
body: JSON.stringify({
|
|
5520
|
-
engineContract:
|
|
5550
|
+
engineContract: H,
|
|
5521
5551
|
inputs: {},
|
|
5522
5552
|
trigger: {
|
|
5523
5553
|
nodeId: "start",
|
|
@@ -5527,42 +5557,42 @@ var Uc = [
|
|
|
5527
5557
|
}),
|
|
5528
5558
|
headers: { "idempotency-key": "draft-run-second" },
|
|
5529
5559
|
method: "POST"
|
|
5530
|
-
}), 202, "Create second Draft Run")).runId, "Second Draft Run"), l = await
|
|
5531
|
-
|
|
5532
|
-
let u =
|
|
5533
|
-
|
|
5560
|
+
}), 202, "Create second Draft Run")).runId, "Second Draft Run"), l = await J(await X(e, `/v1/flows/${n}/runs?limit=1`), 200, "List Runs");
|
|
5561
|
+
W(K(l.runs, "Runs").map((e) => G(e, "Run").runId), [c], "Listed Runs");
|
|
5562
|
+
let u = q(l.nextCursor, "Run cursor");
|
|
5563
|
+
W(K((await J(await X(e, `/v1/flows/${n}/runs?limit=1&cursor=${encodeURIComponent(u)}`), 200, "List next Runs")).runs, "Next Runs").map((e) => G(e, "Run").runId), [s], "Listed next Runs"), await Y(await X(e, `/v1/flows/${q((await Z(e, "Other Run flow", "other-run-flow")).flowId, "Other Run Flow flowId")}/runs?limit=1&cursor=${encodeURIComponent(u)}`), 400, "page.invalid-cursor", "Reject Run cursor from another Flow"), W((await J(await X(e, `/v1/runs/${s}/cancel`, {
|
|
5534
5564
|
body: JSON.stringify({ version: 1 }),
|
|
5535
5565
|
method: "POST"
|
|
5536
|
-
}), 200, "Cancel Run")).status, "canceled", "Canceled Run status"),
|
|
5566
|
+
}), 200, "Cancel Run")).status, "canceled", "Canceled Run status"), W((await J(await X(e, `/v1/runs/${s}/result`), 200, "Read canceled Run result")).status, "canceled", "Canceled Run result"), W((await J(await X(e, `/v1/runs/${s}/events`), 200, "Read canceled Run events")).done, !0, "Canceled Run events"), W((await J(await X(e, `/v1/runs/${c}/cancel`, {
|
|
5537
5567
|
body: JSON.stringify({ version: 1 }),
|
|
5538
5568
|
method: "POST"
|
|
5539
5569
|
}), 200, "Cancel second Draft Run")).status, "canceled", "Second canceled Run status");
|
|
5540
|
-
let d =
|
|
5541
|
-
|
|
5542
|
-
let ee =
|
|
5543
|
-
|
|
5570
|
+
let d = q(o.createdAt, "Run createdAt"), f = new Date(Date.parse(d) + 1).toISOString(), p = await J(await X(e, `/v1/flows/${n}/runs?limit=1&status=canceled&source=draft`), 200, "Filter paginated Runs");
|
|
5571
|
+
W(K(p.runs, "Filtered Run page").map((e) => G(e, "Filtered Run").runId), [c], "Filtered first Run page");
|
|
5572
|
+
let ee = q(p.nextCursor, "Filtered Run cursor");
|
|
5573
|
+
W(K((await J(await X(e, `/v1/flows/${n}/runs?limit=1&status=canceled&source=draft&cursor=${encodeURIComponent(ee)}`), 200, "Continue filtered Runs")).runs, "Next filtered Run page").map((e) => G(e, "Filtered Run").runId), [s], "Filtered next Run page"), W(K((await J(await X(e, `/v1/flows/${n}/runs?status=canceled&source=draft&createdFrom=${encodeURIComponent(d)}&createdBefore=${encodeURIComponent(f)}&runId=${encodeURIComponent(s)}`), 200, "Filter Runs")).runs, "Filtered Runs").map((e) => G(e, "Filtered Run").runId), [s], "Filtered Run list"), W(K((await J(await X(e, `/v1/flows/${n}/runs?createdBefore=${encodeURIComponent(d)}`), 200, "Filter Run boundary")).runs, "Boundary Runs"), [], "Exclusive Run upper boundary");
|
|
5544
5574
|
for (let t of [
|
|
5545
5575
|
"source=manual",
|
|
5546
5576
|
"createdFrom=invalid",
|
|
5547
5577
|
"createdFrom=2026-02-30T00%3A00%3A00Z",
|
|
5548
5578
|
`createdFrom=${encodeURIComponent(f)}&createdBefore=${encodeURIComponent(d)}`,
|
|
5549
5579
|
"runId="
|
|
5550
|
-
]) await
|
|
5580
|
+
]) await Y(await X(e, `/v1/flows/${n}/runs?${t}`), 400, "run.invalid", `Reject Run filter ${t}`);
|
|
5551
5581
|
}
|
|
5552
5582
|
},
|
|
5553
5583
|
{
|
|
5554
5584
|
name: "pauses, resolves, resumes, and cancels waiting Draft Runs",
|
|
5555
5585
|
runtime: !0,
|
|
5556
5586
|
async verify(e) {
|
|
5557
|
-
let t = await
|
|
5587
|
+
let t = await Z(e, "Wait flow", "wait-flow"), n = q(t.flowId, "Wait Flow flowId"), r = `/v1/flows/${n}/revisions/${Bc(await J(await Rc(e, n, await zc(e, n, q(t.draftRevisionId, "Wait Flow revisionId")), [{
|
|
5558
5588
|
kind: "graph.node.create",
|
|
5559
5589
|
node: {
|
|
5560
|
-
|
|
5590
|
+
inputDefinitions: [{
|
|
5561
5591
|
handle: "value",
|
|
5562
5592
|
jsonSchema: {},
|
|
5563
5593
|
nullable: !0,
|
|
5564
5594
|
value: null
|
|
5565
|
-
},
|
|
5595
|
+
}],
|
|
5566
5596
|
inputs: { value: {
|
|
5567
5597
|
kind: "value",
|
|
5568
5598
|
value: { request: 1 }
|
|
@@ -5580,9 +5610,9 @@ var Uc = [
|
|
|
5580
5610
|
target: "approval"
|
|
5581
5611
|
},
|
|
5582
5612
|
target: { kind: "flow" }
|
|
5583
|
-
}]), 200, "Create Wait"), "Wait Revision")}/runs`, i = async (t, n) =>
|
|
5613
|
+
}]), 200, "Create Wait"), "Wait Revision")}/runs`, i = async (t, n) => J(await X(e, r, {
|
|
5584
5614
|
body: JSON.stringify({
|
|
5585
|
-
engineContract:
|
|
5615
|
+
engineContract: H,
|
|
5586
5616
|
inputs: {},
|
|
5587
5617
|
trigger: {
|
|
5588
5618
|
nodeId: "start",
|
|
@@ -5592,38 +5622,38 @@ var Uc = [
|
|
|
5592
5622
|
}),
|
|
5593
5623
|
headers: { "idempotency-key": t },
|
|
5594
5624
|
method: "POST"
|
|
5595
|
-
}), 202, n), a = await i("wait-run", "Create Wait Run"), o =
|
|
5596
|
-
for (let t = 0;
|
|
5597
|
-
|
|
5598
|
-
let c = K(
|
|
5599
|
-
|
|
5600
|
-
let l =
|
|
5601
|
-
|
|
5602
|
-
let u = await
|
|
5603
|
-
for (let e of
|
|
5604
|
-
|
|
5605
|
-
let d = `/v1/runs/${o}/waits/${l}/resolve`, f = (t) =>
|
|
5625
|
+
}), 202, n), a = await i("wait-run", "Create Wait Run"), o = q(a.runId, "Wait Run runId"), s = a;
|
|
5626
|
+
for (let t = 0; K(s.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await J(await X(e, `/v1/runs/${o}`), 200, "Read Wait Run");
|
|
5627
|
+
W(s.status, "running", "Wait Run status");
|
|
5628
|
+
let c = G(K(s.waits, "Waits")[0], "Active Wait");
|
|
5629
|
+
W(c.actions, ["approve", "reject"], "Wait actions"), W(c.nodeId, "approval", "Wait node"), W(c.prompt, "Approve request 1?", "Wait prompt"), q(c.expiresAt, "Wait expiry"), q(c.waitingSince, "Wait start");
|
|
5630
|
+
let l = q(c.waitId, "Wait id");
|
|
5631
|
+
W(K((await J(await X(e, `/v1/flows/${n}/runs?pendingWait=true`), 200, "List waiting Runs")).runs, "Waiting Runs").map((e) => G(e, "Waiting Run").runId), [o], "Waiting Run list");
|
|
5632
|
+
let u = await J(await X(e, `/v1/runs/${o}/events`), 200, "Read waiting Run events");
|
|
5633
|
+
for (let e of K(u.events, "Run events")) Fc(e);
|
|
5634
|
+
W(u.done, !1, "Waiting events done"), K(u.events, "Waiting events").some((e) => G(e, "Waiting event").kind == "wait.created") || U("Waiting Run must contain wait.created."), await Y(await X(e, `/v1/runs/${o}/result`), 409, "run.not-terminal", "Read waiting Run result");
|
|
5635
|
+
let d = `/v1/runs/${o}/waits/${l}/resolve`, f = (t) => X(e, d, {
|
|
5606
5636
|
body: JSON.stringify({
|
|
5607
5637
|
action: t,
|
|
5608
5638
|
version: 1
|
|
5609
5639
|
}),
|
|
5610
5640
|
method: "POST"
|
|
5611
5641
|
});
|
|
5612
|
-
await
|
|
5613
|
-
let p = await
|
|
5614
|
-
|
|
5615
|
-
let ee = await
|
|
5616
|
-
|
|
5617
|
-
for (let t = 0; s.status != "completed" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await
|
|
5618
|
-
|
|
5619
|
-
let te = await
|
|
5620
|
-
|
|
5621
|
-
let ne = await
|
|
5622
|
-
for (let e of
|
|
5623
|
-
|
|
5624
|
-
let re = await i("wait-run-cancel", "Create cancelable Wait Run"), ie =
|
|
5625
|
-
for (let t = 0;
|
|
5626
|
-
|
|
5642
|
+
await Y(await f("continue"), 400, "run.invalid", "Reject unsupported Wait action");
|
|
5643
|
+
let p = await J(await f("approve"), 200, "Approve Wait");
|
|
5644
|
+
W(p.action, "approve", "Approved action"), W(p.resolutionAccepted, !0, "Approved resolution"), W(p.status, "running", "Resolved Run status"), q(p.resolvedAt, "Wait resolution time");
|
|
5645
|
+
let ee = await J(await f("reject"), 200, "Reject resolved Wait");
|
|
5646
|
+
W(ee.action, "approve", "Winning action"), W(ee.resolutionAccepted, !1, "Competing resolution");
|
|
5647
|
+
for (let t = 0; s.status != "completed" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await J(await X(e, `/v1/runs/${o}`), 200, "Read resumed Run");
|
|
5648
|
+
W(s.status, "completed", "Resumed Run status"), W(s.waits, [], "Completed Wait projection");
|
|
5649
|
+
let te = await J(await f("approve"), 200, "Replay approved Wait");
|
|
5650
|
+
W(te.resolutionAccepted, !0, "Replayed resolution"), W(te.status, "completed", "Replayed terminal status");
|
|
5651
|
+
let ne = await J(await X(e, `/v1/runs/${o}/events`), 200, "Read resumed Run events");
|
|
5652
|
+
for (let e of K(ne.events, "Run events")) Fc(e);
|
|
5653
|
+
W(K(ne.events, "Completed events").filter((e) => G(e, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
|
|
5654
|
+
let re = await i("wait-run-cancel", "Create cancelable Wait Run"), ie = q(re.runId, "Cancelable Wait Run id"), ae = re;
|
|
5655
|
+
for (let t = 0; K(ae.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), ae = await J(await X(e, `/v1/runs/${ie}`), 200, "Read cancelable Wait Run");
|
|
5656
|
+
W(ae.status, "running", "Cancelable Wait status"), W((await J(await X(e, `/v1/runs/${ie}/cancel`, {
|
|
5627
5657
|
body: JSON.stringify({ version: 1 }),
|
|
5628
5658
|
method: "POST"
|
|
5629
5659
|
}), 200, "Cancel waiting Run")).status, "canceled", "Canceled waiting Run status");
|
|
@@ -5633,32 +5663,32 @@ var Uc = [
|
|
|
5633
5663
|
name: "rejects invalid and missing Flow control targets",
|
|
5634
5664
|
async verify(e) {
|
|
5635
5665
|
let t = "00000000-0000-7000-8000-000000000001", n = "00000000-0000-7000-8000-000000000002", r = "00000000-0000-7000-8000-000000000003";
|
|
5636
|
-
await
|
|
5666
|
+
await Y(await X(e, `/v1/flows/${t}`), 404, "flow.not-found", "Read missing Flow"), await Y(await X(e, `/v1/flows/${t}`, {
|
|
5637
5667
|
body: JSON.stringify({
|
|
5638
5668
|
name: "Missing",
|
|
5639
5669
|
version: 1
|
|
5640
5670
|
}),
|
|
5641
5671
|
method: "PATCH"
|
|
5642
|
-
}), 404, "flow.not-found", "Rename missing Flow"), await
|
|
5672
|
+
}), 404, "flow.not-found", "Rename missing Flow"), await Y(await X(e, `/v1/flows/${t}`, { method: "DELETE" }), 404, "flow.not-found", "Retire missing Flow"), await Y(await X(e, `/v1/flows/${t}/draft`), 404, "flow.not-found", "Read missing Draft"), await Y(await X(e, `/v1/flows/${t}/revisions/${n}`), 404, "flow.not-found", "Read missing Revision"), await Y(await X(e, `/v1/flows/${t}/presentation`), 404, "flow.not-found", "Read missing Presentation"), await Y(await X(e, `/v1/flows/${t}/presentation`, {
|
|
5643
5673
|
body: JSON.stringify({
|
|
5644
5674
|
expectedRevision: 1,
|
|
5645
5675
|
value: {},
|
|
5646
5676
|
version: 1
|
|
5647
5677
|
}),
|
|
5648
5678
|
method: "PUT"
|
|
5649
|
-
}), 404, "flow.not-found", "Update missing Presentation"), await
|
|
5679
|
+
}), 404, "flow.not-found", "Update missing Presentation"), await Y(await X(e, `/v1/flows/${t}/runs`), 404, "flow.not-found", "List missing Flow Runs"), await Y(await X(e, `/v1/runs/${r}`), 404, "run.not-found", "Read missing Run"), await Y(await X(e, `/v1/runs/${r}/events`), 404, "run.not-found", "Read missing Run events"), await Y(await X(e, `/v1/runs/${r}/result`), 404, "run.not-found", "Read missing Run result"), await Y(await X(e, `/v1/runs/${r}/cancel`, {
|
|
5650
5680
|
body: JSON.stringify({ version: 1 }),
|
|
5651
5681
|
method: "POST"
|
|
5652
5682
|
}), 404, "run.not-found", "Cancel missing Run");
|
|
5653
|
-
let i = await
|
|
5683
|
+
let i = await Z(e, "Invalid targets", "invalid-targets"), a = q(i.flowId, "Invalid targets Flow"), o = q(i.draftRevisionId, "Invalid targets Revision"), s = (t, n) => X(e, `/v1/flows/${a}/revisions/${t}/check`, {
|
|
5654
5684
|
body: JSON.stringify({
|
|
5655
5685
|
engineContract: n,
|
|
5656
5686
|
version: 1
|
|
5657
5687
|
}),
|
|
5658
5688
|
method: "POST"
|
|
5659
5689
|
});
|
|
5660
|
-
await
|
|
5661
|
-
let c = (t, n, r) =>
|
|
5690
|
+
await Y(await s(o, "unsupported-engine/v1"), 409, "engine.unsupported", "Check unsupported Engine"), await Y(await s(n, H), 404, "flow.not-found", "Check missing Revision");
|
|
5691
|
+
let c = (t, n, r) => X(e, `/v1/flows/${a}/revisions/${t}/runs`, {
|
|
5662
5692
|
body: JSON.stringify({
|
|
5663
5693
|
engineContract: n,
|
|
5664
5694
|
inputs: {},
|
|
@@ -5671,14 +5701,14 @@ var Uc = [
|
|
|
5671
5701
|
headers: { "idempotency-key": r },
|
|
5672
5702
|
method: "POST"
|
|
5673
5703
|
});
|
|
5674
|
-
await
|
|
5704
|
+
await Y(await c(o, "unsupported-engine/v1", "unsupported-run"), 409, "engine.unsupported", "Run unsupported Engine"), await Y(await c(n, H, "missing-revision-run"), 404, "flow.not-found", "Run missing Revision");
|
|
5675
5705
|
}
|
|
5676
5706
|
}
|
|
5677
|
-
],
|
|
5707
|
+
], Gc = [
|
|
5678
5708
|
{
|
|
5679
5709
|
name: "controls Live admission independently from publishing and Draft testing",
|
|
5680
5710
|
async verify(e) {
|
|
5681
|
-
let t = await
|
|
5711
|
+
let t = await Z(e, "Enabled flow", "enabled-flow"), n = q(t.flowId, "Flow id"), r = await zc(e, n, q(t.draftRevisionId, "Draft id")), i = (t, r) => X(e, `/v1/flows/${n}/enabled`, {
|
|
5682
5712
|
method: "PUT",
|
|
5683
5713
|
body: JSON.stringify({
|
|
5684
5714
|
enabled: t,
|
|
@@ -5686,17 +5716,17 @@ var Uc = [
|
|
|
5686
5716
|
version: 1
|
|
5687
5717
|
})
|
|
5688
5718
|
});
|
|
5689
|
-
await
|
|
5690
|
-
let a =
|
|
5691
|
-
|
|
5719
|
+
await Y(await i(!0, "missing"), 409, "flow.conflict", "Cannot enable unpublished Flow");
|
|
5720
|
+
let a = q((await Vc(e, await $(e, n, r, null, "enable-first"), 202, "Publish")).publication.publicationId, "Publication id"), o = await J(await i(!1, a), 200, "Disable");
|
|
5721
|
+
W(o.live, {
|
|
5692
5722
|
enabled: !1,
|
|
5693
5723
|
publicationId: a,
|
|
5694
5724
|
revisionId: r
|
|
5695
|
-
}, "Disabled summary"),
|
|
5725
|
+
}, "Disabled summary"), W((await J(await X(e, "/v1/flows"), 200, "List disabled Flow")).flows, [o], "List includes Live state"), W((await J(await X(e, `/v1/flows/${n}/live`), 200, "Disabled Live")).status, "suspended", "Disabled Live status"), await Y(await Uc(e, a, "disabled-run"), 412, "live.conflict", "Disabled Live rejects Run"), await J(await X(e, `/v1/flows/${n}/revisions/${r}/runs`, {
|
|
5696
5726
|
method: "POST",
|
|
5697
5727
|
headers: { "idempotency-key": "disabled-draft" },
|
|
5698
5728
|
body: JSON.stringify({
|
|
5699
|
-
engineContract:
|
|
5729
|
+
engineContract: H,
|
|
5700
5730
|
inputs: {},
|
|
5701
5731
|
trigger: {
|
|
5702
5732
|
nodeId: "start",
|
|
@@ -5705,21 +5735,21 @@ var Uc = [
|
|
|
5705
5735
|
version: 2
|
|
5706
5736
|
})
|
|
5707
5737
|
}), 202, "Disabled Flow permits Draft test");
|
|
5708
|
-
let s =
|
|
5709
|
-
G(
|
|
5738
|
+
let s = q((await Vc(e, await $(e, n, r, a, "enable-next"), 202, "Publish disabled Flow")).publication.publicationId, "Next Publication id");
|
|
5739
|
+
W(G((await J(await X(e, `/v1/flows/${n}`), 200, "Read Flow")).live, "Live").enabled, !1, "Publish preserves disabled state"), await Y(await i(!0, a), 409, "flow.conflict", "Stale switch rejects"), await J(await i(!0, s), 200, "Enable"), await J(await Uc(e, s, "enabled-run"), 202, "Enabled Live accepts Run");
|
|
5710
5740
|
}
|
|
5711
5741
|
},
|
|
5712
5742
|
{
|
|
5713
5743
|
name: "publishes one immutable Flow with idempotent Live CAS",
|
|
5714
5744
|
async verify(e) {
|
|
5715
|
-
let t = await
|
|
5716
|
-
|
|
5717
|
-
let i = () =>
|
|
5718
|
-
|
|
5719
|
-
let c = await
|
|
5720
|
-
|
|
5721
|
-
let l = await
|
|
5722
|
-
|
|
5745
|
+
let t = await Z(e, "Publication flow", "publication-flow"), n = q(t.flowId, "Publication Flow flowId"), r = await zc(e, n, q(t.draftRevisionId, "Publication Flow revisionId"));
|
|
5746
|
+
W((await J(await X(e, `/v1/flows/${n}/live`), 200, "Read Live")).status, "not-published", "Initial Live status");
|
|
5747
|
+
let i = () => $(e, n, r, null, "publication-first"), a = await Vc(e, await i(), 202, "Publish Flow"), o = a.publication, s = q(o.publicationId, "Publication id");
|
|
5748
|
+
W(await J(await i(), 202, "Replay Publish"), a.operation, "Replayed Publish operation"), await Y(await $(e, n, r, s, "publication-first"), 409, "publication.conflict", "Conflicting replay");
|
|
5749
|
+
let c = await J(await X(e, `/v1/flows/${n}/live`), 200, "Read published Live");
|
|
5750
|
+
W(c.publication, o, "Live Publication"), W((await J(await X(e, `/v1/flows/${n}/editor`), 200, "Read published editor")).live, c, "Published editor Live projection");
|
|
5751
|
+
let l = await J(await X(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
|
|
5752
|
+
W(l.publications, [o], "Publication history"), W(l.total, 1, "Publication total"), await Y(await X(e, `/v1/flows/${n}/revisions/${r}/publications`, {
|
|
5723
5753
|
body: JSON.stringify({
|
|
5724
5754
|
engineContract: "unsupported-engine/v1",
|
|
5725
5755
|
expectedLivePublicationId: s,
|
|
@@ -5727,35 +5757,35 @@ var Uc = [
|
|
|
5727
5757
|
}),
|
|
5728
5758
|
headers: { "idempotency-key": "unsupported-publication" },
|
|
5729
5759
|
method: "POST"
|
|
5730
|
-
}), 409, "engine.unsupported", "Publish unsupported Engine"), await
|
|
5760
|
+
}), 409, "engine.unsupported", "Publish unsupported Engine"), await Y(await $(e, n, "00000000-0000-7000-8000-000000000002", s, "missing-revision-publication"), 404, "flow.not-found", "Publish missing Revision"), await Y(await Hc(e, n, "00000000-0000-7000-8000-000000000004", s, "missing-rollback"), 404, "publication.not-found", "Rollback missing Publication"), await Y(await Uc(e, "00000000-0000-7000-8000-000000000004", "missing-publication-run"), 404, "publication.not-found", "Run missing Publication");
|
|
5731
5761
|
}
|
|
5732
5762
|
},
|
|
5733
5763
|
{
|
|
5734
5764
|
name: "rolls back immutable history and fixes a Live Run target",
|
|
5735
5765
|
async verify(e) {
|
|
5736
|
-
let t = await
|
|
5737
|
-
await
|
|
5738
|
-
let c = () =>
|
|
5739
|
-
|
|
5740
|
-
let d = await
|
|
5741
|
-
|
|
5766
|
+
let t = await Z(e, "Rollback flow", "rollback-flow"), n = q(t.flowId, "Rollback Flow flowId"), r = await zc(e, n, q(t.draftRevisionId, "Rollback Flow revisionId")), i = (await Vc(e, await $(e, n, r, null, "publish-first"), 202, "Publish first Revision")).publication, a = q(i.publicationId, "First Publication"), o = (await Vc(e, await $(e, n, Bc(await J(await Q(e, n, r), 200, "Change Draft"), "Second Revision"), a, "publish-second"), 202, "Publish second Revision")).publication, s = q(o.publicationId, "Second Publication");
|
|
5767
|
+
await Y(await Uc(e, a, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
|
|
5768
|
+
let c = () => Hc(e, n, a, s, "rollback-first"), l = await J(await c(), 201, "Rollback Flow"), u = q(l.publicationId, "Rollback Publication");
|
|
5769
|
+
W(l.operation, "rollback", "Rollback operation"), W(l.sourcePublicationId, a, "Rollback source"), W(await J(await c(), 200, "Replay Rollback"), l, "Replayed Rollback");
|
|
5770
|
+
let d = await J(await Uc(e, u, "rollback-run"), 202, "Create Live Run");
|
|
5771
|
+
W(d.flowId, n, "Live Run flowId"), W(d.revisionId, r, "Live Run revisionId"), await J(await X(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow"), await Y(await Uc(e, u, "retired-run"), 409, "flow.busy", "Run retired Flow");
|
|
5742
5772
|
}
|
|
5743
5773
|
}
|
|
5744
|
-
],
|
|
5774
|
+
], Kc = [{
|
|
5745
5775
|
name: "exposes one deployment-scoped Trigger Key catalog",
|
|
5746
5776
|
async verify(e) {
|
|
5747
|
-
let t = await
|
|
5748
|
-
|
|
5777
|
+
let t = await J(await X(e, "/v1/trigger-keys"), 200, "List Trigger Keys"), n = await J(await X(e, "/v1/trigger-keys/catalog"), 200, "List Trigger definitions"), r = K(t.keys, "Trigger Keys").map((e) => G(e, "Trigger Key")), i = K(n.definitions, "Trigger definitions").map((e) => G(e, "Trigger definition"));
|
|
5778
|
+
W(r.map((e) => e.key), i.map((e) => e.key), "Trigger catalog identities");
|
|
5749
5779
|
for (let [t, n] of r.entries()) {
|
|
5750
|
-
let r =
|
|
5751
|
-
|
|
5780
|
+
let r = q(n.key, "Trigger Key");
|
|
5781
|
+
W((await J(await X(e, `/v1/trigger-keys/${encodeURIComponent(r)}`), 200, "Read Trigger Key")).definition, i[t], "Trigger detail");
|
|
5752
5782
|
}
|
|
5753
|
-
await
|
|
5783
|
+
await Y(await X(e, "/v1/trigger-keys/conformance.missing"), 404, "trigger-key.not-found", "Missing Trigger Key");
|
|
5754
5784
|
}
|
|
5755
5785
|
}, {
|
|
5756
5786
|
name: "operates and retires one Live Trigger binding",
|
|
5757
5787
|
async verify(e) {
|
|
5758
|
-
let t = await
|
|
5788
|
+
let t = await Z(e, "Trigger flow", "trigger-flow"), n = q(t.flowId, "Trigger Flow flowId"), r = Bc(await J(await Rc(e, n, q(t.draftRevisionId, "Trigger Flow revisionId"), [{
|
|
5759
5789
|
kind: "graph.node.create",
|
|
5760
5790
|
node: {
|
|
5761
5791
|
cronTimes: [{
|
|
@@ -5777,15 +5807,15 @@ var Uc = [
|
|
|
5777
5807
|
},
|
|
5778
5808
|
nodeId: "webhook",
|
|
5779
5809
|
target: { kind: "flow" }
|
|
5780
|
-
}]), 200, "Create Trigger nodes"), "Trigger Revision"), i = (await
|
|
5781
|
-
|
|
5782
|
-
for (let e of s)
|
|
5783
|
-
let c = `${o}/webhook`, l =
|
|
5810
|
+
}]), 200, "Create Trigger nodes"), "Trigger Revision"), i = (await Vc(e, await $(e, n, r, null, "trigger-publication"), 202, "Publish Trigger Flow")).publication, a = q(i.publicationId, "Trigger Publication"), o = `/v1/flows/${n}/triggers`, s = K((await J(await X(e, o), 200, "List Trigger bindings")).bindings, "Trigger bindings").map((e) => G(e, "Trigger binding"));
|
|
5811
|
+
W(s.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
|
|
5812
|
+
for (let e of s) W(e.currentPublicationId, a, "Trigger Publication");
|
|
5813
|
+
let c = `${o}/webhook`, l = q(G((await J(await X(e, c), 200, "Read Webhook")).binding, "Webhook").endpointUrl, "Webhook endpoint"), u = (t) => X(e, `${c}/${t}`, {
|
|
5784
5814
|
body: JSON.stringify({ version: 1 }),
|
|
5785
5815
|
method: "POST"
|
|
5786
5816
|
});
|
|
5787
|
-
|
|
5788
|
-
let d = (t) =>
|
|
5817
|
+
W((await J(await u("pause"), 200, "Pause Webhook")).operatorState, "paused", "Paused state"), W((await e.request(new Request(l, { method: "POST" }))).status, 404, "Paused callback"), W((await J(await u("resume"), 200, "Resume Webhook")).operatorState, "active", "Resumed state"), W((await e.request(new Request(l, { method: "POST" }))).status, 200, "Resumed callback");
|
|
5818
|
+
let d = (t) => X(e, `/v1/flows/${n}/enabled`, {
|
|
5789
5819
|
method: "PUT",
|
|
5790
5820
|
body: JSON.stringify({
|
|
5791
5821
|
enabled: t,
|
|
@@ -5793,38 +5823,124 @@ var Uc = [
|
|
|
5793
5823
|
version: 1
|
|
5794
5824
|
})
|
|
5795
5825
|
});
|
|
5796
|
-
await
|
|
5826
|
+
await J(await d(!1), 200, "Disable Trigger Flow"), W((await e.request(new Request(l, { method: "POST" }))).status, 404, "Disabled Flow blocks callback"), await J(await u("pause"), 200, "Pause binding while Flow disabled"), await J(await d(!0), 200, "Enable Trigger Flow"), W((await e.request(new Request(l, { method: "POST" }))).status, 404, "Enabling preserves binding pause"), await J(await u("resume"), 200, "Resume binding after enabling Flow"), W((await e.request(new Request(l, { method: "POST" }))).status, 200, "Enabled Flow permits callback"), await Vc(e, await $(e, n, Bc(await J(await Rc(e, n, r, [{
|
|
5797
5827
|
kind: "graph.node.delete",
|
|
5798
5828
|
nodeId: "webhook",
|
|
5799
5829
|
target: { kind: "flow" }
|
|
5800
|
-
}]), 200, "Delete Webhook"), "Retired Trigger Revision"), a, "retire-trigger"), 202, "Publish retired Trigger"), G(
|
|
5830
|
+
}]), 200, "Delete Webhook"), "Retired Trigger Revision"), a, "retire-trigger"), 202, "Publish retired Trigger"), W(G((await J(await X(e, c), 200, "Read retired Webhook")).binding, "Retired Webhook").currentPublicationId, void 0, "Retired Publication");
|
|
5801
5831
|
}
|
|
5802
|
-
}],
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
},
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5832
|
+
}], qc = [
|
|
5833
|
+
{
|
|
5834
|
+
name: "projects implicit Connector access without writable binding state",
|
|
5835
|
+
async verify(e) {
|
|
5836
|
+
let t = q((await Z(e, "Connector access", "connector-access-create")).flowId, "Flow ID"), n = await J(await X(e, `/v1/flows/${t}/connector-access`), 200, "Read Connector access");
|
|
5837
|
+
W(n.accessRevision, 0, "Implicit Connector access revision"), W(n.bindings, [], "Implicit Connector access bindings"), W(n.mode, "implicit", "Implicit Connector access mode"), q(n.providerAccessDigest, "Implicit Connector access digest").startsWith("implicit") || U("Implicit Connector access digest must identify the implicit authority generation."), W(n.version, 1, "Implicit Connector access version"), W(await J(await X(e, `/v1/flows/${t}/connector-access/mail/candidates`), 200, "Read Connector access candidates"), {
|
|
5838
|
+
candidates: [],
|
|
5839
|
+
mode: "implicit",
|
|
5840
|
+
providerId: "mail",
|
|
5841
|
+
version: 1
|
|
5842
|
+
}, "Implicit Connector access candidates"), await Y(await X(e, `/v1/flows/${t}/connector-access/mail`, {
|
|
5843
|
+
body: JSON.stringify({
|
|
5844
|
+
accessBindingId: "editors",
|
|
5845
|
+
expectedAccessRevision: 0,
|
|
5846
|
+
version: 1
|
|
5847
|
+
}),
|
|
5848
|
+
method: "PUT"
|
|
5849
|
+
}), 409, "connector.access-unsupported", "Set implicit Connector access"), await Y(await X(e, `/v1/flows/${t}/connector-access/mail`, {
|
|
5850
|
+
body: JSON.stringify({
|
|
5851
|
+
accessBindingId: "editors",
|
|
5852
|
+
expectedAccessRevision: 0,
|
|
5853
|
+
version: 1
|
|
5854
|
+
}),
|
|
5855
|
+
method: "DELETE"
|
|
5856
|
+
}), 409, "connector.access-unsupported", "Clear implicit Connector access");
|
|
5857
|
+
}
|
|
5858
|
+
},
|
|
5859
|
+
{
|
|
5860
|
+
name: "projects the deployment Connector catalog and authorized Connections",
|
|
5861
|
+
async verify(e) {
|
|
5862
|
+
let t = K((await J(await X(e, "/v1/connector/providers"), 200, "List Connector Providers")).providers, "Connector Providers").map((e) => G(e, "Connector Provider")), n = K((await J(await X(e, "/v1/connector/actions"), 200, "List Connector Actions")).actions, "Connector Actions").map((e) => G(e, "Connector Action"));
|
|
5863
|
+
(t.length == 0 || n.length == 0) && U("Connector conformance deployment must expose a Provider and Action.");
|
|
5864
|
+
let r = n[0], i = q(r.actionId, "Connector Action id"), a = q(r.serviceId, "Connector Action serviceId");
|
|
5865
|
+
t.some((e) => e.serviceId == a) || U("Connector Action must refer to a listed Provider."), W((await J(await X(e, `/v1/connector/actions/${encodeURIComponent(i)}`), 200, "Read Connector Action")).action, r, "Connector Action detail");
|
|
5866
|
+
let o = await J(await X(e, `/v1/connector/connections/${encodeURIComponent(a)}`), 200, "List Connector Connections");
|
|
5867
|
+
Array.isArray(o.connections) || U("Connector Connections must be an array.");
|
|
5868
|
+
let s = await J(await X(e, `/v1/connector/connections/${encodeURIComponent(a)}/page`, {
|
|
5869
|
+
body: JSON.stringify({ version: 1 }),
|
|
5870
|
+
method: "POST"
|
|
5871
|
+
}), 200, "Create Connector Connection page"), c = new URL(q(s.url, "Connector Connection page URL"));
|
|
5872
|
+
c.protocol != "http:" && c.protocol != "https:" && U("Connector Connection page URL must use HTTP.");
|
|
5873
|
+
}
|
|
5874
|
+
},
|
|
5875
|
+
{
|
|
5876
|
+
name: "rejects invalid Connector discovery requests",
|
|
5877
|
+
async verify(e) {
|
|
5878
|
+
await Y(await X(e, "/v1/connector/actions?service=mail&q=send"), 400, "flow.invalid", "Conflicting Connector query"), await Y(await X(e, "/v1/connector/actions?q=%20%20"), 400, "flow.invalid", "Empty Connector query"), await Y(await X(e, `/v1/connector/connections/${"a".repeat(257)}`), 400, "flow.invalid", "Oversized Connector service"), await Y(await X(e, "/v1/connector/actions/conformance.missing"), 404, "connector.action-not-found", "Missing Connector Action");
|
|
5879
|
+
}
|
|
5821
5880
|
}
|
|
5822
|
-
|
|
5881
|
+
];
|
|
5882
|
+
function Jc(e) {
|
|
5883
|
+
return [{
|
|
5884
|
+
name: "selects Provider access with optimistic concurrency",
|
|
5885
|
+
async verify(t) {
|
|
5886
|
+
let n = await Z(t, "Selectable Connector access", "selectable-connector-access-create"), r = q(n.flowId, "Flow ID"), i = `/v1/flows/${r}/connector-access/${encodeURIComponent(e.providerId)}`, a = await J(await X(t, `/v1/flows/${r}/connector-access`), 200, "Read selectable Connector access");
|
|
5887
|
+
W(a.mode, "selectable", "Selectable Connector access mode"), W(a.accessRevision, 0, "Initial selectable Connector access revision");
|
|
5888
|
+
let o = await J(await X(t, `${i}/candidates`), 200, "Read Provider access candidates");
|
|
5889
|
+
W(o.mode, "selectable", "Provider access candidate mode"), W(o.providerId, e.providerId, "Provider access candidate Provider");
|
|
5890
|
+
let s = K(o.candidates, "Provider access candidates").find((t) => G(t, "Provider access candidate").accessBindingId == e.accessBindingId);
|
|
5891
|
+
s ?? U("Expected selectable Provider access candidate was not returned."), W(G(s, "Provider access candidate").connectionDisplayName, e.connectionDisplayName, "Provider access candidate connection display name"), W(G(s, "Provider access candidate").permissionGroupName, e.permissionGroupName, "Provider access candidate permission group name");
|
|
5892
|
+
let c = await J(await X(t, i, {
|
|
5893
|
+
body: JSON.stringify({
|
|
5894
|
+
accessBindingId: e.accessBindingId,
|
|
5895
|
+
expectedAccessRevision: 0,
|
|
5896
|
+
version: 1
|
|
5897
|
+
}),
|
|
5898
|
+
method: "PUT"
|
|
5899
|
+
}), 200, "Select Provider access");
|
|
5900
|
+
W(c.accessRevision, 1, "Selected Connector access revision"), W(c.mode, "selectable", "Selected Connector access mode");
|
|
5901
|
+
let l = K(c.bindings, "Selected Connector access bindings").find((t) => G(t, "Selected Connector access binding").providerId == e.providerId);
|
|
5902
|
+
l ?? U("Selected Provider access binding was not projected."), W(G(l, "Selected Connector access binding").accessBindingId, e.accessBindingId, "Selected Provider access binding ID"), W(G(l, "Selected Connector access binding").connectionDisplayName, e.connectionDisplayName, "Selected Provider access binding connection display name"), W(G(l, "Selected Connector access binding").permissionGroupName, e.permissionGroupName, "Selected Provider access binding permission group name");
|
|
5903
|
+
let u = q(c.providerAccessDigest, "Selected Connector access digest"), d = await zc(t, r, q(n.draftRevisionId, "Draft Revision ID"));
|
|
5904
|
+
W((await J(await X(t, `/v1/flows/${r}/revisions/${d}/runs`, {
|
|
5905
|
+
body: JSON.stringify({
|
|
5906
|
+
engineContract: H,
|
|
5907
|
+
inputs: {},
|
|
5908
|
+
trigger: {
|
|
5909
|
+
nodeId: "start",
|
|
5910
|
+
outputs: {}
|
|
5911
|
+
},
|
|
5912
|
+
version: 2
|
|
5913
|
+
}),
|
|
5914
|
+
headers: { "idempotency-key": "selectable-connector-access-draft-run" },
|
|
5915
|
+
method: "POST"
|
|
5916
|
+
}), 202, "Admit Draft Run with selected Provider access")).providerAccessDigest, u, "Draft Run Provider access snapshot");
|
|
5917
|
+
let f = await Vc(t, await $(t, r, d, null, "selectable-connector-access-publish"), 202, "Publish selected Provider access");
|
|
5918
|
+
W(f.publication.providerAccessDigest, u, "Publication Provider access snapshot"), await Y(await X(t, i, {
|
|
5919
|
+
body: JSON.stringify({
|
|
5920
|
+
accessBindingId: e.accessBindingId,
|
|
5921
|
+
expectedAccessRevision: 0,
|
|
5922
|
+
version: 1
|
|
5923
|
+
}),
|
|
5924
|
+
method: "PUT"
|
|
5925
|
+
}), 412, "connector.access-conflict", "Overwrite Provider access with a stale revision");
|
|
5926
|
+
let p = await J(await X(t, i, {
|
|
5927
|
+
body: JSON.stringify({
|
|
5928
|
+
accessBindingId: e.accessBindingId,
|
|
5929
|
+
expectedAccessRevision: 1,
|
|
5930
|
+
version: 1
|
|
5931
|
+
}),
|
|
5932
|
+
method: "DELETE"
|
|
5933
|
+
}), 200, "Clear Provider access");
|
|
5934
|
+
W(p.accessRevision, 2, "Cleared Connector access revision"), W(p.bindings, [], "Cleared Connector access bindings"), W((await J(await X(t, `/v1/flows/${r}/live`), 200, "Read Live after clearing Provider access")).hasUnpublishedChanges, !0, "Cleared Draft access marks Live as unpublished"), W((await J(await Uc(t, q(f.publication.publicationId, "Publication ID"), "selectable-connector-access-live-run"), 202, "Admit Live Run after clearing Draft access")).providerAccessDigest, u, "Live Run preserves Publication Provider access snapshot");
|
|
5935
|
+
}
|
|
5936
|
+
}];
|
|
5937
|
+
}
|
|
5938
|
+
var Yc = [{
|
|
5823
5939
|
name: "preserves committed mutations and idempotency receipts after restart",
|
|
5824
5940
|
async verify(e) {
|
|
5825
|
-
let t = await
|
|
5826
|
-
await e.restart(),
|
|
5941
|
+
let t = await Z(e, "Recovery", "recovery-create"), n = q(t.flowId, "Flow ID"), r = q(t.draftRevisionId, "Revision ID"), i = await J(await Q(e, n, r, "marker", "recovery-change"), 200, "Commit change");
|
|
5942
|
+
await e.restart(), W((await J(await Lc(e, "Recovery", "recovery-create"), 200, "Replay creation after restart")).flowId, n, "Durable creation identity"), W(await J(await Q(e, n, r, "marker", "recovery-change"), 200, "Replay change after restart"), i, "Durable change receipt"), W((await J(await X(e, `/v1/flows/${n}/draft`), 200, "Recovered Draft")).revisionId, G(i.revision, "Revision").revisionId, "Recovered head");
|
|
5827
5943
|
}
|
|
5828
5944
|
}];
|
|
5829
5945
|
//#endregion
|
|
5830
|
-
export {
|
|
5946
|
+
export { qc as connectorControlApiConformanceCases, Wc as controlApiConformanceCases, Yc as controlRecoveryConformanceCases, Gc as publicationControlApiConformanceCases, Jc as selectableConnectorAccessControlApiConformanceCases, Kc as triggerControlApiConformanceCases };
|