@oomol-lab/open-flow 0.1.0-beta.26 → 0.1.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{createResourceDialog-BwI2JmPE.js → createResourceDialog-C2ZLGPla.js} +1 -1
- package/dist/browser/flow-authoring-node.d.ts +3 -2
- package/dist/browser/flow-authoring.js +933 -915
- package/dist/browser/flow-change-schema.d.ts +4 -0
- package/dist/browser/flow-change.d.ts +8 -7
- package/dist/browser/flow-change.js +1067 -1050
- package/dist/browser/flow-notifications.d.ts +6 -2
- package/dist/browser/{flowChanges-BqPtWEI9.js → flowChanges-Z49mslMz.js} +1098 -1027
- package/dist/browser/{flowWorkspace-CpMGzmfz.js → flowWorkspace-DCaVDqtY.js} +40105 -43746
- package/dist/browser/host-conformance.js +7 -1
- package/dist/browser/{inputValues-CeeJw_G8.js → inputValues-CLnpqFAf.js} +1 -1
- package/dist/browser/{markdownContent-SIlWuHve.js → markdownContent-Bon8uhjM.js} +23 -23
- package/dist/browser/{switch-CyZ96-UF.js → switch-DuB8aovT.js} +5035 -513
- package/dist/browser/ui.css +1 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +890 -727
- package/dist/browser/{workbenchSelect-BUu7CjUA.js → workbenchSelect-DX9IFmX-.js} +1187 -1156
- package/dist/common/authoringExamples.d.ts +27 -0
- package/dist/common/control-api-conformance.js +838 -820
- package/dist/common/control-api-errors.d.ts +8 -0
- package/dist/common/control-api.d.ts +7 -3
- package/dist/common/control-api.js +1425 -1381
- package/dist/common/control-requests.d.ts +13 -6
- package/dist/common/control-requests.js +2034 -1510
- package/dist/common/cron-trigger.d.ts +2 -1
- package/dist/common/cron-trigger.js +27 -24
- package/dist/common/draftOperations.d.ts +14 -0
- package/dist/common/engine-contract.d.ts +2 -2
- package/dist/common/flow-encoding.d.ts +3 -0
- package/dist/common/flow-encoding.js +1067 -968
- package/dist/common/flow-notifications.d.ts +6 -2
- package/dist/common/flow-schema.d.ts +1 -2
- package/dist/common/flow-semantics.d.ts +2 -1
- package/dist/common/flow-semantics.js +7935 -7812
- package/dist/common/flowInspection.d.ts +16 -0
- package/dist/common/integration-trigger.d.ts +2 -2
- package/dist/common/integration-trigger.js +8 -8
- package/dist/common/mcp.d.ts +2 -1
- package/dist/common/mcp.js +140 -118
- package/dist/common/poll-trigger.d.ts +3 -0
- package/dist/common/poll-trigger.js +26 -22
- package/dist/common/provider-triggers.js +2704 -2599
- package/dist/common/runtime-contract.js +3 -3
- package/dist/common/scheduler.d.ts +4 -3
- package/dist/common/scheduler.js +1855 -1725
- package/dist/common/trigger-contract.d.ts +5 -0
- package/dist/common/webhook-trigger.d.ts +3 -3
- package/dist/common/webhook-trigger.js +64 -18
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as e, i as t, l as n, t as r } from "./dist-Dz6Nglsd.js";
|
|
2
2
|
import { i, t as a } from "./main-BDnNHhkU.js";
|
|
3
3
|
import { $ as o, $n as s, $t as c, A as l, Bn as u, Ct as d, D as f, En as p, Et as m, F as h, Fn as g, G as _, Gn as v, H as y, Hn as b, I as x, J as ee, K as S, Kn as C, L as te, M as w, N as ne, O as T, Ot as re, P as ie, Pn as E, Q as ae, R as D, Sn as oe, St as se, U as O, Un as ce, V as le, Vn as k, W as ue, Wn as A, X as de, Xn as fe, Y as pe, Yn as me, Z as he, Zn as ge, a as _e, ar as ve, at as ye, c as be, cn as xe, ct as Se, d as Ce, dr as we, dt as Te, er as Ee, et as De, fn as Oe, ft as ke, gn as Ae, gt as je, hn as Me, ht as Ne, i as Pe, it as Fe, j as Ie, jt as Le, kt as Re, l as ze, ln as Be, lt as Ve, n as He, nr as Ue, nt as We, o as Ge, on as Ke, or as qe, ot as Je, q as Ye, qn as Xe, rn as Ze, rr as Qe, rt as $e, sn as et, sr as tt, st as nt, t as rt, tn as it, tr as at, tt as ot, u as st, un as ct, ur as lt, ut, v as dt, vt as ft, xn as pt, xt as mt, zn as ht } from "./lite-BuKZ8joP.js";
|
|
4
|
-
import {
|
|
5
|
-
import { A as Ct, B as wt, C as Tt, D as Et, E as Dt, F as Ot, I as kt, L as At, M as jt, N as Mt, O as Nt, P as Pt, R as j, S as Ft, T as It, V as Lt, b as Rt, j as zt, k as Bt, n as Vt, v as Ht, y as Ut, z as Wt } from "./workbenchSelect-
|
|
4
|
+
import { _ as gt, a as _t, g as vt, o as yt, v as bt, x as xt, y as St } from "./switch-DuB8aovT.js";
|
|
5
|
+
import { A as Ct, B as wt, C as Tt, D as Et, E as Dt, F as Ot, I as kt, L as At, M as jt, N as Mt, O as Nt, P as Pt, R as j, S as Ft, T as It, V as Lt, b as Rt, j as zt, k as Bt, n as Vt, v as Ht, y as Ut, z as Wt } from "./workbenchSelect-DX9IFmX-.js";
|
|
6
6
|
import { t as Gt } from "./languages-C0zQ4GSo.js";
|
|
7
7
|
import { a as Kt, o as qt, r as Jt } from "./dist-B_T-OpQp.js";
|
|
8
8
|
import "./lib-C5Ipyfps.js";
|
|
@@ -30,6 +30,8 @@ var sn = et("ChevronRight", [["path", {
|
|
|
30
30
|
eventSourceNotFound: "event-source.not-found",
|
|
31
31
|
eventSourceConflict: "event-source.conflict",
|
|
32
32
|
flowInvalid: "flow.invalid",
|
|
33
|
+
flowRepairRequired: "flow.repair-required",
|
|
34
|
+
flowUpgradeRequired: "flow.upgrade-required",
|
|
33
35
|
flowNotFound: "flow.not-found",
|
|
34
36
|
flowBusy: "flow.busy",
|
|
35
37
|
flowConflict: "flow.conflict",
|
|
@@ -57,7 +59,7 @@ var sn = et("ChevronRight", [["path", {
|
|
|
57
59
|
variableLimitReached: "variable.limit-reached",
|
|
58
60
|
variableNotFound: "variable.not-found"
|
|
59
61
|
};
|
|
60
|
-
I.eventSourceInvalid, I.eventSourceIdentityUnavailable, I.eventSourceNotFound, I.eventSourceConflict, I.authenticationRequired, I.authorizationDenied, I.bindingUnresolved, I.connectorActionNotFound, I.connectorUnconfigured, I.connectorUnavailable, I.connectorConsoleUnconfigured, I.engineUnavailable, I.engineUnsupported, I.flowInvalid, I.flowNotFound, I.flowBusy, I.flowConflict, I.flowPresentationConflict, I.flowRevisionConflict, I.liveConflict, I.liveNotFound, I.pageInvalidCursor, I.publicationConflict, I.publicationNotFound, I.publicationUnsupported, I.publishOperationNotFound, I.routeNotFound, I.runConflict, I.runEventsExpired, I.runInvalid, I.runNotFound, I.runNotTerminal, I.runOverloaded, I.runWaitNotFound, I.triggerKeyInvalid, I.triggerKeyNotFound, I.triggerNotFound, I.variableInvalid, I.variableLimitReached, I.variableNotFound;
|
|
62
|
+
I.eventSourceInvalid, I.eventSourceIdentityUnavailable, I.eventSourceNotFound, I.eventSourceConflict, I.authenticationRequired, I.authorizationDenied, I.bindingUnresolved, I.connectorActionNotFound, I.connectorUnconfigured, I.connectorUnavailable, I.connectorConsoleUnconfigured, I.engineUnavailable, I.engineUnsupported, I.flowInvalid, I.flowRepairRequired, I.flowUpgradeRequired, I.flowNotFound, I.flowBusy, I.flowConflict, I.flowPresentationConflict, I.flowRevisionConflict, I.liveConflict, I.liveNotFound, I.pageInvalidCursor, I.publicationConflict, I.publicationNotFound, I.publicationUnsupported, I.publishOperationNotFound, I.routeNotFound, I.runConflict, I.runEventsExpired, I.runInvalid, I.runNotFound, I.runNotTerminal, I.runOverloaded, I.runWaitNotFound, I.triggerKeyInvalid, I.triggerKeyNotFound, I.triggerNotFound, I.variableInvalid, I.variableLimitReached, I.variableNotFound;
|
|
61
63
|
var cn = class extends Error {
|
|
62
64
|
constructor(e, t, n) {
|
|
63
65
|
super(n), this.code = t, this.name = "ApiError", this.status = e;
|
|
@@ -140,12 +142,19 @@ function vn(e) {
|
|
|
140
142
|
function yn(e) {
|
|
141
143
|
let t = R(e), n = vn(t), r = {
|
|
142
144
|
configSchema: gn(t.configSchema),
|
|
143
|
-
definitionVersion:
|
|
145
|
+
definitionVersion: t.definitionVersion === 2 ? 2 : L(),
|
|
144
146
|
description: n.description,
|
|
145
147
|
displayName: n.displayName,
|
|
146
148
|
key: n.key,
|
|
147
149
|
name: n.name,
|
|
148
|
-
|
|
150
|
+
outputs: (Array.isArray(t.outputs) ? t.outputs : L()).map((e) => {
|
|
151
|
+
let t = R(e);
|
|
152
|
+
return Object.assign({
|
|
153
|
+
handle: z(t.handle),
|
|
154
|
+
jsonSchema: gn(t.jsonSchema),
|
|
155
|
+
nullable: typeof t.nullable == "boolean" ? t.nullable : L()
|
|
156
|
+
}, t.description == null ? {} : { description: z(t.description) });
|
|
157
|
+
}),
|
|
149
158
|
provider: n.provider
|
|
150
159
|
};
|
|
151
160
|
if (n.type == "poll") return {
|
|
@@ -748,7 +757,7 @@ Ot({
|
|
|
748
757
|
}).strict(), Ot({
|
|
749
758
|
kind: Mt("open-flow-project-revision"),
|
|
750
759
|
version: Mt(1),
|
|
751
|
-
modelVersion: Mt(1),
|
|
760
|
+
modelVersion: Wt([Mt(1), Mt(2)]),
|
|
752
761
|
modules: kt(j(), Ot({
|
|
753
762
|
name: j(),
|
|
754
763
|
source: j(),
|
|
@@ -789,12 +798,7 @@ function pr(e) {
|
|
|
789
798
|
}
|
|
790
799
|
function mr(e) {
|
|
791
800
|
let t = R(e);
|
|
792
|
-
return
|
|
793
|
-
"revision",
|
|
794
|
-
"updatedAt",
|
|
795
|
-
"value",
|
|
796
|
-
"version"
|
|
797
|
-
]), t.version != 1 || hn(t.revision) < 1 ? L() : {
|
|
801
|
+
return t.version != 1 || hn(t.revision) < 1 ? L() : {
|
|
798
802
|
revision: hn(t.revision),
|
|
799
803
|
updatedAt: z(t.updatedAt),
|
|
800
804
|
value: Object.fromEntries(Object.entries(R(t.value)).map(([e, t]) => [e, gn(t)])),
|
|
@@ -1351,13 +1355,7 @@ var Nr = class {
|
|
|
1351
1355
|
}
|
|
1352
1356
|
async getEditor(e) {
|
|
1353
1357
|
let t = R(await this.request(`/v1/flows/${V(e)}/editor`));
|
|
1354
|
-
if (
|
|
1355
|
-
"flow",
|
|
1356
|
-
"draft",
|
|
1357
|
-
"live",
|
|
1358
|
-
"presentation",
|
|
1359
|
-
"version"
|
|
1360
|
-
]), t.version != 1) return L();
|
|
1358
|
+
if (t.version != 1) return L();
|
|
1361
1359
|
let n = {
|
|
1362
1360
|
flow: $n(t.flow),
|
|
1363
1361
|
draft: pr(t.draft),
|
|
@@ -1455,10 +1453,20 @@ var Nr = class {
|
|
|
1455
1453
|
method: "POST"
|
|
1456
1454
|
}));
|
|
1457
1455
|
}
|
|
1456
|
+
async repairDraft(e, t, n = Mr("repair")) {
|
|
1457
|
+
return hr(await this.request(`/v1/flows/${V(e)}/draft/repair`, {
|
|
1458
|
+
body: JSON.stringify({
|
|
1459
|
+
expectedRevisionId: t,
|
|
1460
|
+
version: 1
|
|
1461
|
+
}),
|
|
1462
|
+
headers: { "idempotency-key": n },
|
|
1463
|
+
method: "POST"
|
|
1464
|
+
}));
|
|
1465
|
+
}
|
|
1458
1466
|
async checkFlow(e, t) {
|
|
1459
1467
|
return Bn(await this.request(`/v1/flows/${V(e)}/revisions/${V(t)}/check`, {
|
|
1460
1468
|
body: JSON.stringify({
|
|
1461
|
-
engineContract: "open-flow-engine/
|
|
1469
|
+
engineContract: "open-flow-engine/v5",
|
|
1462
1470
|
version: 1
|
|
1463
1471
|
}),
|
|
1464
1472
|
method: "POST"
|
|
@@ -1476,10 +1484,10 @@ var Nr = class {
|
|
|
1476
1484
|
async createDraftRun(e, t, n) {
|
|
1477
1485
|
let r = Cr(await this.request(`/v1/flows/${V(e)}/revisions/${V(t)}/runs`, {
|
|
1478
1486
|
body: JSON.stringify({
|
|
1479
|
-
engineContract: "open-flow-engine/
|
|
1487
|
+
engineContract: "open-flow-engine/v5",
|
|
1480
1488
|
inputs: n.inputs ?? {},
|
|
1481
1489
|
trigger: n.trigger,
|
|
1482
|
-
version:
|
|
1490
|
+
version: 2
|
|
1483
1491
|
}),
|
|
1484
1492
|
headers: { "idempotency-key": n.idempotencyKey ?? Mr("run") },
|
|
1485
1493
|
method: "POST"
|
|
@@ -1492,7 +1500,7 @@ var Nr = class {
|
|
|
1492
1500
|
inputs: t.inputs ?? {},
|
|
1493
1501
|
trigger: t.trigger,
|
|
1494
1502
|
publicationId: e,
|
|
1495
|
-
version:
|
|
1503
|
+
version: 2
|
|
1496
1504
|
}),
|
|
1497
1505
|
headers: { "idempotency-key": t.idempotencyKey ?? Mr("run") },
|
|
1498
1506
|
method: "POST"
|
|
@@ -1512,7 +1520,7 @@ var Nr = class {
|
|
|
1512
1520
|
async publishFlow(e, t, n, r = {}) {
|
|
1513
1521
|
return rr(await this.request(`/v1/flows/${V(e)}/revisions/${V(t)}/publications`, {
|
|
1514
1522
|
body: JSON.stringify({
|
|
1515
|
-
engineContract: "open-flow-engine/
|
|
1523
|
+
engineContract: "open-flow-engine/v5",
|
|
1516
1524
|
expectedLivePublicationId: n,
|
|
1517
1525
|
version: 1
|
|
1518
1526
|
}),
|
|
@@ -1679,6 +1687,8 @@ var Nr = class {
|
|
|
1679
1687
|
[I.engineUnavailable]: "notice.error.engineUnavailable",
|
|
1680
1688
|
[I.engineUnsupported]: "notice.error.engineUnsupported",
|
|
1681
1689
|
[I.flowInvalid]: "notice.error.flowInvalid",
|
|
1690
|
+
[I.flowRepairRequired]: "notice.error.flowInvalid",
|
|
1691
|
+
[I.flowUpgradeRequired]: "notice.error.flowInvalid",
|
|
1682
1692
|
[I.flowNotFound]: "notice.error.flowNotFound",
|
|
1683
1693
|
[I.flowBusy]: "notice.error.flowBusy",
|
|
1684
1694
|
[I.flowConflict]: "notice.error.flowConflict",
|
|
@@ -2003,7 +2013,7 @@ function Br({ value: e, onChange: t, disabled: n = !1, allowedEvents: r }) {
|
|
|
2003
2013
|
children: a(`eventSources.eventGroups.${r}`)
|
|
2004
2014
|
}), g.filter((e) => e.group == r).map((r) => /* @__PURE__ */ N(Lt, {
|
|
2005
2015
|
className: "flex cursor-pointer items-start gap-2 rounded-md px-2 py-2 font-normal hover:bg-muted",
|
|
2006
|
-
children: [/* @__PURE__ */ M(
|
|
2016
|
+
children: [/* @__PURE__ */ M(xt, {
|
|
2007
2017
|
className: "mt-0.5",
|
|
2008
2018
|
checked: e.includes(r.id),
|
|
2009
2019
|
disabled: n || !e.includes(r.id) && e.length >= 200,
|
|
@@ -2077,7 +2087,7 @@ function Br({ value: e, onChange: t, disabled: n = !1, allowedEvents: r }) {
|
|
|
2077
2087
|
//#endregion
|
|
2078
2088
|
//#region src/workbench/browser/runtime/eventSources.tsx
|
|
2079
2089
|
function Vr(e) {
|
|
2080
|
-
let t = nn(() =>
|
|
2090
|
+
let t = nn(() => yt(e.language), [e.language]);
|
|
2081
2091
|
return /* @__PURE__ */ M(a, {
|
|
2082
2092
|
i18n: t,
|
|
2083
2093
|
children: /* @__PURE__ */ M(Hr, { ...e })
|
|
@@ -2556,7 +2566,7 @@ function Ur({ source: e, existingNames: t = [], fixedTeamId: n, onPendingChange:
|
|
|
2556
2566
|
children: l("eventSources.resourceManagement")
|
|
2557
2567
|
}), /* @__PURE__ */ N(Lt, {
|
|
2558
2568
|
className: "mt-3 flex items-start gap-2 font-normal",
|
|
2559
|
-
children: [/* @__PURE__ */ M(
|
|
2569
|
+
children: [/* @__PURE__ */ M(xt, {
|
|
2560
2570
|
checked: le,
|
|
2561
2571
|
onCheckedChange: (e) => ue(e === !0),
|
|
2562
2572
|
disabled: A
|
|
@@ -2949,7 +2959,7 @@ var mi = {
|
|
|
2949
2959
|
};
|
|
2950
2960
|
}, [S.events, s]);
|
|
2951
2961
|
let ne = s.useState("hoverEnabled"), T = s.useState("disabled");
|
|
2952
|
-
|
|
2962
|
+
bt(ee, {
|
|
2953
2963
|
enabled: ne && !T && !w && y.type !== "menubar",
|
|
2954
2964
|
closeDelay: C
|
|
2955
2965
|
});
|
|
@@ -3724,9 +3734,9 @@ var Bi = 2, Vi = d(function(e, t) {
|
|
|
3724
3734
|
fe,
|
|
3725
3735
|
_
|
|
3726
3736
|
]);
|
|
3727
|
-
let pe = O && w.context.hasSubmenuOpen, me =
|
|
3737
|
+
let pe = O && w.context.hasSubmenuOpen, me = gt(S, {
|
|
3728
3738
|
enabled: (l ?? pe) && !le && w.type !== "context-menu" && (!O || pe && !se),
|
|
3729
|
-
handleClose:
|
|
3739
|
+
handleClose: vt({ blockPointerEvents: !O }),
|
|
3730
3740
|
mouseOnly: !0,
|
|
3731
3741
|
move: !1,
|
|
3732
3742
|
restMs: w.type === void 0 ? u : void 0,
|
|
@@ -3741,7 +3751,7 @@ var Bi = 2, Vi = d(function(e, t) {
|
|
|
3741
3751
|
toggle: !0,
|
|
3742
3752
|
ignoreMouse: !1,
|
|
3743
3753
|
stickIfOpen: w.type === void 0 && he
|
|
3744
|
-
}), ye =
|
|
3754
|
+
}), ye = St(S, { enabled: !le && pe }), be = zi({
|
|
3745
3755
|
open: C,
|
|
3746
3756
|
enabled: O,
|
|
3747
3757
|
mouseDownAction: "open"
|
|
@@ -3771,7 +3781,7 @@ var Bi = 2, Vi = d(function(e, t) {
|
|
|
3771
3781
|
be,
|
|
3772
3782
|
h,
|
|
3773
3783
|
k
|
|
3774
|
-
], { preFocusGuardRef: ke, handlePreFocusGuardFocus: je, handleFocusTargetFocus: Me } =
|
|
3784
|
+
], { preFocusGuardRef: ke, handlePreFocusGuardFocus: je, handleFocusTargetFocus: Me } = _t(_, te), Ne = v("button", e, {
|
|
3775
3785
|
enabled: !O,
|
|
3776
3786
|
stateAttributesMapping: y,
|
|
3777
3787
|
state: Ce,
|
|
@@ -3874,9 +3884,9 @@ var Gi = /*#__PURE__*/ P.forwardRef(function(e, t) {
|
|
|
3874
3884
|
nativeButton: o,
|
|
3875
3885
|
itemMetadata: ie,
|
|
3876
3886
|
nodeId: m?.context.nodeId
|
|
3877
|
-
}), ce = h.useState("hoverEnabled"), le = ne.useState("allowMouseEnter"), k =
|
|
3887
|
+
}), ce = h.useState("hoverEnabled"), le = ne.useState("allowMouseEnter"), k = gt(y, {
|
|
3878
3888
|
enabled: ce && s && !D,
|
|
3879
|
-
handleClose:
|
|
3889
|
+
handleClose: vt({ blockPointerEvents: !0 }),
|
|
3880
3890
|
mouseOnly: !0,
|
|
3881
3891
|
move: !0,
|
|
3882
3892
|
restMs: c,
|
|
@@ -4515,6 +4525,13 @@ function Ma(e, t, n, r) {
|
|
|
4515
4525
|
nodeId: n,
|
|
4516
4526
|
target: t,
|
|
4517
4527
|
value: r.name
|
|
4528
|
+
}), i.maxExecutions != r.maxExecutions && a.push({
|
|
4529
|
+
before: i.maxExecutions,
|
|
4530
|
+
field: "maxExecutions",
|
|
4531
|
+
kind: "graph.node.field.set",
|
|
4532
|
+
nodeId: n,
|
|
4533
|
+
target: t,
|
|
4534
|
+
value: r.maxExecutions
|
|
4518
4535
|
}), i.timeoutMs != r.timeoutMs && a.push({
|
|
4519
4536
|
before: i.timeoutMs,
|
|
4520
4537
|
field: "timeoutMs",
|
|
@@ -4852,7 +4869,70 @@ var oo = class {
|
|
|
4852
4869
|
invalidate() {
|
|
4853
4870
|
this.#e = Symbol();
|
|
4854
4871
|
}
|
|
4855
|
-
}
|
|
4872
|
+
};
|
|
4873
|
+
//#endregion
|
|
4874
|
+
//#region src/base/common/json.ts
|
|
4875
|
+
function so(e) {
|
|
4876
|
+
if (e === null || typeof e == "boolean" || typeof e == "string") return !0;
|
|
4877
|
+
if (typeof e == "number") return Number.isFinite(e);
|
|
4878
|
+
if (typeof e != "object") return !1;
|
|
4879
|
+
let t = /* @__PURE__ */ new Set(), n = [], r = e;
|
|
4880
|
+
traversal: for (;;) {
|
|
4881
|
+
let e, i;
|
|
4882
|
+
if (Array.isArray(r)) {
|
|
4883
|
+
if (i = r.length, e = Reflect.ownKeys(r), e.length != i + 1) return !1;
|
|
4884
|
+
} else {
|
|
4885
|
+
let t = Reflect.getPrototypeOf(r);
|
|
4886
|
+
if (t != Object.prototype && t != null) return !1;
|
|
4887
|
+
e = Reflect.ownKeys(r), i = void 0;
|
|
4888
|
+
}
|
|
4889
|
+
t.add(r);
|
|
4890
|
+
let a = 0;
|
|
4891
|
+
for (;;) {
|
|
4892
|
+
if (a >= e.length) {
|
|
4893
|
+
t.delete(r);
|
|
4894
|
+
let o = n.pop();
|
|
4895
|
+
if (o === void 0) return !0;
|
|
4896
|
+
r = o.value, e = o.keys, i = o.arrayLength, a = o.index;
|
|
4897
|
+
continue;
|
|
4898
|
+
}
|
|
4899
|
+
let o = e[a++];
|
|
4900
|
+
if (i !== void 0) {
|
|
4901
|
+
if (o == "length") continue;
|
|
4902
|
+
if (typeof o != "string") return !1;
|
|
4903
|
+
let e = Number(o);
|
|
4904
|
+
if (!Number.isSafeInteger(e) || e < 0 || e >= i || String(e) != o) return !1;
|
|
4905
|
+
} else if (typeof o != "string") return !1;
|
|
4906
|
+
let s = Reflect.getOwnPropertyDescriptor(r, o);
|
|
4907
|
+
if (s?.enumerable != 1 || !Object.hasOwn(s, "value")) return !1;
|
|
4908
|
+
let c = s.value;
|
|
4909
|
+
if (c !== null && typeof c != "boolean" && typeof c != "string") {
|
|
4910
|
+
if (typeof c == "number") {
|
|
4911
|
+
if (!Number.isFinite(c)) return !1;
|
|
4912
|
+
continue;
|
|
4913
|
+
}
|
|
4914
|
+
if (typeof c != "object" || t.has(c)) return !1;
|
|
4915
|
+
n.push({
|
|
4916
|
+
value: r,
|
|
4917
|
+
keys: e,
|
|
4918
|
+
arrayLength: i,
|
|
4919
|
+
index: a
|
|
4920
|
+
}), r = c;
|
|
4921
|
+
continue traversal;
|
|
4922
|
+
}
|
|
4923
|
+
}
|
|
4924
|
+
}
|
|
4925
|
+
}
|
|
4926
|
+
function co(e) {
|
|
4927
|
+
try {
|
|
4928
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && so(e);
|
|
4929
|
+
} catch {
|
|
4930
|
+
return !1;
|
|
4931
|
+
}
|
|
4932
|
+
}
|
|
4933
|
+
//#endregion
|
|
4934
|
+
//#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/format.js
|
|
4935
|
+
var lo = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, uo = [
|
|
4856
4936
|
0,
|
|
4857
4937
|
31,
|
|
4858
4938
|
28,
|
|
@@ -4866,60 +4946,60 @@ var oo = class {
|
|
|
4866
4946
|
31,
|
|
4867
4947
|
30,
|
|
4868
4948
|
31
|
|
4869
|
-
],
|
|
4949
|
+
], fo = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i, po = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, mo = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, ho = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, go = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, _o = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, vo = /^(?:\/(?:[^~/]|~0|~1)*)*$/, yo = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, bo = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, xo = (e) => {
|
|
4870
4950
|
if (e[0] === "\"") return !1;
|
|
4871
4951
|
let [t, n, ...r] = e.split("@");
|
|
4872
4952
|
return !t || !n || r.length !== 0 || t.length > 64 || n.length > 253 || t[0] === "." || t.endsWith(".") || t.includes("..") || !/^[a-z0-9.-]+$/i.test(n) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t) ? !1 : n.split(".").every((e) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e));
|
|
4873
|
-
},
|
|
4874
|
-
function
|
|
4953
|
+
}, So = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, Co = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, wo = (e) => e.length > 1 && e.length < 80 && (/^P\d+([.,]\d+)?W$/.test(e) || /^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));
|
|
4954
|
+
function To(e) {
|
|
4875
4955
|
return e.test.bind(e);
|
|
4876
4956
|
}
|
|
4877
|
-
var
|
|
4878
|
-
date:
|
|
4879
|
-
time:
|
|
4880
|
-
"date-time":
|
|
4881
|
-
duration:
|
|
4882
|
-
uri:
|
|
4883
|
-
"uri-reference":
|
|
4884
|
-
"uri-template":
|
|
4885
|
-
url:
|
|
4886
|
-
email:
|
|
4887
|
-
hostname:
|
|
4888
|
-
ipv4:
|
|
4889
|
-
ipv6: Co
|
|
4890
|
-
regex:
|
|
4891
|
-
uuid:
|
|
4892
|
-
"json-pointer":
|
|
4893
|
-
"json-pointer-uri-fragment":
|
|
4894
|
-
"relative-json-pointer":
|
|
4957
|
+
var Eo = {
|
|
4958
|
+
date: Oo,
|
|
4959
|
+
time: ko.bind(void 0, !1),
|
|
4960
|
+
"date-time": jo,
|
|
4961
|
+
duration: wo,
|
|
4962
|
+
uri: Po,
|
|
4963
|
+
"uri-reference": To(mo),
|
|
4964
|
+
"uri-template": To(ho),
|
|
4965
|
+
url: To(go),
|
|
4966
|
+
email: xo,
|
|
4967
|
+
hostname: To(po),
|
|
4968
|
+
ipv4: To(So),
|
|
4969
|
+
ipv6: To(Co),
|
|
4970
|
+
regex: Io,
|
|
4971
|
+
uuid: To(_o),
|
|
4972
|
+
"json-pointer": To(vo),
|
|
4973
|
+
"json-pointer-uri-fragment": To(yo),
|
|
4974
|
+
"relative-json-pointer": To(bo)
|
|
4895
4975
|
};
|
|
4896
|
-
function
|
|
4976
|
+
function Do(e) {
|
|
4897
4977
|
return e % 4 == 0 && (e % 100 != 0 || e % 400 == 0);
|
|
4898
4978
|
}
|
|
4899
|
-
function
|
|
4900
|
-
let t = e.match(
|
|
4979
|
+
function Oo(e) {
|
|
4980
|
+
let t = e.match(lo);
|
|
4901
4981
|
if (!t) return !1;
|
|
4902
4982
|
let n = +t[1], r = +t[2], i = +t[3];
|
|
4903
|
-
return r >= 1 && r <= 12 && i >= 1 && i <= (r == 2 &&
|
|
4983
|
+
return r >= 1 && r <= 12 && i >= 1 && i <= (r == 2 && Do(n) ? 29 : uo[r]);
|
|
4904
4984
|
}
|
|
4905
|
-
function
|
|
4906
|
-
let n = t.match(
|
|
4985
|
+
function ko(e, t) {
|
|
4986
|
+
let n = t.match(fo);
|
|
4907
4987
|
if (!n) return !1;
|
|
4908
4988
|
let r = +n[1], i = +n[2], a = +n[3], o = !!n[5];
|
|
4909
4989
|
return (r <= 23 && i <= 59 && a <= 59 || r == 23 && i == 59 && a == 60) && (!e || o);
|
|
4910
4990
|
}
|
|
4911
|
-
var
|
|
4912
|
-
function
|
|
4913
|
-
let t = e.split(
|
|
4914
|
-
return t.length == 2 &&
|
|
4915
|
-
}
|
|
4916
|
-
var Ao = /\/|:/, jo = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
4917
|
-
function Mo(e) {
|
|
4918
|
-
return Ao.test(e) && jo.test(e);
|
|
4991
|
+
var Ao = /t|\s/i;
|
|
4992
|
+
function jo(e) {
|
|
4993
|
+
let t = e.split(Ao);
|
|
4994
|
+
return t.length == 2 && Oo(t[0]) && ko(!0, t[1]);
|
|
4919
4995
|
}
|
|
4920
|
-
var No =
|
|
4996
|
+
var Mo = /\/|:/, No = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
4921
4997
|
function Po(e) {
|
|
4922
|
-
|
|
4998
|
+
return Mo.test(e) && No.test(e);
|
|
4999
|
+
}
|
|
5000
|
+
var Fo = /[^\\]\\Z/;
|
|
5001
|
+
function Io(e) {
|
|
5002
|
+
if (Fo.test(e)) return !1;
|
|
4923
5003
|
try {
|
|
4924
5004
|
return new RegExp(e, "u"), !0;
|
|
4925
5005
|
} catch {
|
|
@@ -4928,45 +5008,45 @@ function Po(e) {
|
|
|
4928
5008
|
}
|
|
4929
5009
|
//#endregion
|
|
4930
5010
|
//#region src/json-schema-subset/utils.ts
|
|
4931
|
-
var
|
|
4932
|
-
function
|
|
4933
|
-
let e =
|
|
4934
|
-
return
|
|
5011
|
+
var Lo = 0;
|
|
5012
|
+
function Ro() {
|
|
5013
|
+
let e = Lo;
|
|
5014
|
+
return Lo += 1, e;
|
|
4935
5015
|
}
|
|
4936
|
-
function
|
|
5016
|
+
function zo(e) {
|
|
4937
5017
|
if (typeof e == "object" && e && !Object.isFrozen(e)) {
|
|
4938
|
-
for (let t of Object.getOwnPropertyNames(e))
|
|
5018
|
+
for (let t of Object.getOwnPropertyNames(e)) zo(Reflect.get(e, t));
|
|
4939
5019
|
Object.freeze(e);
|
|
4940
5020
|
}
|
|
4941
5021
|
return e;
|
|
4942
5022
|
}
|
|
4943
|
-
function
|
|
5023
|
+
function Bo(e, t) {
|
|
4944
5024
|
let n = {};
|
|
4945
5025
|
for (let r of t) r in e && (n[r] = e[r]);
|
|
4946
5026
|
return n;
|
|
4947
5027
|
}
|
|
4948
|
-
function
|
|
5028
|
+
function Vo(e) {
|
|
4949
5029
|
if (typeof e != "object" || !e) return e;
|
|
4950
5030
|
if (Array.isArray(e)) {
|
|
4951
5031
|
let t = [];
|
|
4952
|
-
for (let [n, r] of e.entries()) t[n] =
|
|
5032
|
+
for (let [n, r] of e.entries()) t[n] = Vo(r);
|
|
4953
5033
|
return t;
|
|
4954
5034
|
}
|
|
4955
5035
|
{
|
|
4956
5036
|
let t = {};
|
|
4957
|
-
for (let n in e) t[n] =
|
|
5037
|
+
for (let n in e) t[n] = Vo(e[n]);
|
|
4958
5038
|
return t;
|
|
4959
5039
|
}
|
|
4960
5040
|
}
|
|
4961
|
-
function
|
|
5041
|
+
function Ho(e, t) {
|
|
4962
5042
|
if (e === t) return !0;
|
|
4963
5043
|
if (typeof e != "object" || !e || typeof e != typeof t) return !1;
|
|
4964
5044
|
if (Array.isArray(e)) {
|
|
4965
5045
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
4966
|
-
for (let [n, r] of e.entries()) if (!
|
|
5046
|
+
for (let [n, r] of e.entries()) if (!Ho(r, t[n])) return !1;
|
|
4967
5047
|
} else {
|
|
4968
5048
|
if (Array.isArray(t)) return !1;
|
|
4969
|
-
for (let n in e) if (!(n in t) || !
|
|
5049
|
+
for (let n in e) if (!(n in t) || !Ho(e[n], t[n])) return !1;
|
|
4970
5050
|
for (let n in t) if (!(n in e)) return !1;
|
|
4971
5051
|
}
|
|
4972
5052
|
return !0;
|
|
@@ -4979,48 +5059,48 @@ var H = Object.freeze({
|
|
|
4979
5059
|
ContainedBy: 2,
|
|
4980
5060
|
Rejection: 3,
|
|
4981
5061
|
Intersection: 4
|
|
4982
|
-
}), U =
|
|
5062
|
+
}), U = Xo(H.Equals), W = Xo(H.Containing), G = Xo(H.ContainedBy), K = Xo(H.Rejection), q = Xo(H.Intersection), Uo = zo([
|
|
4983
5063
|
[H.Equals, U],
|
|
4984
5064
|
[H.Containing, W],
|
|
4985
5065
|
[H.ContainedBy, G],
|
|
4986
5066
|
[H.Rejection, K],
|
|
4987
5067
|
[H.Intersection, q]
|
|
4988
|
-
]),
|
|
5068
|
+
]), Wo = (() => {
|
|
4989
5069
|
let e = 0;
|
|
4990
|
-
for (let [t, n] of
|
|
5070
|
+
for (let [t, n] of Uo) e |= n;
|
|
4991
5071
|
return e;
|
|
4992
5072
|
})();
|
|
4993
|
-
function
|
|
5073
|
+
function Go(e) {
|
|
4994
5074
|
return !!(e & U);
|
|
4995
5075
|
}
|
|
4996
|
-
function
|
|
5076
|
+
function Ko(e) {
|
|
4997
5077
|
return !!(e & W);
|
|
4998
5078
|
}
|
|
4999
|
-
function
|
|
5079
|
+
function qo(e) {
|
|
5000
5080
|
return !!(e & G);
|
|
5001
5081
|
}
|
|
5002
|
-
function
|
|
5082
|
+
function Jo(e) {
|
|
5003
5083
|
return !!(e & K);
|
|
5004
5084
|
}
|
|
5005
|
-
function
|
|
5085
|
+
function Yo(e) {
|
|
5006
5086
|
return !!(e & q);
|
|
5007
5087
|
}
|
|
5008
|
-
function
|
|
5088
|
+
function Xo(e) {
|
|
5009
5089
|
return 1 << e;
|
|
5010
5090
|
}
|
|
5011
5091
|
//#endregion
|
|
5012
5092
|
//#region src/json-schema-subset/expression/combination.ts
|
|
5013
|
-
function
|
|
5014
|
-
let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r :
|
|
5093
|
+
function Zo(e) {
|
|
5094
|
+
let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r : Qo(t, r, e), n += 1, t) };
|
|
5015
5095
|
return Object.defineProperties(r, {
|
|
5016
5096
|
result: { get: () => t },
|
|
5017
5097
|
count: { get: () => n }
|
|
5018
5098
|
}), r;
|
|
5019
5099
|
}
|
|
5020
|
-
function
|
|
5100
|
+
function Qo(e, t, n) {
|
|
5021
5101
|
let r = 0;
|
|
5022
|
-
for (let [i, a] of
|
|
5023
|
-
for (let [e, a] of
|
|
5102
|
+
for (let [i, a] of Uo) if (a & e) {
|
|
5103
|
+
for (let [e, a] of Uo) if (a & t && (r |= n(i, e), r === Wo)) return r;
|
|
5024
5104
|
}
|
|
5025
5105
|
return r;
|
|
5026
5106
|
}
|
|
@@ -5034,59 +5114,59 @@ var J = Object.freeze({
|
|
|
5034
5114
|
Not: 4,
|
|
5035
5115
|
Swap: 5
|
|
5036
5116
|
});
|
|
5037
|
-
function
|
|
5117
|
+
function $o(e, t) {
|
|
5038
5118
|
switch (e) {
|
|
5039
5119
|
case J.Save: return t[0];
|
|
5040
|
-
case J.OneOf: return
|
|
5120
|
+
case J.OneOf: return ts(t);
|
|
5041
5121
|
case J.AllOf:
|
|
5042
|
-
case J.AnyOf: return
|
|
5122
|
+
case J.AnyOf: return ns(e, t);
|
|
5043
5123
|
case J.Not:
|
|
5044
|
-
case J.Swap: return
|
|
5124
|
+
case J.Swap: return rs(e, t[0]);
|
|
5045
5125
|
}
|
|
5046
5126
|
}
|
|
5047
|
-
function
|
|
5048
|
-
return
|
|
5127
|
+
function es(e) {
|
|
5128
|
+
return rs(J.Swap, e);
|
|
5049
5129
|
}
|
|
5050
|
-
function
|
|
5130
|
+
function ts(e) {
|
|
5051
5131
|
if (e.length === 1) return e[0];
|
|
5052
|
-
let t =
|
|
5132
|
+
let t = ns(J.AnyOf, e), n = [];
|
|
5053
5133
|
for (let t = 0; t < e.length; ++t) for (let r = t + 1; r < e.length; ++r) {
|
|
5054
|
-
let i = e[t], a = e[r], o =
|
|
5134
|
+
let i = e[t], a = e[r], o = ns(J.AllOf, [i, a]);
|
|
5055
5135
|
n.push(o);
|
|
5056
5136
|
}
|
|
5057
|
-
let r =
|
|
5058
|
-
return
|
|
5137
|
+
let r = ns(J.AnyOf, n), i = rs(J.Not, r);
|
|
5138
|
+
return ns(J.AllOf, [t, i]);
|
|
5059
5139
|
}
|
|
5060
|
-
function
|
|
5140
|
+
function ns(e, t) {
|
|
5061
5141
|
if (t.length < 0) throw Error("invalid expressions: empty array");
|
|
5062
5142
|
let n;
|
|
5063
5143
|
switch (e) {
|
|
5064
5144
|
case J.AllOf:
|
|
5065
|
-
n =
|
|
5145
|
+
n = Zo(is);
|
|
5066
5146
|
break;
|
|
5067
5147
|
case J.AnyOf:
|
|
5068
|
-
n =
|
|
5148
|
+
n = Zo(as);
|
|
5069
5149
|
break;
|
|
5070
5150
|
default: throw Error(`invalid operator ${e}`);
|
|
5071
5151
|
}
|
|
5072
5152
|
for (let e of t) n.push(e);
|
|
5073
5153
|
return n.result;
|
|
5074
5154
|
}
|
|
5075
|
-
function
|
|
5155
|
+
function rs(e, t) {
|
|
5076
5156
|
let n, r = 0;
|
|
5077
5157
|
switch (e) {
|
|
5078
5158
|
case J.Not:
|
|
5079
|
-
n =
|
|
5159
|
+
n = os;
|
|
5080
5160
|
break;
|
|
5081
5161
|
case J.Swap:
|
|
5082
|
-
n =
|
|
5162
|
+
n = ss;
|
|
5083
5163
|
break;
|
|
5084
5164
|
default: throw Error(`invalid operator ${e}`);
|
|
5085
5165
|
}
|
|
5086
|
-
for (let [e, i] of
|
|
5166
|
+
for (let [e, i] of Uo) i & t && (r |= n(e));
|
|
5087
5167
|
return r;
|
|
5088
5168
|
}
|
|
5089
|
-
function
|
|
5169
|
+
function is(e, t) {
|
|
5090
5170
|
let n = 0;
|
|
5091
5171
|
switch (e) {
|
|
5092
5172
|
case H.Equals:
|
|
@@ -5175,7 +5255,7 @@ function ns(e, t) {
|
|
|
5175
5255
|
}
|
|
5176
5256
|
return n;
|
|
5177
5257
|
}
|
|
5178
|
-
function
|
|
5258
|
+
function as(e, t) {
|
|
5179
5259
|
let n = 0;
|
|
5180
5260
|
switch (e) {
|
|
5181
5261
|
case H.Equals:
|
|
@@ -5264,7 +5344,7 @@ function rs(e, t) {
|
|
|
5264
5344
|
}
|
|
5265
5345
|
return n;
|
|
5266
5346
|
}
|
|
5267
|
-
function
|
|
5347
|
+
function os(e) {
|
|
5268
5348
|
let t = 0;
|
|
5269
5349
|
switch (e) {
|
|
5270
5350
|
case H.Equals:
|
|
@@ -5283,7 +5363,7 @@ function is(e) {
|
|
|
5283
5363
|
}
|
|
5284
5364
|
return t;
|
|
5285
5365
|
}
|
|
5286
|
-
function
|
|
5366
|
+
function ss(e) {
|
|
5287
5367
|
let t = 0;
|
|
5288
5368
|
switch (e) {
|
|
5289
5369
|
case H.Equals:
|
|
@@ -5304,13 +5384,13 @@ function as(e) {
|
|
|
5304
5384
|
}
|
|
5305
5385
|
//#endregion
|
|
5306
5386
|
//#region src/json-schema-subset/expression/types.ts
|
|
5307
|
-
var
|
|
5387
|
+
var cs = Object.freeze({
|
|
5308
5388
|
Leaf: 0,
|
|
5309
5389
|
Not: 1,
|
|
5310
5390
|
AllOf: 2,
|
|
5311
5391
|
AnyOf: 3,
|
|
5312
5392
|
OneOf: 4
|
|
5313
|
-
}),
|
|
5393
|
+
}), ls = (e) => (t, n) => {
|
|
5314
5394
|
let r = {
|
|
5315
5395
|
parent: null,
|
|
5316
5396
|
swapped: !1,
|
|
@@ -5338,7 +5418,7 @@ var os = Object.freeze({
|
|
|
5338
5418
|
let n = U, [r, o] = t.expressions;
|
|
5339
5419
|
if (!e.equals(r, o)) {
|
|
5340
5420
|
let a = e.describe(r);
|
|
5341
|
-
if (a.kind !==
|
|
5421
|
+
if (a.kind !== cs.Leaf) {
|
|
5342
5422
|
let [e, n] = s(a, !1);
|
|
5343
5423
|
t.expressions = null, t.calculation = e;
|
|
5344
5424
|
for (let [e, r] of n.entries()) i.push({
|
|
@@ -5353,7 +5433,7 @@ var os = Object.freeze({
|
|
|
5353
5433
|
return;
|
|
5354
5434
|
}
|
|
5355
5435
|
let c = e.describe(o);
|
|
5356
|
-
if (c.kind !==
|
|
5436
|
+
if (c.kind !== cs.Leaf) {
|
|
5357
5437
|
let [e, n] = s(c, !0);
|
|
5358
5438
|
t.expressions = null, t.calculation = e;
|
|
5359
5439
|
for (let [e, a] of n.entries()) i.push({
|
|
@@ -5379,16 +5459,16 @@ var os = Object.freeze({
|
|
|
5379
5459
|
function s(e, t) {
|
|
5380
5460
|
let n = J.Save, r;
|
|
5381
5461
|
switch (e.kind) {
|
|
5382
|
-
case
|
|
5462
|
+
case cs.Not:
|
|
5383
5463
|
n = J.Not, r = [e.expression];
|
|
5384
5464
|
break;
|
|
5385
|
-
case
|
|
5465
|
+
case cs.AllOf:
|
|
5386
5466
|
n = J.AllOf, r = [...e.expressions];
|
|
5387
5467
|
break;
|
|
5388
|
-
case
|
|
5468
|
+
case cs.AnyOf:
|
|
5389
5469
|
n = J.AnyOf, r = [...e.expressions];
|
|
5390
5470
|
break;
|
|
5391
|
-
case
|
|
5471
|
+
case cs.OneOf:
|
|
5392
5472
|
n = J.OneOf, r = [...e.expressions];
|
|
5393
5473
|
break;
|
|
5394
5474
|
default: throw Error(`invalid kind ${e.kind}`);
|
|
@@ -5401,8 +5481,8 @@ var os = Object.freeze({
|
|
|
5401
5481
|
}, r];
|
|
5402
5482
|
}
|
|
5403
5483
|
function c(e) {
|
|
5404
|
-
let t = e.calculation, n = e.parent, r =
|
|
5405
|
-
if (r === 0 && (r = G), t.willSwap && (r =
|
|
5484
|
+
let t = e.calculation, n = e.parent, r = $o(t.operator, t.results);
|
|
5485
|
+
if (r === 0 && (r = G), t.willSwap && (r = es(r)), n) {
|
|
5406
5486
|
let e = n.node.calculation, t = e.results;
|
|
5407
5487
|
t[n.index] = r, e.count += 1, e.count >= t.length && a.push(n.node);
|
|
5408
5488
|
}
|
|
@@ -5410,79 +5490,79 @@ var os = Object.freeze({
|
|
|
5410
5490
|
let l = r.calculation.results[0];
|
|
5411
5491
|
if (l === 0) throw Error("cannot find result of root");
|
|
5412
5492
|
return l;
|
|
5413
|
-
},
|
|
5493
|
+
}, us = class extends Error {
|
|
5414
5494
|
constructor(e = []) {
|
|
5415
|
-
super(
|
|
5495
|
+
super(ps(e)), this.name = "SchemaError", this.items = e;
|
|
5416
5496
|
}
|
|
5417
|
-
},
|
|
5497
|
+
}, ds = Object.freeze({
|
|
5418
5498
|
Compiled: 0,
|
|
5419
5499
|
External: 1
|
|
5420
5500
|
});
|
|
5421
|
-
function
|
|
5501
|
+
function fs(e) {
|
|
5422
5502
|
switch (e.kind) {
|
|
5423
|
-
case
|
|
5503
|
+
case ds.Compiled: {
|
|
5424
5504
|
let { message: t, path: n } = e;
|
|
5425
5505
|
return `${t} (at ${n.length > 0 ? n.join(".") : "$root"})`;
|
|
5426
5506
|
}
|
|
5427
|
-
case
|
|
5507
|
+
case ds.External: return String(e.error);
|
|
5428
5508
|
}
|
|
5429
5509
|
}
|
|
5430
|
-
function
|
|
5510
|
+
function ps(e) {
|
|
5431
5511
|
switch (e.length) {
|
|
5432
5512
|
case 0: return "without any items";
|
|
5433
|
-
case 1: return
|
|
5434
|
-
default: return `${
|
|
5513
|
+
case 1: return fs(e[0]);
|
|
5514
|
+
default: return `${fs(e[0])} ... omit the rest ${e.length - 1} items`;
|
|
5435
5515
|
}
|
|
5436
5516
|
}
|
|
5437
5517
|
//#endregion
|
|
5438
5518
|
//#region src/json-schema-subset/compiler/common.ts
|
|
5439
|
-
var
|
|
5440
|
-
function
|
|
5441
|
-
return
|
|
5519
|
+
var ms = /* @__PURE__ */ new Set(/* @__PURE__ */ "type.enum.const.multipleOf.maximum.exclusiveMaximum.minimum.exclusiveMinimum.maxLength.minLength.pattern.items.additionalItems.maxItems.minItems.uniqueItems.contains.maxProperties.minProperties.required.properties.patternProperties.additionalProperties.dependencies.propertyNames.if.then.else.allOf.anyOf.oneOf.not.format.contentMediaType.contentEncoding.definitions".split("."));
|
|
5520
|
+
function hs(e) {
|
|
5521
|
+
return ms.has(e);
|
|
5442
5522
|
}
|
|
5443
|
-
function
|
|
5444
|
-
for (let t in e) if (
|
|
5523
|
+
function gs(e) {
|
|
5524
|
+
for (let t in e) if (hs(t)) return !1;
|
|
5445
5525
|
return !0;
|
|
5446
5526
|
}
|
|
5447
|
-
function
|
|
5527
|
+
function _s(e, ...t) {
|
|
5448
5528
|
return {
|
|
5449
5529
|
...e,
|
|
5450
5530
|
path: [...e.path, ...t]
|
|
5451
5531
|
};
|
|
5452
5532
|
}
|
|
5453
|
-
function
|
|
5533
|
+
function vs(e) {
|
|
5454
5534
|
if (typeof e == "boolean") throw Error("JSONSchema7Definition cannot be boolean");
|
|
5455
5535
|
return e;
|
|
5456
5536
|
}
|
|
5457
|
-
function
|
|
5458
|
-
t.push(
|
|
5537
|
+
function ys({ path: e, errors: t }, n, ...r) {
|
|
5538
|
+
t.push(bs(e, r, n));
|
|
5459
5539
|
}
|
|
5460
5540
|
function Y({ path: e, warns: t }, n, ...r) {
|
|
5461
|
-
t.push(
|
|
5541
|
+
t.push(bs(e, r, n));
|
|
5462
5542
|
}
|
|
5463
|
-
function
|
|
5543
|
+
function bs(e, t, n) {
|
|
5464
5544
|
return {
|
|
5465
|
-
kind:
|
|
5545
|
+
kind: ds.Compiled,
|
|
5466
5546
|
message: n,
|
|
5467
5547
|
path: [...e, ...t]
|
|
5468
5548
|
};
|
|
5469
5549
|
}
|
|
5470
5550
|
//#endregion
|
|
5471
5551
|
//#region src/json-schema-subset/compiler/utils.ts
|
|
5472
|
-
function
|
|
5552
|
+
function xs(e) {
|
|
5473
5553
|
for (let t in e) {
|
|
5474
5554
|
let n = e[t];
|
|
5475
|
-
n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] :
|
|
5555
|
+
n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] : Ss(n) && delete e[t]);
|
|
5476
5556
|
}
|
|
5477
5557
|
return e;
|
|
5478
5558
|
}
|
|
5479
|
-
function
|
|
5559
|
+
function Ss(e) {
|
|
5480
5560
|
for (let t in e) return !1;
|
|
5481
5561
|
return !0;
|
|
5482
5562
|
}
|
|
5483
5563
|
//#endregion
|
|
5484
5564
|
//#region src/json-schema-subset/compiler/wrapper.ts
|
|
5485
|
-
var
|
|
5565
|
+
var Cs = Symbol("compiledId"), ws = Symbol("compiledKind"), Ts = Symbol("compiledPath"), Es = Symbol("validatorLoader"), X = Object.freeze({
|
|
5486
5566
|
Extends: 0,
|
|
5487
5567
|
Never: 1,
|
|
5488
5568
|
Any: 2,
|
|
@@ -5495,62 +5575,62 @@ var xs = Symbol("compiledId"), Ss = Symbol("compiledKind"), Cs = Symbol("compile
|
|
|
5495
5575
|
Not: 9,
|
|
5496
5576
|
Combination: 10,
|
|
5497
5577
|
EnumOrConst: 11
|
|
5498
|
-
}),
|
|
5578
|
+
}), Ds = zo(Is(X.Any, Ro(), {}, () => () => !0)), Os = zo(Is(X.Never, Ro(), {
|
|
5499
5579
|
type: "string",
|
|
5500
5580
|
maxLength: 0,
|
|
5501
5581
|
minLength: 1
|
|
5502
5582
|
}, () => () => !1));
|
|
5503
|
-
function
|
|
5504
|
-
return typeof e != "object" || !e ? !1 :
|
|
5583
|
+
function ks(e) {
|
|
5584
|
+
return typeof e != "object" || !e ? !1 : Cs in e;
|
|
5505
5585
|
}
|
|
5506
|
-
function
|
|
5507
|
-
return typeof e != "object" || !e ? !1 :
|
|
5586
|
+
function As(e) {
|
|
5587
|
+
return typeof e != "object" || !e ? !1 : Cs in e && ws in e;
|
|
5508
5588
|
}
|
|
5509
5589
|
function Z(e) {
|
|
5510
|
-
return
|
|
5590
|
+
return As(e) ? e[ws] : X.Extends;
|
|
5511
5591
|
}
|
|
5512
|
-
function
|
|
5513
|
-
return
|
|
5592
|
+
function js(e) {
|
|
5593
|
+
return As(e) || ks(e) ? e[Cs] : e.id;
|
|
5514
5594
|
}
|
|
5515
|
-
function
|
|
5516
|
-
return
|
|
5595
|
+
function Ms(e) {
|
|
5596
|
+
return As(e) ? e[Ts] : void 0;
|
|
5517
5597
|
}
|
|
5518
|
-
function
|
|
5519
|
-
return typeof e != "object" || !e || Object.defineProperty(e,
|
|
5520
|
-
value:
|
|
5598
|
+
function Ns(e) {
|
|
5599
|
+
return typeof e != "object" || !e || Object.defineProperty(e, Cs, {
|
|
5600
|
+
value: Ro(),
|
|
5521
5601
|
configurable: !1,
|
|
5522
5602
|
writable: !1,
|
|
5523
5603
|
enumerable: !1
|
|
5524
5604
|
}), e;
|
|
5525
5605
|
}
|
|
5526
|
-
function
|
|
5527
|
-
return
|
|
5606
|
+
function Ps(e, t, n, r = []) {
|
|
5607
|
+
return Is(e, Ro(), t, n && (() => n.compile(t)), r);
|
|
5528
5608
|
}
|
|
5529
|
-
function
|
|
5530
|
-
return
|
|
5609
|
+
function Fs(e) {
|
|
5610
|
+
return Is(X.Never, Ro(), { ...e }, e[Es], e[Ts]);
|
|
5531
5611
|
}
|
|
5532
|
-
function
|
|
5612
|
+
function Is(e, t, n, r, i = []) {
|
|
5533
5613
|
let a = null;
|
|
5534
5614
|
return Object.defineProperties(n, {
|
|
5535
|
-
[
|
|
5615
|
+
[ws]: {
|
|
5536
5616
|
value: e,
|
|
5537
5617
|
configurable: !1,
|
|
5538
5618
|
writable: !1,
|
|
5539
5619
|
enumerable: !1
|
|
5540
5620
|
},
|
|
5541
|
-
[
|
|
5621
|
+
[Cs]: {
|
|
5542
5622
|
value: t,
|
|
5543
5623
|
configurable: !1,
|
|
5544
5624
|
writable: !1,
|
|
5545
5625
|
enumerable: !1
|
|
5546
5626
|
},
|
|
5547
|
-
[
|
|
5627
|
+
[Ts]: {
|
|
5548
5628
|
value: i,
|
|
5549
5629
|
configurable: !1,
|
|
5550
5630
|
writable: !1,
|
|
5551
5631
|
enumerable: !1
|
|
5552
5632
|
},
|
|
5553
|
-
[
|
|
5633
|
+
[Es]: {
|
|
5554
5634
|
value: r,
|
|
5555
5635
|
configurable: !1,
|
|
5556
5636
|
writable: !1,
|
|
@@ -5567,16 +5647,16 @@ function Ps(e, t, n, r, i = []) {
|
|
|
5567
5647
|
}
|
|
5568
5648
|
//#endregion
|
|
5569
5649
|
//#region src/json-schema-subset/compiler/array.ts
|
|
5570
|
-
function
|
|
5571
|
-
let n =
|
|
5572
|
-
if (Array.isArray(n) ? s =
|
|
5650
|
+
function Ls(e, t) {
|
|
5651
|
+
let n = Rs(e, t), r = zs(e, "maxItems", t), i = zs(e, "minItems", t), a = Bs(e, t), o = t.uniqueItems, s;
|
|
5652
|
+
if (Array.isArray(n) ? s = Vs(e, t) : t.additionalItems && Y(e, "it is needless when items is not array", "additionalItems"), !n || !a || s === null) return null;
|
|
5573
5653
|
let c = !1, l = !1;
|
|
5574
5654
|
if (Array.isArray(n)) {
|
|
5575
|
-
r !== void 0 && r <= n.length && (n = n.splice(r), s =
|
|
5655
|
+
r !== void 0 && r <= n.length && (n = n.splice(r), s = Hs(s, e.delegate));
|
|
5576
5656
|
let t = n.findIndex((e) => Z(e) === X.Never);
|
|
5577
|
-
t !== -1 && (n = n.splice(t), s =
|
|
5657
|
+
t !== -1 && (n = n.splice(t), s = Hs(s, e.delegate), r === void 0 && (r = n.length, l = !0)), i !== void 0 && n.length < i && (Y(e, `length(${n.length}) of items if less than minItems(${i})`), c = !0), n.length === 0 && s && Z(s) === X.Never && (c = !0);
|
|
5578
5658
|
} else Z(n) === X.Never && (c = !0);
|
|
5579
|
-
return r !== void 0 && i !== void 0 && r < i && (l || Y(e, `maxItems(${r}) is less than minItems(${i})`), c = !0),
|
|
5659
|
+
return r !== void 0 && i !== void 0 && r < i && (l || Y(e, `maxItems(${r}) is less than minItems(${i})`), c = !0), Ps(c ? X.Never : X.Array, xs({
|
|
5580
5660
|
type: "array",
|
|
5581
5661
|
items: n,
|
|
5582
5662
|
contains: a,
|
|
@@ -5586,12 +5666,12 @@ function Fs(e, t) {
|
|
|
5586
5666
|
additionalItems: s
|
|
5587
5667
|
}), e.delegate, e.path);
|
|
5588
5668
|
}
|
|
5589
|
-
function
|
|
5590
|
-
if (!t) return
|
|
5669
|
+
function Rs(e, { items: t }) {
|
|
5670
|
+
if (!t) return Ps(X.Any, {}, e.delegate, e.path);
|
|
5591
5671
|
if (Array.isArray(t)) {
|
|
5592
5672
|
let n = [], r = !1;
|
|
5593
5673
|
for (let [i, a] of t.entries()) {
|
|
5594
|
-
let t =
|
|
5674
|
+
let t = Sc(_s(e, "items", i), vs(a));
|
|
5595
5675
|
if (!t) {
|
|
5596
5676
|
r = !0;
|
|
5597
5677
|
continue;
|
|
@@ -5600,9 +5680,9 @@ function Is(e, { items: t }) {
|
|
|
5600
5680
|
}
|
|
5601
5681
|
return r ? null : n;
|
|
5602
5682
|
}
|
|
5603
|
-
return
|
|
5683
|
+
return Sc(_s(e, "items"), vs(t));
|
|
5604
5684
|
}
|
|
5605
|
-
function
|
|
5685
|
+
function zs(e, t, n) {
|
|
5606
5686
|
let r = n[t];
|
|
5607
5687
|
if (r !== void 0) {
|
|
5608
5688
|
if (Number.isNaN(r)) {
|
|
@@ -5616,35 +5696,35 @@ function Ls(e, t, n) {
|
|
|
5616
5696
|
return r;
|
|
5617
5697
|
}
|
|
5618
5698
|
}
|
|
5619
|
-
function
|
|
5620
|
-
return t ?
|
|
5699
|
+
function Bs(e, { contains: t }) {
|
|
5700
|
+
return t ? Sc(_s(e, "contains"), vs(t)) : Ps(X.Any, {}, e.delegate, e.path);
|
|
5621
5701
|
}
|
|
5622
|
-
function
|
|
5702
|
+
function Vs(e, { additionalItems: t }) {
|
|
5623
5703
|
switch (typeof t) {
|
|
5624
|
-
case "boolean": return t ?
|
|
5625
|
-
case "object": return
|
|
5626
|
-
default: return
|
|
5704
|
+
case "boolean": return t ? Ps(X.Any, {}, e.delegate, e.path) : !1;
|
|
5705
|
+
case "object": return Sc(_s(e, "additionalItems"), t);
|
|
5706
|
+
default: return Ps(X.Any, {}, e.delegate, e.path);
|
|
5627
5707
|
}
|
|
5628
5708
|
}
|
|
5629
|
-
function
|
|
5630
|
-
return e === void 0 ?
|
|
5709
|
+
function Hs(e, t) {
|
|
5710
|
+
return e === void 0 ? Ps(X.Never, {
|
|
5631
5711
|
type: "string",
|
|
5632
5712
|
maxLength: 0,
|
|
5633
5713
|
minLength: 1
|
|
5634
|
-
}, t) :
|
|
5714
|
+
}, t) : As(e) ? Z(e) === X.Never ? e : Fs(e) : e;
|
|
5635
5715
|
}
|
|
5636
5716
|
//#endregion
|
|
5637
5717
|
//#region src/json-schema-subset/compiler/combination.ts
|
|
5638
|
-
var
|
|
5718
|
+
var Us = Object.freeze([
|
|
5639
5719
|
"allOf",
|
|
5640
5720
|
"anyOf",
|
|
5641
5721
|
"oneOf"
|
|
5642
5722
|
]);
|
|
5643
|
-
function
|
|
5644
|
-
if (n.length === 0) return
|
|
5723
|
+
function Ws(e, t, n, r) {
|
|
5724
|
+
if (n.length === 0) return ys(e, "disable empty list", t), null;
|
|
5645
5725
|
let i = [];
|
|
5646
5726
|
for (let [r, a] of n.entries()) {
|
|
5647
|
-
let n =
|
|
5727
|
+
let n = Sc(_s(e, t, r), vs(a));
|
|
5648
5728
|
n && i.push(n);
|
|
5649
5729
|
}
|
|
5650
5730
|
if (i.length < n.length) return null;
|
|
@@ -5658,16 +5738,16 @@ function Hs(e, t, n, r) {
|
|
|
5658
5738
|
let s = X.Combination;
|
|
5659
5739
|
switch (t) {
|
|
5660
5740
|
case "allOf":
|
|
5661
|
-
o > 0 ? s = X.Never : a === i.length ? s = X.Any :
|
|
5741
|
+
o > 0 ? s = X.Never : a === i.length ? s = X.Any : Gs(i) || (s = X.Never);
|
|
5662
5742
|
break;
|
|
5663
5743
|
case "anyOf":
|
|
5664
5744
|
a > 0 ? s = X.Any : o === i.length && (s = X.Never);
|
|
5665
5745
|
break;
|
|
5666
5746
|
case "oneOf": a > 1 || o === i.length ? s = X.Never : a === 1 && o === i.length - 1 && (s = X.Any);
|
|
5667
5747
|
}
|
|
5668
|
-
return
|
|
5748
|
+
return Ps(s, { [t]: i }, r, e.path);
|
|
5669
5749
|
}
|
|
5670
|
-
function
|
|
5750
|
+
function Gs(e) {
|
|
5671
5751
|
let t = null;
|
|
5672
5752
|
for (let n of e) {
|
|
5673
5753
|
let e = Z(n);
|
|
@@ -5682,35 +5762,35 @@ function Us(e) {
|
|
|
5682
5762
|
}
|
|
5683
5763
|
//#endregion
|
|
5684
5764
|
//#region src/json-schema-subset/checker/validator.ts
|
|
5685
|
-
var
|
|
5765
|
+
var Ks = Object.freeze({
|
|
5686
5766
|
Valid: 0,
|
|
5687
5767
|
Invalid: 1,
|
|
5688
5768
|
Unknown: 2
|
|
5689
5769
|
});
|
|
5690
|
-
function
|
|
5770
|
+
function qs(e, t) {
|
|
5691
5771
|
let n = e.isValid;
|
|
5692
|
-
return n ? n(t) === !0 ?
|
|
5772
|
+
return n ? n(t) === !0 ? Ks.Valid : Ks.Invalid : Ks.Unknown;
|
|
5693
5773
|
}
|
|
5694
5774
|
//#endregion
|
|
5695
5775
|
//#region src/json-schema-subset/compiler/enumAndConst.ts
|
|
5696
|
-
function
|
|
5776
|
+
function Js(e, t, n, r) {
|
|
5697
5777
|
let i, a = !1;
|
|
5698
5778
|
if (t) {
|
|
5699
|
-
if (t.length === 0) return
|
|
5779
|
+
if (t.length === 0) return ys(e, "disable empty list", "enum"), null;
|
|
5700
5780
|
i = [];
|
|
5701
|
-
for (let [n, a] of t.entries()) switch (
|
|
5702
|
-
case
|
|
5703
|
-
i.push(
|
|
5781
|
+
for (let [n, a] of t.entries()) switch (qs(r, a)) {
|
|
5782
|
+
case Ks.Valid:
|
|
5783
|
+
i.push(Ns(a));
|
|
5704
5784
|
break;
|
|
5705
|
-
case
|
|
5785
|
+
case Ks.Invalid: Y(e, "cannot pass JSON schema of currently schema object", "enum", n);
|
|
5706
5786
|
}
|
|
5707
5787
|
i.length === 0 && Y(e, "all of elements from list is rejected by currently schema object", "enum");
|
|
5708
5788
|
}
|
|
5709
|
-
if (n &&
|
|
5789
|
+
if (n && qs(r, n) === Ks.Invalid && (a = !0), i) {
|
|
5710
5790
|
if (i.length === 0) a = !0;
|
|
5711
5791
|
else if (n) {
|
|
5712
5792
|
let e = !1;
|
|
5713
|
-
for (let t of i) if (
|
|
5793
|
+
for (let t of i) if (Ho(t, n)) {
|
|
5714
5794
|
e = !0;
|
|
5715
5795
|
break;
|
|
5716
5796
|
}
|
|
@@ -5718,11 +5798,11 @@ function Ks(e, t, n, r) {
|
|
|
5718
5798
|
}
|
|
5719
5799
|
}
|
|
5720
5800
|
let o = a ? X.Never : X.EnumOrConst, s = {};
|
|
5721
|
-
return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const =
|
|
5801
|
+
return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const = Ns(Vo(n))), Ps(o, s, e.delegate, e.path);
|
|
5722
5802
|
}
|
|
5723
5803
|
//#endregion
|
|
5724
5804
|
//#region src/json-schema-subset/compiler/object.ts
|
|
5725
|
-
var
|
|
5805
|
+
var Ys = /* @__PURE__ */ new Set([
|
|
5726
5806
|
"type",
|
|
5727
5807
|
"maxProperties",
|
|
5728
5808
|
"minProperties",
|
|
@@ -5733,27 +5813,27 @@ var qs = /* @__PURE__ */ new Set([
|
|
|
5733
5813
|
"dependencies",
|
|
5734
5814
|
"propertyNames"
|
|
5735
5815
|
]);
|
|
5736
|
-
function
|
|
5737
|
-
let n = Object.keys(t).filter((e) => !
|
|
5816
|
+
function Xs(e, t) {
|
|
5817
|
+
let n = Object.keys(t).filter((e) => !Ys.has(e) && hs(e));
|
|
5738
5818
|
n.length > 0 && Y(e, `type="object" will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
5739
|
-
let r =
|
|
5819
|
+
let r = Zs(e, "maxProperties", t), i = Zs(e, "minProperties", t), a = Qs(e, t), o = $s(e, t), s = ec(e, t), c = nc(e, t);
|
|
5740
5820
|
if (!a || !o || !s || !c) return null;
|
|
5741
|
-
let l =
|
|
5821
|
+
let l = tc(e, o, s, t);
|
|
5742
5822
|
if (!l) return null;
|
|
5743
|
-
let u =
|
|
5744
|
-
return
|
|
5823
|
+
let u = ic(e, rc(a, o, s, l), c, t);
|
|
5824
|
+
return Ps(ac(e, a, l, u, r, i) ? X.Never : X.Object, xs({
|
|
5745
5825
|
type: "object",
|
|
5746
5826
|
required: u,
|
|
5747
5827
|
properties: l,
|
|
5748
5828
|
minProperties: i,
|
|
5749
5829
|
maxProperties: r,
|
|
5750
5830
|
additionalProperties: a,
|
|
5751
|
-
patternProperties:
|
|
5752
|
-
dependencies:
|
|
5831
|
+
patternProperties: uc(o),
|
|
5832
|
+
dependencies: dc(c, t),
|
|
5753
5833
|
propertyNames: s
|
|
5754
5834
|
}), e.delegate, e.path);
|
|
5755
5835
|
}
|
|
5756
|
-
function
|
|
5836
|
+
function Zs(e, t, n) {
|
|
5757
5837
|
let r = n[t];
|
|
5758
5838
|
if (r !== void 0) {
|
|
5759
5839
|
if (Number.isNaN(r)) {
|
|
@@ -5767,22 +5847,22 @@ function Ys(e, t, n) {
|
|
|
5767
5847
|
return r;
|
|
5768
5848
|
}
|
|
5769
5849
|
}
|
|
5770
|
-
function
|
|
5771
|
-
return t === !1 ?
|
|
5850
|
+
function Qs(e, { additionalProperties: t }) {
|
|
5851
|
+
return t === !1 ? Ps(X.Never, {
|
|
5772
5852
|
type: "string",
|
|
5773
5853
|
maxLength: 0,
|
|
5774
5854
|
minLength: 1
|
|
5775
|
-
}, e.delegate, e.path) : typeof t == "object" ?
|
|
5855
|
+
}, e.delegate, e.path) : typeof t == "object" ? Sc(_s(e, "additionalProperties"), vs(t)) : Ps(X.Any, {}, e.delegate, e.path);
|
|
5776
5856
|
}
|
|
5777
|
-
function
|
|
5857
|
+
function $s(e, { patternProperties: t }) {
|
|
5778
5858
|
let n = !1, r = {};
|
|
5779
5859
|
for (let i in t) {
|
|
5780
|
-
let a =
|
|
5860
|
+
let a = lc(i);
|
|
5781
5861
|
if (a instanceof Error) {
|
|
5782
5862
|
Y(e, `property name invalid. ${i}`, "patternProperties", i);
|
|
5783
5863
|
continue;
|
|
5784
5864
|
}
|
|
5785
|
-
let o =
|
|
5865
|
+
let o = vs(t[i]), s = Sc(_s(e, "patternProperties", i), o);
|
|
5786
5866
|
if (!s) {
|
|
5787
5867
|
n = !0;
|
|
5788
5868
|
continue;
|
|
@@ -5791,29 +5871,29 @@ function Zs(e, { patternProperties: t }) {
|
|
|
5791
5871
|
}
|
|
5792
5872
|
return n ? null : r;
|
|
5793
5873
|
}
|
|
5794
|
-
function
|
|
5795
|
-
if (!t) return
|
|
5796
|
-
t =
|
|
5797
|
-
let n =
|
|
5874
|
+
function ec(e, { propertyNames: t }) {
|
|
5875
|
+
if (!t) return Ps(X.Any, {}, e.delegate, e.path);
|
|
5876
|
+
t = vs(t);
|
|
5877
|
+
let n = Sc(_s(e, "propertyNames"), t);
|
|
5798
5878
|
if (!n) return null;
|
|
5799
5879
|
let r = Z(n);
|
|
5800
|
-
return r !== X.String && r !== X.Any ?
|
|
5880
|
+
return r !== X.String && r !== X.Any ? Fs(n) : n;
|
|
5801
5881
|
}
|
|
5802
|
-
function
|
|
5882
|
+
function tc(e, t, n, { properties: r }) {
|
|
5803
5883
|
let i = !1;
|
|
5804
5884
|
if (!r) return {};
|
|
5805
5885
|
let a = {};
|
|
5806
5886
|
for (let o in r) {
|
|
5807
|
-
if (
|
|
5887
|
+
if (qs(n, o) === Ks.Invalid) {
|
|
5808
5888
|
Y(e, `key ${JSON.stringify(o)} cannot pass JSON schema from propertyNames`, "properties");
|
|
5809
5889
|
continue;
|
|
5810
5890
|
}
|
|
5811
|
-
let s =
|
|
5891
|
+
let s = cc(t, o);
|
|
5812
5892
|
if (s && Z(s) === X.Never) {
|
|
5813
5893
|
Y(e, `key ${JSON.stringify(o)} matches a pattern that has a impossible(never) schema`, "properties");
|
|
5814
5894
|
continue;
|
|
5815
5895
|
}
|
|
5816
|
-
let c =
|
|
5896
|
+
let c = vs(r[o]), l = Sc(_s(e, "properties", o), c);
|
|
5817
5897
|
if (!l) {
|
|
5818
5898
|
i = !0;
|
|
5819
5899
|
continue;
|
|
@@ -5822,40 +5902,40 @@ function $s(e, t, n, { properties: r }) {
|
|
|
5822
5902
|
}
|
|
5823
5903
|
return i ? null : a;
|
|
5824
5904
|
}
|
|
5825
|
-
function
|
|
5905
|
+
function nc(e, { dependencies: t }) {
|
|
5826
5906
|
if (!t) return [{}, {}];
|
|
5827
5907
|
let n = {}, r = {};
|
|
5828
5908
|
for (let i in t) {
|
|
5829
|
-
let a =
|
|
5909
|
+
let a = vs(t[i]);
|
|
5830
5910
|
if (Array.isArray(a)) {
|
|
5831
|
-
let { keys: t, duplicated: r } =
|
|
5911
|
+
let { keys: t, duplicated: r } = sc(a);
|
|
5832
5912
|
r && Y(e, `found duplicated property names: ${r.join(", ")}`, "dependencies", i), n[i] = t;
|
|
5833
5913
|
} else {
|
|
5834
|
-
let t =
|
|
5914
|
+
let t = Sc(_s(e, "dependencies", i), a);
|
|
5835
5915
|
if (t) {
|
|
5836
5916
|
let e = Z(t);
|
|
5837
|
-
r[i] = e === X.Object || e === X.Any ? t : e === X.Extends ?
|
|
5917
|
+
r[i] = e === X.Object || e === X.Any ? t : e === X.Extends ? Os : Fs(t);
|
|
5838
5918
|
}
|
|
5839
5919
|
}
|
|
5840
5920
|
}
|
|
5841
5921
|
return [n, r];
|
|
5842
5922
|
}
|
|
5843
|
-
function
|
|
5923
|
+
function rc(e, t, n, r) {
|
|
5844
5924
|
return (i) => {
|
|
5845
|
-
if (
|
|
5846
|
-
let a =
|
|
5925
|
+
if (qs(n, i) === Ks.Invalid) return !0;
|
|
5926
|
+
let a = cc(t, i);
|
|
5847
5927
|
return !!(a && Z(a) === X.Never || Z(r[i] ?? e) === X.Never);
|
|
5848
5928
|
};
|
|
5849
5929
|
}
|
|
5850
|
-
function
|
|
5930
|
+
function ic(e, t, n, { required: r }) {
|
|
5851
5931
|
if (!r) return [];
|
|
5852
|
-
let i =
|
|
5932
|
+
let i = sc(r);
|
|
5853
5933
|
i.duplicated && Y(e, `found duplicated required keys: ${i.duplicated.join(", ")}`, "required");
|
|
5854
5934
|
let a = [], o = [];
|
|
5855
|
-
for (let e of i.keys)
|
|
5935
|
+
for (let e of i.keys) oc(n, e).some((e) => t(e)) ? o.push(e) : a.push(e);
|
|
5856
5936
|
return o.length > 0 && Y(e, `key ${o.map((e) => JSON.stringify(e)).join(", ")} will ban by another condition`, "required"), a;
|
|
5857
5937
|
}
|
|
5858
|
-
function
|
|
5938
|
+
function ac(e, t, n, r, i, a) {
|
|
5859
5939
|
if (i !== void 0 && a !== void 0 && i < a) return Y(e, `maxProperties(${i}) is less than minProperties(${a})`), !0;
|
|
5860
5940
|
if (i !== void 0 && r.length > i) return Y(e, `length(${r.length}) of required is greater than maxProperties(${i})`), !0;
|
|
5861
5941
|
if (a !== void 0 && r.length < a) return Y(e, `length(${r.length}) of required is less than minProperties(${a})`), !0;
|
|
@@ -5866,7 +5946,7 @@ function rc(e, t, n, r, i, a) {
|
|
|
5866
5946
|
}
|
|
5867
5947
|
return !0;
|
|
5868
5948
|
}
|
|
5869
|
-
function
|
|
5949
|
+
function oc([e, t], n) {
|
|
5870
5950
|
let r = [n], i = new Set(r);
|
|
5871
5951
|
for (; r.length > 0;) {
|
|
5872
5952
|
let n = r.pop(), i = t[n], o = e[n];
|
|
@@ -5877,7 +5957,7 @@ function ic([e, t], n) {
|
|
|
5877
5957
|
}
|
|
5878
5958
|
return [...i];
|
|
5879
5959
|
}
|
|
5880
|
-
function
|
|
5960
|
+
function sc(e) {
|
|
5881
5961
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
5882
5962
|
for (let r of e) t.has(r) ? n.add(r) : t.add(r);
|
|
5883
5963
|
return n.size === 0 ? {
|
|
@@ -5888,14 +5968,14 @@ function ac(e) {
|
|
|
5888
5968
|
duplicated: [...n]
|
|
5889
5969
|
};
|
|
5890
5970
|
}
|
|
5891
|
-
function
|
|
5971
|
+
function cc(e, t) {
|
|
5892
5972
|
for (let n in e) {
|
|
5893
5973
|
let [r, i] = e[n];
|
|
5894
5974
|
if (i.test(t)) return r;
|
|
5895
5975
|
}
|
|
5896
5976
|
return null;
|
|
5897
5977
|
}
|
|
5898
|
-
function
|
|
5978
|
+
function lc(e) {
|
|
5899
5979
|
try {
|
|
5900
5980
|
return new RegExp(e, "i");
|
|
5901
5981
|
} catch (e) {
|
|
@@ -5903,12 +5983,12 @@ function sc(e) {
|
|
|
5903
5983
|
throw e;
|
|
5904
5984
|
}
|
|
5905
5985
|
}
|
|
5906
|
-
function
|
|
5986
|
+
function uc(e) {
|
|
5907
5987
|
let t = {};
|
|
5908
5988
|
for (let n in e) t[n] = e[n][0];
|
|
5909
5989
|
return t;
|
|
5910
5990
|
}
|
|
5911
|
-
function
|
|
5991
|
+
function dc([e, t], { dependencies: n }) {
|
|
5912
5992
|
let r = {};
|
|
5913
5993
|
for (let i in n) {
|
|
5914
5994
|
let n = e[i], a = t[i];
|
|
@@ -5918,38 +5998,38 @@ function lc([e, t], { dependencies: n }) {
|
|
|
5918
5998
|
}
|
|
5919
5999
|
//#endregion
|
|
5920
6000
|
//#region src/json-schema-subset/compiler/primitive.ts
|
|
5921
|
-
var
|
|
6001
|
+
var fc = /* @__PURE__ */ new Set([
|
|
5922
6002
|
"type",
|
|
5923
6003
|
"multipleOf",
|
|
5924
6004
|
"maximum",
|
|
5925
6005
|
"exclusiveMaximum",
|
|
5926
6006
|
"minimum",
|
|
5927
6007
|
"exclusiveMinimum"
|
|
5928
|
-
]),
|
|
6008
|
+
]), pc = /* @__PURE__ */ new Set([
|
|
5929
6009
|
"type",
|
|
5930
6010
|
"maxLength",
|
|
5931
6011
|
"minLength",
|
|
5932
6012
|
"pattern"
|
|
5933
6013
|
]);
|
|
5934
|
-
function
|
|
6014
|
+
function mc(e, t) {
|
|
5935
6015
|
let { type: n } = t;
|
|
5936
6016
|
switch (n) {
|
|
5937
6017
|
case "number":
|
|
5938
|
-
case "integer": return
|
|
5939
|
-
case "string": return
|
|
6018
|
+
case "integer": return hc(e, t);
|
|
6019
|
+
case "string": return _c(e, t);
|
|
5940
6020
|
case "boolean":
|
|
5941
6021
|
case "null": {
|
|
5942
|
-
let r = Object.keys(t).filter((e) =>
|
|
5943
|
-
return r.length > 0 && Y(e, `key "type" will exclude other keys: ${r.toSorted().join(", ")}`),
|
|
6022
|
+
let r = Object.keys(t).filter((e) => hs(e) && e !== "type");
|
|
6023
|
+
return r.length > 0 && Y(e, `key "type" will exclude other keys: ${r.toSorted().join(", ")}`), Ps(n === "null" ? X.Null : X.Boolean, { type: n }, e.delegate, e.path);
|
|
5944
6024
|
}
|
|
5945
|
-
default: return
|
|
6025
|
+
default: return ys(e, `invalid type ${JSON.stringify(n)}`), null;
|
|
5946
6026
|
}
|
|
5947
6027
|
}
|
|
5948
|
-
function
|
|
5949
|
-
let n = Object.keys(t).filter((e) => !
|
|
6028
|
+
function hc(e, t) {
|
|
6029
|
+
let n = Object.keys(t).filter((e) => !fc.has(e) && hs(e));
|
|
5950
6030
|
n.length > 0 && Y(e, `type=${JSON.stringify(t.type)} will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
5951
|
-
let r =
|
|
5952
|
-
for (let t of
|
|
6031
|
+
let r = Bo(t, fc);
|
|
6032
|
+
for (let t of fc) {
|
|
5953
6033
|
let n = r[t];
|
|
5954
6034
|
t !== "type" && n !== void 0 && Number.isNaN(n) && (Y(e, "found NaN", t), delete r[t]);
|
|
5955
6035
|
}
|
|
@@ -5958,38 +6038,38 @@ function pc(e, t) {
|
|
|
5958
6038
|
let { multipleOf: c } = r;
|
|
5959
6039
|
c === 0 && (delete r.multipleOf, r.type = "number", Y(e, "cannot be 0", "multipleOf"));
|
|
5960
6040
|
let l = X.Numeric;
|
|
5961
|
-
return
|
|
6041
|
+
return gc(r) || (l = X.Never), Ps(l, r, e.delegate, e.path);
|
|
5962
6042
|
}
|
|
5963
|
-
function
|
|
6043
|
+
function gc(e) {
|
|
5964
6044
|
let { maximum: t, exclusiveMaximum: n, minimum: r, exclusiveMinimum: i } = e;
|
|
5965
6045
|
return t !== void 0 && r !== void 0 ? t >= r : n !== void 0 && r !== void 0 ? n > r : t !== void 0 && i !== void 0 ? t > i : n !== void 0 && i !== void 0 ? n > i : !0;
|
|
5966
6046
|
}
|
|
5967
|
-
function
|
|
5968
|
-
let n = Object.keys(t).filter((e) => !
|
|
6047
|
+
function _c(e, t) {
|
|
6048
|
+
let n = Object.keys(t).filter((e) => !pc.has(e) && hs(e));
|
|
5969
6049
|
n.length > 0 && Y(e, `type="string" will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
5970
|
-
let r =
|
|
5971
|
-
|
|
6050
|
+
let r = Bo(t, pc);
|
|
6051
|
+
vc(e, r, "maxLength"), vc(e, r, "minLength");
|
|
5972
6052
|
let i = r.maxLength, a = r.minLength, o = X.String;
|
|
5973
|
-
return i !== void 0 && (i < 0 || i !== void 0 && a !== void 0 && i < a) && (o = X.Never),
|
|
6053
|
+
return i !== void 0 && (i < 0 || i !== void 0 && a !== void 0 && i < a) && (o = X.Never), Ps(o, r, e.delegate, e.path);
|
|
5974
6054
|
}
|
|
5975
|
-
function
|
|
6055
|
+
function vc(e, t, n) {
|
|
5976
6056
|
let r = t[n];
|
|
5977
6057
|
r !== void 0 && Number.isNaN(r) && (Y(e, "found NaN", n), delete t[n]);
|
|
5978
6058
|
}
|
|
5979
6059
|
//#endregion
|
|
5980
6060
|
//#region src/json-schema-subset/compiler/compiler.ts
|
|
5981
|
-
var
|
|
5982
|
-
function
|
|
5983
|
-
if (
|
|
6061
|
+
var yc = Object.freeze([]);
|
|
6062
|
+
function bc(e, t, n, r) {
|
|
6063
|
+
if (As(e) || t.isExtendsSchema(e)) return {
|
|
5984
6064
|
schema: e,
|
|
5985
|
-
warns:
|
|
6065
|
+
warns: yc
|
|
5986
6066
|
};
|
|
5987
6067
|
if (r) {
|
|
5988
6068
|
let t = r.isSchema(e);
|
|
5989
6069
|
if (typeof t == "object") {
|
|
5990
6070
|
let e = [];
|
|
5991
6071
|
for (let n of t) e.push({
|
|
5992
|
-
kind:
|
|
6072
|
+
kind: ds.External,
|
|
5993
6073
|
error: n
|
|
5994
6074
|
});
|
|
5995
6075
|
if (e.length > 0) return e;
|
|
@@ -6002,19 +6082,19 @@ function vc(e, t, n, r) {
|
|
|
6002
6082
|
path: [],
|
|
6003
6083
|
errors: [],
|
|
6004
6084
|
warns: []
|
|
6005
|
-
}, a =
|
|
6006
|
-
if (a)
|
|
6007
|
-
else return
|
|
6085
|
+
}, a = Sc(i, e);
|
|
6086
|
+
if (a) xc(i.errors.length === 0, "found errors (it should be empty)");
|
|
6087
|
+
else return xc(i.errors.length > 0, "cannot found any errors"), i.errors;
|
|
6008
6088
|
return {
|
|
6009
6089
|
schema: a,
|
|
6010
6090
|
warns: i.warns
|
|
6011
6091
|
};
|
|
6012
6092
|
}
|
|
6013
|
-
function
|
|
6093
|
+
function xc(e, t) {
|
|
6014
6094
|
if (!e) throw Error(t);
|
|
6015
6095
|
}
|
|
6016
|
-
function
|
|
6017
|
-
if (e.extends.isExtendsSchema(t) ||
|
|
6096
|
+
function Sc(e, t) {
|
|
6097
|
+
if (e.extends.isExtendsSchema(t) || As(t)) return t;
|
|
6018
6098
|
let n = e.extends.tryCompiledExtendsSchema(t, e.payload);
|
|
6019
6099
|
if (n) return n;
|
|
6020
6100
|
let r = t, i = !1, { enum: a, const: o } = t;
|
|
@@ -6022,23 +6102,23 @@ function bc(e, t) {
|
|
|
6022
6102
|
let { enum: e, const: n, ...a } = t;
|
|
6023
6103
|
r = a, i = !0;
|
|
6024
6104
|
}
|
|
6025
|
-
let s =
|
|
6026
|
-
return s && i && (s =
|
|
6105
|
+
let s = Cc(e, r);
|
|
6106
|
+
return s && i && (s = Js(e, a, o, s)), s || null;
|
|
6027
6107
|
}
|
|
6028
|
-
function
|
|
6029
|
-
for (let n of
|
|
6108
|
+
function Cc(e, t) {
|
|
6109
|
+
for (let n of Us) {
|
|
6030
6110
|
let r = t[n];
|
|
6031
6111
|
if (r) {
|
|
6032
|
-
let i = Object.keys(t).filter((e) =>
|
|
6033
|
-
return i.length > 0 && Y(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`),
|
|
6112
|
+
let i = Object.keys(t).filter((e) => hs(e) && e !== n);
|
|
6113
|
+
return i.length > 0 && Y(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`), Ws(e, n, r) || null;
|
|
6034
6114
|
}
|
|
6035
6115
|
}
|
|
6036
6116
|
{
|
|
6037
|
-
let n =
|
|
6117
|
+
let n = vs(t.not);
|
|
6038
6118
|
if (n) {
|
|
6039
|
-
let r = Object.keys(t).filter((e) =>
|
|
6119
|
+
let r = Object.keys(t).filter((e) => hs(e) && e !== "not");
|
|
6040
6120
|
r.length > 0 && Y(e, `key "not" will exclude other keys: ${r.toSorted().join(", ")}`);
|
|
6041
|
-
let i =
|
|
6121
|
+
let i = Sc(_s(e, "not"), n);
|
|
6042
6122
|
if (!i) return null;
|
|
6043
6123
|
let a = X.Not;
|
|
6044
6124
|
switch (Z(i)) {
|
|
@@ -6047,33 +6127,33 @@ function xc(e, t) {
|
|
|
6047
6127
|
break;
|
|
6048
6128
|
case X.Any: a = X.Never;
|
|
6049
6129
|
}
|
|
6050
|
-
return
|
|
6130
|
+
return Ps(a, { not: i }, e.delegate, e.path);
|
|
6051
6131
|
}
|
|
6052
6132
|
}
|
|
6053
6133
|
if (t.type) {
|
|
6054
6134
|
let { type: n } = t;
|
|
6055
6135
|
if (Array.isArray(n)) {
|
|
6056
6136
|
let { type: r, ...i } = t;
|
|
6057
|
-
return
|
|
6137
|
+
return Ws(e, "anyOf", n.map((e) => ({
|
|
6058
6138
|
...i,
|
|
6059
6139
|
type: e
|
|
6060
6140
|
})));
|
|
6061
6141
|
}
|
|
6062
6142
|
switch (n) {
|
|
6063
|
-
case "object": return
|
|
6064
|
-
case "array": return
|
|
6065
|
-
default: return
|
|
6143
|
+
case "object": return Xs(e, t);
|
|
6144
|
+
case "array": return Ls(e, t);
|
|
6145
|
+
default: return mc(e, t);
|
|
6066
6146
|
}
|
|
6067
6147
|
}
|
|
6068
|
-
return
|
|
6148
|
+
return gs(t) ? Ps(X.Any, {}, e.delegate, e.path) : (ys(e, "unrecognized"), null);
|
|
6069
6149
|
}
|
|
6070
6150
|
//#endregion
|
|
6071
6151
|
//#region src/json-schema-subset/checker/tools/mark.ts
|
|
6072
|
-
var
|
|
6152
|
+
var wc = class {
|
|
6073
6153
|
constructor(e) {
|
|
6074
6154
|
let t = Object.freeze(e.toSorted());
|
|
6075
6155
|
if (t.length > 32) throw Error(`cannot define ${t.length} keys which is greater than 32`);
|
|
6076
|
-
this.keys = t, this.clazz = class extends
|
|
6156
|
+
this.keys = t, this.clazz = class extends Tc {
|
|
6077
6157
|
constructor(e) {
|
|
6078
6158
|
super(t, e);
|
|
6079
6159
|
}
|
|
@@ -6097,7 +6177,7 @@ var Sc = class {
|
|
|
6097
6177
|
else if (e) for (let [n, r] of this.keys.entries()) e[r] && (t |= 1 << n);
|
|
6098
6178
|
return new this.clazz(t);
|
|
6099
6179
|
}
|
|
6100
|
-
},
|
|
6180
|
+
}, Tc = class {
|
|
6101
6181
|
constructor(e, t) {
|
|
6102
6182
|
this.keys = e, this.int32 = t;
|
|
6103
6183
|
}
|
|
@@ -6112,21 +6192,21 @@ var Sc = class {
|
|
|
6112
6192
|
};
|
|
6113
6193
|
//#endregion
|
|
6114
6194
|
//#region src/json-schema-subset/checker/tools/quantum.ts
|
|
6115
|
-
function
|
|
6116
|
-
return new
|
|
6195
|
+
function Ec(e) {
|
|
6196
|
+
return new Dc(e);
|
|
6117
6197
|
}
|
|
6118
|
-
var
|
|
6198
|
+
var Dc = class {
|
|
6119
6199
|
constructor(e) {
|
|
6120
|
-
this.description = new
|
|
6200
|
+
this.description = new wc(e);
|
|
6121
6201
|
}
|
|
6122
6202
|
get keys() {
|
|
6123
6203
|
return this.description.keys;
|
|
6124
6204
|
}
|
|
6125
6205
|
variable(e) {
|
|
6126
6206
|
let t;
|
|
6127
|
-
return e && (t = this.description.toBundle(e).toInt32()), new
|
|
6207
|
+
return e && (t = this.description.toBundle(e).toInt32()), new Oc(this.description, t);
|
|
6128
6208
|
}
|
|
6129
|
-
},
|
|
6209
|
+
}, Oc = class {
|
|
6130
6210
|
constructor(e, t) {
|
|
6131
6211
|
this.values = /* @__PURE__ */ new Set(), this.description = e, t !== void 0 && this.values.add(t);
|
|
6132
6212
|
}
|
|
@@ -6147,7 +6227,7 @@ var Tc = class {
|
|
|
6147
6227
|
}
|
|
6148
6228
|
push(e, t) {
|
|
6149
6229
|
let n = /* @__PURE__ */ new Set();
|
|
6150
|
-
for (let r of this.values) for (let [i, a] of
|
|
6230
|
+
for (let r of this.values) for (let [i, a] of Uo) if (e & a) {
|
|
6151
6231
|
let e = this.description.toBundle(r);
|
|
6152
6232
|
t(i, e), n.add(e.toInt32());
|
|
6153
6233
|
}
|
|
@@ -6164,11 +6244,11 @@ var Tc = class {
|
|
|
6164
6244
|
};
|
|
6165
6245
|
//#endregion
|
|
6166
6246
|
//#region src/json-schema-subset/checker/tools/range.ts
|
|
6167
|
-
function
|
|
6247
|
+
function kc(e, t) {
|
|
6168
6248
|
let [n] = e, [r] = t;
|
|
6169
|
-
return n.num < r.num ?
|
|
6249
|
+
return n.num < r.num ? Ac(e, t) : n.num > r.num ? jc(e, t) : Mc(e, t);
|
|
6170
6250
|
}
|
|
6171
|
-
function
|
|
6251
|
+
function Ac(e, t) {
|
|
6172
6252
|
let [n, r] = e, [i, a] = t;
|
|
6173
6253
|
if (r.num <= i.num) {
|
|
6174
6254
|
let n = r.exclusive, a = i.exclusive;
|
|
@@ -6193,11 +6273,11 @@ function Oc(e, t) {
|
|
|
6193
6273
|
let t;
|
|
6194
6274
|
return e && (t = {
|
|
6195
6275
|
fromLeft: !1,
|
|
6196
|
-
range: [
|
|
6276
|
+
range: [Nc(r), a]
|
|
6197
6277
|
}), {
|
|
6198
6278
|
left: {
|
|
6199
6279
|
fromLeft: !0,
|
|
6200
|
-
range: [n,
|
|
6280
|
+
range: [n, Nc(i)]
|
|
6201
6281
|
},
|
|
6202
6282
|
center: [i, r],
|
|
6203
6283
|
right: t
|
|
@@ -6207,16 +6287,16 @@ function Oc(e, t) {
|
|
|
6207
6287
|
return {
|
|
6208
6288
|
left: {
|
|
6209
6289
|
fromLeft: !0,
|
|
6210
|
-
range: [n,
|
|
6290
|
+
range: [n, Nc(i)]
|
|
6211
6291
|
},
|
|
6212
6292
|
center: [i, a],
|
|
6213
6293
|
right: {
|
|
6214
6294
|
fromLeft: !0,
|
|
6215
|
-
range: [
|
|
6295
|
+
range: [Nc(a), r]
|
|
6216
6296
|
}
|
|
6217
6297
|
};
|
|
6218
6298
|
}
|
|
6219
|
-
function
|
|
6299
|
+
function jc(e, t) {
|
|
6220
6300
|
let [n, r] = e, [i, a] = t;
|
|
6221
6301
|
if (n.num >= a.num) {
|
|
6222
6302
|
let r = a.exclusive, i = n.exclusive;
|
|
@@ -6241,11 +6321,11 @@ function kc(e, t) {
|
|
|
6241
6321
|
let t;
|
|
6242
6322
|
return e && (t = {
|
|
6243
6323
|
fromLeft: !0,
|
|
6244
|
-
range: [
|
|
6324
|
+
range: [Nc(a), r]
|
|
6245
6325
|
}), {
|
|
6246
6326
|
left: {
|
|
6247
6327
|
fromLeft: !1,
|
|
6248
|
-
range: [i,
|
|
6328
|
+
range: [i, Nc(n)]
|
|
6249
6329
|
},
|
|
6250
6330
|
center: [n, a],
|
|
6251
6331
|
right: t
|
|
@@ -6255,23 +6335,23 @@ function kc(e, t) {
|
|
|
6255
6335
|
return {
|
|
6256
6336
|
left: {
|
|
6257
6337
|
fromLeft: !1,
|
|
6258
|
-
range: [i,
|
|
6338
|
+
range: [i, Nc(n)]
|
|
6259
6339
|
},
|
|
6260
6340
|
center: [n, r],
|
|
6261
6341
|
right: {
|
|
6262
6342
|
fromLeft: !1,
|
|
6263
|
-
range: [
|
|
6343
|
+
range: [Nc(r), a]
|
|
6264
6344
|
}
|
|
6265
6345
|
};
|
|
6266
6346
|
}
|
|
6267
|
-
function
|
|
6347
|
+
function Mc(e, t) {
|
|
6268
6348
|
let [n, r] = e, [i, a] = t, o = n.exclusive, s = i.exclusive, c, l = n;
|
|
6269
6349
|
if (!o && s ? (l = i, c = {
|
|
6270
6350
|
fromLeft: !0,
|
|
6271
|
-
range: [n,
|
|
6351
|
+
range: [n, Nc(i)]
|
|
6272
6352
|
}) : o && !s && (c = {
|
|
6273
6353
|
fromLeft: !1,
|
|
6274
|
-
range: [i,
|
|
6354
|
+
range: [i, Nc(n)]
|
|
6275
6355
|
}), r.num <= a.num) {
|
|
6276
6356
|
let e = !0, t = !1;
|
|
6277
6357
|
if (r.num === a.num) {
|
|
@@ -6282,7 +6362,7 @@ function Ac(e, t) {
|
|
|
6282
6362
|
let t;
|
|
6283
6363
|
return e && (t = {
|
|
6284
6364
|
fromLeft: !1,
|
|
6285
|
-
range: [
|
|
6365
|
+
range: [Nc(r), a]
|
|
6286
6366
|
}), {
|
|
6287
6367
|
left: c,
|
|
6288
6368
|
center: [l, r],
|
|
@@ -6295,11 +6375,11 @@ function Ac(e, t) {
|
|
|
6295
6375
|
center: [l, a],
|
|
6296
6376
|
right: {
|
|
6297
6377
|
fromLeft: !0,
|
|
6298
|
-
range: [
|
|
6378
|
+
range: [Nc(a), r]
|
|
6299
6379
|
}
|
|
6300
6380
|
};
|
|
6301
6381
|
}
|
|
6302
|
-
function
|
|
6382
|
+
function Nc(e) {
|
|
6303
6383
|
return {
|
|
6304
6384
|
num: e.num,
|
|
6305
6385
|
exclusive: !e.exclusive
|
|
@@ -6307,8 +6387,8 @@ function jc(e) {
|
|
|
6307
6387
|
}
|
|
6308
6388
|
//#endregion
|
|
6309
6389
|
//#region src/json-schema-subset/checker/range.ts
|
|
6310
|
-
var
|
|
6311
|
-
let { left: a, center: o, right: s } =
|
|
6390
|
+
var Pc = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
|
|
6391
|
+
let { left: a, center: o, right: s } = kc([{
|
|
6312
6392
|
num: t,
|
|
6313
6393
|
exclusive: !1
|
|
6314
6394
|
}, {
|
|
@@ -6338,24 +6418,24 @@ var Mc = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
|
|
|
6338
6418
|
intersection: u
|
|
6339
6419
|
};
|
|
6340
6420
|
};
|
|
6341
|
-
function
|
|
6421
|
+
function Fc({ left: e, right: t, intersection: n }) {
|
|
6342
6422
|
if (!n) return H.Rejection;
|
|
6343
6423
|
let r = !1, i = !1;
|
|
6344
6424
|
return e && (e.isFrom1 ? r = !0 : i = !0), t && (t.isFrom1 ? r = !0 : i = !0), r && i ? H.Intersection : r ? H.Containing : i ? H.ContainedBy : H.Equals;
|
|
6345
6425
|
}
|
|
6346
6426
|
//#endregion
|
|
6347
6427
|
//#region src/json-schema-subset/checker/array.ts
|
|
6348
|
-
var
|
|
6428
|
+
var Ic = Pc(0), Lc = Ec([
|
|
6349
6429
|
"hasCommon",
|
|
6350
6430
|
"hasExtra1",
|
|
6351
6431
|
"hasExtra2",
|
|
6352
6432
|
"hasRejection",
|
|
6353
6433
|
"hasCommonBroken"
|
|
6354
6434
|
]);
|
|
6355
|
-
function
|
|
6356
|
-
let r =
|
|
6435
|
+
function Rc({ calculate: e }, t, n) {
|
|
6436
|
+
let r = Ic(t.minItems, t.maxItems, n.minItems, n.maxItems), i = Fc(r);
|
|
6357
6437
|
if (i === H.Rejection) return K;
|
|
6358
|
-
let [a, o] =
|
|
6438
|
+
let [a, o] = zc(t), [s, c] = zc(n), l = Math.max(a.length, s.length) + 1, u = Math.min(l, r.intersection.max), d = Lc.variable({}), f = Math.min(t.minItems ?? 0, n.minItems ?? 0);
|
|
6359
6439
|
for (let t = 0; t < u; t++) {
|
|
6360
6440
|
let n = e(a[t] ?? o, s[t] ?? c);
|
|
6361
6441
|
d.push(n, (e, n) => {
|
|
@@ -6395,69 +6475,69 @@ function Ic({ calculate: e }, t, n) {
|
|
|
6395
6475
|
}
|
|
6396
6476
|
return p;
|
|
6397
6477
|
}
|
|
6398
|
-
function
|
|
6399
|
-
return Array.isArray(e) ? [e, t ??
|
|
6478
|
+
function zc({ items: e, additionalItems: t }) {
|
|
6479
|
+
return Array.isArray(e) ? [e, t ?? Ds] : [[], e ?? Ds];
|
|
6400
6480
|
}
|
|
6401
6481
|
//#endregion
|
|
6402
6482
|
//#region src/json-schema-subset/checker/cache.ts
|
|
6403
|
-
function
|
|
6483
|
+
function Bc(e) {
|
|
6404
6484
|
let t = /* @__PURE__ */ new Map();
|
|
6405
6485
|
return (n, r) => {
|
|
6406
|
-
let i =
|
|
6407
|
-
return i ===
|
|
6486
|
+
let i = ks(n);
|
|
6487
|
+
return i === ks(r) ? i ? Hc(t, n, r, e) : n === r : !1;
|
|
6408
6488
|
};
|
|
6409
6489
|
}
|
|
6410
|
-
function
|
|
6490
|
+
function Vc(e) {
|
|
6411
6491
|
let t = /* @__PURE__ */ new Map();
|
|
6412
|
-
return (n, r) =>
|
|
6492
|
+
return (n, r) => Hc(t, n, r, e);
|
|
6413
6493
|
}
|
|
6414
|
-
function
|
|
6415
|
-
let i = `${
|
|
6494
|
+
function Hc(e, t, n, r) {
|
|
6495
|
+
let i = `${js(t)}/${js(n)}`, a = e.get(i);
|
|
6416
6496
|
return a === void 0 && e.set(i, a = r(t, n)), a;
|
|
6417
6497
|
}
|
|
6418
6498
|
//#endregion
|
|
6419
6499
|
//#region src/json-schema-subset/checker/enumAndConst.ts
|
|
6420
|
-
function
|
|
6421
|
-
let r =
|
|
6422
|
-
for (let t of r) if (
|
|
6423
|
-
for (let t of i) if (
|
|
6500
|
+
function Uc(e, t, n) {
|
|
6501
|
+
let r = Gc(t), i = Gc(n), a = !1, o = !1, s = !1;
|
|
6502
|
+
for (let t of r) if (Kc(e, i, t) ? s = !0 : a = !0, a && s) break;
|
|
6503
|
+
for (let t of i) if (Kc(e, r, t) ? s = !0 : o = !0, o && s) break;
|
|
6424
6504
|
return s ? a && o ? q : a ? W : o ? G : U : K;
|
|
6425
6505
|
}
|
|
6426
|
-
function
|
|
6506
|
+
function Wc(e, t) {
|
|
6427
6507
|
let n = !1, r = !1;
|
|
6428
|
-
for (let i of
|
|
6429
|
-
switch (
|
|
6430
|
-
case
|
|
6508
|
+
for (let i of Gc(e)) {
|
|
6509
|
+
switch (qs(t, i)) {
|
|
6510
|
+
case Ks.Valid:
|
|
6431
6511
|
n = !0;
|
|
6432
6512
|
break;
|
|
6433
|
-
case
|
|
6513
|
+
case Ks.Invalid:
|
|
6434
6514
|
r = !0;
|
|
6435
6515
|
break;
|
|
6436
|
-
case
|
|
6516
|
+
case Ks.Unknown: return Wo;
|
|
6437
6517
|
}
|
|
6438
6518
|
if (n && r) break;
|
|
6439
6519
|
}
|
|
6440
6520
|
return n && r ? q : n ? U | G : r ? K : Z(t) === X.Never ? U : G;
|
|
6441
6521
|
}
|
|
6442
|
-
function
|
|
6522
|
+
function Gc({ const: e, enum: t }) {
|
|
6443
6523
|
if (e !== void 0) return [e];
|
|
6444
6524
|
if (t) return t;
|
|
6445
6525
|
throw Error("invalid branch");
|
|
6446
6526
|
}
|
|
6447
|
-
function
|
|
6527
|
+
function Kc({ isEquals: e }, t, n) {
|
|
6448
6528
|
for (let r of t) if (e(r, n)) return !0;
|
|
6449
6529
|
return !1;
|
|
6450
6530
|
}
|
|
6451
6531
|
//#endregion
|
|
6452
6532
|
//#region src/json-schema-subset/checker/equals.ts
|
|
6453
|
-
function
|
|
6533
|
+
function qc(e) {
|
|
6454
6534
|
function t(t, n) {
|
|
6455
6535
|
let i = e.isExtendsSchema(t), a = e.isExtendsSchema(n);
|
|
6456
6536
|
return i || a ? e.equals(t, n) : r(t, n);
|
|
6457
6537
|
}
|
|
6458
6538
|
let n = /* @__PURE__ */ new Map();
|
|
6459
6539
|
function r(e, t) {
|
|
6460
|
-
let r =
|
|
6540
|
+
let r = js(e), a = js(t);
|
|
6461
6541
|
if (r === a) return !0;
|
|
6462
6542
|
let o = `${r}/${a}`, s = n.get(o);
|
|
6463
6543
|
return s === void 0 && (s = i(e, t), n.set(o, s)), s;
|
|
@@ -6474,25 +6554,25 @@ function Gc(e) {
|
|
|
6474
6554
|
return !0;
|
|
6475
6555
|
}
|
|
6476
6556
|
function a(e, t) {
|
|
6477
|
-
return e === t ? !0 : typeof e != "object" || !e || typeof e != typeof t ? !1 :
|
|
6557
|
+
return e === t ? !0 : typeof e != "object" || !e || typeof e != typeof t ? !1 : As(e) && As(t) ? r(e, t) : i(e, t);
|
|
6478
6558
|
}
|
|
6479
6559
|
return t;
|
|
6480
6560
|
}
|
|
6481
6561
|
//#endregion
|
|
6482
6562
|
//#region src/json-schema-subset/checker/numeric/integerNormalizer.ts
|
|
6483
|
-
function
|
|
6484
|
-
let t =
|
|
6563
|
+
function Jc(e) {
|
|
6564
|
+
let t = tl(e), n = e.multipleOf ?? 1, r = Xc(t, n);
|
|
6485
6565
|
return r ? {
|
|
6486
6566
|
multipleOf: n,
|
|
6487
6567
|
range: r
|
|
6488
6568
|
} : null;
|
|
6489
6569
|
}
|
|
6490
|
-
function
|
|
6570
|
+
function Yc([e, t]) {
|
|
6491
6571
|
return !(e.num !== t.num || e.exclusive || t.exclusive);
|
|
6492
6572
|
}
|
|
6493
|
-
function
|
|
6573
|
+
function Xc(e, t) {
|
|
6494
6574
|
if (!e) return;
|
|
6495
|
-
let [n, r] = e, i =
|
|
6575
|
+
let [n, r] = e, i = Zc(n.num, t), a = Qc(r.num, t);
|
|
6496
6576
|
if (i === n.num && n.exclusive && (i += t), a === r.num && r.exclusive && (a -= t), !(i > a) && (i !== a || i !== Infinity && i !== -Infinity)) return [{
|
|
6497
6577
|
num: i,
|
|
6498
6578
|
exclusive: !1
|
|
@@ -6501,29 +6581,29 @@ function Jc(e, t) {
|
|
|
6501
6581
|
exclusive: !1
|
|
6502
6582
|
}];
|
|
6503
6583
|
}
|
|
6504
|
-
function
|
|
6584
|
+
function Zc(e, t) {
|
|
6505
6585
|
return Math.ceil(e / t) * t;
|
|
6506
6586
|
}
|
|
6507
|
-
function
|
|
6587
|
+
function Qc(e, t) {
|
|
6508
6588
|
return Math.floor(e / t) * t;
|
|
6509
6589
|
}
|
|
6510
6590
|
//#endregion
|
|
6511
6591
|
//#region src/json-schema-subset/checker/numeric/float.ts
|
|
6512
|
-
function
|
|
6513
|
-
let { left: n, right: r, center: i } =
|
|
6592
|
+
function $c(e, t) {
|
|
6593
|
+
let { left: n, right: r, center: i } = kc(tl(e), tl(t));
|
|
6514
6594
|
if (!i) return K;
|
|
6515
6595
|
let a = !1, o = !1;
|
|
6516
6596
|
return n && (n.fromLeft ? a = !0 : o = !0), r && (r.fromLeft ? a = !0 : o = !0), a && o ? q : a ? W : o ? G : U;
|
|
6517
6597
|
}
|
|
6518
|
-
function
|
|
6519
|
-
let n =
|
|
6598
|
+
function el(e, t) {
|
|
6599
|
+
let n = tl(e), r = Jc(t);
|
|
6520
6600
|
if (!r) return W;
|
|
6521
|
-
let i =
|
|
6601
|
+
let i = kc(n, r.range), a = Xc(i.center, r.multipleOf), o = nl(i.left, r.multipleOf), s = nl(i.right, r.multipleOf);
|
|
6522
6602
|
if (!i.center) return K;
|
|
6523
6603
|
let c = !1, l = !1;
|
|
6524
|
-
return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !
|
|
6604
|
+
return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !Yc(i.center)) && (c = !0), o && (l = !0), s && (l = !0), c && l ? q : c ? W : l ? G : U;
|
|
6525
6605
|
}
|
|
6526
|
-
function
|
|
6606
|
+
function tl(e) {
|
|
6527
6607
|
let t, n;
|
|
6528
6608
|
return t = e.exclusiveMinimum === void 0 ? e.minimum === void 0 ? {
|
|
6529
6609
|
num: -Infinity,
|
|
@@ -6545,84 +6625,84 @@ function $c(e) {
|
|
|
6545
6625
|
exclusive: !0
|
|
6546
6626
|
}, [t, n];
|
|
6547
6627
|
}
|
|
6548
|
-
function
|
|
6549
|
-
if (e && !e.fromLeft) return
|
|
6628
|
+
function nl(e, t) {
|
|
6629
|
+
if (e && !e.fromLeft) return Xc(e.range, t);
|
|
6550
6630
|
}
|
|
6551
6631
|
//#endregion
|
|
6552
6632
|
//#region src/json-schema-subset/checker/numeric/integer.ts
|
|
6553
|
-
function
|
|
6554
|
-
let n =
|
|
6633
|
+
function rl(e, t) {
|
|
6634
|
+
let n = Jc(e), r = Jc(t);
|
|
6555
6635
|
if (!n && !r) return U;
|
|
6556
6636
|
if (!n) return G;
|
|
6557
6637
|
if (!r) return W;
|
|
6558
|
-
let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c =
|
|
6559
|
-
if (c.center && (u =
|
|
6638
|
+
let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c = kc(i, o), l, u = 0;
|
|
6639
|
+
if (c.center && (u = al(a, s), l = Xc(c.center, u)), !l) return K;
|
|
6560
6640
|
let d = !1, f = !1, { left: p, right: m } = c;
|
|
6561
|
-
return p &&
|
|
6641
|
+
return p && Xc(p.range, p.fromLeft ? a : s) && (p.fromLeft ? d = !0 : f = !0), m && Xc(m.range, m.fromLeft ? a : s) && (m.fromLeft ? d = !0 : f = !0), d ||= il(n, l, u), f ||= il(r, l, u), d && f ? q : d ? W : f ? G : U;
|
|
6562
6642
|
}
|
|
6563
|
-
function
|
|
6564
|
-
let i =
|
|
6565
|
-
if (
|
|
6566
|
-
let a =
|
|
6643
|
+
function il({ range: e, multipleOf: t }, n, r) {
|
|
6644
|
+
let i = kc(e, n);
|
|
6645
|
+
if (Xc(i.left?.range, t) || Xc(i.right?.range, t)) return !0;
|
|
6646
|
+
let a = Xc(i.center, t);
|
|
6567
6647
|
if (!a) return !1;
|
|
6568
|
-
let o =
|
|
6569
|
-
return
|
|
6648
|
+
let o = sl(n);
|
|
6649
|
+
return sl(a) > o || o !== 1 && t < r;
|
|
6570
6650
|
}
|
|
6571
|
-
function
|
|
6572
|
-
return e * t /
|
|
6651
|
+
function al(e, t) {
|
|
6652
|
+
return e * t / ol(e, t);
|
|
6573
6653
|
}
|
|
6574
|
-
function
|
|
6575
|
-
return e === 0 ? t :
|
|
6654
|
+
function ol(e, t) {
|
|
6655
|
+
return e === 0 ? t : ol(t % e, e);
|
|
6576
6656
|
}
|
|
6577
|
-
function
|
|
6657
|
+
function sl(e) {
|
|
6578
6658
|
if (!e) return 0;
|
|
6579
6659
|
let [t, n] = e;
|
|
6580
6660
|
return n.num - t.num + 1;
|
|
6581
6661
|
}
|
|
6582
6662
|
//#endregion
|
|
6583
6663
|
//#region src/json-schema-subset/checker/numeric/checker.ts
|
|
6584
|
-
function
|
|
6585
|
-
if (
|
|
6586
|
-
let n =
|
|
6587
|
-
return n && r ?
|
|
6664
|
+
function cl(e, t) {
|
|
6665
|
+
if (ll(e) || ll(t)) return Wo;
|
|
6666
|
+
let n = ul(e), r = ul(t);
|
|
6667
|
+
return n && r ? $c(e, t) : n ? el(e, t) : r ? es(el(t, e)) : rl(e, t);
|
|
6588
6668
|
}
|
|
6589
|
-
function
|
|
6669
|
+
function ll(e) {
|
|
6590
6670
|
let { multipleOf: t } = e;
|
|
6591
6671
|
return t === void 0 ? !1 : !Number.isInteger(t) || t < 0;
|
|
6592
6672
|
}
|
|
6593
|
-
function
|
|
6673
|
+
function ul(e) {
|
|
6594
6674
|
let { multipleOf: t } = e;
|
|
6595
6675
|
return !(t !== void 0 && Number.isInteger(t) || e.type === "integer");
|
|
6596
6676
|
}
|
|
6597
6677
|
//#endregion
|
|
6598
6678
|
//#region src/json-schema-subset/checker/object.ts
|
|
6599
|
-
var
|
|
6679
|
+
var dl = Pc(0), fl = Ec([
|
|
6600
6680
|
"hasCommonInRequired",
|
|
6601
6681
|
"hasCommonOutRequired",
|
|
6602
6682
|
"hasExtra1",
|
|
6603
6683
|
"hasExtra2",
|
|
6604
6684
|
"hasRejection"
|
|
6605
6685
|
]);
|
|
6606
|
-
function
|
|
6607
|
-
if (
|
|
6608
|
-
let r =
|
|
6686
|
+
function pl(e, t, n) {
|
|
6687
|
+
if (ml(t, n)) return K;
|
|
6688
|
+
let r = hl(t, n);
|
|
6609
6689
|
if (!r) return K;
|
|
6610
|
-
let i =
|
|
6690
|
+
let i = xl(t), a = xl(n), o = (t) => {
|
|
6611
6691
|
let n = i(t), r = a(t);
|
|
6612
|
-
return
|
|
6613
|
-
}, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u =
|
|
6614
|
-
for (let e of [...s].toSorted()) u.push(o(e),
|
|
6615
|
-
for (let e of [...c].toSorted()) u.push(o(e),
|
|
6616
|
-
for (let e of [...l].toSorted()) u.push(o(e),
|
|
6692
|
+
return Sl(n, r) ? e.calculate(n, r) : 0;
|
|
6693
|
+
}, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u = fl.variable({});
|
|
6694
|
+
for (let e of [...s].toSorted()) u.push(o(e), _l);
|
|
6695
|
+
for (let e of [...c].toSorted()) u.push(o(e), vl);
|
|
6696
|
+
for (let e of [...l].toSorted()) u.push(o(e), yl);
|
|
6617
6697
|
let { hasOptional1: d, hasOptional2: f } = r;
|
|
6618
6698
|
if (d || f) {
|
|
6619
|
-
let r =
|
|
6620
|
-
for (let e of [...
|
|
6699
|
+
let r = bl(d, f);
|
|
6700
|
+
for (let e of [...gl(t, n)].toSorted()) {
|
|
6621
6701
|
let t = o(e);
|
|
6622
6702
|
t !== 0 && u.push(t, r);
|
|
6623
6703
|
}
|
|
6624
|
-
let i = t.additionalProperties ??
|
|
6625
|
-
if (
|
|
6704
|
+
let i = t.additionalProperties ?? Ds, a = n.additionalProperties ?? Ds;
|
|
6705
|
+
if (Sl(i, a)) {
|
|
6626
6706
|
let t = e.calculate(i, a);
|
|
6627
6707
|
u.push(t, r);
|
|
6628
6708
|
}
|
|
@@ -6634,10 +6714,10 @@ function dl(e, t, n) {
|
|
|
6634
6714
|
for (let { hasExtra1: e, hasExtra2: t, hasCommonInRequired: n, hasCommonOutRequired: r, hasRejection: i } of u) m |= !n && p > 0 || !r && p === 0 || i ? K : e && t ? q : e ? W : t ? G : U;
|
|
6635
6715
|
return m;
|
|
6636
6716
|
}
|
|
6637
|
-
function
|
|
6638
|
-
return
|
|
6717
|
+
function ml(e, t) {
|
|
6718
|
+
return Fc(dl(e.minProperties, e.maxProperties, t.minProperties, t.maxProperties)) === H.Rejection;
|
|
6639
6719
|
}
|
|
6640
|
-
function
|
|
6720
|
+
function hl(e, t) {
|
|
6641
6721
|
let n = new Set(e.required), r = new Set(t.required), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = n.size, s = r.size;
|
|
6642
6722
|
for (let e of n) r.has(e) && i.add(e), a.add(e);
|
|
6643
6723
|
for (let e of r) n.has(e) && i.add(e), a.add(e);
|
|
@@ -6653,7 +6733,7 @@ function pl(e, t) {
|
|
|
6653
6733
|
hasOptional2: u > s
|
|
6654
6734
|
};
|
|
6655
6735
|
}
|
|
6656
|
-
function
|
|
6736
|
+
function gl(e, t) {
|
|
6657
6737
|
let n = new Set(e.required), r = e.properties, i = t.properties, a = e.required, o = t.required;
|
|
6658
6738
|
if (r) for (let e in r) n.add(e);
|
|
6659
6739
|
if (i) for (let e in i) n.add(e);
|
|
@@ -6661,7 +6741,7 @@ function ml(e, t) {
|
|
|
6661
6741
|
if (o) for (let e of o) n.delete(e);
|
|
6662
6742
|
return n;
|
|
6663
6743
|
}
|
|
6664
|
-
var
|
|
6744
|
+
var _l = (e, t) => {
|
|
6665
6745
|
switch (e) {
|
|
6666
6746
|
case H.Equals:
|
|
6667
6747
|
t.hasCommonInRequired = !0;
|
|
@@ -6677,7 +6757,7 @@ var hl = (e, t) => {
|
|
|
6677
6757
|
break;
|
|
6678
6758
|
case H.Rejection: t.hasRejection = !0;
|
|
6679
6759
|
}
|
|
6680
|
-
},
|
|
6760
|
+
}, vl = (e, t) => {
|
|
6681
6761
|
switch (e) {
|
|
6682
6762
|
case H.Equals:
|
|
6683
6763
|
case H.ContainedBy:
|
|
@@ -6689,7 +6769,7 @@ var hl = (e, t) => {
|
|
|
6689
6769
|
break;
|
|
6690
6770
|
case H.Rejection: t.hasRejection = !0;
|
|
6691
6771
|
}
|
|
6692
|
-
},
|
|
6772
|
+
}, yl = (e, t) => {
|
|
6693
6773
|
switch (e) {
|
|
6694
6774
|
case H.Equals:
|
|
6695
6775
|
case H.Containing:
|
|
@@ -6701,7 +6781,7 @@ var hl = (e, t) => {
|
|
|
6701
6781
|
break;
|
|
6702
6782
|
case H.Rejection: t.hasRejection = !0;
|
|
6703
6783
|
}
|
|
6704
|
-
},
|
|
6784
|
+
}, bl = (e, t) => (n, r) => {
|
|
6705
6785
|
if (r.hasRejection) return;
|
|
6706
6786
|
let i = !1, a = !1, o = !1;
|
|
6707
6787
|
switch (n) {
|
|
@@ -6721,7 +6801,7 @@ var hl = (e, t) => {
|
|
|
6721
6801
|
}
|
|
6722
6802
|
e && i && (r.hasExtra1 = !0), t && a && (r.hasExtra2 = !0), e && t && o && (r.hasCommonOutRequired = !0);
|
|
6723
6803
|
};
|
|
6724
|
-
function
|
|
6804
|
+
function xl(e) {
|
|
6725
6805
|
let t = e.properties, n = e.propertyNames, r = e.additionalProperties, i = [];
|
|
6726
6806
|
if (e.patternProperties) for (let t in e.patternProperties) {
|
|
6727
6807
|
let n = e.patternProperties[t], r = new RegExp(t, "i");
|
|
@@ -6731,39 +6811,39 @@ function yl(e) {
|
|
|
6731
6811
|
});
|
|
6732
6812
|
}
|
|
6733
6813
|
return (e) => {
|
|
6734
|
-
if (n &&
|
|
6814
|
+
if (n && qs(n, e) === Ks.Invalid) return Os;
|
|
6735
6815
|
for (let { pattern: t, schema: n } of i) if (t.test(e)) return n;
|
|
6736
|
-
return ((t && t[e]) ?? r) ||
|
|
6816
|
+
return ((t && t[e]) ?? r) || Ds;
|
|
6737
6817
|
};
|
|
6738
6818
|
}
|
|
6739
|
-
function
|
|
6819
|
+
function Sl(e, t) {
|
|
6740
6820
|
let n = Z(e), r = Z(t);
|
|
6741
6821
|
return n !== X.Never || r !== X.Never;
|
|
6742
6822
|
}
|
|
6743
6823
|
//#endregion
|
|
6744
6824
|
//#region src/json-schema-subset/checker/string.ts
|
|
6745
|
-
var
|
|
6746
|
-
function
|
|
6747
|
-
let n =
|
|
6825
|
+
var Cl = Pc(0);
|
|
6826
|
+
function wl(e, t) {
|
|
6827
|
+
let n = Fc(Cl(e.minLength, e.maxLength, t.minLength, t.maxLength)), r = !!e.pattern, i = !!t.pattern;
|
|
6748
6828
|
switch (n) {
|
|
6749
6829
|
case H.Rejection: return K;
|
|
6750
|
-
case H.Containing: return r ?
|
|
6751
|
-
case H.ContainedBy: return i ?
|
|
6752
|
-
case H.Equals: return r && i ? e.pattern === t.pattern ? U :
|
|
6753
|
-
case H.Intersection: return r && i ?
|
|
6830
|
+
case H.Containing: return r ? Wo : W;
|
|
6831
|
+
case H.ContainedBy: return i ? Wo : G;
|
|
6832
|
+
case H.Equals: return r && i ? e.pattern === t.pattern ? U : Wo : r ? U | G : i ? U | W : U;
|
|
6833
|
+
case H.Intersection: return r && i ? Wo : r ? q | K | G : i ? q | K | W : q;
|
|
6754
6834
|
}
|
|
6755
6835
|
}
|
|
6756
6836
|
//#endregion
|
|
6757
6837
|
//#region src/json-schema-subset/checker/checker.ts
|
|
6758
|
-
function
|
|
6759
|
-
let r = {}, i = [], a =
|
|
6760
|
-
r.isEquals =
|
|
6838
|
+
function Tl(e, t, n) {
|
|
6839
|
+
let r = {}, i = [], a = Vc(Dl(e, r)), o = El(), s = qc(e);
|
|
6840
|
+
r.isEquals = Bc(Ho), r.calculate = ls({
|
|
6761
6841
|
describe: o,
|
|
6762
6842
|
equals: s,
|
|
6763
6843
|
calculate: a,
|
|
6764
6844
|
observeCalculation: (e, t, n, r) => {
|
|
6765
|
-
if (!
|
|
6766
|
-
let a = r ?
|
|
6845
|
+
if (!kl(r ? es(n) : n)) return;
|
|
6846
|
+
let a = r ? Al(t, e) : Al(e, t);
|
|
6767
6847
|
a && i.push(a);
|
|
6768
6848
|
}
|
|
6769
6849
|
}), Object.freeze(r);
|
|
@@ -6773,34 +6853,34 @@ function Cl(e, t, n) {
|
|
|
6773
6853
|
expression: c
|
|
6774
6854
|
};
|
|
6775
6855
|
}
|
|
6776
|
-
var
|
|
6856
|
+
var El = () => (e) => {
|
|
6777
6857
|
let t;
|
|
6778
6858
|
switch (Z(e)) {
|
|
6779
6859
|
case X.Not:
|
|
6780
6860
|
t = {
|
|
6781
|
-
kind:
|
|
6861
|
+
kind: cs.Not,
|
|
6782
6862
|
expression: e.not
|
|
6783
6863
|
};
|
|
6784
6864
|
break;
|
|
6785
6865
|
case X.Combination:
|
|
6786
6866
|
if ("allOf" in e) t = {
|
|
6787
|
-
kind:
|
|
6788
|
-
expressions:
|
|
6867
|
+
kind: cs.AllOf,
|
|
6868
|
+
expressions: Ol(e.allOf, X.Any)
|
|
6789
6869
|
};
|
|
6790
6870
|
else if ("anyOf" in e) t = {
|
|
6791
|
-
kind:
|
|
6792
|
-
expressions:
|
|
6871
|
+
kind: cs.AnyOf,
|
|
6872
|
+
expressions: Ol(e.anyOf, X.Never)
|
|
6793
6873
|
};
|
|
6794
6874
|
else if ("oneOf" in e) t = {
|
|
6795
|
-
kind:
|
|
6796
|
-
expressions:
|
|
6875
|
+
kind: cs.OneOf,
|
|
6876
|
+
expressions: Ol(e.oneOf, X.Never)
|
|
6797
6877
|
};
|
|
6798
6878
|
else throw Error(`invalid combination JSON Schema: ${JSON.stringify(e)}`);
|
|
6799
6879
|
break;
|
|
6800
|
-
default: t = { kind:
|
|
6880
|
+
default: t = { kind: cs.Leaf };
|
|
6801
6881
|
}
|
|
6802
6882
|
return t;
|
|
6803
|
-
},
|
|
6883
|
+
}, Dl = (e, t) => (n, r) => {
|
|
6804
6884
|
let i = Z(n), a = Z(r);
|
|
6805
6885
|
if (i === X.Extends || a === X.Extends) return e.calculate(n, r);
|
|
6806
6886
|
switch (i) {
|
|
@@ -6811,28 +6891,28 @@ var wl = () => (e) => {
|
|
|
6811
6891
|
case X.Any: return G;
|
|
6812
6892
|
case X.Never: return W;
|
|
6813
6893
|
}
|
|
6814
|
-
if (i === X.EnumOrConst && a === X.EnumOrConst) return
|
|
6815
|
-
if (i === X.EnumOrConst) return
|
|
6816
|
-
if (a === X.EnumOrConst) return
|
|
6894
|
+
if (i === X.EnumOrConst && a === X.EnumOrConst) return Uc(t, n, r);
|
|
6895
|
+
if (i === X.EnumOrConst) return Wc(n, r);
|
|
6896
|
+
if (a === X.EnumOrConst) return es(Wc(r, n));
|
|
6817
6897
|
if (i !== a) return K;
|
|
6818
6898
|
switch (i) {
|
|
6819
6899
|
case X.Null: return U;
|
|
6820
|
-
case X.Numeric: return
|
|
6821
|
-
case X.String: return
|
|
6900
|
+
case X.Numeric: return cl(n, r);
|
|
6901
|
+
case X.String: return wl(n, r);
|
|
6822
6902
|
case X.Boolean: return U;
|
|
6823
|
-
case X.Object: return
|
|
6824
|
-
case X.Array: return
|
|
6903
|
+
case X.Object: return pl(t, n, r);
|
|
6904
|
+
case X.Array: return Rc(t, n, r);
|
|
6825
6905
|
default: throw Error(`invalid kind ${i}`);
|
|
6826
6906
|
}
|
|
6827
6907
|
};
|
|
6828
|
-
function
|
|
6908
|
+
function Ol(e, t) {
|
|
6829
6909
|
return e.filter((e) => Z(e) !== t);
|
|
6830
6910
|
}
|
|
6831
|
-
function
|
|
6832
|
-
return !
|
|
6911
|
+
function kl(e) {
|
|
6912
|
+
return !Go(e) && !qo(e) && (Ko(e) || Yo(e) || Jo(e));
|
|
6833
6913
|
}
|
|
6834
|
-
function
|
|
6835
|
-
let n =
|
|
6914
|
+
function Al(e, t) {
|
|
6915
|
+
let n = Ms(t);
|
|
6836
6916
|
if (!n) return;
|
|
6837
6917
|
let r = Z(e), i = Z(t);
|
|
6838
6918
|
if (r !== i) return [...n, "type"];
|
|
@@ -6865,12 +6945,12 @@ function Ol(e, t) {
|
|
|
6865
6945
|
}
|
|
6866
6946
|
//#endregion
|
|
6867
6947
|
//#region src/json-schema-subset/extends/extendsContext.ts
|
|
6868
|
-
var
|
|
6948
|
+
var jl = class e {
|
|
6869
6949
|
constructor(e = []) {
|
|
6870
6950
|
this.extendsSchemaClasses = Object.freeze([...e]);
|
|
6871
6951
|
}
|
|
6872
6952
|
tryCompiledExtendsSchema(e, t) {
|
|
6873
|
-
for (let n of this.extendsSchemaClasses) if (n.isMatch(e)) return new n(
|
|
6953
|
+
for (let n of this.extendsSchemaClasses) if (n.isMatch(e)) return new n(Ro(), e, t);
|
|
6874
6954
|
return null;
|
|
6875
6955
|
}
|
|
6876
6956
|
isExtendsSchema(e) {
|
|
@@ -6880,7 +6960,7 @@ var kl = class e {
|
|
|
6880
6960
|
calculate(t, n) {
|
|
6881
6961
|
let r = !(t instanceof this.findMatchedClass(t, n)), i = 0, a;
|
|
6882
6962
|
a = r ? n.compare(t) : t.compare(n);
|
|
6883
|
-
for (let t of a) r && (t = e.swap(t)), i |=
|
|
6963
|
+
for (let t of a) r && (t = e.swap(t)), i |= Xo(t);
|
|
6884
6964
|
return i;
|
|
6885
6965
|
}
|
|
6886
6966
|
equals(e, t) {
|
|
@@ -6900,35 +6980,35 @@ var kl = class e {
|
|
|
6900
6980
|
};
|
|
6901
6981
|
//#endregion
|
|
6902
6982
|
//#region src/json-schema-subset/preprocessing.ts
|
|
6903
|
-
function
|
|
6983
|
+
function Ml(e, t, n = !1) {
|
|
6904
6984
|
let r = t(e);
|
|
6905
6985
|
if (Array.isArray(r)) {
|
|
6906
6986
|
let e = [];
|
|
6907
|
-
throw
|
|
6987
|
+
throw Pl(e, r, "$"), new us(e);
|
|
6908
6988
|
}
|
|
6909
6989
|
let { schema: i, warns: a } = r;
|
|
6910
6990
|
if (n && a.length > 0) {
|
|
6911
6991
|
console.warn(`found ${a.length} warns after compile schema`);
|
|
6912
|
-
for (let e of a) console.warn(
|
|
6992
|
+
for (let e of a) console.warn(fs(e));
|
|
6913
6993
|
}
|
|
6914
6994
|
return i;
|
|
6915
6995
|
}
|
|
6916
|
-
function
|
|
6996
|
+
function Nl(e, t, n, r = !1) {
|
|
6917
6997
|
let i = n(e), a = n(t);
|
|
6918
6998
|
if (Array.isArray(i) || Array.isArray(a)) {
|
|
6919
6999
|
let e = [];
|
|
6920
|
-
throw Array.isArray(i) &&
|
|
7000
|
+
throw Array.isArray(i) && Pl(e, i, "$1"), Array.isArray(a) && Pl(e, a, "$2"), new us(e);
|
|
6921
7001
|
}
|
|
6922
7002
|
let { schema: o, warns: s } = i, { schema: c, warns: l } = a;
|
|
6923
7003
|
if (r) {
|
|
6924
7004
|
s.length > 0 && console.warn(`found ${s.length} warns after compile superSchema`);
|
|
6925
|
-
for (let e of s) console.warn(
|
|
7005
|
+
for (let e of s) console.warn(fs(e));
|
|
6926
7006
|
l.length > 0 && console.warn(`found ${l.length} warns after compile subSchema`);
|
|
6927
|
-
for (let e of l) console.warn(
|
|
7007
|
+
for (let e of l) console.warn(fs(e));
|
|
6928
7008
|
}
|
|
6929
7009
|
return [o, c];
|
|
6930
7010
|
}
|
|
6931
|
-
function
|
|
7011
|
+
function Pl(e, t, n) {
|
|
6932
7012
|
for (let r of t) {
|
|
6933
7013
|
let t = {
|
|
6934
7014
|
...r,
|
|
@@ -6939,61 +7019,61 @@ function Ml(e, t, n) {
|
|
|
6939
7019
|
}
|
|
6940
7020
|
//#endregion
|
|
6941
7021
|
//#region src/json-schema-subset/global.ts
|
|
6942
|
-
var
|
|
7022
|
+
var Fl = Object.freeze({
|
|
6943
7023
|
True: 0,
|
|
6944
7024
|
False: 1,
|
|
6945
7025
|
Unknown: 2
|
|
6946
7026
|
});
|
|
6947
|
-
function
|
|
6948
|
-
let n = new
|
|
7027
|
+
function Il({ extendsSchemaClasses: e, delegate: t } = {}) {
|
|
7028
|
+
let n = new jl(e);
|
|
6949
7029
|
return Object.freeze({
|
|
6950
|
-
compile: (e, r, i) =>
|
|
7030
|
+
compile: (e, r, i) => Ml(e, (e) => bc(e, n, r, t), i),
|
|
6951
7031
|
isSubset: (e, r, i = !1) => {
|
|
6952
|
-
let [a, o] =
|
|
6953
|
-
return l && !u ? { result:
|
|
7032
|
+
let [a, o] = Nl(e, r, (e) => bc(e, n, void 0, t), i), { errorPath: s, expression: c } = Tl(n, a, o), l = Go(c) || qo(c), u = Ko(c) || Yo(c) || Jo(c);
|
|
7033
|
+
return l && !u ? { result: Fl.True } : !l && u ? {
|
|
6954
7034
|
errorPath: s,
|
|
6955
|
-
result:
|
|
6956
|
-
} : { result:
|
|
7035
|
+
result: Fl.False
|
|
7036
|
+
} : { result: Fl.Unknown };
|
|
6957
7037
|
}
|
|
6958
7038
|
});
|
|
6959
7039
|
}
|
|
6960
7040
|
//#endregion
|
|
6961
7041
|
//#region src/manifest/common/schemaComparer.ts
|
|
6962
|
-
function
|
|
7042
|
+
function Ll(e) {
|
|
6963
7043
|
return qt(e)?.type === "string";
|
|
6964
7044
|
}
|
|
6965
|
-
function
|
|
6966
|
-
return e instanceof
|
|
7045
|
+
function Rl(e) {
|
|
7046
|
+
return e instanceof Gl || qt(e)?.type === "array";
|
|
6967
7047
|
}
|
|
6968
|
-
function
|
|
7048
|
+
function zl(e) {
|
|
6969
7049
|
let t = qt(e);
|
|
6970
7050
|
return t?.type === "array" && qt(t.items)?.type === "string";
|
|
6971
7051
|
}
|
|
6972
|
-
function
|
|
7052
|
+
function Bl(e) {
|
|
6973
7053
|
let t = qt(e);
|
|
6974
7054
|
return t != null && Object.keys(t).length === 0;
|
|
6975
7055
|
}
|
|
6976
|
-
function
|
|
7056
|
+
function Vl(e) {
|
|
6977
7057
|
let t = qt(e), n = qt(t?.error);
|
|
6978
7058
|
if (t == null || n == null || t.packageId != null && !Kt(t.packageId) || n.message != null && !Kt(n.message)) throw TypeError("Invalid schema comparison context.");
|
|
6979
7059
|
}
|
|
6980
|
-
function
|
|
6981
|
-
return e == null ? { error: {} } : (
|
|
7060
|
+
function Hl(e) {
|
|
7061
|
+
return e == null ? { error: {} } : (Vl(e), e);
|
|
6982
7062
|
}
|
|
6983
|
-
var
|
|
7063
|
+
var Ul = class e {
|
|
6984
7064
|
static setError(t, n, r) {
|
|
6985
7065
|
t instanceof e ? t.context.error.message = r : n instanceof e && (n.context.error.message = r);
|
|
6986
7066
|
}
|
|
6987
7067
|
constructor(e, t, n) {
|
|
6988
|
-
this.id = e, this.value = t, this.context =
|
|
7068
|
+
this.id = e, this.value = t, this.context = Hl(n);
|
|
6989
7069
|
}
|
|
6990
7070
|
compare(e) {
|
|
6991
7071
|
return this.passThrough(e) || this.compareImpl(e);
|
|
6992
7072
|
}
|
|
6993
7073
|
passThrough(e) {
|
|
6994
|
-
if (e instanceof
|
|
7074
|
+
if (e instanceof ql) return [H.Equals];
|
|
6995
7075
|
}
|
|
6996
|
-
},
|
|
7076
|
+
}, Wl = class e extends Ul {
|
|
6997
7077
|
static isMatch(e) {
|
|
6998
7078
|
let t = qt(e)?.enum;
|
|
6999
7079
|
return Array.isArray(t) && t.every((e) => Kt(e));
|
|
@@ -7003,7 +7083,7 @@ var Vl = class e {
|
|
|
7003
7083
|
super(t, n, r);
|
|
7004
7084
|
}
|
|
7005
7085
|
compareImpl(t) {
|
|
7006
|
-
if (
|
|
7086
|
+
if (Ll(t)) return [H.ContainedBy];
|
|
7007
7087
|
if (t instanceof e) {
|
|
7008
7088
|
let e = new Set(this.value.enum), n = H.Equals;
|
|
7009
7089
|
for (let r of t.value.enum) e.has(r) || (n = H.ContainedBy), e.delete(r);
|
|
@@ -7022,7 +7102,7 @@ var Vl = class e {
|
|
|
7022
7102
|
}
|
|
7023
7103
|
return !1;
|
|
7024
7104
|
}
|
|
7025
|
-
},
|
|
7105
|
+
}, Gl = class e extends Ul {
|
|
7026
7106
|
static isMatch(e) {
|
|
7027
7107
|
let t = qt(e), n = qt(t?.items)?.enum;
|
|
7028
7108
|
return t?.type === "array" && t.uniqueItems === !0 && Array.isArray(n) && n.every((e) => Kt(e));
|
|
@@ -7032,7 +7112,7 @@ var Vl = class e {
|
|
|
7032
7112
|
super(t, n, r);
|
|
7033
7113
|
}
|
|
7034
7114
|
compareImpl(t) {
|
|
7035
|
-
if (t instanceof
|
|
7115
|
+
if (t instanceof Kl || zl(t)) return [H.ContainedBy];
|
|
7036
7116
|
if (t instanceof e) {
|
|
7037
7117
|
let e = new Set(this.value.items.enum), n = H.Equals;
|
|
7038
7118
|
for (let r of t.value.items.enum) e.has(r) || (n = H.ContainedBy), e.delete(r);
|
|
@@ -7051,24 +7131,24 @@ var Vl = class e {
|
|
|
7051
7131
|
}
|
|
7052
7132
|
return !1;
|
|
7053
7133
|
}
|
|
7054
|
-
},
|
|
7134
|
+
}, Kl = class e extends Ul {
|
|
7055
7135
|
static isMatch(e) {
|
|
7056
7136
|
let t = qt(e);
|
|
7057
|
-
return t?.type === "array" && !t.uniqueItems && (!Jt(t.items) ||
|
|
7137
|
+
return t?.type === "array" && !t.uniqueItems && (!Jt(t.items) || Bl(t.items));
|
|
7058
7138
|
}
|
|
7059
7139
|
constructor(t, n, r) {
|
|
7060
7140
|
if (!e.isMatch(n)) throw TypeError("Invalid array schema.");
|
|
7061
7141
|
super(t, n, r);
|
|
7062
7142
|
}
|
|
7063
7143
|
compareImpl(t) {
|
|
7064
|
-
return t instanceof e ||
|
|
7144
|
+
return t instanceof e || Rl(t) ? [H.Equals] : [H.Rejection];
|
|
7065
7145
|
}
|
|
7066
7146
|
equals(t) {
|
|
7067
7147
|
return t instanceof e;
|
|
7068
7148
|
}
|
|
7069
|
-
},
|
|
7149
|
+
}, ql = class e extends Ul {
|
|
7070
7150
|
static isMatch(e) {
|
|
7071
|
-
return
|
|
7151
|
+
return Bl(e);
|
|
7072
7152
|
}
|
|
7073
7153
|
constructor(t, n, r) {
|
|
7074
7154
|
if (!e.isMatch(n)) throw TypeError("Invalid empty schema.");
|
|
@@ -7080,7 +7160,7 @@ var Vl = class e {
|
|
|
7080
7160
|
equals(e) {
|
|
7081
7161
|
return !0;
|
|
7082
7162
|
}
|
|
7083
|
-
},
|
|
7163
|
+
}, Jl = class e extends Ul {
|
|
7084
7164
|
static isMatch(e) {
|
|
7085
7165
|
return qt(e)?.contentMediaType === "oomol/bin";
|
|
7086
7166
|
}
|
|
@@ -7089,12 +7169,12 @@ var Vl = class e {
|
|
|
7089
7169
|
super(t, n, r);
|
|
7090
7170
|
}
|
|
7091
7171
|
compareImpl(t) {
|
|
7092
|
-
return t instanceof e ? [H.Equals] : (
|
|
7172
|
+
return t instanceof e ? [H.Equals] : (Ul.setError(this, t, "edgeError.binDiffType"), [H.Rejection]);
|
|
7093
7173
|
}
|
|
7094
7174
|
equals(t) {
|
|
7095
7175
|
return t instanceof e;
|
|
7096
7176
|
}
|
|
7097
|
-
},
|
|
7177
|
+
}, Yl = class e extends Ul {
|
|
7098
7178
|
static isMatch(e) {
|
|
7099
7179
|
return qt(e)?.contentMediaType === "oomol/artifact";
|
|
7100
7180
|
}
|
|
@@ -7103,41 +7183,41 @@ var Vl = class e {
|
|
|
7103
7183
|
super(t, n, r);
|
|
7104
7184
|
}
|
|
7105
7185
|
compareImpl(t) {
|
|
7106
|
-
return t instanceof e ? [H.Equals] : (
|
|
7186
|
+
return t instanceof e ? [H.Equals] : (Ul.setError(this, t, "edgeError.artifactDiffType"), [H.Rejection]);
|
|
7107
7187
|
}
|
|
7108
7188
|
equals(t) {
|
|
7109
7189
|
return t instanceof e;
|
|
7110
7190
|
}
|
|
7111
7191
|
};
|
|
7112
|
-
function
|
|
7113
|
-
return
|
|
7192
|
+
function Xl() {
|
|
7193
|
+
return Il({ extendsSchemaClasses: [
|
|
7194
|
+
Kl,
|
|
7195
|
+
ql,
|
|
7114
7196
|
Wl,
|
|
7115
7197
|
Gl,
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
Kl,
|
|
7119
|
-
ql
|
|
7198
|
+
Jl,
|
|
7199
|
+
Yl
|
|
7120
7200
|
] });
|
|
7121
7201
|
}
|
|
7122
7202
|
//#endregion
|
|
7123
7203
|
//#region src/manifest/common/schemaCompare.ts
|
|
7124
|
-
var
|
|
7125
|
-
function
|
|
7204
|
+
var Zl = Xl();
|
|
7205
|
+
function Ql(e, t) {
|
|
7126
7206
|
return t ? { anyOf: [e, { type: "null" }] } : e;
|
|
7127
7207
|
}
|
|
7128
|
-
function
|
|
7208
|
+
function $l(e, t) {
|
|
7129
7209
|
return e == null || !t || e.length === 0 || e[0] !== "anyOf" ? e : e[1] === 0 ? e.slice(2) : void 0;
|
|
7130
7210
|
}
|
|
7131
|
-
function
|
|
7211
|
+
function eu(e, t) {
|
|
7132
7212
|
try {
|
|
7133
|
-
let n = {}, r =
|
|
7213
|
+
let n = {}, r = Zl.compile(Ql(tu(e.schema), e.nullable), {
|
|
7134
7214
|
...e,
|
|
7135
7215
|
error: n
|
|
7136
|
-
}), i =
|
|
7216
|
+
}), i = Zl.compile(Ql(tu(t.schema), t.nullable), {
|
|
7137
7217
|
...t,
|
|
7138
7218
|
error: n
|
|
7139
|
-
}), { result: a, errorPath: o } =
|
|
7140
|
-
return a ==
|
|
7219
|
+
}), { result: a, errorPath: o } = Zl.isSubset(r, i);
|
|
7220
|
+
return a == Fl.True ? { kind: "compatible" } : {
|
|
7141
7221
|
kind: "incompatible",
|
|
7142
7222
|
error: n.message,
|
|
7143
7223
|
errorPath: o
|
|
@@ -7149,7 +7229,7 @@ function Ql(e, t) {
|
|
|
7149
7229
|
};
|
|
7150
7230
|
}
|
|
7151
7231
|
}
|
|
7152
|
-
function
|
|
7232
|
+
function tu(e) {
|
|
7153
7233
|
function t(t) {
|
|
7154
7234
|
if (!t.startsWith("#")) return;
|
|
7155
7235
|
let n = decodeURIComponent(t.slice(1));
|
|
@@ -7202,46 +7282,28 @@ function $l(e) {
|
|
|
7202
7282
|
}
|
|
7203
7283
|
//#endregion
|
|
7204
7284
|
//#region src/flow/common/schema.ts
|
|
7205
|
-
function
|
|
7206
|
-
return e.kind == "poll" || e.kind == "integration" ? e.definition.payloadSchema : e.kind == "manual" ? {
|
|
7207
|
-
additionalProperties: !1,
|
|
7208
|
-
type: "object"
|
|
7209
|
-
} : e.kind == "cron" ? {
|
|
7210
|
-
additionalProperties: !1,
|
|
7211
|
-
properties: { scheduledAt: {
|
|
7212
|
-
format: "date-time",
|
|
7213
|
-
type: "string"
|
|
7214
|
-
} },
|
|
7215
|
-
type: "object"
|
|
7216
|
-
} : {
|
|
7217
|
-
additionalProperties: !1,
|
|
7218
|
-
properties: Object.fromEntries(e.inputsDef.map((e) => [e.handle, e.jsonSchema])),
|
|
7219
|
-
required: e.inputsDef.filter((e) => !e.nullable && !Object.hasOwn(e, "value")).map((e) => e.handle),
|
|
7220
|
-
type: "object"
|
|
7221
|
-
};
|
|
7222
|
-
}
|
|
7223
|
-
function tu(e, t) {
|
|
7285
|
+
function nu(e, t) {
|
|
7224
7286
|
if (e === t) return !0;
|
|
7225
7287
|
if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
|
|
7226
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) =>
|
|
7288
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => nu(e, t[n]));
|
|
7227
7289
|
let n = Object.entries(e), r = t;
|
|
7228
|
-
return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) &&
|
|
7290
|
+
return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && nu(t, r[e]));
|
|
7229
7291
|
}
|
|
7230
|
-
function
|
|
7292
|
+
function ru(e) {
|
|
7231
7293
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
7232
7294
|
}
|
|
7233
|
-
function
|
|
7295
|
+
function iu(e) {
|
|
7234
7296
|
return Array.isArray(e) ? e : void 0;
|
|
7235
7297
|
}
|
|
7236
|
-
function
|
|
7237
|
-
if (t === !0 ||
|
|
7238
|
-
if (e === !0 ||
|
|
7239
|
-
let i =
|
|
7298
|
+
function au(e, t, n = !1, r = !1) {
|
|
7299
|
+
if (t === !0 || nu(t, {})) return { kind: "compatible" };
|
|
7300
|
+
if (e === !0 || nu(e, {}) || e === !1 || t === !1) return { kind: "incompatible" };
|
|
7301
|
+
let i = ru(e), a = ru(t);
|
|
7240
7302
|
if (i == null || a == null) return {
|
|
7241
7303
|
kind: "compare-error",
|
|
7242
7304
|
message: "Port schema must be an object or boolean."
|
|
7243
7305
|
};
|
|
7244
|
-
let o =
|
|
7306
|
+
let o = eu({
|
|
7245
7307
|
nullable: n,
|
|
7246
7308
|
packageId: void 0,
|
|
7247
7309
|
schema: i
|
|
@@ -7252,22 +7314,22 @@ function iu(e, t, n = !1, r = !1) {
|
|
|
7252
7314
|
});
|
|
7253
7315
|
return o.kind == "incompatible" ? {
|
|
7254
7316
|
...o,
|
|
7255
|
-
errorPath:
|
|
7317
|
+
errorPath: $l(o.errorPath, r)
|
|
7256
7318
|
} : o;
|
|
7257
7319
|
}
|
|
7258
|
-
function
|
|
7320
|
+
function ou(e, t) {
|
|
7259
7321
|
let n = e;
|
|
7260
7322
|
for (let e of t) {
|
|
7261
7323
|
if (typeof n != "object" || !n) return;
|
|
7262
|
-
n = Array.isArray(n) ? n[Number(e)] :
|
|
7324
|
+
n = Array.isArray(n) ? n[Number(e)] : ru(n)?.[String(e)];
|
|
7263
7325
|
}
|
|
7264
7326
|
return n;
|
|
7265
7327
|
}
|
|
7266
|
-
function
|
|
7328
|
+
function su(e, t, n) {
|
|
7267
7329
|
if (e.nullable && !t.nullable) return { kind: "nullable" };
|
|
7268
7330
|
if (n.error == "edgeError.binDiffType") return { kind: "binary" };
|
|
7269
7331
|
if (n.error == "edgeError.artifactDiffType") return { kind: "artifact" };
|
|
7270
|
-
let r =
|
|
7332
|
+
let r = ru(e.jsonSchema), i = ru(t.jsonSchema), a = n.errorPath == null && r != null && i != null ? cu(r, i) : void 0, o = a == null ? n.errorPath : [a], s = o?.at(-1);
|
|
7271
7333
|
if (typeof s != "string" || !Ut(s)) return {
|
|
7272
7334
|
kind: "schema",
|
|
7273
7335
|
path: o
|
|
@@ -7277,19 +7339,19 @@ function ou(e, t, n) {
|
|
|
7277
7339
|
kind: "keyword",
|
|
7278
7340
|
keyword: s,
|
|
7279
7341
|
path: c,
|
|
7280
|
-
source:
|
|
7281
|
-
target:
|
|
7342
|
+
source: ou(e.jsonSchema, [...c, s]),
|
|
7343
|
+
target: ou(t.jsonSchema, [...c, s])
|
|
7282
7344
|
};
|
|
7283
7345
|
}
|
|
7284
|
-
function
|
|
7285
|
-
if (!
|
|
7286
|
-
if (t.const !== void 0 && !
|
|
7287
|
-
if (t.enum !== void 0 && !
|
|
7346
|
+
function cu(e, t) {
|
|
7347
|
+
if (!nu(e.type, t.type)) return "type";
|
|
7348
|
+
if (t.const !== void 0 && !nu(e.const, t.const)) return "const";
|
|
7349
|
+
if (t.enum !== void 0 && !nu(e.enum, t.enum)) return "enum";
|
|
7288
7350
|
let n = new Set(Array.isArray(e.required) ? e.required : []);
|
|
7289
7351
|
if (Array.isArray(t.required) && t.required.some((e) => typeof e == "string" && !n.has(e))) return "required";
|
|
7290
|
-
for (let n of
|
|
7352
|
+
for (let n of lu) if (t[n] !== void 0 && !nu(e[n], t[n])) return n;
|
|
7291
7353
|
}
|
|
7292
|
-
var
|
|
7354
|
+
var lu = [
|
|
7293
7355
|
"minLength",
|
|
7294
7356
|
"maxLength",
|
|
7295
7357
|
"pattern",
|
|
@@ -7303,26 +7365,87 @@ var cu = [
|
|
|
7303
7365
|
"minProperties",
|
|
7304
7366
|
"maxProperties"
|
|
7305
7367
|
];
|
|
7306
|
-
function
|
|
7307
|
-
let n =
|
|
7368
|
+
function uu(e, t) {
|
|
7369
|
+
let n = au(e.jsonSchema, t.jsonSchema, e.nullable, t.nullable);
|
|
7308
7370
|
return n.kind == "incompatible" ? {
|
|
7309
7371
|
kind: "incompatible",
|
|
7310
|
-
mismatch:
|
|
7372
|
+
mismatch: su(e, t, n)
|
|
7311
7373
|
} : n;
|
|
7312
7374
|
}
|
|
7313
|
-
function
|
|
7314
|
-
return
|
|
7375
|
+
function du(e, t) {
|
|
7376
|
+
return uu(e, t).kind == "compatible";
|
|
7315
7377
|
}
|
|
7316
|
-
function
|
|
7317
|
-
let t =
|
|
7318
|
-
return t != null && n?.includes("string") ?
|
|
7378
|
+
function fu(e) {
|
|
7379
|
+
let t = ru(e), n = iu(t?.type);
|
|
7380
|
+
return t != null && n?.includes("string") ? au({ type: "string" }, {
|
|
7319
7381
|
...t,
|
|
7320
7382
|
type: "string"
|
|
7321
|
-
}).kind == "compatible" :
|
|
7383
|
+
}).kind == "compatible" : au({ type: "string" }, e).kind == "compatible";
|
|
7384
|
+
}
|
|
7385
|
+
//#endregion
|
|
7386
|
+
//#region src/trigger/common/contract.ts
|
|
7387
|
+
var pu = [
|
|
7388
|
+
{
|
|
7389
|
+
handle: "headers",
|
|
7390
|
+
jsonSchema: {
|
|
7391
|
+
type: "object",
|
|
7392
|
+
additionalProperties: { type: "string" }
|
|
7393
|
+
},
|
|
7394
|
+
nullable: !1
|
|
7395
|
+
},
|
|
7396
|
+
{
|
|
7397
|
+
handle: "query",
|
|
7398
|
+
jsonSchema: {
|
|
7399
|
+
type: "object",
|
|
7400
|
+
additionalProperties: {
|
|
7401
|
+
type: ["string", "array"],
|
|
7402
|
+
items: { type: "string" }
|
|
7403
|
+
}
|
|
7404
|
+
},
|
|
7405
|
+
nullable: !1
|
|
7406
|
+
},
|
|
7407
|
+
{
|
|
7408
|
+
handle: "body",
|
|
7409
|
+
jsonSchema: {
|
|
7410
|
+
type: "object",
|
|
7411
|
+
additionalProperties: !0
|
|
7412
|
+
},
|
|
7413
|
+
nullable: !1
|
|
7414
|
+
},
|
|
7415
|
+
{
|
|
7416
|
+
handle: "webhookUrl",
|
|
7417
|
+
jsonSchema: { type: "string" },
|
|
7418
|
+
nullable: !1
|
|
7419
|
+
}
|
|
7420
|
+
], mu = [{
|
|
7421
|
+
description: "The scheduled time that triggered this run, in ISO 8601 format.",
|
|
7422
|
+
handle: "scheduledAt",
|
|
7423
|
+
jsonSchema: {
|
|
7424
|
+
type: "string",
|
|
7425
|
+
format: "date-time"
|
|
7426
|
+
},
|
|
7427
|
+
nullable: !1
|
|
7428
|
+
}];
|
|
7429
|
+
function hu(e) {
|
|
7430
|
+
switch (e.kind) {
|
|
7431
|
+
case "manual": return [];
|
|
7432
|
+
case "cron": return mu;
|
|
7433
|
+
case "poll":
|
|
7434
|
+
case "integration": return e.definition.outputs;
|
|
7435
|
+
case "webhook": return pu.map((t) => t.handle === "body" ? Object.assign({}, t, { jsonSchema: {
|
|
7436
|
+
type: "object",
|
|
7437
|
+
additionalProperties: !1,
|
|
7438
|
+
properties: Object.fromEntries(e.bodyFields.map((e) => [e.handle, e.jsonSchema])),
|
|
7439
|
+
required: e.bodyFields.filter((e) => !e.nullable && !Object.hasOwn(e, "value")).map((e) => e.handle)
|
|
7440
|
+
} }) : t);
|
|
7441
|
+
}
|
|
7442
|
+
}
|
|
7443
|
+
function gu(e) {
|
|
7444
|
+
return Object.fromEntries(hu(e).map(({ handle: e, ...t }) => [e, t]));
|
|
7322
7445
|
}
|
|
7323
7446
|
//#endregion
|
|
7324
7447
|
//#region src/flow/common/graph.ts
|
|
7325
|
-
function
|
|
7448
|
+
function _u(e, t) {
|
|
7326
7449
|
switch (t.kind) {
|
|
7327
7450
|
case "condition": return { [t.input.handle]: t.input };
|
|
7328
7451
|
case "value": return {};
|
|
@@ -7336,7 +7459,7 @@ function fu(e, t) {
|
|
|
7336
7459
|
case "webhook": return {};
|
|
7337
7460
|
}
|
|
7338
7461
|
}
|
|
7339
|
-
function
|
|
7462
|
+
function vu(e) {
|
|
7340
7463
|
return {
|
|
7341
7464
|
notification: {
|
|
7342
7465
|
nullable: !1,
|
|
@@ -7375,7 +7498,7 @@ function pu(e) {
|
|
|
7375
7498
|
}]))
|
|
7376
7499
|
};
|
|
7377
7500
|
}
|
|
7378
|
-
function
|
|
7501
|
+
function yu(e, t) {
|
|
7379
7502
|
switch (t.kind) {
|
|
7380
7503
|
case "condition": {
|
|
7381
7504
|
let e = [...t.cases.map((e) => e.output), ...t.defaultOutput == null ? [] : [t.defaultOutput]];
|
|
@@ -7384,18 +7507,15 @@ function mu(e, t) {
|
|
|
7384
7507
|
case "value": return Tt(t.values);
|
|
7385
7508
|
case "subflow": return Tt(e.subflows[t.subflowId]?.outputs ?? []);
|
|
7386
7509
|
case "task": return Tt(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
|
|
7387
|
-
case "wait": return
|
|
7510
|
+
case "wait": return vu(t);
|
|
7388
7511
|
case "cron":
|
|
7389
7512
|
case "integration":
|
|
7390
7513
|
case "poll":
|
|
7391
7514
|
case "manual":
|
|
7392
|
-
case "webhook": return
|
|
7393
|
-
jsonSchema: eu(t),
|
|
7394
|
-
nullable: !1
|
|
7395
|
-
} };
|
|
7515
|
+
case "webhook": return gu(t);
|
|
7396
7516
|
}
|
|
7397
7517
|
}
|
|
7398
|
-
function
|
|
7518
|
+
function bu(e) {
|
|
7399
7519
|
let t = new Map(Object.keys(e.nodes).map((e) => [e, /* @__PURE__ */ new Set()])), n = /* @__PURE__ */ new Map();
|
|
7400
7520
|
for (let r of e.edges) {
|
|
7401
7521
|
if (!t.has(r.source) || !t.has(r.target)) continue;
|
|
@@ -7412,51 +7532,56 @@ function hu(e) {
|
|
|
7412
7532
|
n?.delete(i), n?.size == 0 && r.push(e);
|
|
7413
7533
|
}
|
|
7414
7534
|
}
|
|
7415
|
-
return r;
|
|
7535
|
+
return [...r, ...[...t.keys()].toSorted()];
|
|
7416
7536
|
}
|
|
7417
|
-
var
|
|
7418
|
-
function
|
|
7537
|
+
var xu = /* @__PURE__ */ new WeakMap();
|
|
7538
|
+
function Su(e, t) {
|
|
7419
7539
|
return Object.entries(e).every(([e, n]) => t[e] == n);
|
|
7420
7540
|
}
|
|
7421
|
-
function
|
|
7541
|
+
function Cu(e, t) {
|
|
7422
7542
|
return Object.entries(e).every(([e, n]) => t[e] == null || t[e] == n);
|
|
7423
7543
|
}
|
|
7424
|
-
function
|
|
7425
|
-
let t =
|
|
7544
|
+
function wu(e) {
|
|
7545
|
+
let t = xu.get(e);
|
|
7426
7546
|
if (t != null) return t;
|
|
7427
7547
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
7428
7548
|
for (let t of e.edges) {
|
|
7429
7549
|
let e = a.get(t.target) ?? [];
|
|
7430
7550
|
e.push(t), a.set(t.target, e);
|
|
7431
7551
|
}
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7552
|
+
let o = bu(e), s = !0;
|
|
7553
|
+
for (; s;) {
|
|
7554
|
+
s = !1;
|
|
7555
|
+
for (let t of o) {
|
|
7556
|
+
let o = e.nodes[t], c = a.get(t) ?? [], l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = [];
|
|
7557
|
+
for (let t of c) {
|
|
7558
|
+
l.add(t.source);
|
|
7559
|
+
for (let e of i.get(t.source) ?? []) u.add(e);
|
|
7560
|
+
e.nodes[t.source]?.kind == "wait" && t.sourceHandle != "notification" && u.add(t.source);
|
|
7561
|
+
for (let e of r.get(t.source) ?? []) l.add(e);
|
|
7562
|
+
for (let r of n.get(t.source) ?? []) {
|
|
7563
|
+
let n = t.sourceHandle == null || e.nodes[t.source]?.kind == "wait" && t.sourceHandle == "notification" ? r : {
|
|
7564
|
+
...r,
|
|
7565
|
+
[t.source]: t.sourceHandle
|
|
7566
|
+
};
|
|
7567
|
+
if (!d.some((e) => Su(e, n))) {
|
|
7568
|
+
for (let e = d.length - 1; e >= 0; e--) Su(n, d[e]) && d.splice(e, 1);
|
|
7569
|
+
d.push(n);
|
|
7570
|
+
}
|
|
7447
7571
|
}
|
|
7448
7572
|
}
|
|
7573
|
+
let f = c.length == 0 ? "inputs" in o ? [{}] : [{ $trigger: t }] : d, p = n.get(t) ?? [];
|
|
7574
|
+
(l.size != (r.get(t)?.size ?? 0) || u.size != (i.get(t)?.size ?? 0) || f.length != p.length || f.some((e) => !p.some((t) => Su(t, e) && Su(e, t)))) && (s = !0), r.set(t, l), i.set(t, u), n.set(t, f);
|
|
7449
7575
|
}
|
|
7450
|
-
r.set(t, c), i.set(t, l), n.set(t, s.length == 0 ? "inputs" in o ? [{}] : [{ $trigger: t }] : u);
|
|
7451
7576
|
}
|
|
7452
|
-
let
|
|
7577
|
+
let c = {
|
|
7453
7578
|
ancestors: r,
|
|
7454
7579
|
paths: n,
|
|
7455
7580
|
resolvedWaits: i
|
|
7456
7581
|
};
|
|
7457
|
-
return
|
|
7582
|
+
return xu.set(e, c), c;
|
|
7458
7583
|
}
|
|
7459
|
-
function
|
|
7584
|
+
function Tu(e, t, n) {
|
|
7460
7585
|
if (n.kind != "node") return [{}];
|
|
7461
7586
|
let r = e.nodes[n.nodeId], i = t.get(n.nodeId) ?? [];
|
|
7462
7587
|
return r?.kind == "condition" || r?.kind == "wait" && n.output != "notification" ? i.map((e) => ({
|
|
@@ -7464,66 +7589,69 @@ function bu(e, t, n) {
|
|
|
7464
7589
|
[n.nodeId]: n.output
|
|
7465
7590
|
})) : i;
|
|
7466
7591
|
}
|
|
7467
|
-
function
|
|
7592
|
+
function Eu(e, t, n, r) {
|
|
7468
7593
|
if (n.kind == "value") return !0;
|
|
7469
7594
|
let { ancestors: i, paths: a } = r;
|
|
7470
7595
|
if (t != null && n.sources.some((e) => e.kind == "node" && !i.get(t)?.has(e.nodeId)) || t != null && n.sources.some((n) => n.kind == "node" && e.nodes[n.nodeId]?.kind == "wait" && n.output != "notification" && !r.resolvedWaits.get(t)?.has(n.nodeId))) return !1;
|
|
7471
|
-
let o = n.sources.map((t) =>
|
|
7472
|
-
for (let [e,
|
|
7473
|
-
|
|
7474
|
-
let r
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7596
|
+
let o = n.sources.map((t) => Tu(e, a, t)), s = t == null ? [{}] : a.get(t) ?? [];
|
|
7597
|
+
for (let [e, r] of o.entries()) for (let [a, c] of o.slice(e + 1).entries()) {
|
|
7598
|
+
let o = n.sources[e], l = n.sources[e + a + 1];
|
|
7599
|
+
if (!(t != null && o.kind == "node" && l.kind == "node" && o.nodeId != l.nodeId && !i.get(o.nodeId)?.has(l.nodeId) && !i.get(l.nodeId)?.has(o.nodeId))) for (let e of r) for (let t of s) {
|
|
7600
|
+
if (!Cu(e, t)) continue;
|
|
7601
|
+
let n = {
|
|
7602
|
+
...t,
|
|
7603
|
+
...e
|
|
7604
|
+
};
|
|
7605
|
+
if (c.some((e) => Cu(e, n))) return !1;
|
|
7606
|
+
}
|
|
7479
7607
|
}
|
|
7480
7608
|
return !0;
|
|
7481
7609
|
}
|
|
7482
|
-
function
|
|
7610
|
+
function Du(e, t, n, r, i) {
|
|
7483
7611
|
let a = t.nodes[i.nodeId], o = t.nodes[n];
|
|
7484
7612
|
if (a == null) return { kind: "source-missing" };
|
|
7485
7613
|
if (o == null) return { kind: "not-ready" };
|
|
7486
|
-
let s =
|
|
7614
|
+
let s = yu(e, a)[i.output], c = _u(e, o)[r];
|
|
7487
7615
|
if (s == null) return { kind: "output-missing" };
|
|
7488
7616
|
if (c == null) return { kind: "not-ready" };
|
|
7489
|
-
let l =
|
|
7617
|
+
let l = wu(t);
|
|
7490
7618
|
if (l.ancestors.get(n)?.has(i.nodeId) !== !0 || a.kind == "wait" && i.output != "notification" && !l.resolvedWaits.get(n)?.has(i.nodeId)) return { kind: "not-ready" };
|
|
7491
|
-
let u =
|
|
7619
|
+
let u = uu(s, c);
|
|
7492
7620
|
return u.kind == "compatible" ? { kind: "available" } : u.kind == "incompatible" ? {
|
|
7493
7621
|
kind: "schema",
|
|
7494
7622
|
mismatch: u.mismatch
|
|
7495
7623
|
} : { kind: "schema-error" };
|
|
7496
7624
|
}
|
|
7497
|
-
function
|
|
7498
|
-
let a = i.map((i) =>
|
|
7625
|
+
function Ou(e, t, n, r, i) {
|
|
7626
|
+
let a = i.map((i) => Du(e, t, n, r, i));
|
|
7499
7627
|
return {
|
|
7500
|
-
conflict: a.length > 1 && a.every((e) => e.kind == "available") && !
|
|
7628
|
+
conflict: a.length > 1 && a.every((e) => e.kind == "available") && !Eu(t, n, {
|
|
7501
7629
|
kind: "sources",
|
|
7502
7630
|
sources: i.map((e) => ({
|
|
7503
7631
|
kind: "node",
|
|
7504
7632
|
...e
|
|
7505
7633
|
}))
|
|
7506
|
-
},
|
|
7634
|
+
}, wu(t)),
|
|
7507
7635
|
sources: a
|
|
7508
7636
|
};
|
|
7509
7637
|
}
|
|
7510
|
-
function
|
|
7511
|
-
let i =
|
|
7638
|
+
function ku(e, t, n, r) {
|
|
7639
|
+
let i = wu(t);
|
|
7512
7640
|
return Object.fromEntries([...i.ancestors.get(n) ?? []].flatMap((a) => {
|
|
7513
7641
|
let o = t.nodes[a];
|
|
7514
7642
|
if (o == null) return [];
|
|
7515
|
-
let s = Object.keys(
|
|
7643
|
+
let s = Object.keys(yu(e, o)).filter((s) => Eu(t, n, {
|
|
7516
7644
|
kind: "sources",
|
|
7517
7645
|
sources: [{
|
|
7518
7646
|
kind: "node",
|
|
7519
7647
|
nodeId: a,
|
|
7520
7648
|
output: s
|
|
7521
7649
|
}]
|
|
7522
|
-
}, i) && (r == null ||
|
|
7650
|
+
}, i) && (r == null || du(yu(e, o)[s], _u(e, t.nodes[n])[r])));
|
|
7523
7651
|
return s.length == 0 ? [] : [[a, s]];
|
|
7524
7652
|
}));
|
|
7525
7653
|
}
|
|
7526
|
-
`${JSON.stringify("open-flow-engine/
|
|
7654
|
+
`${JSON.stringify("open-flow-engine/v5")}`, new Set([
|
|
7527
7655
|
"assert",
|
|
7528
7656
|
"assert/strict",
|
|
7529
7657
|
"buffer",
|
|
@@ -7548,7 +7676,7 @@ function wu(e, t, n, r) {
|
|
|
7548
7676
|
"url",
|
|
7549
7677
|
"util",
|
|
7550
7678
|
"zlib"
|
|
7551
|
-
].flatMap((e) => [e, `node:${e}`])), `${JSON.stringify("open-flow-engine/
|
|
7679
|
+
].flatMap((e) => [e, `node:${e}`])), `${JSON.stringify("open-flow-engine/v5/nodejs-compat-v1")}`;
|
|
7552
7680
|
//#endregion
|
|
7553
7681
|
//#region src/flow/common/agent.ts
|
|
7554
7682
|
var Q = jt(() => Wt([Nt(), At({
|
|
@@ -7593,7 +7721,7 @@ var Q = jt(() => Wt([Nt(), At({
|
|
|
7593
7721
|
return !1;
|
|
7594
7722
|
}
|
|
7595
7723
|
}, "Invalid regular expression.").optional(),
|
|
7596
|
-
format: j().refine((e) => Object.hasOwn(
|
|
7724
|
+
format: j().refine((e) => Object.hasOwn(Eo, e), "Unsupported string format.").optional(),
|
|
7597
7725
|
multipleOf: Pt().positive().optional(),
|
|
7598
7726
|
uniqueItems: Nt().optional(),
|
|
7599
7727
|
contains: Q.optional(),
|
|
@@ -7640,11 +7768,11 @@ var Q = jt(() => Wt([Nt(), At({
|
|
|
7640
7768
|
}).transform(({ title: e, default: t, examples: n, readOnly: r, writeOnly: i, deprecated: a, $comment: o, ...s }) => s)]));
|
|
7641
7769
|
//#endregion
|
|
7642
7770
|
//#region src/flow/common/semantics.ts
|
|
7643
|
-
function
|
|
7771
|
+
function Au(e) {
|
|
7644
7772
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
7645
7773
|
}
|
|
7646
|
-
function
|
|
7647
|
-
if (t != null) return
|
|
7774
|
+
function ju(e, t) {
|
|
7775
|
+
if (t != null) return ju(Mu(e, t));
|
|
7648
7776
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
7649
7777
|
function s(e) {
|
|
7650
7778
|
n.add(e);
|
|
@@ -7659,7 +7787,7 @@ function Eu(e, t) {
|
|
|
7659
7787
|
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (r.add(e.bindingId), s(e.bindingId));
|
|
7660
7788
|
}
|
|
7661
7789
|
function u(t) {
|
|
7662
|
-
for (let [, n] of
|
|
7790
|
+
for (let [, n] of Au(t.nodes)) switch ("inputs" in n && l(n.inputs), n.kind) {
|
|
7663
7791
|
case "condition": break;
|
|
7664
7792
|
case "subflow":
|
|
7665
7793
|
d(n.subflowId);
|
|
@@ -7692,7 +7820,7 @@ function Eu(e, t) {
|
|
|
7692
7820
|
tasks: o
|
|
7693
7821
|
};
|
|
7694
7822
|
}
|
|
7695
|
-
function
|
|
7823
|
+
function Mu(e, t) {
|
|
7696
7824
|
let n = e.document.graph, r = /* @__PURE__ */ new Set([t]);
|
|
7697
7825
|
for (let e of r) for (let t of n.edges) t.source == e && r.add(t.target);
|
|
7698
7826
|
function i(e, t) {
|
|
@@ -7721,7 +7849,7 @@ function Du(e, t) {
|
|
|
7721
7849
|
edges: n.edges.filter((e) => r.has(e.source))
|
|
7722
7850
|
}
|
|
7723
7851
|
}
|
|
7724
|
-
}, { bindings: s } =
|
|
7852
|
+
}, { bindings: s } = ju(o);
|
|
7725
7853
|
return {
|
|
7726
7854
|
...o,
|
|
7727
7855
|
document: {
|
|
@@ -7730,7 +7858,7 @@ function Du(e, t) {
|
|
|
7730
7858
|
}
|
|
7731
7859
|
};
|
|
7732
7860
|
}
|
|
7733
|
-
function
|
|
7861
|
+
function Nu(e) {
|
|
7734
7862
|
return Object.values(e.tasks).flatMap((t) => {
|
|
7735
7863
|
if (t.executor.kind != "agent") return [];
|
|
7736
7864
|
let n = t.executor.notification == null ? void 0 : e.tasks[t.executor.notification.taskId]?.executor;
|
|
@@ -7741,12 +7869,12 @@ function Ou(e) {
|
|
|
7741
7869
|
}));
|
|
7742
7870
|
});
|
|
7743
7871
|
}
|
|
7744
|
-
function
|
|
7872
|
+
function Pu(e) {
|
|
7745
7873
|
return [e.graph, ...Object.values(e.subflows).map((e) => e.graph)].flatMap((e) => Object.values(e.nodes).flatMap((e) => e.kind == "task" && e.task != null ? e.task.capabilities ?? [] : []));
|
|
7746
7874
|
}
|
|
7747
7875
|
//#endregion
|
|
7748
7876
|
//#region src/workbench/browser/runtime/revisionView.ts
|
|
7749
|
-
var
|
|
7877
|
+
var Fu = /* @__PURE__ */ new WeakMap(), Iu = class {
|
|
7750
7878
|
#e;
|
|
7751
7879
|
#t;
|
|
7752
7880
|
#n = /* @__PURE__ */ new WeakMap();
|
|
@@ -7756,7 +7884,7 @@ var Au = /* @__PURE__ */ new WeakMap(), ju = class {
|
|
|
7756
7884
|
this.revision = e, this.#e = e.content.document, this.#t = e.content.modules;
|
|
7757
7885
|
let t = /* @__PURE__ */ new Set();
|
|
7758
7886
|
for (let e of Object.values(this.#e.tasks)) e.executor.kind == "connector" && t.add(e.executor.action);
|
|
7759
|
-
for (let e of [...
|
|
7887
|
+
for (let e of [...Pu(this.#e), ...Nu(this.#e)]) t.add(e.action);
|
|
7760
7888
|
this.connectorActionIds = t;
|
|
7761
7889
|
}
|
|
7762
7890
|
subflow(e) {
|
|
@@ -7775,8 +7903,8 @@ var Au = /* @__PURE__ */ new WeakMap(), ju = class {
|
|
|
7775
7903
|
conflict: !1,
|
|
7776
7904
|
sources: []
|
|
7777
7905
|
} : void 0, d, f = {
|
|
7778
|
-
check: () => u ??=
|
|
7779
|
-
candidates: () => d ??=
|
|
7906
|
+
check: () => u ??= Ou(this.#e, r, t, n, l),
|
|
7907
|
+
candidates: () => d ??= ku(this.#e, r, t, n)
|
|
7780
7908
|
};
|
|
7781
7909
|
return i ?? this.#r.set(r, i = /* @__PURE__ */ new Map()), i.set(a, f), f;
|
|
7782
7910
|
}
|
|
@@ -7898,13 +8026,13 @@ var Au = /* @__PURE__ */ new WeakMap(), ju = class {
|
|
|
7898
8026
|
return !1;
|
|
7899
8027
|
}
|
|
7900
8028
|
};
|
|
7901
|
-
function
|
|
7902
|
-
let t =
|
|
7903
|
-
return t ?? (t = new
|
|
8029
|
+
function Lu(e) {
|
|
8030
|
+
let t = Fu.get(e);
|
|
8031
|
+
return t ?? (t = new Iu(e), Fu.set(e, t)), t;
|
|
7904
8032
|
}
|
|
7905
8033
|
//#endregion
|
|
7906
8034
|
//#region src/workbench/browser/runtime/runs/runStore.ts
|
|
7907
|
-
var
|
|
8035
|
+
var Ru = {
|
|
7908
8036
|
eventCursor: 0,
|
|
7909
8037
|
eventFilter: "all",
|
|
7910
8038
|
events: [],
|
|
@@ -7919,33 +8047,33 @@ var Nu = {
|
|
|
7919
8047
|
resolvingActions: /* @__PURE__ */ new Map(),
|
|
7920
8048
|
runById: /* @__PURE__ */ new Map(),
|
|
7921
8049
|
runIds: []
|
|
7922
|
-
},
|
|
7923
|
-
function
|
|
8050
|
+
}, zu = 100, Bu = 500, Vu = 1200, Hu = 6e4;
|
|
8051
|
+
function Uu(e) {
|
|
7924
8052
|
return e?.status == "queued" || e?.status == "starting" || e?.status == "running" || e?.status == "waiting";
|
|
7925
8053
|
}
|
|
7926
|
-
function
|
|
8054
|
+
function Wu(e) {
|
|
7927
8055
|
return e.selectedRunId == null ? void 0 : e.runById.get(e.selectedRunId);
|
|
7928
8056
|
}
|
|
7929
|
-
function
|
|
7930
|
-
let n = new Map(t.map((e) => [e.runId, e])), r = t.map((e) => e.runId), i =
|
|
8057
|
+
function Gu(e, t) {
|
|
8058
|
+
let n = new Map(t.map((e) => [e.runId, e])), r = t.map((e) => e.runId), i = Wu(e);
|
|
7931
8059
|
return i != null && (n.has(i.runId) || r.unshift(i.runId), n.set(i.runId, i)), {
|
|
7932
8060
|
runById: n,
|
|
7933
8061
|
runIds: r
|
|
7934
8062
|
};
|
|
7935
8063
|
}
|
|
7936
|
-
function
|
|
8064
|
+
function Ku(e, t) {
|
|
7937
8065
|
return new Map(e.runById).set(t.runId, t);
|
|
7938
8066
|
}
|
|
7939
|
-
var
|
|
8067
|
+
var qu = class {
|
|
7940
8068
|
#e = new oo();
|
|
7941
8069
|
#t;
|
|
7942
8070
|
#n;
|
|
7943
8071
|
#r = new oo();
|
|
7944
8072
|
#i = new oo();
|
|
7945
8073
|
#a;
|
|
7946
|
-
#o = n(
|
|
8074
|
+
#o = n(Ru);
|
|
7947
8075
|
#s;
|
|
7948
|
-
constructor(t, n, i =
|
|
8076
|
+
constructor(t, n, i = yt()) {
|
|
7949
8077
|
this.#t = t, this.#n = i, this.#a = n, this.$ = {
|
|
7950
8078
|
cancelingRunId: e(this.#o, (e) => e.cancelingRunId),
|
|
7951
8079
|
eventFilter: e(this.#o, (e) => e.eventFilter),
|
|
@@ -7962,7 +8090,7 @@ var Hu = class {
|
|
|
7962
8090
|
refreshing: e(this.#o, (e) => e.refreshing),
|
|
7963
8091
|
result: e(this.#o, (e) => e.result),
|
|
7964
8092
|
resolvingActions: e(this.#o, (e) => e.resolvingActions),
|
|
7965
|
-
run: e(this.#o,
|
|
8093
|
+
run: e(this.#o, Wu),
|
|
7966
8094
|
runs: e(this.#o, (e) => e.runIds.flatMap((t) => {
|
|
7967
8095
|
let n = e.runById.get(t);
|
|
7968
8096
|
return n == null ? [] : [n];
|
|
@@ -7975,7 +8103,7 @@ var Hu = class {
|
|
|
7975
8103
|
this.#o.dispose();
|
|
7976
8104
|
}
|
|
7977
8105
|
reset() {
|
|
7978
|
-
this.#e.invalidate(), this.#r.invalidate(), this.#i.invalidate(), this.#f(), this.#o.set(
|
|
8106
|
+
this.#e.invalidate(), this.#r.invalidate(), this.#i.invalidate(), this.#f(), this.#o.set(Ru);
|
|
7979
8107
|
}
|
|
7980
8108
|
async load(e) {
|
|
7981
8109
|
let t = this.#o.value, n = t.loaded && t.target?.flowId == e, r = this.#r.begin();
|
|
@@ -7990,7 +8118,7 @@ var Hu = class {
|
|
|
7990
8118
|
let t = await this.#t.listRuns(e, { limit: 50 });
|
|
7991
8119
|
if (!r() || this.#o.value.target?.flowId != e) return;
|
|
7992
8120
|
this.#p({
|
|
7993
|
-
...
|
|
8121
|
+
...Gu(this.#o.value, t.runs),
|
|
7994
8122
|
nextCursor: t.nextCursor,
|
|
7995
8123
|
refreshing: !1
|
|
7996
8124
|
});
|
|
@@ -8001,9 +8129,9 @@ var Hu = class {
|
|
|
8001
8129
|
return;
|
|
8002
8130
|
}
|
|
8003
8131
|
this.#i.invalidate(), this.#f();
|
|
8004
|
-
let i =
|
|
8132
|
+
let i = Wu(t)?.flowId == e ? t.cancelingRunId : void 0;
|
|
8005
8133
|
t.cancelingRunId != null && i == null && this.#e.invalidate(), this.#o.set({
|
|
8006
|
-
...
|
|
8134
|
+
...Ru,
|
|
8007
8135
|
...i == null ? {} : { cancelingRunId: i },
|
|
8008
8136
|
eventFilter: t.eventFilter,
|
|
8009
8137
|
loading: !0,
|
|
@@ -8013,7 +8141,7 @@ var Hu = class {
|
|
|
8013
8141
|
let t = await this.#t.listRuns(e, { limit: 50 });
|
|
8014
8142
|
if (!r()) return;
|
|
8015
8143
|
this.#p({
|
|
8016
|
-
...
|
|
8144
|
+
...Gu(this.#o.value, t.runs),
|
|
8017
8145
|
loaded: !0,
|
|
8018
8146
|
loadFailed: !1,
|
|
8019
8147
|
loading: !1,
|
|
@@ -8073,7 +8201,7 @@ var Hu = class {
|
|
|
8073
8201
|
e != null && await this.load(e.flowId);
|
|
8074
8202
|
}
|
|
8075
8203
|
retryObservation() {
|
|
8076
|
-
let e =
|
|
8204
|
+
let e = Wu(this.#o.value);
|
|
8077
8205
|
if (e == null) return;
|
|
8078
8206
|
let t = this.#i.begin();
|
|
8079
8207
|
this.#f(), this.#p({ observationFailed: !1 }), this.#l(e, t);
|
|
@@ -8082,8 +8210,8 @@ var Hu = class {
|
|
|
8082
8210
|
this.#p({ eventFilter: e });
|
|
8083
8211
|
}
|
|
8084
8212
|
async cancel() {
|
|
8085
|
-
let e =
|
|
8086
|
-
if (!
|
|
8213
|
+
let e = Wu(this.#o.value);
|
|
8214
|
+
if (!Uu(e) || this.#o.value.cancelingRunId != null || this.#o.value.resolvingActions.size > 0) return;
|
|
8087
8215
|
let t = this.#e.begin();
|
|
8088
8216
|
this.#p({ cancelingRunId: e.runId });
|
|
8089
8217
|
try {
|
|
@@ -8095,7 +8223,7 @@ var Hu = class {
|
|
|
8095
8223
|
...i,
|
|
8096
8224
|
status: n.status
|
|
8097
8225
|
};
|
|
8098
|
-
if (this.#p({ runById:
|
|
8226
|
+
if (this.#p({ runById: Ku(r, a) }), r.selectedRunId != e.runId) return;
|
|
8099
8227
|
let o = this.#i.begin();
|
|
8100
8228
|
this.#f(), await this.#l(a, o);
|
|
8101
8229
|
} catch (e) {
|
|
@@ -8105,18 +8233,18 @@ var Hu = class {
|
|
|
8105
8233
|
}
|
|
8106
8234
|
}
|
|
8107
8235
|
async resolve(e, t) {
|
|
8108
|
-
let n =
|
|
8236
|
+
let n = Wu(this.#o.value), r = n != null && "waits" in n ? n.waits.find((t) => t.waitId == e) : void 0;
|
|
8109
8237
|
if (!(n == null || r == null || this.#o.value.cancelingRunId != null || this.#o.value.resolvingActions.has(e) || !r.actions.some((e) => e == t))) {
|
|
8110
8238
|
this.#p({ resolvingActions: new Map(this.#o.value.resolvingActions).set(e, t) });
|
|
8111
8239
|
try {
|
|
8112
|
-
let i = await this.#t.resolveRunWait(n.runId, r.waitId, t), a = this.#o.value, o =
|
|
8240
|
+
let i = await this.#t.resolveRunWait(n.runId, r.waitId, t), a = this.#o.value, o = Wu(a);
|
|
8113
8241
|
if (o?.runId != n.runId || !("waits" in o)) return;
|
|
8114
8242
|
let s = {
|
|
8115
8243
|
...o,
|
|
8116
8244
|
waits: o.waits.filter((t) => t.waitId != e),
|
|
8117
8245
|
status: i.status
|
|
8118
8246
|
};
|
|
8119
|
-
this.#p({ runById:
|
|
8247
|
+
this.#p({ runById: Ku(a, s) }), this.retryObservation();
|
|
8120
8248
|
let c = this.#o.value.target;
|
|
8121
8249
|
c != null && this.#u(c.flowId);
|
|
8122
8250
|
} catch (e) {
|
|
@@ -8150,7 +8278,7 @@ var Hu = class {
|
|
|
8150
8278
|
externalRunId: void 0,
|
|
8151
8279
|
loaded: !0,
|
|
8152
8280
|
result: void 0,
|
|
8153
|
-
runById:
|
|
8281
|
+
runById: Ku(n, e),
|
|
8154
8282
|
runIds: [e.runId, ...n.runIds.filter((t) => t != e.runId)],
|
|
8155
8283
|
selectedRunId: e.runId,
|
|
8156
8284
|
target: { flowId: e.flowId }
|
|
@@ -8173,7 +8301,7 @@ var Hu = class {
|
|
|
8173
8301
|
observationFailed: !1,
|
|
8174
8302
|
resolvingActions: /* @__PURE__ */ new Map(),
|
|
8175
8303
|
result: void 0,
|
|
8176
|
-
runById:
|
|
8304
|
+
runById: Ku(n, e),
|
|
8177
8305
|
selectedRunId: e.runId
|
|
8178
8306
|
}), this.#l(e, t);
|
|
8179
8307
|
}
|
|
@@ -8185,7 +8313,7 @@ var Hu = class {
|
|
|
8185
8313
|
let a = this.#o.value.eventCursor, [o, s] = yield* an.tryPromise({
|
|
8186
8314
|
try: (t) => Promise.allSettled([this.#t.getRun(e.runId, t), this.#t.getRunEvents(e.runId, {
|
|
8187
8315
|
after: a,
|
|
8188
|
-
limit:
|
|
8316
|
+
limit: zu
|
|
8189
8317
|
}, t)]),
|
|
8190
8318
|
catch: (e) => e
|
|
8191
8319
|
});
|
|
@@ -8197,7 +8325,7 @@ var Hu = class {
|
|
|
8197
8325
|
this.#p({
|
|
8198
8326
|
eventsExpiresAt: void 0,
|
|
8199
8327
|
historyComplete: !1,
|
|
8200
|
-
runById:
|
|
8328
|
+
runById: Ku(this.#o.value, c)
|
|
8201
8329
|
}), yield* an.tryPromise({
|
|
8202
8330
|
try: (e) => this.#d(c, t, e),
|
|
8203
8331
|
catch: (e) => e
|
|
@@ -8210,14 +8338,14 @@ var Hu = class {
|
|
|
8210
8338
|
events: [...this.#o.value.events, ...l.events],
|
|
8211
8339
|
eventsExpiresAt: l.eventsExpiresAt,
|
|
8212
8340
|
historyComplete: l.historyComplete,
|
|
8213
|
-
runById:
|
|
8341
|
+
runById: Ku(this.#o.value, c)
|
|
8214
8342
|
}), yield* an.tryPromise({
|
|
8215
8343
|
try: (e) => this.#d(c, t, e),
|
|
8216
8344
|
catch: (e) => e
|
|
8217
8345
|
}), yield* on.succeed(n, void 0), vr(c.status) && l.done) return;
|
|
8218
8346
|
let u = c.status == "queued" || c.status == "starting";
|
|
8219
8347
|
i = u && c.status == r.status ? i + 1 : 0;
|
|
8220
|
-
let d = vr(c.status) || l.events.length ==
|
|
8348
|
+
let d = vr(c.status) || l.events.length == zu ? 0 : c.status == "waiting" ? Hu : u ? Math.min(Vu, Bu * 2 ** Math.max(0, i - 1)) : Vu;
|
|
8221
8349
|
r = c, yield* an.sleep(d);
|
|
8222
8350
|
}
|
|
8223
8351
|
}).pipe(an.catch((n) => an.sync(() => {
|
|
@@ -8234,7 +8362,7 @@ var Hu = class {
|
|
|
8234
8362
|
let n = await this.#t.listRuns(e, { limit: 50 });
|
|
8235
8363
|
if (!t() || this.#o.value.target?.flowId != e) return;
|
|
8236
8364
|
this.#p({
|
|
8237
|
-
...
|
|
8365
|
+
...Gu(this.#o.value, n.runs),
|
|
8238
8366
|
loaded: !0,
|
|
8239
8367
|
loadingMore: !1,
|
|
8240
8368
|
nextCursor: n.nextCursor,
|
|
@@ -8258,7 +8386,7 @@ var Hu = class {
|
|
|
8258
8386
|
...e
|
|
8259
8387
|
});
|
|
8260
8388
|
}
|
|
8261
|
-
},
|
|
8389
|
+
}, Ju = {
|
|
8262
8390
|
"17track": "https://static.oomol.com/logo/third-party/17track.svg",
|
|
8263
8391
|
"7_shifts": "https://static.oomol.com/logo/third-party/7_shifts.png",
|
|
8264
8392
|
ably: "https://static.oomol.com/logo/third-party/ably.svg",
|
|
@@ -8549,6 +8677,7 @@ var Hu = class {
|
|
|
8549
8677
|
ipgeolocation_io: "https://static.oomol.com/logo/third-party/ipgeolocation_io.svg",
|
|
8550
8678
|
openalex: "https://static.oomol.com/logo/third-party/openalex.svg",
|
|
8551
8679
|
orcid: "https://static.oomol.com/logo/third-party/orcid.svg",
|
|
8680
|
+
orimon: "https://static.oomol.com/logo/third-party/orimon.svg",
|
|
8552
8681
|
mendeley: "https://static.oomol.com/logo/third-party/mendeley.svg",
|
|
8553
8682
|
crossref: "https://static.oomol.com/logo/third-party/crossref.svg",
|
|
8554
8683
|
datacite: "https://static.oomol.com/logo/third-party/datacite.svg",
|
|
@@ -8861,6 +8990,7 @@ var Hu = class {
|
|
|
8861
8990
|
myotp_app: "https://static.oomol.com/logo/third-party/myotp_app.png",
|
|
8862
8991
|
"fusion-api": "https://static.oomol.com/logo/logo.png",
|
|
8863
8992
|
oomol_console: "https://static.oomol.com/logo/third-party/oomol_console.svg",
|
|
8993
|
+
oomol_rag: "https://static.oomol.com/logo/third-party/oomol_rag.svg",
|
|
8864
8994
|
indeed: "https://static.oomol.com/logo/third-party/indeed.svg",
|
|
8865
8995
|
pi_hole: "https://static.oomol.com/logo/third-party/pi_hole.svg",
|
|
8866
8996
|
firecrawl: "https://static.oomol.com/logo/third-party/Firecrawl.svg",
|
|
@@ -9771,25 +9901,25 @@ var Hu = class {
|
|
|
9771
9901
|
speedtest_tracker: "https://static.oomol.com/logo/third-party/speedtest_tracker.png",
|
|
9772
9902
|
bloomerang: "https://static.oomol.com/logo/third-party/bloomerang.png",
|
|
9773
9903
|
coupontools: "https://static.oomol.com/logo/third-party/coupontools.png"
|
|
9774
|
-
},
|
|
9904
|
+
}, Yu = {
|
|
9775
9905
|
img: "ContentIcon_img_eb462",
|
|
9776
9906
|
initials: "ContentIcon_initials_eb462"
|
|
9777
|
-
},
|
|
9907
|
+
}, Xu = {
|
|
9778
9908
|
icon: "IconifyIcon_icon_e957a",
|
|
9779
9909
|
external: "IconifyIcon_external_e957a"
|
|
9780
9910
|
};
|
|
9781
9911
|
//#endregion
|
|
9782
9912
|
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/url.js
|
|
9783
|
-
function
|
|
9913
|
+
function Zu(e) {
|
|
9784
9914
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
9785
9915
|
}
|
|
9786
9916
|
//#endregion
|
|
9787
9917
|
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js
|
|
9788
|
-
function
|
|
9918
|
+
function Qu(e) {
|
|
9789
9919
|
let t = e.startsWith("<svg>") ? e.replace("<svg>", "<svg >") : e;
|
|
9790
|
-
return !t.includes(" xmlns:xlink=") && t.includes(" xlink:") && (t = t.replace("<svg ", "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" ")), t.includes(" xmlns=") || (t = t.replace("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" ")),
|
|
9920
|
+
return !t.includes(" xmlns:xlink=") && t.includes(" xlink:") && (t = t.replace("<svg ", "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" ")), t.includes(" xmlns=") || (t = t.replace("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" ")), Zu(t);
|
|
9791
9921
|
}
|
|
9792
|
-
var
|
|
9922
|
+
var $u = {
|
|
9793
9923
|
"skill-icons": {
|
|
9794
9924
|
prefix: "skill-icons",
|
|
9795
9925
|
icons: {
|
|
@@ -9805,29 +9935,29 @@ var Ju = {
|
|
|
9805
9935
|
width: 36,
|
|
9806
9936
|
height: 36
|
|
9807
9937
|
}
|
|
9808
|
-
},
|
|
9809
|
-
function
|
|
9810
|
-
let t =
|
|
9938
|
+
}, ed = null, td = /* @__PURE__ */ new Map();
|
|
9939
|
+
function nd(e) {
|
|
9940
|
+
let t = td.get(e);
|
|
9811
9941
|
return t || (t = (e == "carbon" ? import("./carbon-Cn-DTyjG.js").then(({ default: e }) => ({
|
|
9812
9942
|
icons: e,
|
|
9813
9943
|
chars: {},
|
|
9814
9944
|
info: e.info,
|
|
9815
9945
|
metadata: { categories: e.categories }
|
|
9816
9946
|
})) : import("./_virtual_open-flow-twemoji-CpHJOEsk.js").then((e) => e.default)).catch((t) => {
|
|
9817
|
-
throw
|
|
9818
|
-
}),
|
|
9947
|
+
throw td.delete(e), t;
|
|
9948
|
+
}), td.set(e, t)), t;
|
|
9819
9949
|
}
|
|
9820
|
-
var
|
|
9821
|
-
let [t, n] = F(
|
|
9822
|
-
if (
|
|
9823
|
-
r.current && n(
|
|
9950
|
+
var rd = Xt(null), id = ({ children: e }) => {
|
|
9951
|
+
let [t, n] = F(ed), r = rn(!0), i = Zt(async (e) => {
|
|
9952
|
+
if (ed?.[e]) {
|
|
9953
|
+
r.current && n(ed);
|
|
9824
9954
|
return;
|
|
9825
9955
|
}
|
|
9826
|
-
let t = await
|
|
9827
|
-
|
|
9828
|
-
...
|
|
9956
|
+
let t = await nd(e);
|
|
9957
|
+
ed = {
|
|
9958
|
+
...ed,
|
|
9829
9959
|
[e]: t
|
|
9830
|
-
}, r.current && n(
|
|
9960
|
+
}, r.current && n(ed);
|
|
9831
9961
|
}, []);
|
|
9832
9962
|
$t(() => (r.current = !0, () => {
|
|
9833
9963
|
r.current = !1;
|
|
@@ -9836,24 +9966,24 @@ var Qu = Xt(null), $u = ({ children: e }) => {
|
|
|
9836
9966
|
data: t,
|
|
9837
9967
|
loadCollection: i
|
|
9838
9968
|
}), [t, i]);
|
|
9839
|
-
return /* @__PURE__ */ M(
|
|
9969
|
+
return /* @__PURE__ */ M(rd.Provider, {
|
|
9840
9970
|
value: a,
|
|
9841
9971
|
children: e
|
|
9842
9972
|
});
|
|
9843
9973
|
};
|
|
9844
|
-
function
|
|
9845
|
-
return Qt(
|
|
9974
|
+
function ad() {
|
|
9975
|
+
return Qt(rd)?.data ?? null;
|
|
9846
9976
|
}
|
|
9847
|
-
function
|
|
9848
|
-
return Qt(
|
|
9977
|
+
function od() {
|
|
9978
|
+
return Qt(rd)?.loadCollection;
|
|
9849
9979
|
}
|
|
9850
9980
|
//#endregion
|
|
9851
9981
|
//#region src/ui/browser/icons/IconifyIcon.tsx
|
|
9852
|
-
function
|
|
9982
|
+
function sd(e) {
|
|
9853
9983
|
return e == "carbon" || e == "twemoji";
|
|
9854
9984
|
}
|
|
9855
|
-
var
|
|
9856
|
-
let a =
|
|
9985
|
+
var cd = ({ collection: e, icon: t, color: n, className: r, onError: i }) => {
|
|
9986
|
+
let a = ad(!0), o = od(), s = sd(e) ? e : void 0, c = s != null && !a?.[s];
|
|
9857
9987
|
$t(() => {
|
|
9858
9988
|
c && s && o?.(s).catch((e) => i?.(e));
|
|
9859
9989
|
}, [
|
|
@@ -9862,52 +9992,52 @@ var rd = ({ collection: e, icon: t, color: n, className: r, onError: i }) => {
|
|
|
9862
9992
|
o,
|
|
9863
9993
|
i
|
|
9864
9994
|
]);
|
|
9865
|
-
let l = nn(() =>
|
|
9995
|
+
let l = nn(() => gd(e, t, void 0, a), [
|
|
9866
9996
|
a,
|
|
9867
9997
|
e,
|
|
9868
9998
|
t
|
|
9869
9999
|
]);
|
|
9870
|
-
return l ? /* @__PURE__ */ M(
|
|
10000
|
+
return l ? /* @__PURE__ */ M(hd, {
|
|
9871
10001
|
url: l,
|
|
9872
10002
|
collection: e,
|
|
9873
10003
|
icon: t,
|
|
9874
10004
|
color: n,
|
|
9875
10005
|
className: r
|
|
9876
|
-
}) : c ? /* @__PURE__ */ M("i", {}) : /* @__PURE__ */ M(
|
|
10006
|
+
}) : c ? /* @__PURE__ */ M("i", {}) : /* @__PURE__ */ M(ld, {
|
|
9877
10007
|
collection: e,
|
|
9878
10008
|
icon: t,
|
|
9879
10009
|
color: n,
|
|
9880
10010
|
className: r,
|
|
9881
10011
|
onError: i
|
|
9882
10012
|
});
|
|
9883
|
-
},
|
|
10013
|
+
}, ld = ({ collection: e, icon: t, color: n, className: r, onError: i }) => {
|
|
9884
10014
|
let [a, o] = F(void 0);
|
|
9885
10015
|
return tn(() => {
|
|
9886
10016
|
let n = !1;
|
|
9887
|
-
return
|
|
9888
|
-
n || o(
|
|
10017
|
+
return fd(e, t).then((e) => {
|
|
10018
|
+
n || o(_d(e.width, e.height, e));
|
|
9889
10019
|
}).catch((e) => {
|
|
9890
10020
|
n || (o(void 0), i?.(e));
|
|
9891
10021
|
}), () => {
|
|
9892
10022
|
n = !0;
|
|
9893
10023
|
};
|
|
9894
10024
|
}, [e, t]), a ? /* @__PURE__ */ M("i", {
|
|
9895
|
-
className: A(r,
|
|
10025
|
+
className: A(r, Xu.icon, !a.includes("currentColor") && "is-colored"),
|
|
9896
10026
|
style: {
|
|
9897
10027
|
color: n,
|
|
9898
10028
|
"--icon": `url("${a}")`
|
|
9899
10029
|
}
|
|
9900
10030
|
}) : /* @__PURE__ */ M("i", {});
|
|
9901
|
-
},
|
|
9902
|
-
let n = `${e}:${t}`, r =
|
|
10031
|
+
}, ud = /* @__PURE__ */ new Map(), dd = /* @__PURE__ */ new Map(), fd = (e, t) => {
|
|
10032
|
+
let n = `${e}:${t}`, r = ud.get(n);
|
|
9903
10033
|
if (r) return Promise.resolve(r);
|
|
9904
|
-
let i =
|
|
10034
|
+
let i = dd.get(n);
|
|
9905
10035
|
if (i) return i;
|
|
9906
|
-
let a =
|
|
9907
|
-
return
|
|
9908
|
-
},
|
|
9909
|
-
|
|
9910
|
-
let n = await fetch(
|
|
10036
|
+
let a = md(e, t).then((e) => (ud.set(n, e), e)).finally(() => dd.delete(n));
|
|
10037
|
+
return dd.set(n, a), a;
|
|
10038
|
+
}, pd = new URL("https://api.iconify.design/codicon.json?icons=close"), md = async (e, t) => {
|
|
10039
|
+
pd.pathname = `/${e}.json`, pd.searchParams.set("icons", t);
|
|
10040
|
+
let n = await fetch(pd.href);
|
|
9911
10041
|
if (!n.ok) throw Error(`Failed to fetch ${e}:${t}: ${n.statusText}. Status: ${n.status}`);
|
|
9912
10042
|
let r = await n.json();
|
|
9913
10043
|
if (typeof r == "number") throw Error(`Failed to fetch ${e}:${t}: ${n.statusText}. Status: ${r}`);
|
|
@@ -9918,53 +10048,53 @@ var rd = ({ collection: e, icon: t, color: n, className: r, onError: i }) => {
|
|
|
9918
10048
|
i.width ||= e, i.height ||= t;
|
|
9919
10049
|
}
|
|
9920
10050
|
return i;
|
|
9921
|
-
},
|
|
9922
|
-
className: A(n,
|
|
10051
|
+
}, hd = ({ url: e, color: t, className: n }) => /* @__PURE__ */ M("i", {
|
|
10052
|
+
className: A(n, Xu.icon, !e.includes("currentColor") && "is-colored"),
|
|
9923
10053
|
style: {
|
|
9924
10054
|
color: t,
|
|
9925
10055
|
"--icon": `url("${e}")`
|
|
9926
10056
|
}
|
|
9927
|
-
}),
|
|
9928
|
-
r ||=
|
|
10057
|
+
}), gd = (e, t, n, r) => {
|
|
10058
|
+
r ||= ed;
|
|
9929
10059
|
let i, a;
|
|
9930
10060
|
if (r) {
|
|
9931
10061
|
let n = r[e];
|
|
9932
10062
|
n && (a = n.icons, i = a.icons[t]);
|
|
9933
10063
|
}
|
|
9934
|
-
if (a || (a =
|
|
9935
|
-
let r =
|
|
9936
|
-
if (r) return
|
|
10064
|
+
if (a || (a = $u[e], i = a && a.icons[t]), !i) {
|
|
10065
|
+
let r = ud.get(`${e}:${t}`);
|
|
10066
|
+
if (r) return _d(r.width, r.height, r, n);
|
|
9937
10067
|
}
|
|
9938
|
-
if (i && a) return
|
|
10068
|
+
if (i && a) return _d(i.width || a.width, i.height || a.height, i, n);
|
|
9939
10069
|
};
|
|
9940
|
-
function
|
|
10070
|
+
function _d(e, t, n, r) {
|
|
9941
10071
|
e ||= 16, t ||= 16;
|
|
9942
10072
|
let i = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${`0 0 ${e} ${t}`}" width="1em" height="1em">${n.body}</svg>`;
|
|
9943
|
-
return r && (i = i.replace(/currentColor/g, r)), `data:image/svg+xml;utf8,${
|
|
10073
|
+
return r && (i = i.replace(/currentColor/g, r)), `data:image/svg+xml;utf8,${Qu(i)}`;
|
|
9944
10074
|
}
|
|
9945
10075
|
//#endregion
|
|
9946
10076
|
//#region src/ui/browser/icons/ContentIcon.tsx
|
|
9947
|
-
var
|
|
9948
|
-
let a = nn(() =>
|
|
9949
|
-
return o?.startsWith(
|
|
10077
|
+
var vd = ({ src: e, className: t, fallback: n = null, loading: r = "lazy", decoding: i = "async" }) => {
|
|
10078
|
+
let a = nn(() => Cd(e), [e]), o = a?.source ?? e, s = nn(() => wd(o), [o]), [c, l] = F(), u = () => l(o);
|
|
10079
|
+
return o?.startsWith(yd) ? /* @__PURE__ */ M("span", {
|
|
9950
10080
|
"data-icon-kind": "initials",
|
|
9951
10081
|
"aria-hidden": "true",
|
|
9952
|
-
className: A(
|
|
9953
|
-
children: /* @__PURE__ */ M("span", { children: o.slice(
|
|
9954
|
-
}) : o ? o === c ? a == null ? n : /* @__PURE__ */ M(
|
|
10082
|
+
className: A(Yu.initials, t),
|
|
10083
|
+
children: /* @__PURE__ */ M("span", { children: o.slice(yd.length) })
|
|
10084
|
+
}) : o ? o === c ? a == null ? n : /* @__PURE__ */ M(vd, {
|
|
9955
10085
|
className: t,
|
|
9956
10086
|
fallback: n,
|
|
9957
10087
|
src: a.fallback,
|
|
9958
10088
|
loading: r,
|
|
9959
10089
|
decoding: i
|
|
9960
|
-
}) : s ? /* @__PURE__ */ M(
|
|
10090
|
+
}) : s ? /* @__PURE__ */ M(cd, {
|
|
9961
10091
|
collection: s.collection,
|
|
9962
10092
|
icon: s.icon,
|
|
9963
10093
|
color: s.color,
|
|
9964
10094
|
className: t,
|
|
9965
10095
|
onError: u
|
|
9966
10096
|
}) : /* @__PURE__ */ M("img", {
|
|
9967
|
-
className: A(
|
|
10097
|
+
className: A(Yu.img, t),
|
|
9968
10098
|
src: o,
|
|
9969
10099
|
alt: "",
|
|
9970
10100
|
decoding: i,
|
|
@@ -9972,19 +10102,19 @@ var pd = ({ src: e, className: t, fallback: n = null, loading: r = "lazy", decod
|
|
|
9972
10102
|
referrerPolicy: "no-referrer",
|
|
9973
10103
|
onError: u
|
|
9974
10104
|
}) : n;
|
|
9975
|
-
},
|
|
9976
|
-
function
|
|
9977
|
-
return `${
|
|
10105
|
+
}, yd = "data:application/vnd.open-flow.initials,";
|
|
10106
|
+
function bd(e) {
|
|
10107
|
+
return `${yd}${e}`;
|
|
9978
10108
|
}
|
|
9979
|
-
var
|
|
9980
|
-
function
|
|
9981
|
-
return `${
|
|
10109
|
+
var xd = "data:application/vnd.open-flow.image-icon+json,";
|
|
10110
|
+
function Sd(e, t) {
|
|
10111
|
+
return `${xd}${encodeURIComponent(JSON.stringify({
|
|
9982
10112
|
fallback: t,
|
|
9983
10113
|
source: e
|
|
9984
10114
|
}))}`;
|
|
9985
10115
|
}
|
|
9986
|
-
function
|
|
9987
|
-
if (e?.startsWith(
|
|
10116
|
+
function Cd(e) {
|
|
10117
|
+
if (e?.startsWith(xd)) try {
|
|
9988
10118
|
let t = JSON.parse(decodeURIComponent(e.slice(47)));
|
|
9989
10119
|
if (typeof t.fallback == "string" && typeof t.source == "string") return {
|
|
9990
10120
|
fallback: t.fallback,
|
|
@@ -9994,7 +10124,7 @@ function vd(e) {
|
|
|
9994
10124
|
return;
|
|
9995
10125
|
}
|
|
9996
10126
|
}
|
|
9997
|
-
function
|
|
10127
|
+
function wd(e) {
|
|
9998
10128
|
if (e && e.length > 2 && e[0] === ":" && e.endsWith(":")) {
|
|
9999
10129
|
let [, t, n, r] = e.split(":");
|
|
10000
10130
|
if (t && n) return {
|
|
@@ -10007,22 +10137,22 @@ function yd(e) {
|
|
|
10007
10137
|
}
|
|
10008
10138
|
//#endregion
|
|
10009
10139
|
//#region src/workbench/browser/runtime/providerIcon.ts
|
|
10010
|
-
function
|
|
10011
|
-
let n =
|
|
10012
|
-
return r == null ? n :
|
|
10140
|
+
function Td(e, t = Ju) {
|
|
10141
|
+
let n = bd(Dd(e.serviceName)), r = Ed(e, t);
|
|
10142
|
+
return r == null ? n : Sd(r, n);
|
|
10013
10143
|
}
|
|
10014
|
-
function
|
|
10144
|
+
function Ed(e, t = Ju) {
|
|
10015
10145
|
let n = e.icon?.trim();
|
|
10016
10146
|
if (n) return n;
|
|
10017
10147
|
let r = t[e.serviceId]?.trim();
|
|
10018
10148
|
if (r) return r;
|
|
10019
|
-
let i =
|
|
10149
|
+
let i = Od(e.homepageUrl);
|
|
10020
10150
|
return i == null ? void 0 : `https://www.google.com/s2/favicons?sz=64&domain=${encodeURIComponent(i)}`;
|
|
10021
10151
|
}
|
|
10022
|
-
function
|
|
10152
|
+
function Dd(e) {
|
|
10023
10153
|
return e.split(/\s+/).map((e) => e[0]).join("").slice(0, 2).toUpperCase() || "?";
|
|
10024
10154
|
}
|
|
10025
|
-
function
|
|
10155
|
+
function Od(e) {
|
|
10026
10156
|
if (e) try {
|
|
10027
10157
|
return new URL(e).hostname || void 0;
|
|
10028
10158
|
} catch {
|
|
@@ -10031,14 +10161,14 @@ function Cd(e) {
|
|
|
10031
10161
|
}
|
|
10032
10162
|
//#endregion
|
|
10033
10163
|
//#region src/workbench/browser/runtime/workspace.ts
|
|
10034
|
-
function
|
|
10035
|
-
let n = e.authenticated && t != null ?
|
|
10164
|
+
function kd(e, t) {
|
|
10165
|
+
let n = e.authenticated && t != null ? Ad(t).preferred : void 0;
|
|
10036
10166
|
return {
|
|
10037
10167
|
...e,
|
|
10038
10168
|
...n == null ? {} : { defaultConnection: n }
|
|
10039
10169
|
};
|
|
10040
10170
|
}
|
|
10041
|
-
function
|
|
10171
|
+
function Ad(e) {
|
|
10042
10172
|
let t = [], n = /* @__PURE__ */ new Map(), r;
|
|
10043
10173
|
for (let i of e) n.set(i.connectionId, i), i.status == "active" && (t.push(i), i.isDefault && (r = i));
|
|
10044
10174
|
return {
|
|
@@ -10048,7 +10178,7 @@ function Td(e) {
|
|
|
10048
10178
|
preferred: r ?? (t.length == 1 ? t[0] : void 0)
|
|
10049
10179
|
};
|
|
10050
10180
|
}
|
|
10051
|
-
function
|
|
10181
|
+
function jd(e, t) {
|
|
10052
10182
|
if (e.node.name != null) return e.node.name;
|
|
10053
10183
|
switch (e.kind) {
|
|
10054
10184
|
case "condition": return t?.("addNode.condition") ?? "Condition";
|
|
@@ -10058,7 +10188,7 @@ function Ed(e, t) {
|
|
|
10058
10188
|
case "task": return e.definition?.name ?? (e.node.task == null ? e.node.taskId : e.node.task.moduleId);
|
|
10059
10189
|
}
|
|
10060
10190
|
}
|
|
10061
|
-
function
|
|
10191
|
+
function Md(e) {
|
|
10062
10192
|
switch (e.kind) {
|
|
10063
10193
|
case "condition": return ":carbon:child-node:";
|
|
10064
10194
|
case "subflow": return ":carbon:subflow:";
|
|
@@ -10073,43 +10203,43 @@ function Dd(e) {
|
|
|
10073
10203
|
function $(e) {
|
|
10074
10204
|
if (!(typeof e != "object" || !e || Array.isArray(e))) return e;
|
|
10075
10205
|
}
|
|
10076
|
-
function
|
|
10206
|
+
function Nd(e) {
|
|
10077
10207
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
10078
10208
|
}
|
|
10079
|
-
function
|
|
10209
|
+
function Pd(e, t) {
|
|
10080
10210
|
let n = $(e.designer);
|
|
10081
|
-
if (n?.version == 1) return
|
|
10211
|
+
if (n?.version == 1) return af(n, t);
|
|
10082
10212
|
}
|
|
10083
|
-
function
|
|
10213
|
+
function Fd(e, t) {
|
|
10084
10214
|
return ((e) => Object.fromEntries(Object.entries($(e) ?? {}).flatMap(([e, t]) => {
|
|
10085
|
-
let n = $(t), r =
|
|
10215
|
+
let n = $(t), r = Nd(n?.x), i = Nd(n?.y);
|
|
10086
10216
|
return r == null || i == null ? [] : [[e, {
|
|
10087
10217
|
x: r,
|
|
10088
10218
|
y: i
|
|
10089
10219
|
}]];
|
|
10090
|
-
})))(
|
|
10220
|
+
})))(Pd(e, t)?.nodes);
|
|
10091
10221
|
}
|
|
10092
|
-
function
|
|
10093
|
-
let n =
|
|
10222
|
+
function Id(e, t) {
|
|
10223
|
+
let n = Fd(e, t), r = Pd(e, t)?.order, i = Array.isArray(r) ? r.flatMap((e) => typeof e == "string" && n[e] != null ? [e] : []) : [];
|
|
10094
10224
|
return [.../* @__PURE__ */ new Set([...i, ...Object.keys(n)])];
|
|
10095
10225
|
}
|
|
10096
|
-
function
|
|
10097
|
-
let n = $(
|
|
10226
|
+
function Ld(e, t) {
|
|
10227
|
+
let n = $(Pd(e, t)?.viewport), r = Nd(n?.x), i = Nd(n?.y), a = Nd(n?.zoom);
|
|
10098
10228
|
return r == null || i == null || a == null || a <= 0 ? void 0 : {
|
|
10099
10229
|
x: r,
|
|
10100
10230
|
y: i,
|
|
10101
10231
|
zoom: a
|
|
10102
10232
|
};
|
|
10103
10233
|
}
|
|
10104
|
-
function
|
|
10105
|
-
return
|
|
10234
|
+
function Rd(e, t) {
|
|
10235
|
+
return Ld(e, t) ?? {
|
|
10106
10236
|
x: 0,
|
|
10107
10237
|
y: 0,
|
|
10108
10238
|
zoom: 1
|
|
10109
10239
|
};
|
|
10110
10240
|
}
|
|
10111
|
-
function
|
|
10112
|
-
let r = $(
|
|
10241
|
+
function zd(e, t, n) {
|
|
10242
|
+
let r = $(Pd(e, t)?.comments) ?? {};
|
|
10113
10243
|
return Object.fromEntries(Object.entries(r).flatMap(([e, t]) => {
|
|
10114
10244
|
let r = $(t), i = typeof r?.title == "string" ? r.title : void 0, a = typeof r?.content == "string" ? r.content : void 0;
|
|
10115
10245
|
return i == null || a == null ? [] : [[e, {
|
|
@@ -10122,7 +10252,7 @@ function Pd(e, t, n) {
|
|
|
10122
10252
|
}]];
|
|
10123
10253
|
}));
|
|
10124
10254
|
}
|
|
10125
|
-
function
|
|
10255
|
+
function Bd(e, t, n, r) {
|
|
10126
10256
|
return JSON.stringify([
|
|
10127
10257
|
e,
|
|
10128
10258
|
t,
|
|
@@ -10130,13 +10260,10 @@ function Fd(e, t, n, r) {
|
|
|
10130
10260
|
r
|
|
10131
10261
|
]);
|
|
10132
10262
|
}
|
|
10133
|
-
function
|
|
10263
|
+
function Vd(e) {
|
|
10134
10264
|
if (e.kind == "trigger") return {
|
|
10135
10265
|
inputs: /* @__PURE__ */ new Map(),
|
|
10136
|
-
outputs:
|
|
10137
|
-
jsonSchema: eu(e.trigger),
|
|
10138
|
-
nullable: !1
|
|
10139
|
-
}]])
|
|
10266
|
+
outputs: new Map(Object.entries(gu(e.trigger)))
|
|
10140
10267
|
};
|
|
10141
10268
|
let t = new Map(Object.keys(e.node.inputs).map((e) => [e, {}])), n = /* @__PURE__ */ new Map();
|
|
10142
10269
|
switch (e.kind) {
|
|
@@ -10171,7 +10298,7 @@ function Id(e) {
|
|
|
10171
10298
|
jsonSchema: e.node.input.jsonSchema,
|
|
10172
10299
|
nullable: e.node.input.nullable
|
|
10173
10300
|
});
|
|
10174
|
-
for (let [t, r] of Object.entries(
|
|
10301
|
+
for (let [t, r] of Object.entries(vu(e.node))) n.set(t, r);
|
|
10175
10302
|
break;
|
|
10176
10303
|
case "subflow": {
|
|
10177
10304
|
let r = e.definition;
|
|
@@ -10217,7 +10344,7 @@ function Id(e) {
|
|
|
10217
10344
|
outputs: n
|
|
10218
10345
|
};
|
|
10219
10346
|
}
|
|
10220
|
-
function
|
|
10347
|
+
function Hd(e) {
|
|
10221
10348
|
switch (e) {
|
|
10222
10349
|
case "endsWith": return "ends with";
|
|
10223
10350
|
case "hasKey": return "has key";
|
|
@@ -10241,7 +10368,7 @@ function Ld(e) {
|
|
|
10241
10368
|
case "contains": return e;
|
|
10242
10369
|
}
|
|
10243
10370
|
}
|
|
10244
|
-
function
|
|
10371
|
+
function Ud(e, t, n) {
|
|
10245
10372
|
let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
|
|
10246
10373
|
if (t.kind == "task") {
|
|
10247
10374
|
t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
|
|
@@ -10250,7 +10377,7 @@ function Rd(e, t, n) {
|
|
|
10250
10377
|
} else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
|
|
10251
10378
|
return n.filter((e) => i.some((t) => e.path.startsWith(t))).length;
|
|
10252
10379
|
}
|
|
10253
|
-
function
|
|
10380
|
+
function Wd(e, t, n, r) {
|
|
10254
10381
|
if (t.kind != "flow" || n?.flowId != e.revision.flowId || n.revisionId != e.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
|
|
10255
10382
|
let i = n.status == "queued" || n.status == "starting" || n.status == "running" || n.status == "waiting", a = /* @__PURE__ */ new Map();
|
|
10256
10383
|
if ("waits" in n) for (let e of n.waits) a.set(e.nodeId, {
|
|
@@ -10262,6 +10389,7 @@ function zd(e, t, n, r) {
|
|
|
10262
10389
|
nodes: a,
|
|
10263
10390
|
status: i ? "running" : "idle"
|
|
10264
10391
|
};
|
|
10392
|
+
let s = /* @__PURE__ */ new Map();
|
|
10265
10393
|
for (let t of r) {
|
|
10266
10394
|
if (t.payload.scopeId != o || t.payload.flowId != e.revision.flowId) continue;
|
|
10267
10395
|
let r = t.payload.nodeId;
|
|
@@ -10269,7 +10397,7 @@ function zd(e, t, n, r) {
|
|
|
10269
10397
|
let i = a.get(r);
|
|
10270
10398
|
switch (t.kind) {
|
|
10271
10399
|
case "node.started":
|
|
10272
|
-
a.set(r, {
|
|
10400
|
+
s.set(t.payload.executionId, r), a.set(r, {
|
|
10273
10401
|
...i,
|
|
10274
10402
|
runId: n.runId,
|
|
10275
10403
|
startedAt: t.createdAt,
|
|
@@ -10286,7 +10414,7 @@ function zd(e, t, n, r) {
|
|
|
10286
10414
|
break;
|
|
10287
10415
|
}
|
|
10288
10416
|
case "node.completed":
|
|
10289
|
-
a.set(r, {
|
|
10417
|
+
s.delete(t.payload.executionId), a.set(r, {
|
|
10290
10418
|
...i,
|
|
10291
10419
|
runId: n.runId,
|
|
10292
10420
|
finishedAt: t.createdAt,
|
|
@@ -10297,7 +10425,7 @@ function zd(e, t, n, r) {
|
|
|
10297
10425
|
});
|
|
10298
10426
|
break;
|
|
10299
10427
|
case "node.failed":
|
|
10300
|
-
a.set(r, {
|
|
10428
|
+
s.delete(t.payload.executionId), a.set(r, {
|
|
10301
10429
|
...i,
|
|
10302
10430
|
runId: n.runId,
|
|
10303
10431
|
finishedAt: t.createdAt,
|
|
@@ -10325,7 +10453,21 @@ function zd(e, t, n, r) {
|
|
|
10325
10453
|
});
|
|
10326
10454
|
}
|
|
10327
10455
|
}
|
|
10328
|
-
if (
|
|
10456
|
+
if (i) {
|
|
10457
|
+
let e = /* @__PURE__ */ new Map();
|
|
10458
|
+
for (let t of s.values()) e.set(t, (e.get(t) ?? 0) + 1), a.set(t, {
|
|
10459
|
+
...a.get(t),
|
|
10460
|
+
runId: n.runId,
|
|
10461
|
+
status: "running"
|
|
10462
|
+
});
|
|
10463
|
+
let t = /* @__PURE__ */ new Map();
|
|
10464
|
+
if ("waits" in n) for (let e of n.waits) t.set(e.nodeId, (t.get(e.nodeId) ?? 0) + 1);
|
|
10465
|
+
for (let [r, i] of t) (e.get(r) ?? 0) <= i && a.set(r, {
|
|
10466
|
+
...a.get(r),
|
|
10467
|
+
runId: n.runId,
|
|
10468
|
+
status: "waiting"
|
|
10469
|
+
});
|
|
10470
|
+
} else for (let [e, t] of a) (t.status == "running" || t.status == "waiting") && a.set(e, {
|
|
10329
10471
|
...t,
|
|
10330
10472
|
status: "idle"
|
|
10331
10473
|
});
|
|
@@ -10334,10 +10476,10 @@ function zd(e, t, n, r) {
|
|
|
10334
10476
|
status: i ? "running" : "idle"
|
|
10335
10477
|
};
|
|
10336
10478
|
}
|
|
10337
|
-
function
|
|
10479
|
+
function Gd(e, t, n) {
|
|
10338
10480
|
if (e != null) return "moduleId" in e ? n?.("designer.executorJavaScript") ?? "javascript" : e.executor.kind == "agent" ? "Agent" : e.executor.kind == "llm" ? n?.("designer.executorLlm") ?? "llm" : `${n?.("designer.executorConnector") ?? "connector"} · ${t ?? e.executor.action.split(".")[0]}`;
|
|
10339
10481
|
}
|
|
10340
|
-
function
|
|
10482
|
+
function Kd(e) {
|
|
10341
10483
|
switch (e.kind) {
|
|
10342
10484
|
case "manual": return ":carbon:play:";
|
|
10343
10485
|
case "cron": return ":carbon:time:";
|
|
@@ -10346,11 +10488,11 @@ function Vd(e) {
|
|
|
10346
10488
|
case "webhook": return ":carbon:webhook:";
|
|
10347
10489
|
}
|
|
10348
10490
|
}
|
|
10349
|
-
function
|
|
10491
|
+
function qd(e, t) {
|
|
10350
10492
|
let n = `/document/graph/nodes/${e}`;
|
|
10351
10493
|
return t.filter((e) => e.code != "trigger.config-incomplete" && (e.path == n || e.path.startsWith(`${n}/`)));
|
|
10352
10494
|
}
|
|
10353
|
-
function
|
|
10495
|
+
function Jd(e, t) {
|
|
10354
10496
|
let n = [], r = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), i = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), a = Array.isArray(e.edges) ? e.edges : [];
|
|
10355
10497
|
for (let e of a) {
|
|
10356
10498
|
if (typeof e != "object" || !e || Array.isArray(e)) continue;
|
|
@@ -10358,7 +10500,7 @@ function Ud(e, t) {
|
|
|
10358
10500
|
if (typeof a.source != "string" || typeof a.target != "string" || a.sourceHandle != null && typeof a.sourceHandle != "string" || !t.has(a.source) || !t.has(a.target)) continue;
|
|
10359
10501
|
let o = a.sourceHandle == null ? "$out" : `$branch:${a.sourceHandle}`;
|
|
10360
10502
|
n.push({
|
|
10361
|
-
id:
|
|
10503
|
+
id: Bd(a.source, o, a.target, "$in"),
|
|
10362
10504
|
source: a.source,
|
|
10363
10505
|
sourceHandle: o,
|
|
10364
10506
|
target: a.target,
|
|
@@ -10371,7 +10513,7 @@ function Ud(e, t) {
|
|
|
10371
10513
|
edges: n
|
|
10372
10514
|
};
|
|
10373
10515
|
}
|
|
10374
|
-
function
|
|
10516
|
+
function Yd(e, t, n) {
|
|
10375
10517
|
let r = new Map([...t].map(([e, t]) => [e, t.size])), i = /* @__PURE__ */ new Map(), a = [], o = /* @__PURE__ */ new Set(), s = [...r].filter(([, e]) => e == 0).map(([e]) => e).toSorted();
|
|
10376
10518
|
for (let e = 0; e < s.length; e += 1) {
|
|
10377
10519
|
let t = s[e];
|
|
@@ -10390,14 +10532,14 @@ function Wd(e, t, n) {
|
|
|
10390
10532
|
ordered: a
|
|
10391
10533
|
};
|
|
10392
10534
|
}
|
|
10393
|
-
function
|
|
10535
|
+
function Xd(e, t, n) {
|
|
10394
10536
|
if (!("inputs" in t)) return [];
|
|
10395
10537
|
let r = [];
|
|
10396
10538
|
for (let [i, a] of n.inputs) {
|
|
10397
10539
|
let n = t.inputs[i], o = [], s = /* @__PURE__ */ new Set();
|
|
10398
10540
|
if (n?.kind == "sources") for (let t of n.sources) {
|
|
10399
10541
|
if (t.kind != "node") continue;
|
|
10400
|
-
let n = t.nodeId, r = t.output, a =
|
|
10542
|
+
let n = t.nodeId, r = t.output, a = Bd(n, r, e, i);
|
|
10401
10543
|
s.has(a) || (s.add(a), o.push({
|
|
10402
10544
|
nodeId: n,
|
|
10403
10545
|
output: r
|
|
@@ -10412,10 +10554,10 @@ function Gd(e, t, n) {
|
|
|
10412
10554
|
}
|
|
10413
10555
|
return r;
|
|
10414
10556
|
}
|
|
10415
|
-
function
|
|
10557
|
+
function Zd(e) {
|
|
10416
10558
|
return [...e.outputs].map(([e, t]) => Object.assign({ handle: e }, t));
|
|
10417
10559
|
}
|
|
10418
|
-
function
|
|
10560
|
+
function Qd(e, t) {
|
|
10419
10561
|
if (e.kind != "task" || e.definition == null) return t;
|
|
10420
10562
|
let n = new Map(t.map((e) => [e.handle, e])), r = [];
|
|
10421
10563
|
for (let t of e.definition.inputs) {
|
|
@@ -10428,7 +10570,7 @@ function qd(e, t) {
|
|
|
10428
10570
|
}
|
|
10429
10571
|
return r.push(...n.values()), r;
|
|
10430
10572
|
}
|
|
10431
|
-
function
|
|
10573
|
+
function $d(e, t) {
|
|
10432
10574
|
if (e.kind != "task" || e.definition == null) return t;
|
|
10433
10575
|
let n = new Map(t.map((e) => [e.handle, e])), r = [];
|
|
10434
10576
|
for (let t of e.definition.outputs) {
|
|
@@ -10441,8 +10583,8 @@ function Jd(e, t) {
|
|
|
10441
10583
|
}
|
|
10442
10584
|
return r.push(...n.values()), r;
|
|
10443
10585
|
}
|
|
10444
|
-
function
|
|
10445
|
-
let a =
|
|
10586
|
+
function ef(e, t, n, r, i) {
|
|
10587
|
+
let a = qd(e, r), o = a.some((e) => e.code == "trigger.connection-missing" || e.code == "trigger.connection-invalid"), s = t.kind == "integration" || t.kind == "poll" ? i[t.definition.provider] : void 0, c;
|
|
10446
10588
|
switch (t.kind) {
|
|
10447
10589
|
case "manual":
|
|
10448
10590
|
c = {
|
|
@@ -10479,34 +10621,30 @@ function Yd(e, t, n, r, i) {
|
|
|
10479
10621
|
description: t.description,
|
|
10480
10622
|
diagnostics: a.length,
|
|
10481
10623
|
connectionRequired: o,
|
|
10482
|
-
icon: t.icon ?? (t.kind == "integration" || t.kind == "poll" ?
|
|
10624
|
+
icon: t.icon ?? (t.kind == "integration" || t.kind == "poll" ? Td(s ?? {
|
|
10483
10625
|
serviceId: t.definition.provider,
|
|
10484
10626
|
serviceName: t.definition.provider
|
|
10485
|
-
}) :
|
|
10627
|
+
}) : Kd(t)),
|
|
10486
10628
|
id: e,
|
|
10487
10629
|
inputs: [],
|
|
10488
10630
|
kind: "trigger",
|
|
10489
|
-
outputs: [{
|
|
10490
|
-
handle: "payload",
|
|
10491
|
-
jsonSchema: eu(t),
|
|
10492
|
-
nullable: !1
|
|
10493
|
-
}],
|
|
10631
|
+
outputs: Object.entries(gu(t)).map(([e, t]) => Object.assign({ handle: e }, t)),
|
|
10494
10632
|
presentation: c,
|
|
10495
10633
|
position: n,
|
|
10496
10634
|
title: t.name
|
|
10497
10635
|
};
|
|
10498
10636
|
}
|
|
10499
|
-
function
|
|
10500
|
-
let a = t.node, o =
|
|
10637
|
+
function tf(e, t, n, r, i) {
|
|
10638
|
+
let a = t.node, o = Qd(t, Xd(e, a, n)), s = $d(t, Zd(n)), c = t.kind == "task" ? t.definition : void 0, l = c != null && "executor" in c && c.executor.kind == "connector" ? c.executor : void 0, u = l == null ? void 0 : i.connectorActions[l.action], d = u == null ? void 0 : i.connectionCatalogs[u.serviceId], f = l?.connectionId, p = f == null ? void 0 : d?.byId.get(f), m = u?.authenticated == 1 && (l?.connectionId == null || d != null && p?.status != "active"), h = i.runNodes.get(e), g = {
|
|
10501
10639
|
description: a.description,
|
|
10502
|
-
diagnostics:
|
|
10503
|
-
icon: a.icon ?? (u == null ?
|
|
10640
|
+
diagnostics: Ud(i.target, t, i.diagnostics),
|
|
10641
|
+
icon: a.icon ?? (u == null ? Md(t) : Td(u)),
|
|
10504
10642
|
id: e,
|
|
10505
10643
|
inputs: o,
|
|
10506
10644
|
outputs: s,
|
|
10507
10645
|
position: r,
|
|
10508
10646
|
...h == null ? {} : { run: h },
|
|
10509
|
-
title:
|
|
10647
|
+
title: jd(t, i.t)
|
|
10510
10648
|
};
|
|
10511
10649
|
switch (a.kind) {
|
|
10512
10650
|
case "condition": return {
|
|
@@ -10515,7 +10653,7 @@ function Xd(e, t, n, r, i) {
|
|
|
10515
10653
|
cases: a.cases.map((e) => ({
|
|
10516
10654
|
expressions: e.expressions.map((e) => ({
|
|
10517
10655
|
input: e.input,
|
|
10518
|
-
operator:
|
|
10656
|
+
operator: Hd(e.operator),
|
|
10519
10657
|
value: e.value
|
|
10520
10658
|
})),
|
|
10521
10659
|
output: e.output,
|
|
@@ -10535,13 +10673,13 @@ function Xd(e, t, n, r, i) {
|
|
|
10535
10673
|
return t == null || "group" in t ? [] : [t];
|
|
10536
10674
|
}),
|
|
10537
10675
|
kind: a.kind,
|
|
10538
|
-
executorName:
|
|
10676
|
+
executorName: Gd(c, u?.serviceName, i.t),
|
|
10539
10677
|
connectionRequired: m,
|
|
10540
10678
|
...c != null && "executor" in c && c.executor.kind == "agent" ? { tools: c.executor.tools.map((e) => {
|
|
10541
10679
|
let t = i.connectorActions[e.action], n = t?.serviceId ?? e.action.split(".")[0], r = t?.serviceName ?? n;
|
|
10542
10680
|
return {
|
|
10543
10681
|
id: e.id,
|
|
10544
|
-
icon:
|
|
10682
|
+
icon: Td(t ?? {
|
|
10545
10683
|
serviceId: n,
|
|
10546
10684
|
serviceName: r
|
|
10547
10685
|
}),
|
|
@@ -10561,8 +10699,8 @@ function Xd(e, t, n, r, i) {
|
|
|
10561
10699
|
};
|
|
10562
10700
|
}
|
|
10563
10701
|
}
|
|
10564
|
-
function
|
|
10565
|
-
let u = e == null ? void 0 :
|
|
10702
|
+
function nf(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
|
|
10703
|
+
let u = e == null ? void 0 : Lu(e), d = u == null || t == null ? void 0 : u.graph(t);
|
|
10566
10704
|
if (u == null || t == null || d == null) return {
|
|
10567
10705
|
edges: [],
|
|
10568
10706
|
nodes: [],
|
|
@@ -10572,7 +10710,7 @@ function Zd(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
|
|
|
10572
10710
|
zoom: 1
|
|
10573
10711
|
}
|
|
10574
10712
|
};
|
|
10575
|
-
let f =
|
|
10713
|
+
let f = Wd(u, t, s, c), p = Object.entries(d.nodes), m = new Map(p.map(([e, t]) => [e, u.resolveNode(e, t)])), h = new Set(p.map(([e]) => e)), g = new Map([...m].map(([e, t]) => [e, Vd(t)])), _ = Jd(d, h), v = Yd(h, _.dependencies, _.dependents), y = Fd(n, t), b = $(Pd(n, t)?.hiddenNodeContent), x = {
|
|
10576
10714
|
connectionCatalogs: a,
|
|
10577
10715
|
connectorActions: i,
|
|
10578
10716
|
diagnostics: r,
|
|
@@ -10590,39 +10728,39 @@ function Zd(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
|
|
|
10590
10728
|
}, a = m.get(e);
|
|
10591
10729
|
if (a.kind == "trigger") {
|
|
10592
10730
|
S.push({
|
|
10593
|
-
...
|
|
10731
|
+
...ef(e, a.trigger, i, r, l),
|
|
10594
10732
|
contentHidden: b?.[e] === !0
|
|
10595
10733
|
});
|
|
10596
10734
|
continue;
|
|
10597
10735
|
}
|
|
10598
|
-
let o =
|
|
10736
|
+
let o = tf(e, a, g.get(e), i, x);
|
|
10599
10737
|
S.push({
|
|
10600
10738
|
...o,
|
|
10601
10739
|
contentHidden: b?.[e] === !0
|
|
10602
10740
|
});
|
|
10603
10741
|
}
|
|
10604
|
-
for (let [e, r] of Object.entries(
|
|
10742
|
+
for (let [e, r] of Object.entries(zd(n, t, y)).toSorted(([e], [t]) => e.localeCompare(t))) S.push({
|
|
10605
10743
|
...r,
|
|
10606
10744
|
id: e,
|
|
10607
10745
|
kind: "comment",
|
|
10608
10746
|
contentHidden: b?.[e] === !0
|
|
10609
10747
|
});
|
|
10610
|
-
let C = new Map(
|
|
10748
|
+
let C = new Map(Id(n, t).map((e, t) => [e, t]));
|
|
10611
10749
|
return S.sort((e, t) => (C.get(e.id) ?? -1) - (C.get(t.id) ?? -1)), {
|
|
10612
10750
|
edges: _.edges,
|
|
10613
10751
|
nodes: S,
|
|
10614
10752
|
...f.status == null ? {} : { runStatus: f.status },
|
|
10615
|
-
viewport:
|
|
10753
|
+
viewport: Rd(n, t)
|
|
10616
10754
|
};
|
|
10617
10755
|
}
|
|
10618
|
-
function
|
|
10756
|
+
function rf(e) {
|
|
10619
10757
|
let t = $(e.designer);
|
|
10620
10758
|
return t?.version == 1 ? t : { version: 1 };
|
|
10621
10759
|
}
|
|
10622
|
-
function
|
|
10760
|
+
function af(e, t) {
|
|
10623
10761
|
return t.kind == "flow" ? $(e.flow) : $($(e.subflows)?.[t.id]);
|
|
10624
10762
|
}
|
|
10625
|
-
function
|
|
10763
|
+
function of(e, t, n) {
|
|
10626
10764
|
if (t.kind == "flow") return {
|
|
10627
10765
|
...e,
|
|
10628
10766
|
flow: n,
|
|
@@ -10638,17 +10776,17 @@ function ef(e, t, n) {
|
|
|
10638
10776
|
version: 1
|
|
10639
10777
|
};
|
|
10640
10778
|
}
|
|
10641
|
-
function
|
|
10779
|
+
function sf(e, t) {
|
|
10642
10780
|
let n = {
|
|
10643
|
-
...
|
|
10644
|
-
viewport: { ...
|
|
10645
|
-
nodes:
|
|
10646
|
-
order:
|
|
10781
|
+
...Pd(e, t),
|
|
10782
|
+
viewport: { ...Rd(e, t) },
|
|
10783
|
+
nodes: Fd(e, t),
|
|
10784
|
+
order: Id(e, t)
|
|
10647
10785
|
};
|
|
10648
10786
|
return delete n.layouts, n;
|
|
10649
10787
|
}
|
|
10650
|
-
function
|
|
10651
|
-
let r =
|
|
10788
|
+
function cf(e, t, n) {
|
|
10789
|
+
let r = rf(e), i = sf(e, t), a = $(i.nodes) ?? {}, o = [...Id(e, t)];
|
|
10652
10790
|
for (let e of Object.keys(n)) o.includes(e) || o.push(e);
|
|
10653
10791
|
let s = {
|
|
10654
10792
|
...a,
|
|
@@ -10659,29 +10797,29 @@ function nf(e, t, n) {
|
|
|
10659
10797
|
};
|
|
10660
10798
|
return {
|
|
10661
10799
|
...e,
|
|
10662
|
-
designer:
|
|
10800
|
+
designer: of(r, t, {
|
|
10663
10801
|
...i,
|
|
10664
10802
|
nodes: s,
|
|
10665
10803
|
order: o
|
|
10666
10804
|
})
|
|
10667
10805
|
};
|
|
10668
10806
|
}
|
|
10669
|
-
function
|
|
10670
|
-
if ($(
|
|
10671
|
-
let i =
|
|
10807
|
+
function lf(e, t, n, r) {
|
|
10808
|
+
if ($(Pd(e, t)?.hiddenNodeContent)?.[n] === !0 === r) return e;
|
|
10809
|
+
let i = sf(e, t), a = { ...$(i.hiddenNodeContent) };
|
|
10672
10810
|
return r ? a[n] = !0 : delete a[n], {
|
|
10673
10811
|
...e,
|
|
10674
|
-
designer:
|
|
10812
|
+
designer: of(rf(e), t, {
|
|
10675
10813
|
...i,
|
|
10676
10814
|
hiddenNodeContent: a
|
|
10677
10815
|
})
|
|
10678
10816
|
};
|
|
10679
10817
|
}
|
|
10680
|
-
function
|
|
10681
|
-
let i =
|
|
10818
|
+
function uf(e, t, n, r) {
|
|
10819
|
+
let i = cf(e, t, { [n]: r.position }), a = rf(i), o = af(a, t) ?? {}, s = $(o.comments) ?? {};
|
|
10682
10820
|
return {
|
|
10683
10821
|
...i,
|
|
10684
|
-
designer:
|
|
10822
|
+
designer: of(a, t, {
|
|
10685
10823
|
...o,
|
|
10686
10824
|
comments: {
|
|
10687
10825
|
...s,
|
|
@@ -10693,13 +10831,13 @@ function af(e, t, n, r) {
|
|
|
10693
10831
|
})
|
|
10694
10832
|
};
|
|
10695
10833
|
}
|
|
10696
|
-
function
|
|
10697
|
-
let r =
|
|
10834
|
+
function df(e, t, n) {
|
|
10835
|
+
let r = rf(e), i = sf(e, t), a = { ...$(i.comments) }, o = { ...$(i.nodes) };
|
|
10698
10836
|
for (let e of n) delete a[e], delete o[e];
|
|
10699
|
-
let s =
|
|
10837
|
+
let s = Id(e, t).filter((e) => !n.has(e));
|
|
10700
10838
|
return {
|
|
10701
10839
|
...e,
|
|
10702
|
-
designer:
|
|
10840
|
+
designer: of(r, t, {
|
|
10703
10841
|
...i,
|
|
10704
10842
|
comments: a,
|
|
10705
10843
|
nodes: o,
|
|
@@ -10707,16 +10845,16 @@ function of(e, t, n) {
|
|
|
10707
10845
|
})
|
|
10708
10846
|
};
|
|
10709
10847
|
}
|
|
10710
|
-
function
|
|
10711
|
-
return new Set(Object.keys($(
|
|
10848
|
+
function ff(e, t) {
|
|
10849
|
+
return new Set(Object.keys($(Pd(e, t)?.comments) ?? {}));
|
|
10712
10850
|
}
|
|
10713
|
-
function
|
|
10714
|
-
let r =
|
|
10851
|
+
function pf(e, t, n) {
|
|
10852
|
+
let r = Ld(e, t);
|
|
10715
10853
|
if (r?.x == n.x && r.y == n.y && r.zoom == n.zoom) return e;
|
|
10716
|
-
let i =
|
|
10854
|
+
let i = rf(e), a = sf(e, t);
|
|
10717
10855
|
return {
|
|
10718
10856
|
...e,
|
|
10719
|
-
designer:
|
|
10857
|
+
designer: of(i, t, {
|
|
10720
10858
|
...a,
|
|
10721
10859
|
viewport: {
|
|
10722
10860
|
x: n.x,
|
|
@@ -10726,7 +10864,7 @@ function cf(e, t, n) {
|
|
|
10726
10864
|
})
|
|
10727
10865
|
};
|
|
10728
10866
|
}
|
|
10729
|
-
function
|
|
10867
|
+
function mf(e, t, n) {
|
|
10730
10868
|
let r = e.kind == "node.started" ? e.payload.nodeTitle : void 0;
|
|
10731
10869
|
if (typeof r == "string") return r;
|
|
10732
10870
|
let i = "executionId" in e.payload ? e.payload.executionId : void 0;
|
|
@@ -10737,8 +10875,8 @@ function lf(e, t, n) {
|
|
|
10737
10875
|
let a = e.payload.nodeId;
|
|
10738
10876
|
return typeof a == "string" ? n?.get(a) ?? a : e.kind.startsWith("run.") ? t?.("run.flowSubject") ?? "Flow run" : t?.("run.nodeSubject") ?? "Node";
|
|
10739
10877
|
}
|
|
10740
|
-
function
|
|
10741
|
-
let r =
|
|
10878
|
+
function hf(e, t, n) {
|
|
10879
|
+
let r = sf(e, n), i = sf(t, n), a = /* @__PURE__ */ new Set();
|
|
10742
10880
|
for (let e of [
|
|
10743
10881
|
"nodes",
|
|
10744
10882
|
"comments",
|
|
@@ -10756,13 +10894,13 @@ function uf(e, t, n) {
|
|
|
10756
10894
|
before: o(r),
|
|
10757
10895
|
after: o(i),
|
|
10758
10896
|
nodeIds: [...a],
|
|
10759
|
-
beforeOrder:
|
|
10760
|
-
afterOrder:
|
|
10897
|
+
beforeOrder: Id(e, n),
|
|
10898
|
+
afterOrder: Id(t, n)
|
|
10761
10899
|
};
|
|
10762
10900
|
}
|
|
10763
|
-
function
|
|
10901
|
+
function gf(e, t, n, r) {
|
|
10764
10902
|
if (n.nodeIds.length == 0) return e;
|
|
10765
|
-
let i =
|
|
10903
|
+
let i = sf(e, t), a = r ? n.after : n.before;
|
|
10766
10904
|
for (let e of [
|
|
10767
10905
|
"nodes",
|
|
10768
10906
|
"comments",
|
|
@@ -10774,17 +10912,17 @@ function df(e, t, n, r) {
|
|
|
10774
10912
|
}
|
|
10775
10913
|
return i.order = [...r ? n.afterOrder : n.beforeOrder], {
|
|
10776
10914
|
...e,
|
|
10777
|
-
designer:
|
|
10915
|
+
designer: of(rf(e), t, i)
|
|
10778
10916
|
};
|
|
10779
10917
|
}
|
|
10780
10918
|
//#endregion
|
|
10781
10919
|
//#region src/workbench/browser/runtime/stores/resource.ts
|
|
10782
|
-
var
|
|
10783
|
-
function
|
|
10784
|
-
let n =
|
|
10785
|
-
return n ?? (n = e(t, (e) => e.data),
|
|
10920
|
+
var _f = /* @__PURE__ */ new WeakMap();
|
|
10921
|
+
function vf(t) {
|
|
10922
|
+
let n = _f.get(t);
|
|
10923
|
+
return n ?? (n = e(t, (e) => e.data), _f.set(t, n)), n;
|
|
10786
10924
|
}
|
|
10787
|
-
var
|
|
10925
|
+
var yf = class {
|
|
10788
10926
|
#e;
|
|
10789
10927
|
#t;
|
|
10790
10928
|
#n;
|
|
@@ -10874,7 +11012,7 @@ var mf = class {
|
|
|
10874
11012
|
}), this.#e.dispose();
|
|
10875
11013
|
}
|
|
10876
11014
|
};
|
|
10877
|
-
function
|
|
11015
|
+
function bf(e, t, n = !1) {
|
|
10878
11016
|
return new Promise((r, i) => {
|
|
10879
11017
|
let a, o = () => {
|
|
10880
11018
|
a?.(), t?.removeEventListener("abort", s);
|
|
@@ -10887,7 +11025,7 @@ function hf(e, t, n = !1) {
|
|
|
10887
11025
|
c() || (a = e.subscribe(c), t?.addEventListener("abort", s, { once: !0 }), c());
|
|
10888
11026
|
});
|
|
10889
11027
|
}
|
|
10890
|
-
function
|
|
11028
|
+
function xf(e, t, n) {
|
|
10891
11029
|
if (!t.aborted) {
|
|
10892
11030
|
if ("then" in e) n({
|
|
10893
11031
|
data: void 0,
|
|
@@ -10916,8 +11054,8 @@ function gf(e, t, n) {
|
|
|
10916
11054
|
}
|
|
10917
11055
|
//#endregion
|
|
10918
11056
|
//#region src/workbench/browser/runtime/stores/optionSource.ts
|
|
10919
|
-
function
|
|
10920
|
-
return "then" in e ? e.then((e) => e === void 0 ? void 0 : n(e)) :
|
|
11057
|
+
function Sf(e, t, n) {
|
|
11058
|
+
return "then" in e ? e.then((e) => e === void 0 ? void 0 : n(e)) : Cf(t, (t) => {
|
|
10921
11059
|
let r = t(e);
|
|
10922
11060
|
return {
|
|
10923
11061
|
...r,
|
|
@@ -10925,12 +11063,12 @@ function _f(e, t, n) {
|
|
|
10925
11063
|
};
|
|
10926
11064
|
});
|
|
10927
11065
|
}
|
|
10928
|
-
function
|
|
11066
|
+
function Cf(e, n) {
|
|
10929
11067
|
let r = t(n);
|
|
10930
11068
|
return e.addEventListener("abort", () => r.dispose(), { once: !0 }), r;
|
|
10931
11069
|
}
|
|
10932
|
-
function
|
|
10933
|
-
return
|
|
11070
|
+
function wf(e, t) {
|
|
11071
|
+
return Cf(e, (e) => {
|
|
10934
11072
|
let n = t.map((t) => e(t));
|
|
10935
11073
|
return {
|
|
10936
11074
|
data: n.every((e) => e.data === void 0) ? void 0 : n.flatMap((e) => e.data ?? []),
|
|
@@ -10940,68 +11078,8 @@ function yf(e, t) {
|
|
|
10940
11078
|
});
|
|
10941
11079
|
}
|
|
10942
11080
|
//#endregion
|
|
10943
|
-
//#region src/base/common/json.ts
|
|
10944
|
-
function bf(e) {
|
|
10945
|
-
if (e === null || typeof e == "boolean" || typeof e == "string") return !0;
|
|
10946
|
-
if (typeof e == "number") return Number.isFinite(e);
|
|
10947
|
-
if (typeof e != "object") return !1;
|
|
10948
|
-
let t = /* @__PURE__ */ new Set(), n = [], r = e;
|
|
10949
|
-
traversal: for (;;) {
|
|
10950
|
-
let e, i;
|
|
10951
|
-
if (Array.isArray(r)) {
|
|
10952
|
-
if (i = r.length, e = Reflect.ownKeys(r), e.length != i + 1) return !1;
|
|
10953
|
-
} else {
|
|
10954
|
-
let t = Reflect.getPrototypeOf(r);
|
|
10955
|
-
if (t != Object.prototype && t != null) return !1;
|
|
10956
|
-
e = Reflect.ownKeys(r), i = void 0;
|
|
10957
|
-
}
|
|
10958
|
-
t.add(r);
|
|
10959
|
-
let a = 0;
|
|
10960
|
-
for (;;) {
|
|
10961
|
-
if (a >= e.length) {
|
|
10962
|
-
t.delete(r);
|
|
10963
|
-
let o = n.pop();
|
|
10964
|
-
if (o === void 0) return !0;
|
|
10965
|
-
r = o.value, e = o.keys, i = o.arrayLength, a = o.index;
|
|
10966
|
-
continue;
|
|
10967
|
-
}
|
|
10968
|
-
let o = e[a++];
|
|
10969
|
-
if (i !== void 0) {
|
|
10970
|
-
if (o == "length") continue;
|
|
10971
|
-
if (typeof o != "string") return !1;
|
|
10972
|
-
let e = Number(o);
|
|
10973
|
-
if (!Number.isSafeInteger(e) || e < 0 || e >= i || String(e) != o) return !1;
|
|
10974
|
-
} else if (typeof o != "string") return !1;
|
|
10975
|
-
let s = Reflect.getOwnPropertyDescriptor(r, o);
|
|
10976
|
-
if (s?.enumerable != 1 || !Object.hasOwn(s, "value")) return !1;
|
|
10977
|
-
let c = s.value;
|
|
10978
|
-
if (c !== null && typeof c != "boolean" && typeof c != "string") {
|
|
10979
|
-
if (typeof c == "number") {
|
|
10980
|
-
if (!Number.isFinite(c)) return !1;
|
|
10981
|
-
continue;
|
|
10982
|
-
}
|
|
10983
|
-
if (typeof c != "object" || t.has(c)) return !1;
|
|
10984
|
-
n.push({
|
|
10985
|
-
value: r,
|
|
10986
|
-
keys: e,
|
|
10987
|
-
arrayLength: i,
|
|
10988
|
-
index: a
|
|
10989
|
-
}), r = c;
|
|
10990
|
-
continue traversal;
|
|
10991
|
-
}
|
|
10992
|
-
}
|
|
10993
|
-
}
|
|
10994
|
-
}
|
|
10995
|
-
function xf(e) {
|
|
10996
|
-
try {
|
|
10997
|
-
return typeof e == "object" && !!e && !Array.isArray(e) && bf(e);
|
|
10998
|
-
} catch {
|
|
10999
|
-
return !1;
|
|
11000
|
-
}
|
|
11001
|
-
}
|
|
11002
|
-
//#endregion
|
|
11003
11081
|
//#region src/trigger/providers/feishu/config.ts
|
|
11004
|
-
function
|
|
11082
|
+
function Tf(e) {
|
|
11005
11083
|
if (e.length != 0) {
|
|
11006
11084
|
if (e.every((e) => e.startsWith("drive.file."))) return "document";
|
|
11007
11085
|
if (e.every((e) => e == "calendar.calendar.event.changed_v4")) return "calendar";
|
|
@@ -11013,12 +11091,12 @@ function Sf(e) {
|
|
|
11013
11091
|
].includes(e))) return "approval";
|
|
11014
11092
|
}
|
|
11015
11093
|
}
|
|
11016
|
-
function
|
|
11094
|
+
function Ef(e) {
|
|
11017
11095
|
return e.length > 0 && e.every((e) => ["im.message.receive_v1", "im.chat.member.bot.added_v1"].includes(e));
|
|
11018
11096
|
}
|
|
11019
11097
|
//#endregion
|
|
11020
11098
|
//#region src/workbench/browser/runtime/editor/addNodeOptions.ts
|
|
11021
|
-
function
|
|
11099
|
+
function Df(e) {
|
|
11022
11100
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
11023
11101
|
t.set(e.id, e);
|
|
11024
11102
|
for (let t of e.choices ?? []) n(t.option);
|
|
@@ -11026,7 +11104,7 @@ function wf(e) {
|
|
|
11026
11104
|
for (let t of e) n(t);
|
|
11027
11105
|
return t;
|
|
11028
11106
|
}
|
|
11029
|
-
function
|
|
11107
|
+
function Of(e) {
|
|
11030
11108
|
let t = e("addNode.blocks");
|
|
11031
11109
|
return [
|
|
11032
11110
|
{
|
|
@@ -11165,9 +11243,9 @@ function Tf(e) {
|
|
|
11165
11243
|
}
|
|
11166
11244
|
];
|
|
11167
11245
|
}
|
|
11168
|
-
function
|
|
11246
|
+
function kf(e, t, n) {
|
|
11169
11247
|
if (e == null || t == null) return [];
|
|
11170
|
-
let r =
|
|
11248
|
+
let r = Of(n);
|
|
11171
11249
|
if (t.kind != "flow") return r.filter((e) => e.kind != "agent");
|
|
11172
11250
|
let i = n("addNode.triggers"), a = [
|
|
11173
11251
|
{
|
|
@@ -11178,13 +11256,7 @@ function Ef(e, t, n) {
|
|
|
11178
11256
|
inputs: [],
|
|
11179
11257
|
kind: "trigger",
|
|
11180
11258
|
label: n("addNode.manual"),
|
|
11181
|
-
outputs: [
|
|
11182
|
-
handle: "payload",
|
|
11183
|
-
jsonSchema: {
|
|
11184
|
-
additionalProperties: !1,
|
|
11185
|
-
type: "object"
|
|
11186
|
-
}
|
|
11187
|
-
}],
|
|
11259
|
+
outputs: [],
|
|
11188
11260
|
trigger: { kind: "manual" }
|
|
11189
11261
|
},
|
|
11190
11262
|
{
|
|
@@ -11195,10 +11267,11 @@ function Ef(e, t, n) {
|
|
|
11195
11267
|
inputs: [],
|
|
11196
11268
|
kind: "trigger",
|
|
11197
11269
|
label: n("addNode.webhook"),
|
|
11198
|
-
outputs:
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11270
|
+
outputs: hu({
|
|
11271
|
+
kind: "webhook",
|
|
11272
|
+
name: "Webhook",
|
|
11273
|
+
bodyFields: []
|
|
11274
|
+
}),
|
|
11202
11275
|
trigger: { kind: "webhook" }
|
|
11203
11276
|
},
|
|
11204
11277
|
{
|
|
@@ -11209,13 +11282,11 @@ function Ef(e, t, n) {
|
|
|
11209
11282
|
inputs: [],
|
|
11210
11283
|
kind: "trigger",
|
|
11211
11284
|
label: n("addNode.cron"),
|
|
11212
|
-
outputs:
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
}
|
|
11218
|
-
}],
|
|
11285
|
+
outputs: hu({
|
|
11286
|
+
kind: "cron",
|
|
11287
|
+
name: "Cron",
|
|
11288
|
+
cronTimes: []
|
|
11289
|
+
}),
|
|
11219
11290
|
trigger: { kind: "cron" }
|
|
11220
11291
|
},
|
|
11221
11292
|
{
|
|
@@ -11236,9 +11307,9 @@ function Ef(e, t, n) {
|
|
|
11236
11307
|
},
|
|
11237
11308
|
...r
|
|
11238
11309
|
];
|
|
11239
|
-
return Object.values(
|
|
11310
|
+
return Object.values(Lu(e).graph(t)?.nodes ?? {}).some((e) => e.kind == "manual") ? a.filter((e) => e.id != "trigger:manual") : a;
|
|
11240
11311
|
}
|
|
11241
|
-
function
|
|
11312
|
+
function Af(e, t, n, r) {
|
|
11242
11313
|
switch (e.kind) {
|
|
11243
11314
|
case "new-task": return {
|
|
11244
11315
|
kind: "code",
|
|
@@ -11304,41 +11375,41 @@ function Df(e, t, n, r) {
|
|
|
11304
11375
|
}
|
|
11305
11376
|
//#endregion
|
|
11306
11377
|
//#region src/manifest/common/meta/block/generateTyping.ts
|
|
11307
|
-
function
|
|
11308
|
-
return e === "typescript" ?
|
|
11378
|
+
function jf(e, t, n) {
|
|
11379
|
+
return e === "typescript" ? If(t, n) + "\n" : Lf(t, n) + "\n";
|
|
11309
11380
|
}
|
|
11310
|
-
var
|
|
11311
|
-
function
|
|
11312
|
-
return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some(
|
|
11381
|
+
var Mf = /* @__PURE__ */ new Set(["color", "text"]), Nf = (e) => e.includes(" | ") ? `(${e})` : e;
|
|
11382
|
+
function Pf(e) {
|
|
11383
|
+
return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some(Pf) : e.type === "object" ? Object.values(e.properties || {}).some(Pf) : e.type === "array" && Pf(e.items);
|
|
11313
11384
|
}
|
|
11314
|
-
function
|
|
11315
|
-
return [...e, ...t].some((e) =>
|
|
11385
|
+
function Ff(e, t) {
|
|
11386
|
+
return [...e, ...t].some((e) => Pf(e.json_schema));
|
|
11316
11387
|
}
|
|
11317
|
-
function
|
|
11388
|
+
function If(e = [], t = []) {
|
|
11318
11389
|
let n = ["type Inputs = {"];
|
|
11319
|
-
for (let t of e) n.push(` ${t.handle}: ${
|
|
11390
|
+
for (let t of e) n.push(` ${t.handle}: ${Rf(t.json_schema, t.nullable)};`);
|
|
11320
11391
|
n.push("};"), n.push("type Outputs = {");
|
|
11321
|
-
for (let e of t) n.push(` ${e.handle}: ${
|
|
11322
|
-
return n.push("};"),
|
|
11392
|
+
for (let e of t) n.push(` ${e.handle}: ${Rf(e.json_schema, e.nullable)};`);
|
|
11393
|
+
return n.push("};"), Ff(e, t) && n.unshift("import type { ArtifactRef } from '@oomol-lab/open-flow'", ""), n.join("\n");
|
|
11323
11394
|
}
|
|
11324
|
-
function
|
|
11395
|
+
function Lf(e = [], t = []) {
|
|
11325
11396
|
let n = ["@typedef {{"];
|
|
11326
|
-
for (let t of e) n.push(` ${t.handle}: ${
|
|
11397
|
+
for (let t of e) n.push(` ${t.handle}: ${Rf(t.json_schema, t.nullable)};`);
|
|
11327
11398
|
n.push("}} Inputs;"), n.push("@typedef {{");
|
|
11328
|
-
for (let e of t) n.push(` ${e.handle}: ${
|
|
11329
|
-
n.push("}} Outputs;"),
|
|
11399
|
+
for (let e of t) n.push(` ${e.handle}: ${Rf(e.json_schema, e.nullable)};`);
|
|
11400
|
+
n.push("}} Outputs;"), Ff(e, t) && n.unshift("@import { ArtifactRef } from \"@oomol-lab/open-flow\"");
|
|
11330
11401
|
let r = n.map((e) => ` * ${e}`);
|
|
11331
11402
|
return r.unshift("/**"), r.push(" */"), r.join("\n");
|
|
11332
11403
|
}
|
|
11333
|
-
function
|
|
11404
|
+
function Rf(e, t) {
|
|
11334
11405
|
if (!e) return "unknown";
|
|
11335
11406
|
switch (e.contentMediaType) {
|
|
11336
11407
|
case "oomol/bin": return t ? "Uint8Array | null" : "Uint8Array";
|
|
11337
11408
|
case "oomol/artifact": return t ? "ArtifactRef | null" : "ArtifactRef";
|
|
11338
11409
|
}
|
|
11339
|
-
if (
|
|
11340
|
-
if (Array.isArray(e.anyOf)) return
|
|
11341
|
-
if (Array.isArray(e.enum)) return
|
|
11410
|
+
if (Mf.has(e["ui:widget"])) return t ? "string | null" : "string";
|
|
11411
|
+
if (Array.isArray(e.anyOf)) return zf((t ? e.anyOf.concat({ type: "null" }) : e.anyOf).map((e) => Nf(Rf(e, !1)))) || "unknown";
|
|
11412
|
+
if (Array.isArray(e.enum)) return zf((t ? e.enum.concat(null) : e.enum).map((e) => JSON.stringify(e))) || "unknown";
|
|
11342
11413
|
switch (e.type) {
|
|
11343
11414
|
case "null": return "null";
|
|
11344
11415
|
case "boolean": return t ? "boolean | null" : "boolean";
|
|
@@ -11348,35 +11419,35 @@ function Ff(e, t) {
|
|
|
11348
11419
|
case "object": {
|
|
11349
11420
|
let n = Object.keys(e.properties || {});
|
|
11350
11421
|
if (n.length === 0) return "Record<string, unknown>";
|
|
11351
|
-
let r = Array.isArray(e?.required) ? new Set(e.required) : /* @__PURE__ */ new Set(), i = `{ ${n.map((t) => `${JSON.stringify(t)}${r.has(t) ? "" : "?"}: ${
|
|
11422
|
+
let r = Array.isArray(e?.required) ? new Set(e.required) : /* @__PURE__ */ new Set(), i = `{ ${n.map((t) => `${JSON.stringify(t)}${r.has(t) ? "" : "?"}: ${Rf(e.properties[t], !1)}`).join("; ")} }`;
|
|
11352
11423
|
return t ? `${i} | null` : i;
|
|
11353
11424
|
}
|
|
11354
11425
|
case "array":
|
|
11355
11426
|
if (e.uniqueItems && Array.isArray(e.items?.enum)) {
|
|
11356
|
-
let n = `${
|
|
11427
|
+
let n = `${Nf(Rf(e.items, !1))}[]`;
|
|
11357
11428
|
return t ? `${n} | null` : n;
|
|
11358
11429
|
}
|
|
11359
11430
|
{
|
|
11360
|
-
let n = `${
|
|
11431
|
+
let n = `${Nf(Rf(e.items, !1))}[]`;
|
|
11361
11432
|
return t ? `${n} | null` : n;
|
|
11362
11433
|
}
|
|
11363
11434
|
default: return "unknown";
|
|
11364
11435
|
}
|
|
11365
11436
|
}
|
|
11366
|
-
function
|
|
11437
|
+
function zf(e) {
|
|
11367
11438
|
let t = Array.from(new Set(e.filter((e) => !!e)));
|
|
11368
11439
|
return t.length === 0 || t.includes("unknown") ? "unknown" : t.join(" | ");
|
|
11369
11440
|
}
|
|
11370
11441
|
//#endregion
|
|
11371
11442
|
//#region src/workbench/browser/runtime/editor/flowChanges.ts
|
|
11372
|
-
function
|
|
11443
|
+
function Bf(e, t) {
|
|
11373
11444
|
return {
|
|
11374
11445
|
...e,
|
|
11375
11446
|
content: Ht(e.content, t)
|
|
11376
11447
|
};
|
|
11377
11448
|
}
|
|
11378
|
-
function
|
|
11379
|
-
let r =
|
|
11449
|
+
function Vf(e, t = [], n = {}) {
|
|
11450
|
+
let r = jf("javascript", e.inputs.flatMap((e) => "handle" in e ? [{
|
|
11380
11451
|
handle: e.handle,
|
|
11381
11452
|
json_schema: e.jsonSchema,
|
|
11382
11453
|
nullable: e.nullable
|
|
@@ -11386,7 +11457,7 @@ function Rf(e, t = [], n = {}) {
|
|
|
11386
11457
|
nullable: e.nullable
|
|
11387
11458
|
}] : [])), i = [], a = /* @__PURE__ */ new Map();
|
|
11388
11459
|
for (let e of t) {
|
|
11389
|
-
let t = n[e.action], r = t?.inputSchema == null ? "Record<string, unknown>" :
|
|
11460
|
+
let t = n[e.action], r = t?.inputSchema == null ? "Record<string, unknown>" : Rf(t.inputSchema, !1), o = t?.outputSchema == null ? "unknown" : Rf(t.outputSchema, !1), s = `{ connectionId: ${e.connections.map((e) => JSON.stringify(e.connectionId)).join(" | ") || "never"}; connectionAlias?: never } | { connectionAlias: ${e.connections.flatMap((e) => e.alias == null ? [] : [JSON.stringify(e.alias)]).join(" | ") || "never"}; connectionId?: never }`, c = `(...args: ${e.connections.length > 0 && e.connectionId == null ? `[input: {} extends ${r} ? ${r} | undefined : ${r}, options: ${s}]` : `{} extends ${r} ? [input?: ${r}, options?: ${s}] : [input: ${r}, options?: ${s}]`}) => Promise<${o}>`;
|
|
11390
11461
|
i.push(`${JSON.stringify(e.action)}: ${c}`);
|
|
11391
11462
|
let l = e.action.indexOf("."), u = e.action.slice(0, l), d = a.get(u) ?? [];
|
|
11392
11463
|
d.push(`${JSON.stringify(e.action.slice(l + 1))}: ${c}`), a.set(u, d);
|
|
@@ -11394,7 +11465,7 @@ function Rf(e, t = [], n = {}) {
|
|
|
11394
11465
|
for (let [e, t] of a) i.push(`${JSON.stringify(e)}: { ${t.join("; ")} }`);
|
|
11395
11466
|
return `${r}/** @typedef {import("@oomol-lab/open-flow").TaskContext<{ ${i.join("; ").replaceAll("*/", "*\\/")} }>} TaskContext */\n`;
|
|
11396
11467
|
}
|
|
11397
|
-
function
|
|
11468
|
+
function Hf(e) {
|
|
11398
11469
|
return {
|
|
11399
11470
|
executor: {
|
|
11400
11471
|
action: e.actionId,
|
|
@@ -11406,7 +11477,7 @@ function zf(e) {
|
|
|
11406
11477
|
outputs: Object.entries(e.outputs).map(([e, t]) => Object.assign({ handle: e }, t))
|
|
11407
11478
|
};
|
|
11408
11479
|
}
|
|
11409
|
-
function
|
|
11480
|
+
function Uf(e, t, n) {
|
|
11410
11481
|
return {
|
|
11411
11482
|
id: n,
|
|
11412
11483
|
name: `${e.actionId.replace(/[^a-zA-Z0-9_]/g, "_").slice(0, 48)}_${n.slice(0, 8)}`,
|
|
@@ -11417,7 +11488,7 @@ function Bf(e, t, n) {
|
|
|
11417
11488
|
inputs: Object.entries(e.inputs).map(([e, { value: t, ...n }]) => Object.assign({ handle: e }, n, { source: { kind: "model" } }))
|
|
11418
11489
|
};
|
|
11419
11490
|
}
|
|
11420
|
-
function
|
|
11491
|
+
function Wf(e, t) {
|
|
11421
11492
|
return [{
|
|
11422
11493
|
kind: "subflow.create",
|
|
11423
11494
|
subflow: {
|
|
@@ -11445,7 +11516,7 @@ function Vf(e, t) {
|
|
|
11445
11516
|
subflowId: e
|
|
11446
11517
|
}];
|
|
11447
11518
|
}
|
|
11448
|
-
function
|
|
11519
|
+
function Gf(e, t, n) {
|
|
11449
11520
|
let r = e.graph(t);
|
|
11450
11521
|
if (r == null) return n;
|
|
11451
11522
|
let i = new Set(Object.values(r.nodes).flatMap((e) => e.name == null ? [] : [e.name]));
|
|
@@ -11461,7 +11532,7 @@ function Hf(e, t, n) {
|
|
|
11461
11532
|
};
|
|
11462
11533
|
});
|
|
11463
11534
|
}
|
|
11464
|
-
function
|
|
11535
|
+
function Kf(e, t, n, r, i) {
|
|
11465
11536
|
let a;
|
|
11466
11537
|
switch (r.kind) {
|
|
11467
11538
|
case "code":
|
|
@@ -11486,7 +11557,7 @@ function Uf(e, t, n, r, i) {
|
|
|
11486
11557
|
a = Ca(t, {
|
|
11487
11558
|
nodeId: n,
|
|
11488
11559
|
taskId: i()
|
|
11489
|
-
},
|
|
11560
|
+
}, Hf(r.action));
|
|
11490
11561
|
break;
|
|
11491
11562
|
case "condition":
|
|
11492
11563
|
a = Ea(t, n, r.name);
|
|
@@ -11500,7 +11571,7 @@ function Uf(e, t, n, r, i) {
|
|
|
11500
11571
|
case "subflow": {
|
|
11501
11572
|
let i = e.subflow(r.subflowId);
|
|
11502
11573
|
if (i == null) return;
|
|
11503
|
-
a =
|
|
11574
|
+
a = up(t, n, r.subflowId, i.inputs);
|
|
11504
11575
|
break;
|
|
11505
11576
|
}
|
|
11506
11577
|
case "manual":
|
|
@@ -11511,7 +11582,7 @@ function Uf(e, t, n, r, i) {
|
|
|
11511
11582
|
break;
|
|
11512
11583
|
case "webhook":
|
|
11513
11584
|
a = t.kind == "flow" ? ka(t, n, {
|
|
11514
|
-
|
|
11585
|
+
bodyFields: [],
|
|
11515
11586
|
kind: "webhook",
|
|
11516
11587
|
name: r.name
|
|
11517
11588
|
}) : void 0;
|
|
@@ -11537,12 +11608,12 @@ function Uf(e, t, n, r, i) {
|
|
|
11537
11608
|
...r.connectionId == null ? {} : { connectionId: r.connectionId }
|
|
11538
11609
|
});
|
|
11539
11610
|
}
|
|
11540
|
-
return a == null ? void 0 :
|
|
11611
|
+
return a == null ? void 0 : Gf(e, t, a);
|
|
11541
11612
|
}
|
|
11542
|
-
function
|
|
11613
|
+
function qf(e, t, n) {
|
|
11543
11614
|
return ja(e.revision.content, t, n);
|
|
11544
11615
|
}
|
|
11545
|
-
function
|
|
11616
|
+
function Jf(e, t, n) {
|
|
11546
11617
|
let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
|
|
11547
11618
|
return {
|
|
11548
11619
|
edges: (e.graph(t)?.edges ?? []).filter((e) => i[e.source] != null && i[e.target] != null),
|
|
@@ -11559,7 +11630,7 @@ function Gf(e, t, n) {
|
|
|
11559
11630
|
nodes: i
|
|
11560
11631
|
};
|
|
11561
11632
|
}
|
|
11562
|
-
function
|
|
11633
|
+
function Yf(e, t, n, r) {
|
|
11563
11634
|
if (e.graph(t) == null) return {
|
|
11564
11635
|
changes: [],
|
|
11565
11636
|
nodeIds: [],
|
|
@@ -11682,15 +11753,15 @@ function Kf(e, t, n, r) {
|
|
|
11682
11753
|
});
|
|
11683
11754
|
}
|
|
11684
11755
|
return {
|
|
11685
|
-
changes:
|
|
11756
|
+
changes: Gf(e, t, c),
|
|
11686
11757
|
nodeIds: [...s.values()],
|
|
11687
11758
|
sourceIds: o
|
|
11688
11759
|
};
|
|
11689
11760
|
}
|
|
11690
|
-
function
|
|
11761
|
+
function Xf(e, t, n, r) {
|
|
11691
11762
|
return Ma(e.revision.content, t, n, r);
|
|
11692
11763
|
}
|
|
11693
|
-
function
|
|
11764
|
+
function Zf(e, t, n, r) {
|
|
11694
11765
|
let i = e.node(t, n)?.node;
|
|
11695
11766
|
if (i != null) return i.description == r ? [] : [{
|
|
11696
11767
|
before: i.description,
|
|
@@ -11701,7 +11772,7 @@ function Jf(e, t, n, r) {
|
|
|
11701
11772
|
value: r
|
|
11702
11773
|
}];
|
|
11703
11774
|
}
|
|
11704
|
-
function
|
|
11775
|
+
function Qf(e, t, n, r) {
|
|
11705
11776
|
let i = e.node(t, n)?.node;
|
|
11706
11777
|
if (i != null) return i.icon == r ? [] : [{
|
|
11707
11778
|
before: i.icon,
|
|
@@ -11712,7 +11783,7 @@ function Yf(e, t, n, r) {
|
|
|
11712
11783
|
value: r
|
|
11713
11784
|
}];
|
|
11714
11785
|
}
|
|
11715
|
-
function
|
|
11786
|
+
function $f(e, t, n, r) {
|
|
11716
11787
|
let i = e.node(t, n)?.node;
|
|
11717
11788
|
if (i == null || i.kind == "manual") return;
|
|
11718
11789
|
let a = "inputs" in i ? r : r ?? i.name;
|
|
@@ -11725,17 +11796,17 @@ function Xf(e, t, n, r) {
|
|
|
11725
11796
|
value: a
|
|
11726
11797
|
}];
|
|
11727
11798
|
}
|
|
11728
|
-
function
|
|
11799
|
+
function ep(e, t, n, r, i) {
|
|
11729
11800
|
let a = e.graph(t)?.nodes[n];
|
|
11730
11801
|
if (!(i === void 0 && a != null && "inputs" in a && a.inputs[r] == null)) return Na(e.revision.content, t, n, r, i);
|
|
11731
11802
|
}
|
|
11732
|
-
function
|
|
11803
|
+
function tp(e, t, n, r, i, a) {
|
|
11733
11804
|
return Ia(e.revision.content, t, n, r, i, a);
|
|
11734
11805
|
}
|
|
11735
|
-
function
|
|
11806
|
+
function np(e, t, n, r) {
|
|
11736
11807
|
let i = e.graph(t), a = i?.nodes[n];
|
|
11737
11808
|
if (i == null || a?.kind != "condition") return;
|
|
11738
|
-
let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l =
|
|
11809
|
+
let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l = fp(Object.keys(o).map((e) => ({ handle: e })), Object.keys(s).map((e) => ({ handle: e }))), u = new Set(Object.keys(s)), d = [];
|
|
11739
11810
|
for (let e of i.edges) {
|
|
11740
11811
|
if (e.source != n || e.sourceHandle == null) continue;
|
|
11741
11812
|
let r = l != null && e.sourceHandle == l[0] ? l[1] : e.sourceHandle;
|
|
@@ -11784,11 +11855,11 @@ function $f(e, t, n, r) {
|
|
|
11784
11855
|
value: r
|
|
11785
11856
|
});
|
|
11786
11857
|
}
|
|
11787
|
-
d.push(...
|
|
11858
|
+
d.push(...pp(o.inputs, i, t, e));
|
|
11788
11859
|
}
|
|
11789
11860
|
return La(e.revision.content, d);
|
|
11790
11861
|
}
|
|
11791
|
-
function
|
|
11862
|
+
function rp(e, t, n, r) {
|
|
11792
11863
|
let i = e.node(t, n)?.node;
|
|
11793
11864
|
if (i?.kind != "value") return;
|
|
11794
11865
|
let a = r.map((e) => ({
|
|
@@ -11806,7 +11877,7 @@ function ep(e, t, n, r) {
|
|
|
11806
11877
|
value: a
|
|
11807
11878
|
}];
|
|
11808
11879
|
}
|
|
11809
|
-
function
|
|
11880
|
+
function ip(e, t, n, r) {
|
|
11810
11881
|
if (t.kind != "flow") return;
|
|
11811
11882
|
let i = e.graph(t), a = i?.nodes[n];
|
|
11812
11883
|
if (i == null || a?.kind != "wait") return;
|
|
@@ -11853,7 +11924,7 @@ function tp(e, t, n, r) {
|
|
|
11853
11924
|
}
|
|
11854
11925
|
return l.length == 0 ? [] : La(e.revision.content, l);
|
|
11855
11926
|
}
|
|
11856
|
-
function
|
|
11927
|
+
function ap(e, t, n, r) {
|
|
11857
11928
|
let i = e.graph(t)?.nodes[n];
|
|
11858
11929
|
if (i?.kind == "task") switch (r.kind) {
|
|
11859
11930
|
case "agent": return i.taskId == null || !rt(e.task(i.taskId), r.before) ? void 0 : [{
|
|
@@ -11862,7 +11933,7 @@ function np(e, t, n, r) {
|
|
|
11862
11933
|
before: r.before,
|
|
11863
11934
|
value: r.task
|
|
11864
11935
|
}];
|
|
11865
|
-
case "code": return i.task == null ? void 0 :
|
|
11936
|
+
case "code": return i.task == null ? void 0 : mp(e, t, n, {
|
|
11866
11937
|
...i.task,
|
|
11867
11938
|
name: r.name
|
|
11868
11939
|
});
|
|
@@ -11895,28 +11966,28 @@ function np(e, t, n, r) {
|
|
|
11895
11966
|
}
|
|
11896
11967
|
}
|
|
11897
11968
|
}
|
|
11898
|
-
function
|
|
11969
|
+
function op(e, t, n, r) {
|
|
11899
11970
|
let i = e.node(t, n);
|
|
11900
11971
|
if (i?.kind == "task" && i.node.taskId != null && i.definition != null && "executor" in i.definition && i.definition.executor.kind == "agent") {
|
|
11901
|
-
let a =
|
|
11972
|
+
let a = mp(e, t, n, {
|
|
11902
11973
|
...i.definition,
|
|
11903
11974
|
...r
|
|
11904
11975
|
});
|
|
11905
11976
|
return a == null ? void 0 : La(e.revision.content, a);
|
|
11906
11977
|
}
|
|
11907
11978
|
if (i?.kind != "task" || i.node.task == null || i.module == null || rt(i.node.task.inputs, r.inputs) && rt(i.node.task.outputs, r.outputs)) return;
|
|
11908
|
-
let a =
|
|
11979
|
+
let a = mp(e, t, n, {
|
|
11909
11980
|
...i.node.task,
|
|
11910
11981
|
...r
|
|
11911
11982
|
});
|
|
11912
11983
|
if (a != null) return La(e.revision.content, a);
|
|
11913
11984
|
}
|
|
11914
|
-
function
|
|
11985
|
+
function sp(e, t, n, r) {
|
|
11915
11986
|
let i = e.node(t, n);
|
|
11916
11987
|
if (i?.kind != "task" || i.node.task != null || i.definition == null) return;
|
|
11917
11988
|
let a = i.node;
|
|
11918
11989
|
if (rt(a.additionalInputs ?? [], r)) return;
|
|
11919
|
-
let o =
|
|
11990
|
+
let o = fp(a.additionalInputs ?? [], r), s = new Set(i.definition.inputs.flatMap((e) => "handle" in e ? [e.handle] : []).concat(r.map((e) => e.handle))), c = Object.assign({}, a.inputs);
|
|
11920
11991
|
o != null && Object.hasOwn(c, o[0]) && (c[o[1]] = c[o[0]], delete c[o[0]]);
|
|
11921
11992
|
for (let e of Object.keys(c)) s.has(e) || delete c[e];
|
|
11922
11993
|
let l = r.length == 0 ? void 0 : r;
|
|
@@ -11926,19 +11997,19 @@ function ip(e, t, n, r) {
|
|
|
11926
11997
|
nodeId: n,
|
|
11927
11998
|
target: t,
|
|
11928
11999
|
value: l
|
|
11929
|
-
}, ...
|
|
12000
|
+
}, ...pp(a.inputs, c, t, n)]);
|
|
11930
12001
|
}
|
|
11931
|
-
function
|
|
12002
|
+
function cp(e, t, n, r) {
|
|
11932
12003
|
let i = e.trigger(n);
|
|
11933
12004
|
if (i == null || i.kind != "webhook") return;
|
|
11934
12005
|
let a = {
|
|
11935
|
-
|
|
12006
|
+
bodyFields: i.bodyFields,
|
|
11936
12007
|
options: i.options
|
|
11937
12008
|
}, o = {
|
|
11938
|
-
|
|
12009
|
+
bodyFields: r.bodyFields,
|
|
11939
12010
|
options: Object.keys(r.options).length == 0 ? void 0 : r.options
|
|
11940
12011
|
};
|
|
11941
|
-
return rt(a.
|
|
12012
|
+
return rt(a.bodyFields, o.bodyFields) && rt(a.options, o.options) ? [] : [{
|
|
11942
12013
|
before: a,
|
|
11943
12014
|
kind: "graph.node.webhook.set",
|
|
11944
12015
|
nodeId: n,
|
|
@@ -11946,7 +12017,7 @@ function ap(e, t, n, r) {
|
|
|
11946
12017
|
value: o
|
|
11947
12018
|
}];
|
|
11948
12019
|
}
|
|
11949
|
-
function
|
|
12020
|
+
function lp(e, t, n) {
|
|
11950
12021
|
let r = e.subflow(t);
|
|
11951
12022
|
if (r == null) return;
|
|
11952
12023
|
let i = {
|
|
@@ -11961,11 +12032,11 @@ function op(e, t, n) {
|
|
|
11961
12032
|
subflowId: t
|
|
11962
12033
|
}];
|
|
11963
12034
|
}
|
|
11964
|
-
function
|
|
12035
|
+
function up(e, t, n, r) {
|
|
11965
12036
|
return [{
|
|
11966
12037
|
kind: "graph.node.create",
|
|
11967
12038
|
node: {
|
|
11968
|
-
inputs:
|
|
12039
|
+
inputs: dp(r),
|
|
11969
12040
|
kind: "subflow",
|
|
11970
12041
|
subflowId: n
|
|
11971
12042
|
},
|
|
@@ -11973,17 +12044,17 @@ function sp(e, t, n, r) {
|
|
|
11973
12044
|
target: e
|
|
11974
12045
|
}];
|
|
11975
12046
|
}
|
|
11976
|
-
function
|
|
12047
|
+
function dp(e) {
|
|
11977
12048
|
return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
|
|
11978
12049
|
kind: "value",
|
|
11979
12050
|
value: e.value
|
|
11980
12051
|
}]] : []));
|
|
11981
12052
|
}
|
|
11982
|
-
function
|
|
12053
|
+
function fp(e, t) {
|
|
11983
12054
|
let n = new Set(e.flatMap((e) => "handle" in e ? [e.handle] : [])), r = new Set(t.flatMap((e) => "handle" in e ? [e.handle] : [])), i = [...n].filter((e) => !r.has(e)), a = [...r].filter((e) => !n.has(e));
|
|
11984
12055
|
return i.length == 1 && a.length == 1 ? [i[0], a[0]] : void 0;
|
|
11985
12056
|
}
|
|
11986
|
-
function
|
|
12057
|
+
function pp(e, t, n, r) {
|
|
11987
12058
|
let i = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]), a = [];
|
|
11988
12059
|
for (let o of i) rt(e[o], t[o]) || a.push({
|
|
11989
12060
|
before: e[o],
|
|
@@ -11995,12 +12066,12 @@ function up(e, t, n, r) {
|
|
|
11995
12066
|
});
|
|
11996
12067
|
return a;
|
|
11997
12068
|
}
|
|
11998
|
-
function
|
|
12069
|
+
function mp(e, t, n, r) {
|
|
11999
12070
|
let i = e.graph(t), a = i?.nodes[n];
|
|
12000
12071
|
if (i == null || a?.kind != "task") return;
|
|
12001
12072
|
let o = a.task ?? e.task(a.taskId);
|
|
12002
12073
|
if (o == null) return;
|
|
12003
|
-
let s =
|
|
12074
|
+
let s = fp(o.inputs, r.inputs), c = fp(o.outputs, r.outputs), l = new Set(r.inputs.flatMap((e) => "handle" in e ? [e.handle] : [])), u = new Set(r.outputs.flatMap((e) => "handle" in e ? [e.handle] : [])), d = [];
|
|
12004
12075
|
for (let e of i.edges) {
|
|
12005
12076
|
if (e.source != n || e.sourceHandle == null) continue;
|
|
12006
12077
|
let r = c != null && e.sourceHandle == c[0] ? c[1] : e.sourceHandle;
|
|
@@ -12058,7 +12129,7 @@ function dp(e, t, n, r) {
|
|
|
12058
12129
|
value: i
|
|
12059
12130
|
});
|
|
12060
12131
|
}
|
|
12061
|
-
d.push(...
|
|
12132
|
+
d.push(...pp(o.inputs, i, t, e));
|
|
12062
12133
|
}
|
|
12063
12134
|
if (a.task == null && "executor" in r && r.executor.kind == "agent" && "executor" in o) {
|
|
12064
12135
|
let e = r.executor, t = (e) => e.kind == "input" ? s != null && e.input == s[0] ? {
|
|
@@ -12095,4 +12166,4 @@ function dp(e, t, n, r) {
|
|
|
12095
12166
|
return d;
|
|
12096
12167
|
}
|
|
12097
12168
|
//#endregion
|
|
12098
|
-
export {
|
|
12169
|
+
export { ad as $, di as $t, Cf as A, fa as At, mf as B, ta as Bt, Af as C, ga as Ct, Ef as D, pa as Dt, Tf as E, ma as Et, kd as F, ea as Ft, lf as G, Ri as Gt, gf as H, na as Ht, hf as I, $i as It, Td as J, Pi as Jt, cf as K, Li as Kt, ff as L, aa as Lt, xf as M, ia as Mt, vf as N, Zi as Nt, wf as O, la as Ot, bf as P, Qi as Pt, od as Q, pi as Qt, Ad as R, oa as Rt, cp as S, _a as St, Df as T, ca as Tt, uf as U, Xi as Ut, df as V, ra as Vt, pf as W, Wi as Wt, cd as X, vi as Xt, vd as Y, yi as Yt, id as Z, hi as Zt, ap as _, R as _n, za as _t, Jf as a, Vr as an, hu as at, rp as b, I as bn, Ba as bt, Yf as c, Br as cn, co as ct, np as d, Fr as dn, io as dt, Qr as en, qu as et, Zf as f, Or as fn, Qa as ft, lp as g, gn, Ka as gt, Xf as h, L as hn, xa as ht, Vf as i, qr as in, vu as it, yf as j, Yi as jt, Sf as k, da as kt, ep as l, Rr as ln, oo as lt, $f as m, On as mn, Xa as mt, Uf as n, Xr as nn, Lu as nt, Wf as o, Ur as on, ru as ot, Qf as p, Gn as pn, Za as pt, Pd as q, Ii as qt, Bf as r, Zr as rn, ju as rt, qf as s, Wr as sn, fu as st, Kf as t, $r as tn, Uu as tt, tp as u, Lr as un, eo as ut, sp as v, z as vn, Fa as vt, kf as w, ha as wt, ip as x, sn as xn, Va as xt, op as y, cn as yn, Ha as yt, nf as z, sa as zt };
|