@oomol-lab/open-flow 0.1.0-beta.36 → 0.1.0-beta.38
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/{editorComponent-DsbY5PNw.js → editorComponent-BUEAVBsL.js} +180 -100
- package/dist/browser/flow-authoring.js +11976 -1720
- package/dist/browser/{flowChanges-DwZmz0xb.js → flowChanges-Bu_BEtpj.js} +2797 -2663
- package/dist/browser/{flowWorkspace-C8yH2xRN.js → flowWorkspace-etUB3NSN.js} +9628 -9537
- package/dist/browser/{inputValues-CxEwXhw7.js → inputValues-CiSzEYeK.js} +1 -1
- package/dist/browser/{typeScriptSession-DnAmJCzu.js → typeScriptSession-vC9uPDVV.js} +1 -1
- package/dist/browser/ui.css +1 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +934 -861
- package/dist/common/connectorDecoders.d.ts +8 -0
- package/dist/common/control-api-conformance.d.ts +2 -1
- package/dist/common/control-api-conformance.js +1660 -1629
- package/dist/common/control-api.d.ts +26 -7
- package/dist/common/control-api.js +2844 -2739
- package/dist/common/control-requests.d.ts +8 -0
- package/dist/common/control-requests.js +4733 -1645
- package/dist/common/flow-semantics.d.ts +1 -0
- package/dist/common/flow-semantics.js +12 -2
- package/dist/common/mcp.js +578 -498
- package/dist/common/providerAccess.d.ts +20 -0
- package/package.json +1 -1
- package/dist/browser/lib-GrGxYjsJ.js +0 -7855
package/dist/common/mcp.js
CHANGED
|
@@ -4873,55 +4873,7 @@ var Vc = P({
|
|
|
4873
4873
|
offset: A().int().nonnegative().default(0),
|
|
4874
4874
|
limit: A().int().min(1).max(100).default(20),
|
|
4875
4875
|
maxBytes: A().int().min(1).max(1048576).default(15e3)
|
|
4876
|
-
}),
|
|
4877
|
-
version: R(1),
|
|
4878
|
-
sourceId: Hc,
|
|
4879
|
-
revision: ss().positive(),
|
|
4880
|
-
name: Wc,
|
|
4881
|
-
provider: L(["feishu", "feishu_app_bot"]),
|
|
4882
|
-
appId: Hc,
|
|
4883
|
-
connectionId: Hc,
|
|
4884
|
-
teamId: Hc.nullable(),
|
|
4885
|
-
enabled: j(),
|
|
4886
|
-
eventTypes: M(Uc),
|
|
4887
|
-
manageSubscriptions: j(),
|
|
4888
|
-
verificationTokenConfigured: j(),
|
|
4889
|
-
encryptKeyConfigured: j(),
|
|
4890
|
-
endpointUrl: O().nullable(),
|
|
4891
|
-
verifiedAt: O().nullable(),
|
|
4892
|
-
lastReceivedAt: O().nullable(),
|
|
4893
|
-
updatedAt: O(),
|
|
4894
|
-
consumers: M(P({
|
|
4895
|
-
flowId: Hc,
|
|
4896
|
-
flowName: O(),
|
|
4897
|
-
triggerNodeId: Hc
|
|
4898
|
-
}))
|
|
4899
|
-
});
|
|
4900
|
-
function Kc(e) {
|
|
4901
|
-
return Gc.parse(e);
|
|
4902
|
-
}
|
|
4903
|
-
function qc(e) {
|
|
4904
|
-
return P({
|
|
4905
|
-
version: R(1),
|
|
4906
|
-
sources: M(Gc),
|
|
4907
|
-
teamId: Hc.nullable().optional()
|
|
4908
|
-
}).parse(e);
|
|
4909
|
-
}
|
|
4910
|
-
var Jc = new Map([
|
|
4911
|
-
"en",
|
|
4912
|
-
"zh-CN",
|
|
4913
|
-
"zh-TW",
|
|
4914
|
-
"ja",
|
|
4915
|
-
"ko",
|
|
4916
|
-
"ru",
|
|
4917
|
-
"fr"
|
|
4918
|
-
].map((e) => [e.toLowerCase(), e]));
|
|
4919
|
-
function Yc(e) {
|
|
4920
|
-
return typeof e == "string" && Jc.get(e.toLowerCase()) == e;
|
|
4921
|
-
}
|
|
4922
|
-
//#endregion
|
|
4923
|
-
//#region src/control/common/errors.ts
|
|
4924
|
-
var H = {
|
|
4876
|
+
}), H = {
|
|
4925
4877
|
authenticationRequired: "authentication.required",
|
|
4926
4878
|
authorizationDenied: "authorization.denied",
|
|
4927
4879
|
bindingUnresolved: "binding.unresolved",
|
|
@@ -4970,7 +4922,7 @@ var H = {
|
|
|
4970
4922
|
variableNotFound: "variable.not-found"
|
|
4971
4923
|
};
|
|
4972
4924
|
H.eventSourceInvalid, H.eventSourceIdentityUnavailable, H.eventSourceNotFound, H.eventSourceConflict, H.authenticationRequired, H.authorizationDenied, H.bindingUnresolved, H.connectorActionNotFound, H.connectorAccessConflict, H.connectorAccessInvalid, H.connectorAccessRequired, H.connectorAccessUnsupported, H.connectorUnconfigured, H.connectorUnavailable, H.connectorConsoleUnconfigured, H.engineUnavailable, H.engineUnsupported, H.flowInvalid, H.flowRepairRequired, H.flowUpgradeRequired, H.flowNotFound, H.flowBusy, H.flowConflict, H.flowPresentationConflict, H.flowRevisionConflict, H.liveConflict, H.liveNotFound, H.pageInvalidCursor, H.publicationConflict, H.publicationNotFound, H.publicationUnsupported, H.publishOperationNotFound, H.routeNotFound, H.runConflict, H.runEventsExpired, H.runInvalid, H.runNotFound, H.runNotTerminal, H.runOverloaded, H.runWaitNotFound, H.triggerKeyInvalid, H.triggerKeyNotFound, H.triggerNotFound, H.variableInvalid, H.variableLimitReached, H.variableNotFound;
|
|
4973
|
-
var
|
|
4925
|
+
var Hc = class extends Error {
|
|
4974
4926
|
constructor(e, t, n) {
|
|
4975
4927
|
super(n), this.code = t, this.name = "ApiError", this.status = e;
|
|
4976
4928
|
}
|
|
@@ -4978,7 +4930,7 @@ var Xc = class extends Error {
|
|
|
4978
4930
|
//#endregion
|
|
4979
4931
|
//#region src/control/common/decoding.ts
|
|
4980
4932
|
function U() {
|
|
4981
|
-
throw new
|
|
4933
|
+
throw new Hc(502, "response.invalid", "The Control API returned an invalid response.");
|
|
4982
4934
|
}
|
|
4983
4935
|
function W(e) {
|
|
4984
4936
|
return typeof e != "object" || !e || Array.isArray(e) ? U() : e;
|
|
@@ -4999,12 +4951,366 @@ function J(e) {
|
|
|
4999
4951
|
let t = W(e);
|
|
5000
4952
|
return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, J(t)]));
|
|
5001
4953
|
}
|
|
5002
|
-
function
|
|
4954
|
+
function Uc(e) {
|
|
5003
4955
|
if (e != null) return G(e);
|
|
5004
4956
|
}
|
|
4957
|
+
new TextEncoder();
|
|
4958
|
+
var Wc = I(O(), fs()), Gc = N({
|
|
4959
|
+
jsonSchema: fs(),
|
|
4960
|
+
nullable: j(),
|
|
4961
|
+
value: fs().optional(),
|
|
4962
|
+
description: O().optional()
|
|
4963
|
+
}).strict(), Kc = I(O(), Gc), qc = F([N({
|
|
4964
|
+
kind: R("value"),
|
|
4965
|
+
value: fs()
|
|
4966
|
+
}).strict(), N({
|
|
4967
|
+
kind: R("sources"),
|
|
4968
|
+
sources: M(N({
|
|
4969
|
+
kind: R("node"),
|
|
4970
|
+
nodeId: O(),
|
|
4971
|
+
output: O()
|
|
4972
|
+
}).strict())
|
|
4973
|
+
}).strict()]), Jc = {
|
|
4974
|
+
name: O().optional(),
|
|
4975
|
+
description: O().optional(),
|
|
4976
|
+
icon: O().optional()
|
|
4977
|
+
}, Yc = F([
|
|
4978
|
+
N({
|
|
4979
|
+
...Jc,
|
|
4980
|
+
kind: R("cron"),
|
|
4981
|
+
cronTimes: M(fs())
|
|
4982
|
+
}).strict(),
|
|
4983
|
+
N({
|
|
4984
|
+
...Jc,
|
|
4985
|
+
kind: R("manual")
|
|
4986
|
+
}).strict(),
|
|
4987
|
+
N({
|
|
4988
|
+
...Jc,
|
|
4989
|
+
kind: R("task"),
|
|
4990
|
+
concurrency: R(1).optional(),
|
|
4991
|
+
inputs: I(O(), qc),
|
|
4992
|
+
task: N({
|
|
4993
|
+
name: O(),
|
|
4994
|
+
moduleId: O(),
|
|
4995
|
+
inputs: Kc,
|
|
4996
|
+
outputs: I(O(), Gc.omit({ value: !0 }))
|
|
4997
|
+
}).strict()
|
|
4998
|
+
}).strict()
|
|
4999
|
+
]);
|
|
5000
|
+
N({
|
|
5001
|
+
name: O(),
|
|
5002
|
+
graph: N({ nodes: I(O(), Yc) }).strict()
|
|
5003
|
+
}).strict(), N({
|
|
5004
|
+
kind: R("open-flow-project-revision"),
|
|
5005
|
+
version: R(1),
|
|
5006
|
+
modelVersion: F([R(1), R(2)]),
|
|
5007
|
+
modules: I(O(), N({
|
|
5008
|
+
name: O(),
|
|
5009
|
+
source: O(),
|
|
5010
|
+
imports: M(O())
|
|
5011
|
+
}).strict()),
|
|
5012
|
+
document: N({
|
|
5013
|
+
bindings: Wc,
|
|
5014
|
+
flows: Wc,
|
|
5015
|
+
subflows: Wc,
|
|
5016
|
+
tasks: Wc
|
|
5017
|
+
}).strict()
|
|
5018
|
+
}).strict();
|
|
5019
|
+
//#endregion
|
|
5020
|
+
//#region src/control/common/providerAccess.ts
|
|
5021
|
+
var Xc = ys("kind", [P({ kind: R("admin-delegation") }), P({
|
|
5022
|
+
kind: R("policy"),
|
|
5023
|
+
ruleId: O().min(1).nullable()
|
|
5024
|
+
})]);
|
|
5025
|
+
function Zc(e) {
|
|
5026
|
+
return Xc.parse(e);
|
|
5027
|
+
}
|
|
5028
|
+
//#endregion
|
|
5029
|
+
//#region src/control/common/connectorDecoders.ts
|
|
5030
|
+
function Qc(e) {
|
|
5031
|
+
let t = W(e);
|
|
5032
|
+
if (K(t, [
|
|
5033
|
+
"actionIds",
|
|
5034
|
+
"allActions",
|
|
5035
|
+
"configured",
|
|
5036
|
+
"proxy"
|
|
5037
|
+
]), !Array.isArray(t.actionIds) || typeof t.allActions != "boolean" || typeof t.configured != "boolean" || typeof t.proxy != "boolean") return U();
|
|
5038
|
+
let n = t.actionIds.map(G);
|
|
5039
|
+
return new Set(n).size != n.length || t.allActions != (n.length == 0) || t.proxy != (t.allActions && !t.configured) ? U() : {
|
|
5040
|
+
actionIds: n,
|
|
5041
|
+
allActions: t.allActions,
|
|
5042
|
+
configured: t.configured,
|
|
5043
|
+
proxy: t.proxy
|
|
5044
|
+
};
|
|
5045
|
+
}
|
|
5046
|
+
function $c(e, t) {
|
|
5047
|
+
let n = W(e), r = n.policyRevision, i = n.status, a = n.isDefault, o = Object.hasOwn(n, "displayName") && !Object.hasOwn(n, "connectionDisplayName"), s = t && Object.hasOwn(n, "permissions") ? Qc(n.permissions) : void 0, c = n.permissionGroupName;
|
|
5048
|
+
if (K(n, [
|
|
5049
|
+
"accessBindingId",
|
|
5050
|
+
"connectionId",
|
|
5051
|
+
"source",
|
|
5052
|
+
o ? "displayName" : "connectionDisplayName",
|
|
5053
|
+
...t && Object.hasOwn(n, "isDefault") ? ["isDefault"] : [],
|
|
5054
|
+
...t && s != null ? ["permissions"] : [],
|
|
5055
|
+
...Object.hasOwn(n, "permissionGroupName") ? ["permissionGroupName"] : [],
|
|
5056
|
+
...r == null ? [] : ["policyRevision"],
|
|
5057
|
+
"providerId",
|
|
5058
|
+
...t ? [] : ["status"]
|
|
5059
|
+
]), r != null && typeof r != "string" || t && a !== void 0 && typeof a != "boolean" || c != null && typeof c != "string" || !t && i != "active" && i != "forbidden" && i != "invalid" && i != "missing") return U();
|
|
5060
|
+
let l;
|
|
5061
|
+
try {
|
|
5062
|
+
l = Zc(n.source);
|
|
5063
|
+
} catch {
|
|
5064
|
+
return U();
|
|
5065
|
+
}
|
|
5066
|
+
return {
|
|
5067
|
+
accessBindingId: G(n.accessBindingId),
|
|
5068
|
+
connectionId: G(n.connectionId),
|
|
5069
|
+
source: l,
|
|
5070
|
+
connectionDisplayName: G(o ? n.displayName : n.connectionDisplayName),
|
|
5071
|
+
...t && typeof a == "boolean" ? { isDefault: a } : {},
|
|
5072
|
+
...s == null ? {} : { permissions: s },
|
|
5073
|
+
...c === void 0 ? {} : { permissionGroupName: c },
|
|
5074
|
+
...r == null ? {} : { policyRevision: r },
|
|
5075
|
+
providerId: G(n.providerId),
|
|
5076
|
+
...t ? {} : { status: i }
|
|
5077
|
+
};
|
|
5078
|
+
}
|
|
5079
|
+
function el(e) {
|
|
5080
|
+
return e != "implicit" && e != "selectable" ? U() : e;
|
|
5081
|
+
}
|
|
5082
|
+
function tl(e) {
|
|
5083
|
+
let t = W(e);
|
|
5084
|
+
K(t, [
|
|
5085
|
+
"accessRevision",
|
|
5086
|
+
"bindings",
|
|
5087
|
+
"mode",
|
|
5088
|
+
"providerAccessDigest",
|
|
5089
|
+
..."providerIds" in t ? ["providerIds"] : [],
|
|
5090
|
+
..."discardedBindingCount" in t ? ["discardedBindingCount"] : [],
|
|
5091
|
+
"version"
|
|
5092
|
+
]);
|
|
5093
|
+
let n = q(t.accessRevision);
|
|
5094
|
+
if (t.version != 1 || n < 0 || !Array.isArray(t.bindings) || "providerIds" in t && !Array.isArray(t.providerIds)) return U();
|
|
5095
|
+
let r = t.providerIds == null ? void 0 : t.providerIds.map((e) => G(e));
|
|
5096
|
+
if (r != null && new Set(r).size != r.length) return U();
|
|
5097
|
+
let i = t.discardedBindingCount == null ? 0 : q(t.discardedBindingCount);
|
|
5098
|
+
if (i < 0) return U();
|
|
5099
|
+
let a = [];
|
|
5100
|
+
for (let e of t.bindings) try {
|
|
5101
|
+
a.push($c(e, !1));
|
|
5102
|
+
} catch (t) {
|
|
5103
|
+
if (!(t instanceof Hc) || t.code != "response.invalid") throw t;
|
|
5104
|
+
typeof e == "object" && e && !Array.isArray(e) && typeof e.accessBindingId == "string" && e.accessBindingId.length > 0 && typeof e.providerId == "string" && e.providerId.length > 0 ? a.push({
|
|
5105
|
+
accessBindingId: e.accessBindingId,
|
|
5106
|
+
providerId: e.providerId,
|
|
5107
|
+
connectionId: null,
|
|
5108
|
+
source: null,
|
|
5109
|
+
status: "invalid",
|
|
5110
|
+
connectionDisplayName: typeof e.connectionDisplayName == "string" && e.connectionDisplayName.length > 0 ? e.connectionDisplayName : typeof e.displayName == "string" && e.displayName.length > 0 ? e.displayName : e.providerId,
|
|
5111
|
+
permissionGroupName: typeof e.permissionGroupName == "string" ? e.permissionGroupName : null
|
|
5112
|
+
}) : i++;
|
|
5113
|
+
}
|
|
5114
|
+
return new Set(a.map((e) => e.accessBindingId)).size == a.length ? {
|
|
5115
|
+
accessRevision: n,
|
|
5116
|
+
...i == 0 ? {} : { discardedBindingCount: i },
|
|
5117
|
+
...r == null ? {} : { providerIds: r },
|
|
5118
|
+
bindings: a,
|
|
5119
|
+
mode: el(t.mode),
|
|
5120
|
+
providerAccessDigest: G(t.providerAccessDigest),
|
|
5121
|
+
version: 1
|
|
5122
|
+
} : U();
|
|
5123
|
+
}
|
|
5124
|
+
function nl(e, t) {
|
|
5125
|
+
let n = W(e);
|
|
5126
|
+
if (K(n, [
|
|
5127
|
+
"candidates",
|
|
5128
|
+
"mode",
|
|
5129
|
+
"providerId",
|
|
5130
|
+
"version"
|
|
5131
|
+
]), n.version != 1 || G(n.providerId) != t || !Array.isArray(n.candidates)) return U();
|
|
5132
|
+
let r = n.candidates.map((e) => $c(e, !0));
|
|
5133
|
+
return r.some((e) => e.providerId != t) || new Set(r.map((e) => e.accessBindingId)).size != r.length ? U() : {
|
|
5134
|
+
candidates: r,
|
|
5135
|
+
mode: el(n.mode),
|
|
5136
|
+
providerId: t,
|
|
5137
|
+
version: 1
|
|
5138
|
+
};
|
|
5139
|
+
}
|
|
5140
|
+
function rl(e, t) {
|
|
5141
|
+
let n = W(e);
|
|
5142
|
+
if (K(n, ["results", "version"]), n.version != 1 || !Array.isArray(n.results)) return U();
|
|
5143
|
+
let r = new Set(t), i = n.results.map((e) => {
|
|
5144
|
+
let t = W(e), n = G(t.providerId);
|
|
5145
|
+
if (!r.delete(n)) return U();
|
|
5146
|
+
if (!Object.hasOwn(t, "error")) return nl(t, n);
|
|
5147
|
+
K(t, ["providerId", "error"]);
|
|
5148
|
+
let i = W(t.error);
|
|
5149
|
+
return K(i, ["code", "message"]), {
|
|
5150
|
+
providerId: n,
|
|
5151
|
+
error: {
|
|
5152
|
+
code: G(i.code),
|
|
5153
|
+
message: G(i.message)
|
|
5154
|
+
}
|
|
5155
|
+
};
|
|
5156
|
+
});
|
|
5157
|
+
return r.size == 0 ? {
|
|
5158
|
+
results: i,
|
|
5159
|
+
version: 1
|
|
5160
|
+
} : U();
|
|
5161
|
+
}
|
|
5162
|
+
function il(e) {
|
|
5163
|
+
let t = W(e);
|
|
5164
|
+
if (K(t, [
|
|
5165
|
+
...Object.hasOwn(t, "providerAccountId") ? ["providerAccountId"] : [],
|
|
5166
|
+
...Object.hasOwn(t, "alias") ? ["alias"] : [],
|
|
5167
|
+
...Object.hasOwn(t, "builtInAccount") ? ["builtInAccount"] : [],
|
|
5168
|
+
"connectionId",
|
|
5169
|
+
"displayName",
|
|
5170
|
+
"isDefault",
|
|
5171
|
+
"serviceId",
|
|
5172
|
+
"status"
|
|
5173
|
+
]), t.builtInAccount !== void 0 && typeof t.builtInAccount != "boolean") return U();
|
|
5174
|
+
let n = t.status;
|
|
5175
|
+
return n != "active" && n != "disconnected" && n != "error" && n != "reauth_required" || typeof t.isDefault != "boolean" ? U() : {
|
|
5176
|
+
...t.providerAccountId === void 0 ? {} : { providerAccountId: G(t.providerAccountId) },
|
|
5177
|
+
...t.alias === void 0 ? {} : { alias: G(t.alias) },
|
|
5178
|
+
...t.builtInAccount === void 0 ? {} : { builtInAccount: t.builtInAccount },
|
|
5179
|
+
connectionId: G(t.connectionId),
|
|
5180
|
+
displayName: G(t.displayName),
|
|
5181
|
+
isDefault: t.isDefault,
|
|
5182
|
+
serviceId: G(t.serviceId),
|
|
5183
|
+
status: n
|
|
5184
|
+
};
|
|
5185
|
+
}
|
|
5186
|
+
function al(e, t = !1) {
|
|
5187
|
+
let n = W(e), r = n.description, i = t && Object.hasOwn(n, "value");
|
|
5188
|
+
return K(n, [
|
|
5189
|
+
"jsonSchema",
|
|
5190
|
+
"nullable",
|
|
5191
|
+
...r == null ? [] : ["description"],
|
|
5192
|
+
...i ? ["value"] : []
|
|
5193
|
+
]), r != null && typeof r != "string" || typeof n.nullable != "boolean" ? U() : {
|
|
5194
|
+
...r == null ? {} : { description: r },
|
|
5195
|
+
jsonSchema: J(n.jsonSchema),
|
|
5196
|
+
nullable: n.nullable,
|
|
5197
|
+
...i ? { value: J(n.value) } : {}
|
|
5198
|
+
};
|
|
5199
|
+
}
|
|
5200
|
+
function ol(e) {
|
|
5201
|
+
return al(e, !0);
|
|
5202
|
+
}
|
|
5203
|
+
function sl(e, t) {
|
|
5204
|
+
return Object.fromEntries(Object.entries(W(e)).map(([e, n]) => [e, t(n)]));
|
|
5205
|
+
}
|
|
5206
|
+
function cl(e) {
|
|
5207
|
+
let t = W(e), n = t.homepageUrl, r = t.icon;
|
|
5208
|
+
return K(t, [
|
|
5209
|
+
"actionId",
|
|
5210
|
+
...Object.hasOwn(t, "operationType") ? ["operationType"] : [],
|
|
5211
|
+
...Object.hasOwn(t, "inputSchema") ? ["inputSchema"] : [],
|
|
5212
|
+
...Object.hasOwn(t, "outputSchema") ? ["outputSchema"] : [],
|
|
5213
|
+
"authenticated",
|
|
5214
|
+
"description",
|
|
5215
|
+
...n == null ? [] : ["homepageUrl"],
|
|
5216
|
+
...r == null ? [] : ["icon"],
|
|
5217
|
+
"inputs",
|
|
5218
|
+
"name",
|
|
5219
|
+
"outputs",
|
|
5220
|
+
"serviceId",
|
|
5221
|
+
"serviceName"
|
|
5222
|
+
]), n != null && typeof n != "string" || r != null && typeof r != "string" ? U() : {
|
|
5223
|
+
...t.inputSchema === void 0 ? {} : { inputSchema: J(t.inputSchema) },
|
|
5224
|
+
...t.outputSchema === void 0 ? {} : { outputSchema: J(t.outputSchema) },
|
|
5225
|
+
actionId: G(t.actionId),
|
|
5226
|
+
...t.operationType == null ? {} : { operationType: G(t.operationType) },
|
|
5227
|
+
authenticated: typeof t.authenticated == "boolean" ? t.authenticated : U(),
|
|
5228
|
+
description: typeof t.description == "string" ? t.description : U(),
|
|
5229
|
+
...n == null ? {} : { homepageUrl: n },
|
|
5230
|
+
...r == null ? {} : { icon: r },
|
|
5231
|
+
inputs: sl(t.inputs, ol),
|
|
5232
|
+
name: G(t.name),
|
|
5233
|
+
outputs: sl(t.outputs, al),
|
|
5234
|
+
serviceId: G(t.serviceId),
|
|
5235
|
+
serviceName: G(t.serviceName)
|
|
5236
|
+
};
|
|
5237
|
+
}
|
|
5238
|
+
function ll(e) {
|
|
5239
|
+
let { defaultConnection: t, ...n } = W(e), r = cl(n);
|
|
5240
|
+
if (t == null) return r;
|
|
5241
|
+
let i = il(t);
|
|
5242
|
+
return i.serviceId != r.serviceId || i.status != "active" ? U() : {
|
|
5243
|
+
...r,
|
|
5244
|
+
defaultConnection: i
|
|
5245
|
+
};
|
|
5246
|
+
}
|
|
5247
|
+
function ul(e) {
|
|
5248
|
+
let t = W(e), n = t.homepageUrl, r = t.icon;
|
|
5249
|
+
return t.noSetup !== void 0 && typeof t.noSetup != "boolean" || (K(t, [
|
|
5250
|
+
...Object.hasOwn(t, "noSetup") ? ["noSetup"] : [],
|
|
5251
|
+
"serviceId",
|
|
5252
|
+
"serviceName",
|
|
5253
|
+
...n == null ? [] : ["homepageUrl"],
|
|
5254
|
+
...r == null ? [] : ["icon"]
|
|
5255
|
+
]), n != null && typeof n != "string" || r != null && typeof r != "string") ? U() : {
|
|
5256
|
+
...n == null ? {} : { homepageUrl: n },
|
|
5257
|
+
...r == null ? {} : { icon: r },
|
|
5258
|
+
serviceId: G(t.serviceId),
|
|
5259
|
+
serviceName: G(t.serviceName),
|
|
5260
|
+
...t.noSetup === void 0 ? {} : { noSetup: t.noSetup }
|
|
5261
|
+
};
|
|
5262
|
+
}
|
|
5263
|
+
//#endregion
|
|
5264
|
+
//#region src/control/common/eventSources.ts
|
|
5265
|
+
var dl = O().min(1).max(256), fl = O().regex(/^[a-z][a-z0-9_.]{0,127}$/), pl = O().trim().min(1).max(128), ml = P({
|
|
5266
|
+
version: R(1),
|
|
5267
|
+
sourceId: dl,
|
|
5268
|
+
revision: ss().positive(),
|
|
5269
|
+
name: pl,
|
|
5270
|
+
provider: L(["feishu", "feishu_app_bot"]),
|
|
5271
|
+
appId: dl,
|
|
5272
|
+
connectionId: dl,
|
|
5273
|
+
teamId: dl.nullable(),
|
|
5274
|
+
enabled: j(),
|
|
5275
|
+
eventTypes: M(fl),
|
|
5276
|
+
manageSubscriptions: j(),
|
|
5277
|
+
verificationTokenConfigured: j(),
|
|
5278
|
+
encryptKeyConfigured: j(),
|
|
5279
|
+
endpointUrl: O().nullable(),
|
|
5280
|
+
verifiedAt: O().nullable(),
|
|
5281
|
+
lastReceivedAt: O().nullable(),
|
|
5282
|
+
updatedAt: O(),
|
|
5283
|
+
consumers: M(P({
|
|
5284
|
+
flowId: dl,
|
|
5285
|
+
flowName: O(),
|
|
5286
|
+
triggerNodeId: dl
|
|
5287
|
+
}))
|
|
5288
|
+
});
|
|
5289
|
+
function hl(e) {
|
|
5290
|
+
return ml.parse(e);
|
|
5291
|
+
}
|
|
5292
|
+
function gl(e) {
|
|
5293
|
+
return P({
|
|
5294
|
+
version: R(1),
|
|
5295
|
+
sources: M(ml),
|
|
5296
|
+
teamId: dl.nullable().optional()
|
|
5297
|
+
}).parse(e);
|
|
5298
|
+
}
|
|
5299
|
+
var _l = new Map([
|
|
5300
|
+
"en",
|
|
5301
|
+
"zh-CN",
|
|
5302
|
+
"zh-TW",
|
|
5303
|
+
"ja",
|
|
5304
|
+
"ko",
|
|
5305
|
+
"ru",
|
|
5306
|
+
"fr"
|
|
5307
|
+
].map((e) => [e.toLowerCase(), e]));
|
|
5308
|
+
function vl(e) {
|
|
5309
|
+
return typeof e == "string" && _l.get(e.toLowerCase()) == e;
|
|
5310
|
+
}
|
|
5005
5311
|
//#endregion
|
|
5006
5312
|
//#region src/trigger/common/configSchema.ts
|
|
5007
|
-
var
|
|
5313
|
+
var yl = M(F([P({
|
|
5008
5314
|
handle: O().min(1),
|
|
5009
5315
|
description: O().optional(),
|
|
5010
5316
|
jsonSchema: Xs(),
|
|
@@ -5016,7 +5322,7 @@ var Qc = M(F([P({
|
|
|
5016
5322
|
})]));
|
|
5017
5323
|
//#endregion
|
|
5018
5324
|
//#region src/control/common/triggerDecoders.ts
|
|
5019
|
-
function
|
|
5325
|
+
function bl(e) {
|
|
5020
5326
|
let t = W(e), n = t.type;
|
|
5021
5327
|
return n != "integration" && n != "poll" ? U() : {
|
|
5022
5328
|
description: typeof t.description == "string" ? t.description : U(),
|
|
@@ -5027,9 +5333,9 @@ function $c(e) {
|
|
|
5027
5333
|
type: n
|
|
5028
5334
|
};
|
|
5029
5335
|
}
|
|
5030
|
-
function
|
|
5031
|
-
let t = W(e), n =
|
|
5032
|
-
configInputs:
|
|
5336
|
+
function xl(e) {
|
|
5337
|
+
let t = W(e), n = bl(t), r = {
|
|
5338
|
+
configInputs: yl.parse(t.configInputs),
|
|
5033
5339
|
definitionVersion: t.definitionVersion === 2 ? 2 : U(),
|
|
5034
5340
|
description: n.description,
|
|
5035
5341
|
displayName: n.displayName,
|
|
@@ -5078,18 +5384,18 @@ function el(e) {
|
|
|
5078
5384
|
type: "integration"
|
|
5079
5385
|
};
|
|
5080
5386
|
}
|
|
5081
|
-
var
|
|
5387
|
+
var Sl = /* @__PURE__ */ new Set([
|
|
5082
5388
|
"cron",
|
|
5083
5389
|
"integration",
|
|
5084
5390
|
"poll",
|
|
5085
5391
|
"webhook"
|
|
5086
|
-
]),
|
|
5392
|
+
]), Cl = /* @__PURE__ */ new Set([
|
|
5087
5393
|
"failed",
|
|
5088
5394
|
"healthy",
|
|
5089
5395
|
"initializing",
|
|
5090
5396
|
"needs_reauth",
|
|
5091
5397
|
"suspended"
|
|
5092
|
-
]),
|
|
5398
|
+
]), wl = /* @__PURE__ */ new Set([
|
|
5093
5399
|
"delivery.failed",
|
|
5094
5400
|
"health.failed",
|
|
5095
5401
|
"health.needs_reauth",
|
|
@@ -5098,11 +5404,11 @@ var tl = /* @__PURE__ */ new Set([
|
|
|
5098
5404
|
"operator.paused",
|
|
5099
5405
|
"operator.resumed"
|
|
5100
5406
|
]);
|
|
5101
|
-
function
|
|
5407
|
+
function Tl(e) {
|
|
5102
5408
|
let t = W(e), n = t.health, r = t.listener == null ? void 0 : W(t.listener);
|
|
5103
5409
|
if (r != null && r.health != "healthy" && r.health != "failed" && r.health != "needs_reauth") return U();
|
|
5104
5410
|
let i = t.kind, a = t.operatorState, o = q(t.runtimeVersion);
|
|
5105
|
-
return t.version != 1 || typeof n != "string" || !
|
|
5411
|
+
return t.version != 1 || typeof n != "string" || !Cl.has(n) || typeof i != "string" || !Sl.has(i) || a != "active" && a != "paused" || o <= 0 ? U() : {
|
|
5106
5412
|
...t.currentPublicationId == null ? {} : { currentPublicationId: G(t.currentPublicationId) },
|
|
5107
5413
|
...t.currentRevisionId == null ? {} : { currentRevisionId: G(t.currentRevisionId) },
|
|
5108
5414
|
...t.endpointUrl == null ? {} : { endpointUrl: G(t.endpointUrl) },
|
|
@@ -5121,17 +5427,17 @@ function il(e) {
|
|
|
5121
5427
|
version: 1
|
|
5122
5428
|
};
|
|
5123
5429
|
}
|
|
5124
|
-
function
|
|
5430
|
+
function El(e) {
|
|
5125
5431
|
let t = W(e);
|
|
5126
5432
|
return t.version == 1 ? {
|
|
5127
|
-
binding:
|
|
5433
|
+
binding: Tl(t.binding),
|
|
5128
5434
|
version: 1
|
|
5129
5435
|
} : U();
|
|
5130
5436
|
}
|
|
5131
|
-
function
|
|
5437
|
+
function Dl(e) {
|
|
5132
5438
|
let t = W(e), n = t.kind;
|
|
5133
|
-
if (typeof n != "string" || !
|
|
5134
|
-
let r =
|
|
5439
|
+
if (typeof n != "string" || !wl.has(n)) return U();
|
|
5440
|
+
let r = Uc(t.errorCode), i = Uc(t.errorMessage);
|
|
5135
5441
|
return i != null && i.length > 512 ? U() : {
|
|
5136
5442
|
activityId: G(t.activityId),
|
|
5137
5443
|
createdAt: G(t.createdAt),
|
|
@@ -5140,15 +5446,15 @@ function ol(e) {
|
|
|
5140
5446
|
kind: n
|
|
5141
5447
|
};
|
|
5142
5448
|
}
|
|
5143
|
-
function
|
|
5144
|
-
let t = W(e), n =
|
|
5449
|
+
function Ol(e) {
|
|
5450
|
+
let t = W(e), n = Uc(t.nextCursor);
|
|
5145
5451
|
return t.version != 1 || !Array.isArray(t.activities) ? U() : {
|
|
5146
|
-
activities: t.activities.map(
|
|
5452
|
+
activities: t.activities.map(Dl),
|
|
5147
5453
|
...n == null ? {} : { nextCursor: n },
|
|
5148
5454
|
version: 1
|
|
5149
5455
|
};
|
|
5150
5456
|
}
|
|
5151
|
-
function
|
|
5457
|
+
function kl(e) {
|
|
5152
5458
|
let t = W(e), n = q(t.filtered);
|
|
5153
5459
|
return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? U() : {
|
|
5154
5460
|
events: t.events.map((e) => {
|
|
@@ -5162,15 +5468,15 @@ function cl(e) {
|
|
|
5162
5468
|
}
|
|
5163
5469
|
//#endregion
|
|
5164
5470
|
//#region src/control/common/triggerCatalog.ts
|
|
5165
|
-
function
|
|
5471
|
+
function Al(e) {
|
|
5166
5472
|
let t = W(e);
|
|
5167
5473
|
if (K(t, [
|
|
5168
5474
|
"version",
|
|
5169
5475
|
"locale",
|
|
5170
5476
|
"definitions",
|
|
5171
5477
|
"display"
|
|
5172
|
-
]), t.version != 2 || !
|
|
5173
|
-
let n = t.definitions.map(
|
|
5478
|
+
]), t.version != 2 || !vl(t.locale) || !Array.isArray(t.definitions)) return U();
|
|
5479
|
+
let n = t.definitions.map(xl), r = W(t.display), i = new Set(n.map((e) => e.key));
|
|
5174
5480
|
if (i.size != n.length || Object.keys(r).length != i.size) return U();
|
|
5175
5481
|
let a = Object.fromEntries(n.map((e) => {
|
|
5176
5482
|
let { key: t } = e, n = W(r[t]);
|
|
@@ -5180,10 +5486,10 @@ function ll(e) {
|
|
|
5180
5486
|
"description",
|
|
5181
5487
|
"outputs"
|
|
5182
5488
|
]), [t, {
|
|
5183
|
-
configInputs:
|
|
5489
|
+
configInputs: jl(n.configInputs, e.configInputs.flatMap((e) => "handle" in e ? [e.handle] : [])),
|
|
5184
5490
|
displayName: G(n.displayName),
|
|
5185
5491
|
description: G(n.description),
|
|
5186
|
-
outputs:
|
|
5492
|
+
outputs: jl(n.outputs, e.outputs.map((e) => e.handle))
|
|
5187
5493
|
}];
|
|
5188
5494
|
}));
|
|
5189
5495
|
return {
|
|
@@ -5193,13 +5499,13 @@ function ll(e) {
|
|
|
5193
5499
|
display: a
|
|
5194
5500
|
};
|
|
5195
5501
|
}
|
|
5196
|
-
function
|
|
5502
|
+
function jl(e, t) {
|
|
5197
5503
|
let n = W(e);
|
|
5198
5504
|
return K(n, t), Object.fromEntries(Object.entries(n).map(([e, t]) => [e, G(t)]));
|
|
5199
5505
|
}
|
|
5200
5506
|
//#endregion
|
|
5201
5507
|
//#region src/control/common/results.ts
|
|
5202
|
-
var
|
|
5508
|
+
var Ml = Xs(), Nl = P({
|
|
5203
5509
|
pointer: O(),
|
|
5204
5510
|
type: L([
|
|
5205
5511
|
"object",
|
|
@@ -5211,12 +5517,12 @@ var dl = Xs(), fl = P({
|
|
|
5211
5517
|
]),
|
|
5212
5518
|
length: A().int().nonnegative().optional(),
|
|
5213
5519
|
complete: j(),
|
|
5214
|
-
value:
|
|
5215
|
-
}),
|
|
5520
|
+
value: Ml.optional()
|
|
5521
|
+
}), Pl = Nl.extend({
|
|
5216
5522
|
offset: A().int().nonnegative(),
|
|
5217
5523
|
nextOffset: A().int().positive().optional(),
|
|
5218
|
-
entries: M(
|
|
5219
|
-
}),
|
|
5524
|
+
entries: M(Nl).optional()
|
|
5525
|
+
}), Fl = P({
|
|
5220
5526
|
resultId: O().min(1),
|
|
5221
5527
|
callId: O().min(1),
|
|
5222
5528
|
toolId: O().min(1),
|
|
@@ -5227,59 +5533,59 @@ var dl = Xs(), fl = P({
|
|
|
5227
5533
|
bytes: A().int().nonnegative(),
|
|
5228
5534
|
digest: O().regex(/^[a-f0-9]{64}$/),
|
|
5229
5535
|
createdAt: O().datetime()
|
|
5230
|
-
}),
|
|
5536
|
+
}), Il = P({
|
|
5231
5537
|
version: R(1),
|
|
5232
5538
|
runId: O(),
|
|
5233
|
-
results: M(
|
|
5539
|
+
results: M(Fl),
|
|
5234
5540
|
nextAfter: O().optional()
|
|
5235
|
-
}),
|
|
5541
|
+
}), Ll = P({
|
|
5236
5542
|
version: R(1),
|
|
5237
5543
|
runId: O(),
|
|
5238
|
-
result:
|
|
5239
|
-
page:
|
|
5544
|
+
result: Fl,
|
|
5545
|
+
page: Pl
|
|
5240
5546
|
});
|
|
5241
|
-
function
|
|
5242
|
-
return
|
|
5547
|
+
function Rl(e) {
|
|
5548
|
+
return Il.parse(e);
|
|
5243
5549
|
}
|
|
5244
|
-
function
|
|
5245
|
-
return
|
|
5550
|
+
function zl(e) {
|
|
5551
|
+
return Ll.parse(e);
|
|
5246
5552
|
}
|
|
5247
5553
|
new TextEncoder();
|
|
5248
5554
|
//#endregion
|
|
5249
5555
|
//#region src/control/common/checkDecoders.ts
|
|
5250
|
-
function
|
|
5556
|
+
function Bl(e) {
|
|
5251
5557
|
return Array.isArray(e) ? e.map((e) => typeof e == "string" || Number.isSafeInteger(e) ? e : U()) : U();
|
|
5252
5558
|
}
|
|
5253
|
-
function
|
|
5559
|
+
function Vl(e) {
|
|
5254
5560
|
let t = W(e), n = G(t.kind);
|
|
5255
5561
|
return n == "artifact" || n == "binary" || n == "nullable" ? { kind: n } : n == "schema" ? {
|
|
5256
5562
|
kind: n,
|
|
5257
|
-
path: t.path == null ? void 0 :
|
|
5563
|
+
path: t.path == null ? void 0 : Bl(t.path)
|
|
5258
5564
|
} : n != "keyword" || typeof t.keyword != "string" || !zc(t.keyword) ? U() : {
|
|
5259
5565
|
kind: n,
|
|
5260
5566
|
keyword: t.keyword,
|
|
5261
|
-
path:
|
|
5567
|
+
path: Bl(t.path),
|
|
5262
5568
|
source: t.source === void 0 ? void 0 : J(t.source),
|
|
5263
5569
|
target: t.target === void 0 ? void 0 : J(t.target)
|
|
5264
5570
|
};
|
|
5265
5571
|
}
|
|
5266
|
-
function
|
|
5572
|
+
function Hl(e) {
|
|
5267
5573
|
let t = W(e), n = t.values == null ? void 0 : W(t.values);
|
|
5268
5574
|
return {
|
|
5269
5575
|
code: G(t.code),
|
|
5270
5576
|
column: q(t.column),
|
|
5271
5577
|
line: q(t.line),
|
|
5272
5578
|
message: G(t.message),
|
|
5273
|
-
mismatch: t.mismatch == null ? void 0 :
|
|
5579
|
+
mismatch: t.mismatch == null ? void 0 : Vl(t.mismatch),
|
|
5274
5580
|
path: typeof t.path == "string" ? t.path : U(),
|
|
5275
5581
|
...n == null ? {} : { values: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, typeof t == "string" || typeof t == "number" ? t : U()])) }
|
|
5276
5582
|
};
|
|
5277
5583
|
}
|
|
5278
|
-
function
|
|
5584
|
+
function Ul(e) {
|
|
5279
5585
|
let t = W(e);
|
|
5280
5586
|
return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? U() : {
|
|
5281
5587
|
closureDigest: G(t.closureDigest),
|
|
5282
|
-
diagnostics: t.diagnostics.map(
|
|
5588
|
+
diagnostics: t.diagnostics.map(Hl),
|
|
5283
5589
|
engineContract: G(t.engineContract),
|
|
5284
5590
|
flowId: G(t.flowId),
|
|
5285
5591
|
modelVersion: q(t.modelVersion),
|
|
@@ -5290,189 +5596,9 @@ function Sl(e) {
|
|
|
5290
5596
|
};
|
|
5291
5597
|
}
|
|
5292
5598
|
//#endregion
|
|
5293
|
-
//#region src/control/common/connectorDecoders.ts
|
|
5294
|
-
function Cl(e) {
|
|
5295
|
-
let t = W(e);
|
|
5296
|
-
if (K(t, [
|
|
5297
|
-
"actionIds",
|
|
5298
|
-
"allActions",
|
|
5299
|
-
"configured",
|
|
5300
|
-
"proxy"
|
|
5301
|
-
]), !Array.isArray(t.actionIds) || typeof t.allActions != "boolean" || typeof t.configured != "boolean" || typeof t.proxy != "boolean") return U();
|
|
5302
|
-
let n = t.actionIds.map(G);
|
|
5303
|
-
return new Set(n).size != n.length || t.allActions != (n.length == 0) || t.proxy != (t.allActions && !t.configured) ? U() : {
|
|
5304
|
-
actionIds: n,
|
|
5305
|
-
allActions: t.allActions,
|
|
5306
|
-
configured: t.configured,
|
|
5307
|
-
proxy: t.proxy
|
|
5308
|
-
};
|
|
5309
|
-
}
|
|
5310
|
-
function wl(e, t) {
|
|
5311
|
-
let n = W(e), r = n.policyRevision, i = n.status, a = n.isDefault, o = Object.hasOwn(n, "displayName") && !Object.hasOwn(n, "connectionDisplayName"), s = t && Object.hasOwn(n, "permissions") ? Cl(n.permissions) : void 0, c = n.permissionGroupName;
|
|
5312
|
-
return K(n, [
|
|
5313
|
-
"accessBindingId",
|
|
5314
|
-
o ? "displayName" : "connectionDisplayName",
|
|
5315
|
-
...t && Object.hasOwn(n, "isDefault") ? ["isDefault"] : [],
|
|
5316
|
-
...t && s != null ? ["permissions"] : [],
|
|
5317
|
-
...Object.hasOwn(n, "permissionGroupName") ? ["permissionGroupName"] : [],
|
|
5318
|
-
...r == null ? [] : ["policyRevision"],
|
|
5319
|
-
"providerId",
|
|
5320
|
-
...t ? [] : ["status"]
|
|
5321
|
-
]), r != null && typeof r != "string" || t && a !== void 0 && typeof a != "boolean" || c != null && typeof c != "string" || !t && i != "active" && i != "forbidden" && i != "invalid" && i != "missing" ? U() : {
|
|
5322
|
-
accessBindingId: G(n.accessBindingId),
|
|
5323
|
-
connectionDisplayName: G(o ? n.displayName : n.connectionDisplayName),
|
|
5324
|
-
...t && typeof a == "boolean" ? { isDefault: a } : {},
|
|
5325
|
-
...s == null ? {} : { permissions: s },
|
|
5326
|
-
...c === void 0 ? {} : { permissionGroupName: c },
|
|
5327
|
-
...r == null ? {} : { policyRevision: r },
|
|
5328
|
-
providerId: G(n.providerId),
|
|
5329
|
-
...t ? {} : { status: i }
|
|
5330
|
-
};
|
|
5331
|
-
}
|
|
5332
|
-
function Tl(e) {
|
|
5333
|
-
return e != "implicit" && e != "selectable" ? U() : e;
|
|
5334
|
-
}
|
|
5335
|
-
function El(e) {
|
|
5336
|
-
let t = W(e);
|
|
5337
|
-
K(t, [
|
|
5338
|
-
"accessRevision",
|
|
5339
|
-
"bindings",
|
|
5340
|
-
"mode",
|
|
5341
|
-
"providerAccessDigest",
|
|
5342
|
-
"version"
|
|
5343
|
-
]);
|
|
5344
|
-
let n = q(t.accessRevision);
|
|
5345
|
-
if (t.version != 1 || n < 0 || !Array.isArray(t.bindings)) return U();
|
|
5346
|
-
let r = t.bindings.map((e) => wl(e, !1));
|
|
5347
|
-
return new Set(r.map((e) => e.accessBindingId)).size == r.length ? {
|
|
5348
|
-
accessRevision: n,
|
|
5349
|
-
bindings: r,
|
|
5350
|
-
mode: Tl(t.mode),
|
|
5351
|
-
providerAccessDigest: G(t.providerAccessDigest),
|
|
5352
|
-
version: 1
|
|
5353
|
-
} : U();
|
|
5354
|
-
}
|
|
5355
|
-
function Dl(e, t) {
|
|
5356
|
-
let n = W(e);
|
|
5357
|
-
if (K(n, [
|
|
5358
|
-
"candidates",
|
|
5359
|
-
"mode",
|
|
5360
|
-
"providerId",
|
|
5361
|
-
"version"
|
|
5362
|
-
]), n.version != 1 || G(n.providerId) != t || !Array.isArray(n.candidates)) return U();
|
|
5363
|
-
let r = n.candidates.map((e) => wl(e, !0));
|
|
5364
|
-
return r.some((e) => e.providerId != t) || new Set(r.map((e) => e.accessBindingId)).size != r.length ? U() : {
|
|
5365
|
-
candidates: r,
|
|
5366
|
-
mode: Tl(n.mode),
|
|
5367
|
-
providerId: t,
|
|
5368
|
-
version: 1
|
|
5369
|
-
};
|
|
5370
|
-
}
|
|
5371
|
-
function Ol(e) {
|
|
5372
|
-
let t = W(e);
|
|
5373
|
-
if (K(t, [
|
|
5374
|
-
...Object.hasOwn(t, "providerAccountId") ? ["providerAccountId"] : [],
|
|
5375
|
-
...Object.hasOwn(t, "alias") ? ["alias"] : [],
|
|
5376
|
-
...Object.hasOwn(t, "builtInAccount") ? ["builtInAccount"] : [],
|
|
5377
|
-
"connectionId",
|
|
5378
|
-
"displayName",
|
|
5379
|
-
"isDefault",
|
|
5380
|
-
"serviceId",
|
|
5381
|
-
"status"
|
|
5382
|
-
]), t.builtInAccount !== void 0 && typeof t.builtInAccount != "boolean") return U();
|
|
5383
|
-
let n = t.status;
|
|
5384
|
-
return n != "active" && n != "disconnected" && n != "error" && n != "reauth_required" || typeof t.isDefault != "boolean" ? U() : {
|
|
5385
|
-
...t.providerAccountId === void 0 ? {} : { providerAccountId: G(t.providerAccountId) },
|
|
5386
|
-
...t.alias === void 0 ? {} : { alias: G(t.alias) },
|
|
5387
|
-
...t.builtInAccount === void 0 ? {} : { builtInAccount: t.builtInAccount },
|
|
5388
|
-
connectionId: G(t.connectionId),
|
|
5389
|
-
displayName: G(t.displayName),
|
|
5390
|
-
isDefault: t.isDefault,
|
|
5391
|
-
serviceId: G(t.serviceId),
|
|
5392
|
-
status: n
|
|
5393
|
-
};
|
|
5394
|
-
}
|
|
5395
|
-
function kl(e, t = !1) {
|
|
5396
|
-
let n = W(e), r = n.description, i = t && Object.hasOwn(n, "value");
|
|
5397
|
-
return K(n, [
|
|
5398
|
-
"jsonSchema",
|
|
5399
|
-
"nullable",
|
|
5400
|
-
...r == null ? [] : ["description"],
|
|
5401
|
-
...i ? ["value"] : []
|
|
5402
|
-
]), r != null && typeof r != "string" || typeof n.nullable != "boolean" ? U() : {
|
|
5403
|
-
...r == null ? {} : { description: r },
|
|
5404
|
-
jsonSchema: J(n.jsonSchema),
|
|
5405
|
-
nullable: n.nullable,
|
|
5406
|
-
...i ? { value: J(n.value) } : {}
|
|
5407
|
-
};
|
|
5408
|
-
}
|
|
5409
|
-
function Al(e) {
|
|
5410
|
-
return kl(e, !0);
|
|
5411
|
-
}
|
|
5412
|
-
function jl(e, t) {
|
|
5413
|
-
return Object.fromEntries(Object.entries(W(e)).map(([e, n]) => [e, t(n)]));
|
|
5414
|
-
}
|
|
5415
|
-
function Ml(e) {
|
|
5416
|
-
let t = W(e), n = t.homepageUrl, r = t.icon;
|
|
5417
|
-
return K(t, [
|
|
5418
|
-
"actionId",
|
|
5419
|
-
...Object.hasOwn(t, "operationType") ? ["operationType"] : [],
|
|
5420
|
-
...Object.hasOwn(t, "inputSchema") ? ["inputSchema"] : [],
|
|
5421
|
-
...Object.hasOwn(t, "outputSchema") ? ["outputSchema"] : [],
|
|
5422
|
-
"authenticated",
|
|
5423
|
-
"description",
|
|
5424
|
-
...n == null ? [] : ["homepageUrl"],
|
|
5425
|
-
...r == null ? [] : ["icon"],
|
|
5426
|
-
"inputs",
|
|
5427
|
-
"name",
|
|
5428
|
-
"outputs",
|
|
5429
|
-
"serviceId",
|
|
5430
|
-
"serviceName"
|
|
5431
|
-
]), n != null && typeof n != "string" || r != null && typeof r != "string" ? U() : {
|
|
5432
|
-
...t.inputSchema === void 0 ? {} : { inputSchema: J(t.inputSchema) },
|
|
5433
|
-
...t.outputSchema === void 0 ? {} : { outputSchema: J(t.outputSchema) },
|
|
5434
|
-
actionId: G(t.actionId),
|
|
5435
|
-
...t.operationType == null ? {} : { operationType: G(t.operationType) },
|
|
5436
|
-
authenticated: typeof t.authenticated == "boolean" ? t.authenticated : U(),
|
|
5437
|
-
description: typeof t.description == "string" ? t.description : U(),
|
|
5438
|
-
...n == null ? {} : { homepageUrl: n },
|
|
5439
|
-
...r == null ? {} : { icon: r },
|
|
5440
|
-
inputs: jl(t.inputs, Al),
|
|
5441
|
-
name: G(t.name),
|
|
5442
|
-
outputs: jl(t.outputs, kl),
|
|
5443
|
-
serviceId: G(t.serviceId),
|
|
5444
|
-
serviceName: G(t.serviceName)
|
|
5445
|
-
};
|
|
5446
|
-
}
|
|
5447
|
-
function Nl(e) {
|
|
5448
|
-
let { defaultConnection: t, ...n } = W(e), r = Ml(n);
|
|
5449
|
-
if (t == null) return r;
|
|
5450
|
-
let i = Ol(t);
|
|
5451
|
-
return i.serviceId != r.serviceId || i.status != "active" ? U() : {
|
|
5452
|
-
...r,
|
|
5453
|
-
defaultConnection: i
|
|
5454
|
-
};
|
|
5455
|
-
}
|
|
5456
|
-
function Pl(e) {
|
|
5457
|
-
let t = W(e), n = t.homepageUrl, r = t.icon;
|
|
5458
|
-
return t.noSetup !== void 0 && typeof t.noSetup != "boolean" || (K(t, [
|
|
5459
|
-
...Object.hasOwn(t, "noSetup") ? ["noSetup"] : [],
|
|
5460
|
-
"serviceId",
|
|
5461
|
-
"serviceName",
|
|
5462
|
-
...n == null ? [] : ["homepageUrl"],
|
|
5463
|
-
...r == null ? [] : ["icon"]
|
|
5464
|
-
]), n != null && typeof n != "string" || r != null && typeof r != "string") ? U() : {
|
|
5465
|
-
...n == null ? {} : { homepageUrl: n },
|
|
5466
|
-
...r == null ? {} : { icon: r },
|
|
5467
|
-
serviceId: G(t.serviceId),
|
|
5468
|
-
serviceName: G(t.serviceName),
|
|
5469
|
-
...t.noSetup === void 0 ? {} : { noSetup: t.noSetup }
|
|
5470
|
-
};
|
|
5471
|
-
}
|
|
5472
|
-
//#endregion
|
|
5473
5599
|
//#region src/control/common/connectorQueries.ts
|
|
5474
|
-
var
|
|
5475
|
-
function
|
|
5600
|
+
var Wl = (e) => e == null ? "" : `?flowId=${encodeURIComponent(e)}`;
|
|
5601
|
+
function Gl(e, t) {
|
|
5476
5602
|
let n = new URLSearchParams({
|
|
5477
5603
|
...e == null ? {} : { flowId: e },
|
|
5478
5604
|
...t == null ? {} : { locale: t }
|
|
@@ -5481,11 +5607,11 @@ function Il(e, t) {
|
|
|
5481
5607
|
path: `/v1/connector/providers${n ? `?${n}` : ""}`,
|
|
5482
5608
|
decode: (e) => {
|
|
5483
5609
|
let t = W(e);
|
|
5484
|
-
return K(t, ["providers", "version"]), t.version != 1 || !Array.isArray(t.providers) ? U() : t.providers.map(
|
|
5610
|
+
return K(t, ["providers", "version"]), t.version != 1 || !Array.isArray(t.providers) ? U() : t.providers.map(ul);
|
|
5485
5611
|
}
|
|
5486
5612
|
};
|
|
5487
5613
|
}
|
|
5488
|
-
function
|
|
5614
|
+
function Kl(e, t, n) {
|
|
5489
5615
|
let r = new URLSearchParams({
|
|
5490
5616
|
...t == null ? {} : { flowId: t },
|
|
5491
5617
|
...n == null ? {} : { locale: n }
|
|
@@ -5494,35 +5620,35 @@ function Ll(e, t, n) {
|
|
|
5494
5620
|
path: `/v1/connector/actions/${encodeURIComponent(e)}${r ? `?${r}` : ""}`,
|
|
5495
5621
|
decode: (e) => {
|
|
5496
5622
|
let t = W(e);
|
|
5497
|
-
return K(t, ["action", "version"]), t.version == 1 ?
|
|
5623
|
+
return K(t, ["action", "version"]), t.version == 1 ? ll(t.action) : U();
|
|
5498
5624
|
}
|
|
5499
5625
|
};
|
|
5500
5626
|
}
|
|
5501
|
-
function
|
|
5627
|
+
function ql(e) {
|
|
5502
5628
|
return {
|
|
5503
|
-
path: `/v1/connector/connections${
|
|
5629
|
+
path: `/v1/connector/connections${Wl(e)}`,
|
|
5504
5630
|
decode: (e) => {
|
|
5505
5631
|
let t = W(e);
|
|
5506
|
-
return K(t, ["connections", "version"]), t.version != 1 || !Array.isArray(t.connections) ? U() : t.connections.map(
|
|
5632
|
+
return K(t, ["connections", "version"]), t.version != 1 || !Array.isArray(t.connections) ? U() : t.connections.map(il);
|
|
5507
5633
|
}
|
|
5508
5634
|
};
|
|
5509
5635
|
}
|
|
5510
|
-
function
|
|
5636
|
+
function Jl(e, t) {
|
|
5511
5637
|
return {
|
|
5512
|
-
path: `/v1/connector/connections/${encodeURIComponent(e)}${
|
|
5638
|
+
path: `/v1/connector/connections/${encodeURIComponent(e)}${Wl(t)}`,
|
|
5513
5639
|
decode: (t) => {
|
|
5514
5640
|
let n = W(t);
|
|
5515
5641
|
return K(n, [
|
|
5516
5642
|
"connections",
|
|
5517
5643
|
"serviceId",
|
|
5518
5644
|
"version"
|
|
5519
|
-
]), n.version != 1 || G(n.serviceId) != e || !Array.isArray(n.connections) ? U() : n.connections.map(
|
|
5645
|
+
]), n.version != 1 || G(n.serviceId) != e || !Array.isArray(n.connections) ? U() : n.connections.map(il);
|
|
5520
5646
|
}
|
|
5521
5647
|
};
|
|
5522
5648
|
}
|
|
5523
5649
|
//#endregion
|
|
5524
5650
|
//#region src/control/common/flowDecoders.ts
|
|
5525
|
-
function
|
|
5651
|
+
function Yl(e) {
|
|
5526
5652
|
let t = W(e), n = t.status;
|
|
5527
5653
|
if (t.version != 1 || n != "active" && n != "retiring") return U();
|
|
5528
5654
|
let r = t.live == null ? void 0 : W(t.live);
|
|
@@ -5541,18 +5667,18 @@ function Bl(e) {
|
|
|
5541
5667
|
version: 1
|
|
5542
5668
|
};
|
|
5543
5669
|
}
|
|
5544
|
-
function
|
|
5670
|
+
function Xl(e) {
|
|
5545
5671
|
let t = W(e);
|
|
5546
5672
|
if (t.version != 1 || !Array.isArray(t.flows)) return U();
|
|
5547
5673
|
let n = t.nextCursor, r = t.total;
|
|
5548
5674
|
return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
|
|
5549
5675
|
...n == null ? {} : { nextCursor: n },
|
|
5550
|
-
flows: t.flows.map(
|
|
5676
|
+
flows: t.flows.map(Yl),
|
|
5551
5677
|
...r == null ? {} : { total: r },
|
|
5552
5678
|
version: 1
|
|
5553
5679
|
};
|
|
5554
5680
|
}
|
|
5555
|
-
function
|
|
5681
|
+
function Zl(e) {
|
|
5556
5682
|
let t = W(e);
|
|
5557
5683
|
if (K(t, [
|
|
5558
5684
|
"name",
|
|
@@ -5575,7 +5701,7 @@ function Hl(e) {
|
|
|
5575
5701
|
}
|
|
5576
5702
|
//#endregion
|
|
5577
5703
|
//#region src/control/common/publicationDecoders.ts
|
|
5578
|
-
function
|
|
5704
|
+
function Ql(e) {
|
|
5579
5705
|
let t = W(e), n = t.operation, r = t.sourcePublicationId;
|
|
5580
5706
|
return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ? U() : {
|
|
5581
5707
|
actorId: G(t.actorId),
|
|
@@ -5593,7 +5719,7 @@ function Ul(e) {
|
|
|
5593
5719
|
version: 1
|
|
5594
5720
|
};
|
|
5595
5721
|
}
|
|
5596
|
-
function
|
|
5722
|
+
function $l(e) {
|
|
5597
5723
|
let t = W(e), n = t.status, r = {
|
|
5598
5724
|
createdAt: G(t.createdAt),
|
|
5599
5725
|
flowId: G(t.flowId),
|
|
@@ -5659,91 +5785,29 @@ function Wl(e) {
|
|
|
5659
5785
|
default: return U();
|
|
5660
5786
|
}
|
|
5661
5787
|
}
|
|
5662
|
-
function
|
|
5788
|
+
function eu(e) {
|
|
5663
5789
|
let t = W(e), n = t.status, r = t.publication;
|
|
5664
5790
|
return t.version != 1 || typeof t.hasUnpublishedChanges != "boolean" || n != "not-published" && n != "runnable" && n != "suspended" || n == "not-published" && r !== null || n != "not-published" && r === null ? U() : {
|
|
5665
5791
|
flowId: G(t.flowId),
|
|
5666
5792
|
hasUnpublishedChanges: t.hasUnpublishedChanges,
|
|
5667
|
-
publication: r === null ? null :
|
|
5793
|
+
publication: r === null ? null : Ql(r),
|
|
5668
5794
|
revision: q(t.revision),
|
|
5669
5795
|
status: n,
|
|
5670
5796
|
version: 1
|
|
5671
5797
|
};
|
|
5672
5798
|
}
|
|
5673
|
-
function
|
|
5799
|
+
function tu(e) {
|
|
5674
5800
|
let t = W(e), n = t.nextCursor, r = t.total;
|
|
5675
5801
|
return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? U() : {
|
|
5676
5802
|
...n == null ? {} : { nextCursor: n },
|
|
5677
|
-
publications: t.publications.map(
|
|
5803
|
+
publications: t.publications.map(Ql),
|
|
5678
5804
|
...r == null ? {} : { total: r },
|
|
5679
5805
|
version: 1
|
|
5680
5806
|
};
|
|
5681
5807
|
}
|
|
5682
|
-
new TextEncoder();
|
|
5683
|
-
var ql = I(O(), fs()), Jl = N({
|
|
5684
|
-
jsonSchema: fs(),
|
|
5685
|
-
nullable: j(),
|
|
5686
|
-
value: fs().optional(),
|
|
5687
|
-
description: O().optional()
|
|
5688
|
-
}).strict(), Yl = I(O(), Jl), Xl = F([N({
|
|
5689
|
-
kind: R("value"),
|
|
5690
|
-
value: fs()
|
|
5691
|
-
}).strict(), N({
|
|
5692
|
-
kind: R("sources"),
|
|
5693
|
-
sources: M(N({
|
|
5694
|
-
kind: R("node"),
|
|
5695
|
-
nodeId: O(),
|
|
5696
|
-
output: O()
|
|
5697
|
-
}).strict())
|
|
5698
|
-
}).strict()]), Zl = {
|
|
5699
|
-
name: O().optional(),
|
|
5700
|
-
description: O().optional(),
|
|
5701
|
-
icon: O().optional()
|
|
5702
|
-
}, Ql = F([
|
|
5703
|
-
N({
|
|
5704
|
-
...Zl,
|
|
5705
|
-
kind: R("cron"),
|
|
5706
|
-
cronTimes: M(fs())
|
|
5707
|
-
}).strict(),
|
|
5708
|
-
N({
|
|
5709
|
-
...Zl,
|
|
5710
|
-
kind: R("manual")
|
|
5711
|
-
}).strict(),
|
|
5712
|
-
N({
|
|
5713
|
-
...Zl,
|
|
5714
|
-
kind: R("task"),
|
|
5715
|
-
concurrency: R(1).optional(),
|
|
5716
|
-
inputs: I(O(), Xl),
|
|
5717
|
-
task: N({
|
|
5718
|
-
name: O(),
|
|
5719
|
-
moduleId: O(),
|
|
5720
|
-
inputs: Yl,
|
|
5721
|
-
outputs: I(O(), Jl.omit({ value: !0 }))
|
|
5722
|
-
}).strict()
|
|
5723
|
-
}).strict()
|
|
5724
|
-
]);
|
|
5725
|
-
N({
|
|
5726
|
-
name: O(),
|
|
5727
|
-
graph: N({ nodes: I(O(), Ql) }).strict()
|
|
5728
|
-
}).strict(), N({
|
|
5729
|
-
kind: R("open-flow-project-revision"),
|
|
5730
|
-
version: R(1),
|
|
5731
|
-
modelVersion: F([R(1), R(2)]),
|
|
5732
|
-
modules: I(O(), N({
|
|
5733
|
-
name: O(),
|
|
5734
|
-
source: O(),
|
|
5735
|
-
imports: M(O())
|
|
5736
|
-
}).strict()),
|
|
5737
|
-
document: N({
|
|
5738
|
-
bindings: ql,
|
|
5739
|
-
flows: ql,
|
|
5740
|
-
subflows: ql,
|
|
5741
|
-
tasks: ql
|
|
5742
|
-
}).strict()
|
|
5743
|
-
}).strict();
|
|
5744
5808
|
//#endregion
|
|
5745
5809
|
//#region src/control/common/revisionDecoders.ts
|
|
5746
|
-
function
|
|
5810
|
+
function nu(e) {
|
|
5747
5811
|
let t = W(e), n = t.parentRevisionId;
|
|
5748
5812
|
return t.version != 1 || n !== null && typeof n != "string" ? U() : {
|
|
5749
5813
|
actorId: G(t.actorId),
|
|
@@ -5756,18 +5820,18 @@ function $l(e) {
|
|
|
5756
5820
|
version: 1
|
|
5757
5821
|
};
|
|
5758
5822
|
}
|
|
5759
|
-
function
|
|
5823
|
+
function ru(e) {
|
|
5760
5824
|
let t = W(e);
|
|
5761
5825
|
try {
|
|
5762
5826
|
return {
|
|
5763
|
-
|
|
5827
|
+
...nu(t),
|
|
5764
5828
|
content: Ic(t.content)
|
|
5765
5829
|
};
|
|
5766
5830
|
} catch {
|
|
5767
5831
|
return U();
|
|
5768
5832
|
}
|
|
5769
5833
|
}
|
|
5770
|
-
function
|
|
5834
|
+
function iu(e) {
|
|
5771
5835
|
let t = W(e);
|
|
5772
5836
|
return t.version != 1 || q(t.revision) < 1 ? U() : {
|
|
5773
5837
|
revision: q(t.revision),
|
|
@@ -5776,28 +5840,28 @@ function tu(e) {
|
|
|
5776
5840
|
version: 1
|
|
5777
5841
|
};
|
|
5778
5842
|
}
|
|
5779
|
-
function
|
|
5843
|
+
function au(e) {
|
|
5780
5844
|
let t = W(e);
|
|
5781
5845
|
return t.version == 1 ? {
|
|
5782
|
-
revision:
|
|
5846
|
+
revision: nu(t.revision),
|
|
5783
5847
|
version: 1
|
|
5784
5848
|
} : U();
|
|
5785
5849
|
}
|
|
5786
|
-
function
|
|
5850
|
+
function ou(e) {
|
|
5787
5851
|
let t = W(e);
|
|
5788
5852
|
return t.version != 1 || t.kind != "snapshot" ? U() : {
|
|
5789
|
-
draft:
|
|
5853
|
+
draft: ru(t.draft),
|
|
5790
5854
|
kind: "snapshot",
|
|
5791
5855
|
version: 1
|
|
5792
5856
|
};
|
|
5793
5857
|
}
|
|
5794
5858
|
//#endregion
|
|
5795
5859
|
//#region src/control/common/runDecoders.ts
|
|
5796
|
-
var
|
|
5797
|
-
function
|
|
5798
|
-
return typeof e == "string" &&
|
|
5860
|
+
var su = new Set($s);
|
|
5861
|
+
function cu(e) {
|
|
5862
|
+
return typeof e == "string" && su.has(e) ? e : U();
|
|
5799
5863
|
}
|
|
5800
|
-
function
|
|
5864
|
+
function lu(e) {
|
|
5801
5865
|
let t = W(e), n = t.source, r = t.startedAt, i = t.finishedAt;
|
|
5802
5866
|
return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || i != null && typeof i != "string" ? U() : {
|
|
5803
5867
|
createdAt: G(t.createdAt),
|
|
@@ -5807,11 +5871,11 @@ function ou(e) {
|
|
|
5807
5871
|
runId: G(t.runId),
|
|
5808
5872
|
source: n,
|
|
5809
5873
|
...r == null ? {} : { startedAt: r },
|
|
5810
|
-
status:
|
|
5874
|
+
status: cu(t.status),
|
|
5811
5875
|
version: 1
|
|
5812
5876
|
};
|
|
5813
5877
|
}
|
|
5814
|
-
function
|
|
5878
|
+
function uu(e) {
|
|
5815
5879
|
let t = W(e);
|
|
5816
5880
|
K(t, [
|
|
5817
5881
|
"actions",
|
|
@@ -5831,10 +5895,10 @@ function su(e) {
|
|
|
5831
5895
|
waitingSince: G(t.waitingSince)
|
|
5832
5896
|
};
|
|
5833
5897
|
}
|
|
5834
|
-
function
|
|
5835
|
-
let t = W(e), n =
|
|
5898
|
+
function du(e) {
|
|
5899
|
+
let t = W(e), n = lu(t), r = t.eventsExpiresAt;
|
|
5836
5900
|
if (r != null && typeof r != "string" || t.waiting !== void 0 || !Array.isArray(t.waits)) return U();
|
|
5837
|
-
let i = t.waits.map(
|
|
5901
|
+
let i = t.waits.map(uu);
|
|
5838
5902
|
if (new Set(i.map((e) => e.waitId)).size != i.length || n.status == "waiting" && i.length == 0 || [
|
|
5839
5903
|
"completed",
|
|
5840
5904
|
"failed",
|
|
@@ -5874,17 +5938,17 @@ function cu(e) {
|
|
|
5874
5938
|
};
|
|
5875
5939
|
}
|
|
5876
5940
|
}
|
|
5877
|
-
function
|
|
5941
|
+
function fu(e) {
|
|
5878
5942
|
let t = W(e), n = t.nextCursor;
|
|
5879
5943
|
return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? U() : {
|
|
5880
5944
|
flowId: G(t.flowId),
|
|
5881
5945
|
...n == null ? {} : { nextCursor: n },
|
|
5882
|
-
runs: t.runs.map(
|
|
5946
|
+
runs: t.runs.map(lu),
|
|
5883
5947
|
version: 1
|
|
5884
5948
|
};
|
|
5885
5949
|
}
|
|
5886
|
-
function
|
|
5887
|
-
let t = W(e), n =
|
|
5950
|
+
function pu(e) {
|
|
5951
|
+
let t = W(e), n = cu(t.status);
|
|
5888
5952
|
return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? U() : {
|
|
5889
5953
|
cancelAccepted: t.cancelAccepted,
|
|
5890
5954
|
runId: G(t.runId),
|
|
@@ -5892,7 +5956,7 @@ function uu(e) {
|
|
|
5892
5956
|
version: 1
|
|
5893
5957
|
};
|
|
5894
5958
|
}
|
|
5895
|
-
function
|
|
5959
|
+
function mu(e) {
|
|
5896
5960
|
let t = W(e);
|
|
5897
5961
|
K(t, [
|
|
5898
5962
|
"action",
|
|
@@ -5911,12 +5975,12 @@ function du(e) {
|
|
|
5911
5975
|
resolutionAccepted: t.resolutionAccepted,
|
|
5912
5976
|
resolvedAt: r,
|
|
5913
5977
|
runId: G(t.runId),
|
|
5914
|
-
status:
|
|
5978
|
+
status: cu(t.status),
|
|
5915
5979
|
version: 1,
|
|
5916
5980
|
waitId: G(t.waitId)
|
|
5917
5981
|
};
|
|
5918
5982
|
}
|
|
5919
|
-
function
|
|
5983
|
+
function hu(e) {
|
|
5920
5984
|
let t = W(e), n = t.status;
|
|
5921
5985
|
if (t.version != 1) return U();
|
|
5922
5986
|
let r = {
|
|
@@ -5959,7 +6023,7 @@ function fu(e) {
|
|
|
5959
6023
|
}
|
|
5960
6024
|
//#endregion
|
|
5961
6025
|
//#region src/control/common/random.ts
|
|
5962
|
-
function
|
|
6026
|
+
function gu() {
|
|
5963
6027
|
let e = globalThis.crypto;
|
|
5964
6028
|
if (e != null) {
|
|
5965
6029
|
try {
|
|
@@ -5976,7 +6040,7 @@ function pu() {
|
|
|
5976
6040
|
}
|
|
5977
6041
|
//#endregion
|
|
5978
6042
|
//#region src/control/common/api.ts
|
|
5979
|
-
function
|
|
6043
|
+
function _u(e) {
|
|
5980
6044
|
let t = W(e), n = q(t.sequence);
|
|
5981
6045
|
if (n < 0) return U();
|
|
5982
6046
|
let r = {
|
|
@@ -6004,7 +6068,7 @@ function mu(e) {
|
|
|
6004
6068
|
payload: {
|
|
6005
6069
|
flowId: G(i.flowId),
|
|
6006
6070
|
scopeId: G(i.scopeId),
|
|
6007
|
-
progress:
|
|
6071
|
+
progress: vu(i.progress)
|
|
6008
6072
|
}
|
|
6009
6073
|
};
|
|
6010
6074
|
case "run.waiting": return Array.isArray(i.waitIds) ? {
|
|
@@ -6113,7 +6177,7 @@ function mu(e) {
|
|
|
6113
6177
|
kind: a,
|
|
6114
6178
|
payload: {
|
|
6115
6179
|
...e,
|
|
6116
|
-
progress:
|
|
6180
|
+
progress: vu(i.progress)
|
|
6117
6181
|
}
|
|
6118
6182
|
};
|
|
6119
6183
|
case "node.artifact": {
|
|
@@ -6139,14 +6203,14 @@ function mu(e) {
|
|
|
6139
6203
|
default: return U();
|
|
6140
6204
|
}
|
|
6141
6205
|
}
|
|
6142
|
-
function
|
|
6206
|
+
function vu(e) {
|
|
6143
6207
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : U();
|
|
6144
6208
|
}
|
|
6145
|
-
function
|
|
6209
|
+
function yu(e) {
|
|
6146
6210
|
let t = W(e), n = t.eventsExpiresAt, r = q(t.nextAfter);
|
|
6147
6211
|
return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? U() : {
|
|
6148
6212
|
done: t.done,
|
|
6149
|
-
events: t.events.map(
|
|
6213
|
+
events: t.events.map(_u),
|
|
6150
6214
|
...n == null ? {} : { eventsExpiresAt: n },
|
|
6151
6215
|
historyComplete: t.historyComplete,
|
|
6152
6216
|
nextAfter: r,
|
|
@@ -6155,10 +6219,10 @@ function gu(e) {
|
|
|
6155
6219
|
};
|
|
6156
6220
|
}
|
|
6157
6221
|
var Y = encodeURIComponent;
|
|
6158
|
-
function
|
|
6159
|
-
return `${e}-${
|
|
6222
|
+
function bu(e) {
|
|
6223
|
+
return `${e}-${gu()}`;
|
|
6160
6224
|
}
|
|
6161
|
-
var
|
|
6225
|
+
var xu = class {
|
|
6162
6226
|
constructor(e) {
|
|
6163
6227
|
this.requestControl = e;
|
|
6164
6228
|
}
|
|
@@ -6166,23 +6230,23 @@ var vu = class {
|
|
|
6166
6230
|
let t = new URLSearchParams();
|
|
6167
6231
|
e.cursor != null && t.set("cursor", e.cursor), e.limit != null && t.set("limit", String(e.limit)), e.includeTotal != null && t.set("includeTotal", String(e.includeTotal));
|
|
6168
6232
|
let n = t.size == 0 ? "" : `?${t}`;
|
|
6169
|
-
return
|
|
6233
|
+
return Xl(await this.request(`/v1/flows${n}`));
|
|
6170
6234
|
}
|
|
6171
6235
|
async listEventSources(e, t) {
|
|
6172
|
-
return
|
|
6236
|
+
return gl(await this.request("/v1/event-sources" + (e == null ? "" : `?flowId=${Y(e)}`), { signal: t }));
|
|
6173
6237
|
}
|
|
6174
6238
|
async listEventSourceConnections(e, t) {
|
|
6175
6239
|
let n = W(await this.request(`/v1/event-sources/connections${e == null ? "" : `?teamId=${Y(e)}`}`, { signal: t }));
|
|
6176
|
-
return K(n, ["version", "connections"]), n.version != 1 || !Array.isArray(n.connections) ? U() : n.connections.map(
|
|
6240
|
+
return K(n, ["version", "connections"]), n.version != 1 || !Array.isArray(n.connections) ? U() : n.connections.map(il);
|
|
6177
6241
|
}
|
|
6178
6242
|
async createEventSource(e) {
|
|
6179
|
-
return
|
|
6243
|
+
return hl(await this.request("/v1/event-sources", {
|
|
6180
6244
|
method: "POST",
|
|
6181
6245
|
body: JSON.stringify(e)
|
|
6182
6246
|
}));
|
|
6183
6247
|
}
|
|
6184
6248
|
async updateEventSource(e, t) {
|
|
6185
|
-
return
|
|
6249
|
+
return hl(await this.request(`/v1/event-sources/${Y(e)}`, {
|
|
6186
6250
|
method: "PUT",
|
|
6187
6251
|
body: JSON.stringify(t)
|
|
6188
6252
|
}));
|
|
@@ -6199,15 +6263,15 @@ var vu = class {
|
|
|
6199
6263
|
async listVariables() {
|
|
6200
6264
|
let e = W(await this.request("/v1/variables"));
|
|
6201
6265
|
return K(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? U() : {
|
|
6202
|
-
variables: e.variables.map(
|
|
6266
|
+
variables: e.variables.map(Zl),
|
|
6203
6267
|
version: 1
|
|
6204
6268
|
};
|
|
6205
6269
|
}
|
|
6206
6270
|
async getVariable(e) {
|
|
6207
|
-
return
|
|
6271
|
+
return Zl(await this.request(`/v1/variables/${Y(e)}`));
|
|
6208
6272
|
}
|
|
6209
6273
|
async putVariable(e, t) {
|
|
6210
|
-
return
|
|
6274
|
+
return Zl(await this.request(`/v1/variables/${Y(e)}`, {
|
|
6211
6275
|
body: JSON.stringify({ value: t }),
|
|
6212
6276
|
method: "PUT"
|
|
6213
6277
|
}));
|
|
@@ -6216,8 +6280,8 @@ var vu = class {
|
|
|
6216
6280
|
let t = W(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
|
|
6217
6281
|
if (K(t, ["version"]), t.version != 1) return U();
|
|
6218
6282
|
}
|
|
6219
|
-
async createFlow(e, t = `flow-${
|
|
6220
|
-
return
|
|
6283
|
+
async createFlow(e, t = `flow-${gu()}`) {
|
|
6284
|
+
return Yl(await this.request("/v1/flows", {
|
|
6221
6285
|
body: JSON.stringify({
|
|
6222
6286
|
name: e,
|
|
6223
6287
|
version: 1
|
|
@@ -6227,10 +6291,10 @@ var vu = class {
|
|
|
6227
6291
|
}));
|
|
6228
6292
|
}
|
|
6229
6293
|
async getFlow(e) {
|
|
6230
|
-
return
|
|
6294
|
+
return Yl(await this.request(`/v1/flows/${Y(e)}`));
|
|
6231
6295
|
}
|
|
6232
6296
|
async renameFlow(e, t) {
|
|
6233
|
-
return
|
|
6297
|
+
return Yl(await this.request(`/v1/flows/${Y(e)}`, {
|
|
6234
6298
|
body: JSON.stringify({
|
|
6235
6299
|
name: t,
|
|
6236
6300
|
version: 1
|
|
@@ -6239,15 +6303,15 @@ var vu = class {
|
|
|
6239
6303
|
}));
|
|
6240
6304
|
}
|
|
6241
6305
|
async deleteFlow(e) {
|
|
6242
|
-
return
|
|
6306
|
+
return Yl(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
|
|
6243
6307
|
}
|
|
6244
6308
|
async listTriggerKeys(e, t) {
|
|
6245
6309
|
let n = W(await this.request(`/v1/trigger-keys${t == null ? "" : `?locale=${encodeURIComponent(t)}`}`, { signal: e }));
|
|
6246
|
-
return n.version != 1 || !Array.isArray(n.keys) ? U() : n.keys.map(
|
|
6310
|
+
return n.version != 1 || !Array.isArray(n.keys) ? U() : n.keys.map(bl);
|
|
6247
6311
|
}
|
|
6248
6312
|
async listTriggerDefinitions(e) {
|
|
6249
6313
|
let t = W(await this.request("/v1/trigger-keys/catalog", { signal: e }));
|
|
6250
|
-
return t.version != 2 || !Array.isArray(t.definitions) ? U() : t.definitions.map(
|
|
6314
|
+
return t.version != 2 || !Array.isArray(t.definitions) ? U() : t.definitions.map(xl);
|
|
6251
6315
|
}
|
|
6252
6316
|
async readCatalog(e, t, n) {
|
|
6253
6317
|
let r = new Headers();
|
|
@@ -6276,41 +6340,41 @@ var vu = class {
|
|
|
6276
6340
|
...t,
|
|
6277
6341
|
etag: i.headers.get("etag")?.trim() || t.etag
|
|
6278
6342
|
} : {
|
|
6279
|
-
data:
|
|
6343
|
+
data: Al(await i.json()),
|
|
6280
6344
|
etag: i.headers.get("etag")?.trim() || null
|
|
6281
6345
|
};
|
|
6282
6346
|
}
|
|
6283
6347
|
async getTriggerKey(e, t) {
|
|
6284
6348
|
let n = W(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
|
|
6285
|
-
return n.version == 1 ?
|
|
6349
|
+
return n.version == 1 ? xl(n.definition) : U();
|
|
6286
6350
|
}
|
|
6287
6351
|
async listFlowTriggerBindings(e, t) {
|
|
6288
6352
|
let n = W(await this.request(`/v1/flows/${Y(e)}/triggers`, { signal: t }));
|
|
6289
|
-
return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(
|
|
6353
|
+
return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(Tl);
|
|
6290
6354
|
}
|
|
6291
6355
|
async getFlowTriggerBinding(e, t) {
|
|
6292
|
-
return
|
|
6356
|
+
return El(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
|
|
6293
6357
|
}
|
|
6294
6358
|
async listFlowTriggerActivities(e, t, n = {}) {
|
|
6295
6359
|
let r = new URLSearchParams();
|
|
6296
6360
|
n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
|
|
6297
6361
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
6298
|
-
return
|
|
6362
|
+
return Ol(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
|
|
6299
6363
|
}
|
|
6300
6364
|
async pauseFlowTrigger(e, t) {
|
|
6301
|
-
return
|
|
6365
|
+
return Tl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
|
|
6302
6366
|
body: JSON.stringify({ version: 1 }),
|
|
6303
6367
|
method: "POST"
|
|
6304
6368
|
}));
|
|
6305
6369
|
}
|
|
6306
6370
|
async resumeFlowTrigger(e, t) {
|
|
6307
|
-
return
|
|
6371
|
+
return Tl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
|
|
6308
6372
|
body: JSON.stringify({ version: 1 }),
|
|
6309
6373
|
method: "POST"
|
|
6310
6374
|
}));
|
|
6311
6375
|
}
|
|
6312
6376
|
async testFlowPollTrigger(e, t) {
|
|
6313
|
-
return
|
|
6377
|
+
return kl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
|
|
6314
6378
|
body: JSON.stringify({ version: 1 }),
|
|
6315
6379
|
method: "POST"
|
|
6316
6380
|
}));
|
|
@@ -6319,25 +6383,25 @@ var vu = class {
|
|
|
6319
6383
|
let t = W(await this.request(`/v1/flows/${Y(e)}/editor`));
|
|
6320
6384
|
if (t.version != 1) return U();
|
|
6321
6385
|
let n = {
|
|
6322
|
-
flow:
|
|
6323
|
-
draft:
|
|
6324
|
-
live:
|
|
6325
|
-
presentation:
|
|
6386
|
+
flow: Yl(t.flow),
|
|
6387
|
+
draft: ru(t.draft),
|
|
6388
|
+
live: eu(t.live),
|
|
6389
|
+
presentation: iu(t.presentation),
|
|
6326
6390
|
version: 1
|
|
6327
6391
|
};
|
|
6328
6392
|
return n.flow.flowId != e || n.draft.flowId != e || n.live.flowId != e || n.flow.draftRevisionId != n.draft.revisionId ? U() : n;
|
|
6329
6393
|
}
|
|
6330
6394
|
async getPresentation(e) {
|
|
6331
|
-
return
|
|
6395
|
+
return iu(await this.request(`/v1/flows/${Y(e)}/presentation`));
|
|
6332
6396
|
}
|
|
6333
6397
|
async getDraft(e) {
|
|
6334
|
-
return
|
|
6398
|
+
return ru(await this.request(`/v1/flows/${Y(e)}/draft`));
|
|
6335
6399
|
}
|
|
6336
6400
|
async syncDraft(e) {
|
|
6337
|
-
return
|
|
6401
|
+
return ou(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
|
|
6338
6402
|
}
|
|
6339
6403
|
async getRevision(e, t) {
|
|
6340
|
-
return
|
|
6404
|
+
return ru(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
|
|
6341
6405
|
}
|
|
6342
6406
|
async listTriggerConfigOptions(e, t, n, r) {
|
|
6343
6407
|
let i = W(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/options/${Y(n)}`, { signal: r }));
|
|
@@ -6360,17 +6424,33 @@ var vu = class {
|
|
|
6360
6424
|
});
|
|
6361
6425
|
}
|
|
6362
6426
|
async listConnectorProviders(e, t, n) {
|
|
6363
|
-
let r =
|
|
6427
|
+
let r = Gl(t, n);
|
|
6364
6428
|
return this.connectorRequest(r.path, "providers", e, r.decode);
|
|
6365
6429
|
}
|
|
6366
6430
|
async getConnectorAccess(e, t) {
|
|
6367
|
-
return
|
|
6431
|
+
return tl(await this.request(`/v1/flows/${Y(e)}/connector-access`, { signal: t }));
|
|
6368
6432
|
}
|
|
6369
6433
|
async listProviderAccessBindingCandidates(e, t, n) {
|
|
6370
|
-
return
|
|
6434
|
+
return rl(await this.request(`/v1/flows/${Y(e)}/connector-access/candidates/query`, {
|
|
6435
|
+
method: "POST",
|
|
6436
|
+
body: JSON.stringify({
|
|
6437
|
+
providerIds: t,
|
|
6438
|
+
version: 1
|
|
6439
|
+
}),
|
|
6440
|
+
signal: n
|
|
6441
|
+
}), t);
|
|
6442
|
+
}
|
|
6443
|
+
async setConnectorService(e, t, n, r) {
|
|
6444
|
+
return tl(await this.request(`/v1/flows/${Y(e)}/connector-access/${Y(t)}/service`, {
|
|
6445
|
+
body: JSON.stringify({
|
|
6446
|
+
expectedAccessRevision: r,
|
|
6447
|
+
version: 1
|
|
6448
|
+
}),
|
|
6449
|
+
method: n ? "PUT" : "DELETE"
|
|
6450
|
+
}));
|
|
6371
6451
|
}
|
|
6372
6452
|
async addProviderAccessBinding(e, t, n, r) {
|
|
6373
|
-
return
|
|
6453
|
+
return tl(await this.request(`/v1/flows/${Y(e)}/connector-access/${Y(t)}`, {
|
|
6374
6454
|
body: JSON.stringify({
|
|
6375
6455
|
accessBindingId: n,
|
|
6376
6456
|
expectedAccessRevision: r,
|
|
@@ -6380,7 +6460,7 @@ var vu = class {
|
|
|
6380
6460
|
}));
|
|
6381
6461
|
}
|
|
6382
6462
|
async removeProviderAccessBinding(e, t, n, r) {
|
|
6383
|
-
return
|
|
6463
|
+
return tl(await this.request(`/v1/flows/${Y(e)}/connector-access/${Y(t)}`, {
|
|
6384
6464
|
body: JSON.stringify({
|
|
6385
6465
|
accessBindingId: n,
|
|
6386
6466
|
expectedAccessRevision: r,
|
|
@@ -6404,15 +6484,15 @@ var vu = class {
|
|
|
6404
6484
|
}, t);
|
|
6405
6485
|
}
|
|
6406
6486
|
async getConnectorAction(e, t, n, r, i = !1) {
|
|
6407
|
-
let a =
|
|
6487
|
+
let a = Kl(e, n, r);
|
|
6408
6488
|
return this.connectorRequest(a.path, "actions", t, a.decode, i);
|
|
6409
6489
|
}
|
|
6410
6490
|
async listAllConnectorConnections(e, t, n = !1) {
|
|
6411
|
-
let r =
|
|
6491
|
+
let r = ql(t);
|
|
6412
6492
|
return this.connectorRequest(r.path, "connections", e, r.decode, n);
|
|
6413
6493
|
}
|
|
6414
6494
|
async listConnectorConnections(e, t, n, r = !1) {
|
|
6415
|
-
let i =
|
|
6495
|
+
let i = Jl(e, n);
|
|
6416
6496
|
return this.connectorRequest(i.path, "connections", t, i.decode, r);
|
|
6417
6497
|
}
|
|
6418
6498
|
async createConnectorConnectionPage(e, t, n) {
|
|
@@ -6430,8 +6510,8 @@ var vu = class {
|
|
|
6430
6510
|
return U();
|
|
6431
6511
|
}
|
|
6432
6512
|
}
|
|
6433
|
-
async changeDraft(e, t, n, r =
|
|
6434
|
-
return
|
|
6513
|
+
async changeDraft(e, t, n, r = bu("change")) {
|
|
6514
|
+
return au(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
|
|
6435
6515
|
body: JSON.stringify({
|
|
6436
6516
|
expectedRevisionId: t,
|
|
6437
6517
|
operations: n,
|
|
@@ -6441,8 +6521,8 @@ var vu = class {
|
|
|
6441
6521
|
method: "POST"
|
|
6442
6522
|
}));
|
|
6443
6523
|
}
|
|
6444
|
-
async repairDraft(e, t, n =
|
|
6445
|
-
return
|
|
6524
|
+
async repairDraft(e, t, n = bu("repair")) {
|
|
6525
|
+
return au(await this.request(`/v1/flows/${Y(e)}/draft/repair`, {
|
|
6446
6526
|
body: JSON.stringify({
|
|
6447
6527
|
expectedRevisionId: t,
|
|
6448
6528
|
version: 1
|
|
@@ -6452,7 +6532,7 @@ var vu = class {
|
|
|
6452
6532
|
}));
|
|
6453
6533
|
}
|
|
6454
6534
|
async checkFlow(e, t) {
|
|
6455
|
-
return
|
|
6535
|
+
return Ul(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
|
|
6456
6536
|
body: JSON.stringify({
|
|
6457
6537
|
engineContract: "open-flow-engine/v5",
|
|
6458
6538
|
version: 1
|
|
@@ -6461,42 +6541,42 @@ var vu = class {
|
|
|
6461
6541
|
}));
|
|
6462
6542
|
}
|
|
6463
6543
|
async getLive(e, t) {
|
|
6464
|
-
return
|
|
6544
|
+
return eu(await this.request(`/v1/flows/${Y(e)}/live`, { signal: t }));
|
|
6465
6545
|
}
|
|
6466
6546
|
async listPublications(e, t = {}, n) {
|
|
6467
6547
|
let r = new URLSearchParams();
|
|
6468
6548
|
t.cursor != null && r.set("cursor", t.cursor), t.limit != null && r.set("limit", String(t.limit)), t.includeTotal != null && r.set("includeTotal", String(t.includeTotal));
|
|
6469
6549
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
6470
|
-
return
|
|
6550
|
+
return tu(await this.request(`/v1/flows/${Y(e)}/publications${i}`, { signal: n }));
|
|
6471
6551
|
}
|
|
6472
6552
|
async createDraftRun(e, t, n) {
|
|
6473
|
-
let r =
|
|
6553
|
+
let r = du(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
|
|
6474
6554
|
body: JSON.stringify({
|
|
6475
6555
|
engineContract: "open-flow-engine/v5",
|
|
6476
6556
|
inputs: n.inputs ?? {},
|
|
6477
6557
|
trigger: n.trigger,
|
|
6478
6558
|
version: 2
|
|
6479
6559
|
}),
|
|
6480
|
-
headers: { "idempotency-key": n.idempotencyKey ??
|
|
6560
|
+
headers: { "idempotency-key": n.idempotencyKey ?? bu("run") },
|
|
6481
6561
|
method: "POST"
|
|
6482
6562
|
}));
|
|
6483
6563
|
return r.source == "draft" ? r : U();
|
|
6484
6564
|
}
|
|
6485
6565
|
async createLiveRun(e, t) {
|
|
6486
|
-
let n =
|
|
6566
|
+
let n = du(await this.request("/v1/runs", {
|
|
6487
6567
|
body: JSON.stringify({
|
|
6488
6568
|
inputs: t.inputs ?? {},
|
|
6489
6569
|
trigger: t.trigger,
|
|
6490
6570
|
publicationId: e,
|
|
6491
6571
|
version: 2
|
|
6492
6572
|
}),
|
|
6493
|
-
headers: { "idempotency-key": t.idempotencyKey ??
|
|
6573
|
+
headers: { "idempotency-key": t.idempotencyKey ?? bu("run") },
|
|
6494
6574
|
method: "POST"
|
|
6495
6575
|
}));
|
|
6496
6576
|
return n.source == "live" ? n : U();
|
|
6497
6577
|
}
|
|
6498
6578
|
async setFlowEnabled(e, t, n) {
|
|
6499
|
-
return
|
|
6579
|
+
return Yl(await this.request(`/v1/flows/${Y(e)}/enabled`, {
|
|
6500
6580
|
method: "PUT",
|
|
6501
6581
|
body: JSON.stringify({
|
|
6502
6582
|
enabled: n,
|
|
@@ -6506,65 +6586,65 @@ var vu = class {
|
|
|
6506
6586
|
}));
|
|
6507
6587
|
}
|
|
6508
6588
|
async publishFlow(e, t, n, r = {}) {
|
|
6509
|
-
return
|
|
6589
|
+
return $l(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
|
|
6510
6590
|
body: JSON.stringify({
|
|
6511
6591
|
engineContract: "open-flow-engine/v5",
|
|
6512
6592
|
expectedLivePublicationId: n,
|
|
6513
6593
|
version: 1
|
|
6514
6594
|
}),
|
|
6515
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
6595
|
+
headers: { "idempotency-key": r.idempotencyKey ?? bu("publication") },
|
|
6516
6596
|
method: "POST"
|
|
6517
6597
|
}));
|
|
6518
6598
|
}
|
|
6519
6599
|
async getPublishOperation(e, t, n) {
|
|
6520
|
-
return
|
|
6600
|
+
return $l(await this.request(`/v1/flows/${Y(e)}/publish-operations/${Y(t)}`, { signal: n }));
|
|
6521
6601
|
}
|
|
6522
6602
|
async rollbackFlow(e, t, n, r = {}) {
|
|
6523
|
-
return
|
|
6603
|
+
return Ql(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
|
|
6524
6604
|
body: JSON.stringify({
|
|
6525
6605
|
expectedLivePublicationId: n,
|
|
6526
6606
|
version: 1
|
|
6527
6607
|
}),
|
|
6528
|
-
headers: { "idempotency-key": r.idempotencyKey ??
|
|
6608
|
+
headers: { "idempotency-key": r.idempotencyKey ?? bu("publication") },
|
|
6529
6609
|
method: "POST"
|
|
6530
6610
|
}));
|
|
6531
6611
|
}
|
|
6532
6612
|
async getRun(e, t) {
|
|
6533
|
-
return
|
|
6613
|
+
return du(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
|
|
6534
6614
|
}
|
|
6535
6615
|
async listRuns(e, t = {}) {
|
|
6536
6616
|
let n = new URLSearchParams();
|
|
6537
6617
|
t.cursor != null && n.set("cursor", t.cursor), t.limit != null && n.set("limit", String(t.limit)), t.status != null && n.set("status", t.status), t.pendingWait != null && n.set("pendingWait", String(t.pendingWait)), t.source != null && n.set("source", t.source), t.createdFrom != null && n.set("createdFrom", t.createdFrom), t.createdBefore != null && n.set("createdBefore", t.createdBefore), t.runId != null && n.set("runId", t.runId);
|
|
6538
6618
|
let r = n.size == 0 ? "" : `?${n}`;
|
|
6539
|
-
return
|
|
6619
|
+
return fu(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
|
|
6540
6620
|
}
|
|
6541
6621
|
async getRunEvents(e, t = {}, n) {
|
|
6542
6622
|
let r = new URLSearchParams();
|
|
6543
6623
|
t.after != null && r.set("after", String(t.after)), t.limit != null && r.set("limit", String(t.limit));
|
|
6544
6624
|
let i = r.size == 0 ? "" : `?${r}`;
|
|
6545
|
-
return
|
|
6625
|
+
return yu(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
|
|
6546
6626
|
}
|
|
6547
6627
|
async listRunResults(e, t, n) {
|
|
6548
|
-
return
|
|
6628
|
+
return Rl(await this.request(`/v1/runs/${Y(e)}/results${t == null ? "" : `?after=${encodeURIComponent(t)}`}`, { signal: n }));
|
|
6549
6629
|
}
|
|
6550
6630
|
async readRunResult(e, t, n = {}, r) {
|
|
6551
6631
|
let i = new URLSearchParams(Object.entries(n).map(([e, t]) => [e, String(t)]));
|
|
6552
|
-
return
|
|
6632
|
+
return zl(await this.request(`/v1/runs/${Y(e)}/results/${Y(t)}?${i}`, { signal: r }));
|
|
6553
6633
|
}
|
|
6554
6634
|
async downloadRunResult(e, t, n) {
|
|
6555
6635
|
return (await this.response(`/v1/runs/${Y(e)}/results/${Y(t)}/content`, { signal: n })).blob();
|
|
6556
6636
|
}
|
|
6557
6637
|
async getRunResult(e, t) {
|
|
6558
|
-
return
|
|
6638
|
+
return hu(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
|
|
6559
6639
|
}
|
|
6560
6640
|
async cancelRun(e) {
|
|
6561
|
-
return
|
|
6641
|
+
return pu(await this.request(`/v1/runs/${Y(e)}/cancel`, {
|
|
6562
6642
|
body: JSON.stringify({ version: 1 }),
|
|
6563
6643
|
method: "POST"
|
|
6564
6644
|
}));
|
|
6565
6645
|
}
|
|
6566
6646
|
async resolveRunWait(e, t, n, r) {
|
|
6567
|
-
return
|
|
6647
|
+
return mu(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
|
|
6568
6648
|
body: JSON.stringify({
|
|
6569
6649
|
action: n,
|
|
6570
6650
|
comment: r,
|
|
@@ -6577,7 +6657,7 @@ var vu = class {
|
|
|
6577
6657
|
let n = Object.entries(e).map(([e, t]) => `${Y(e)}=${Y(t)}`).join("&"), r = n == "" ? "" : `?${n}`;
|
|
6578
6658
|
return this.connectorRequest(`/v1/connector/actions${r}`, "actions", t, (e) => {
|
|
6579
6659
|
let t = W(e);
|
|
6580
|
-
return K(t, ["actions", "version"]), t.version != 1 || !Array.isArray(t.actions) ? U() : t.actions.map(
|
|
6660
|
+
return K(t, ["actions", "version"]), t.version != 1 || !Array.isArray(t.actions) ? U() : t.actions.map(ll);
|
|
6581
6661
|
});
|
|
6582
6662
|
}
|
|
6583
6663
|
async connectorRequest(e, t, n, r, i = !1) {
|
|
@@ -6598,7 +6678,7 @@ var vu = class {
|
|
|
6598
6678
|
return U();
|
|
6599
6679
|
}
|
|
6600
6680
|
let t = W(e).error, n = t == null ? void 0 : W(t);
|
|
6601
|
-
throw new
|
|
6681
|
+
throw new Hc(i.status, typeof n?.code == "string" ? n.code : "request.failed", typeof n?.message == "string" ? n.message : `Request failed with status ${i.status}.`);
|
|
6602
6682
|
}
|
|
6603
6683
|
return i;
|
|
6604
6684
|
}
|
|
@@ -6616,13 +6696,13 @@ var vu = class {
|
|
|
6616
6696
|
function X(e, t) {
|
|
6617
6697
|
if (!e) throw Error(t);
|
|
6618
6698
|
}
|
|
6619
|
-
async function
|
|
6699
|
+
async function Su(e, t, n) {
|
|
6620
6700
|
let r = await e.request(new Request(new URL("/v1/mcp", e.origin), {
|
|
6621
6701
|
method: "POST",
|
|
6622
6702
|
headers: {
|
|
6623
6703
|
"content-type": "application/json",
|
|
6624
6704
|
accept: "application/json, text/event-stream",
|
|
6625
|
-
"mcp-protocol-version":
|
|
6705
|
+
"mcp-protocol-version": wu,
|
|
6626
6706
|
"mcp-method": t,
|
|
6627
6707
|
...t == "tools/call" ? { "mcp-name": String(n?.name) } : {}
|
|
6628
6708
|
},
|
|
@@ -6633,7 +6713,7 @@ async function yu(e, t, n) {
|
|
|
6633
6713
|
params: {
|
|
6634
6714
|
...n,
|
|
6635
6715
|
_meta: {
|
|
6636
|
-
"io.modelcontextprotocol/protocolVersion":
|
|
6716
|
+
"io.modelcontextprotocol/protocolVersion": wu,
|
|
6637
6717
|
"io.modelcontextprotocol/clientCapabilities": {}
|
|
6638
6718
|
}
|
|
6639
6719
|
}
|
|
@@ -6643,13 +6723,13 @@ async function yu(e, t, n) {
|
|
|
6643
6723
|
let i = await r.text(), a = r.headers.get("content-type")?.includes("text/event-stream") ? JSON.parse(i.split("\n").findLast((e) => e.startsWith("data:"))?.slice(5) ?? "null") : JSON.parse(i);
|
|
6644
6724
|
return X(a != null && a.error == null, `MCP ${t} failed: ${JSON.stringify(a)}.`), a.result;
|
|
6645
6725
|
}
|
|
6646
|
-
var
|
|
6726
|
+
var Cu = [
|
|
6647
6727
|
{
|
|
6648
6728
|
name: "publishes the public MCP catalog, input schemas and annotations",
|
|
6649
6729
|
async verify(e) {
|
|
6650
|
-
let t = await
|
|
6651
|
-
X(Array.isArray(t.tools), "MCP tools must be an array."), X(t.tools.length == Object.keys(
|
|
6652
|
-
for (let [e, n] of Object.entries(
|
|
6730
|
+
let t = await Su(e, "tools/list");
|
|
6731
|
+
X(Array.isArray(t.tools), "MCP tools must be an array."), X(t.tools.length == Object.keys(Au).length, "MCP tool count differs from the public contract.");
|
|
6732
|
+
for (let [e, n] of Object.entries(Au)) {
|
|
6653
6733
|
let r = t.tools.find((t) => t.name == e);
|
|
6654
6734
|
X(r != null, `Missing MCP tool ${e}.`), X(r.description == n.description, `${e} description differs.`), X(Qs(r.annotations, n.annotations), `${e} annotations differ.`);
|
|
6655
6735
|
let { $schema: i, ...a } = n.inputSchema["~standard"].jsonSchema.input(), { $schema: o, ...s } = r.inputSchema;
|
|
@@ -6660,7 +6740,7 @@ var bu = [
|
|
|
6660
6740
|
{
|
|
6661
6741
|
name: "shares Run pagination, status filters and cancellation between MCP and REST",
|
|
6662
6742
|
async verify(e) {
|
|
6663
|
-
let t = new
|
|
6743
|
+
let t = new xu((t, n) => e.request(new Request(new URL(t, e.origin), n))), n = await t.createFlow("MCP Run listing"), r = await t.changeDraft(n.flowId, n.draftRevisionId, [{
|
|
6664
6744
|
kind: "graph.node.create",
|
|
6665
6745
|
target: { kind: "flow" },
|
|
6666
6746
|
nodeId: "start",
|
|
@@ -6678,7 +6758,7 @@ var bu = [
|
|
|
6678
6758
|
}
|
|
6679
6759
|
}, a = [];
|
|
6680
6760
|
for (let t = 0; t < 2; t++) {
|
|
6681
|
-
let t = (await
|
|
6761
|
+
let t = (await Su(e, "tools/call", {
|
|
6682
6762
|
name: "flow_run",
|
|
6683
6763
|
arguments: {
|
|
6684
6764
|
...i,
|
|
@@ -6687,7 +6767,7 @@ var bu = [
|
|
|
6687
6767
|
})).structuredContent;
|
|
6688
6768
|
X(typeof t.runId == "string", "MCP must return an accepted Run ID."), a.push(t.runId);
|
|
6689
6769
|
}
|
|
6690
|
-
let o = (await
|
|
6770
|
+
let o = (await Su(e, "tools/call", {
|
|
6691
6771
|
name: "run_list",
|
|
6692
6772
|
arguments: {
|
|
6693
6773
|
flowId: n.flowId,
|
|
@@ -6701,24 +6781,24 @@ var bu = [
|
|
|
6701
6781
|
});
|
|
6702
6782
|
X(s.runs.length == 1 && s.runs[0]?.runId != o.runs[0]?.runId, "REST must continue the MCP Run cursor without duplicates.");
|
|
6703
6783
|
let c = await t.listRuns(n.flowId, { limit: 1 });
|
|
6704
|
-
X(Qs((await
|
|
6784
|
+
X(Qs((await Su(e, "tools/call", {
|
|
6705
6785
|
name: "run_list",
|
|
6706
6786
|
arguments: {
|
|
6707
6787
|
flowId: n.flowId,
|
|
6708
6788
|
cursor: c.nextCursor,
|
|
6709
6789
|
limit: 1
|
|
6710
6790
|
}
|
|
6711
|
-
})).structuredContent, s), "MCP must continue the REST Run cursor."), await
|
|
6791
|
+
})).structuredContent, s), "MCP must continue the REST Run cursor."), await Su(e, "tools/call", {
|
|
6712
6792
|
name: "run_cancel",
|
|
6713
6793
|
arguments: { runId: a[0] }
|
|
6714
|
-
}), X(Qs((await
|
|
6794
|
+
}), X(Qs((await Su(e, "tools/call", {
|
|
6715
6795
|
name: "run_list",
|
|
6716
6796
|
arguments: {
|
|
6717
6797
|
flowId: n.flowId,
|
|
6718
6798
|
status: "canceled"
|
|
6719
6799
|
}
|
|
6720
6800
|
})).structuredContent, await t.listRuns(n.flowId, { status: "canceled" })), "MCP and REST status filters differ.");
|
|
6721
|
-
let l = await
|
|
6801
|
+
let l = await Su(e, "tools/call", {
|
|
6722
6802
|
name: "run_list",
|
|
6723
6803
|
arguments: {
|
|
6724
6804
|
flowId: (await t.createFlow("Other Run scope")).flowId,
|
|
@@ -6734,7 +6814,7 @@ var bu = [
|
|
|
6734
6814
|
let t = {
|
|
6735
6815
|
name: "MCP conformance",
|
|
6736
6816
|
idempotencyKey: crypto.randomUUID()
|
|
6737
|
-
}, n = () =>
|
|
6817
|
+
}, n = () => Su(e, "tools/call", {
|
|
6738
6818
|
name: "flow_create",
|
|
6739
6819
|
arguments: t
|
|
6740
6820
|
}), r = await n();
|
|
@@ -6743,7 +6823,7 @@ var bu = [
|
|
|
6743
6823
|
X(typeof i.flowId == "string", "MCP did not return a Flow ID."), X(Qs((await n()).structuredContent, i), "MCP mutation replay changed identity.");
|
|
6744
6824
|
let a = await e.request(new Request(new URL(`/v1/flows/${encodeURIComponent(i.flowId)}/draft`, e.origin)));
|
|
6745
6825
|
X(a.ok, "REST cannot read the Flow created through MCP."), X((await a.json()).revisionId == i.draftRevisionId, "MCP and REST disagree on the Draft head.");
|
|
6746
|
-
let o = await
|
|
6826
|
+
let o = await Su(e, "tools/call", {
|
|
6747
6827
|
name: "flow_create",
|
|
6748
6828
|
arguments: {
|
|
6749
6829
|
...t,
|
|
@@ -6753,7 +6833,7 @@ var bu = [
|
|
|
6753
6833
|
X(o.isError == 1, "MCP must reject a changed idempotent replay."), X(o.structuredContent.error.code == "flow.conflict", "MCP must preserve the Control error code.");
|
|
6754
6834
|
}
|
|
6755
6835
|
}
|
|
6756
|
-
],
|
|
6836
|
+
], wu = "2026-07-28", Tu = Xs(), Z = O().min(1), Eu = Z.max(256).describe("Stable identity for this mutation. Retry with the same key and identical arguments, even after a lost response."), Du = ss().min(1).max(100).default(50), Q = Z.describe("Exact Flow ID returned by flow_list or flow_create."), Ou = Z.describe("Exact Run ID returned by flow_run or run_list."), ku = "Use flow_list and flow_get to inspect a Flow. Use flow_schema to learn atomic edit operations, then flow_apply with the observed expectedRevisionId and a stable idempotencyKey. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_create, flow_apply, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
|
|
6757
6837
|
function $(e, t, n) {
|
|
6758
6838
|
return {
|
|
6759
6839
|
description: e,
|
|
@@ -6780,10 +6860,10 @@ function $(e, t, n) {
|
|
|
6780
6860
|
} }
|
|
6781
6861
|
};
|
|
6782
6862
|
}
|
|
6783
|
-
var
|
|
6863
|
+
var Au = {
|
|
6784
6864
|
flow_list: $("List Flows in this deployment. Continue with nextCursor; cursors are compatible with the Control API.", P({
|
|
6785
6865
|
cursor: Z.optional(),
|
|
6786
|
-
limit:
|
|
6866
|
+
limit: Du
|
|
6787
6867
|
}), !0),
|
|
6788
6868
|
flow_get: $("Read Flow metadata, the full Draft and current Live publication. Unreadable Drafts return draft=null and draftIssue; flow.live still identifies the published version. Use draft.revisionId as the base of an edit.", P({ flowId: Q }), !0),
|
|
6789
6869
|
flow_schema: $("Get an operation schema by kind, or a complete apply batch by example (connector, poll, poll-notification, code, wait). Use example=index to list examples. graph.trigger.create resolves a provider key into a fixed definition at commit.", P({
|
|
@@ -6792,14 +6872,14 @@ var Du = {
|
|
|
6792
6872
|
}).refine((e) => e.kind == null || e.example == null, "Choose kind or example, not both."), !0),
|
|
6793
6873
|
flow_create: $("Create an empty Flow. If this deployment uses OOMOL Connector, choose a teamId from connector_teams. Keep the key and arguments stable when retrying.", P({
|
|
6794
6874
|
name: Z.refine((e) => e == e.trim() && Bc(e) == null, "Flow name is invalid."),
|
|
6795
|
-
idempotencyKey:
|
|
6875
|
+
idempotencyKey: Eu,
|
|
6796
6876
|
teamId: Z.optional()
|
|
6797
6877
|
}), !1),
|
|
6798
6878
|
flow_apply: $("Apply ordered atomic changes. Read flow_schema first. A stale expectedRevisionId is a conflict; reread the Draft before deciding on a new edit.", P({
|
|
6799
6879
|
flowId: Q,
|
|
6800
6880
|
expectedRevisionId: Z,
|
|
6801
|
-
idempotencyKey:
|
|
6802
|
-
operations: M(
|
|
6881
|
+
idempotencyKey: Eu,
|
|
6882
|
+
operations: M(Tu).min(1).describe("Change operations defined by flow_schema. Explicit IDs and before values refer to the base Revision.")
|
|
6803
6883
|
}), !1),
|
|
6804
6884
|
flow_check: $("Validate a fixed Revision and return diagnostics. Get its revisionId from flow_get or flow_apply.", P({
|
|
6805
6885
|
flowId: Q,
|
|
@@ -6809,7 +6889,7 @@ var Du = {
|
|
|
6809
6889
|
flowId: Q,
|
|
6810
6890
|
revisionId: Z,
|
|
6811
6891
|
expectedLivePublicationId: Z.nullable(),
|
|
6812
|
-
idempotencyKey:
|
|
6892
|
+
idempotencyKey: Eu
|
|
6813
6893
|
}), !1),
|
|
6814
6894
|
flow_publish_status: $("Read a publish operation. Only succeeded confirms publication; failed includes the failure details. Keep polling while pending.", P({
|
|
6815
6895
|
flowId: Q,
|
|
@@ -6827,35 +6907,35 @@ var Du = {
|
|
|
6827
6907
|
publicationId: Z.optional(),
|
|
6828
6908
|
trigger: P({
|
|
6829
6909
|
nodeId: Z,
|
|
6830
|
-
outputs: I(O(),
|
|
6910
|
+
outputs: I(O(), Tu)
|
|
6831
6911
|
}),
|
|
6832
|
-
inputs: I(O(), I(O(),
|
|
6833
|
-
idempotencyKey:
|
|
6912
|
+
inputs: I(O(), I(O(), Tu)).default({}),
|
|
6913
|
+
idempotencyKey: Eu
|
|
6834
6914
|
}), !1),
|
|
6835
6915
|
run_list: $("List Runs for a Flow, optionally filtered by status. Continue with nextCursor; cursors are compatible with the Control API.", P({
|
|
6836
6916
|
flowId: Q,
|
|
6837
6917
|
pendingWait: j().optional(),
|
|
6838
6918
|
status: L($s).optional(),
|
|
6839
6919
|
cursor: Z.optional(),
|
|
6840
|
-
limit:
|
|
6920
|
+
limit: Du
|
|
6841
6921
|
}), !0),
|
|
6842
|
-
run_get: $("Read Run status, including waiting details and allowed actions. Completed, failed, canceled and indeterminate are terminal.", P({ runId:
|
|
6922
|
+
run_get: $("Read Run status, including waiting details and allowed actions. Completed, failed, canceled and indeterminate are terminal.", P({ runId: Ou }), !0),
|
|
6843
6923
|
run_events: $("Read one page of Run events. Continue with nextAfter. Events can expire independently of the terminal result.", P({
|
|
6844
|
-
runId:
|
|
6924
|
+
runId: Ou,
|
|
6845
6925
|
after: ss().min(0).default(0),
|
|
6846
|
-
limit:
|
|
6926
|
+
limit: Du
|
|
6847
6927
|
}), !0),
|
|
6848
|
-
run_result: $("Read the terminal result. A queued, running or waiting Run returns run.not-terminal; inspect run_get first.", P({ runId:
|
|
6928
|
+
run_result: $("Read the terminal result. A queued, running or waiting Run returns run.not-terminal; inspect run_get first.", P({ runId: Ou }), !0),
|
|
6849
6929
|
run_results: $("List stored Agent tool result metadata for a Run, including Connector and code results. Continue with nextAfter as after. Use run_result_read to inspect content.", P({
|
|
6850
|
-
runId:
|
|
6930
|
+
runId: Ou,
|
|
6851
6931
|
after: Z.optional()
|
|
6852
6932
|
}), !0),
|
|
6853
6933
|
run_result_read: $("Read a bounded page of a stored Agent tool result. Select a JSON Pointer with pointer and continue with nextOffset as offset at the same pointer. A complete value contains all data at that pointer.", Vc.extend({
|
|
6854
|
-
runId:
|
|
6934
|
+
runId: Ou,
|
|
6855
6935
|
resultId: Z
|
|
6856
6936
|
}), !0),
|
|
6857
6937
|
run_resolve_wait: $("Explicitly resolve the waitId observed in run_get with one of its allowed actions. Optional comment records the reason (up to 2,000 Unicode code points). The first decision and comment win; inspect resolutionAccepted and action. Resume the same Run and poll run_get; do not create a replacement Run.", P({
|
|
6858
|
-
runId:
|
|
6938
|
+
runId: Ou,
|
|
6859
6939
|
waitId: Z,
|
|
6860
6940
|
action: L([
|
|
6861
6941
|
"approve",
|
|
@@ -6864,7 +6944,7 @@ var Du = {
|
|
|
6864
6944
|
]),
|
|
6865
6945
|
comment: ec
|
|
6866
6946
|
}), !1),
|
|
6867
|
-
run_cancel: $("Explicitly cancel a Run. Inspect cancelAccepted and the authoritative status; completion can win the race.", P({ runId:
|
|
6947
|
+
run_cancel: $("Explicitly cancel a Run. Inspect cancelAccepted and the authoritative status; completion can win the race.", P({ runId: Ou }), !1),
|
|
6868
6948
|
connector_teams: $("List OOMOL Teams available for Flow creation. An unconfigured or custom Connector may not provide Teams.", P({}), !0),
|
|
6869
6949
|
connector_list: $("List Connector providers available in the Flow scope.", P({ flowId: Q.optional() }), !0),
|
|
6870
6950
|
connector_search: $("Search Connector actions in the Flow scope.", P({
|
|
@@ -6883,4 +6963,4 @@ var Du = {
|
|
|
6883
6963
|
trigger_get: $("Read a provider Trigger definition before creating its node.", P({ key: Z }), !0)
|
|
6884
6964
|
};
|
|
6885
6965
|
//#endregion
|
|
6886
|
-
export {
|
|
6966
|
+
export { Cu as mcpConformanceCases, ku as mcpInstructions, wu as mcpProtocolVersion, Au as mcpTools };
|