@oomol-lab/open-flow 0.1.0-alpha.0
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/LICENSE +201 -0
- package/NOTICE +47 -0
- package/README.md +18 -0
- package/dist/browser/_virtual_open-flow-twemoji-DJwKsM_w.js +5067 -0
- package/dist/browser/addNodeOptions-DqoIueCR.js +33746 -0
- package/dist/browser/assets/font-00b26ac825e20950.woff2 +0 -0
- package/dist/browser/assets/font-036d4e95149b69ff.woff2 +0 -0
- package/dist/browser/assets/font-07d8e303ce4fc12b.ttf +0 -0
- package/dist/browser/assets/font-08ce98e51b04d589.ttf +0 -0
- package/dist/browser/assets/font-0cdd387c9590a1a9.woff2 +0 -0
- package/dist/browser/assets/font-0d85ae7cc30f2379.ttf +0 -0
- package/dist/browser/assets/font-0f60d1b897938ec9.woff2 +0 -0
- package/dist/browser/assets/font-11e4dc8a6471ff6d.woff +0 -0
- package/dist/browser/assets/font-138ac28d1663b303.ttf +0 -0
- package/dist/browser/assets/font-1ae6bd7475590e97.woff +0 -0
- package/dist/browser/assets/font-1c67f068fea8bb09.ttf +0 -0
- package/dist/browser/assets/font-1e6f9579e90e2cac.ttf +0 -0
- package/dist/browser/assets/font-1ece03f79f95277d.ttf +0 -0
- package/dist/browser/assets/font-2014c523c3210bcc.woff +0 -0
- package/dist/browser/assets/font-30da91e84c893f87.woff +0 -0
- package/dist/browser/assets/font-3398dd02302557a7.woff +0 -0
- package/dist/browser/assets/font-3931dd81faed86ba.ttf +0 -0
- package/dist/browser/assets/font-500e04d54f0d5166.ttf +0 -0
- package/dist/browser/assets/font-51814d270d06ff02.woff2 +0 -0
- package/dist/browser/assets/font-5d53e70ad607c235.woff2 +0 -0
- package/dist/browser/assets/font-5e28753be717dac9.woff +0 -0
- package/dist/browser/assets/font-68534840bcfdd2bf.ttf +0 -0
- package/dist/browser/assets/font-68e8c73ef42afd3c.woff2 +0 -0
- package/dist/browser/assets/font-6ab6b62e9b62dae2.woff +0 -0
- package/dist/browser/assets/font-6b47c40166b6dbe2.woff2 +0 -0
- package/dist/browser/assets/font-70ee1f64a20f2048.ttf +0 -0
- package/dist/browser/assets/font-71d517d67827787c.woff2 +0 -0
- package/dist/browser/assets/font-73d591271b160496.woff2 +0 -0
- package/dist/browser/assets/font-74444efd593c005e.woff2 +0 -0
- package/dist/browser/assets/font-7af58c5ec8f132a2.woff2 +0 -0
- package/dist/browser/assets/font-850c0af5c2238497.woff +0 -0
- package/dist/browser/assets/font-8a8d244581371912.woff +0 -0
- package/dist/browser/assets/font-9163df9c7122432e.ttf +0 -0
- package/dist/browser/assets/font-91ee67500cc0129a.woff +0 -0
- package/dist/browser/assets/font-95b6d2f1a50173bf.ttf +0 -0
- package/dist/browser/assets/font-97479ca6cce906ab.woff2 +0 -0
- package/dist/browser/assets/font-99cd42a3c072d918.woff2 +0 -0
- package/dist/browser/assets/font-99f9c6750b489c94.woff +0 -0
- package/dist/browser/assets/font-9be7ceb88004ab8a.woff +0 -0
- package/dist/browser/assets/font-a4af7d414440a1c1.woff2 +0 -0
- package/dist/browser/assets/font-a6b2099fb555c60e.ttf +0 -0
- package/dist/browser/assets/font-a6f7ec0d846ac7ad.woff +0 -0
- package/dist/browser/assets/font-c2342cd8b869e017.woff2 +0 -0
- package/dist/browser/assets/font-c6368d87e8a1a3a5.woff +0 -0
- package/dist/browser/assets/font-c647367d1dd4e162.ttf +0 -0
- package/dist/browser/assets/font-c76c5d696297d51b.woff +0 -0
- package/dist/browser/assets/font-c943cc986384f59e.woff +0 -0
- package/dist/browser/assets/font-d0332f52868370fd.ttf +0 -0
- package/dist/browser/assets/font-d04c54219f9eaec6.woff2 +0 -0
- package/dist/browser/assets/font-d96cdf2b3bdd4d64.woff +0 -0
- package/dist/browser/assets/font-dc47344dbb6cb5b6.woff2 +0 -0
- package/dist/browser/assets/font-de7701e42cf1f4cf.woff2 +0 -0
- package/dist/browser/assets/font-e14fed02b1aba7ce.woff +0 -0
- package/dist/browser/assets/font-e99ae51144bf1232.woff2 +0 -0
- package/dist/browser/assets/font-ece03cfd83e22c21.woff +0 -0
- package/dist/browser/assets/font-ed0b74372feefcbb.ttf +0 -0
- package/dist/browser/assets/font-f01f3e87d9c6a61c.ttf +0 -0
- package/dist/browser/assets/font-f1d6ef86f3b11a52.woff +0 -0
- package/dist/browser/assets/font-f36ea897e19f4a2e.ttf +0 -0
- package/dist/browser/assets/font-f9377ab0271cda59.ttf +0 -0
- package/dist/browser/carbon-nMY84Amv.js +53 -0
- package/dist/browser/composite-7VwgfnXx.js +6088 -0
- package/dist/browser/createResourceDialog-ByuJWdSL.js +439 -0
- package/dist/browser/dist-7oZK9QXZ.js +50088 -0
- package/dist/browser/dist-B9OV3YTx.js +881 -0
- package/dist/browser/dist-BLk5M0uK.js +1816 -0
- package/dist/browser/dist-BbyiRq3c.js +3285 -0
- package/dist/browser/dist-CIq6ue3I.js +6646 -0
- package/dist/browser/dist-CLZJNoWB.js +89 -0
- package/dist/browser/dist-CvcmLAMW.js +1620 -0
- package/dist/browser/dist-DL0SDskM.js +2327 -0
- package/dist/browser/dist-Djd02JSy.js +1247 -0
- package/dist/browser/dist-aWSZx4q1.js +850 -0
- package/dist/browser/dist-n-z5HtaO.js +4 -0
- package/dist/browser/dist-o4dBuwiG.js +320 -0
- package/dist/browser/dist-zyY--HOV.js +1543 -0
- package/dist/browser/esm-DXw7EADW.js +218 -0
- package/dist/browser/favicon.svg +7 -0
- package/dist/browser/flowWorkspace-DwVMpcar.js +22092 -0
- package/dist/browser/lib-S4ccuMeT.js +7857 -0
- package/dist/browser/licenses.md +4973 -0
- package/dist/browser/markdownContent-ZZFfSRqO.js +44545 -0
- package/dist/browser/project-change.d.ts +311 -0
- package/dist/browser/project-change.js +259 -0
- package/dist/browser/project-notifications.d.ts +12 -0
- package/dist/browser/rolldown-runtime-CEFd7nDs.js +30 -0
- package/dist/browser/workbench-contract.d.ts +28 -0
- package/dist/browser/workbench.css +2 -0
- package/dist/browser/workbench.css.d.ts +1 -0
- package/dist/browser/workbench.d.ts +14 -0
- package/dist/browser/workbench.js +3364 -0
- package/dist/common/connector-action.d.ts +20 -0
- package/dist/common/connector-action.js +106 -0
- package/dist/common/connector-proxy.d.ts +14 -0
- package/dist/common/connector-proxy.js +0 -0
- package/dist/common/control-api-conformance.d.ts +13 -0
- package/dist/common/control-api-conformance.js +518 -0
- package/dist/common/control-api-errors.d.ts +121 -0
- package/dist/common/control-api.d.ts +349 -0
- package/dist/common/control-api.js +884 -0
- package/dist/common/cron-trigger.d.ts +21 -0
- package/dist/common/cron-trigger.js +834 -0
- package/dist/common/engine-contract.d.ts +7 -0
- package/dist/common/favicon.svg +7 -0
- package/dist/common/integration-trigger.d.ts +111 -0
- package/dist/common/integration-trigger.js +290 -0
- package/dist/common/licenses.md +27 -0
- package/dist/common/poll-trigger.d.ts +69 -0
- package/dist/common/poll-trigger.js +155 -0
- package/dist/common/project-encoding.d.ts +11 -0
- package/dist/common/project-encoding.js +242 -0
- package/dist/common/project-notifications.d.ts +12 -0
- package/dist/common/project-semantics.d.ts +55 -0
- package/dist/common/project-semantics.js +8687 -0
- package/dist/common/provider-triggers.d.ts +6 -0
- package/dist/common/provider-triggers.js +4614 -0
- package/dist/common/run-events.d.ts +9 -0
- package/dist/common/run-events.js +192 -0
- package/dist/common/run-lifecycle.d.ts +69 -0
- package/dist/common/run-lifecycle.js +169 -0
- package/dist/common/runtime-contract.d.ts +53 -0
- package/dist/common/runtime-contract.js +151 -0
- package/dist/common/scheduler.d.ts +99 -0
- package/dist/common/scheduler.js +379 -0
- package/dist/common/webhook-trigger.d.ts +22 -0
- package/dist/common/webhook-trigger.js +270 -0
- package/dist/index.d.ts +66 -0
- package/package.json +102 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
//#region ../../node_modules/dequal/lite/index.mjs
|
|
2
|
+
var e = Object.prototype.hasOwnProperty;
|
|
3
|
+
function t(n, r) {
|
|
4
|
+
var i, a;
|
|
5
|
+
if (n === r) return !0;
|
|
6
|
+
if (n && r && (i = n.constructor) === r.constructor) {
|
|
7
|
+
if (i === Date) return n.getTime() === r.getTime();
|
|
8
|
+
if (i === RegExp) return n.toString() === r.toString();
|
|
9
|
+
if (i === Array) {
|
|
10
|
+
if ((a = n.length) === r.length) for (; a-- && t(n[a], r[a]););
|
|
11
|
+
return a === -1;
|
|
12
|
+
}
|
|
13
|
+
if (!i || typeof n == "object") {
|
|
14
|
+
for (i in a = 0, n) if (e.call(n, i) && ++a && !e.call(r, i) || !(i in r) || !t(n[i], r[i])) return !1;
|
|
15
|
+
return Object.keys(r).length === a;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return n !== n && r !== r;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/control/common/conformance.ts
|
|
22
|
+
var n = "open-flow-engine/v1";
|
|
23
|
+
function r(e) {
|
|
24
|
+
throw Error(e);
|
|
25
|
+
}
|
|
26
|
+
function i(e, n, i) {
|
|
27
|
+
t(e, n) || r(`${i}: expected ${JSON.stringify(n)}, received ${JSON.stringify(e)}.`);
|
|
28
|
+
}
|
|
29
|
+
function a(e, t) {
|
|
30
|
+
return (typeof e != "object" || !e || Array.isArray(e)) && r(`${t}: expected an object.`), e;
|
|
31
|
+
}
|
|
32
|
+
function o(e, t) {
|
|
33
|
+
return Array.isArray(e) || r(`${t}: expected an array.`), e;
|
|
34
|
+
}
|
|
35
|
+
function s(e, t) {
|
|
36
|
+
return (typeof e != "string" || e.length == 0) && r(`${t}: expected a non-empty string.`), e;
|
|
37
|
+
}
|
|
38
|
+
function c(e, t, n) {
|
|
39
|
+
i(Object.keys(e).toSorted(), [...t].toSorted(), `${n} fields`);
|
|
40
|
+
}
|
|
41
|
+
function l(e, t) {
|
|
42
|
+
let n = a(e, t);
|
|
43
|
+
return c(n, [
|
|
44
|
+
"connectionId",
|
|
45
|
+
"displayName",
|
|
46
|
+
"isDefault",
|
|
47
|
+
"serviceId",
|
|
48
|
+
"status"
|
|
49
|
+
], t), s(n.connectionId, `${t} connectionId`), s(n.displayName, `${t} displayName`), s(n.serviceId, `${t} serviceId`), typeof n.isDefault != "boolean" && r(`${t} isDefault: expected a boolean.`), [
|
|
50
|
+
"active",
|
|
51
|
+
"disconnected",
|
|
52
|
+
"error",
|
|
53
|
+
"reauth_required"
|
|
54
|
+
].includes(String(n.status)) || r(`${t} status: invalid status.`), n;
|
|
55
|
+
}
|
|
56
|
+
function u(e, t, n) {
|
|
57
|
+
let i = a(e, n), o = Object.hasOwn(i, "description"), s = t && Object.hasOwn(i, "value");
|
|
58
|
+
c(i, [
|
|
59
|
+
"jsonSchema",
|
|
60
|
+
"nullable",
|
|
61
|
+
...o ? ["description"] : [],
|
|
62
|
+
...s ? ["value"] : []
|
|
63
|
+
], n), typeof i.nullable != "boolean" && r(`${n} nullable: expected a boolean.`), o && typeof i.description != "string" && r(`${n} description: expected a string.`);
|
|
64
|
+
}
|
|
65
|
+
function d(e, t) {
|
|
66
|
+
let n = a(e, t), o = Object.hasOwn(n, "defaultConnection"), d = Object.hasOwn(n, "icon");
|
|
67
|
+
c(n, [
|
|
68
|
+
"actionId",
|
|
69
|
+
...o ? ["defaultConnection"] : [],
|
|
70
|
+
"description",
|
|
71
|
+
...d ? ["icon"] : [],
|
|
72
|
+
"inputs",
|
|
73
|
+
"name",
|
|
74
|
+
"outputs",
|
|
75
|
+
"serviceId",
|
|
76
|
+
"serviceName"
|
|
77
|
+
], t), s(n.actionId, `${t} actionId`), s(n.name, `${t} name`), s(n.serviceId, `${t} serviceId`), s(n.serviceName, `${t} serviceName`), typeof n.description != "string" && r(`${t} description: expected a string.`), d && s(n.icon, `${t} icon`);
|
|
78
|
+
for (let [e, r] of Object.entries(a(n.inputs, `${t} inputs`))) u(r, !0, `${t} input ${e}`);
|
|
79
|
+
for (let [e, r] of Object.entries(a(n.outputs, `${t} outputs`))) u(r, !1, `${t} output ${e}`);
|
|
80
|
+
if (o) {
|
|
81
|
+
let e = l(n.defaultConnection, `${t} default Connection`);
|
|
82
|
+
i(e.serviceId, n.serviceId, `${t} default Connection serviceId`), i(e.status, "active", `${t} default Connection status`);
|
|
83
|
+
}
|
|
84
|
+
return n;
|
|
85
|
+
}
|
|
86
|
+
async function f(e, t, n) {
|
|
87
|
+
return i(e.status, t, `${n} status`), a(await e.json().catch(() => r(`${n} body: expected JSON.`)), `${n} body`);
|
|
88
|
+
}
|
|
89
|
+
async function p(e, t, n, r) {
|
|
90
|
+
let o = await f(e, t, r);
|
|
91
|
+
i(a(o.error, `${r} error`).code, n, `${r} error code`), i(o.version, 1, `${r} version`);
|
|
92
|
+
}
|
|
93
|
+
function m(e, t, n = {}) {
|
|
94
|
+
let r = new Headers(n.headers);
|
|
95
|
+
return n.body != null && !r.has("content-type") && r.set("content-type", "application/json"), e.request(new Request(new URL(t, e.origin), {
|
|
96
|
+
...n,
|
|
97
|
+
headers: r
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
function h(e, t, n) {
|
|
101
|
+
return m(e, "/v1/projects", {
|
|
102
|
+
body: JSON.stringify({
|
|
103
|
+
name: t,
|
|
104
|
+
version: 1
|
|
105
|
+
}),
|
|
106
|
+
headers: { "idempotency-key": n },
|
|
107
|
+
method: "POST"
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async function g(e, t, n) {
|
|
111
|
+
return await f(await h(e, t, n), 201, "Create Project");
|
|
112
|
+
}
|
|
113
|
+
function _(e, t, n, r) {
|
|
114
|
+
return m(e, `/v1/projects/${encodeURIComponent(t)}/draft/changes`, {
|
|
115
|
+
body: JSON.stringify({
|
|
116
|
+
expectedRevisionId: n,
|
|
117
|
+
operations: [{
|
|
118
|
+
flow: {
|
|
119
|
+
graph: { nodes: {} },
|
|
120
|
+
name: "Main"
|
|
121
|
+
},
|
|
122
|
+
flowId: r,
|
|
123
|
+
kind: "flow.create"
|
|
124
|
+
}],
|
|
125
|
+
version: 1
|
|
126
|
+
}),
|
|
127
|
+
method: "POST"
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async function v(e, t, n, r = "main") {
|
|
131
|
+
return await f(await _(e, t, n, r), 200, "Create Flow Revision");
|
|
132
|
+
}
|
|
133
|
+
function y(e, t) {
|
|
134
|
+
return s(a(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
|
|
135
|
+
}
|
|
136
|
+
function b(e, t, n, r) {
|
|
137
|
+
return m(e, `/v1/projects/${encodeURIComponent(t)}/draft/changes`, {
|
|
138
|
+
body: JSON.stringify({
|
|
139
|
+
expectedRevisionId: n,
|
|
140
|
+
operations: r,
|
|
141
|
+
version: 1
|
|
142
|
+
}),
|
|
143
|
+
method: "POST"
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function x(e, t, r, i, a, o) {
|
|
147
|
+
return m(e, `/v1/projects/${encodeURIComponent(t)}/revisions/${encodeURIComponent(r)}/flows/${encodeURIComponent(i)}/publications`, {
|
|
148
|
+
body: JSON.stringify({
|
|
149
|
+
engineContract: n,
|
|
150
|
+
expectedLivePublicationId: a,
|
|
151
|
+
version: 1
|
|
152
|
+
}),
|
|
153
|
+
headers: { "idempotency-key": o },
|
|
154
|
+
method: "POST"
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function S(e, t, n, r, i, a) {
|
|
158
|
+
return m(e, `/v1/projects/${encodeURIComponent(t)}/flows/${encodeURIComponent(n)}/publications/${encodeURIComponent(r)}/rollback`, {
|
|
159
|
+
body: JSON.stringify({
|
|
160
|
+
expectedLivePublicationId: i,
|
|
161
|
+
version: 1
|
|
162
|
+
}),
|
|
163
|
+
headers: { "idempotency-key": a },
|
|
164
|
+
method: "POST"
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function C(e, t, n, r, i = {}) {
|
|
168
|
+
return m(e, `/v1/projects/${encodeURIComponent(t)}/flows/${encodeURIComponent(n)}/runs`, {
|
|
169
|
+
body: JSON.stringify({
|
|
170
|
+
inputs: i,
|
|
171
|
+
version: 1
|
|
172
|
+
}),
|
|
173
|
+
headers: { "idempotency-key": r },
|
|
174
|
+
method: "POST"
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function w(e, t) {
|
|
178
|
+
return s(e.publicationId, `${t} publicationId`);
|
|
179
|
+
}
|
|
180
|
+
var T = [
|
|
181
|
+
{
|
|
182
|
+
name: "creates, replays, lists, reads, and retires a Project",
|
|
183
|
+
async verify(e) {
|
|
184
|
+
let t = await g(e, "Control project", "project-lifecycle"), n = s(t.projectId, "Created Project projectId"), r = s(t.draftRevisionId, "Created Project draftRevisionId");
|
|
185
|
+
i(t.name, "Control project", "Created Project name"), i(t.status, "active", "Created Project status"), i(t.version, 1, "Created Project version"), i(await f(await h(e, "Control project", "project-lifecycle"), 200, "Replay Project"), t, "Replayed Project"), await p(await h(e, "Different project", "project-lifecycle"), 409, "project.conflict", "Conflicting Project"), i(await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read Project"), t, "Read Project");
|
|
186
|
+
let a = await f(await m(e, "/v1/projects?includeTotal=true"), 200, "List Projects");
|
|
187
|
+
i(a.projects, [t], "Listed Projects"), i(a.total, 1, "Project total");
|
|
188
|
+
let o = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft`), 200, "Read initial Draft");
|
|
189
|
+
i(o.revisionId, r, "Initial Draft revisionId"), i(o.projectId, n, "Initial Draft projectId");
|
|
190
|
+
let c = () => m(e, `/v1/projects/${encodeURIComponent(n)}`, { method: "DELETE" }), l = await f(await c(), 202, "Retire Project");
|
|
191
|
+
i(l.status, "retiring", "Retired Project status"), i(l.projectId, n, "Retired Project projectId"), i(await f(await c(), 202, "Replay Project retirement"), l, "Replayed Project retirement"), await p(await _(e, n, r, "rejected"), 409, "project.busy", "Mutation after retirement");
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "commits immutable Draft Revisions and projects the current Flows",
|
|
196
|
+
async verify(e) {
|
|
197
|
+
let t = await g(e, "Draft project", "draft-project"), n = s(t.projectId, "Draft Project projectId"), c = s(t.draftRevisionId, "Draft Project revisionId"), l = await v(e, n, c), u = y(l, "Changed Draft");
|
|
198
|
+
u == c && r("Changed Draft must advance the Revision identity."), i(a(l.revision, "Changed Draft revision").parentRevisionId, c, "Changed Draft parentRevisionId"), await p(await _(e, n, c, "stale"), 412, "project.revision-conflict", "Stale Draft change"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read changed Project")).draftRevisionId, u, "Current Project Draft head"), i(a(a((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/revisions/${encodeURIComponent(c)}`), 200, "Read immutable Revision")).content, "Old Revision content").document, "Old Revision document").flows, {}, "Old Revision Flows");
|
|
199
|
+
let d = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft`), 200, "Read current Draft");
|
|
200
|
+
i(d.revisionId, u, "Current Draft revisionId");
|
|
201
|
+
let h = a(a(d.content, "Current Draft content").document, "Current Draft document").flows;
|
|
202
|
+
i(Object.keys(a(h, "Current Draft Flows")), ["main"], "Current Draft Flow ids");
|
|
203
|
+
let b = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft/sync`), 200, "Sync Draft snapshot");
|
|
204
|
+
i(b.kind, "snapshot", "Draft snapshot kind"), i(a(b.draft, "Draft snapshot").revisionId, u, "Draft snapshot revisionId");
|
|
205
|
+
let x = await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/draft/sync?fromRevisionId=${encodeURIComponent(c)}`), 200, "Sync Draft from parent");
|
|
206
|
+
x.kind == "snapshot" ? i(a(x.draft, "Draft sync snapshot").revisionId, u, "Draft sync snapshot revisionId") : x.kind == "changes" ? i(a(a(o(x.revisions, "Draft sync revisions").at(-1), "Last Draft sync revision").revision, "Last Draft sync revision metadata").revisionId, u, "Last Draft sync revisionId") : r(`Draft sync kind: expected changes or snapshot, received ${JSON.stringify(x.kind)}.`);
|
|
207
|
+
let S = o((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/flows`), 200, "List Draft Flows")).flows, "Projected Flows"), C = a(S[0], "Projected Flow");
|
|
208
|
+
i(S.length, 1, "Projected Flow count"), i(C.flowId, "main", "Projected Flow id"), i(a(C.draft, "Projected Flow Draft").revisionId, u, "Projected Flow Revision");
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "keeps Presentation CAS independent from the Draft head",
|
|
213
|
+
async verify(e) {
|
|
214
|
+
let t = await g(e, "Presentation project", "presentation-project"), n = s(t.projectId, "Presentation Project projectId"), r = s(t.draftRevisionId, "Presentation Project Draft head"), a = `/v1/projects/${encodeURIComponent(n)}/presentation`;
|
|
215
|
+
i((await f(await m(e, a), 200, "Read initial Presentation")).revision, 1, "Initial Presentation revision");
|
|
216
|
+
let o = { nodes: { task: {
|
|
217
|
+
x: 120,
|
|
218
|
+
y: 80
|
|
219
|
+
} } }, c = await f(await m(e, a, {
|
|
220
|
+
body: JSON.stringify({
|
|
221
|
+
expectedRevision: 1,
|
|
222
|
+
value: o,
|
|
223
|
+
version: 1
|
|
224
|
+
}),
|
|
225
|
+
method: "PUT"
|
|
226
|
+
}), 200, "Update Presentation");
|
|
227
|
+
i(c.revision, 2, "Updated Presentation revision"), i(c.value, o, "Updated Presentation value"), i(await f(await m(e, a), 200, "Read updated Presentation"), c, "Persisted Presentation"), await p(await m(e, a, {
|
|
228
|
+
body: JSON.stringify({
|
|
229
|
+
expectedRevision: 1,
|
|
230
|
+
value: {},
|
|
231
|
+
version: 1
|
|
232
|
+
}),
|
|
233
|
+
method: "PUT"
|
|
234
|
+
}), 412, "project.presentation-conflict", "Stale Presentation update"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read Presentation Project")).draftRevisionId, r, "Draft head after Presentation update");
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "validates one Flow from a fixed ProjectRevision",
|
|
239
|
+
async verify(e) {
|
|
240
|
+
let t = await g(e, "Validation project", "validation-project"), r = s(t.projectId, "Validation Project projectId"), o = await v(e, r, s(t.draftRevisionId, "Validation Project Draft head")), c = y(o, "Validation Revision"), l = a(o.revision, "Validation Revision"), u = `/v1/projects/${encodeURIComponent(r)}/revisions/${encodeURIComponent(c)}/flows`, d = await f(await m(e, `${u}/main/check`, {
|
|
241
|
+
body: JSON.stringify({
|
|
242
|
+
engineContract: n,
|
|
243
|
+
version: 1
|
|
244
|
+
}),
|
|
245
|
+
method: "POST"
|
|
246
|
+
}), 200, "Check Flow");
|
|
247
|
+
i(d.projectId, r, "Flow check projectId"), i(d.revisionId, c, "Flow check revisionId"), i(d.revisionDigest, l.digest, "Flow check revision digest"), i(d.flowId, "main", "Flow check flowId"), i(d.engineContract, n, "Flow check Engine Contract"), i(d.modelVersion, 1, "Flow check model version"), i(d.valid, !0, "Flow check validity"), s(d.closureDigest, "Flow check closure digest"), await p(await m(e, `${u}/missing/check`, {
|
|
248
|
+
body: JSON.stringify({
|
|
249
|
+
engineContract: n,
|
|
250
|
+
version: 1
|
|
251
|
+
}),
|
|
252
|
+
method: "POST"
|
|
253
|
+
}), 404, "flow.not-found", "Missing Flow check");
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "admits, observes, and cancels one fixed Draft Run",
|
|
258
|
+
async verify(e) {
|
|
259
|
+
let t = await g(e, "Run project", "run-project"), r = s(t.projectId, "Run Project projectId"), c = y(await v(e, r, s(t.draftRevisionId, "Run Project Draft head")), "Run Revision"), l = `/v1/projects/${encodeURIComponent(r)}/revisions/${encodeURIComponent(c)}/flows/main/runs`, u = () => m(e, l, {
|
|
260
|
+
body: JSON.stringify({
|
|
261
|
+
engineContract: n,
|
|
262
|
+
inputs: {},
|
|
263
|
+
version: 1
|
|
264
|
+
}),
|
|
265
|
+
headers: { "idempotency-key": "draft-run" },
|
|
266
|
+
method: "POST"
|
|
267
|
+
}), d = await f(await u(), 202, "Create Draft Run"), h = s(d.runId, "Draft Run runId");
|
|
268
|
+
i(d.projectId, r, "Draft Run projectId"), i(d.revisionId, c, "Draft Run revisionId"), i(d.flowId, "main", "Draft Run flowId"), i(d.source, "draft", "Draft Run source"), i(d.status, "queued", "Draft Run status"), i(await f(await u(), 200, "Replay Draft Run"), d, "Replayed Draft Run");
|
|
269
|
+
let _ = `/v1/projects/${encodeURIComponent(r)}/runs/${encodeURIComponent(h)}`;
|
|
270
|
+
i(await f(await m(e, _), 200, "Read Draft Run"), d, "Read Draft Run");
|
|
271
|
+
let b = await f(await m(e, `/v1/projects/${encodeURIComponent(r)}/runs`), 200, "List Draft Runs");
|
|
272
|
+
i(b.projectId, r, "Run list projectId"), i(o(b.runs, "Listed Runs").map((e) => a(e, "Listed Run").runId), [h], "Listed Run ids");
|
|
273
|
+
let x = await f(await m(e, `${_}/events`), 200, "Read queued Run events"), [S] = o(x.events, "Queued Run events");
|
|
274
|
+
i(a(S, "Queued Run event").kind, "run.queued", "Queued Run event kind"), i(x.done, !1, "Queued Run events done"), await p(await m(e, `${_}/result`), 409, "run.not-terminal", "Read pending Run result");
|
|
275
|
+
let C = await g(e, "Other project", "other-run-project");
|
|
276
|
+
await p(await m(e, `/v1/projects/${encodeURIComponent(s(C.projectId, "Other Project projectId"))}/runs/${encodeURIComponent(h)}`), 404, "run.not-found", "Read Run through another Project");
|
|
277
|
+
let w = () => m(e, `${_}/cancel`, {
|
|
278
|
+
body: JSON.stringify({ version: 1 }),
|
|
279
|
+
method: "POST"
|
|
280
|
+
});
|
|
281
|
+
i(await f(await w(), 200, "Cancel Draft Run"), {
|
|
282
|
+
cancelAccepted: !0,
|
|
283
|
+
runId: h,
|
|
284
|
+
status: "canceled",
|
|
285
|
+
version: 1
|
|
286
|
+
}, "Canceled Draft Run");
|
|
287
|
+
let T = await f(await m(e, `${_}/result`), 200, "Read canceled Run result");
|
|
288
|
+
i(T.runId, h, "Canceled Run result runId"), i(T.status, "canceled", "Canceled Run result status"), s(T.finishedAt, "Canceled Run result finishedAt");
|
|
289
|
+
let E = await f(await m(e, `${_}/events?after=1`), 200, "Read terminal Run events"), [D] = o(E.events, "Terminal Run events");
|
|
290
|
+
i(a(D, "Terminal Run event").kind, "run.canceled", "Terminal Run event kind"), i(E.done, !0, "Terminal Run events done"), i(await f(await w(), 200, "Replay Run cancellation"), {
|
|
291
|
+
cancelAccepted: !1,
|
|
292
|
+
runId: h,
|
|
293
|
+
status: "canceled",
|
|
294
|
+
version: 1
|
|
295
|
+
}, "Replayed cancellation");
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
], E = [
|
|
299
|
+
{
|
|
300
|
+
name: "publishes one immutable Flow with idempotent Live CAS",
|
|
301
|
+
async verify(e) {
|
|
302
|
+
let t = await g(e, "Publication project", "publication-project"), r = s(t.projectId, "Publication Project projectId"), c = a((await v(e, r, s(t.draftRevisionId, "Publication Project Draft head"))).revision, "Publication Revision"), l = s(c.revisionId, "Publication Revision revisionId"), u = `/v1/projects/${encodeURIComponent(r)}/flows/main`, d = await f(await m(e, `${u}/live`), 200, "Read unpublished Live");
|
|
303
|
+
i(d.projectId, r, "Unpublished Live projectId"), i(d.flowId, "main", "Unpublished Live flowId"), i(d.publication, null, "Unpublished Live Publication"), i(d.revision, 0, "Unpublished Live revision"), i(d.status, "not-published", "Unpublished Live status"), i(d.hasUnpublishedChanges, !0, "Unpublished Live Draft state"), await p(await C(e, r, "main", "missing-live-run"), 404, "live.not-found", "Run unpublished Live");
|
|
304
|
+
let h = () => x(e, r, l, "main", null, "publication-first"), _ = await f(await h(), 201, "Publish Flow"), y = w(_, "Published Flow");
|
|
305
|
+
i(_.projectId, r, "Publication projectId"), i(_.flowId, "main", "Publication flowId"), i(_.revisionId, l, "Publication revisionId"), i(_.revisionDigest, c.digest, "Publication revision digest"), i(_.engineContract, n, "Publication Engine Contract"), i(_.modelVersion, 1, "Publication model version"), i(_.operation, "publish", "Publication operation"), i(_.sourcePublicationId, void 0, "Publication source"), i(_.version, 1, "Publication version"), s(_.actorId, "Publication actorId"), s(_.closureDigest, "Publication closure digest"), s(_.createdAt, "Publication createdAt"), i(await f(await h(), 200, "Replay Publish"), _, "Replayed Publication"), await p(await x(e, r, l, "main", y, "publication-first"), 409, "publication.conflict", "Conflicting Publish replay"), await p(await x(e, r, l, "main", null, "publication-stale-live"), 412, "live.conflict", "Stale Publish Live precondition");
|
|
306
|
+
let b = await f(await m(e, `${u}/live`), 200, "Read published Live");
|
|
307
|
+
i(b.publication, _, "Live Publication"), i(b.revision, 1, "Published Live revision"), i(b.status, "runnable", "Published Live status"), i(b.hasUnpublishedChanges, !1, "Published Live Draft state");
|
|
308
|
+
let [S] = o((await f(await m(e, `/v1/projects/${encodeURIComponent(r)}/flows`), 200, "List published Flows")).flows, "Published Flow projection"), T = a(S, "Published Flow");
|
|
309
|
+
i(a(a(T.live, "Published Flow Live").publication, "Published Flow Publication"), _, "Projected Publication"), i(a(T.live, "Published Flow Live").revision, 1, "Projected Live revision"), i(T.hasUnpublishedChanges, !1, "Projected unpublished state");
|
|
310
|
+
let E = await f(await m(e, `${u}/publications?includeTotal=true`), 200, "List Publication history");
|
|
311
|
+
i(E.publications, [_], "Publication history"), i(E.total, 1, "Publication history total");
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "rolls back immutable history and fixes a Live Run target",
|
|
316
|
+
async verify(e) {
|
|
317
|
+
let t = await g(e, "Rollback project", "rollback-project"), n = s(t.projectId, "Rollback Project projectId"), a = y(await v(e, n, s(t.draftRevisionId, "Rollback Project Draft head")), "First Rollback Revision"), o = await f(await x(e, n, a, "main", null, "rollback-publish-first"), 201, "Publish first Rollback Revision"), c = w(o, "First Rollback Publication"), l = y(await f(await b(e, n, a, [{
|
|
318
|
+
kind: "graph.node.create",
|
|
319
|
+
node: {
|
|
320
|
+
concurrency: 1,
|
|
321
|
+
inputs: {},
|
|
322
|
+
kind: "value",
|
|
323
|
+
values: { ready: {
|
|
324
|
+
jsonSchema: { type: "boolean" },
|
|
325
|
+
nullable: !1,
|
|
326
|
+
value: !0
|
|
327
|
+
} }
|
|
328
|
+
},
|
|
329
|
+
nodeId: "marker",
|
|
330
|
+
target: {
|
|
331
|
+
id: "main",
|
|
332
|
+
kind: "flow"
|
|
333
|
+
}
|
|
334
|
+
}]), 200, "Create second Rollback Revision"), "Second Rollback Revision"), u = await f(await x(e, n, l, "main", c, "rollback-publish-second"), 201, "Publish second Rollback Revision"), d = w(u, "Second Rollback Publication"), h = () => S(e, n, "main", c, d, "rollback-first"), _ = await f(await h(), 201, "Rollback Flow"), T = w(_, "Rollback Publication");
|
|
335
|
+
(T == c || T == d) && r("Rollback must create a new Publication identity."), i(_.operation, "rollback", "Rollback operation"), i(_.sourcePublicationId, c, "Rollback source Publication"), i(_.revisionId, o.revisionId, "Rollback fixed Revision"), i(_.revisionDigest, o.revisionDigest, "Rollback fixed Revision digest"), i(_.closureDigest, o.closureDigest, "Rollback fixed closure digest"), i(_.engineContract, o.engineContract, "Rollback fixed Engine Contract"), i(await f(await h(), 200, "Replay Rollback"), _, "Replayed Rollback"), await p(await S(e, n, "main", c, T, "rollback-first"), 409, "publication.conflict", "Conflicting Rollback replay");
|
|
336
|
+
let E = `/v1/projects/${encodeURIComponent(n)}/flows/main`, D = await f(await m(e, `${E}/live`), 200, "Read rolled back Live");
|
|
337
|
+
i(D.publication, _, "Rolled back Live Publication"), i(D.revision, 3, "Rolled back Live revision"), i(D.hasUnpublishedChanges, !0, "Rolled back Live Draft state"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}`), 200, "Read Rollback Project")).draftRevisionId, l, "Draft head after Rollback");
|
|
338
|
+
let O = await f(await m(e, `${E}/publications?includeTotal=true&limit=2`), 200, "List first Publication page");
|
|
339
|
+
i(O.publications, [_, u], "First Publication page"), i(O.total, 3, "Publication page total");
|
|
340
|
+
let k = s(O.nextCursor, "Publication next cursor"), A = await f(await m(e, `${E}/publications?cursor=${encodeURIComponent(k)}&limit=2`), 200, "List second Publication page");
|
|
341
|
+
i(A.publications, [o], "Second Publication page"), i(A.nextCursor, void 0, "Final Publication cursor");
|
|
342
|
+
let j = () => C(e, n, "main", "rollback-live-run"), M = await f(await j(), 202, "Create rolled back Live Run"), N = s(M.runId, "Rolled back Live Run runId");
|
|
343
|
+
i(M.projectId, n, "Live Run projectId"), i(M.flowId, "main", "Live Run flowId"), i(M.publicationId, T, "Live Run Publication"), i(M.revisionId, a, "Live Run fixed Revision"), i(M.source, "live", "Live Run source"), i(M.status, "queued", "Live Run status"), i(await f(await j(), 200, "Replay Live Run"), M, "Replayed Live Run"), await p(await C(e, n, "main", "rollback-live-run", { changed: {} }), 409, "run.conflict", "Conflicting Live Run replay"), await f(await x(e, n, l, "main", T, "rollback-publish-current"), 201, "Move Live after Run admission"), i(await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/runs/${encodeURIComponent(N)}`), 200, "Read fixed Live Run"), M, "Live Run after Live moved");
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: "retires Live when its Flow or Project is retired",
|
|
348
|
+
async verify(e) {
|
|
349
|
+
let t = await g(e, "Deleted Flow project", "deleted-flow-project"), n = s(t.projectId, "Deleted Flow Project projectId"), r = y(await v(e, n, s(t.draftRevisionId, "Deleted Flow Project Draft head")), "Deleted Flow Revision"), a = await f(await x(e, n, r, "main", null, "deleted-flow-publish"), 201, "Publish deleted Flow");
|
|
350
|
+
await f(await b(e, n, r, [{
|
|
351
|
+
flowId: "main",
|
|
352
|
+
kind: "flow.delete"
|
|
353
|
+
}]), 200, "Delete published Flow");
|
|
354
|
+
let o = `/v1/projects/${encodeURIComponent(n)}/flows/main`, c = await f(await m(e, `${o}/live`), 200, "Read deleted Flow Live");
|
|
355
|
+
i(c.publication, null, "Deleted Flow Live Publication"), i(c.revision, 0, "Deleted Flow Live revision"), i(c.status, "not-published", "Deleted Flow Live status"), i(c.hasUnpublishedChanges, !1, "Deleted Flow unpublished state"), i((await f(await m(e, `/v1/projects/${encodeURIComponent(n)}/flows`), 200, "List deleted Flows")).flows, [], "Deleted Flow projection");
|
|
356
|
+
let l = await f(await m(e, `${o}/publications?includeTotal=true`), 200, "List deleted Flow history");
|
|
357
|
+
i(l.publications, [a], "Deleted Flow Publication history"), i(l.total, 1, "Deleted Flow Publication total"), await p(await C(e, n, "main", "deleted-flow-run"), 404, "live.not-found", "Run deleted Flow Live");
|
|
358
|
+
let u = await g(e, "Retired Live project", "retired-live-project"), d = s(u.projectId, "Retired Live Project projectId"), h = y(await v(e, d, s(u.draftRevisionId, "Retired Live Project Draft head")), "Retired Live Revision"), _ = await f(await x(e, d, h, "main", null, "retired-live-publish"), 201, "Publish retiring Project Flow"), T = w(_, "Retired Live Publication");
|
|
359
|
+
await f(await m(e, `/v1/projects/${encodeURIComponent(d)}`, { method: "DELETE" }), 202, "Retire Live Project");
|
|
360
|
+
let E = `/v1/projects/${encodeURIComponent(d)}/flows/main`, D = await f(await m(e, `${E}/live`), 200, "Read retired Project Live");
|
|
361
|
+
i(D.publication, null, "Retired Project Live Publication"), i(D.revision, 0, "Retired Project Live revision"), i(D.status, "not-published", "Retired Project Live status");
|
|
362
|
+
let O = await f(await m(e, `${E}/publications?includeTotal=true`), 200, "List retired Publication history");
|
|
363
|
+
i(O.publications, [_], "Retired Publication history"), i(O.total, 1, "Retired Publication total"), await p(await C(e, d, "main", "retired-live-run"), 409, "project.busy", "Run retired Live"), await p(await x(e, d, h, "main", null, "retired-live-republish"), 409, "project.busy", "Publish retired Project"), await p(await S(e, d, "main", T, T, "retired-live-rollback"), 409, "project.busy", "Rollback retired Project");
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
], D = [{
|
|
367
|
+
name: "exposes one deployment-scoped Trigger Key catalog",
|
|
368
|
+
async verify(e) {
|
|
369
|
+
let t = await f(await m(e, "/v1/trigger-keys"), 200, "List Trigger Keys"), n = await f(await m(e, "/v1/trigger-keys/catalog"), 200, "List Trigger definitions"), c = o(t.keys, "Trigger Key summaries").map((e) => a(e, "Trigger Key summary")), l = o(n.definitions, "Trigger definitions").map((e) => a(e, "Trigger definition"));
|
|
370
|
+
i(t.version, 1, "Trigger Key summaries version"), i(n.version, 1, "Trigger definitions version"), i(c.map((e) => s(e.key, "Trigger Key summary key")), l.map((e) => s(e.key, "Trigger definition key")), "Trigger catalog identities");
|
|
371
|
+
for (let [t, n] of c.entries()) {
|
|
372
|
+
let a = l[t], o = n.type;
|
|
373
|
+
o != "integration" && o != "poll" && r(`Trigger Key summary type: expected integration or poll, received ${JSON.stringify(o)}.`), i(a.type, o, "Trigger definition type"), typeof n.description != "string" && r(`Trigger Key summary description: expected string, received ${JSON.stringify(n.description)}.`), s(n.displayName, "Trigger Key summary displayName"), s(n.name, "Trigger Key summary name"), s(n.provider, "Trigger Key summary provider");
|
|
374
|
+
let c = s(n.key, "Trigger Key summary key"), u = await f(await m(e, `/v1/trigger-keys/${encodeURIComponent(c)}`), 200, "Read Trigger Key");
|
|
375
|
+
i(u.definition, a, "Trigger Key detail"), i(u.version, 1, "Trigger Key detail version");
|
|
376
|
+
}
|
|
377
|
+
await p(await m(e, "/v1/trigger-keys/conformance.missing"), 404, "trigger-key.not-found", "Read missing Trigger Key");
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
name: "operates and retires one Live Trigger binding without creating another execution history",
|
|
381
|
+
async verify(e) {
|
|
382
|
+
let t = await g(e, "Trigger project", "trigger-project"), n = s(t.projectId, "Trigger Project projectId"), r = y(await f(await b(e, n, s(t.draftRevisionId, "Trigger Project Draft head"), [{
|
|
383
|
+
flow: {
|
|
384
|
+
graph: { nodes: {
|
|
385
|
+
cron: {
|
|
386
|
+
cronTimes: [{
|
|
387
|
+
type: "every",
|
|
388
|
+
unit: "hour",
|
|
389
|
+
value: 1
|
|
390
|
+
}],
|
|
391
|
+
kind: "cron",
|
|
392
|
+
name: "Scheduled"
|
|
393
|
+
},
|
|
394
|
+
webhook: {
|
|
395
|
+
inputsDef: [],
|
|
396
|
+
kind: "webhook",
|
|
397
|
+
name: "Incoming"
|
|
398
|
+
}
|
|
399
|
+
} },
|
|
400
|
+
name: "Triggered"
|
|
401
|
+
},
|
|
402
|
+
flowId: "main",
|
|
403
|
+
kind: "flow.create"
|
|
404
|
+
}]), 200, "Create Trigger Flow"), "Trigger Revision"), c = w(await f(await x(e, n, r, "main", null, "trigger-publication-1"), 201, "Publish Trigger Flow"), "First Trigger Publication"), l = `/v1/projects/${encodeURIComponent(n)}/flows/main/triggers`, u = await f(await m(e, l), 200, "List Trigger bindings");
|
|
405
|
+
i(u.projectId, n, "Trigger binding list projectId"), i(u.flowId, "main", "Trigger binding list flowId"), i(u.version, 1, "Trigger binding list version");
|
|
406
|
+
let d = o(u.bindings, "Trigger bindings").map((e) => a(e, "Trigger binding"));
|
|
407
|
+
i(d.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
|
|
408
|
+
for (let e of d) i(e.currentPublicationId, c, "Trigger binding current Publication"), i(e.currentRevisionId, r, "Trigger binding current Revision"), i(e.operatorState, "active", "Trigger binding operator state"), i(e.health, "healthy", "Trigger binding health"), i(e.runtimeVersion, 1, "Initial Trigger runtime version"), i(e.endpointUrl, void 0, "Trigger list endpoint URL"), i(e.version, 1, "Trigger binding version"), s(e.updatedAt, "Trigger binding updatedAt");
|
|
409
|
+
let h = `${l}/webhook`, _ = await f(await m(e, h), 200, "Read Webhook binding"), v = a(_.binding, "Webhook binding detail"), S = s(v.endpointUrl, "Webhook endpoint URL");
|
|
410
|
+
i(v.kind, "webhook", "Webhook binding kind"), i(_.version, 1, "Webhook binding detail version"), i(a((await f(await m(e, `${l}/cron`), 200, "Read Cron binding")).binding, "Cron binding detail").endpointUrl, void 0, "Cron endpoint URL");
|
|
411
|
+
let C = (t) => m(e, `${h}/${t}`, {
|
|
412
|
+
body: JSON.stringify({ version: 1 }),
|
|
413
|
+
method: "POST"
|
|
414
|
+
}), T = await f(await C("pause"), 200, "Pause Webhook binding");
|
|
415
|
+
i(T.operatorState, "paused", "Paused Webhook operator state"), i(T.runtimeVersion, 2, "Paused Webhook runtime version"), i(await f(await C("pause"), 200, "Replay Webhook pause"), T, "Replayed Webhook pause"), i((await e.request(new Request(S, { method: "POST" }))).status, 404, "Paused Webhook callback status");
|
|
416
|
+
let E = w(await f(await x(e, n, r, "main", c, "trigger-publication-2"), 201, "Republish paused Trigger Flow"), "Second Trigger Publication"), D = a((await f(await m(e, h), 200, "Read paused republished binding")).binding, "Paused binding");
|
|
417
|
+
i(D.currentPublicationId, E, "Paused binding current Publication"), i(D.operatorState, "paused", "Paused binding state after Publish"), i(D.runtimeVersion, 3, "Paused binding runtime after Publish"), i((await e.request(new Request(S, { method: "POST" }))).status, 404, "Republished paused Webhook callback status");
|
|
418
|
+
let O = await f(await C("resume"), 200, "Resume Webhook binding");
|
|
419
|
+
i(O.operatorState, "active", "Resumed Webhook operator state"), i(O.runtimeVersion, 4, "Resumed Webhook runtime version"), i((await e.request(new Request(S, { method: "POST" }))).status, 200, "Resumed Webhook callback status"), await p(await m(e, `${h}/test`, {
|
|
420
|
+
body: JSON.stringify({ version: 1 }),
|
|
421
|
+
method: "POST"
|
|
422
|
+
}), 404, "trigger.not-found", "Test non-Poll binding");
|
|
423
|
+
let k = await f(await m(e, `${h}/activities?limit=1`), 200, "List first Trigger Activity"), A = a(o(k.activities, "First Trigger Activity page")[0], "First Trigger Activity");
|
|
424
|
+
i(A.kind, "operator.resumed", "First Trigger Activity kind"), s(A.activityId, "First Trigger Activity id"), s(A.createdAt, "First Trigger Activity createdAt");
|
|
425
|
+
let j = s(k.nextCursor, "First Trigger Activity cursor"), M = await f(await m(e, `${h}/activities?cursor=${encodeURIComponent(j)}&limit=1`), 200, "List second Trigger Activity");
|
|
426
|
+
i(a(o(M.activities, "Second Trigger Activity page")[0], "Second Trigger Activity").kind, "operator.paused", "Second Trigger Activity kind"), i(M.nextCursor, void 0, "Last Trigger Activity cursor"), await p(await m(e, `${l}/cron/activities?cursor=${encodeURIComponent(j)}`), 400, "page.invalid-cursor", "Cross-binding Trigger Activity cursor"), await f(await x(e, n, y(await f(await b(e, n, r, [{
|
|
427
|
+
kind: "graph.node.delete",
|
|
428
|
+
nodeId: "webhook",
|
|
429
|
+
target: {
|
|
430
|
+
id: "main",
|
|
431
|
+
kind: "flow"
|
|
432
|
+
}
|
|
433
|
+
}]), 200, "Delete Webhook Trigger"), "Retired Trigger Revision"), "main", E, "trigger-publication-3"), 201, "Publish retired Webhook Trigger");
|
|
434
|
+
let N = a((await f(await m(e, h), 200, "Read retired Webhook binding")).binding, "Retired Webhook binding");
|
|
435
|
+
i(N.currentPublicationId, void 0, "Retired Webhook current Publication"), i(N.currentRevisionId, void 0, "Retired Webhook current Revision"), i(N.endpointUrl, void 0, "Retired Webhook endpoint URL"), i((await e.request(new Request(S, { method: "POST" }))).status, 404, "Retired Webhook callback status"), await p(await C("pause"), 404, "trigger.not-found", "Pause retired Webhook binding"), i(o((await f(await m(e, `${h}/activities`), 200, "Read retired Trigger Activities")).activities, "Retired Trigger Activities").length, 2, "Retired Trigger Activity count");
|
|
436
|
+
}
|
|
437
|
+
}], O = [{
|
|
438
|
+
name: "projects one Connector catalog and its authorized Connections",
|
|
439
|
+
async verify(e) {
|
|
440
|
+
let t = s((await g(e, "Connector project", "connector-project")).projectId, "Connector Project projectId"), n = `/v1/projects/${encodeURIComponent(t)}/connector`, u = await f(await m(e, `${n}/providers`), 200, "List Connector Providers");
|
|
441
|
+
c(u, [
|
|
442
|
+
"projectId",
|
|
443
|
+
"providers",
|
|
444
|
+
"version"
|
|
445
|
+
], "Connector Provider page"), i(u.projectId, t, "Connector Provider page projectId"), i(u.version, 1, "Connector Provider page version");
|
|
446
|
+
let p = o(u.providers, "Connector Providers").map((e, t) => {
|
|
447
|
+
let n = a(e, `Connector Provider ${t}`), r = Object.hasOwn(n, "icon");
|
|
448
|
+
return c(n, [
|
|
449
|
+
"serviceId",
|
|
450
|
+
"serviceName",
|
|
451
|
+
...r ? ["icon"] : []
|
|
452
|
+
], `Connector Provider ${t}`), s(n.serviceId, `Connector Provider ${t} serviceId`), s(n.serviceName, `Connector Provider ${t} serviceName`), r && s(n.icon, `Connector Provider ${t} icon`), n;
|
|
453
|
+
});
|
|
454
|
+
p.length == 0 && r("Connector conformance deployment must expose at least one Provider.");
|
|
455
|
+
let h = await f(await m(e, `${n}/actions`), 200, "List all Connector Actions");
|
|
456
|
+
c(h, [
|
|
457
|
+
"actions",
|
|
458
|
+
"projectId",
|
|
459
|
+
"version"
|
|
460
|
+
], "Complete Connector Action page"), i(h.projectId, t, "Complete Connector Action page projectId"), i(h.version, 1, "Complete Connector Action page version");
|
|
461
|
+
let _ = o(h.actions, "Complete Connector Actions").map((e, t) => d(e, `Complete Connector Action ${t}`));
|
|
462
|
+
_.length == 0 && r("Connector conformance deployment must expose at least one Action.");
|
|
463
|
+
let v = _[0], y = s(v.serviceId, "Selected Connector Action serviceId");
|
|
464
|
+
p.some((e) => e.serviceId == y) || r("Selected Connector Action must refer to a listed Provider.");
|
|
465
|
+
let b = await f(await m(e, `${n}/actions?service=${encodeURIComponent(y)}`), 200, "List Provider Connector Actions");
|
|
466
|
+
c(b, [
|
|
467
|
+
"actions",
|
|
468
|
+
"projectId",
|
|
469
|
+
"version"
|
|
470
|
+
], "Provider Connector Action page"), i(b.projectId, t, "Provider Connector Action page projectId"), i(b.version, 1, "Provider Connector Action page version"), o(b.actions, "Provider Connector Actions").map((e, t) => d(e, `Provider Connector Action ${t}`)).some((e) => e.actionId == v.actionId) || r("Provider Action list must include the selected Action.");
|
|
471
|
+
let x = s(v.name, "Selected Connector Action name"), S = await f(await m(e, `${n}/actions?q=${encodeURIComponent(x)}`), 200, "Search Connector Actions");
|
|
472
|
+
c(S, [
|
|
473
|
+
"actions",
|
|
474
|
+
"projectId",
|
|
475
|
+
"version"
|
|
476
|
+
], "Searched Connector Action page"), i(S.projectId, t, "Searched Connector Action page projectId"), i(S.version, 1, "Searched Connector Action page version"), o(S.actions, "Searched Connector Actions").map((e, t) => d(e, `Searched Connector Action ${t}`)).some((e) => e.actionId == v.actionId) || r("Connector Action search must include an exact name match.");
|
|
477
|
+
let C = s(v.actionId, "Selected Connector Action actionId"), w = await f(await m(e, `${n}/actions/${encodeURIComponent(C)}`), 200, "Read Connector Action");
|
|
478
|
+
c(w, [
|
|
479
|
+
"action",
|
|
480
|
+
"projectId",
|
|
481
|
+
"version"
|
|
482
|
+
], "Connector Action detail"), i(d(w.action, "Connector Action detail Action"), v, "Connector Action detail"), i(w.projectId, t, "Connector Action detail projectId"), i(w.version, 1, "Connector Action detail version");
|
|
483
|
+
let T = await f(await m(e, `${n}/connections/${encodeURIComponent(y)}`), 200, "List Connector Connections");
|
|
484
|
+
c(T, [
|
|
485
|
+
"connections",
|
|
486
|
+
"projectId",
|
|
487
|
+
"serviceId",
|
|
488
|
+
"version"
|
|
489
|
+
], "Connector Connection page"), i(T.projectId, t, "Connector Connection page projectId"), i(T.serviceId, y, "Connector Connection page serviceId"), i(T.version, 1, "Connector Connection page version");
|
|
490
|
+
let E = o(T.connections, "Connector Connections").map((e, t) => l(e, `Connector Connection ${t}`)), D = Object.hasOwn(v, "defaultConnection") ? l(v.defaultConnection, "Selected Connector Action default Connection") : void 0;
|
|
491
|
+
D != null && !E.some((e) => e.connectionId == D.connectionId) && r("Connector Action default Connection must be present in the service Connection list.");
|
|
492
|
+
let O = await f(await m(e, `${n}/connections/${encodeURIComponent(y)}/page`, {
|
|
493
|
+
body: JSON.stringify({
|
|
494
|
+
returnUrl: "https://workbench.example/projects/connector",
|
|
495
|
+
version: 1
|
|
496
|
+
}),
|
|
497
|
+
method: "POST"
|
|
498
|
+
}), 200, "Create Connector Connection page");
|
|
499
|
+
c(O, ["url", "version"], "Connector Connection external page");
|
|
500
|
+
let k = new URL(s(O.url, "Connector Connection external page URL"));
|
|
501
|
+
k.protocol != "http:" && k.protocol != "https:" && r("Connector Connection external page URL must use HTTP."), i(O.version, 1, "Connector Connection external page version");
|
|
502
|
+
}
|
|
503
|
+
}, {
|
|
504
|
+
name: "rejects invalid or out-of-scope Connector discovery requests",
|
|
505
|
+
async verify(e) {
|
|
506
|
+
let t = s((await g(e, "Connector validation", "connector-validation")).projectId, "Connector validation Project projectId"), n = `/v1/projects/${encodeURIComponent(t)}/connector`;
|
|
507
|
+
await p(await m(e, `${n}/actions?service=mail&q=send`), 400, "project.invalid", "Conflicting Connector Action query"), await p(await m(e, `${n}/actions?q=%20%20`), 400, "project.invalid", "Empty Connector Action query"), await p(await m(e, `${n}/actions?q=${"a".repeat(257)}`), 400, "project.invalid", "Oversized Connector Action query"), await p(await m(e, `${n}/connections/${"a".repeat(257)}`), 400, "project.invalid", "Oversized Connector service"), await p(await m(e, `${n}/connections/mail/page`, {
|
|
508
|
+
body: JSON.stringify({
|
|
509
|
+
extra: !0,
|
|
510
|
+
returnUrl: "https://workbench.example",
|
|
511
|
+
version: 1
|
|
512
|
+
}),
|
|
513
|
+
method: "POST"
|
|
514
|
+
}), 400, "project.invalid", "Malformed Connector Connection page"), await p(await m(e, "/v1/projects/00000000-0000-7000-8000-000000000000/connector/providers"), 404, "project.not-found", "Out-of-scope Connector Project"), await p(await m(e, `${n}/actions/conformance.missing`), 404, "connector.action-not-found", "Missing Connector Action");
|
|
515
|
+
}
|
|
516
|
+
}];
|
|
517
|
+
//#endregion
|
|
518
|
+
export { O as connectorControlApiConformanceCases, T as controlApiConformanceCases, E as publicationControlApiConformanceCases, D as triggerControlApiConformanceCases };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export declare const controlErrorCode: {
|
|
2
|
+
readonly authenticationRequired: 'authentication.required';
|
|
3
|
+
readonly authorizationDenied: 'authorization.denied';
|
|
4
|
+
readonly bindingUnresolved: 'binding.unresolved';
|
|
5
|
+
readonly connectorActionNotFound: 'connector.action-not-found';
|
|
6
|
+
readonly connectorUnavailable: 'connector.unavailable';
|
|
7
|
+
readonly engineUnavailable: 'engine.unavailable';
|
|
8
|
+
readonly engineUnsupported: 'engine.unsupported';
|
|
9
|
+
readonly flowInvalid: 'flow.invalid';
|
|
10
|
+
readonly flowNotFound: 'flow.not-found';
|
|
11
|
+
readonly liveConflict: 'live.conflict';
|
|
12
|
+
readonly liveNotFound: 'live.not-found';
|
|
13
|
+
readonly pageInvalidCursor: 'page.invalid-cursor';
|
|
14
|
+
readonly projectBusy: 'project.busy';
|
|
15
|
+
readonly projectConflict: 'project.conflict';
|
|
16
|
+
readonly projectInvalid: 'project.invalid';
|
|
17
|
+
readonly projectNotFound: 'project.not-found';
|
|
18
|
+
readonly projectPresentationConflict: 'project.presentation-conflict';
|
|
19
|
+
readonly projectRevisionConflict: 'project.revision-conflict';
|
|
20
|
+
readonly publicationConflict: 'publication.conflict';
|
|
21
|
+
readonly publicationNotFound: 'publication.not-found';
|
|
22
|
+
readonly routeNotFound: 'route.not-found';
|
|
23
|
+
readonly runConflict: 'run.conflict';
|
|
24
|
+
readonly runEventsExpired: 'run.events-expired';
|
|
25
|
+
readonly runInvalid: 'run.invalid';
|
|
26
|
+
readonly runNotFound: 'run.not-found';
|
|
27
|
+
readonly runNotTerminal: 'run.not-terminal';
|
|
28
|
+
readonly triggerKeyInvalid: 'trigger-key.invalid';
|
|
29
|
+
readonly triggerKeyNotFound: 'trigger-key.not-found';
|
|
30
|
+
readonly triggerNotFound: 'trigger.not-found';
|
|
31
|
+
};
|
|
32
|
+
export type ControlErrorCode = (typeof controlErrorCode)[keyof typeof controlErrorCode];
|
|
33
|
+
export declare const controlErrorMetadata: {
|
|
34
|
+
readonly "authentication.required": {
|
|
35
|
+
readonly status: 401;
|
|
36
|
+
};
|
|
37
|
+
readonly "authorization.denied": {
|
|
38
|
+
readonly status: 403;
|
|
39
|
+
};
|
|
40
|
+
readonly "binding.unresolved": {
|
|
41
|
+
readonly status: 409;
|
|
42
|
+
};
|
|
43
|
+
readonly "connector.action-not-found": {
|
|
44
|
+
readonly status: 404;
|
|
45
|
+
};
|
|
46
|
+
readonly "connector.unavailable": {
|
|
47
|
+
readonly status: 503;
|
|
48
|
+
};
|
|
49
|
+
readonly "engine.unavailable": {
|
|
50
|
+
readonly status: 503;
|
|
51
|
+
};
|
|
52
|
+
readonly "engine.unsupported": {
|
|
53
|
+
readonly status: 409;
|
|
54
|
+
};
|
|
55
|
+
readonly "flow.invalid": {
|
|
56
|
+
readonly status: 400;
|
|
57
|
+
};
|
|
58
|
+
readonly "flow.not-found": {
|
|
59
|
+
readonly status: 404;
|
|
60
|
+
};
|
|
61
|
+
readonly "live.conflict": {
|
|
62
|
+
readonly status: 412;
|
|
63
|
+
};
|
|
64
|
+
readonly "live.not-found": {
|
|
65
|
+
readonly status: 404;
|
|
66
|
+
};
|
|
67
|
+
readonly "page.invalid-cursor": {
|
|
68
|
+
readonly status: 400;
|
|
69
|
+
};
|
|
70
|
+
readonly "project.busy": {
|
|
71
|
+
readonly status: 409;
|
|
72
|
+
};
|
|
73
|
+
readonly "project.conflict": {
|
|
74
|
+
readonly status: 409;
|
|
75
|
+
};
|
|
76
|
+
readonly "project.invalid": {
|
|
77
|
+
readonly status: 400;
|
|
78
|
+
};
|
|
79
|
+
readonly "project.not-found": {
|
|
80
|
+
readonly status: 404;
|
|
81
|
+
};
|
|
82
|
+
readonly "project.presentation-conflict": {
|
|
83
|
+
readonly status: 412;
|
|
84
|
+
};
|
|
85
|
+
readonly "project.revision-conflict": {
|
|
86
|
+
readonly status: 412;
|
|
87
|
+
};
|
|
88
|
+
readonly "publication.conflict": {
|
|
89
|
+
readonly status: 409;
|
|
90
|
+
};
|
|
91
|
+
readonly "publication.not-found": {
|
|
92
|
+
readonly status: 404;
|
|
93
|
+
};
|
|
94
|
+
readonly "route.not-found": {
|
|
95
|
+
readonly status: 404;
|
|
96
|
+
};
|
|
97
|
+
readonly "run.conflict": {
|
|
98
|
+
readonly status: 409;
|
|
99
|
+
};
|
|
100
|
+
readonly "run.events-expired": {
|
|
101
|
+
readonly status: 410;
|
|
102
|
+
};
|
|
103
|
+
readonly "run.invalid": {
|
|
104
|
+
readonly status: 400;
|
|
105
|
+
};
|
|
106
|
+
readonly "run.not-found": {
|
|
107
|
+
readonly status: 404;
|
|
108
|
+
};
|
|
109
|
+
readonly "run.not-terminal": {
|
|
110
|
+
readonly status: 409;
|
|
111
|
+
};
|
|
112
|
+
readonly "trigger-key.invalid": {
|
|
113
|
+
readonly status: 409;
|
|
114
|
+
};
|
|
115
|
+
readonly "trigger-key.not-found": {
|
|
116
|
+
readonly status: 404;
|
|
117
|
+
};
|
|
118
|
+
readonly "trigger.not-found": {
|
|
119
|
+
readonly status: 404;
|
|
120
|
+
};
|
|
121
|
+
};
|