@oomol-lab/open-flow 0.1.0-beta.60 → 0.1.0-beta.62
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/README.md +14 -1
- package/dist/browser/{createResourceDialog-B7ThMSeA.js → createResourceDialog-DZgJsr3e.js} +2 -2
- package/dist/browser/{flowChanges-Cbl6Izr-.js → flowChanges-CzYIVevI.js} +1234 -1063
- package/dist/browser/{flowWorkspace-BdbsnUDs.js → flowWorkspace-BgZaFKZm.js} +208 -94
- package/dist/browser/{icons-D70mz3qW.js → icons-CajfDpy_.js} +13 -13
- package/dist/browser/preview.js +1126 -844
- package/dist/browser/ui.css +697 -1
- package/dist/browser/ui.d.ts +45 -0
- package/dist/browser/ui.js +6243 -740
- package/dist/browser/workbench.css +4 -20
- package/dist/browser/workbench.js +50 -41
- package/dist/browser/{workbenchSelect-gB45mZY7.js → workbenchSelect-H9wzEFkH.js} +1 -1
- package/dist/command/index.d.ts +6 -0
- package/dist/command/index.js +84 -0
- package/dist/command/licenses.md +191 -0
- package/dist/common/control-api-conformance.js +738 -583
- package/dist/common/control-api.d.ts +23 -3
- package/dist/common/control-api.js +824 -614
- package/dist/common/control-requests.js +23 -15
- package/dist/common/liveDetails.d.ts +138 -0
- package/dist/common/mcp.d.ts +29 -0
- package/dist/common/mcp.js +737 -578
- package/package.json +5 -1
- package/skills/open-flow/SKILL.md +7 -3
- package/skills/open-flow/references/flow-authoring.md +37 -1
package/dist/common/mcp.js
CHANGED
|
@@ -8776,6 +8776,9 @@ var webhookMethods = [
|
|
|
8776
8776
|
"PATCH",
|
|
8777
8777
|
"DELETE"
|
|
8778
8778
|
];
|
|
8779
|
+
function webhookSupportsBody(method) {
|
|
8780
|
+
return method !== "GET";
|
|
8781
|
+
}
|
|
8779
8782
|
var text = string$1();
|
|
8780
8783
|
var json$3 = json$4();
|
|
8781
8784
|
var strings$1 = array(text);
|
|
@@ -9151,7 +9154,7 @@ var graph = object({
|
|
|
9151
9154
|
nodes: record$2(text, node),
|
|
9152
9155
|
edges: array(edge).default([])
|
|
9153
9156
|
});
|
|
9154
|
-
var binding = object({
|
|
9157
|
+
var binding$1 = object({
|
|
9155
9158
|
kind: literal("variable"),
|
|
9156
9159
|
target: text
|
|
9157
9160
|
});
|
|
@@ -9161,7 +9164,7 @@ var module = object({
|
|
|
9161
9164
|
source: text
|
|
9162
9165
|
});
|
|
9163
9166
|
var document = preprocess(rejectRetiredDefinitions, object({
|
|
9164
|
-
bindings: record$2(text, binding),
|
|
9167
|
+
bindings: record$2(text, binding$1),
|
|
9165
9168
|
graph
|
|
9166
9169
|
}));
|
|
9167
9170
|
var revision = object({
|
|
@@ -9205,7 +9208,7 @@ var shapes = {
|
|
|
9205
9208
|
},
|
|
9206
9209
|
"binding.create": {
|
|
9207
9210
|
bindingId: text,
|
|
9208
|
-
binding
|
|
9211
|
+
binding: binding$1
|
|
9209
9212
|
},
|
|
9210
9213
|
"binding.delete": { bindingId: text },
|
|
9211
9214
|
"binding.target.set": {
|
|
@@ -9406,7 +9409,7 @@ var authenticationSchema = union([
|
|
|
9406
9409
|
in: _enum(["header", "query"])
|
|
9407
9410
|
})
|
|
9408
9411
|
]);
|
|
9409
|
-
strictObject({
|
|
9412
|
+
var authoringOpenApiSchema = strictObject({
|
|
9410
9413
|
sourceUrl: string$1().min(1),
|
|
9411
9414
|
path: string$1().min(1),
|
|
9412
9415
|
method: string$1().min(1),
|
|
@@ -9503,36 +9506,53 @@ var when = union([
|
|
|
9503
9506
|
all,
|
|
9504
9507
|
strictObject({ any: array(union([expression, all])) })
|
|
9505
9508
|
]);
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
})
|
|
9509
|
+
var authoringConfigurations = {
|
|
9510
|
+
manual: strictObject({}),
|
|
9511
|
+
error: strictObject({ sourceFlowIds: array(id$2).optional() }),
|
|
9512
|
+
webhook: authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
|
|
9513
|
+
cron: strictObject({ schedule: authoringDefinitionSchemas.schedule }),
|
|
9514
|
+
poll: strictObject({
|
|
9515
|
+
key: id$2,
|
|
9516
|
+
connectionId: id$2.optional(),
|
|
9517
|
+
schedule: authoringDefinitionSchemas.schedule
|
|
9518
|
+
}),
|
|
9519
|
+
integration: strictObject({
|
|
9520
|
+
key: id$2,
|
|
9521
|
+
connectionId: id$2.optional()
|
|
9522
|
+
}),
|
|
9523
|
+
code: strictObject({
|
|
9524
|
+
inputs: inputFields,
|
|
9525
|
+
outputs: outputFields,
|
|
9526
|
+
capabilities: authoringDefinitionSchemas.capabilities.optional()
|
|
9527
|
+
}),
|
|
9528
|
+
connector: authoringDefinitionSchemas.connector.strict(),
|
|
9529
|
+
openapi: authoringOpenApiSchema,
|
|
9530
|
+
agent: authoringDefinitionSchemas.agent.omit({
|
|
9531
|
+
prompt: true,
|
|
9532
|
+
tools: true
|
|
9533
|
+
}).extend({
|
|
9534
|
+
inputs: inputFields,
|
|
9535
|
+
resultSchema: json$2.describe("JSON schema of the final result. Defaults to text. The tool manages the output definition; references can omit port."),
|
|
9536
|
+
tools: array(agentTool),
|
|
9537
|
+
notification: notification.optional()
|
|
9538
|
+
}).strict(),
|
|
9539
|
+
llm: authoringLlmConfiguration.extend({ inputs: inputFields }),
|
|
9540
|
+
decision: authoringDefinitionSchemas.decision,
|
|
9541
|
+
condition: strictObject({
|
|
9542
|
+
match: _enum(["first", "all"]),
|
|
9543
|
+
branches: array(strictObject({
|
|
9544
|
+
name: id$2,
|
|
9545
|
+
description: string$1().optional(),
|
|
9546
|
+
when
|
|
9547
|
+
}))
|
|
9548
|
+
}),
|
|
9549
|
+
value: strictObject({
|
|
9550
|
+
values: patch,
|
|
9551
|
+
outputs: outputFields
|
|
9552
|
+
}),
|
|
9553
|
+
wait: strictObject({ inputs: inputFields }),
|
|
9554
|
+
approval: strictObject({ inputs: inputFields })
|
|
9555
|
+
};
|
|
9536
9556
|
var updates = strictObject({
|
|
9537
9557
|
name: id$2.optional(),
|
|
9538
9558
|
description: string$1().optional(),
|
|
@@ -9687,40 +9707,6 @@ var resultQuerySchema = strictObject({
|
|
|
9687
9707
|
maxBytes: number().int().min(1).max(1048576).default(15e3)
|
|
9688
9708
|
});
|
|
9689
9709
|
//#endregion
|
|
9690
|
-
//#region src/control/common/providerIconSprite.ts
|
|
9691
|
-
/** Optional artwork must never make an otherwise usable catalog unavailable. */
|
|
9692
|
-
function providerIconAppearance(metadata, position) {
|
|
9693
|
-
if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
|
|
9694
|
-
const m = metadata;
|
|
9695
|
-
const p = position;
|
|
9696
|
-
if (typeof m.version != "string" || ![
|
|
9697
|
-
m.pixelRatio,
|
|
9698
|
-
m.iconSize,
|
|
9699
|
-
m.width,
|
|
9700
|
-
m.height
|
|
9701
|
-
].every((v) => Number.isInteger(v) && v > 0) || ![
|
|
9702
|
-
m.bleed,
|
|
9703
|
-
p.x,
|
|
9704
|
-
p.y
|
|
9705
|
-
].every((v) => Number.isInteger(v) && v >= 0) || p.x + m.iconSize > m.width || p.y + m.iconSize > m.height) return {};
|
|
9706
|
-
try {
|
|
9707
|
-
for (const url of [m.lightUrl, m.darkUrl]) if (typeof url != "string" || ![
|
|
9708
|
-
"https:",
|
|
9709
|
-
"http:",
|
|
9710
|
-
"data:"
|
|
9711
|
-
].includes(new URL(url).protocol)) return {};
|
|
9712
|
-
} catch {
|
|
9713
|
-
return {};
|
|
9714
|
-
}
|
|
9715
|
-
return {
|
|
9716
|
-
iconSprite: m,
|
|
9717
|
-
iconSpritePosition: {
|
|
9718
|
-
x: p.x,
|
|
9719
|
-
y: p.y
|
|
9720
|
-
}
|
|
9721
|
-
};
|
|
9722
|
-
}
|
|
9723
|
-
//#endregion
|
|
9724
9710
|
//#region src/control/common/errors.ts
|
|
9725
9711
|
var controlErrorCode = {
|
|
9726
9712
|
authenticationRequired: "authentication.required",
|
|
@@ -9820,114 +9806,561 @@ function optionalString(value) {
|
|
|
9820
9806
|
if (value == null) return;
|
|
9821
9807
|
return string(value);
|
|
9822
9808
|
}
|
|
9823
|
-
new TextEncoder();
|
|
9824
|
-
//#endregion
|
|
9825
|
-
//#region src/control/common/providerAccess.ts
|
|
9826
|
-
var sourceSchema = discriminatedUnion("kind", [strictObject({ kind: literal("admin-delegation") }), strictObject({
|
|
9827
|
-
kind: literal("policy"),
|
|
9828
|
-
ruleId: string$1().min(1).nullable()
|
|
9829
|
-
})]);
|
|
9830
|
-
function parseProviderAccessSource(value) {
|
|
9831
|
-
return sourceSchema.parse(value);
|
|
9832
|
-
}
|
|
9833
9809
|
//#endregion
|
|
9834
|
-
//#region src/control/common/
|
|
9835
|
-
function
|
|
9810
|
+
//#region src/control/common/publicationDecoders.ts
|
|
9811
|
+
function publication(value) {
|
|
9836
9812
|
const source = record(value);
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
]);
|
|
9845
|
-
if (!Array.isArray(source.actionIds)) return invalidResponse("permissions.actionIds: expected an array.");
|
|
9846
|
-
if (!Array.isArray(source.triggerIds)) return invalidResponse("permissions.triggerIds: expected an array.");
|
|
9847
|
-
if (typeof source.allActions != "boolean") return invalidResponse("permissions.allActions: expected a boolean.");
|
|
9848
|
-
if (typeof source.allTriggers != "boolean") return invalidResponse("permissions.allTriggers: expected a boolean.");
|
|
9849
|
-
if (typeof source.configured != "boolean") return invalidResponse("permissions.configured: expected a boolean.");
|
|
9850
|
-
if (typeof source.proxy != "boolean") return invalidResponse("permissions.proxy: expected a boolean.");
|
|
9851
|
-
const actionIds = source.actionIds.map(string);
|
|
9852
|
-
const triggerIds = source.triggerIds.map(string);
|
|
9853
|
-
if (new Set(actionIds).size != actionIds.length) return invalidResponse("permissions.actionIds: duplicate IDs.");
|
|
9854
|
-
if (source.allActions && actionIds.length != 0) return invalidResponse("permissions.actionIds: must be empty when allActions is true.");
|
|
9855
|
-
if (new Set(triggerIds).size != triggerIds.length) return invalidResponse("permissions.triggerIds: duplicate IDs.");
|
|
9856
|
-
if (source.allTriggers && triggerIds.length != 0) return invalidResponse("permissions.triggerIds: must be empty when allTriggers is true.");
|
|
9857
|
-
if (source.proxy && (!source.allActions || !source.allTriggers || source.configured)) return invalidResponse("permissions.proxy: requires allActions=true, allTriggers=true and configured=false.");
|
|
9813
|
+
const liveEnd = source.liveEnd == null ? void 0 : record(source.liveEnd);
|
|
9814
|
+
if (liveEnd != null && typeof liveEnd.enabled != "boolean") return invalidResponse();
|
|
9815
|
+
const operation = source.operation;
|
|
9816
|
+
const sourcePublicationId = source.sourcePublicationId;
|
|
9817
|
+
if (source.version != 1) return invalidResponse();
|
|
9818
|
+
if (operation != "publish" && operation != "rollback") return invalidResponse();
|
|
9819
|
+
if (sourcePublicationId != null && typeof sourcePublicationId != "string") return invalidResponse();
|
|
9858
9820
|
return {
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9821
|
+
...liveEnd == null ? {} : { liveEnd: {
|
|
9822
|
+
enabled: liveEnd.enabled,
|
|
9823
|
+
endedAt: string(liveEnd.endedAt)
|
|
9824
|
+
} },
|
|
9825
|
+
actorId: string(source.actorId),
|
|
9826
|
+
closureDigest: string(source.closureDigest),
|
|
9827
|
+
createdAt: string(source.createdAt),
|
|
9828
|
+
engineContract: string(source.engineContract),
|
|
9829
|
+
flowId: string(source.flowId),
|
|
9830
|
+
modelVersion: integer(source.modelVersion),
|
|
9831
|
+
operation,
|
|
9832
|
+
publicationId: string(source.publicationId),
|
|
9833
|
+
sharedAccessDigest: string(source.sharedAccessDigest),
|
|
9834
|
+
revisionDigest: string(source.revisionDigest),
|
|
9835
|
+
revisionId: string(source.revisionId),
|
|
9836
|
+
...sourcePublicationId == null ? {} : { sourcePublicationId },
|
|
9837
|
+
version: 1
|
|
9865
9838
|
};
|
|
9866
9839
|
}
|
|
9867
|
-
function
|
|
9840
|
+
function publishOperation(value) {
|
|
9868
9841
|
const source = record(value);
|
|
9869
|
-
const policyRevision = source.policyRevision;
|
|
9870
9842
|
const status = source.status;
|
|
9871
|
-
const
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9843
|
+
const common = {
|
|
9844
|
+
createdAt: string(source.createdAt),
|
|
9845
|
+
flowId: string(source.flowId),
|
|
9846
|
+
operationId: string(source.operationId),
|
|
9847
|
+
revisionId: string(source.revisionId),
|
|
9848
|
+
updatedAt: string(source.updatedAt),
|
|
9849
|
+
version: 1
|
|
9850
|
+
};
|
|
9851
|
+
if (source.version != 1) return invalidResponse();
|
|
9852
|
+
switch (status) {
|
|
9853
|
+
case "pending":
|
|
9854
|
+
exact(source, [
|
|
9855
|
+
"createdAt",
|
|
9856
|
+
"flowId",
|
|
9857
|
+
"operationId",
|
|
9858
|
+
"revisionId",
|
|
9859
|
+
"status",
|
|
9860
|
+
"updatedAt",
|
|
9861
|
+
"version"
|
|
9862
|
+
]);
|
|
9863
|
+
return {
|
|
9864
|
+
...common,
|
|
9865
|
+
status
|
|
9866
|
+
};
|
|
9867
|
+
case "succeeded":
|
|
9868
|
+
exact(source, [
|
|
9869
|
+
"createdAt",
|
|
9870
|
+
"flowId",
|
|
9871
|
+
"operationId",
|
|
9872
|
+
"publicationId",
|
|
9873
|
+
"revisionId",
|
|
9874
|
+
"status",
|
|
9875
|
+
"updatedAt",
|
|
9876
|
+
"version"
|
|
9877
|
+
]);
|
|
9878
|
+
return {
|
|
9879
|
+
...common,
|
|
9880
|
+
publicationId: string(source.publicationId),
|
|
9881
|
+
status
|
|
9882
|
+
};
|
|
9883
|
+
case "failed": {
|
|
9884
|
+
exact(source, [
|
|
9885
|
+
"createdAt",
|
|
9886
|
+
"flowId",
|
|
9887
|
+
"issue",
|
|
9888
|
+
"operationId",
|
|
9889
|
+
"revisionId",
|
|
9890
|
+
"status",
|
|
9891
|
+
"updatedAt",
|
|
9892
|
+
"version"
|
|
9893
|
+
]);
|
|
9894
|
+
const issue = record(source.issue);
|
|
9895
|
+
const nodeId = issue.nodeId;
|
|
9896
|
+
exact(issue, [
|
|
9897
|
+
"code",
|
|
9898
|
+
"message",
|
|
9899
|
+
...nodeId == null ? [] : ["nodeId"]
|
|
9900
|
+
]);
|
|
9901
|
+
return {
|
|
9902
|
+
...common,
|
|
9903
|
+
issue: {
|
|
9904
|
+
code: string(issue.code),
|
|
9905
|
+
message: string(issue.message),
|
|
9906
|
+
...nodeId == null ? {} : { nodeId: string(nodeId) }
|
|
9907
|
+
},
|
|
9908
|
+
status
|
|
9909
|
+
};
|
|
9910
|
+
}
|
|
9911
|
+
default: return invalidResponse();
|
|
9896
9912
|
}
|
|
9913
|
+
}
|
|
9914
|
+
function live(value) {
|
|
9915
|
+
const source = record(value);
|
|
9916
|
+
const status = source.status;
|
|
9917
|
+
const candidate = source.publication;
|
|
9918
|
+
if (source.version != 1 || typeof source.hasUnpublishedChanges != "boolean") return invalidResponse();
|
|
9919
|
+
if (status != "not-published" && status != "runnable" && status != "suspended") return invalidResponse();
|
|
9920
|
+
if (status == "not-published" && candidate !== null) return invalidResponse();
|
|
9921
|
+
if (status != "not-published" && candidate === null) return invalidResponse();
|
|
9897
9922
|
return {
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
...permissionGroupName === void 0 ? {} : { permissionGroupName },
|
|
9905
|
-
...policyRevision == null ? {} : { policyRevision },
|
|
9906
|
-
providerId: string(source.providerId),
|
|
9907
|
-
...candidate ? {} : { status }
|
|
9923
|
+
flowId: string(source.flowId),
|
|
9924
|
+
hasUnpublishedChanges: source.hasUnpublishedChanges,
|
|
9925
|
+
publication: candidate === null ? null : publication(candidate),
|
|
9926
|
+
revision: integer(source.revision),
|
|
9927
|
+
status,
|
|
9928
|
+
version: 1
|
|
9908
9929
|
};
|
|
9909
9930
|
}
|
|
9910
|
-
function
|
|
9911
|
-
if (value != "implicit" && value != "selectable") return invalidResponse("mode: expected implicit or selectable.");
|
|
9912
|
-
return value;
|
|
9913
|
-
}
|
|
9914
|
-
function connectorAccess(value) {
|
|
9931
|
+
function publicationPage(value) {
|
|
9915
9932
|
const source = record(value);
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
...
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9933
|
+
const nextCursor = source.nextCursor;
|
|
9934
|
+
const total = source.total;
|
|
9935
|
+
if (source.version != 1 || !Array.isArray(source.publications)) return invalidResponse();
|
|
9936
|
+
if (nextCursor != null && typeof nextCursor != "string") return invalidResponse();
|
|
9937
|
+
if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
|
|
9938
|
+
return {
|
|
9939
|
+
...nextCursor == null ? {} : { nextCursor },
|
|
9940
|
+
publications: source.publications.map(publication),
|
|
9941
|
+
...total == null ? {} : { total },
|
|
9942
|
+
version: 1
|
|
9943
|
+
};
|
|
9944
|
+
}
|
|
9945
|
+
//#endregion
|
|
9946
|
+
//#region src/trigger/common/configSchema.ts
|
|
9947
|
+
var configInputsSchema = array(union([strictObject({
|
|
9948
|
+
handle: string$1().min(1),
|
|
9949
|
+
description: string$1().optional(),
|
|
9950
|
+
jsonSchema: json$4(),
|
|
9951
|
+
nullable: boolean(),
|
|
9952
|
+
value: json$4().optional()
|
|
9953
|
+
}), strictObject({
|
|
9954
|
+
group: string$1(),
|
|
9955
|
+
collapsed: boolean().optional()
|
|
9956
|
+
})]));
|
|
9957
|
+
//#endregion
|
|
9958
|
+
//#region src/control/common/triggerDecoders.ts
|
|
9959
|
+
function triggerKeySummary(value) {
|
|
9960
|
+
const source = record(value);
|
|
9961
|
+
const type = source.type;
|
|
9962
|
+
if (type != "integration" && type != "poll") return invalidResponse();
|
|
9963
|
+
return {
|
|
9964
|
+
description: typeof source.description == "string" ? source.description : invalidResponse(),
|
|
9965
|
+
displayName: string(source.displayName),
|
|
9966
|
+
key: string(source.key),
|
|
9967
|
+
name: string(source.name),
|
|
9968
|
+
provider: string(source.provider),
|
|
9969
|
+
type
|
|
9970
|
+
};
|
|
9971
|
+
}
|
|
9972
|
+
function triggerKey(value) {
|
|
9973
|
+
const source = record(value);
|
|
9974
|
+
const summary = triggerKeySummary(source);
|
|
9975
|
+
const base = {
|
|
9976
|
+
configInputs: configInputsSchema.parse(source.configInputs),
|
|
9977
|
+
definitionVersion: source.definitionVersion === 2 ? 2 : invalidResponse(),
|
|
9978
|
+
description: summary.description,
|
|
9979
|
+
displayName: summary.displayName,
|
|
9980
|
+
key: summary.key,
|
|
9981
|
+
name: summary.name,
|
|
9982
|
+
outputs: (Array.isArray(source.outputs) ? source.outputs : invalidResponse()).map((entry) => {
|
|
9983
|
+
const port = record(entry);
|
|
9984
|
+
return Object.assign({
|
|
9985
|
+
handle: string(port.handle),
|
|
9986
|
+
jsonSchema: jsonValue(port.jsonSchema),
|
|
9987
|
+
nullable: typeof port.nullable === "boolean" ? port.nullable : invalidResponse()
|
|
9988
|
+
}, port.description == null ? {} : { description: string(port.description) });
|
|
9989
|
+
}),
|
|
9990
|
+
provider: summary.provider
|
|
9991
|
+
};
|
|
9992
|
+
if (summary.type == "poll") return {
|
|
9993
|
+
...base,
|
|
9994
|
+
type: "poll"
|
|
9995
|
+
};
|
|
9996
|
+
const endpoint = record(source.endpoint);
|
|
9997
|
+
const body = record(endpoint.body);
|
|
9998
|
+
if (!Array.isArray(endpoint.methods) || !Array.isArray(body.formats) || typeof body.allowArray != "boolean" || typeof body.allowEmpty != "boolean") return invalidResponse();
|
|
9999
|
+
const methods = endpoint.methods.map(string);
|
|
10000
|
+
const formats = body.formats.map(string);
|
|
10001
|
+
const successStatus = integer(endpoint.successStatus);
|
|
10002
|
+
if (methods.some((method) => ![
|
|
10003
|
+
"DELETE",
|
|
10004
|
+
"GET",
|
|
10005
|
+
"HEAD",
|
|
10006
|
+
"PATCH",
|
|
10007
|
+
"POST",
|
|
10008
|
+
"PUT"
|
|
10009
|
+
].includes(method)) || formats.some((format) => ![
|
|
10010
|
+
"form",
|
|
10011
|
+
"json",
|
|
10012
|
+
"multipart",
|
|
10013
|
+
"text"
|
|
10014
|
+
].includes(format)) || successStatus < 200 || successStatus > 299) return invalidResponse();
|
|
10015
|
+
return {
|
|
10016
|
+
...base,
|
|
10017
|
+
endpoint: {
|
|
10018
|
+
body: {
|
|
10019
|
+
allowArray: body.allowArray,
|
|
10020
|
+
allowEmpty: body.allowEmpty,
|
|
10021
|
+
formats
|
|
10022
|
+
},
|
|
10023
|
+
methods,
|
|
10024
|
+
successStatus
|
|
10025
|
+
},
|
|
10026
|
+
type: "integration"
|
|
10027
|
+
};
|
|
10028
|
+
}
|
|
10029
|
+
var triggerKinds = /* @__PURE__ */ new Set([
|
|
10030
|
+
"error",
|
|
10031
|
+
"cron",
|
|
10032
|
+
"integration",
|
|
10033
|
+
"poll",
|
|
10034
|
+
"webhook"
|
|
10035
|
+
]);
|
|
10036
|
+
var triggerHealth = /* @__PURE__ */ new Set([
|
|
10037
|
+
"failed",
|
|
10038
|
+
"healthy",
|
|
10039
|
+
"initializing",
|
|
10040
|
+
"needs_reauth",
|
|
10041
|
+
"suspended"
|
|
10042
|
+
]);
|
|
10043
|
+
var triggerActivityKinds = /* @__PURE__ */ new Set([
|
|
10044
|
+
"delivery.failed",
|
|
10045
|
+
"health.failed",
|
|
10046
|
+
"health.needs_reauth",
|
|
10047
|
+
"health.recovered",
|
|
10048
|
+
"health.suspended",
|
|
10049
|
+
"operator.paused",
|
|
10050
|
+
"operator.resumed"
|
|
10051
|
+
]);
|
|
10052
|
+
function triggerBinding(value) {
|
|
10053
|
+
const source = record(value);
|
|
10054
|
+
const health = source.health;
|
|
10055
|
+
const listener = source.listener == null ? void 0 : record(source.listener);
|
|
10056
|
+
if (listener != null && listener.health != "healthy" && listener.health != "failed" && listener.health != "needs_reauth") return invalidResponse();
|
|
10057
|
+
const kind = source.kind;
|
|
10058
|
+
const runtimeVersion = integer(source.runtimeVersion);
|
|
10059
|
+
if (source.version != 1 || typeof health != "string" || !triggerHealth.has(health)) return invalidResponse();
|
|
10060
|
+
if (typeof kind != "string" || !triggerKinds.has(kind)) return invalidResponse();
|
|
10061
|
+
if (runtimeVersion <= 0) return invalidResponse();
|
|
10062
|
+
return {
|
|
10063
|
+
...source.currentPublicationId == null ? {} : { currentPublicationId: string(source.currentPublicationId) },
|
|
10064
|
+
...source.currentRevisionId == null ? {} : { currentRevisionId: string(source.currentRevisionId) },
|
|
10065
|
+
...source.endpointUrl == null ? {} : { endpointUrl: string(source.endpointUrl) },
|
|
10066
|
+
...listener == null ? {} : { listener: {
|
|
10067
|
+
health: listener.health,
|
|
10068
|
+
...listener.lastErrorCode == null ? {} : { lastErrorCode: string(listener.lastErrorCode) }
|
|
10069
|
+
} },
|
|
10070
|
+
flowId: string(source.flowId),
|
|
10071
|
+
health,
|
|
10072
|
+
kind,
|
|
10073
|
+
...source.lastErrorCode == null ? {} : { lastErrorCode: string(source.lastErrorCode) },
|
|
10074
|
+
runtimeVersion,
|
|
10075
|
+
triggerNodeId: string(source.triggerNodeId),
|
|
10076
|
+
updatedAt: string(source.updatedAt),
|
|
10077
|
+
version: 1
|
|
10078
|
+
};
|
|
10079
|
+
}
|
|
10080
|
+
function triggerBindingDetail(value) {
|
|
10081
|
+
const source = record(value);
|
|
10082
|
+
if (source.version != 1) return invalidResponse();
|
|
10083
|
+
return {
|
|
10084
|
+
binding: triggerBinding(source.binding),
|
|
10085
|
+
version: 1
|
|
10086
|
+
};
|
|
10087
|
+
}
|
|
10088
|
+
function triggerActivity(value) {
|
|
10089
|
+
const source = record(value);
|
|
10090
|
+
const kind = source.kind;
|
|
10091
|
+
if (typeof kind != "string" || !triggerActivityKinds.has(kind)) return invalidResponse();
|
|
10092
|
+
const errorCode = optionalString(source.errorCode);
|
|
10093
|
+
const errorMessage = optionalString(source.errorMessage);
|
|
10094
|
+
if (errorMessage != null && errorMessage.length > 512) return invalidResponse();
|
|
10095
|
+
return {
|
|
10096
|
+
activityId: string(source.activityId),
|
|
10097
|
+
createdAt: string(source.createdAt),
|
|
10098
|
+
...errorCode == null ? {} : { errorCode },
|
|
10099
|
+
...errorMessage == null ? {} : { errorMessage },
|
|
10100
|
+
kind
|
|
10101
|
+
};
|
|
10102
|
+
}
|
|
10103
|
+
function triggerActivityPage(value) {
|
|
10104
|
+
const source = record(value);
|
|
10105
|
+
const nextCursor = optionalString(source.nextCursor);
|
|
10106
|
+
if (source.version != 1 || !Array.isArray(source.activities)) return invalidResponse();
|
|
10107
|
+
return {
|
|
10108
|
+
activities: source.activities.map(triggerActivity),
|
|
10109
|
+
...nextCursor == null ? {} : { nextCursor },
|
|
10110
|
+
version: 1
|
|
10111
|
+
};
|
|
10112
|
+
}
|
|
10113
|
+
function pollTriggerTestResult(value) {
|
|
10114
|
+
const source = record(value);
|
|
10115
|
+
const filtered = integer(source.filtered);
|
|
10116
|
+
if (source.version != 1 || !Array.isArray(source.events) || typeof source.hasMore != "boolean" || filtered < 0) return invalidResponse();
|
|
10117
|
+
return {
|
|
10118
|
+
events: source.events.map((event) => {
|
|
10119
|
+
const object = record(event);
|
|
10120
|
+
return Object.fromEntries(Object.entries(object).map(([key, item]) => [key, jsonValue(item)]));
|
|
10121
|
+
}),
|
|
10122
|
+
filtered,
|
|
10123
|
+
hasMore: source.hasMore,
|
|
10124
|
+
version: 1
|
|
10125
|
+
};
|
|
10126
|
+
}
|
|
10127
|
+
//#endregion
|
|
10128
|
+
//#region src/control/common/liveDetails.ts
|
|
10129
|
+
var metadata = {
|
|
10130
|
+
nodeId: string$1().min(1),
|
|
10131
|
+
name: string$1(),
|
|
10132
|
+
description: string$1().optional()
|
|
10133
|
+
};
|
|
10134
|
+
var binding = unknown().transform(triggerBinding);
|
|
10135
|
+
var provider = {
|
|
10136
|
+
provider: string$1().min(1),
|
|
10137
|
+
inputs: record$2(string$1(), discriminatedUnion("kind", [strictObject({
|
|
10138
|
+
kind: literal("value"),
|
|
10139
|
+
value: json$4()
|
|
10140
|
+
}), strictObject({ kind: literal("unset") })]))
|
|
10141
|
+
};
|
|
10142
|
+
var entrySchema = discriminatedUnion("type", [
|
|
10143
|
+
strictObject({
|
|
10144
|
+
...metadata,
|
|
10145
|
+
type: literal("manual"),
|
|
10146
|
+
config: authoringConfigurations.manual
|
|
10147
|
+
}),
|
|
10148
|
+
strictObject({
|
|
10149
|
+
...metadata,
|
|
10150
|
+
type: literal("webhook"),
|
|
10151
|
+
config: authoringConfigurations.webhook,
|
|
10152
|
+
binding
|
|
10153
|
+
}),
|
|
10154
|
+
strictObject({
|
|
10155
|
+
...metadata,
|
|
10156
|
+
type: literal("cron"),
|
|
10157
|
+
config: authoringConfigurations.cron,
|
|
10158
|
+
binding
|
|
10159
|
+
}),
|
|
10160
|
+
strictObject({
|
|
10161
|
+
...metadata,
|
|
10162
|
+
type: literal("error"),
|
|
10163
|
+
config: authoringConfigurations.error,
|
|
10164
|
+
binding
|
|
10165
|
+
}),
|
|
10166
|
+
strictObject({
|
|
10167
|
+
...metadata,
|
|
10168
|
+
...provider,
|
|
10169
|
+
type: literal("poll"),
|
|
10170
|
+
config: authoringConfigurations.poll,
|
|
10171
|
+
binding
|
|
10172
|
+
}),
|
|
10173
|
+
strictObject({
|
|
10174
|
+
...metadata,
|
|
10175
|
+
...provider,
|
|
10176
|
+
type: literal("integration"),
|
|
10177
|
+
config: authoringConfigurations.integration,
|
|
10178
|
+
binding
|
|
10179
|
+
})
|
|
10180
|
+
]);
|
|
10181
|
+
function decodeLiveDetails(value) {
|
|
10182
|
+
const source = record(value);
|
|
10183
|
+
const flowId = string(source.flowId);
|
|
10184
|
+
if (source.version != 1 || !Array.isArray(source.entries)) return invalidResponse();
|
|
10185
|
+
if (source.publication === null) {
|
|
10186
|
+
if (source.status != "not-published" || source.entries.length != 0 || Object.hasOwn(source, "enabled")) return invalidResponse();
|
|
10187
|
+
return {
|
|
10188
|
+
flowId,
|
|
10189
|
+
publication: null,
|
|
10190
|
+
status: "not-published",
|
|
10191
|
+
entries: [],
|
|
10192
|
+
version: 1
|
|
10193
|
+
};
|
|
10194
|
+
}
|
|
10195
|
+
const current = publication(source.publication);
|
|
10196
|
+
const status = source.status;
|
|
10197
|
+
if (current.flowId != flowId || typeof source.enabled != "boolean") return invalidResponse();
|
|
10198
|
+
if (status != "runnable" && status != "suspended") return invalidResponse();
|
|
10199
|
+
if (!source.enabled && source.status == "runnable") return invalidResponse();
|
|
10200
|
+
return {
|
|
10201
|
+
flowId,
|
|
10202
|
+
publication: current,
|
|
10203
|
+
status,
|
|
10204
|
+
enabled: source.enabled,
|
|
10205
|
+
entries: decodeEntries(source.entries, current),
|
|
10206
|
+
version: 1
|
|
10207
|
+
};
|
|
10208
|
+
}
|
|
10209
|
+
/** Both producers and consumers enforce the same published-entry invariants. */
|
|
10210
|
+
function decodeEntries(values, current) {
|
|
10211
|
+
const parsed = array(entrySchema).safeParse(values);
|
|
10212
|
+
if (!parsed.success) return invalidResponse();
|
|
10213
|
+
const ids = /* @__PURE__ */ new Set();
|
|
10214
|
+
for (const entry of parsed.data) {
|
|
10215
|
+
if (ids.has(entry.nodeId)) return invalidResponse();
|
|
10216
|
+
ids.add(entry.nodeId);
|
|
10217
|
+
if (entry.type != "manual" && (entry.binding.flowId != current.flowId || entry.binding.triggerNodeId != entry.nodeId || entry.binding.kind != entry.type || entry.binding.currentPublicationId != current.publicationId || entry.binding.currentRevisionId != current.revisionId)) return invalidResponse();
|
|
10218
|
+
if (entry.type == "webhook" && (!entry.binding.endpointUrl || !webhookSupportsBody(entry.config.method) && Object.keys(entry.config.body).length > 0)) return invalidResponse();
|
|
10219
|
+
}
|
|
10220
|
+
return parsed.data;
|
|
10221
|
+
}
|
|
10222
|
+
//#endregion
|
|
10223
|
+
//#region src/control/common/providerIconSprite.ts
|
|
10224
|
+
/** Optional artwork must never make an otherwise usable catalog unavailable. */
|
|
10225
|
+
function providerIconAppearance(metadata, position) {
|
|
10226
|
+
if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
|
|
10227
|
+
const m = metadata;
|
|
10228
|
+
const p = position;
|
|
10229
|
+
if (typeof m.version != "string" || ![
|
|
10230
|
+
m.pixelRatio,
|
|
10231
|
+
m.iconSize,
|
|
10232
|
+
m.width,
|
|
10233
|
+
m.height
|
|
10234
|
+
].every((v) => Number.isInteger(v) && v > 0) || ![
|
|
10235
|
+
m.bleed,
|
|
10236
|
+
p.x,
|
|
10237
|
+
p.y
|
|
10238
|
+
].every((v) => Number.isInteger(v) && v >= 0) || p.x + m.iconSize > m.width || p.y + m.iconSize > m.height) return {};
|
|
10239
|
+
try {
|
|
10240
|
+
for (const url of [m.lightUrl, m.darkUrl]) if (typeof url != "string" || ![
|
|
10241
|
+
"https:",
|
|
10242
|
+
"http:",
|
|
10243
|
+
"data:"
|
|
10244
|
+
].includes(new URL(url).protocol)) return {};
|
|
10245
|
+
} catch {
|
|
10246
|
+
return {};
|
|
10247
|
+
}
|
|
10248
|
+
return {
|
|
10249
|
+
iconSprite: m,
|
|
10250
|
+
iconSpritePosition: {
|
|
10251
|
+
x: p.x,
|
|
10252
|
+
y: p.y
|
|
10253
|
+
}
|
|
10254
|
+
};
|
|
10255
|
+
}
|
|
10256
|
+
new TextEncoder();
|
|
10257
|
+
//#endregion
|
|
10258
|
+
//#region src/control/common/providerAccess.ts
|
|
10259
|
+
var sourceSchema = discriminatedUnion("kind", [strictObject({ kind: literal("admin-delegation") }), strictObject({
|
|
10260
|
+
kind: literal("policy"),
|
|
10261
|
+
ruleId: string$1().min(1).nullable()
|
|
10262
|
+
})]);
|
|
10263
|
+
function parseProviderAccessSource(value) {
|
|
10264
|
+
return sourceSchema.parse(value);
|
|
10265
|
+
}
|
|
10266
|
+
//#endregion
|
|
10267
|
+
//#region src/control/common/connectorDecoders.ts
|
|
10268
|
+
function accessPermissions(value) {
|
|
10269
|
+
const source = record(value);
|
|
10270
|
+
exact(source, [
|
|
10271
|
+
"actionIds",
|
|
10272
|
+
"allActions",
|
|
10273
|
+
"triggerIds",
|
|
10274
|
+
"allTriggers",
|
|
10275
|
+
"configured",
|
|
10276
|
+
"proxy"
|
|
10277
|
+
]);
|
|
10278
|
+
if (!Array.isArray(source.actionIds)) return invalidResponse("permissions.actionIds: expected an array.");
|
|
10279
|
+
if (!Array.isArray(source.triggerIds)) return invalidResponse("permissions.triggerIds: expected an array.");
|
|
10280
|
+
if (typeof source.allActions != "boolean") return invalidResponse("permissions.allActions: expected a boolean.");
|
|
10281
|
+
if (typeof source.allTriggers != "boolean") return invalidResponse("permissions.allTriggers: expected a boolean.");
|
|
10282
|
+
if (typeof source.configured != "boolean") return invalidResponse("permissions.configured: expected a boolean.");
|
|
10283
|
+
if (typeof source.proxy != "boolean") return invalidResponse("permissions.proxy: expected a boolean.");
|
|
10284
|
+
const actionIds = source.actionIds.map(string);
|
|
10285
|
+
const triggerIds = source.triggerIds.map(string);
|
|
10286
|
+
if (new Set(actionIds).size != actionIds.length) return invalidResponse("permissions.actionIds: duplicate IDs.");
|
|
10287
|
+
if (source.allActions && actionIds.length != 0) return invalidResponse("permissions.actionIds: must be empty when allActions is true.");
|
|
10288
|
+
if (new Set(triggerIds).size != triggerIds.length) return invalidResponse("permissions.triggerIds: duplicate IDs.");
|
|
10289
|
+
if (source.allTriggers && triggerIds.length != 0) return invalidResponse("permissions.triggerIds: must be empty when allTriggers is true.");
|
|
10290
|
+
if (source.proxy && (!source.allActions || !source.allTriggers || source.configured)) return invalidResponse("permissions.proxy: requires allActions=true, allTriggers=true and configured=false.");
|
|
10291
|
+
return {
|
|
10292
|
+
actionIds,
|
|
10293
|
+
triggerIds,
|
|
10294
|
+
allTriggers: source.allTriggers,
|
|
10295
|
+
allActions: source.allActions,
|
|
10296
|
+
configured: source.configured,
|
|
10297
|
+
proxy: source.proxy
|
|
10298
|
+
};
|
|
10299
|
+
}
|
|
10300
|
+
function accessBinding(value, candidate) {
|
|
10301
|
+
const source = record(value);
|
|
10302
|
+
const policyRevision = source.policyRevision;
|
|
10303
|
+
const status = source.status;
|
|
10304
|
+
const isDefault = source.isDefault;
|
|
10305
|
+
const legacy = Object.hasOwn(source, "displayName") && !Object.hasOwn(source, "connectionDisplayName");
|
|
10306
|
+
const permissions = candidate && Object.hasOwn(source, "permissions") ? accessPermissions(source.permissions) : void 0;
|
|
10307
|
+
const permissionGroupName = source.permissionGroupName;
|
|
10308
|
+
exact(source, [
|
|
10309
|
+
"accessBindingId",
|
|
10310
|
+
"connectionId",
|
|
10311
|
+
"source",
|
|
10312
|
+
legacy ? "displayName" : "connectionDisplayName",
|
|
10313
|
+
...candidate && Object.hasOwn(source, "isDefault") ? ["isDefault"] : [],
|
|
10314
|
+
...candidate && permissions != null ? ["permissions"] : [],
|
|
10315
|
+
...Object.hasOwn(source, "permissionGroupName") ? ["permissionGroupName"] : [],
|
|
10316
|
+
...policyRevision == null ? [] : ["policyRevision"],
|
|
10317
|
+
"providerId",
|
|
10318
|
+
...candidate ? [] : ["status"]
|
|
10319
|
+
]);
|
|
10320
|
+
if (policyRevision != null && typeof policyRevision != "string") return invalidResponse("policyRevision: expected a string.");
|
|
10321
|
+
if (candidate && isDefault !== void 0 && typeof isDefault != "boolean") return invalidResponse("isDefault: expected a boolean.");
|
|
10322
|
+
if (permissionGroupName !== void 0 && permissionGroupName !== null && typeof permissionGroupName != "string") return invalidResponse("permissionGroupName: expected a string or null.");
|
|
10323
|
+
if (!candidate && status != "active" && status != "forbidden" && status != "invalid" && status != "missing") return invalidResponse();
|
|
10324
|
+
let bindingSource;
|
|
10325
|
+
try {
|
|
10326
|
+
bindingSource = parseProviderAccessSource(source.source);
|
|
10327
|
+
} catch {
|
|
10328
|
+
return invalidResponse("source: expected { kind: 'admin-delegation' } or { kind: 'policy', ruleId: string | null }.");
|
|
10329
|
+
}
|
|
10330
|
+
return {
|
|
10331
|
+
accessBindingId: string(source.accessBindingId),
|
|
10332
|
+
connectionId: string(source.connectionId),
|
|
10333
|
+
source: bindingSource,
|
|
10334
|
+
connectionDisplayName: string(legacy ? source.displayName : source.connectionDisplayName),
|
|
10335
|
+
...candidate && typeof isDefault == "boolean" ? { isDefault } : {},
|
|
10336
|
+
...permissions == null ? {} : { permissions },
|
|
10337
|
+
...permissionGroupName === void 0 ? {} : { permissionGroupName },
|
|
10338
|
+
...policyRevision == null ? {} : { policyRevision },
|
|
10339
|
+
providerId: string(source.providerId),
|
|
10340
|
+
...candidate ? {} : { status }
|
|
10341
|
+
};
|
|
10342
|
+
}
|
|
10343
|
+
function accessMode(value) {
|
|
10344
|
+
if (value != "implicit" && value != "selectable") return invalidResponse("mode: expected implicit or selectable.");
|
|
10345
|
+
return value;
|
|
10346
|
+
}
|
|
10347
|
+
function connectorAccess(value) {
|
|
10348
|
+
const source = record(value);
|
|
10349
|
+
exact(source, [
|
|
10350
|
+
"accessRevision",
|
|
10351
|
+
"bindings",
|
|
10352
|
+
"mode",
|
|
10353
|
+
"sharedAccessDigest",
|
|
10354
|
+
..."providerIds" in source ? ["providerIds"] : [],
|
|
10355
|
+
..."discardedBindingCount" in source ? ["discardedBindingCount"] : [],
|
|
10356
|
+
"version"
|
|
10357
|
+
]);
|
|
10358
|
+
const accessRevision = integer(source.accessRevision);
|
|
10359
|
+
if (source.version != 1 || accessRevision < 0 || !Array.isArray(source.bindings)) return invalidResponse();
|
|
10360
|
+
if ("providerIds" in source && !Array.isArray(source.providerIds)) return invalidResponse();
|
|
10361
|
+
const providerIds = source.providerIds == null ? void 0 : source.providerIds.map((id) => string(id));
|
|
10362
|
+
if (providerIds != null && new Set(providerIds).size != providerIds.length) return invalidResponse();
|
|
10363
|
+
let discardedBindingCount = source.discardedBindingCount == null ? 0 : integer(source.discardedBindingCount);
|
|
9931
10364
|
if (discardedBindingCount < 0) return invalidResponse();
|
|
9932
10365
|
const bindings = [];
|
|
9933
10366
|
for (const entry of source.bindings) try {
|
|
@@ -10135,292 +10568,107 @@ function connectorActionMetadata(value) {
|
|
|
10135
10568
|
return {
|
|
10136
10569
|
...source.inputSchema === void 0 ? {} : { inputSchema: jsonValue(source.inputSchema) },
|
|
10137
10570
|
...source.outputSchema === void 0 ? {} : { outputSchema: jsonValue(source.outputSchema) },
|
|
10138
|
-
actionId: string(source.actionId),
|
|
10139
|
-
...source.operationType == null ? {} : { operationType: string(source.operationType) },
|
|
10140
|
-
authenticated: typeof source.authenticated == "boolean" ? source.authenticated : invalidResponse(),
|
|
10141
|
-
description: typeof source.description == "string" ? source.description : invalidResponse(),
|
|
10142
|
-
...homepageUrl == null ? {} : { homepageUrl },
|
|
10143
|
-
...icon == null ? {} : { icon },
|
|
10144
|
-
...providerIconAppearance(source.iconSprite, source.iconSpritePosition),
|
|
10145
|
-
inputs: ports(source.inputs, inputPort),
|
|
10146
|
-
name: string(source.name),
|
|
10147
|
-
outputs: ports(source.outputs, port),
|
|
10148
|
-
serviceId: string(source.serviceId),
|
|
10149
|
-
serviceName: string(source.serviceName)
|
|
10150
|
-
};
|
|
10151
|
-
}
|
|
10152
|
-
function connectorAction(value) {
|
|
10153
|
-
const { defaultConnection, ...metadata } = record(value);
|
|
10154
|
-
const action = connectorActionMetadata(metadata);
|
|
10155
|
-
if (defaultConnection == null) return action;
|
|
10156
|
-
const preferred = connection(defaultConnection);
|
|
10157
|
-
if (preferred.serviceId != action.serviceId || preferred.status != "active") return invalidResponse();
|
|
10158
|
-
return {
|
|
10159
|
-
...action,
|
|
10160
|
-
defaultConnection: preferred
|
|
10161
|
-
};
|
|
10162
|
-
}
|
|
10163
|
-
function connectorProvider(value) {
|
|
10164
|
-
const source = record(value);
|
|
10165
|
-
const homepageUrl = source.homepageUrl;
|
|
10166
|
-
const icon = source.icon;
|
|
10167
|
-
if (source.noSetup !== void 0 && typeof source.noSetup != "boolean") return invalidResponse();
|
|
10168
|
-
exact(source, [
|
|
10169
|
-
...Object.hasOwn(source, "noSetup") ? ["noSetup"] : [],
|
|
10170
|
-
"serviceId",
|
|
10171
|
-
"serviceName",
|
|
10172
|
-
...homepageUrl == null ? [] : ["homepageUrl"],
|
|
10173
|
-
...icon == null ? [] : ["icon"],
|
|
10174
|
-
..."iconSprite" in source ? ["iconSprite"] : [],
|
|
10175
|
-
..."iconSpritePosition" in source ? ["iconSpritePosition"] : []
|
|
10176
|
-
]);
|
|
10177
|
-
if (homepageUrl != null && typeof homepageUrl != "string" || icon != null && typeof icon != "string") return invalidResponse();
|
|
10178
|
-
return {
|
|
10179
|
-
...homepageUrl == null ? {} : { homepageUrl },
|
|
10180
|
-
...icon == null ? {} : { icon },
|
|
10181
|
-
...providerIconAppearance(source.iconSprite, source.iconSpritePosition),
|
|
10182
|
-
serviceId: string(source.serviceId),
|
|
10183
|
-
serviceName: string(source.serviceName),
|
|
10184
|
-
...source.noSetup === void 0 ? {} : { noSetup: source.noSetup }
|
|
10185
|
-
};
|
|
10186
|
-
}
|
|
10187
|
-
//#endregion
|
|
10188
|
-
//#region src/control/common/eventSources.ts
|
|
10189
|
-
var id$1 = string$1().min(1).max(256);
|
|
10190
|
-
var eventType = string$1().regex(/^[a-z][a-z0-9_.]{0,127}$/);
|
|
10191
|
-
var name = string$1().trim().min(1).max(128);
|
|
10192
|
-
var eventSourceSchema = strictObject({
|
|
10193
|
-
version: literal(1),
|
|
10194
|
-
sourceId: id$1,
|
|
10195
|
-
revision: int().positive(),
|
|
10196
|
-
name,
|
|
10197
|
-
provider: _enum(["feishu", "feishu_app_bot"]),
|
|
10198
|
-
appId: id$1,
|
|
10199
|
-
connectionId: id$1,
|
|
10200
|
-
teamId: id$1.nullable(),
|
|
10201
|
-
enabled: boolean(),
|
|
10202
|
-
eventTypes: array(eventType),
|
|
10203
|
-
manageSubscriptions: boolean(),
|
|
10204
|
-
verificationTokenConfigured: boolean(),
|
|
10205
|
-
encryptKeyConfigured: boolean(),
|
|
10206
|
-
endpointUrl: string$1().nullable(),
|
|
10207
|
-
verifiedAt: string$1().nullable(),
|
|
10208
|
-
lastReceivedAt: string$1().nullable(),
|
|
10209
|
-
updatedAt: string$1(),
|
|
10210
|
-
consumers: array(strictObject({
|
|
10211
|
-
flowId: id$1,
|
|
10212
|
-
flowName: string$1(),
|
|
10213
|
-
triggerNodeId: id$1
|
|
10214
|
-
}))
|
|
10215
|
-
});
|
|
10216
|
-
function decodeEventSource(value) {
|
|
10217
|
-
return eventSourceSchema.parse(value);
|
|
10218
|
-
}
|
|
10219
|
-
function decodeEventSources(value) {
|
|
10220
|
-
return strictObject({
|
|
10221
|
-
version: literal(1),
|
|
10222
|
-
sources: array(eventSourceSchema),
|
|
10223
|
-
teamId: id$1.nullable().optional()
|
|
10224
|
-
}).parse(value);
|
|
10225
|
-
}
|
|
10226
|
-
var uiLanguageTags = new Map([
|
|
10227
|
-
"en",
|
|
10228
|
-
"zh-CN",
|
|
10229
|
-
"zh-TW",
|
|
10230
|
-
"ja",
|
|
10231
|
-
"ko",
|
|
10232
|
-
"ru",
|
|
10233
|
-
"fr"
|
|
10234
|
-
].map((language) => [language.toLowerCase(), language]));
|
|
10235
|
-
function isUiLanguage(value) {
|
|
10236
|
-
return typeof value == "string" && uiLanguageTags.get(value.toLowerCase()) == value;
|
|
10237
|
-
}
|
|
10238
|
-
//#endregion
|
|
10239
|
-
//#region src/trigger/common/configSchema.ts
|
|
10240
|
-
var configInputsSchema = array(union([strictObject({
|
|
10241
|
-
handle: string$1().min(1),
|
|
10242
|
-
description: string$1().optional(),
|
|
10243
|
-
jsonSchema: json$4(),
|
|
10244
|
-
nullable: boolean(),
|
|
10245
|
-
value: json$4().optional()
|
|
10246
|
-
}), strictObject({
|
|
10247
|
-
group: string$1(),
|
|
10248
|
-
collapsed: boolean().optional()
|
|
10249
|
-
})]));
|
|
10250
|
-
//#endregion
|
|
10251
|
-
//#region src/control/common/triggerDecoders.ts
|
|
10252
|
-
function triggerKeySummary(value) {
|
|
10253
|
-
const source = record(value);
|
|
10254
|
-
const type = source.type;
|
|
10255
|
-
if (type != "integration" && type != "poll") return invalidResponse();
|
|
10256
|
-
return {
|
|
10257
|
-
description: typeof source.description == "string" ? source.description : invalidResponse(),
|
|
10258
|
-
displayName: string(source.displayName),
|
|
10259
|
-
key: string(source.key),
|
|
10260
|
-
name: string(source.name),
|
|
10261
|
-
provider: string(source.provider),
|
|
10262
|
-
type
|
|
10263
|
-
};
|
|
10264
|
-
}
|
|
10265
|
-
function triggerKey(value) {
|
|
10266
|
-
const source = record(value);
|
|
10267
|
-
const summary = triggerKeySummary(source);
|
|
10268
|
-
const base = {
|
|
10269
|
-
configInputs: configInputsSchema.parse(source.configInputs),
|
|
10270
|
-
definitionVersion: source.definitionVersion === 2 ? 2 : invalidResponse(),
|
|
10271
|
-
description: summary.description,
|
|
10272
|
-
displayName: summary.displayName,
|
|
10273
|
-
key: summary.key,
|
|
10274
|
-
name: summary.name,
|
|
10275
|
-
outputs: (Array.isArray(source.outputs) ? source.outputs : invalidResponse()).map((entry) => {
|
|
10276
|
-
const port = record(entry);
|
|
10277
|
-
return Object.assign({
|
|
10278
|
-
handle: string(port.handle),
|
|
10279
|
-
jsonSchema: jsonValue(port.jsonSchema),
|
|
10280
|
-
nullable: typeof port.nullable === "boolean" ? port.nullable : invalidResponse()
|
|
10281
|
-
}, port.description == null ? {} : { description: string(port.description) });
|
|
10282
|
-
}),
|
|
10283
|
-
provider: summary.provider
|
|
10284
|
-
};
|
|
10285
|
-
if (summary.type == "poll") return {
|
|
10286
|
-
...base,
|
|
10287
|
-
type: "poll"
|
|
10288
|
-
};
|
|
10289
|
-
const endpoint = record(source.endpoint);
|
|
10290
|
-
const body = record(endpoint.body);
|
|
10291
|
-
if (!Array.isArray(endpoint.methods) || !Array.isArray(body.formats) || typeof body.allowArray != "boolean" || typeof body.allowEmpty != "boolean") return invalidResponse();
|
|
10292
|
-
const methods = endpoint.methods.map(string);
|
|
10293
|
-
const formats = body.formats.map(string);
|
|
10294
|
-
const successStatus = integer(endpoint.successStatus);
|
|
10295
|
-
if (methods.some((method) => ![
|
|
10296
|
-
"DELETE",
|
|
10297
|
-
"GET",
|
|
10298
|
-
"HEAD",
|
|
10299
|
-
"PATCH",
|
|
10300
|
-
"POST",
|
|
10301
|
-
"PUT"
|
|
10302
|
-
].includes(method)) || formats.some((format) => ![
|
|
10303
|
-
"form",
|
|
10304
|
-
"json",
|
|
10305
|
-
"multipart",
|
|
10306
|
-
"text"
|
|
10307
|
-
].includes(format)) || successStatus < 200 || successStatus > 299) return invalidResponse();
|
|
10308
|
-
return {
|
|
10309
|
-
...base,
|
|
10310
|
-
endpoint: {
|
|
10311
|
-
body: {
|
|
10312
|
-
allowArray: body.allowArray,
|
|
10313
|
-
allowEmpty: body.allowEmpty,
|
|
10314
|
-
formats
|
|
10315
|
-
},
|
|
10316
|
-
methods,
|
|
10317
|
-
successStatus
|
|
10318
|
-
},
|
|
10319
|
-
type: "integration"
|
|
10320
|
-
};
|
|
10321
|
-
}
|
|
10322
|
-
var triggerKinds = /* @__PURE__ */ new Set([
|
|
10323
|
-
"error",
|
|
10324
|
-
"cron",
|
|
10325
|
-
"integration",
|
|
10326
|
-
"poll",
|
|
10327
|
-
"webhook"
|
|
10328
|
-
]);
|
|
10329
|
-
var triggerHealth = /* @__PURE__ */ new Set([
|
|
10330
|
-
"failed",
|
|
10331
|
-
"healthy",
|
|
10332
|
-
"initializing",
|
|
10333
|
-
"needs_reauth",
|
|
10334
|
-
"suspended"
|
|
10335
|
-
]);
|
|
10336
|
-
var triggerActivityKinds = /* @__PURE__ */ new Set([
|
|
10337
|
-
"delivery.failed",
|
|
10338
|
-
"health.failed",
|
|
10339
|
-
"health.needs_reauth",
|
|
10340
|
-
"health.recovered",
|
|
10341
|
-
"health.suspended",
|
|
10342
|
-
"operator.paused",
|
|
10343
|
-
"operator.resumed"
|
|
10344
|
-
]);
|
|
10345
|
-
function triggerBinding(value) {
|
|
10346
|
-
const source = record(value);
|
|
10347
|
-
const health = source.health;
|
|
10348
|
-
const listener = source.listener == null ? void 0 : record(source.listener);
|
|
10349
|
-
if (listener != null && listener.health != "healthy" && listener.health != "failed" && listener.health != "needs_reauth") return invalidResponse();
|
|
10350
|
-
const kind = source.kind;
|
|
10351
|
-
const operatorState = source.operatorState;
|
|
10352
|
-
const runtimeVersion = integer(source.runtimeVersion);
|
|
10353
|
-
if (source.version != 1 || typeof health != "string" || !triggerHealth.has(health)) return invalidResponse();
|
|
10354
|
-
if (typeof kind != "string" || !triggerKinds.has(kind)) return invalidResponse();
|
|
10355
|
-
if (operatorState != "active" && operatorState != "paused") return invalidResponse();
|
|
10356
|
-
if (runtimeVersion <= 0) return invalidResponse();
|
|
10357
|
-
return {
|
|
10358
|
-
...source.currentPublicationId == null ? {} : { currentPublicationId: string(source.currentPublicationId) },
|
|
10359
|
-
...source.currentRevisionId == null ? {} : { currentRevisionId: string(source.currentRevisionId) },
|
|
10360
|
-
...source.endpointUrl == null ? {} : { endpointUrl: string(source.endpointUrl) },
|
|
10361
|
-
...listener == null ? {} : { listener: {
|
|
10362
|
-
health: listener.health,
|
|
10363
|
-
...listener.lastErrorCode == null ? {} : { lastErrorCode: string(listener.lastErrorCode) }
|
|
10364
|
-
} },
|
|
10365
|
-
flowId: string(source.flowId),
|
|
10366
|
-
health,
|
|
10367
|
-
kind,
|
|
10368
|
-
...source.lastErrorCode == null ? {} : { lastErrorCode: string(source.lastErrorCode) },
|
|
10369
|
-
operatorState,
|
|
10370
|
-
runtimeVersion,
|
|
10371
|
-
triggerNodeId: string(source.triggerNodeId),
|
|
10372
|
-
updatedAt: string(source.updatedAt),
|
|
10373
|
-
version: 1
|
|
10374
|
-
};
|
|
10375
|
-
}
|
|
10376
|
-
function triggerBindingDetail(value) {
|
|
10377
|
-
const source = record(value);
|
|
10378
|
-
if (source.version != 1) return invalidResponse();
|
|
10379
|
-
return {
|
|
10380
|
-
binding: triggerBinding(source.binding),
|
|
10381
|
-
version: 1
|
|
10382
|
-
};
|
|
10383
|
-
}
|
|
10384
|
-
function triggerActivity(value) {
|
|
10385
|
-
const source = record(value);
|
|
10386
|
-
const kind = source.kind;
|
|
10387
|
-
if (typeof kind != "string" || !triggerActivityKinds.has(kind)) return invalidResponse();
|
|
10388
|
-
const errorCode = optionalString(source.errorCode);
|
|
10389
|
-
const errorMessage = optionalString(source.errorMessage);
|
|
10390
|
-
if (errorMessage != null && errorMessage.length > 512) return invalidResponse();
|
|
10391
|
-
return {
|
|
10392
|
-
activityId: string(source.activityId),
|
|
10393
|
-
createdAt: string(source.createdAt),
|
|
10394
|
-
...errorCode == null ? {} : { errorCode },
|
|
10395
|
-
...errorMessage == null ? {} : { errorMessage },
|
|
10396
|
-
kind
|
|
10571
|
+
actionId: string(source.actionId),
|
|
10572
|
+
...source.operationType == null ? {} : { operationType: string(source.operationType) },
|
|
10573
|
+
authenticated: typeof source.authenticated == "boolean" ? source.authenticated : invalidResponse(),
|
|
10574
|
+
description: typeof source.description == "string" ? source.description : invalidResponse(),
|
|
10575
|
+
...homepageUrl == null ? {} : { homepageUrl },
|
|
10576
|
+
...icon == null ? {} : { icon },
|
|
10577
|
+
...providerIconAppearance(source.iconSprite, source.iconSpritePosition),
|
|
10578
|
+
inputs: ports(source.inputs, inputPort),
|
|
10579
|
+
name: string(source.name),
|
|
10580
|
+
outputs: ports(source.outputs, port),
|
|
10581
|
+
serviceId: string(source.serviceId),
|
|
10582
|
+
serviceName: string(source.serviceName)
|
|
10397
10583
|
};
|
|
10398
10584
|
}
|
|
10399
|
-
function
|
|
10400
|
-
const
|
|
10401
|
-
const
|
|
10402
|
-
if (
|
|
10585
|
+
function connectorAction(value) {
|
|
10586
|
+
const { defaultConnection, ...metadata } = record(value);
|
|
10587
|
+
const action = connectorActionMetadata(metadata);
|
|
10588
|
+
if (defaultConnection == null) return action;
|
|
10589
|
+
const preferred = connection(defaultConnection);
|
|
10590
|
+
if (preferred.serviceId != action.serviceId || preferred.status != "active") return invalidResponse();
|
|
10403
10591
|
return {
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
version: 1
|
|
10592
|
+
...action,
|
|
10593
|
+
defaultConnection: preferred
|
|
10407
10594
|
};
|
|
10408
10595
|
}
|
|
10409
|
-
function
|
|
10596
|
+
function connectorProvider(value) {
|
|
10410
10597
|
const source = record(value);
|
|
10411
|
-
const
|
|
10412
|
-
|
|
10598
|
+
const homepageUrl = source.homepageUrl;
|
|
10599
|
+
const icon = source.icon;
|
|
10600
|
+
if (source.noSetup !== void 0 && typeof source.noSetup != "boolean") return invalidResponse();
|
|
10601
|
+
exact(source, [
|
|
10602
|
+
...Object.hasOwn(source, "noSetup") ? ["noSetup"] : [],
|
|
10603
|
+
"serviceId",
|
|
10604
|
+
"serviceName",
|
|
10605
|
+
...homepageUrl == null ? [] : ["homepageUrl"],
|
|
10606
|
+
...icon == null ? [] : ["icon"],
|
|
10607
|
+
..."iconSprite" in source ? ["iconSprite"] : [],
|
|
10608
|
+
..."iconSpritePosition" in source ? ["iconSpritePosition"] : []
|
|
10609
|
+
]);
|
|
10610
|
+
if (homepageUrl != null && typeof homepageUrl != "string" || icon != null && typeof icon != "string") return invalidResponse();
|
|
10413
10611
|
return {
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
version: 1
|
|
10612
|
+
...homepageUrl == null ? {} : { homepageUrl },
|
|
10613
|
+
...icon == null ? {} : { icon },
|
|
10614
|
+
...providerIconAppearance(source.iconSprite, source.iconSpritePosition),
|
|
10615
|
+
serviceId: string(source.serviceId),
|
|
10616
|
+
serviceName: string(source.serviceName),
|
|
10617
|
+
...source.noSetup === void 0 ? {} : { noSetup: source.noSetup }
|
|
10421
10618
|
};
|
|
10422
10619
|
}
|
|
10423
10620
|
//#endregion
|
|
10621
|
+
//#region src/control/common/eventSources.ts
|
|
10622
|
+
var id$1 = string$1().min(1).max(256);
|
|
10623
|
+
var eventType = string$1().regex(/^[a-z][a-z0-9_.]{0,127}$/);
|
|
10624
|
+
var name = string$1().trim().min(1).max(128);
|
|
10625
|
+
var eventSourceSchema = strictObject({
|
|
10626
|
+
version: literal(1),
|
|
10627
|
+
sourceId: id$1,
|
|
10628
|
+
revision: int().positive(),
|
|
10629
|
+
name,
|
|
10630
|
+
provider: _enum(["feishu", "feishu_app_bot"]),
|
|
10631
|
+
appId: id$1,
|
|
10632
|
+
connectionId: id$1,
|
|
10633
|
+
teamId: id$1.nullable(),
|
|
10634
|
+
enabled: boolean(),
|
|
10635
|
+
eventTypes: array(eventType),
|
|
10636
|
+
manageSubscriptions: boolean(),
|
|
10637
|
+
verificationTokenConfigured: boolean(),
|
|
10638
|
+
encryptKeyConfigured: boolean(),
|
|
10639
|
+
endpointUrl: string$1().nullable(),
|
|
10640
|
+
verifiedAt: string$1().nullable(),
|
|
10641
|
+
lastReceivedAt: string$1().nullable(),
|
|
10642
|
+
updatedAt: string$1(),
|
|
10643
|
+
consumers: array(strictObject({
|
|
10644
|
+
flowId: id$1,
|
|
10645
|
+
flowName: string$1(),
|
|
10646
|
+
triggerNodeId: id$1
|
|
10647
|
+
}))
|
|
10648
|
+
});
|
|
10649
|
+
function decodeEventSource(value) {
|
|
10650
|
+
return eventSourceSchema.parse(value);
|
|
10651
|
+
}
|
|
10652
|
+
function decodeEventSources(value) {
|
|
10653
|
+
return strictObject({
|
|
10654
|
+
version: literal(1),
|
|
10655
|
+
sources: array(eventSourceSchema),
|
|
10656
|
+
teamId: id$1.nullable().optional()
|
|
10657
|
+
}).parse(value);
|
|
10658
|
+
}
|
|
10659
|
+
var uiLanguageTags = new Map([
|
|
10660
|
+
"en",
|
|
10661
|
+
"zh-CN",
|
|
10662
|
+
"zh-TW",
|
|
10663
|
+
"ja",
|
|
10664
|
+
"ko",
|
|
10665
|
+
"ru",
|
|
10666
|
+
"fr"
|
|
10667
|
+
].map((language) => [language.toLowerCase(), language]));
|
|
10668
|
+
function isUiLanguage(value) {
|
|
10669
|
+
return typeof value == "string" && uiLanguageTags.get(value.toLowerCase()) == value;
|
|
10670
|
+
}
|
|
10671
|
+
//#endregion
|
|
10424
10672
|
//#region src/control/common/triggerCatalog.ts
|
|
10425
10673
|
function decodeTriggerCatalog(value) {
|
|
10426
10674
|
const source = record(value);
|
|
@@ -10747,140 +10995,54 @@ function errorListener(value) {
|
|
|
10747
10995
|
enabled: source.enabled
|
|
10748
10996
|
};
|
|
10749
10997
|
}
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
if (source.version != 1) return invalidResponse();
|
|
10759
|
-
if (operation != "publish" && operation != "rollback") return invalidResponse();
|
|
10760
|
-
if (sourcePublicationId != null && typeof sourcePublicationId != "string") return invalidResponse();
|
|
10998
|
+
function variableReferences(input) {
|
|
10999
|
+
const source = record(input);
|
|
11000
|
+
exact(source, [
|
|
11001
|
+
"version",
|
|
11002
|
+
"references",
|
|
11003
|
+
"unknown"
|
|
11004
|
+
]);
|
|
11005
|
+
if (source.version != 1 || !Array.isArray(source.references) || !Array.isArray(source.unknown)) return invalidResponse();
|
|
10761
11006
|
return {
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
actorId: string(source.actorId),
|
|
10767
|
-
closureDigest: string(source.closureDigest),
|
|
10768
|
-
createdAt: string(source.createdAt),
|
|
10769
|
-
engineContract: string(source.engineContract),
|
|
10770
|
-
flowId: string(source.flowId),
|
|
10771
|
-
modelVersion: integer(source.modelVersion),
|
|
10772
|
-
operation,
|
|
10773
|
-
publicationId: string(source.publicationId),
|
|
10774
|
-
sharedAccessDigest: string(source.sharedAccessDigest),
|
|
10775
|
-
revisionDigest: string(source.revisionDigest),
|
|
10776
|
-
revisionId: string(source.revisionId),
|
|
10777
|
-
...sourcePublicationId == null ? {} : { sourcePublicationId },
|
|
10778
|
-
version: 1
|
|
10779
|
-
};
|
|
10780
|
-
}
|
|
10781
|
-
function publishOperation(value) {
|
|
10782
|
-
const source = record(value);
|
|
10783
|
-
const status = source.status;
|
|
10784
|
-
const common = {
|
|
10785
|
-
createdAt: string(source.createdAt),
|
|
10786
|
-
flowId: string(source.flowId),
|
|
10787
|
-
operationId: string(source.operationId),
|
|
10788
|
-
revisionId: string(source.revisionId),
|
|
10789
|
-
updatedAt: string(source.updatedAt),
|
|
10790
|
-
version: 1
|
|
10791
|
-
};
|
|
10792
|
-
if (source.version != 1) return invalidResponse();
|
|
10793
|
-
switch (status) {
|
|
10794
|
-
case "pending":
|
|
10795
|
-
exact(source, [
|
|
10796
|
-
"createdAt",
|
|
10797
|
-
"flowId",
|
|
10798
|
-
"operationId",
|
|
10799
|
-
"revisionId",
|
|
10800
|
-
"status",
|
|
10801
|
-
"updatedAt",
|
|
10802
|
-
"version"
|
|
10803
|
-
]);
|
|
10804
|
-
return {
|
|
10805
|
-
...common,
|
|
10806
|
-
status
|
|
10807
|
-
};
|
|
10808
|
-
case "succeeded":
|
|
10809
|
-
exact(source, [
|
|
10810
|
-
"createdAt",
|
|
11007
|
+
version: 1,
|
|
11008
|
+
references: source.references.map((value) => {
|
|
11009
|
+
const item = record(value);
|
|
11010
|
+
exact(item, [
|
|
10811
11011
|
"flowId",
|
|
10812
|
-
"
|
|
10813
|
-
"
|
|
10814
|
-
"
|
|
10815
|
-
"status",
|
|
10816
|
-
"updatedAt",
|
|
10817
|
-
"version"
|
|
11012
|
+
"flowName",
|
|
11013
|
+
"draft",
|
|
11014
|
+
"live"
|
|
10818
11015
|
]);
|
|
11016
|
+
if (typeof item.draft != "boolean") return invalidResponse();
|
|
11017
|
+
const live = item.live === null ? null : record(item.live);
|
|
11018
|
+
if (live != null) {
|
|
11019
|
+
exact(live, ["publicationId", "enabled"]);
|
|
11020
|
+
if (typeof live.enabled != "boolean") return invalidResponse();
|
|
11021
|
+
}
|
|
10819
11022
|
return {
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
11023
|
+
flowId: string(item.flowId),
|
|
11024
|
+
flowName: string(item.flowName),
|
|
11025
|
+
draft: item.draft,
|
|
11026
|
+
live: live == null ? null : {
|
|
11027
|
+
publicationId: string(live.publicationId),
|
|
11028
|
+
enabled: live.enabled
|
|
11029
|
+
}
|
|
10823
11030
|
};
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
11031
|
+
}),
|
|
11032
|
+
unknown: source.unknown.map((value) => {
|
|
11033
|
+
const item = record(value);
|
|
11034
|
+
exact(item, [
|
|
10827
11035
|
"flowId",
|
|
10828
|
-
"
|
|
10829
|
-
"
|
|
10830
|
-
"revisionId",
|
|
10831
|
-
"status",
|
|
10832
|
-
"updatedAt",
|
|
10833
|
-
"version"
|
|
10834
|
-
]);
|
|
10835
|
-
const issue = record(source.issue);
|
|
10836
|
-
const nodeId = issue.nodeId;
|
|
10837
|
-
exact(issue, [
|
|
10838
|
-
"code",
|
|
10839
|
-
"message",
|
|
10840
|
-
...nodeId == null ? [] : ["nodeId"]
|
|
11036
|
+
"flowName",
|
|
11037
|
+
"scope"
|
|
10841
11038
|
]);
|
|
11039
|
+
if (item.scope !== "draft" && item.scope !== "live") return invalidResponse();
|
|
10842
11040
|
return {
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
message: string(issue.message),
|
|
10847
|
-
...nodeId == null ? {} : { nodeId: string(nodeId) }
|
|
10848
|
-
},
|
|
10849
|
-
status
|
|
11041
|
+
flowId: string(item.flowId),
|
|
11042
|
+
flowName: string(item.flowName),
|
|
11043
|
+
scope: item.scope
|
|
10850
11044
|
};
|
|
10851
|
-
}
|
|
10852
|
-
default: return invalidResponse();
|
|
10853
|
-
}
|
|
10854
|
-
}
|
|
10855
|
-
function live(value) {
|
|
10856
|
-
const source = record(value);
|
|
10857
|
-
const status = source.status;
|
|
10858
|
-
const candidate = source.publication;
|
|
10859
|
-
if (source.version != 1 || typeof source.hasUnpublishedChanges != "boolean") return invalidResponse();
|
|
10860
|
-
if (status != "not-published" && status != "runnable" && status != "suspended") return invalidResponse();
|
|
10861
|
-
if (status == "not-published" && candidate !== null) return invalidResponse();
|
|
10862
|
-
if (status != "not-published" && candidate === null) return invalidResponse();
|
|
10863
|
-
return {
|
|
10864
|
-
flowId: string(source.flowId),
|
|
10865
|
-
hasUnpublishedChanges: source.hasUnpublishedChanges,
|
|
10866
|
-
publication: candidate === null ? null : publication(candidate),
|
|
10867
|
-
revision: integer(source.revision),
|
|
10868
|
-
status,
|
|
10869
|
-
version: 1
|
|
10870
|
-
};
|
|
10871
|
-
}
|
|
10872
|
-
function publicationPage(value) {
|
|
10873
|
-
const source = record(value);
|
|
10874
|
-
const nextCursor = source.nextCursor;
|
|
10875
|
-
const total = source.total;
|
|
10876
|
-
if (source.version != 1 || !Array.isArray(source.publications)) return invalidResponse();
|
|
10877
|
-
if (nextCursor != null && typeof nextCursor != "string") return invalidResponse();
|
|
10878
|
-
if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
|
|
10879
|
-
return {
|
|
10880
|
-
...nextCursor == null ? {} : { nextCursor },
|
|
10881
|
-
publications: source.publications.map(publication),
|
|
10882
|
-
...total == null ? {} : { total },
|
|
10883
|
-
version: 1
|
|
11045
|
+
})
|
|
10884
11046
|
};
|
|
10885
11047
|
}
|
|
10886
11048
|
//#endregion
|
|
@@ -11441,6 +11603,9 @@ var ControlClient = class {
|
|
|
11441
11603
|
version: 1
|
|
11442
11604
|
};
|
|
11443
11605
|
}
|
|
11606
|
+
async getVariableReferences(name, signal) {
|
|
11607
|
+
return variableReferences(await this.request(`/v1/variables/${segment(name)}/references`, { signal }));
|
|
11608
|
+
}
|
|
11444
11609
|
async getVariable(name) {
|
|
11445
11610
|
return variable(await this.request(`/v1/variables/${segment(name)}`));
|
|
11446
11611
|
}
|
|
@@ -11553,18 +11718,6 @@ var ControlClient = class {
|
|
|
11553
11718
|
const query = parameters.size == 0 ? "" : `?${parameters}`;
|
|
11554
11719
|
return triggerActivityPage(await this.request(`/v1/flows/${segment(flowId)}/triggers/${segment(triggerNodeId)}/activities${query}`));
|
|
11555
11720
|
}
|
|
11556
|
-
async pauseFlowTrigger(flowId, triggerNodeId) {
|
|
11557
|
-
return triggerBinding(await this.request(`/v1/flows/${segment(flowId)}/triggers/${segment(triggerNodeId)}/pause`, {
|
|
11558
|
-
body: JSON.stringify({ version: 1 }),
|
|
11559
|
-
method: "POST"
|
|
11560
|
-
}));
|
|
11561
|
-
}
|
|
11562
|
-
async resumeFlowTrigger(flowId, triggerNodeId) {
|
|
11563
|
-
return triggerBinding(await this.request(`/v1/flows/${segment(flowId)}/triggers/${segment(triggerNodeId)}/resume`, {
|
|
11564
|
-
body: JSON.stringify({ version: 1 }),
|
|
11565
|
-
method: "POST"
|
|
11566
|
-
}));
|
|
11567
|
-
}
|
|
11568
11721
|
async testFlowPollTrigger(flowId, triggerNodeId) {
|
|
11569
11722
|
return pollTriggerTestResult(await this.request(`/v1/flows/${segment(flowId)}/triggers/${segment(triggerNodeId)}/test`, {
|
|
11570
11723
|
body: JSON.stringify({ version: 1 }),
|
|
@@ -11820,6 +11973,11 @@ var ControlClient = class {
|
|
|
11820
11973
|
method: "POST"
|
|
11821
11974
|
}));
|
|
11822
11975
|
}
|
|
11976
|
+
async getLiveDetails(flowId, signal) {
|
|
11977
|
+
const details = decodeLiveDetails(await this.request(`/v1/flows/${segment(flowId)}/live/details`, { signal }));
|
|
11978
|
+
if (details.flowId != flowId) return invalidResponse();
|
|
11979
|
+
return details;
|
|
11980
|
+
}
|
|
11823
11981
|
async getLive(flowId, signal) {
|
|
11824
11982
|
return live(await this.request(`/v1/flows/${segment(flowId)}/live`, { signal }));
|
|
11825
11983
|
}
|
|
@@ -12156,7 +12314,7 @@ var mutationKey = id.max(256).describe("Stable identity for this mutation. Retry
|
|
|
12156
12314
|
var pageLimit = int().min(1).max(100).default(50);
|
|
12157
12315
|
var flow = id.describe("Exact Flow ID returned by flow_list or flow_create.");
|
|
12158
12316
|
var run = id.describe("Exact Run ID returned by flow_run or run_list.");
|
|
12159
|
-
var mcpInstructions = "Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. 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. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. 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_edit with identical arguments and the same requestId. Retry flow_create, 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.";
|
|
12317
|
+
var mcpInstructions = "Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. 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. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_live to inspect current online entries after publication. 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_edit with identical arguments and the same requestId. Retry flow_create, 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.";
|
|
12160
12318
|
function tool(description, schema, readOnly) {
|
|
12161
12319
|
return {
|
|
12162
12320
|
description,
|
|
@@ -12184,6 +12342,7 @@ function tool(description, schema, readOnly) {
|
|
|
12184
12342
|
};
|
|
12185
12343
|
}
|
|
12186
12344
|
var mcpTools = {
|
|
12345
|
+
flow_live: tool("Read the current published Flow, enablement and online entries, including Webhook URLs and request fields. Draft changes do not affect this view. An unpublished Flow returns not-published with no entries.", strictObject({ flowId: flow }), true),
|
|
12187
12346
|
flow_list: tool("List Flows in this deployment. Continue with nextCursor; cursors are compatible with the Control API.", strictObject({
|
|
12188
12347
|
cursor: id.optional(),
|
|
12189
12348
|
limit: pageLimit
|