@oomol-lab/open-flow 0.1.0-beta.30 → 0.1.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{createResourceDialog-_y2xHaUA.js → createResourceDialog-DRB0OEtr.js} +2 -2
- package/dist/browser/{editorComponent-Dq4IKp5R.js → editorComponent-bXA-KosC.js} +2765 -1113
- package/dist/browser/flow-authoring-node.d.ts +5 -3
- package/dist/browser/flow-authoring.js +1575 -1472
- package/dist/browser/flow-change.d.ts +47 -20
- package/dist/browser/flow-change.js +1728 -1602
- package/dist/browser/flow-input-value.d.ts +6 -0
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/flowChanges-FiZJreeB.js +9855 -0
- package/dist/browser/{flowRunInputEditorStore-CTORQcA2.js → flowRunInputEditorStore-Bgb5vSeS.js} +3 -3
- package/dist/browser/flowWorkspace-CBo6Ih_c.js +40987 -0
- package/dist/browser/{inputValues-DJfFraxG.js → inputValues-CUyjbECo.js} +2 -2
- package/dist/browser/licenses.md +0 -58
- package/dist/browser/{lite-BuKZ8joP.js → lite-BA96NG4M.js} +8 -4
- package/dist/browser/theme.css +2 -0
- package/dist/browser/ui.css +2 -1
- package/dist/browser/ui.d.ts +31 -3
- package/dist/browser/ui.js +3547 -772
- package/dist/browser/{value-DPg_9yXB.js → value-B_yE9ean.js} +22 -14
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +3944 -1077
- package/dist/browser/{workbenchSelect-BDPIQxYK.js → workbenchSelect-DNteZJYP.js} +1698 -1470
- package/dist/common/control-api-conformance.d.ts +6 -0
- package/dist/common/control-api-conformance.js +510 -394
- package/dist/common/control-api-errors.d.ts +16 -0
- package/dist/common/control-api.d.ts +64 -7
- package/dist/common/control-api.js +1724 -1568
- package/dist/common/control-requests.d.ts +16 -0
- package/dist/common/control-requests.js +685 -651
- package/dist/common/event-sources.d.ts +0 -1
- package/dist/common/feishu-events.d.ts +0 -1
- package/dist/common/flow-encoding.js +1168 -1140
- package/dist/common/flow-graph.d.ts +16 -9
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-semantics.d.ts +2 -2
- package/dist/common/flow-semantics.js +2223 -1954
- package/dist/common/fr-ClB96SQY.js +298 -0
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/integration-trigger.js +7572 -88
- package/dist/common/ja-BJF-VrP2.js +298 -0
- package/dist/common/ko-Bght_VaB.js +298 -0
- package/dist/common/mcp.d.ts +1 -0
- package/dist/common/mcp.js +1727 -1574
- package/dist/common/poll-trigger.d.ts +3 -1
- package/dist/common/poll-trigger.js +7512 -28
- package/dist/common/provider-triggers.js +6806 -3525
- package/dist/common/ru-DrP4BRM5.js +298 -0
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +41 -27
- package/dist/common/scheduler.d.ts +7 -1
- package/dist/common/scheduler.js +981 -792
- package/dist/common/trigger-catalog.d.ts +3 -1
- package/dist/common/trigger-config.d.ts +7 -0
- package/dist/common/zh-CN-D2od3TNw.js +298 -0
- package/dist/common/zh-TW-CRmc3FMz.js +298 -0
- package/package.json +1 -1
- package/dist/browser/flowChanges-AdN0Iqma.js +0 -12304
- package/dist/browser/flowWorkspace-BrtzLKWB.js +0 -153066
- package/dist/common/fr-iv1541dF.js +0 -93
- package/dist/common/ja-Bq-ZDOD4.js +0 -93
- package/dist/common/ko-Z-k9R2c6.js +0 -93
- package/dist/common/ru-B4gFecYZ.js +0 -93
- package/dist/common/zh-CN-ByQ6nYam.js +0 -93
- package/dist/common/zh-TW-QjIarvX9.js +0 -93
package/dist/common/scheduler.js
CHANGED
|
@@ -4836,7 +4836,35 @@ var vc = class {
|
|
|
4836
4836
|
$id: t
|
|
4837
4837
|
}), Us(e, this.lookup);
|
|
4838
4838
|
}
|
|
4839
|
-
}
|
|
4839
|
+
};
|
|
4840
|
+
//#endregion
|
|
4841
|
+
//#region src/flow/common/inputValue.ts
|
|
4842
|
+
function yc(e, t) {
|
|
4843
|
+
if (e?.kind !== "unset") return e?.kind === "value" ? e.value : t;
|
|
4844
|
+
}
|
|
4845
|
+
//#endregion
|
|
4846
|
+
//#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/lite/index.mjs
|
|
4847
|
+
var bc = Object.prototype.hasOwnProperty;
|
|
4848
|
+
function xc(e, t) {
|
|
4849
|
+
var n, r;
|
|
4850
|
+
if (e === t) return !0;
|
|
4851
|
+
if (e && t && (n = e.constructor) === t.constructor) {
|
|
4852
|
+
if (n === Date) return e.getTime() === t.getTime();
|
|
4853
|
+
if (n === RegExp) return e.toString() === t.toString();
|
|
4854
|
+
if (n === Array) {
|
|
4855
|
+
if ((r = e.length) === t.length) for (; r-- && xc(e[r], t[r]););
|
|
4856
|
+
return r === -1;
|
|
4857
|
+
}
|
|
4858
|
+
if (!n || typeof e == "object") {
|
|
4859
|
+
for (n in r = 0, e) if (bc.call(e, n) && ++r && !bc.call(t, n) || !(n in t) || !xc(e[n], t[n])) return !1;
|
|
4860
|
+
return Object.keys(t).length === r;
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
return e !== e && t !== t;
|
|
4864
|
+
}
|
|
4865
|
+
//#endregion
|
|
4866
|
+
//#region src/flow/common/triggerScheduleSchema.ts
|
|
4867
|
+
var Sc = N(F([P({
|
|
4840
4868
|
type: R("cron"),
|
|
4841
4869
|
expression: A(),
|
|
4842
4870
|
timezone: A()
|
|
@@ -4850,58 +4878,67 @@ var vc = class {
|
|
|
4850
4878
|
"week"
|
|
4851
4879
|
]),
|
|
4852
4880
|
value: M()
|
|
4853
|
-
})])), B = A(),
|
|
4881
|
+
})])), B = A(), Cc = Fs(), wc = N(B), Tc = P({
|
|
4854
4882
|
description: B.optional(),
|
|
4855
|
-
jsonSchema:
|
|
4883
|
+
jsonSchema: Cc,
|
|
4856
4884
|
nullable: Jo(),
|
|
4857
4885
|
handle: B
|
|
4858
|
-
}),
|
|
4886
|
+
}), Ec = Tc.extend({ value: Cc.optional() }), Dc = P({
|
|
4859
4887
|
collapsed: Jo().optional(),
|
|
4860
4888
|
group: B
|
|
4861
|
-
}),
|
|
4889
|
+
}), Oc = P({
|
|
4862
4890
|
kind: R("node"),
|
|
4863
4891
|
nodeId: B,
|
|
4864
|
-
output: B
|
|
4865
|
-
|
|
4892
|
+
output: B,
|
|
4893
|
+
field: B.optional()
|
|
4894
|
+
}), kc = P({
|
|
4866
4895
|
kind: R("flow"),
|
|
4867
4896
|
input: B
|
|
4868
|
-
}),
|
|
4869
|
-
|
|
4870
|
-
|
|
4897
|
+
}), Ac = F([
|
|
4898
|
+
Oc,
|
|
4899
|
+
kc,
|
|
4871
4900
|
P({
|
|
4872
4901
|
kind: R("binding"),
|
|
4873
4902
|
bindingId: B
|
|
4874
4903
|
})
|
|
4875
|
-
]),
|
|
4904
|
+
]), jc = F([P({ kind: R("unset") }), P({
|
|
4876
4905
|
kind: R("value"),
|
|
4877
|
-
value:
|
|
4878
|
-
}), P({
|
|
4906
|
+
value: Cc
|
|
4907
|
+
})]), Mc = F([jc, P({
|
|
4879
4908
|
kind: R("sources"),
|
|
4880
|
-
sources: N(
|
|
4881
|
-
})]),
|
|
4882
|
-
inputs: N(F([
|
|
4883
|
-
outputs: N(F([
|
|
4884
|
-
},
|
|
4909
|
+
sources: N(Ac)
|
|
4910
|
+
})]), Nc = I(B, Mc), Pc = {
|
|
4911
|
+
inputs: N(F([Ec, Dc])),
|
|
4912
|
+
outputs: N(F([Tc, Dc]))
|
|
4913
|
+
}, Fc = F([rs({
|
|
4885
4914
|
kind: R("connector"),
|
|
4886
4915
|
action: B,
|
|
4887
4916
|
connectionId: B.optional(),
|
|
4888
|
-
connections: N(
|
|
4917
|
+
connections: N(rs({
|
|
4889
4918
|
connectionId: B,
|
|
4890
4919
|
alias: B.optional()
|
|
4891
4920
|
}))
|
|
4892
|
-
}),
|
|
4893
|
-
|
|
4921
|
+
}), rs({
|
|
4922
|
+
kind: R("connector"),
|
|
4923
|
+
actionHints: N(B).optional(),
|
|
4924
|
+
connectionHints: N(rs({
|
|
4925
|
+
action: B,
|
|
4926
|
+
connectionId: B,
|
|
4927
|
+
alias: B.optional()
|
|
4928
|
+
})).optional()
|
|
4929
|
+
})]), Ic = P({
|
|
4930
|
+
...Pc,
|
|
4894
4931
|
name: B,
|
|
4895
4932
|
moduleId: B,
|
|
4896
|
-
capabilities: N(
|
|
4897
|
-
}),
|
|
4933
|
+
capabilities: N(Fc).optional()
|
|
4934
|
+
}), Lc = F([P({
|
|
4898
4935
|
kind: R("value"),
|
|
4899
|
-
value:
|
|
4936
|
+
value: Cc
|
|
4900
4937
|
}), P({
|
|
4901
4938
|
kind: R("input"),
|
|
4902
4939
|
input: B
|
|
4903
|
-
})]),
|
|
4904
|
-
...
|
|
4940
|
+
})]), Rc = F([Lc, P({ kind: R("model") })]), zc = P({
|
|
4941
|
+
...Pc,
|
|
4905
4942
|
name: B,
|
|
4906
4943
|
executor: F([
|
|
4907
4944
|
P({
|
|
@@ -4917,7 +4954,7 @@ var vc = class {
|
|
|
4917
4954
|
kind: R("agent"),
|
|
4918
4955
|
code: Jo().optional(),
|
|
4919
4956
|
model: B,
|
|
4920
|
-
prompt:
|
|
4957
|
+
prompt: Lc,
|
|
4921
4958
|
system: B,
|
|
4922
4959
|
maxRounds: M(),
|
|
4923
4960
|
tools: N(P({
|
|
@@ -4927,22 +4964,29 @@ var vc = class {
|
|
|
4927
4964
|
action: B,
|
|
4928
4965
|
connectionId: B.optional(),
|
|
4929
4966
|
approval: Jo(),
|
|
4930
|
-
inputs: N(
|
|
4967
|
+
inputs: N(Ec.extend({ source: Rc }))
|
|
4931
4968
|
})),
|
|
4932
4969
|
notification: P({
|
|
4933
4970
|
taskId: B,
|
|
4934
4971
|
messageHandle: B,
|
|
4935
|
-
inputs: I(B,
|
|
4972
|
+
inputs: I(B, Lc)
|
|
4936
4973
|
}).optional()
|
|
4937
4974
|
})
|
|
4938
4975
|
])
|
|
4939
|
-
}),
|
|
4940
|
-
|
|
4976
|
+
}), Bc = F([P({
|
|
4977
|
+
kind: R("value"),
|
|
4978
|
+
value: Cc.optional(),
|
|
4979
|
+
jsonSchema: Cc.optional()
|
|
4980
|
+
}), P({
|
|
4981
|
+
kind: R("source"),
|
|
4982
|
+
source: Ac
|
|
4983
|
+
})]), Vc = {
|
|
4984
|
+
matchMode: L(["first", "all"]),
|
|
4941
4985
|
cases: N(P({
|
|
4986
|
+
description: B.optional(),
|
|
4942
4987
|
output: B,
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
input: B,
|
|
4988
|
+
groups: N(P({ expressions: N(P({
|
|
4989
|
+
left: Bc,
|
|
4946
4990
|
operator: L([
|
|
4947
4991
|
"!=",
|
|
4948
4992
|
"<",
|
|
@@ -4965,30 +5009,32 @@ var vc = class {
|
|
|
4965
5009
|
"notHasValue",
|
|
4966
5010
|
"startsWith"
|
|
4967
5011
|
]),
|
|
4968
|
-
|
|
4969
|
-
}))
|
|
4970
|
-
}))
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
5012
|
+
right: Bc.optional()
|
|
5013
|
+
})) }))
|
|
5014
|
+
}))
|
|
5015
|
+
}, Hc = {
|
|
5016
|
+
inputDefinitions: N(Ec),
|
|
5017
|
+
prompt: B
|
|
5018
|
+
}, Uc = {
|
|
5019
|
+
bodyFields: N(Ec),
|
|
4974
5020
|
options: P({
|
|
4975
|
-
allowedMethods:
|
|
4976
|
-
allowedOrigins:
|
|
5021
|
+
allowedMethods: wc.optional(),
|
|
5022
|
+
allowedOrigins: wc.optional(),
|
|
4977
5023
|
noResponseBody: Jo().optional(),
|
|
4978
5024
|
responseData: B.optional(),
|
|
4979
5025
|
responseHeaders: I(B, B).optional(),
|
|
4980
5026
|
responseStatusCode: M().optional()
|
|
4981
5027
|
}).optional()
|
|
4982
|
-
},
|
|
4983
|
-
|
|
5028
|
+
}, Wc = {
|
|
5029
|
+
configInputs: Pc.inputs,
|
|
4984
5030
|
definitionVersion: R(2),
|
|
4985
5031
|
description: B,
|
|
4986
5032
|
displayName: B,
|
|
4987
5033
|
key: B,
|
|
4988
5034
|
name: B,
|
|
4989
|
-
outputs: N(
|
|
5035
|
+
outputs: N(Tc).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
|
|
4990
5036
|
provider: B
|
|
4991
|
-
},
|
|
5037
|
+
}, Gc = P({
|
|
4992
5038
|
body: P({
|
|
4993
5039
|
allowArray: Jo(),
|
|
4994
5040
|
allowEmpty: Jo(),
|
|
@@ -5008,136 +5054,135 @@ var vc = class {
|
|
|
5008
5054
|
"PUT"
|
|
5009
5055
|
])),
|
|
5010
5056
|
successStatus: M()
|
|
5011
|
-
}),
|
|
5057
|
+
}), Kc = {
|
|
5012
5058
|
name: B,
|
|
5013
5059
|
description: B.optional(),
|
|
5014
5060
|
icon: B.optional()
|
|
5015
|
-
},
|
|
5061
|
+
}, qc = {
|
|
5016
5062
|
maxExecutions: M().int().positive().max(2 ** 53 - 1).optional(),
|
|
5017
|
-
inputs:
|
|
5063
|
+
inputs: Nc,
|
|
5018
5064
|
name: B.optional(),
|
|
5019
5065
|
description: B.optional(),
|
|
5020
5066
|
icon: B.optional(),
|
|
5021
5067
|
timeoutMs: M().optional()
|
|
5022
|
-
},
|
|
5068
|
+
}, Jc = F([
|
|
5023
5069
|
P({
|
|
5024
|
-
...
|
|
5070
|
+
...qc,
|
|
5071
|
+
inputs: I(B, es()),
|
|
5025
5072
|
kind: R("condition"),
|
|
5026
|
-
...
|
|
5073
|
+
...Vc
|
|
5027
5074
|
}),
|
|
5028
5075
|
P({
|
|
5029
|
-
...
|
|
5076
|
+
...qc,
|
|
5030
5077
|
inputs: Qo().transform(() => ({})).default({}),
|
|
5031
5078
|
kind: R("value"),
|
|
5032
|
-
values: N(
|
|
5079
|
+
values: N(Ec)
|
|
5033
5080
|
}),
|
|
5034
5081
|
P({
|
|
5035
|
-
...
|
|
5082
|
+
...qc,
|
|
5036
5083
|
kind: R("subflow"),
|
|
5037
5084
|
subflowId: B
|
|
5038
5085
|
}),
|
|
5039
5086
|
P({
|
|
5040
|
-
...
|
|
5087
|
+
...qc,
|
|
5041
5088
|
kind: R("task"),
|
|
5042
|
-
task:
|
|
5043
|
-
additionalInputs: N(
|
|
5089
|
+
task: Ic,
|
|
5090
|
+
additionalInputs: N(Ec).optional()
|
|
5044
5091
|
}),
|
|
5045
5092
|
P({
|
|
5046
|
-
...
|
|
5093
|
+
...qc,
|
|
5047
5094
|
kind: R("task"),
|
|
5048
5095
|
taskId: B,
|
|
5049
|
-
additionalInputs: N(
|
|
5096
|
+
additionalInputs: N(Ec).optional()
|
|
5050
5097
|
}),
|
|
5051
5098
|
rs({
|
|
5052
|
-
...
|
|
5099
|
+
...qc,
|
|
5053
5100
|
kind: R("approval"),
|
|
5054
|
-
|
|
5055
|
-
...Ic
|
|
5101
|
+
...Hc
|
|
5056
5102
|
}).omit({ timeoutMs: !0 }),
|
|
5057
5103
|
rs({
|
|
5058
|
-
...
|
|
5104
|
+
...qc,
|
|
5059
5105
|
kind: R("wait"),
|
|
5060
|
-
|
|
5061
|
-
...Ic
|
|
5106
|
+
...Hc
|
|
5062
5107
|
}).omit({ timeoutMs: !0 }),
|
|
5063
5108
|
P({
|
|
5064
|
-
...
|
|
5109
|
+
...Kc,
|
|
5065
5110
|
kind: R("manual")
|
|
5066
5111
|
}),
|
|
5067
5112
|
P({
|
|
5068
|
-
...
|
|
5113
|
+
...Kc,
|
|
5069
5114
|
kind: R("webhook"),
|
|
5070
|
-
...
|
|
5115
|
+
...Uc
|
|
5071
5116
|
}),
|
|
5072
5117
|
P({
|
|
5073
|
-
...
|
|
5118
|
+
...Kc,
|
|
5074
5119
|
kind: R("cron"),
|
|
5075
|
-
cronTimes:
|
|
5120
|
+
cronTimes: Sc
|
|
5076
5121
|
}),
|
|
5077
5122
|
P({
|
|
5078
|
-
...
|
|
5123
|
+
...Kc,
|
|
5079
5124
|
kind: R("poll"),
|
|
5080
5125
|
bindingId: B,
|
|
5081
|
-
config: I(B,
|
|
5126
|
+
config: I(B, jc),
|
|
5082
5127
|
definition: P({
|
|
5083
|
-
...
|
|
5128
|
+
...Wc,
|
|
5084
5129
|
type: R("poll")
|
|
5085
5130
|
}),
|
|
5086
|
-
pollTimes:
|
|
5131
|
+
pollTimes: Sc
|
|
5087
5132
|
}),
|
|
5088
5133
|
P({
|
|
5089
|
-
...
|
|
5134
|
+
...Kc,
|
|
5090
5135
|
kind: R("integration"),
|
|
5091
5136
|
bindingId: B,
|
|
5092
|
-
config: I(B,
|
|
5137
|
+
config: I(B, jc),
|
|
5093
5138
|
definition: P({
|
|
5094
|
-
...
|
|
5139
|
+
...Wc,
|
|
5095
5140
|
type: R("integration"),
|
|
5096
|
-
endpoint:
|
|
5141
|
+
endpoint: Gc
|
|
5097
5142
|
})
|
|
5098
5143
|
})
|
|
5099
|
-
]),
|
|
5144
|
+
]), Yc = F([P({ kind: R("flow") }), P({
|
|
5100
5145
|
kind: R("subflow"),
|
|
5101
5146
|
id: B
|
|
5102
|
-
})]),
|
|
5147
|
+
})]), Xc = P({
|
|
5103
5148
|
source: B,
|
|
5104
5149
|
target: B,
|
|
5105
5150
|
sourceHandle: B.optional()
|
|
5106
|
-
}),
|
|
5151
|
+
}), V = {
|
|
5107
5152
|
nodeId: B,
|
|
5108
|
-
target:
|
|
5109
|
-
},
|
|
5153
|
+
target: Yc
|
|
5154
|
+
}, Zc = P({
|
|
5110
5155
|
name: B,
|
|
5111
|
-
inputs: N(
|
|
5112
|
-
outputs: N(
|
|
5113
|
-
}),
|
|
5114
|
-
nodes: I(B,
|
|
5115
|
-
edges: N(
|
|
5116
|
-
}),
|
|
5156
|
+
inputs: N(Ec),
|
|
5157
|
+
outputs: N(Tc.extend({ sources: N(F([Oc, kc])) }))
|
|
5158
|
+
}), Qc = P({
|
|
5159
|
+
nodes: I(B, Jc),
|
|
5160
|
+
edges: N(Xc).default([])
|
|
5161
|
+
}), $c = P({
|
|
5117
5162
|
kind: L(["connection", "variable"]),
|
|
5118
5163
|
target: B
|
|
5119
|
-
}),
|
|
5164
|
+
}), el = P({
|
|
5120
5165
|
name: B,
|
|
5121
|
-
imports:
|
|
5166
|
+
imports: wc,
|
|
5122
5167
|
source: B
|
|
5123
|
-
}),
|
|
5124
|
-
bindings: I(B,
|
|
5125
|
-
graph:
|
|
5126
|
-
subflows: I(B,
|
|
5127
|
-
tasks: I(B,
|
|
5128
|
-
}), Zc = P({
|
|
5129
|
-
modelVersion: F([R(2), R(3)]),
|
|
5130
|
-
document: Xc,
|
|
5131
|
-
modules: I(B, Yc)
|
|
5168
|
+
}), tl = P({
|
|
5169
|
+
bindings: I(B, $c),
|
|
5170
|
+
graph: Qc,
|
|
5171
|
+
subflows: I(B, Zc.extend({ graph: Qc })),
|
|
5172
|
+
tasks: I(B, zc)
|
|
5132
5173
|
});
|
|
5133
|
-
|
|
5174
|
+
P({
|
|
5175
|
+
modelVersion: F([R(2), R(3)]),
|
|
5176
|
+
document: tl,
|
|
5177
|
+
modules: I(B, el)
|
|
5178
|
+
}).extend({
|
|
5134
5179
|
kind: R("open-flow-flow-revision"),
|
|
5135
5180
|
version: R(1)
|
|
5136
5181
|
});
|
|
5137
|
-
var
|
|
5182
|
+
var nl = {
|
|
5138
5183
|
"binding.create": {
|
|
5139
5184
|
bindingId: B,
|
|
5140
|
-
binding:
|
|
5185
|
+
binding: $c
|
|
5141
5186
|
},
|
|
5142
5187
|
"binding.delete": { bindingId: B },
|
|
5143
5188
|
"binding.target.set": {
|
|
@@ -5146,21 +5191,21 @@ var Qc = {
|
|
|
5146
5191
|
value: B
|
|
5147
5192
|
},
|
|
5148
5193
|
"graph.edge.connect": {
|
|
5149
|
-
target:
|
|
5150
|
-
edge:
|
|
5194
|
+
target: Yc,
|
|
5195
|
+
edge: Xc
|
|
5151
5196
|
},
|
|
5152
5197
|
"graph.edge.disconnect": {
|
|
5153
|
-
target:
|
|
5154
|
-
edge:
|
|
5198
|
+
target: Yc,
|
|
5199
|
+
edge: Xc
|
|
5155
5200
|
},
|
|
5156
5201
|
"graph.node.create": {
|
|
5157
|
-
...
|
|
5158
|
-
node:
|
|
5202
|
+
...V,
|
|
5203
|
+
node: Jc
|
|
5159
5204
|
},
|
|
5160
|
-
"graph.node.delete":
|
|
5205
|
+
"graph.node.delete": V,
|
|
5161
5206
|
"graph.node.field.set": F([
|
|
5162
5207
|
P({
|
|
5163
|
-
...
|
|
5208
|
+
...V,
|
|
5164
5209
|
kind: R("graph.node.field.set"),
|
|
5165
5210
|
field: L([
|
|
5166
5211
|
"description",
|
|
@@ -5171,14 +5216,14 @@ var Qc = {
|
|
|
5171
5216
|
value: B.optional()
|
|
5172
5217
|
}),
|
|
5173
5218
|
P({
|
|
5174
|
-
...
|
|
5219
|
+
...V,
|
|
5175
5220
|
kind: R("graph.node.field.set"),
|
|
5176
5221
|
field: R("maxExecutions"),
|
|
5177
5222
|
before: M().int().positive().max(2 ** 53 - 1).optional(),
|
|
5178
5223
|
value: M().int().positive().max(2 ** 53 - 1).optional()
|
|
5179
5224
|
}),
|
|
5180
5225
|
P({
|
|
5181
|
-
...
|
|
5226
|
+
...V,
|
|
5182
5227
|
kind: R("graph.node.field.set"),
|
|
5183
5228
|
field: R("timeoutMs"),
|
|
5184
5229
|
before: M().optional(),
|
|
@@ -5186,67 +5231,67 @@ var Qc = {
|
|
|
5186
5231
|
})
|
|
5187
5232
|
]),
|
|
5188
5233
|
"graph.node.input.set": {
|
|
5189
|
-
...
|
|
5234
|
+
...V,
|
|
5190
5235
|
handle: B,
|
|
5191
|
-
before:
|
|
5192
|
-
value:
|
|
5236
|
+
before: Mc.optional(),
|
|
5237
|
+
value: Mc.optional()
|
|
5193
5238
|
},
|
|
5194
5239
|
"graph.node.additional-inputs.set": {
|
|
5195
|
-
...
|
|
5196
|
-
before: N(
|
|
5197
|
-
value: N(
|
|
5240
|
+
...V,
|
|
5241
|
+
before: N(Ec).optional(),
|
|
5242
|
+
value: N(Ec).optional()
|
|
5198
5243
|
},
|
|
5199
5244
|
"graph.node.condition.set": {
|
|
5200
|
-
...
|
|
5201
|
-
before: P(
|
|
5202
|
-
value: P(
|
|
5245
|
+
...V,
|
|
5246
|
+
before: P(Vc),
|
|
5247
|
+
value: P(Vc)
|
|
5203
5248
|
},
|
|
5204
5249
|
"graph.node.values.set": {
|
|
5205
|
-
...
|
|
5206
|
-
before: N(
|
|
5207
|
-
value: N(
|
|
5250
|
+
...V,
|
|
5251
|
+
before: N(Ec),
|
|
5252
|
+
value: N(Ec)
|
|
5208
5253
|
},
|
|
5209
5254
|
"graph.node.resolution.set": {
|
|
5210
|
-
...
|
|
5255
|
+
...V,
|
|
5211
5256
|
target: P({ kind: R("flow") }),
|
|
5212
|
-
before: P(
|
|
5213
|
-
value: P(
|
|
5257
|
+
before: P(Hc),
|
|
5258
|
+
value: P(Hc)
|
|
5214
5259
|
},
|
|
5215
5260
|
"graph.node.webhook.set": {
|
|
5216
|
-
...
|
|
5261
|
+
...V,
|
|
5217
5262
|
target: P({ kind: R("flow") }),
|
|
5218
|
-
before: P(
|
|
5219
|
-
value: P(
|
|
5263
|
+
before: P(Uc),
|
|
5264
|
+
value: P(Uc)
|
|
5220
5265
|
},
|
|
5221
5266
|
"graph.node.task.ports.set": {
|
|
5222
|
-
...
|
|
5223
|
-
before: P(
|
|
5224
|
-
value: P(
|
|
5267
|
+
...V,
|
|
5268
|
+
before: P(Pc),
|
|
5269
|
+
value: P(Pc)
|
|
5225
5270
|
},
|
|
5226
5271
|
"graph.node.task.name.set": {
|
|
5227
|
-
...
|
|
5272
|
+
...V,
|
|
5228
5273
|
before: B,
|
|
5229
5274
|
value: B
|
|
5230
5275
|
},
|
|
5231
5276
|
"graph.node.task.capabilities.set": {
|
|
5232
|
-
...
|
|
5233
|
-
before: N(
|
|
5234
|
-
value: N(
|
|
5277
|
+
...V,
|
|
5278
|
+
before: N(Fc).optional(),
|
|
5279
|
+
value: N(Fc).optional()
|
|
5235
5280
|
},
|
|
5236
5281
|
"graph.trigger.config.set": {
|
|
5237
5282
|
nodeId: B,
|
|
5238
5283
|
name: B,
|
|
5239
|
-
before:
|
|
5240
|
-
value:
|
|
5284
|
+
before: jc.optional(),
|
|
5285
|
+
value: jc.optional()
|
|
5241
5286
|
},
|
|
5242
5287
|
"graph.trigger.schedule.set": {
|
|
5243
5288
|
nodeId: B,
|
|
5244
|
-
before:
|
|
5245
|
-
value:
|
|
5289
|
+
before: Sc,
|
|
5290
|
+
value: Sc
|
|
5246
5291
|
},
|
|
5247
5292
|
"module.create": {
|
|
5248
5293
|
moduleId: B,
|
|
5249
|
-
module:
|
|
5294
|
+
module: el
|
|
5250
5295
|
},
|
|
5251
5296
|
"module.delete": { moduleId: B },
|
|
5252
5297
|
"module.rename": {
|
|
@@ -5256,24 +5301,24 @@ var Qc = {
|
|
|
5256
5301
|
},
|
|
5257
5302
|
"module.source.replace": {
|
|
5258
5303
|
moduleId: B,
|
|
5259
|
-
beforeImports:
|
|
5304
|
+
beforeImports: wc,
|
|
5260
5305
|
beforeSource: B,
|
|
5261
|
-
imports:
|
|
5306
|
+
imports: wc,
|
|
5262
5307
|
source: B
|
|
5263
5308
|
},
|
|
5264
5309
|
"subflow.create": {
|
|
5265
5310
|
subflowId: B,
|
|
5266
|
-
subflow:
|
|
5311
|
+
subflow: Zc.extend({ graph: Qc })
|
|
5267
5312
|
},
|
|
5268
5313
|
"subflow.definition.set": {
|
|
5269
5314
|
subflowId: B,
|
|
5270
|
-
before:
|
|
5271
|
-
definition:
|
|
5315
|
+
before: Zc,
|
|
5316
|
+
definition: Zc
|
|
5272
5317
|
},
|
|
5273
5318
|
"subflow.delete": { subflowId: B },
|
|
5274
5319
|
"task.create": {
|
|
5275
5320
|
taskId: B,
|
|
5276
|
-
task:
|
|
5321
|
+
task: zc
|
|
5277
5322
|
},
|
|
5278
5323
|
"task.delete": { taskId: B },
|
|
5279
5324
|
"task.connector.connection.set": {
|
|
@@ -5283,8 +5328,8 @@ var Qc = {
|
|
|
5283
5328
|
},
|
|
5284
5329
|
"task.agent.set": {
|
|
5285
5330
|
taskId: B,
|
|
5286
|
-
before:
|
|
5287
|
-
value:
|
|
5331
|
+
before: zc,
|
|
5332
|
+
value: zc
|
|
5288
5333
|
},
|
|
5289
5334
|
"task.llm.mode.set": {
|
|
5290
5335
|
taskId: B,
|
|
@@ -5297,56 +5342,235 @@ var Qc = {
|
|
|
5297
5342
|
value: B
|
|
5298
5343
|
}
|
|
5299
5344
|
};
|
|
5300
|
-
N(F([...new Map(Object.entries(
|
|
5345
|
+
N(F([...new Map(Object.entries(nl).map(([e, t]) => [e, t instanceof k ? t : P({
|
|
5301
5346
|
kind: R(e),
|
|
5302
5347
|
...t
|
|
5303
5348
|
})])).values()])).min(1);
|
|
5304
5349
|
//#endregion
|
|
5350
|
+
//#region src/flow/common/condition.ts
|
|
5351
|
+
var rl = "otherwise", il = [
|
|
5352
|
+
"==",
|
|
5353
|
+
"!=",
|
|
5354
|
+
"<",
|
|
5355
|
+
"<=",
|
|
5356
|
+
">",
|
|
5357
|
+
">=",
|
|
5358
|
+
"contains",
|
|
5359
|
+
"notContains",
|
|
5360
|
+
"startsWith",
|
|
5361
|
+
"endsWith",
|
|
5362
|
+
"hasKey",
|
|
5363
|
+
"notHasKey",
|
|
5364
|
+
"hasValue",
|
|
5365
|
+
"notHasValue",
|
|
5366
|
+
"isEmpty",
|
|
5367
|
+
"isNotEmpty",
|
|
5368
|
+
"isNull",
|
|
5369
|
+
"isNotNull",
|
|
5370
|
+
"isTrue",
|
|
5371
|
+
"isFalse"
|
|
5372
|
+
], al = (e) => e.startsWith("is"), ol = (e, t, n, r) => `${e}/${t}/${n}/${r}`;
|
|
5373
|
+
function sl(e) {
|
|
5374
|
+
return e.cases.flatMap((e, t) => e.groups.flatMap((e, n) => e.expressions.flatMap((e, r) => [{
|
|
5375
|
+
handle: ol(t, n, r, "left"),
|
|
5376
|
+
operand: e.left,
|
|
5377
|
+
expression: e,
|
|
5378
|
+
side: "left"
|
|
5379
|
+
}, ...al(e.operator) ? [] : [{
|
|
5380
|
+
handle: ol(t, n, r, "right"),
|
|
5381
|
+
operand: e.right ?? { kind: "value" },
|
|
5382
|
+
expression: e,
|
|
5383
|
+
side: "right"
|
|
5384
|
+
}]])));
|
|
5385
|
+
}
|
|
5386
|
+
function cl(e) {
|
|
5387
|
+
return e.kind == "condition" ? Object.fromEntries(sl(e).flatMap(({ handle: e, operand: t }) => t.kind == "source" ? [[e, {
|
|
5388
|
+
kind: "sources",
|
|
5389
|
+
sources: [t.source]
|
|
5390
|
+
}]] : t.value === void 0 ? [] : [[e, {
|
|
5391
|
+
kind: "value",
|
|
5392
|
+
value: t.value
|
|
5393
|
+
}]])) : "inputs" in e ? e.inputs : {};
|
|
5394
|
+
}
|
|
5395
|
+
function ll(e) {
|
|
5396
|
+
return Object.fromEntries(sl(e).map(({ handle: e, operand: t }) => [e, {
|
|
5397
|
+
jsonSchema: t.kind === "value" ? t.jsonSchema ?? {} : {},
|
|
5398
|
+
nullable: t.kind !== "value" || t.value === null
|
|
5399
|
+
}]));
|
|
5400
|
+
}
|
|
5401
|
+
function ul(e) {
|
|
5402
|
+
return e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
|
|
5403
|
+
}
|
|
5404
|
+
function dl(e) {
|
|
5405
|
+
return e == null ? il : [
|
|
5406
|
+
"==",
|
|
5407
|
+
"!=",
|
|
5408
|
+
...{
|
|
5409
|
+
number: [
|
|
5410
|
+
"<",
|
|
5411
|
+
"<=",
|
|
5412
|
+
">",
|
|
5413
|
+
">="
|
|
5414
|
+
],
|
|
5415
|
+
integer: [
|
|
5416
|
+
"<",
|
|
5417
|
+
"<=",
|
|
5418
|
+
">",
|
|
5419
|
+
">="
|
|
5420
|
+
],
|
|
5421
|
+
string: [
|
|
5422
|
+
"contains",
|
|
5423
|
+
"notContains",
|
|
5424
|
+
"startsWith",
|
|
5425
|
+
"endsWith",
|
|
5426
|
+
"isEmpty",
|
|
5427
|
+
"isNotEmpty"
|
|
5428
|
+
],
|
|
5429
|
+
array: [
|
|
5430
|
+
"contains",
|
|
5431
|
+
"notContains",
|
|
5432
|
+
"isEmpty",
|
|
5433
|
+
"isNotEmpty"
|
|
5434
|
+
],
|
|
5435
|
+
object: [
|
|
5436
|
+
"hasKey",
|
|
5437
|
+
"notHasKey",
|
|
5438
|
+
"hasValue",
|
|
5439
|
+
"notHasValue",
|
|
5440
|
+
"isEmpty",
|
|
5441
|
+
"isNotEmpty"
|
|
5442
|
+
],
|
|
5443
|
+
boolean: ["isTrue", "isFalse"],
|
|
5444
|
+
null: []
|
|
5445
|
+
}[e] ?? [],
|
|
5446
|
+
"isNull",
|
|
5447
|
+
"isNotNull"
|
|
5448
|
+
];
|
|
5449
|
+
}
|
|
5450
|
+
var fl = (e) => e == "integer" ? "number" : e;
|
|
5451
|
+
function pl(e, t, n) {
|
|
5452
|
+
if (t != null && !dl(t).includes(e)) return {
|
|
5453
|
+
target: "operator",
|
|
5454
|
+
message: `Operator ${e} is not compatible with ${t}.`
|
|
5455
|
+
};
|
|
5456
|
+
if (al(e) || n == null) return;
|
|
5457
|
+
let r = [
|
|
5458
|
+
"<",
|
|
5459
|
+
"<=",
|
|
5460
|
+
">",
|
|
5461
|
+
">="
|
|
5462
|
+
].includes(e) ? "number" : [
|
|
5463
|
+
"startsWith",
|
|
5464
|
+
"endsWith",
|
|
5465
|
+
"hasKey",
|
|
5466
|
+
"notHasKey"
|
|
5467
|
+
].includes(e) || ["contains", "notContains"].includes(e) && t == "string" ? "string" : ["==", "!="].includes(e) ? fl(t) : void 0;
|
|
5468
|
+
if (r != null && r != fl(n)) return {
|
|
5469
|
+
target: "right",
|
|
5470
|
+
message: `Operator ${e} requires a ${r} right operand.`
|
|
5471
|
+
};
|
|
5472
|
+
}
|
|
5473
|
+
function ml(e, t, n) {
|
|
5474
|
+
if (!al(e) && n === void 0) throw Error("Condition right operand is missing.");
|
|
5475
|
+
let r = pl(e, ul(t), n === void 0 ? void 0 : ul(n));
|
|
5476
|
+
if (r != null) throw Error(r.message);
|
|
5477
|
+
switch (e) {
|
|
5478
|
+
case "==": return xc(t, n);
|
|
5479
|
+
case "!=": return !xc(t, n);
|
|
5480
|
+
case "<": return t < n;
|
|
5481
|
+
case "<=": return t <= n;
|
|
5482
|
+
case ">": return t > n;
|
|
5483
|
+
case ">=": return t >= n;
|
|
5484
|
+
case "contains":
|
|
5485
|
+
case "notContains": {
|
|
5486
|
+
let r = typeof t == "string" ? t.includes(n) : t.some((e) => xc(e, n));
|
|
5487
|
+
return e == "contains" ? r : !r;
|
|
5488
|
+
}
|
|
5489
|
+
case "startsWith": return t.startsWith(n);
|
|
5490
|
+
case "endsWith": return t.endsWith(n);
|
|
5491
|
+
case "hasKey":
|
|
5492
|
+
case "notHasKey": {
|
|
5493
|
+
let r = Object.hasOwn(t, n);
|
|
5494
|
+
return e == "hasKey" ? r : !r;
|
|
5495
|
+
}
|
|
5496
|
+
case "hasValue":
|
|
5497
|
+
case "notHasValue": {
|
|
5498
|
+
let r = Object.values(t).some((e) => xc(e, n));
|
|
5499
|
+
return e == "hasValue" ? r : !r;
|
|
5500
|
+
}
|
|
5501
|
+
case "isEmpty":
|
|
5502
|
+
case "isNotEmpty": {
|
|
5503
|
+
let n = typeof t == "string" || Array.isArray(t) ? t.length == 0 : Object.keys(t).length == 0;
|
|
5504
|
+
return e == "isEmpty" ? n : !n;
|
|
5505
|
+
}
|
|
5506
|
+
case "isNull": return t === null;
|
|
5507
|
+
case "isNotNull": return t !== null;
|
|
5508
|
+
case "isTrue": return t === !0;
|
|
5509
|
+
case "isFalse": return t === !1;
|
|
5510
|
+
}
|
|
5511
|
+
}
|
|
5512
|
+
function hl(e, t) {
|
|
5513
|
+
for (let { handle: n } of sl(e)) if (!Object.hasOwn(t, n)) throw Error(`Condition operand ${n} is missing.`);
|
|
5514
|
+
let n = e.cases.map((e, n) => {
|
|
5515
|
+
if (e.groups.length == 0) throw Error("Condition Case requires a group.");
|
|
5516
|
+
return e.groups.map((e, r) => {
|
|
5517
|
+
if (e.expressions.length == 0) throw Error("Condition group requires an expression.");
|
|
5518
|
+
return e.expressions.map((e, i) => {
|
|
5519
|
+
let a = t[ol(n, r, i, "left")], o = al(e.operator) ? void 0 : t[ol(n, r, i, "right")], s = pl(e.operator, ul(a), o === void 0 ? void 0 : ul(o));
|
|
5520
|
+
if (s != null || !al(e.operator) && o === void 0) throw Error(s?.message ?? "Condition right operand is missing.");
|
|
5521
|
+
return () => ml(e.operator, a, o);
|
|
5522
|
+
});
|
|
5523
|
+
});
|
|
5524
|
+
}), r = [];
|
|
5525
|
+
for (let [t, i] of n.entries()) if (i.some((e) => e.every((e) => e())) && (r.push(e.cases[t].output), e.matchMode == "first")) break;
|
|
5526
|
+
return r.length == 0 ? [rl] : r;
|
|
5527
|
+
}
|
|
5528
|
+
//#endregion
|
|
5305
5529
|
//#region src/flow/common/change.ts
|
|
5306
|
-
function
|
|
5530
|
+
function gl(e) {
|
|
5307
5531
|
return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
|
|
5308
5532
|
}
|
|
5309
5533
|
//#endregion
|
|
5310
5534
|
//#region src/json-schema-subset/utils.ts
|
|
5311
|
-
var
|
|
5312
|
-
function
|
|
5313
|
-
let e =
|
|
5314
|
-
return
|
|
5535
|
+
var _l = 0;
|
|
5536
|
+
function vl() {
|
|
5537
|
+
let e = _l;
|
|
5538
|
+
return _l += 1, e;
|
|
5315
5539
|
}
|
|
5316
|
-
function
|
|
5540
|
+
function yl(e) {
|
|
5317
5541
|
if (typeof e == "object" && e && !Object.isFrozen(e)) {
|
|
5318
|
-
for (let t of Object.getOwnPropertyNames(e))
|
|
5542
|
+
for (let t of Object.getOwnPropertyNames(e)) yl(Reflect.get(e, t));
|
|
5319
5543
|
Object.freeze(e);
|
|
5320
5544
|
}
|
|
5321
5545
|
return e;
|
|
5322
5546
|
}
|
|
5323
|
-
function
|
|
5547
|
+
function bl(e, t) {
|
|
5324
5548
|
let n = {};
|
|
5325
5549
|
for (let r of t) r in e && (n[r] = e[r]);
|
|
5326
5550
|
return n;
|
|
5327
5551
|
}
|
|
5328
|
-
function
|
|
5552
|
+
function xl(e) {
|
|
5329
5553
|
if (typeof e != "object" || !e) return e;
|
|
5330
5554
|
if (Array.isArray(e)) {
|
|
5331
5555
|
let t = [];
|
|
5332
|
-
for (let [n, r] of e.entries()) t[n] =
|
|
5556
|
+
for (let [n, r] of e.entries()) t[n] = xl(r);
|
|
5333
5557
|
return t;
|
|
5334
5558
|
}
|
|
5335
5559
|
{
|
|
5336
5560
|
let t = {};
|
|
5337
|
-
for (let n in e) t[n] =
|
|
5561
|
+
for (let n in e) t[n] = xl(e[n]);
|
|
5338
5562
|
return t;
|
|
5339
5563
|
}
|
|
5340
5564
|
}
|
|
5341
|
-
function
|
|
5565
|
+
function Sl(e, t) {
|
|
5342
5566
|
if (e === t) return !0;
|
|
5343
5567
|
if (typeof e != "object" || !e || typeof e != typeof t) return !1;
|
|
5344
5568
|
if (Array.isArray(e)) {
|
|
5345
5569
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
5346
|
-
for (let [n, r] of e.entries()) if (!
|
|
5570
|
+
for (let [n, r] of e.entries()) if (!Sl(r, t[n])) return !1;
|
|
5347
5571
|
} else {
|
|
5348
5572
|
if (Array.isArray(t)) return !1;
|
|
5349
|
-
for (let n in e) if (!(n in t) || !
|
|
5573
|
+
for (let n in e) if (!(n in t) || !Sl(e[n], t[n])) return !1;
|
|
5350
5574
|
for (let n in t) if (!(n in e)) return !1;
|
|
5351
5575
|
}
|
|
5352
5576
|
return !0;
|
|
@@ -5359,48 +5583,48 @@ var H = Object.freeze({
|
|
|
5359
5583
|
ContainedBy: 2,
|
|
5360
5584
|
Rejection: 3,
|
|
5361
5585
|
Intersection: 4
|
|
5362
|
-
}), U =
|
|
5586
|
+
}), U = Al(H.Equals), W = Al(H.Containing), G = Al(H.ContainedBy), K = Al(H.Rejection), q = Al(H.Intersection), Cl = yl([
|
|
5363
5587
|
[H.Equals, U],
|
|
5364
5588
|
[H.Containing, W],
|
|
5365
5589
|
[H.ContainedBy, G],
|
|
5366
5590
|
[H.Rejection, K],
|
|
5367
5591
|
[H.Intersection, q]
|
|
5368
|
-
]),
|
|
5592
|
+
]), wl = (() => {
|
|
5369
5593
|
let e = 0;
|
|
5370
|
-
for (let [t, n] of
|
|
5594
|
+
for (let [t, n] of Cl) e |= n;
|
|
5371
5595
|
return e;
|
|
5372
5596
|
})();
|
|
5373
|
-
function
|
|
5597
|
+
function Tl(e) {
|
|
5374
5598
|
return !!(e & U);
|
|
5375
5599
|
}
|
|
5376
|
-
function
|
|
5600
|
+
function El(e) {
|
|
5377
5601
|
return !!(e & W);
|
|
5378
5602
|
}
|
|
5379
|
-
function
|
|
5603
|
+
function Dl(e) {
|
|
5380
5604
|
return !!(e & G);
|
|
5381
5605
|
}
|
|
5382
|
-
function
|
|
5606
|
+
function Ol(e) {
|
|
5383
5607
|
return !!(e & K);
|
|
5384
5608
|
}
|
|
5385
|
-
function
|
|
5609
|
+
function kl(e) {
|
|
5386
5610
|
return !!(e & q);
|
|
5387
5611
|
}
|
|
5388
|
-
function
|
|
5612
|
+
function Al(e) {
|
|
5389
5613
|
return 1 << e;
|
|
5390
5614
|
}
|
|
5391
5615
|
//#endregion
|
|
5392
5616
|
//#region src/json-schema-subset/expression/combination.ts
|
|
5393
|
-
function
|
|
5394
|
-
let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r :
|
|
5617
|
+
function jl(e) {
|
|
5618
|
+
let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r : Ml(t, r, e), n += 1, t) };
|
|
5395
5619
|
return Object.defineProperties(r, {
|
|
5396
5620
|
result: { get: () => t },
|
|
5397
5621
|
count: { get: () => n }
|
|
5398
5622
|
}), r;
|
|
5399
5623
|
}
|
|
5400
|
-
function
|
|
5624
|
+
function Ml(e, t, n) {
|
|
5401
5625
|
let r = 0;
|
|
5402
|
-
for (let [i, a] of
|
|
5403
|
-
for (let [e, a] of
|
|
5626
|
+
for (let [i, a] of Cl) if (a & e) {
|
|
5627
|
+
for (let [e, a] of Cl) if (a & t && (r |= n(i, e), r === wl)) return r;
|
|
5404
5628
|
}
|
|
5405
5629
|
return r;
|
|
5406
5630
|
}
|
|
@@ -5414,59 +5638,59 @@ var J = Object.freeze({
|
|
|
5414
5638
|
Not: 4,
|
|
5415
5639
|
Swap: 5
|
|
5416
5640
|
});
|
|
5417
|
-
function
|
|
5641
|
+
function Nl(e, t) {
|
|
5418
5642
|
switch (e) {
|
|
5419
5643
|
case J.Save: return t[0];
|
|
5420
|
-
case J.OneOf: return
|
|
5644
|
+
case J.OneOf: return Fl(t);
|
|
5421
5645
|
case J.AllOf:
|
|
5422
|
-
case J.AnyOf: return
|
|
5646
|
+
case J.AnyOf: return Il(e, t);
|
|
5423
5647
|
case J.Not:
|
|
5424
|
-
case J.Swap: return
|
|
5648
|
+
case J.Swap: return Ll(e, t[0]);
|
|
5425
5649
|
}
|
|
5426
5650
|
}
|
|
5427
|
-
function
|
|
5428
|
-
return
|
|
5651
|
+
function Pl(e) {
|
|
5652
|
+
return Ll(J.Swap, e);
|
|
5429
5653
|
}
|
|
5430
|
-
function
|
|
5654
|
+
function Fl(e) {
|
|
5431
5655
|
if (e.length === 1) return e[0];
|
|
5432
|
-
let t =
|
|
5656
|
+
let t = Il(J.AnyOf, e), n = [];
|
|
5433
5657
|
for (let t = 0; t < e.length; ++t) for (let r = t + 1; r < e.length; ++r) {
|
|
5434
|
-
let i = e[t], a = e[r], o =
|
|
5658
|
+
let i = e[t], a = e[r], o = Il(J.AllOf, [i, a]);
|
|
5435
5659
|
n.push(o);
|
|
5436
5660
|
}
|
|
5437
|
-
let r =
|
|
5438
|
-
return
|
|
5661
|
+
let r = Il(J.AnyOf, n), i = Ll(J.Not, r);
|
|
5662
|
+
return Il(J.AllOf, [t, i]);
|
|
5439
5663
|
}
|
|
5440
|
-
function
|
|
5664
|
+
function Il(e, t) {
|
|
5441
5665
|
if (t.length < 0) throw Error("invalid expressions: empty array");
|
|
5442
5666
|
let n;
|
|
5443
5667
|
switch (e) {
|
|
5444
5668
|
case J.AllOf:
|
|
5445
|
-
n =
|
|
5669
|
+
n = jl(Rl);
|
|
5446
5670
|
break;
|
|
5447
5671
|
case J.AnyOf:
|
|
5448
|
-
n =
|
|
5672
|
+
n = jl(zl);
|
|
5449
5673
|
break;
|
|
5450
5674
|
default: throw Error(`invalid operator ${e}`);
|
|
5451
5675
|
}
|
|
5452
5676
|
for (let e of t) n.push(e);
|
|
5453
5677
|
return n.result;
|
|
5454
5678
|
}
|
|
5455
|
-
function
|
|
5679
|
+
function Ll(e, t) {
|
|
5456
5680
|
let n, r = 0;
|
|
5457
5681
|
switch (e) {
|
|
5458
5682
|
case J.Not:
|
|
5459
|
-
n =
|
|
5683
|
+
n = Bl;
|
|
5460
5684
|
break;
|
|
5461
5685
|
case J.Swap:
|
|
5462
|
-
n =
|
|
5686
|
+
n = Vl;
|
|
5463
5687
|
break;
|
|
5464
5688
|
default: throw Error(`invalid operator ${e}`);
|
|
5465
5689
|
}
|
|
5466
|
-
for (let [e, i] of
|
|
5690
|
+
for (let [e, i] of Cl) i & t && (r |= n(e));
|
|
5467
5691
|
return r;
|
|
5468
5692
|
}
|
|
5469
|
-
function
|
|
5693
|
+
function Rl(e, t) {
|
|
5470
5694
|
let n = 0;
|
|
5471
5695
|
switch (e) {
|
|
5472
5696
|
case H.Equals:
|
|
@@ -5555,7 +5779,7 @@ function xl(e, t) {
|
|
|
5555
5779
|
}
|
|
5556
5780
|
return n;
|
|
5557
5781
|
}
|
|
5558
|
-
function
|
|
5782
|
+
function zl(e, t) {
|
|
5559
5783
|
let n = 0;
|
|
5560
5784
|
switch (e) {
|
|
5561
5785
|
case H.Equals:
|
|
@@ -5644,7 +5868,7 @@ function Sl(e, t) {
|
|
|
5644
5868
|
}
|
|
5645
5869
|
return n;
|
|
5646
5870
|
}
|
|
5647
|
-
function
|
|
5871
|
+
function Bl(e) {
|
|
5648
5872
|
let t = 0;
|
|
5649
5873
|
switch (e) {
|
|
5650
5874
|
case H.Equals:
|
|
@@ -5663,7 +5887,7 @@ function Cl(e) {
|
|
|
5663
5887
|
}
|
|
5664
5888
|
return t;
|
|
5665
5889
|
}
|
|
5666
|
-
function
|
|
5890
|
+
function Vl(e) {
|
|
5667
5891
|
let t = 0;
|
|
5668
5892
|
switch (e) {
|
|
5669
5893
|
case H.Equals:
|
|
@@ -5684,13 +5908,13 @@ function wl(e) {
|
|
|
5684
5908
|
}
|
|
5685
5909
|
//#endregion
|
|
5686
5910
|
//#region src/json-schema-subset/expression/types.ts
|
|
5687
|
-
var
|
|
5911
|
+
var Hl = Object.freeze({
|
|
5688
5912
|
Leaf: 0,
|
|
5689
5913
|
Not: 1,
|
|
5690
5914
|
AllOf: 2,
|
|
5691
5915
|
AnyOf: 3,
|
|
5692
5916
|
OneOf: 4
|
|
5693
|
-
}),
|
|
5917
|
+
}), Ul = (e) => (t, n) => {
|
|
5694
5918
|
let r = {
|
|
5695
5919
|
parent: null,
|
|
5696
5920
|
swapped: !1,
|
|
@@ -5718,7 +5942,7 @@ var Tl = Object.freeze({
|
|
|
5718
5942
|
let n = U, [r, o] = t.expressions;
|
|
5719
5943
|
if (!e.equals(r, o)) {
|
|
5720
5944
|
let a = e.describe(r);
|
|
5721
|
-
if (a.kind !==
|
|
5945
|
+
if (a.kind !== Hl.Leaf) {
|
|
5722
5946
|
let [e, n] = s(a, !1);
|
|
5723
5947
|
t.expressions = null, t.calculation = e;
|
|
5724
5948
|
for (let [e, r] of n.entries()) i.push({
|
|
@@ -5733,7 +5957,7 @@ var Tl = Object.freeze({
|
|
|
5733
5957
|
return;
|
|
5734
5958
|
}
|
|
5735
5959
|
let c = e.describe(o);
|
|
5736
|
-
if (c.kind !==
|
|
5960
|
+
if (c.kind !== Hl.Leaf) {
|
|
5737
5961
|
let [e, n] = s(c, !0);
|
|
5738
5962
|
t.expressions = null, t.calculation = e;
|
|
5739
5963
|
for (let [e, a] of n.entries()) i.push({
|
|
@@ -5759,16 +5983,16 @@ var Tl = Object.freeze({
|
|
|
5759
5983
|
function s(e, t) {
|
|
5760
5984
|
let n = J.Save, r;
|
|
5761
5985
|
switch (e.kind) {
|
|
5762
|
-
case
|
|
5986
|
+
case Hl.Not:
|
|
5763
5987
|
n = J.Not, r = [e.expression];
|
|
5764
5988
|
break;
|
|
5765
|
-
case
|
|
5989
|
+
case Hl.AllOf:
|
|
5766
5990
|
n = J.AllOf, r = [...e.expressions];
|
|
5767
5991
|
break;
|
|
5768
|
-
case
|
|
5992
|
+
case Hl.AnyOf:
|
|
5769
5993
|
n = J.AnyOf, r = [...e.expressions];
|
|
5770
5994
|
break;
|
|
5771
|
-
case
|
|
5995
|
+
case Hl.OneOf:
|
|
5772
5996
|
n = J.OneOf, r = [...e.expressions];
|
|
5773
5997
|
break;
|
|
5774
5998
|
default: throw Error(`invalid kind ${e.kind}`);
|
|
@@ -5781,8 +6005,8 @@ var Tl = Object.freeze({
|
|
|
5781
6005
|
}, r];
|
|
5782
6006
|
}
|
|
5783
6007
|
function c(e) {
|
|
5784
|
-
let t = e.calculation, n = e.parent, r =
|
|
5785
|
-
if (r === 0 && (r = G), t.willSwap && (r =
|
|
6008
|
+
let t = e.calculation, n = e.parent, r = Nl(t.operator, t.results);
|
|
6009
|
+
if (r === 0 && (r = G), t.willSwap && (r = Pl(r)), n) {
|
|
5786
6010
|
let e = n.node.calculation, t = e.results;
|
|
5787
6011
|
t[n.index] = r, e.count += 1, e.count >= t.length && a.push(n.node);
|
|
5788
6012
|
}
|
|
@@ -5790,79 +6014,79 @@ var Tl = Object.freeze({
|
|
|
5790
6014
|
let l = r.calculation.results[0];
|
|
5791
6015
|
if (l === 0) throw Error("cannot find result of root");
|
|
5792
6016
|
return l;
|
|
5793
|
-
},
|
|
6017
|
+
}, Wl = class extends Error {
|
|
5794
6018
|
constructor(e = []) {
|
|
5795
|
-
super(
|
|
6019
|
+
super(ql(e)), this.name = "SchemaError", this.items = e;
|
|
5796
6020
|
}
|
|
5797
|
-
},
|
|
6021
|
+
}, Gl = Object.freeze({
|
|
5798
6022
|
Compiled: 0,
|
|
5799
6023
|
External: 1
|
|
5800
6024
|
});
|
|
5801
|
-
function
|
|
6025
|
+
function Kl(e) {
|
|
5802
6026
|
switch (e.kind) {
|
|
5803
|
-
case
|
|
6027
|
+
case Gl.Compiled: {
|
|
5804
6028
|
let { message: t, path: n } = e;
|
|
5805
6029
|
return `${t} (at ${n.length > 0 ? n.join(".") : "$root"})`;
|
|
5806
6030
|
}
|
|
5807
|
-
case
|
|
6031
|
+
case Gl.External: return String(e.error);
|
|
5808
6032
|
}
|
|
5809
6033
|
}
|
|
5810
|
-
function
|
|
6034
|
+
function ql(e) {
|
|
5811
6035
|
switch (e.length) {
|
|
5812
6036
|
case 0: return "without any items";
|
|
5813
|
-
case 1: return
|
|
5814
|
-
default: return `${
|
|
6037
|
+
case 1: return Kl(e[0]);
|
|
6038
|
+
default: return `${Kl(e[0])} ... omit the rest ${e.length - 1} items`;
|
|
5815
6039
|
}
|
|
5816
6040
|
}
|
|
5817
6041
|
//#endregion
|
|
5818
6042
|
//#region src/json-schema-subset/compiler/common.ts
|
|
5819
|
-
var
|
|
5820
|
-
function
|
|
5821
|
-
return
|
|
6043
|
+
var Jl = /* @__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("."));
|
|
6044
|
+
function Yl(e) {
|
|
6045
|
+
return Jl.has(e);
|
|
5822
6046
|
}
|
|
5823
|
-
function
|
|
5824
|
-
for (let t in e) if (
|
|
6047
|
+
function Xl(e) {
|
|
6048
|
+
for (let t in e) if (Yl(t)) return !1;
|
|
5825
6049
|
return !0;
|
|
5826
6050
|
}
|
|
5827
|
-
function
|
|
6051
|
+
function Zl(e, ...t) {
|
|
5828
6052
|
return {
|
|
5829
6053
|
...e,
|
|
5830
6054
|
path: [...e.path, ...t]
|
|
5831
6055
|
};
|
|
5832
6056
|
}
|
|
5833
|
-
function
|
|
6057
|
+
function Ql(e) {
|
|
5834
6058
|
if (typeof e == "boolean") throw Error("JSONSchema7Definition cannot be boolean");
|
|
5835
6059
|
return e;
|
|
5836
6060
|
}
|
|
5837
|
-
function
|
|
5838
|
-
t.push(
|
|
6061
|
+
function $l({ path: e, errors: t }, n, ...r) {
|
|
6062
|
+
t.push(eu(e, r, n));
|
|
5839
6063
|
}
|
|
5840
6064
|
function Y({ path: e, warns: t }, n, ...r) {
|
|
5841
|
-
t.push(
|
|
6065
|
+
t.push(eu(e, r, n));
|
|
5842
6066
|
}
|
|
5843
|
-
function
|
|
6067
|
+
function eu(e, t, n) {
|
|
5844
6068
|
return {
|
|
5845
|
-
kind:
|
|
6069
|
+
kind: Gl.Compiled,
|
|
5846
6070
|
message: n,
|
|
5847
6071
|
path: [...e, ...t]
|
|
5848
6072
|
};
|
|
5849
6073
|
}
|
|
5850
6074
|
//#endregion
|
|
5851
6075
|
//#region src/json-schema-subset/compiler/utils.ts
|
|
5852
|
-
function
|
|
6076
|
+
function tu(e) {
|
|
5853
6077
|
for (let t in e) {
|
|
5854
6078
|
let n = e[t];
|
|
5855
|
-
n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] :
|
|
6079
|
+
n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] : nu(n) && delete e[t]);
|
|
5856
6080
|
}
|
|
5857
6081
|
return e;
|
|
5858
6082
|
}
|
|
5859
|
-
function
|
|
6083
|
+
function nu(e) {
|
|
5860
6084
|
for (let t in e) return !1;
|
|
5861
6085
|
return !0;
|
|
5862
6086
|
}
|
|
5863
6087
|
//#endregion
|
|
5864
6088
|
//#region src/json-schema-subset/compiler/wrapper.ts
|
|
5865
|
-
var
|
|
6089
|
+
var ru = Symbol("compiledId"), iu = Symbol("compiledKind"), au = Symbol("compiledPath"), ou = Symbol("validatorLoader"), X = Object.freeze({
|
|
5866
6090
|
Extends: 0,
|
|
5867
6091
|
Never: 1,
|
|
5868
6092
|
Any: 2,
|
|
@@ -5875,62 +6099,62 @@ var Bl = Symbol("compiledId"), Vl = Symbol("compiledKind"), Hl = Symbol("compile
|
|
|
5875
6099
|
Not: 9,
|
|
5876
6100
|
Combination: 10,
|
|
5877
6101
|
EnumOrConst: 11
|
|
5878
|
-
}),
|
|
6102
|
+
}), su = yl(hu(X.Any, vl(), {}, () => () => !0)), cu = yl(hu(X.Never, vl(), {
|
|
5879
6103
|
type: "string",
|
|
5880
6104
|
maxLength: 0,
|
|
5881
6105
|
minLength: 1
|
|
5882
6106
|
}, () => () => !1));
|
|
5883
|
-
function
|
|
5884
|
-
return typeof e != "object" || !e ? !1 :
|
|
6107
|
+
function lu(e) {
|
|
6108
|
+
return typeof e != "object" || !e ? !1 : ru in e;
|
|
5885
6109
|
}
|
|
5886
|
-
function
|
|
5887
|
-
return typeof e != "object" || !e ? !1 :
|
|
6110
|
+
function uu(e) {
|
|
6111
|
+
return typeof e != "object" || !e ? !1 : ru in e && iu in e;
|
|
5888
6112
|
}
|
|
5889
6113
|
function Z(e) {
|
|
5890
|
-
return
|
|
6114
|
+
return uu(e) ? e[iu] : X.Extends;
|
|
5891
6115
|
}
|
|
5892
|
-
function
|
|
5893
|
-
return
|
|
6116
|
+
function du(e) {
|
|
6117
|
+
return uu(e) || lu(e) ? e[ru] : e.id;
|
|
5894
6118
|
}
|
|
5895
|
-
function
|
|
5896
|
-
return
|
|
6119
|
+
function fu(e) {
|
|
6120
|
+
return uu(e) ? e[au] : void 0;
|
|
5897
6121
|
}
|
|
5898
|
-
function
|
|
5899
|
-
return typeof e != "object" || !e || Object.defineProperty(e,
|
|
5900
|
-
value:
|
|
6122
|
+
function pu(e) {
|
|
6123
|
+
return typeof e != "object" || !e || Object.defineProperty(e, ru, {
|
|
6124
|
+
value: vl(),
|
|
5901
6125
|
configurable: !1,
|
|
5902
6126
|
writable: !1,
|
|
5903
6127
|
enumerable: !1
|
|
5904
6128
|
}), e;
|
|
5905
6129
|
}
|
|
5906
6130
|
function Q(e, t, n, r = []) {
|
|
5907
|
-
return
|
|
6131
|
+
return hu(e, vl(), t, n && (() => n.compile(t)), r);
|
|
5908
6132
|
}
|
|
5909
|
-
function
|
|
5910
|
-
return
|
|
6133
|
+
function mu(e) {
|
|
6134
|
+
return hu(X.Never, vl(), { ...e }, e[ou], e[au]);
|
|
5911
6135
|
}
|
|
5912
|
-
function
|
|
6136
|
+
function hu(e, t, n, r, i = []) {
|
|
5913
6137
|
let a = null;
|
|
5914
6138
|
return Object.defineProperties(n, {
|
|
5915
|
-
[
|
|
6139
|
+
[iu]: {
|
|
5916
6140
|
value: e,
|
|
5917
6141
|
configurable: !1,
|
|
5918
6142
|
writable: !1,
|
|
5919
6143
|
enumerable: !1
|
|
5920
6144
|
},
|
|
5921
|
-
[
|
|
6145
|
+
[ru]: {
|
|
5922
6146
|
value: t,
|
|
5923
6147
|
configurable: !1,
|
|
5924
6148
|
writable: !1,
|
|
5925
6149
|
enumerable: !1
|
|
5926
6150
|
},
|
|
5927
|
-
[
|
|
6151
|
+
[au]: {
|
|
5928
6152
|
value: i,
|
|
5929
6153
|
configurable: !1,
|
|
5930
6154
|
writable: !1,
|
|
5931
6155
|
enumerable: !1
|
|
5932
6156
|
},
|
|
5933
|
-
[
|
|
6157
|
+
[ou]: {
|
|
5934
6158
|
value: r,
|
|
5935
6159
|
configurable: !1,
|
|
5936
6160
|
writable: !1,
|
|
@@ -5947,16 +6171,16 @@ function Ql(e, t, n, r, i = []) {
|
|
|
5947
6171
|
}
|
|
5948
6172
|
//#endregion
|
|
5949
6173
|
//#region src/json-schema-subset/compiler/array.ts
|
|
5950
|
-
function
|
|
5951
|
-
let n =
|
|
5952
|
-
if (Array.isArray(n) ? s =
|
|
6174
|
+
function gu(e, t) {
|
|
6175
|
+
let n = _u(e, t), r = vu(e, "maxItems", t), i = vu(e, "minItems", t), a = yu(e, t), o = t.uniqueItems, s;
|
|
6176
|
+
if (Array.isArray(n) ? s = bu(e, t) : t.additionalItems && Y(e, "it is needless when items is not array", "additionalItems"), !n || !a || s === null) return null;
|
|
5953
6177
|
let c = !1, l = !1;
|
|
5954
6178
|
if (Array.isArray(n)) {
|
|
5955
|
-
r !== void 0 && r <= n.length && (n = n.splice(r), s =
|
|
6179
|
+
r !== void 0 && r <= n.length && (n = n.splice(r), s = xu(s, e.delegate));
|
|
5956
6180
|
let t = n.findIndex((e) => Z(e) === X.Never);
|
|
5957
|
-
t !== -1 && (n = n.splice(t), s =
|
|
6181
|
+
t !== -1 && (n = n.splice(t), s = xu(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);
|
|
5958
6182
|
} else Z(n) === X.Never && (c = !0);
|
|
5959
|
-
return r !== void 0 && i !== void 0 && r < i && (l || Y(e, `maxItems(${r}) is less than minItems(${i})`), c = !0), Q(c ? X.Never : X.Array,
|
|
6183
|
+
return r !== void 0 && i !== void 0 && r < i && (l || Y(e, `maxItems(${r}) is less than minItems(${i})`), c = !0), Q(c ? X.Never : X.Array, tu({
|
|
5960
6184
|
type: "array",
|
|
5961
6185
|
items: n,
|
|
5962
6186
|
contains: a,
|
|
@@ -5966,12 +6190,12 @@ function $l(e, t) {
|
|
|
5966
6190
|
additionalItems: s
|
|
5967
6191
|
}), e.delegate, e.path);
|
|
5968
6192
|
}
|
|
5969
|
-
function
|
|
6193
|
+
function _u(e, { items: t }) {
|
|
5970
6194
|
if (!t) return Q(X.Any, {}, e.delegate, e.path);
|
|
5971
6195
|
if (Array.isArray(t)) {
|
|
5972
6196
|
let n = [], r = !1;
|
|
5973
6197
|
for (let [i, a] of t.entries()) {
|
|
5974
|
-
let t =
|
|
6198
|
+
let t = td(Zl(e, "items", i), Ql(a));
|
|
5975
6199
|
if (!t) {
|
|
5976
6200
|
r = !0;
|
|
5977
6201
|
continue;
|
|
@@ -5980,9 +6204,9 @@ function eu(e, { items: t }) {
|
|
|
5980
6204
|
}
|
|
5981
6205
|
return r ? null : n;
|
|
5982
6206
|
}
|
|
5983
|
-
return
|
|
6207
|
+
return td(Zl(e, "items"), Ql(t));
|
|
5984
6208
|
}
|
|
5985
|
-
function
|
|
6209
|
+
function vu(e, t, n) {
|
|
5986
6210
|
let r = n[t];
|
|
5987
6211
|
if (r !== void 0) {
|
|
5988
6212
|
if (Number.isNaN(r)) {
|
|
@@ -5996,35 +6220,35 @@ function tu(e, t, n) {
|
|
|
5996
6220
|
return r;
|
|
5997
6221
|
}
|
|
5998
6222
|
}
|
|
5999
|
-
function
|
|
6000
|
-
return t ?
|
|
6223
|
+
function yu(e, { contains: t }) {
|
|
6224
|
+
return t ? td(Zl(e, "contains"), Ql(t)) : Q(X.Any, {}, e.delegate, e.path);
|
|
6001
6225
|
}
|
|
6002
|
-
function
|
|
6226
|
+
function bu(e, { additionalItems: t }) {
|
|
6003
6227
|
switch (typeof t) {
|
|
6004
6228
|
case "boolean": return t ? Q(X.Any, {}, e.delegate, e.path) : !1;
|
|
6005
|
-
case "object": return
|
|
6229
|
+
case "object": return td(Zl(e, "additionalItems"), t);
|
|
6006
6230
|
default: return Q(X.Any, {}, e.delegate, e.path);
|
|
6007
6231
|
}
|
|
6008
6232
|
}
|
|
6009
|
-
function
|
|
6233
|
+
function xu(e, t) {
|
|
6010
6234
|
return e === void 0 ? Q(X.Never, {
|
|
6011
6235
|
type: "string",
|
|
6012
6236
|
maxLength: 0,
|
|
6013
6237
|
minLength: 1
|
|
6014
|
-
}, t) :
|
|
6238
|
+
}, t) : uu(e) ? Z(e) === X.Never ? e : mu(e) : e;
|
|
6015
6239
|
}
|
|
6016
6240
|
//#endregion
|
|
6017
6241
|
//#region src/json-schema-subset/compiler/combination.ts
|
|
6018
|
-
var
|
|
6242
|
+
var Su = Object.freeze([
|
|
6019
6243
|
"allOf",
|
|
6020
6244
|
"anyOf",
|
|
6021
6245
|
"oneOf"
|
|
6022
6246
|
]);
|
|
6023
|
-
function
|
|
6024
|
-
if (n.length === 0) return
|
|
6247
|
+
function Cu(e, t, n, r) {
|
|
6248
|
+
if (n.length === 0) return $l(e, "disable empty list", t), null;
|
|
6025
6249
|
let i = [];
|
|
6026
6250
|
for (let [r, a] of n.entries()) {
|
|
6027
|
-
let n =
|
|
6251
|
+
let n = td(Zl(e, t, r), Ql(a));
|
|
6028
6252
|
n && i.push(n);
|
|
6029
6253
|
}
|
|
6030
6254
|
if (i.length < n.length) return null;
|
|
@@ -6038,7 +6262,7 @@ function ou(e, t, n, r) {
|
|
|
6038
6262
|
let s = X.Combination;
|
|
6039
6263
|
switch (t) {
|
|
6040
6264
|
case "allOf":
|
|
6041
|
-
o > 0 ? s = X.Never : a === i.length ? s = X.Any :
|
|
6265
|
+
o > 0 ? s = X.Never : a === i.length ? s = X.Any : wu(i) || (s = X.Never);
|
|
6042
6266
|
break;
|
|
6043
6267
|
case "anyOf":
|
|
6044
6268
|
a > 0 ? s = X.Any : o === i.length && (s = X.Never);
|
|
@@ -6047,7 +6271,7 @@ function ou(e, t, n, r) {
|
|
|
6047
6271
|
}
|
|
6048
6272
|
return Q(s, { [t]: i }, r, e.path);
|
|
6049
6273
|
}
|
|
6050
|
-
function
|
|
6274
|
+
function wu(e) {
|
|
6051
6275
|
let t = null;
|
|
6052
6276
|
for (let n of e) {
|
|
6053
6277
|
let e = Z(n);
|
|
@@ -6062,35 +6286,35 @@ function su(e) {
|
|
|
6062
6286
|
}
|
|
6063
6287
|
//#endregion
|
|
6064
6288
|
//#region src/json-schema-subset/checker/validator.ts
|
|
6065
|
-
var
|
|
6289
|
+
var Tu = Object.freeze({
|
|
6066
6290
|
Valid: 0,
|
|
6067
6291
|
Invalid: 1,
|
|
6068
6292
|
Unknown: 2
|
|
6069
6293
|
});
|
|
6070
|
-
function
|
|
6294
|
+
function Eu(e, t) {
|
|
6071
6295
|
let n = e.isValid;
|
|
6072
|
-
return n ? n(t) === !0 ?
|
|
6296
|
+
return n ? n(t) === !0 ? Tu.Valid : Tu.Invalid : Tu.Unknown;
|
|
6073
6297
|
}
|
|
6074
6298
|
//#endregion
|
|
6075
6299
|
//#region src/json-schema-subset/compiler/enumAndConst.ts
|
|
6076
|
-
function
|
|
6300
|
+
function Du(e, t, n, r) {
|
|
6077
6301
|
let i, a = !1;
|
|
6078
6302
|
if (t) {
|
|
6079
|
-
if (t.length === 0) return
|
|
6303
|
+
if (t.length === 0) return $l(e, "disable empty list", "enum"), null;
|
|
6080
6304
|
i = [];
|
|
6081
|
-
for (let [n, a] of t.entries()) switch (
|
|
6082
|
-
case
|
|
6083
|
-
i.push(
|
|
6305
|
+
for (let [n, a] of t.entries()) switch (Eu(r, a)) {
|
|
6306
|
+
case Tu.Valid:
|
|
6307
|
+
i.push(pu(a));
|
|
6084
6308
|
break;
|
|
6085
|
-
case
|
|
6309
|
+
case Tu.Invalid: Y(e, "cannot pass JSON schema of currently schema object", "enum", n);
|
|
6086
6310
|
}
|
|
6087
6311
|
i.length === 0 && Y(e, "all of elements from list is rejected by currently schema object", "enum");
|
|
6088
6312
|
}
|
|
6089
|
-
if (n &&
|
|
6313
|
+
if (n && Eu(r, n) === Tu.Invalid && (a = !0), i) {
|
|
6090
6314
|
if (i.length === 0) a = !0;
|
|
6091
6315
|
else if (n) {
|
|
6092
6316
|
let e = !1;
|
|
6093
|
-
for (let t of i) if (
|
|
6317
|
+
for (let t of i) if (Sl(t, n)) {
|
|
6094
6318
|
e = !0;
|
|
6095
6319
|
break;
|
|
6096
6320
|
}
|
|
@@ -6098,11 +6322,11 @@ function uu(e, t, n, r) {
|
|
|
6098
6322
|
}
|
|
6099
6323
|
}
|
|
6100
6324
|
let o = a ? X.Never : X.EnumOrConst, s = {};
|
|
6101
|
-
return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const =
|
|
6325
|
+
return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const = pu(xl(n))), Q(o, s, e.delegate, e.path);
|
|
6102
6326
|
}
|
|
6103
6327
|
//#endregion
|
|
6104
6328
|
//#region src/json-schema-subset/compiler/object.ts
|
|
6105
|
-
var
|
|
6329
|
+
var Ou = /* @__PURE__ */ new Set([
|
|
6106
6330
|
"type",
|
|
6107
6331
|
"maxProperties",
|
|
6108
6332
|
"minProperties",
|
|
@@ -6113,27 +6337,27 @@ var du = /* @__PURE__ */ new Set([
|
|
|
6113
6337
|
"dependencies",
|
|
6114
6338
|
"propertyNames"
|
|
6115
6339
|
]);
|
|
6116
|
-
function
|
|
6117
|
-
let n = Object.keys(t).filter((e) => !
|
|
6340
|
+
function ku(e, t) {
|
|
6341
|
+
let n = Object.keys(t).filter((e) => !Ou.has(e) && Yl(e));
|
|
6118
6342
|
n.length > 0 && Y(e, `type="object" will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
6119
|
-
let r =
|
|
6343
|
+
let r = Au(e, "maxProperties", t), i = Au(e, "minProperties", t), a = ju(e, t), o = Mu(e, t), s = Nu(e, t), c = Fu(e, t);
|
|
6120
6344
|
if (!a || !o || !s || !c) return null;
|
|
6121
|
-
let l =
|
|
6345
|
+
let l = Pu(e, o, s, t);
|
|
6122
6346
|
if (!l) return null;
|
|
6123
|
-
let u =
|
|
6124
|
-
return Q(
|
|
6347
|
+
let u = Lu(e, Iu(a, o, s, l), c, t);
|
|
6348
|
+
return Q(Ru(e, a, l, u, r, i) ? X.Never : X.Object, tu({
|
|
6125
6349
|
type: "object",
|
|
6126
6350
|
required: u,
|
|
6127
6351
|
properties: l,
|
|
6128
6352
|
minProperties: i,
|
|
6129
6353
|
maxProperties: r,
|
|
6130
6354
|
additionalProperties: a,
|
|
6131
|
-
patternProperties:
|
|
6132
|
-
dependencies:
|
|
6355
|
+
patternProperties: Uu(o),
|
|
6356
|
+
dependencies: Wu(c, t),
|
|
6133
6357
|
propertyNames: s
|
|
6134
6358
|
}), e.delegate, e.path);
|
|
6135
6359
|
}
|
|
6136
|
-
function
|
|
6360
|
+
function Au(e, t, n) {
|
|
6137
6361
|
let r = n[t];
|
|
6138
6362
|
if (r !== void 0) {
|
|
6139
6363
|
if (Number.isNaN(r)) {
|
|
@@ -6147,22 +6371,22 @@ function pu(e, t, n) {
|
|
|
6147
6371
|
return r;
|
|
6148
6372
|
}
|
|
6149
6373
|
}
|
|
6150
|
-
function
|
|
6374
|
+
function ju(e, { additionalProperties: t }) {
|
|
6151
6375
|
return t === !1 ? Q(X.Never, {
|
|
6152
6376
|
type: "string",
|
|
6153
6377
|
maxLength: 0,
|
|
6154
6378
|
minLength: 1
|
|
6155
|
-
}, e.delegate, e.path) : typeof t == "object" ?
|
|
6379
|
+
}, e.delegate, e.path) : typeof t == "object" ? td(Zl(e, "additionalProperties"), Ql(t)) : Q(X.Any, {}, e.delegate, e.path);
|
|
6156
6380
|
}
|
|
6157
|
-
function
|
|
6381
|
+
function Mu(e, { patternProperties: t }) {
|
|
6158
6382
|
let n = !1, r = {};
|
|
6159
6383
|
for (let i in t) {
|
|
6160
|
-
let a =
|
|
6384
|
+
let a = Hu(i);
|
|
6161
6385
|
if (a instanceof Error) {
|
|
6162
6386
|
Y(e, `property name invalid. ${i}`, "patternProperties", i);
|
|
6163
6387
|
continue;
|
|
6164
6388
|
}
|
|
6165
|
-
let o =
|
|
6389
|
+
let o = Ql(t[i]), s = td(Zl(e, "patternProperties", i), o);
|
|
6166
6390
|
if (!s) {
|
|
6167
6391
|
n = !0;
|
|
6168
6392
|
continue;
|
|
@@ -6171,29 +6395,29 @@ function hu(e, { patternProperties: t }) {
|
|
|
6171
6395
|
}
|
|
6172
6396
|
return n ? null : r;
|
|
6173
6397
|
}
|
|
6174
|
-
function
|
|
6398
|
+
function Nu(e, { propertyNames: t }) {
|
|
6175
6399
|
if (!t) return Q(X.Any, {}, e.delegate, e.path);
|
|
6176
|
-
t =
|
|
6177
|
-
let n =
|
|
6400
|
+
t = Ql(t);
|
|
6401
|
+
let n = td(Zl(e, "propertyNames"), t);
|
|
6178
6402
|
if (!n) return null;
|
|
6179
6403
|
let r = Z(n);
|
|
6180
|
-
return r !== X.String && r !== X.Any ?
|
|
6404
|
+
return r !== X.String && r !== X.Any ? mu(n) : n;
|
|
6181
6405
|
}
|
|
6182
|
-
function
|
|
6406
|
+
function Pu(e, t, n, { properties: r }) {
|
|
6183
6407
|
let i = !1;
|
|
6184
6408
|
if (!r) return {};
|
|
6185
6409
|
let a = {};
|
|
6186
6410
|
for (let o in r) {
|
|
6187
|
-
if (
|
|
6411
|
+
if (Eu(n, o) === Tu.Invalid) {
|
|
6188
6412
|
Y(e, `key ${JSON.stringify(o)} cannot pass JSON schema from propertyNames`, "properties");
|
|
6189
6413
|
continue;
|
|
6190
6414
|
}
|
|
6191
|
-
let s =
|
|
6415
|
+
let s = Vu(t, o);
|
|
6192
6416
|
if (s && Z(s) === X.Never) {
|
|
6193
6417
|
Y(e, `key ${JSON.stringify(o)} matches a pattern that has a impossible(never) schema`, "properties");
|
|
6194
6418
|
continue;
|
|
6195
6419
|
}
|
|
6196
|
-
let c =
|
|
6420
|
+
let c = Ql(r[o]), l = td(Zl(e, "properties", o), c);
|
|
6197
6421
|
if (!l) {
|
|
6198
6422
|
i = !0;
|
|
6199
6423
|
continue;
|
|
@@ -6202,40 +6426,40 @@ function _u(e, t, n, { properties: r }) {
|
|
|
6202
6426
|
}
|
|
6203
6427
|
return i ? null : a;
|
|
6204
6428
|
}
|
|
6205
|
-
function
|
|
6429
|
+
function Fu(e, { dependencies: t }) {
|
|
6206
6430
|
if (!t) return [{}, {}];
|
|
6207
6431
|
let n = {}, r = {};
|
|
6208
6432
|
for (let i in t) {
|
|
6209
|
-
let a =
|
|
6433
|
+
let a = Ql(t[i]);
|
|
6210
6434
|
if (Array.isArray(a)) {
|
|
6211
|
-
let { keys: t, duplicated: r } =
|
|
6435
|
+
let { keys: t, duplicated: r } = Bu(a);
|
|
6212
6436
|
r && Y(e, `found duplicated property names: ${r.join(", ")}`, "dependencies", i), n[i] = t;
|
|
6213
6437
|
} else {
|
|
6214
|
-
let t =
|
|
6438
|
+
let t = td(Zl(e, "dependencies", i), a);
|
|
6215
6439
|
if (t) {
|
|
6216
6440
|
let e = Z(t);
|
|
6217
|
-
r[i] = e === X.Object || e === X.Any ? t : e === X.Extends ?
|
|
6441
|
+
r[i] = e === X.Object || e === X.Any ? t : e === X.Extends ? cu : mu(t);
|
|
6218
6442
|
}
|
|
6219
6443
|
}
|
|
6220
6444
|
}
|
|
6221
6445
|
return [n, r];
|
|
6222
6446
|
}
|
|
6223
|
-
function
|
|
6447
|
+
function Iu(e, t, n, r) {
|
|
6224
6448
|
return (i) => {
|
|
6225
|
-
if (
|
|
6226
|
-
let a =
|
|
6449
|
+
if (Eu(n, i) === Tu.Invalid) return !0;
|
|
6450
|
+
let a = Vu(t, i);
|
|
6227
6451
|
return !!(a && Z(a) === X.Never || Z(r[i] ?? e) === X.Never);
|
|
6228
6452
|
};
|
|
6229
6453
|
}
|
|
6230
|
-
function
|
|
6454
|
+
function Lu(e, t, n, { required: r }) {
|
|
6231
6455
|
if (!r) return [];
|
|
6232
|
-
let i =
|
|
6456
|
+
let i = Bu(r);
|
|
6233
6457
|
i.duplicated && Y(e, `found duplicated required keys: ${i.duplicated.join(", ")}`, "required");
|
|
6234
6458
|
let a = [], o = [];
|
|
6235
|
-
for (let e of i.keys)
|
|
6459
|
+
for (let e of i.keys) zu(n, e).some((e) => t(e)) ? o.push(e) : a.push(e);
|
|
6236
6460
|
return o.length > 0 && Y(e, `key ${o.map((e) => JSON.stringify(e)).join(", ")} will ban by another condition`, "required"), a;
|
|
6237
6461
|
}
|
|
6238
|
-
function
|
|
6462
|
+
function Ru(e, t, n, r, i, a) {
|
|
6239
6463
|
if (i !== void 0 && a !== void 0 && i < a) return Y(e, `maxProperties(${i}) is less than minProperties(${a})`), !0;
|
|
6240
6464
|
if (i !== void 0 && r.length > i) return Y(e, `length(${r.length}) of required is greater than maxProperties(${i})`), !0;
|
|
6241
6465
|
if (a !== void 0 && r.length < a) return Y(e, `length(${r.length}) of required is less than minProperties(${a})`), !0;
|
|
@@ -6246,7 +6470,7 @@ function xu(e, t, n, r, i, a) {
|
|
|
6246
6470
|
}
|
|
6247
6471
|
return !0;
|
|
6248
6472
|
}
|
|
6249
|
-
function
|
|
6473
|
+
function zu([e, t], n) {
|
|
6250
6474
|
let r = [n], i = new Set(r);
|
|
6251
6475
|
for (; r.length > 0;) {
|
|
6252
6476
|
let n = r.pop(), i = t[n], o = e[n];
|
|
@@ -6257,7 +6481,7 @@ function Su([e, t], n) {
|
|
|
6257
6481
|
}
|
|
6258
6482
|
return [...i];
|
|
6259
6483
|
}
|
|
6260
|
-
function
|
|
6484
|
+
function Bu(e) {
|
|
6261
6485
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
6262
6486
|
for (let r of e) t.has(r) ? n.add(r) : t.add(r);
|
|
6263
6487
|
return n.size === 0 ? {
|
|
@@ -6268,14 +6492,14 @@ function Cu(e) {
|
|
|
6268
6492
|
duplicated: [...n]
|
|
6269
6493
|
};
|
|
6270
6494
|
}
|
|
6271
|
-
function
|
|
6495
|
+
function Vu(e, t) {
|
|
6272
6496
|
for (let n in e) {
|
|
6273
6497
|
let [r, i] = e[n];
|
|
6274
6498
|
if (i.test(t)) return r;
|
|
6275
6499
|
}
|
|
6276
6500
|
return null;
|
|
6277
6501
|
}
|
|
6278
|
-
function
|
|
6502
|
+
function Hu(e) {
|
|
6279
6503
|
try {
|
|
6280
6504
|
return new RegExp(e, "i");
|
|
6281
6505
|
} catch (e) {
|
|
@@ -6283,12 +6507,12 @@ function Tu(e) {
|
|
|
6283
6507
|
throw e;
|
|
6284
6508
|
}
|
|
6285
6509
|
}
|
|
6286
|
-
function
|
|
6510
|
+
function Uu(e) {
|
|
6287
6511
|
let t = {};
|
|
6288
6512
|
for (let n in e) t[n] = e[n][0];
|
|
6289
6513
|
return t;
|
|
6290
6514
|
}
|
|
6291
|
-
function
|
|
6515
|
+
function Wu([e, t], { dependencies: n }) {
|
|
6292
6516
|
let r = {};
|
|
6293
6517
|
for (let i in n) {
|
|
6294
6518
|
let n = e[i], a = t[i];
|
|
@@ -6298,39 +6522,39 @@ function Du([e, t], { dependencies: n }) {
|
|
|
6298
6522
|
}
|
|
6299
6523
|
//#endregion
|
|
6300
6524
|
//#region src/json-schema-subset/compiler/primitive.ts
|
|
6301
|
-
var
|
|
6525
|
+
var Gu = /* @__PURE__ */ new Set([
|
|
6302
6526
|
"type",
|
|
6303
6527
|
"multipleOf",
|
|
6304
6528
|
"maximum",
|
|
6305
6529
|
"exclusiveMaximum",
|
|
6306
6530
|
"minimum",
|
|
6307
6531
|
"exclusiveMinimum"
|
|
6308
|
-
]),
|
|
6532
|
+
]), Ku = /* @__PURE__ */ new Set([
|
|
6309
6533
|
"type",
|
|
6310
6534
|
"format",
|
|
6311
6535
|
"maxLength",
|
|
6312
6536
|
"minLength",
|
|
6313
6537
|
"pattern"
|
|
6314
6538
|
]);
|
|
6315
|
-
function
|
|
6539
|
+
function qu(e, t) {
|
|
6316
6540
|
let { type: n } = t;
|
|
6317
6541
|
switch (n) {
|
|
6318
6542
|
case "number":
|
|
6319
|
-
case "integer": return
|
|
6320
|
-
case "string": return
|
|
6543
|
+
case "integer": return Ju(e, t);
|
|
6544
|
+
case "string": return Xu(e, t);
|
|
6321
6545
|
case "boolean":
|
|
6322
6546
|
case "null": {
|
|
6323
|
-
let r = Object.keys(t).filter((e) =>
|
|
6547
|
+
let r = Object.keys(t).filter((e) => Yl(e) && e !== "type");
|
|
6324
6548
|
return r.length > 0 && Y(e, `key "type" will exclude other keys: ${r.toSorted().join(", ")}`), Q(n === "null" ? X.Null : X.Boolean, { type: n }, e.delegate, e.path);
|
|
6325
6549
|
}
|
|
6326
|
-
default: return
|
|
6550
|
+
default: return $l(e, `invalid type ${JSON.stringify(n)}`), null;
|
|
6327
6551
|
}
|
|
6328
6552
|
}
|
|
6329
|
-
function
|
|
6330
|
-
let n = Object.keys(t).filter((e) => !
|
|
6553
|
+
function Ju(e, t) {
|
|
6554
|
+
let n = Object.keys(t).filter((e) => !Gu.has(e) && Yl(e));
|
|
6331
6555
|
n.length > 0 && Y(e, `type=${JSON.stringify(t.type)} will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
6332
|
-
let r =
|
|
6333
|
-
for (let t of
|
|
6556
|
+
let r = bl(t, Gu);
|
|
6557
|
+
for (let t of Gu) {
|
|
6334
6558
|
let n = r[t];
|
|
6335
6559
|
t !== "type" && n !== void 0 && Number.isNaN(n) && (Y(e, "found NaN", t), delete r[t]);
|
|
6336
6560
|
}
|
|
@@ -6339,38 +6563,38 @@ function ju(e, t) {
|
|
|
6339
6563
|
let { multipleOf: c } = r;
|
|
6340
6564
|
c === 0 && (delete r.multipleOf, r.type = "number", Y(e, "cannot be 0", "multipleOf"));
|
|
6341
6565
|
let l = X.Numeric;
|
|
6342
|
-
return
|
|
6566
|
+
return Yu(r) || (l = X.Never), Q(l, r, e.delegate, e.path);
|
|
6343
6567
|
}
|
|
6344
|
-
function
|
|
6568
|
+
function Yu(e) {
|
|
6345
6569
|
let { maximum: t, exclusiveMaximum: n, minimum: r, exclusiveMinimum: i } = e;
|
|
6346
6570
|
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;
|
|
6347
6571
|
}
|
|
6348
|
-
function
|
|
6349
|
-
let n = Object.keys(t).filter((e) => !
|
|
6572
|
+
function Xu(e, t) {
|
|
6573
|
+
let n = Object.keys(t).filter((e) => !Ku.has(e) && Yl(e));
|
|
6350
6574
|
n.length > 0 && Y(e, `type="string" will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
6351
|
-
let r =
|
|
6352
|
-
|
|
6575
|
+
let r = bl(t, Ku);
|
|
6576
|
+
Zu(e, r, "maxLength"), Zu(e, r, "minLength");
|
|
6353
6577
|
let i = r.maxLength, a = r.minLength, o = X.String;
|
|
6354
6578
|
return i !== void 0 && (i < 0 || i !== void 0 && a !== void 0 && i < a) && (o = X.Never), Q(o, r, e.delegate, e.path);
|
|
6355
6579
|
}
|
|
6356
|
-
function
|
|
6580
|
+
function Zu(e, t, n) {
|
|
6357
6581
|
let r = t[n];
|
|
6358
6582
|
r !== void 0 && Number.isNaN(r) && (Y(e, "found NaN", n), delete t[n]);
|
|
6359
6583
|
}
|
|
6360
6584
|
//#endregion
|
|
6361
6585
|
//#region src/json-schema-subset/compiler/compiler.ts
|
|
6362
|
-
var
|
|
6363
|
-
function
|
|
6364
|
-
if (
|
|
6586
|
+
var Qu = Object.freeze([]);
|
|
6587
|
+
function $u(e, t, n, r) {
|
|
6588
|
+
if (uu(e) || t.isExtendsSchema(e)) return {
|
|
6365
6589
|
schema: e,
|
|
6366
|
-
warns:
|
|
6590
|
+
warns: Qu
|
|
6367
6591
|
};
|
|
6368
6592
|
if (r) {
|
|
6369
6593
|
let t = r.isSchema(e);
|
|
6370
6594
|
if (typeof t == "object") {
|
|
6371
6595
|
let e = [];
|
|
6372
6596
|
for (let n of t) e.push({
|
|
6373
|
-
kind:
|
|
6597
|
+
kind: Gl.External,
|
|
6374
6598
|
error: n
|
|
6375
6599
|
});
|
|
6376
6600
|
if (e.length > 0) return e;
|
|
@@ -6383,19 +6607,19 @@ function Iu(e, t, n, r) {
|
|
|
6383
6607
|
path: [],
|
|
6384
6608
|
errors: [],
|
|
6385
6609
|
warns: []
|
|
6386
|
-
}, a =
|
|
6387
|
-
if (a)
|
|
6388
|
-
else return
|
|
6610
|
+
}, a = td(i, e);
|
|
6611
|
+
if (a) ed(i.errors.length === 0, "found errors (it should be empty)");
|
|
6612
|
+
else return ed(i.errors.length > 0, "cannot found any errors"), i.errors;
|
|
6389
6613
|
return {
|
|
6390
6614
|
schema: a,
|
|
6391
6615
|
warns: i.warns
|
|
6392
6616
|
};
|
|
6393
6617
|
}
|
|
6394
|
-
function
|
|
6618
|
+
function ed(e, t) {
|
|
6395
6619
|
if (!e) throw Error(t);
|
|
6396
6620
|
}
|
|
6397
|
-
function
|
|
6398
|
-
if (e.extends.isExtendsSchema(t) ||
|
|
6621
|
+
function td(e, t) {
|
|
6622
|
+
if (e.extends.isExtendsSchema(t) || uu(t)) return t;
|
|
6399
6623
|
let n = e.extends.tryCompiledExtendsSchema(t, e.payload);
|
|
6400
6624
|
if (n) return n;
|
|
6401
6625
|
let r = t, i = !1, { enum: a, const: o } = t;
|
|
@@ -6403,23 +6627,23 @@ function Ru(e, t) {
|
|
|
6403
6627
|
let { enum: e, const: n, ...a } = t;
|
|
6404
6628
|
r = a, i = !0;
|
|
6405
6629
|
}
|
|
6406
|
-
let s =
|
|
6407
|
-
return s && i && (s =
|
|
6630
|
+
let s = nd(e, r);
|
|
6631
|
+
return s && i && (s = Du(e, a, o, s)), s || null;
|
|
6408
6632
|
}
|
|
6409
|
-
function
|
|
6410
|
-
for (let n of
|
|
6633
|
+
function nd(e, t) {
|
|
6634
|
+
for (let n of Su) {
|
|
6411
6635
|
let r = t[n];
|
|
6412
6636
|
if (r) {
|
|
6413
|
-
let i = Object.keys(t).filter((e) =>
|
|
6414
|
-
return i.length > 0 && Y(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`),
|
|
6637
|
+
let i = Object.keys(t).filter((e) => Yl(e) && e !== n);
|
|
6638
|
+
return i.length > 0 && Y(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`), Cu(e, n, r) || null;
|
|
6415
6639
|
}
|
|
6416
6640
|
}
|
|
6417
6641
|
{
|
|
6418
|
-
let n =
|
|
6642
|
+
let n = Ql(t.not);
|
|
6419
6643
|
if (n) {
|
|
6420
|
-
let r = Object.keys(t).filter((e) =>
|
|
6644
|
+
let r = Object.keys(t).filter((e) => Yl(e) && e !== "not");
|
|
6421
6645
|
r.length > 0 && Y(e, `key "not" will exclude other keys: ${r.toSorted().join(", ")}`);
|
|
6422
|
-
let i =
|
|
6646
|
+
let i = td(Zl(e, "not"), n);
|
|
6423
6647
|
if (!i) return null;
|
|
6424
6648
|
let a = X.Not;
|
|
6425
6649
|
switch (Z(i)) {
|
|
@@ -6435,26 +6659,26 @@ function zu(e, t) {
|
|
|
6435
6659
|
let { type: n } = t;
|
|
6436
6660
|
if (Array.isArray(n)) {
|
|
6437
6661
|
let { type: r, ...i } = t;
|
|
6438
|
-
return
|
|
6662
|
+
return Cu(e, "anyOf", n.map((e) => ({
|
|
6439
6663
|
...i,
|
|
6440
6664
|
type: e
|
|
6441
6665
|
})));
|
|
6442
6666
|
}
|
|
6443
6667
|
switch (n) {
|
|
6444
|
-
case "object": return
|
|
6445
|
-
case "array": return
|
|
6446
|
-
default: return
|
|
6668
|
+
case "object": return ku(e, t);
|
|
6669
|
+
case "array": return gu(e, t);
|
|
6670
|
+
default: return qu(e, t);
|
|
6447
6671
|
}
|
|
6448
6672
|
}
|
|
6449
|
-
return
|
|
6673
|
+
return Xl(t) ? Q(X.Any, {}, e.delegate, e.path) : ($l(e, "unrecognized"), null);
|
|
6450
6674
|
}
|
|
6451
6675
|
//#endregion
|
|
6452
6676
|
//#region src/json-schema-subset/checker/tools/mark.ts
|
|
6453
|
-
var
|
|
6677
|
+
var rd = class {
|
|
6454
6678
|
constructor(e) {
|
|
6455
6679
|
let t = Object.freeze(e.toSorted());
|
|
6456
6680
|
if (t.length > 32) throw Error(`cannot define ${t.length} keys which is greater than 32`);
|
|
6457
|
-
this.keys = t, this.clazz = class extends
|
|
6681
|
+
this.keys = t, this.clazz = class extends id {
|
|
6458
6682
|
constructor(e) {
|
|
6459
6683
|
super(t, e);
|
|
6460
6684
|
}
|
|
@@ -6478,7 +6702,7 @@ var Bu = class {
|
|
|
6478
6702
|
else if (e) for (let [n, r] of this.keys.entries()) e[r] && (t |= 1 << n);
|
|
6479
6703
|
return new this.clazz(t);
|
|
6480
6704
|
}
|
|
6481
|
-
},
|
|
6705
|
+
}, id = class {
|
|
6482
6706
|
constructor(e, t) {
|
|
6483
6707
|
this.keys = e, this.int32 = t;
|
|
6484
6708
|
}
|
|
@@ -6493,21 +6717,21 @@ var Bu = class {
|
|
|
6493
6717
|
};
|
|
6494
6718
|
//#endregion
|
|
6495
6719
|
//#region src/json-schema-subset/checker/tools/quantum.ts
|
|
6496
|
-
function
|
|
6497
|
-
return new
|
|
6720
|
+
function ad(e) {
|
|
6721
|
+
return new od(e);
|
|
6498
6722
|
}
|
|
6499
|
-
var
|
|
6723
|
+
var od = class {
|
|
6500
6724
|
constructor(e) {
|
|
6501
|
-
this.description = new
|
|
6725
|
+
this.description = new rd(e);
|
|
6502
6726
|
}
|
|
6503
6727
|
get keys() {
|
|
6504
6728
|
return this.description.keys;
|
|
6505
6729
|
}
|
|
6506
6730
|
variable(e) {
|
|
6507
6731
|
let t;
|
|
6508
|
-
return e && (t = this.description.toBundle(e).toInt32()), new
|
|
6732
|
+
return e && (t = this.description.toBundle(e).toInt32()), new sd(this.description, t);
|
|
6509
6733
|
}
|
|
6510
|
-
},
|
|
6734
|
+
}, sd = class {
|
|
6511
6735
|
constructor(e, t) {
|
|
6512
6736
|
this.values = /* @__PURE__ */ new Set(), this.description = e, t !== void 0 && this.values.add(t);
|
|
6513
6737
|
}
|
|
@@ -6528,7 +6752,7 @@ var Uu = class {
|
|
|
6528
6752
|
}
|
|
6529
6753
|
push(e, t) {
|
|
6530
6754
|
let n = /* @__PURE__ */ new Set();
|
|
6531
|
-
for (let r of this.values) for (let [i, a] of
|
|
6755
|
+
for (let r of this.values) for (let [i, a] of Cl) if (e & a) {
|
|
6532
6756
|
let e = this.description.toBundle(r);
|
|
6533
6757
|
t(i, e), n.add(e.toInt32());
|
|
6534
6758
|
}
|
|
@@ -6545,11 +6769,11 @@ var Uu = class {
|
|
|
6545
6769
|
};
|
|
6546
6770
|
//#endregion
|
|
6547
6771
|
//#region src/json-schema-subset/checker/tools/range.ts
|
|
6548
|
-
function
|
|
6772
|
+
function cd(e, t) {
|
|
6549
6773
|
let [n] = e, [r] = t;
|
|
6550
|
-
return n.num < r.num ?
|
|
6774
|
+
return n.num < r.num ? ld(e, t) : n.num > r.num ? ud(e, t) : dd(e, t);
|
|
6551
6775
|
}
|
|
6552
|
-
function
|
|
6776
|
+
function ld(e, t) {
|
|
6553
6777
|
let [n, r] = e, [i, a] = t;
|
|
6554
6778
|
if (r.num <= i.num) {
|
|
6555
6779
|
let n = r.exclusive, a = i.exclusive;
|
|
@@ -6574,11 +6798,11 @@ function Ku(e, t) {
|
|
|
6574
6798
|
let t;
|
|
6575
6799
|
return e && (t = {
|
|
6576
6800
|
fromLeft: !1,
|
|
6577
|
-
range: [
|
|
6801
|
+
range: [fd(r), a]
|
|
6578
6802
|
}), {
|
|
6579
6803
|
left: {
|
|
6580
6804
|
fromLeft: !0,
|
|
6581
|
-
range: [n,
|
|
6805
|
+
range: [n, fd(i)]
|
|
6582
6806
|
},
|
|
6583
6807
|
center: [i, r],
|
|
6584
6808
|
right: t
|
|
@@ -6588,16 +6812,16 @@ function Ku(e, t) {
|
|
|
6588
6812
|
return {
|
|
6589
6813
|
left: {
|
|
6590
6814
|
fromLeft: !0,
|
|
6591
|
-
range: [n,
|
|
6815
|
+
range: [n, fd(i)]
|
|
6592
6816
|
},
|
|
6593
6817
|
center: [i, a],
|
|
6594
6818
|
right: {
|
|
6595
6819
|
fromLeft: !0,
|
|
6596
|
-
range: [
|
|
6820
|
+
range: [fd(a), r]
|
|
6597
6821
|
}
|
|
6598
6822
|
};
|
|
6599
6823
|
}
|
|
6600
|
-
function
|
|
6824
|
+
function ud(e, t) {
|
|
6601
6825
|
let [n, r] = e, [i, a] = t;
|
|
6602
6826
|
if (n.num >= a.num) {
|
|
6603
6827
|
let r = a.exclusive, i = n.exclusive;
|
|
@@ -6622,11 +6846,11 @@ function qu(e, t) {
|
|
|
6622
6846
|
let t;
|
|
6623
6847
|
return e && (t = {
|
|
6624
6848
|
fromLeft: !0,
|
|
6625
|
-
range: [
|
|
6849
|
+
range: [fd(a), r]
|
|
6626
6850
|
}), {
|
|
6627
6851
|
left: {
|
|
6628
6852
|
fromLeft: !1,
|
|
6629
|
-
range: [i,
|
|
6853
|
+
range: [i, fd(n)]
|
|
6630
6854
|
},
|
|
6631
6855
|
center: [n, a],
|
|
6632
6856
|
right: t
|
|
@@ -6636,23 +6860,23 @@ function qu(e, t) {
|
|
|
6636
6860
|
return {
|
|
6637
6861
|
left: {
|
|
6638
6862
|
fromLeft: !1,
|
|
6639
|
-
range: [i,
|
|
6863
|
+
range: [i, fd(n)]
|
|
6640
6864
|
},
|
|
6641
6865
|
center: [n, r],
|
|
6642
6866
|
right: {
|
|
6643
6867
|
fromLeft: !1,
|
|
6644
|
-
range: [
|
|
6868
|
+
range: [fd(r), a]
|
|
6645
6869
|
}
|
|
6646
6870
|
};
|
|
6647
6871
|
}
|
|
6648
|
-
function
|
|
6872
|
+
function dd(e, t) {
|
|
6649
6873
|
let [n, r] = e, [i, a] = t, o = n.exclusive, s = i.exclusive, c, l = n;
|
|
6650
6874
|
if (!o && s ? (l = i, c = {
|
|
6651
6875
|
fromLeft: !0,
|
|
6652
|
-
range: [n,
|
|
6876
|
+
range: [n, fd(i)]
|
|
6653
6877
|
}) : o && !s && (c = {
|
|
6654
6878
|
fromLeft: !1,
|
|
6655
|
-
range: [i,
|
|
6879
|
+
range: [i, fd(n)]
|
|
6656
6880
|
}), r.num <= a.num) {
|
|
6657
6881
|
let e = !0, t = !1;
|
|
6658
6882
|
if (r.num === a.num) {
|
|
@@ -6663,7 +6887,7 @@ function Ju(e, t) {
|
|
|
6663
6887
|
let t;
|
|
6664
6888
|
return e && (t = {
|
|
6665
6889
|
fromLeft: !1,
|
|
6666
|
-
range: [
|
|
6890
|
+
range: [fd(r), a]
|
|
6667
6891
|
}), {
|
|
6668
6892
|
left: c,
|
|
6669
6893
|
center: [l, r],
|
|
@@ -6676,11 +6900,11 @@ function Ju(e, t) {
|
|
|
6676
6900
|
center: [l, a],
|
|
6677
6901
|
right: {
|
|
6678
6902
|
fromLeft: !0,
|
|
6679
|
-
range: [
|
|
6903
|
+
range: [fd(a), r]
|
|
6680
6904
|
}
|
|
6681
6905
|
};
|
|
6682
6906
|
}
|
|
6683
|
-
function
|
|
6907
|
+
function fd(e) {
|
|
6684
6908
|
return {
|
|
6685
6909
|
num: e.num,
|
|
6686
6910
|
exclusive: !e.exclusive
|
|
@@ -6688,8 +6912,8 @@ function Yu(e) {
|
|
|
6688
6912
|
}
|
|
6689
6913
|
//#endregion
|
|
6690
6914
|
//#region src/json-schema-subset/checker/range.ts
|
|
6691
|
-
var
|
|
6692
|
-
let { left: a, center: o, right: s } =
|
|
6915
|
+
var pd = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
|
|
6916
|
+
let { left: a, center: o, right: s } = cd([{
|
|
6693
6917
|
num: t,
|
|
6694
6918
|
exclusive: !1
|
|
6695
6919
|
}, {
|
|
@@ -6719,24 +6943,24 @@ var Xu = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
|
|
|
6719
6943
|
intersection: u
|
|
6720
6944
|
};
|
|
6721
6945
|
};
|
|
6722
|
-
function
|
|
6946
|
+
function md({ left: e, right: t, intersection: n }) {
|
|
6723
6947
|
if (!n) return H.Rejection;
|
|
6724
6948
|
let r = !1, i = !1;
|
|
6725
6949
|
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;
|
|
6726
6950
|
}
|
|
6727
6951
|
//#endregion
|
|
6728
6952
|
//#region src/json-schema-subset/checker/array.ts
|
|
6729
|
-
var
|
|
6953
|
+
var hd = pd(0), gd = ad([
|
|
6730
6954
|
"hasCommon",
|
|
6731
6955
|
"hasExtra1",
|
|
6732
6956
|
"hasExtra2",
|
|
6733
6957
|
"hasRejection",
|
|
6734
6958
|
"hasCommonBroken"
|
|
6735
6959
|
]);
|
|
6736
|
-
function
|
|
6737
|
-
let r =
|
|
6960
|
+
function _d({ calculate: e }, t, n) {
|
|
6961
|
+
let r = hd(t.minItems, t.maxItems, n.minItems, n.maxItems), i = md(r);
|
|
6738
6962
|
if (i === H.Rejection) return K;
|
|
6739
|
-
let [a, o] =
|
|
6963
|
+
let [a, o] = vd(t), [s, c] = vd(n), l = Math.max(a.length, s.length) + 1, u = Math.min(l, r.intersection.max), d = gd.variable({}), f = Math.min(t.minItems ?? 0, n.minItems ?? 0);
|
|
6740
6964
|
for (let t = 0; t < u; t++) {
|
|
6741
6965
|
let n = e(a[t] ?? o, s[t] ?? c);
|
|
6742
6966
|
d.push(n, (e, n) => {
|
|
@@ -6776,69 +7000,69 @@ function ed({ calculate: e }, t, n) {
|
|
|
6776
7000
|
}
|
|
6777
7001
|
return p;
|
|
6778
7002
|
}
|
|
6779
|
-
function
|
|
6780
|
-
return Array.isArray(e) ? [e, t ??
|
|
7003
|
+
function vd({ items: e, additionalItems: t }) {
|
|
7004
|
+
return Array.isArray(e) ? [e, t ?? su] : [[], e ?? su];
|
|
6781
7005
|
}
|
|
6782
7006
|
//#endregion
|
|
6783
7007
|
//#region src/json-schema-subset/checker/cache.ts
|
|
6784
|
-
function
|
|
7008
|
+
function yd(e) {
|
|
6785
7009
|
let t = /* @__PURE__ */ new Map();
|
|
6786
7010
|
return (n, r) => {
|
|
6787
|
-
let i =
|
|
6788
|
-
return i ===
|
|
7011
|
+
let i = lu(n);
|
|
7012
|
+
return i === lu(r) ? i ? xd(t, n, r, e) : n === r : !1;
|
|
6789
7013
|
};
|
|
6790
7014
|
}
|
|
6791
|
-
function
|
|
7015
|
+
function bd(e) {
|
|
6792
7016
|
let t = /* @__PURE__ */ new Map();
|
|
6793
|
-
return (n, r) =>
|
|
7017
|
+
return (n, r) => xd(t, n, r, e);
|
|
6794
7018
|
}
|
|
6795
|
-
function
|
|
6796
|
-
let i = `${
|
|
7019
|
+
function xd(e, t, n, r) {
|
|
7020
|
+
let i = `${du(t)}/${du(n)}`, a = e.get(i);
|
|
6797
7021
|
return a === void 0 && e.set(i, a = r(t, n)), a;
|
|
6798
7022
|
}
|
|
6799
7023
|
//#endregion
|
|
6800
7024
|
//#region src/json-schema-subset/checker/enumAndConst.ts
|
|
6801
|
-
function
|
|
6802
|
-
let r =
|
|
6803
|
-
for (let t of r) if (
|
|
6804
|
-
for (let t of i) if (
|
|
7025
|
+
function Sd(e, t, n) {
|
|
7026
|
+
let r = wd(t), i = wd(n), a = !1, o = !1, s = !1;
|
|
7027
|
+
for (let t of r) if (Td(e, i, t) ? s = !0 : a = !0, a && s) break;
|
|
7028
|
+
for (let t of i) if (Td(e, r, t) ? s = !0 : o = !0, o && s) break;
|
|
6805
7029
|
return s ? a && o ? q : a ? W : o ? G : U : K;
|
|
6806
7030
|
}
|
|
6807
|
-
function
|
|
7031
|
+
function Cd(e, t) {
|
|
6808
7032
|
let n = !1, r = !1;
|
|
6809
|
-
for (let i of
|
|
6810
|
-
switch (
|
|
6811
|
-
case
|
|
7033
|
+
for (let i of wd(e)) {
|
|
7034
|
+
switch (Eu(t, i)) {
|
|
7035
|
+
case Tu.Valid:
|
|
6812
7036
|
n = !0;
|
|
6813
7037
|
break;
|
|
6814
|
-
case
|
|
7038
|
+
case Tu.Invalid:
|
|
6815
7039
|
r = !0;
|
|
6816
7040
|
break;
|
|
6817
|
-
case
|
|
7041
|
+
case Tu.Unknown: return wl;
|
|
6818
7042
|
}
|
|
6819
7043
|
if (n && r) break;
|
|
6820
7044
|
}
|
|
6821
7045
|
return n && r ? q : n ? U | G : r ? K : Z(t) === X.Never ? U : G;
|
|
6822
7046
|
}
|
|
6823
|
-
function
|
|
7047
|
+
function wd({ const: e, enum: t }) {
|
|
6824
7048
|
if (e !== void 0) return [e];
|
|
6825
7049
|
if (t) return t;
|
|
6826
7050
|
throw Error("invalid branch");
|
|
6827
7051
|
}
|
|
6828
|
-
function
|
|
7052
|
+
function Td({ isEquals: e }, t, n) {
|
|
6829
7053
|
for (let r of t) if (e(r, n)) return !0;
|
|
6830
7054
|
return !1;
|
|
6831
7055
|
}
|
|
6832
7056
|
//#endregion
|
|
6833
7057
|
//#region src/json-schema-subset/checker/equals.ts
|
|
6834
|
-
function
|
|
7058
|
+
function Ed(e) {
|
|
6835
7059
|
function t(t, n) {
|
|
6836
7060
|
let i = e.isExtendsSchema(t), a = e.isExtendsSchema(n);
|
|
6837
7061
|
return i || a ? e.equals(t, n) : r(t, n);
|
|
6838
7062
|
}
|
|
6839
7063
|
let n = /* @__PURE__ */ new Map();
|
|
6840
7064
|
function r(e, t) {
|
|
6841
|
-
let r =
|
|
7065
|
+
let r = du(e), a = du(t);
|
|
6842
7066
|
if (r === a) return !0;
|
|
6843
7067
|
let o = `${r}/${a}`, s = n.get(o);
|
|
6844
7068
|
return s === void 0 && (s = i(e, t), n.set(o, s)), s;
|
|
@@ -6855,25 +7079,25 @@ function ld(e) {
|
|
|
6855
7079
|
return !0;
|
|
6856
7080
|
}
|
|
6857
7081
|
function a(e, t) {
|
|
6858
|
-
return e === t ? !0 : typeof e != "object" || !e || typeof e != typeof t ? !1 :
|
|
7082
|
+
return e === t ? !0 : typeof e != "object" || !e || typeof e != typeof t ? !1 : uu(e) && uu(t) ? r(e, t) : i(e, t);
|
|
6859
7083
|
}
|
|
6860
7084
|
return t;
|
|
6861
7085
|
}
|
|
6862
7086
|
//#endregion
|
|
6863
7087
|
//#region src/json-schema-subset/checker/numeric/integerNormalizer.ts
|
|
6864
|
-
function
|
|
6865
|
-
let t =
|
|
7088
|
+
function Dd(e) {
|
|
7089
|
+
let t = Pd(e), n = e.multipleOf ?? 1, r = kd(t, n);
|
|
6866
7090
|
return r ? {
|
|
6867
7091
|
multipleOf: n,
|
|
6868
7092
|
range: r
|
|
6869
7093
|
} : null;
|
|
6870
7094
|
}
|
|
6871
|
-
function
|
|
7095
|
+
function Od([e, t]) {
|
|
6872
7096
|
return !(e.num !== t.num || e.exclusive || t.exclusive);
|
|
6873
7097
|
}
|
|
6874
|
-
function
|
|
7098
|
+
function kd(e, t) {
|
|
6875
7099
|
if (!e) return;
|
|
6876
|
-
let [n, r] = e, i =
|
|
7100
|
+
let [n, r] = e, i = Ad(n.num, t), a = jd(r.num, t);
|
|
6877
7101
|
if (i === n.num && n.exclusive && (i += t), a === r.num && r.exclusive && (a -= t), !(i > a) && (i !== a || i !== Infinity && i !== -Infinity)) return [{
|
|
6878
7102
|
num: i,
|
|
6879
7103
|
exclusive: !1
|
|
@@ -6882,29 +7106,29 @@ function fd(e, t) {
|
|
|
6882
7106
|
exclusive: !1
|
|
6883
7107
|
}];
|
|
6884
7108
|
}
|
|
6885
|
-
function
|
|
7109
|
+
function Ad(e, t) {
|
|
6886
7110
|
return Math.ceil(e / t) * t;
|
|
6887
7111
|
}
|
|
6888
|
-
function
|
|
7112
|
+
function jd(e, t) {
|
|
6889
7113
|
return Math.floor(e / t) * t;
|
|
6890
7114
|
}
|
|
6891
7115
|
//#endregion
|
|
6892
7116
|
//#region src/json-schema-subset/checker/numeric/float.ts
|
|
6893
|
-
function
|
|
6894
|
-
let { left: n, right: r, center: i } =
|
|
7117
|
+
function Md(e, t) {
|
|
7118
|
+
let { left: n, right: r, center: i } = cd(Pd(e), Pd(t));
|
|
6895
7119
|
if (!i) return K;
|
|
6896
7120
|
let a = !1, o = !1;
|
|
6897
7121
|
return n && (n.fromLeft ? a = !0 : o = !0), r && (r.fromLeft ? a = !0 : o = !0), a && o ? q : a ? W : o ? G : U;
|
|
6898
7122
|
}
|
|
6899
|
-
function
|
|
6900
|
-
let n =
|
|
7123
|
+
function Nd(e, t) {
|
|
7124
|
+
let n = Pd(e), r = Dd(t);
|
|
6901
7125
|
if (!r) return W;
|
|
6902
|
-
let i =
|
|
7126
|
+
let i = cd(n, r.range), a = kd(i.center, r.multipleOf), o = Fd(i.left, r.multipleOf), s = Fd(i.right, r.multipleOf);
|
|
6903
7127
|
if (!i.center) return K;
|
|
6904
7128
|
let c = !1, l = !1;
|
|
6905
|
-
return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !
|
|
7129
|
+
return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !Od(i.center)) && (c = !0), o && (l = !0), s && (l = !0), c && l ? q : c ? W : l ? G : U;
|
|
6906
7130
|
}
|
|
6907
|
-
function
|
|
7131
|
+
function Pd(e) {
|
|
6908
7132
|
let t, n;
|
|
6909
7133
|
return t = e.exclusiveMinimum === void 0 ? e.minimum === void 0 ? {
|
|
6910
7134
|
num: -Infinity,
|
|
@@ -6926,84 +7150,84 @@ function _d(e) {
|
|
|
6926
7150
|
exclusive: !0
|
|
6927
7151
|
}, [t, n];
|
|
6928
7152
|
}
|
|
6929
|
-
function
|
|
6930
|
-
if (e && !e.fromLeft) return
|
|
7153
|
+
function Fd(e, t) {
|
|
7154
|
+
if (e && !e.fromLeft) return kd(e.range, t);
|
|
6931
7155
|
}
|
|
6932
7156
|
//#endregion
|
|
6933
7157
|
//#region src/json-schema-subset/checker/numeric/integer.ts
|
|
6934
|
-
function
|
|
6935
|
-
let n =
|
|
7158
|
+
function Id(e, t) {
|
|
7159
|
+
let n = Dd(e), r = Dd(t);
|
|
6936
7160
|
if (!n && !r) return U;
|
|
6937
7161
|
if (!n) return G;
|
|
6938
7162
|
if (!r) return W;
|
|
6939
|
-
let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c =
|
|
6940
|
-
if (c.center && (u =
|
|
7163
|
+
let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c = cd(i, o), l, u = 0;
|
|
7164
|
+
if (c.center && (u = Rd(a, s), l = kd(c.center, u)), !l) return K;
|
|
6941
7165
|
let d = !1, f = !1, { left: p, right: m } = c;
|
|
6942
|
-
return p &&
|
|
7166
|
+
return p && kd(p.range, p.fromLeft ? a : s) && (p.fromLeft ? d = !0 : f = !0), m && kd(m.range, m.fromLeft ? a : s) && (m.fromLeft ? d = !0 : f = !0), d ||= Ld(n, l, u), f ||= Ld(r, l, u), d && f ? q : d ? W : f ? G : U;
|
|
6943
7167
|
}
|
|
6944
|
-
function
|
|
6945
|
-
let i =
|
|
6946
|
-
if (
|
|
6947
|
-
let a =
|
|
7168
|
+
function Ld({ range: e, multipleOf: t }, n, r) {
|
|
7169
|
+
let i = cd(e, n);
|
|
7170
|
+
if (kd(i.left?.range, t) || kd(i.right?.range, t)) return !0;
|
|
7171
|
+
let a = kd(i.center, t);
|
|
6948
7172
|
if (!a) return !1;
|
|
6949
|
-
let o =
|
|
6950
|
-
return
|
|
7173
|
+
let o = Bd(n);
|
|
7174
|
+
return Bd(a) > o || o !== 1 && t < r;
|
|
6951
7175
|
}
|
|
6952
|
-
function
|
|
6953
|
-
return e * t /
|
|
7176
|
+
function Rd(e, t) {
|
|
7177
|
+
return e * t / zd(e, t);
|
|
6954
7178
|
}
|
|
6955
|
-
function
|
|
6956
|
-
return e === 0 ? t :
|
|
7179
|
+
function zd(e, t) {
|
|
7180
|
+
return e === 0 ? t : zd(t % e, e);
|
|
6957
7181
|
}
|
|
6958
|
-
function
|
|
7182
|
+
function Bd(e) {
|
|
6959
7183
|
if (!e) return 0;
|
|
6960
7184
|
let [t, n] = e;
|
|
6961
7185
|
return n.num - t.num + 1;
|
|
6962
7186
|
}
|
|
6963
7187
|
//#endregion
|
|
6964
7188
|
//#region src/json-schema-subset/checker/numeric/checker.ts
|
|
6965
|
-
function
|
|
6966
|
-
if (
|
|
6967
|
-
let n =
|
|
6968
|
-
return n && r ?
|
|
7189
|
+
function Vd(e, t) {
|
|
7190
|
+
if (Hd(e) || Hd(t)) return wl;
|
|
7191
|
+
let n = Ud(e), r = Ud(t);
|
|
7192
|
+
return n && r ? Md(e, t) : n ? Nd(e, t) : r ? Pl(Nd(t, e)) : Id(e, t);
|
|
6969
7193
|
}
|
|
6970
|
-
function
|
|
7194
|
+
function Hd(e) {
|
|
6971
7195
|
let { multipleOf: t } = e;
|
|
6972
7196
|
return t === void 0 ? !1 : !Number.isInteger(t) || t < 0;
|
|
6973
7197
|
}
|
|
6974
|
-
function
|
|
7198
|
+
function Ud(e) {
|
|
6975
7199
|
let { multipleOf: t } = e;
|
|
6976
7200
|
return !(t !== void 0 && Number.isInteger(t) || e.type === "integer");
|
|
6977
7201
|
}
|
|
6978
7202
|
//#endregion
|
|
6979
7203
|
//#region src/json-schema-subset/checker/object.ts
|
|
6980
|
-
var
|
|
7204
|
+
var Wd = pd(0), Gd = ad([
|
|
6981
7205
|
"hasCommonInRequired",
|
|
6982
7206
|
"hasCommonOutRequired",
|
|
6983
7207
|
"hasExtra1",
|
|
6984
7208
|
"hasExtra2",
|
|
6985
7209
|
"hasRejection"
|
|
6986
7210
|
]);
|
|
6987
|
-
function
|
|
6988
|
-
if (
|
|
6989
|
-
let r =
|
|
7211
|
+
function Kd(e, t, n) {
|
|
7212
|
+
if (qd(t, n)) return K;
|
|
7213
|
+
let r = Jd(t, n);
|
|
6990
7214
|
if (!r) return K;
|
|
6991
|
-
let i =
|
|
7215
|
+
let i = ef(t), a = ef(n), o = (t) => {
|
|
6992
7216
|
let n = i(t), r = a(t);
|
|
6993
|
-
return
|
|
6994
|
-
}, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u =
|
|
6995
|
-
for (let e of [...s].toSorted()) u.push(o(e),
|
|
6996
|
-
for (let e of [...c].toSorted()) u.push(o(e),
|
|
6997
|
-
for (let e of [...l].toSorted()) u.push(o(e),
|
|
7217
|
+
return tf(n, r) ? e.calculate(n, r) : 0;
|
|
7218
|
+
}, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u = Gd.variable({});
|
|
7219
|
+
for (let e of [...s].toSorted()) u.push(o(e), Xd);
|
|
7220
|
+
for (let e of [...c].toSorted()) u.push(o(e), Zd);
|
|
7221
|
+
for (let e of [...l].toSorted()) u.push(o(e), Qd);
|
|
6998
7222
|
let { hasOptional1: d, hasOptional2: f } = r;
|
|
6999
7223
|
if (d || f) {
|
|
7000
|
-
let r =
|
|
7001
|
-
for (let e of [...
|
|
7224
|
+
let r = $d(d, f);
|
|
7225
|
+
for (let e of [...Yd(t, n)].toSorted()) {
|
|
7002
7226
|
let t = o(e);
|
|
7003
7227
|
t !== 0 && u.push(t, r);
|
|
7004
7228
|
}
|
|
7005
|
-
let i = t.additionalProperties ??
|
|
7006
|
-
if (
|
|
7229
|
+
let i = t.additionalProperties ?? su, a = n.additionalProperties ?? su;
|
|
7230
|
+
if (tf(i, a)) {
|
|
7007
7231
|
let t = e.calculate(i, a);
|
|
7008
7232
|
u.push(t, r);
|
|
7009
7233
|
}
|
|
@@ -7015,10 +7239,10 @@ function kd(e, t, n) {
|
|
|
7015
7239
|
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;
|
|
7016
7240
|
return m;
|
|
7017
7241
|
}
|
|
7018
|
-
function
|
|
7019
|
-
return
|
|
7242
|
+
function qd(e, t) {
|
|
7243
|
+
return md(Wd(e.minProperties, e.maxProperties, t.minProperties, t.maxProperties)) === H.Rejection;
|
|
7020
7244
|
}
|
|
7021
|
-
function
|
|
7245
|
+
function Jd(e, t) {
|
|
7022
7246
|
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;
|
|
7023
7247
|
for (let e of n) r.has(e) && i.add(e), a.add(e);
|
|
7024
7248
|
for (let e of r) n.has(e) && i.add(e), a.add(e);
|
|
@@ -7034,7 +7258,7 @@ function jd(e, t) {
|
|
|
7034
7258
|
hasOptional2: u > s
|
|
7035
7259
|
};
|
|
7036
7260
|
}
|
|
7037
|
-
function
|
|
7261
|
+
function Yd(e, t) {
|
|
7038
7262
|
let n = new Set(e.required), r = e.properties, i = t.properties, a = e.required, o = t.required;
|
|
7039
7263
|
if (r) for (let e in r) n.add(e);
|
|
7040
7264
|
if (i) for (let e in i) n.add(e);
|
|
@@ -7042,7 +7266,7 @@ function Md(e, t) {
|
|
|
7042
7266
|
if (o) for (let e of o) n.delete(e);
|
|
7043
7267
|
return n;
|
|
7044
7268
|
}
|
|
7045
|
-
var
|
|
7269
|
+
var Xd = (e, t) => {
|
|
7046
7270
|
switch (e) {
|
|
7047
7271
|
case H.Equals:
|
|
7048
7272
|
t.hasCommonInRequired = !0;
|
|
@@ -7058,7 +7282,7 @@ var Nd = (e, t) => {
|
|
|
7058
7282
|
break;
|
|
7059
7283
|
case H.Rejection: t.hasRejection = !0;
|
|
7060
7284
|
}
|
|
7061
|
-
},
|
|
7285
|
+
}, Zd = (e, t) => {
|
|
7062
7286
|
switch (e) {
|
|
7063
7287
|
case H.Equals:
|
|
7064
7288
|
case H.ContainedBy:
|
|
@@ -7070,7 +7294,7 @@ var Nd = (e, t) => {
|
|
|
7070
7294
|
break;
|
|
7071
7295
|
case H.Rejection: t.hasRejection = !0;
|
|
7072
7296
|
}
|
|
7073
|
-
},
|
|
7297
|
+
}, Qd = (e, t) => {
|
|
7074
7298
|
switch (e) {
|
|
7075
7299
|
case H.Equals:
|
|
7076
7300
|
case H.Containing:
|
|
@@ -7082,7 +7306,7 @@ var Nd = (e, t) => {
|
|
|
7082
7306
|
break;
|
|
7083
7307
|
case H.Rejection: t.hasRejection = !0;
|
|
7084
7308
|
}
|
|
7085
|
-
},
|
|
7309
|
+
}, $d = (e, t) => (n, r) => {
|
|
7086
7310
|
if (r.hasRejection) return;
|
|
7087
7311
|
let i = !1, a = !1, o = !1;
|
|
7088
7312
|
switch (n) {
|
|
@@ -7102,7 +7326,7 @@ var Nd = (e, t) => {
|
|
|
7102
7326
|
}
|
|
7103
7327
|
e && i && (r.hasExtra1 = !0), t && a && (r.hasExtra2 = !0), e && t && o && (r.hasCommonOutRequired = !0);
|
|
7104
7328
|
};
|
|
7105
|
-
function
|
|
7329
|
+
function ef(e) {
|
|
7106
7330
|
let t = e.properties, n = e.propertyNames, r = e.additionalProperties, i = [];
|
|
7107
7331
|
if (e.patternProperties) for (let t in e.patternProperties) {
|
|
7108
7332
|
let n = e.patternProperties[t], r = new RegExp(t, "i");
|
|
@@ -7112,41 +7336,41 @@ function Ld(e) {
|
|
|
7112
7336
|
});
|
|
7113
7337
|
}
|
|
7114
7338
|
return (e) => {
|
|
7115
|
-
if (n &&
|
|
7339
|
+
if (n && Eu(n, e) === Tu.Invalid) return cu;
|
|
7116
7340
|
for (let { pattern: t, schema: n } of i) if (t.test(e)) return n;
|
|
7117
|
-
return ((t && t[e]) ?? r) ||
|
|
7341
|
+
return ((t && t[e]) ?? r) || su;
|
|
7118
7342
|
};
|
|
7119
7343
|
}
|
|
7120
|
-
function
|
|
7344
|
+
function tf(e, t) {
|
|
7121
7345
|
let n = Z(e), r = Z(t);
|
|
7122
7346
|
return n !== X.Never || r !== X.Never;
|
|
7123
7347
|
}
|
|
7124
7348
|
//#endregion
|
|
7125
7349
|
//#region src/json-schema-subset/checker/string.ts
|
|
7126
|
-
var
|
|
7127
|
-
function
|
|
7350
|
+
var nf = pd(0);
|
|
7351
|
+
function rf(e, t) {
|
|
7128
7352
|
if (t.format && !e.format) return W;
|
|
7129
|
-
if (e.format && t.format && e.format !== t.format) return
|
|
7130
|
-
let n =
|
|
7353
|
+
if (e.format && t.format && e.format !== t.format) return wl;
|
|
7354
|
+
let n = md(nf(e.minLength, e.maxLength, t.minLength, t.maxLength)), r = !!e.pattern, i = !!t.pattern;
|
|
7131
7355
|
switch (n) {
|
|
7132
7356
|
case H.Rejection: return K;
|
|
7133
|
-
case H.Containing: return r ?
|
|
7134
|
-
case H.ContainedBy: return i ?
|
|
7135
|
-
case H.Equals: return r && i ? e.pattern === t.pattern ? U :
|
|
7136
|
-
case H.Intersection: return r && i ?
|
|
7357
|
+
case H.Containing: return r ? wl : W;
|
|
7358
|
+
case H.ContainedBy: return i ? wl : G;
|
|
7359
|
+
case H.Equals: return r && i ? e.pattern === t.pattern ? U : wl : r ? U | G : i ? U | W : U;
|
|
7360
|
+
case H.Intersection: return r && i ? wl : r ? q | K | G : i ? q | K | W : q;
|
|
7137
7361
|
}
|
|
7138
7362
|
}
|
|
7139
7363
|
//#endregion
|
|
7140
7364
|
//#region src/json-schema-subset/checker/checker.ts
|
|
7141
|
-
function
|
|
7142
|
-
let r = {}, i = [], a =
|
|
7143
|
-
r.isEquals =
|
|
7365
|
+
function af(e, t, n) {
|
|
7366
|
+
let r = {}, i = [], a = bd(sf(e, r)), o = of(), s = Ed(e);
|
|
7367
|
+
r.isEquals = yd(Sl), r.calculate = Ul({
|
|
7144
7368
|
describe: o,
|
|
7145
7369
|
equals: s,
|
|
7146
7370
|
calculate: a,
|
|
7147
7371
|
observeCalculation: (e, t, n, r) => {
|
|
7148
|
-
if (!
|
|
7149
|
-
let a = r ?
|
|
7372
|
+
if (!lf(r ? Pl(n) : n)) return;
|
|
7373
|
+
let a = r ? uf(t, e) : uf(e, t);
|
|
7150
7374
|
a && i.push(a);
|
|
7151
7375
|
}
|
|
7152
7376
|
}), Object.freeze(r);
|
|
@@ -7156,34 +7380,34 @@ function Vd(e, t, n) {
|
|
|
7156
7380
|
expression: c
|
|
7157
7381
|
};
|
|
7158
7382
|
}
|
|
7159
|
-
var
|
|
7383
|
+
var of = () => (e) => {
|
|
7160
7384
|
let t;
|
|
7161
7385
|
switch (Z(e)) {
|
|
7162
7386
|
case X.Not:
|
|
7163
7387
|
t = {
|
|
7164
|
-
kind:
|
|
7388
|
+
kind: Hl.Not,
|
|
7165
7389
|
expression: e.not
|
|
7166
7390
|
};
|
|
7167
7391
|
break;
|
|
7168
7392
|
case X.Combination:
|
|
7169
7393
|
if ("allOf" in e) t = {
|
|
7170
|
-
kind:
|
|
7171
|
-
expressions:
|
|
7394
|
+
kind: Hl.AllOf,
|
|
7395
|
+
expressions: cf(e.allOf, X.Any)
|
|
7172
7396
|
};
|
|
7173
7397
|
else if ("anyOf" in e) t = {
|
|
7174
|
-
kind:
|
|
7175
|
-
expressions:
|
|
7398
|
+
kind: Hl.AnyOf,
|
|
7399
|
+
expressions: cf(e.anyOf, X.Never)
|
|
7176
7400
|
};
|
|
7177
7401
|
else if ("oneOf" in e) t = {
|
|
7178
|
-
kind:
|
|
7179
|
-
expressions:
|
|
7402
|
+
kind: Hl.OneOf,
|
|
7403
|
+
expressions: cf(e.oneOf, X.Never)
|
|
7180
7404
|
};
|
|
7181
7405
|
else throw Error(`invalid combination JSON Schema: ${JSON.stringify(e)}`);
|
|
7182
7406
|
break;
|
|
7183
|
-
default: t = { kind:
|
|
7407
|
+
default: t = { kind: Hl.Leaf };
|
|
7184
7408
|
}
|
|
7185
7409
|
return t;
|
|
7186
|
-
},
|
|
7410
|
+
}, sf = (e, t) => (n, r) => {
|
|
7187
7411
|
let i = Z(n), a = Z(r);
|
|
7188
7412
|
if (i === X.Extends || a === X.Extends) return e.calculate(n, r);
|
|
7189
7413
|
switch (i) {
|
|
@@ -7194,28 +7418,28 @@ var Hd = () => (e) => {
|
|
|
7194
7418
|
case X.Any: return G;
|
|
7195
7419
|
case X.Never: return W;
|
|
7196
7420
|
}
|
|
7197
|
-
if (i === X.EnumOrConst && a === X.EnumOrConst) return
|
|
7198
|
-
if (i === X.EnumOrConst) return
|
|
7199
|
-
if (a === X.EnumOrConst) return
|
|
7421
|
+
if (i === X.EnumOrConst && a === X.EnumOrConst) return Sd(t, n, r);
|
|
7422
|
+
if (i === X.EnumOrConst) return Cd(n, r);
|
|
7423
|
+
if (a === X.EnumOrConst) return Pl(Cd(r, n));
|
|
7200
7424
|
if (i !== a) return K;
|
|
7201
7425
|
switch (i) {
|
|
7202
7426
|
case X.Null: return U;
|
|
7203
|
-
case X.Numeric: return
|
|
7204
|
-
case X.String: return
|
|
7427
|
+
case X.Numeric: return Vd(n, r);
|
|
7428
|
+
case X.String: return rf(n, r);
|
|
7205
7429
|
case X.Boolean: return U;
|
|
7206
|
-
case X.Object: return
|
|
7207
|
-
case X.Array: return
|
|
7430
|
+
case X.Object: return Kd(t, n, r);
|
|
7431
|
+
case X.Array: return _d(t, n, r);
|
|
7208
7432
|
default: throw Error(`invalid kind ${i}`);
|
|
7209
7433
|
}
|
|
7210
7434
|
};
|
|
7211
|
-
function
|
|
7435
|
+
function cf(e, t) {
|
|
7212
7436
|
return e.filter((e) => Z(e) !== t);
|
|
7213
7437
|
}
|
|
7214
|
-
function
|
|
7215
|
-
return !
|
|
7438
|
+
function lf(e) {
|
|
7439
|
+
return !Tl(e) && !Dl(e) && (El(e) || kl(e) || Ol(e));
|
|
7216
7440
|
}
|
|
7217
|
-
function
|
|
7218
|
-
let n =
|
|
7441
|
+
function uf(e, t) {
|
|
7442
|
+
let n = fu(t);
|
|
7219
7443
|
if (!n) return;
|
|
7220
7444
|
let r = Z(e), i = Z(t);
|
|
7221
7445
|
if (r !== i) return [...n, "type"];
|
|
@@ -7250,12 +7474,12 @@ function Kd(e, t) {
|
|
|
7250
7474
|
}
|
|
7251
7475
|
//#endregion
|
|
7252
7476
|
//#region src/json-schema-subset/extends/extendsContext.ts
|
|
7253
|
-
var
|
|
7477
|
+
var df = class e {
|
|
7254
7478
|
constructor(e = []) {
|
|
7255
7479
|
this.extendsSchemaClasses = Object.freeze([...e]);
|
|
7256
7480
|
}
|
|
7257
7481
|
tryCompiledExtendsSchema(e, t) {
|
|
7258
|
-
for (let n of this.extendsSchemaClasses) if (n.isMatch(e)) return new n(
|
|
7482
|
+
for (let n of this.extendsSchemaClasses) if (n.isMatch(e)) return new n(vl(), e, t);
|
|
7259
7483
|
return null;
|
|
7260
7484
|
}
|
|
7261
7485
|
isExtendsSchema(e) {
|
|
@@ -7265,7 +7489,7 @@ var qd = class e {
|
|
|
7265
7489
|
calculate(t, n) {
|
|
7266
7490
|
let r = !(t instanceof this.findMatchedClass(t, n)), i = 0, a;
|
|
7267
7491
|
a = r ? n.compare(t) : t.compare(n);
|
|
7268
|
-
for (let t of a) r && (t = e.swap(t)), i |=
|
|
7492
|
+
for (let t of a) r && (t = e.swap(t)), i |= Al(t);
|
|
7269
7493
|
return i;
|
|
7270
7494
|
}
|
|
7271
7495
|
equals(e, t) {
|
|
@@ -7285,35 +7509,35 @@ var qd = class e {
|
|
|
7285
7509
|
};
|
|
7286
7510
|
//#endregion
|
|
7287
7511
|
//#region src/json-schema-subset/preprocessing.ts
|
|
7288
|
-
function
|
|
7512
|
+
function ff(e, t, n = !1) {
|
|
7289
7513
|
let r = t(e);
|
|
7290
7514
|
if (Array.isArray(r)) {
|
|
7291
7515
|
let e = [];
|
|
7292
|
-
throw
|
|
7516
|
+
throw mf(e, r, "$"), new Wl(e);
|
|
7293
7517
|
}
|
|
7294
7518
|
let { schema: i, warns: a } = r;
|
|
7295
7519
|
if (n && a.length > 0) {
|
|
7296
7520
|
console.warn(`found ${a.length} warns after compile schema`);
|
|
7297
|
-
for (let e of a) console.warn(
|
|
7521
|
+
for (let e of a) console.warn(Kl(e));
|
|
7298
7522
|
}
|
|
7299
7523
|
return i;
|
|
7300
7524
|
}
|
|
7301
|
-
function
|
|
7525
|
+
function pf(e, t, n, r = !1) {
|
|
7302
7526
|
let i = n(e), a = n(t);
|
|
7303
7527
|
if (Array.isArray(i) || Array.isArray(a)) {
|
|
7304
7528
|
let e = [];
|
|
7305
|
-
throw Array.isArray(i) &&
|
|
7529
|
+
throw Array.isArray(i) && mf(e, i, "$1"), Array.isArray(a) && mf(e, a, "$2"), new Wl(e);
|
|
7306
7530
|
}
|
|
7307
7531
|
let { schema: o, warns: s } = i, { schema: c, warns: l } = a;
|
|
7308
7532
|
if (r) {
|
|
7309
7533
|
s.length > 0 && console.warn(`found ${s.length} warns after compile superSchema`);
|
|
7310
|
-
for (let e of s) console.warn(
|
|
7534
|
+
for (let e of s) console.warn(Kl(e));
|
|
7311
7535
|
l.length > 0 && console.warn(`found ${l.length} warns after compile subSchema`);
|
|
7312
|
-
for (let e of l) console.warn(
|
|
7536
|
+
for (let e of l) console.warn(Kl(e));
|
|
7313
7537
|
}
|
|
7314
7538
|
return [o, c];
|
|
7315
7539
|
}
|
|
7316
|
-
function
|
|
7540
|
+
function mf(e, t, n) {
|
|
7317
7541
|
for (let r of t) {
|
|
7318
7542
|
let t = {
|
|
7319
7543
|
...r,
|
|
@@ -7324,60 +7548,60 @@ function Xd(e, t, n) {
|
|
|
7324
7548
|
}
|
|
7325
7549
|
//#endregion
|
|
7326
7550
|
//#region src/json-schema-subset/global.ts
|
|
7327
|
-
var
|
|
7551
|
+
var hf = Object.freeze({
|
|
7328
7552
|
True: 0,
|
|
7329
7553
|
False: 1,
|
|
7330
7554
|
Unknown: 2
|
|
7331
7555
|
});
|
|
7332
|
-
function
|
|
7333
|
-
let n = new
|
|
7556
|
+
function gf({ extendsSchemaClasses: e, delegate: t } = {}) {
|
|
7557
|
+
let n = new df(e);
|
|
7334
7558
|
return Object.freeze({
|
|
7335
|
-
compile: (e, r, i) =>
|
|
7559
|
+
compile: (e, r, i) => ff(e, (e) => $u(e, n, r, t), i),
|
|
7336
7560
|
isSubset: (e, r, i = !1) => {
|
|
7337
|
-
let [a, o] =
|
|
7338
|
-
return l && !u ? { result:
|
|
7561
|
+
let [a, o] = pf(e, r, (e) => $u(e, n, void 0, t), i), { errorPath: s, expression: c } = af(n, a, o), l = Tl(c) || Dl(c), u = El(c) || kl(c) || Ol(c);
|
|
7562
|
+
return l && !u ? { result: hf.True } : !l && u ? {
|
|
7339
7563
|
errorPath: s,
|
|
7340
|
-
result:
|
|
7341
|
-
} : { result:
|
|
7564
|
+
result: hf.False
|
|
7565
|
+
} : { result: hf.Unknown };
|
|
7342
7566
|
}
|
|
7343
7567
|
});
|
|
7344
7568
|
}
|
|
7345
7569
|
//#endregion
|
|
7346
7570
|
//#region ../../node_modules/.bun/@wopjs+cast@0.1.16/node_modules/@wopjs/cast/dist/index.mjs
|
|
7347
|
-
var
|
|
7571
|
+
var _f = (e) => typeof e == "string", vf = Array.isArray, yf = (e) => typeof e == "object" && !!e, bf = (e) => yf(e) && !vf(e), xf = (e) => bf(e) ? e : void 0;
|
|
7348
7572
|
//#endregion
|
|
7349
7573
|
//#region src/manifest/common/schemaComparer.ts
|
|
7350
|
-
function
|
|
7351
|
-
return
|
|
7574
|
+
function Sf(e) {
|
|
7575
|
+
return xf(e)?.type === "string";
|
|
7352
7576
|
}
|
|
7353
|
-
function
|
|
7354
|
-
let t =
|
|
7355
|
-
if (t == null || n == null || t.packageId != null &&
|
|
7577
|
+
function Cf(e) {
|
|
7578
|
+
let t = xf(e), n = xf(t?.error);
|
|
7579
|
+
if (t == null || n == null || t.packageId != null && !_f(t.packageId) || n.message != null && !_f(n.message)) throw TypeError("Invalid schema comparison context.");
|
|
7356
7580
|
}
|
|
7357
|
-
function
|
|
7358
|
-
return e == null ? { error: {} } : (
|
|
7581
|
+
function wf(e) {
|
|
7582
|
+
return e == null ? { error: {} } : (Cf(e), e);
|
|
7359
7583
|
}
|
|
7360
|
-
var
|
|
7584
|
+
var Tf = class e {
|
|
7361
7585
|
static setError(t, n, r) {
|
|
7362
7586
|
t instanceof e ? t.context.error.message = r : n instanceof e && (n.context.error.message = r);
|
|
7363
7587
|
}
|
|
7364
7588
|
constructor(e, t, n) {
|
|
7365
|
-
this.id = e, this.value = t, this.context =
|
|
7589
|
+
this.id = e, this.value = t, this.context = wf(n);
|
|
7366
7590
|
}
|
|
7367
7591
|
compare(e) {
|
|
7368
|
-
return
|
|
7592
|
+
return uu(e) && Z(e) === X.Any ? [H.ContainedBy] : this.compareImpl(e);
|
|
7369
7593
|
}
|
|
7370
|
-
},
|
|
7594
|
+
}, Ef = class e extends Tf {
|
|
7371
7595
|
static isMatch(e) {
|
|
7372
|
-
let t =
|
|
7373
|
-
return Array.isArray(t) && t.every((e) =>
|
|
7596
|
+
let t = xf(e)?.enum;
|
|
7597
|
+
return Array.isArray(t) && t.every((e) => _f(e));
|
|
7374
7598
|
}
|
|
7375
7599
|
constructor(t, n, r) {
|
|
7376
7600
|
if (!e.isMatch(n)) throw TypeError("Invalid single-select schema.");
|
|
7377
7601
|
super(t, n, r);
|
|
7378
7602
|
}
|
|
7379
7603
|
compareImpl(t) {
|
|
7380
|
-
if (
|
|
7604
|
+
if (Sf(t)) return [H.ContainedBy];
|
|
7381
7605
|
if (t instanceof e) {
|
|
7382
7606
|
let e = new Set(this.value.enum), n = H.Equals;
|
|
7383
7607
|
for (let r of t.value.enum) e.has(r) || (n = H.ContainedBy), e.delete(r);
|
|
@@ -7396,58 +7620,58 @@ var cf = class e {
|
|
|
7396
7620
|
}
|
|
7397
7621
|
return !1;
|
|
7398
7622
|
}
|
|
7399
|
-
},
|
|
7623
|
+
}, Df = class e extends Tf {
|
|
7400
7624
|
static isMatch(e) {
|
|
7401
|
-
return
|
|
7625
|
+
return xf(e)?.contentMediaType === "oomol/bin";
|
|
7402
7626
|
}
|
|
7403
7627
|
constructor(t, n, r) {
|
|
7404
7628
|
if (!e.isMatch(n)) throw TypeError("Invalid binary schema.");
|
|
7405
7629
|
super(t, n, r);
|
|
7406
7630
|
}
|
|
7407
7631
|
compareImpl(t) {
|
|
7408
|
-
return t instanceof e ? [H.Equals] : (
|
|
7632
|
+
return t instanceof e ? [H.Equals] : (Tf.setError(this, t, "edgeError.binDiffType"), [H.Rejection]);
|
|
7409
7633
|
}
|
|
7410
7634
|
equals(t) {
|
|
7411
7635
|
return t instanceof e;
|
|
7412
7636
|
}
|
|
7413
|
-
},
|
|
7637
|
+
}, Of = class e extends Tf {
|
|
7414
7638
|
static isMatch(e) {
|
|
7415
|
-
return
|
|
7639
|
+
return xf(e)?.contentMediaType === "oomol/artifact";
|
|
7416
7640
|
}
|
|
7417
7641
|
constructor(t, n, r) {
|
|
7418
7642
|
if (!e.isMatch(n)) throw TypeError("Invalid Artifact schema.");
|
|
7419
7643
|
super(t, n, r);
|
|
7420
7644
|
}
|
|
7421
7645
|
compareImpl(t) {
|
|
7422
|
-
return t instanceof e ? [H.Equals] : (
|
|
7646
|
+
return t instanceof e ? [H.Equals] : (Tf.setError(this, t, "edgeError.artifactDiffType"), [H.Rejection]);
|
|
7423
7647
|
}
|
|
7424
7648
|
equals(t) {
|
|
7425
7649
|
return t instanceof e;
|
|
7426
7650
|
}
|
|
7427
7651
|
};
|
|
7428
|
-
function
|
|
7429
|
-
return
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7652
|
+
function kf() {
|
|
7653
|
+
return gf({ extendsSchemaClasses: [
|
|
7654
|
+
Ef,
|
|
7655
|
+
Df,
|
|
7656
|
+
Of
|
|
7433
7657
|
] });
|
|
7434
7658
|
}
|
|
7435
|
-
|
|
7659
|
+
kf();
|
|
7436
7660
|
//#endregion
|
|
7437
7661
|
//#region src/flow/common/schema.ts
|
|
7438
|
-
function
|
|
7662
|
+
function Af(e) {
|
|
7439
7663
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
7440
7664
|
}
|
|
7441
|
-
var
|
|
7442
|
-
function
|
|
7665
|
+
var jf = /* @__PURE__ */ new WeakMap();
|
|
7666
|
+
function Mf(e, t) {
|
|
7443
7667
|
if (typeof t == "boolean") return t;
|
|
7444
|
-
let n =
|
|
7445
|
-
if (n == null || n.properties != null &&
|
|
7668
|
+
let n = Af(t);
|
|
7669
|
+
if (n == null || n.properties != null && Af(n.properties) == null) return !1;
|
|
7446
7670
|
try {
|
|
7447
|
-
let t =
|
|
7671
|
+
let t = jf.get(n);
|
|
7448
7672
|
if (t == null) {
|
|
7449
7673
|
let e = typeof n.$schema == "string" ? n.$schema : "", r = e.includes("draft-04") ? "4" : e.includes("draft-07") ? "7" : e.includes("2020-12") ? "2020-12" : "2019-09";
|
|
7450
|
-
t = new vc(structuredClone(n), r),
|
|
7674
|
+
t = new vc(structuredClone(n), r), jf.set(n, t);
|
|
7451
7675
|
}
|
|
7452
7676
|
return t.validate(e).valid;
|
|
7453
7677
|
} catch {
|
|
@@ -7543,14 +7767,14 @@ var $ = js(() => F([Jo(), rs({
|
|
|
7543
7767
|
exclusiveMinimum: M().optional(),
|
|
7544
7768
|
exclusiveMaximum: M().optional()
|
|
7545
7769
|
}).transform(({ title: e, default: t, examples: n, readOnly: r, writeOnly: i, deprecated: a, $comment: o, ...s }) => s)]));
|
|
7546
|
-
function
|
|
7770
|
+
function Nf(e, t) {
|
|
7547
7771
|
if (e.kind == "value") return e.value;
|
|
7548
7772
|
if (!Object.hasOwn(t, e.input)) throw Error(`Agent input ${e.input} is missing.`);
|
|
7549
7773
|
return t[e.input];
|
|
7550
7774
|
}
|
|
7551
7775
|
//#endregion
|
|
7552
7776
|
//#region src/base/common/json.ts
|
|
7553
|
-
function
|
|
7777
|
+
function Pf(e) {
|
|
7554
7778
|
if (e === null || typeof e == "boolean" || typeof e == "string") return !0;
|
|
7555
7779
|
if (typeof e == "number") return Number.isFinite(e);
|
|
7556
7780
|
if (typeof e != "object") return !1;
|
|
@@ -7601,16 +7825,16 @@ function _f(e) {
|
|
|
7601
7825
|
}
|
|
7602
7826
|
}
|
|
7603
7827
|
}
|
|
7604
|
-
function
|
|
7828
|
+
function Ff(e) {
|
|
7605
7829
|
try {
|
|
7606
|
-
return typeof e == "object" && !!e && !Array.isArray(e) &&
|
|
7830
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && Pf(e);
|
|
7607
7831
|
} catch {
|
|
7608
7832
|
return !1;
|
|
7609
7833
|
}
|
|
7610
7834
|
}
|
|
7611
7835
|
//#endregion
|
|
7612
7836
|
//#region src/trigger/common/contract.ts
|
|
7613
|
-
var
|
|
7837
|
+
var If = [
|
|
7614
7838
|
{
|
|
7615
7839
|
handle: "headers",
|
|
7616
7840
|
jsonSchema: {
|
|
@@ -7643,8 +7867,7 @@ var yf = [
|
|
|
7643
7867
|
jsonSchema: { type: "string" },
|
|
7644
7868
|
nullable: !1
|
|
7645
7869
|
}
|
|
7646
|
-
],
|
|
7647
|
-
description: "The scheduled time that triggered this run, in ISO 8601 format.",
|
|
7870
|
+
], Lf = [{
|
|
7648
7871
|
handle: "scheduledAt",
|
|
7649
7872
|
jsonSchema: {
|
|
7650
7873
|
type: "string",
|
|
@@ -7652,13 +7875,13 @@ var yf = [
|
|
|
7652
7875
|
},
|
|
7653
7876
|
nullable: !1
|
|
7654
7877
|
}];
|
|
7655
|
-
function
|
|
7878
|
+
function Rf(e) {
|
|
7656
7879
|
switch (e.kind) {
|
|
7657
7880
|
case "manual": return [];
|
|
7658
|
-
case "cron": return
|
|
7881
|
+
case "cron": return Lf;
|
|
7659
7882
|
case "poll":
|
|
7660
7883
|
case "integration": return e.definition.outputs;
|
|
7661
|
-
case "webhook": return
|
|
7884
|
+
case "webhook": return If.map((t) => t.handle === "body" ? Object.assign({}, t, { jsonSchema: {
|
|
7662
7885
|
type: "object",
|
|
7663
7886
|
additionalProperties: !1,
|
|
7664
7887
|
properties: Object.fromEntries(e.bodyFields.map((e) => [e.handle, e.jsonSchema])),
|
|
@@ -7666,82 +7889,80 @@ function xf(e) {
|
|
|
7666
7889
|
} }) : t);
|
|
7667
7890
|
}
|
|
7668
7891
|
}
|
|
7669
|
-
function
|
|
7670
|
-
if (!
|
|
7671
|
-
let n =
|
|
7672
|
-
return new Set(n.map((e) => e.handle)).size === n.length && Object.keys(t).length === n.length && n.every((e) => Object.hasOwn(t, e.handle) && (t[e.handle] === null && e.nullable ||
|
|
7892
|
+
function zf(e, t) {
|
|
7893
|
+
if (!Ff(t)) return !1;
|
|
7894
|
+
let n = Rf(e);
|
|
7895
|
+
return new Set(n.map((e) => e.handle)).size === n.length && Object.keys(t).length === n.length && n.every((e) => Object.hasOwn(t, e.handle) && (t[e.handle] === null && e.nullable || Mf(t[e.handle], e.jsonSchema)));
|
|
7673
7896
|
}
|
|
7674
7897
|
//#endregion
|
|
7675
7898
|
//#region src/flow/common/graph.ts
|
|
7676
|
-
function
|
|
7899
|
+
function Bf(e) {
|
|
7677
7900
|
return e?.kind == "approval" || e?.kind == "wait";
|
|
7678
7901
|
}
|
|
7679
|
-
function
|
|
7902
|
+
function Vf(e) {
|
|
7680
7903
|
return e.kind == "wait" ? ["continue"] : ["approve", "reject"];
|
|
7681
7904
|
}
|
|
7682
|
-
|
|
7683
|
-
|
|
7905
|
+
var Hf = (e) => ({
|
|
7906
|
+
nullable: !1,
|
|
7907
|
+
jsonSchema: {
|
|
7908
|
+
type: "object",
|
|
7909
|
+
properties: e,
|
|
7910
|
+
required: Object.keys(e),
|
|
7911
|
+
additionalProperties: !1
|
|
7912
|
+
}
|
|
7913
|
+
});
|
|
7914
|
+
function Uf(e) {
|
|
7915
|
+
let t = Vf(e), n = {
|
|
7916
|
+
type: "object",
|
|
7917
|
+
properties: Object.fromEntries(e.inputDefinitions.map((e) => [e.handle, {}])),
|
|
7918
|
+
required: e.inputDefinitions.map((e) => e.handle),
|
|
7919
|
+
additionalProperties: !1
|
|
7920
|
+
};
|
|
7684
7921
|
return {
|
|
7685
|
-
pending: {
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
action: { enum: t },
|
|
7698
|
-
url: { type: "string" }
|
|
7699
|
-
},
|
|
7700
|
-
required: ["action", "url"],
|
|
7701
|
-
additionalProperties: !1
|
|
7702
|
-
}
|
|
7703
|
-
},
|
|
7704
|
-
expiresAt: { type: "string" }
|
|
7705
|
-
},
|
|
7706
|
-
required: [
|
|
7707
|
-
"value",
|
|
7708
|
-
"prompt",
|
|
7709
|
-
"actions",
|
|
7710
|
-
"expiresAt"
|
|
7711
|
-
],
|
|
7712
|
-
additionalProperties: !1
|
|
7713
|
-
}
|
|
7714
|
-
},
|
|
7715
|
-
...Object.fromEntries(t.map((t) => [t, {
|
|
7716
|
-
jsonSchema: e.input.jsonSchema,
|
|
7717
|
-
nullable: e.input.nullable,
|
|
7718
|
-
...e.input.description == null ? {} : { description: e.input.description }
|
|
7719
|
-
}]))
|
|
7922
|
+
pending: Hf({
|
|
7923
|
+
inputs: n,
|
|
7924
|
+
prompt: { type: "string" },
|
|
7925
|
+
...Object.fromEntries(t.map((e) => [`${e}Url`, { type: "string" }])),
|
|
7926
|
+
expiresAt: { type: "string" }
|
|
7927
|
+
}),
|
|
7928
|
+
...Object.fromEntries(t.map((e) => [e, Hf({
|
|
7929
|
+
inputs: n,
|
|
7930
|
+
action: { const: e },
|
|
7931
|
+
resolvedAt: { type: "string" },
|
|
7932
|
+
comment: { type: ["string", "null"] }
|
|
7933
|
+
})]))
|
|
7720
7934
|
};
|
|
7721
7935
|
}
|
|
7722
7936
|
//#endregion
|
|
7937
|
+
//#region src/execution/common/wait.ts
|
|
7938
|
+
var Wf = A().trim().refine((e) => [...e].length <= 2e3, "Wait comment must contain at most 2,000 Unicode code points.").nullable().optional();
|
|
7939
|
+
function Gf(e) {
|
|
7940
|
+
return Wf.parse(e) || null;
|
|
7941
|
+
}
|
|
7942
|
+
//#endregion
|
|
7723
7943
|
//#region src/execution/common/scheduler.ts
|
|
7724
|
-
|
|
7944
|
+
var Kf = Gf;
|
|
7945
|
+
function qf(e, t) {
|
|
7725
7946
|
return e.edges.some((e) => e.source == t && e.sourceHandle == "pending") || Object.values(e.nodes).some((e) => "inputs" in e && Object.values(e.inputs).some((e) => e.kind == "sources" && e.sources.some((e) => e.kind == "node" && e.nodeId == t && e.output == "pending")));
|
|
7726
7947
|
}
|
|
7727
|
-
var
|
|
7728
|
-
function
|
|
7948
|
+
var Jf = 12e4;
|
|
7949
|
+
function Yf(e, t) {
|
|
7729
7950
|
return t?.(e) ?? {
|
|
7730
7951
|
code: "node.failed",
|
|
7731
7952
|
message: e instanceof Error ? e.message : String(e)
|
|
7732
7953
|
};
|
|
7733
7954
|
}
|
|
7734
|
-
function
|
|
7955
|
+
function Xf(e, t) {
|
|
7735
7956
|
switch (t.kind) {
|
|
7736
|
-
case "condition": return
|
|
7957
|
+
case "condition": return ll(t);
|
|
7737
7958
|
case "value": return {};
|
|
7738
|
-
case "subflow": return
|
|
7739
|
-
case "task": return
|
|
7959
|
+
case "subflow": return gl(e.subflows[t.subflowId].inputs);
|
|
7960
|
+
case "task": return gl([...t.task == null ? e.tasks[t.taskId].inputs : t.task.inputs, ...t.additionalInputs ?? []]);
|
|
7740
7961
|
case "approval":
|
|
7741
|
-
case "wait": return
|
|
7962
|
+
case "wait": return gl(t.inputDefinitions);
|
|
7742
7963
|
}
|
|
7743
7964
|
}
|
|
7744
|
-
function
|
|
7965
|
+
function Zf(e, t) {
|
|
7745
7966
|
if (t.name != null) return t.name;
|
|
7746
7967
|
switch (t.kind) {
|
|
7747
7968
|
case "condition": return;
|
|
@@ -7752,45 +7973,45 @@ function Af(e, t) {
|
|
|
7752
7973
|
case "wait": return "Wait";
|
|
7753
7974
|
}
|
|
7754
7975
|
}
|
|
7755
|
-
function
|
|
7976
|
+
function Qf(e, t) {
|
|
7756
7977
|
return t.kind == "task" ? t.task == null ? e.tasks[t.taskId].executor.kind : "javascript" : t.kind;
|
|
7757
7978
|
}
|
|
7758
|
-
function
|
|
7979
|
+
function $f(e, t) {
|
|
7759
7980
|
if (typeof e != "object" || !e || Array.isArray(e)) throw Error(`${t} must be an object.`);
|
|
7760
7981
|
return e;
|
|
7761
7982
|
}
|
|
7762
|
-
function
|
|
7983
|
+
function ep(e, t, n) {
|
|
7763
7984
|
let r = Object.keys(e);
|
|
7764
7985
|
if (r.length != t.length || r.some((e) => !t.includes(e))) throw Error(`${n} contains unsupported fields.`);
|
|
7765
7986
|
}
|
|
7766
|
-
function
|
|
7987
|
+
function tp(e, t) {
|
|
7767
7988
|
if (typeof e != "string" || e.length == 0) throw Error(`${t} must be a non-empty string.`);
|
|
7768
7989
|
return e;
|
|
7769
7990
|
}
|
|
7770
|
-
function
|
|
7991
|
+
function np(e, t, n = 0) {
|
|
7771
7992
|
if (n > 64) throw Error(`${t} exceeds the maximum JSON depth.`);
|
|
7772
7993
|
if (e === null || typeof e == "boolean" || typeof e == "string" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
7773
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
7774
|
-
let r =
|
|
7775
|
-
return Object.fromEntries(Object.entries(r).map(([e, r]) => [e,
|
|
7994
|
+
if (Array.isArray(e)) return e.map((e) => np(e, t, n + 1));
|
|
7995
|
+
let r = $f(e, t);
|
|
7996
|
+
return Object.fromEntries(Object.entries(r).map(([e, r]) => [e, np(r, t, n + 1)]));
|
|
7776
7997
|
}
|
|
7777
|
-
var
|
|
7998
|
+
var rp = rs({
|
|
7778
7999
|
state: Fs(),
|
|
7779
8000
|
callId: A().min(1),
|
|
7780
8001
|
toolId: A().min(1),
|
|
7781
8002
|
input: I(A(), Fs()),
|
|
7782
8003
|
rounds: M().int().nonnegative(),
|
|
7783
8004
|
version: R(1)
|
|
7784
|
-
}),
|
|
8005
|
+
}), ip = F([rs({
|
|
7785
8006
|
kind: R("completed"),
|
|
7786
8007
|
output: Fs()
|
|
7787
8008
|
}), rs({
|
|
7788
8009
|
kind: R("suspended"),
|
|
7789
|
-
checkpoint:
|
|
8010
|
+
checkpoint: rp
|
|
7790
8011
|
})]);
|
|
7791
|
-
function
|
|
7792
|
-
let t =
|
|
7793
|
-
if (
|
|
8012
|
+
function ap(e) {
|
|
8013
|
+
let t = $f(e, "Flow Run checkpoint");
|
|
8014
|
+
if (ep(t, [
|
|
7794
8015
|
"agents",
|
|
7795
8016
|
"bindingValues",
|
|
7796
8017
|
"counts",
|
|
@@ -7800,14 +8021,14 @@ function Rf(e) {
|
|
|
7800
8021
|
"version",
|
|
7801
8022
|
"waits"
|
|
7802
8023
|
], "Flow Run checkpoint"), t.version != 5) throw Error("Flow Run checkpoint version is unsupported.");
|
|
7803
|
-
let n = Object.fromEntries(Object.entries(
|
|
8024
|
+
let n = Object.fromEntries(Object.entries($f(t.bindingValues, "Checkpoint bindings")).map(([e, t]) => {
|
|
7804
8025
|
if (typeof t != "string") throw Error("Checkpoint binding must be a string.");
|
|
7805
8026
|
return [e, t];
|
|
7806
|
-
})), r = Object.fromEntries(Object.entries(
|
|
7807
|
-
let n =
|
|
7808
|
-
return
|
|
7809
|
-
jobId:
|
|
7810
|
-
outputs: Object.fromEntries(Object.entries(
|
|
8027
|
+
})), r = Object.fromEntries(Object.entries($f(t.inputs, "Checkpoint inputs")).map(([e, t]) => [e, Object.fromEntries(Object.entries($f(t, "Checkpoint node inputs")).map(([e, t]) => [e, np(t, "Checkpoint input")]))])), i = Object.fromEntries(Object.entries($f(t.results, "Checkpoint results")).map(([e, t]) => {
|
|
8028
|
+
let n = $f(t, "Checkpoint result");
|
|
8029
|
+
return ep(n, ["jobId", "outputs"], "Checkpoint result"), [e, {
|
|
8030
|
+
jobId: tp(n.jobId, "Checkpoint job ID"),
|
|
8031
|
+
outputs: Object.fromEntries(Object.entries($f(n.outputs, "Checkpoint outputs")).map(([e, t]) => [e, np(t, "Checkpoint output")]))
|
|
7811
8032
|
}];
|
|
7812
8033
|
})), a = I(A(), I(A(), M().int().positive().max(2 ** 53 - 1))).parse(t.counts), o = I(A(), I(A(), I(A(), Fs()))).parse(t.frames), s = {
|
|
7813
8034
|
jobId: A().min(1),
|
|
@@ -7827,7 +8048,7 @@ function Rf(e) {
|
|
|
7827
8048
|
invocationId: A().min(1),
|
|
7828
8049
|
input: I(A(), Fs()),
|
|
7829
8050
|
remainingMs: M().positive().optional(),
|
|
7830
|
-
checkpoint:
|
|
8051
|
+
checkpoint: rp
|
|
7831
8052
|
})).parse(t.agents), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
7832
8053
|
for (let e of c) {
|
|
7833
8054
|
if (u.has(e.jobId) || d.has(e.waitId) || o[e.jobId] == null || Object.values(i).some((t) => t.jobId == e.jobId)) throw Error("Checkpoint waiting execution states conflict.");
|
|
@@ -7846,63 +8067,24 @@ function Rf(e) {
|
|
|
7846
8067
|
waits: c
|
|
7847
8068
|
};
|
|
7848
8069
|
}
|
|
7849
|
-
function
|
|
8070
|
+
function op(e, t) {
|
|
7850
8071
|
if (e === t) return !0;
|
|
7851
8072
|
if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
|
|
7852
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) =>
|
|
8073
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => op(e, t[n]));
|
|
7853
8074
|
let n = Object.entries(e), r = Object.entries(t), i = t;
|
|
7854
|
-
return n.length == r.length && n.every(([e, t]) => Object.hasOwn(i, e) &&
|
|
7855
|
-
}
|
|
7856
|
-
function Bf(e, t, n) {
|
|
7857
|
-
let r = Object.hasOwn(n, t.input) ? n[t.input] : null, i = t.value;
|
|
7858
|
-
switch (t.operator) {
|
|
7859
|
-
case "==": return i !== void 0 && zf(r, i);
|
|
7860
|
-
case "!=": return i !== void 0 && !zf(r, i);
|
|
7861
|
-
case ">": return typeof r == "number" && typeof i == "number" && r > i;
|
|
7862
|
-
case ">=": return typeof r == "number" && typeof i == "number" && r >= i;
|
|
7863
|
-
case "<": return typeof r == "number" && typeof i == "number" && r < i;
|
|
7864
|
-
case "<=": return typeof r == "number" && typeof i == "number" && r <= i;
|
|
7865
|
-
case "contains":
|
|
7866
|
-
case "notContains": {
|
|
7867
|
-
let e;
|
|
7868
|
-
return typeof r == "string" && typeof i == "string" ? e = r.includes(i) : Array.isArray(r) && i !== void 0 && (e = r.some((e) => zf(e, i))), e == null ? !1 : t.operator == "contains" ? e : !e;
|
|
7869
|
-
}
|
|
7870
|
-
case "startsWith": return typeof r == "string" && typeof i == "string" && r.startsWith(i);
|
|
7871
|
-
case "endsWith": return typeof r == "string" && typeof i == "string" && r.endsWith(i);
|
|
7872
|
-
case "hasKey":
|
|
7873
|
-
case "notHasKey": {
|
|
7874
|
-
if (r == null || Array.isArray(r) || typeof r != "object" || typeof i != "string") return !1;
|
|
7875
|
-
let e = Object.hasOwn(r, i);
|
|
7876
|
-
return t.operator == "hasKey" ? e : !e;
|
|
7877
|
-
}
|
|
7878
|
-
case "hasValue":
|
|
7879
|
-
case "notHasValue": {
|
|
7880
|
-
if (r == null || Array.isArray(r) || typeof r != "object" || i === void 0) return !1;
|
|
7881
|
-
let e = Object.values(r).some((e) => zf(e, i));
|
|
7882
|
-
return t.operator == "hasValue" ? e : !e;
|
|
7883
|
-
}
|
|
7884
|
-
case "isEmpty":
|
|
7885
|
-
case "isNotEmpty": {
|
|
7886
|
-
let e = r === null || typeof r == "string" && r.length == 0 || Array.isArray(r) && r.length == 0 || typeof r == "object" && !Array.isArray(r) && Object.keys(r).length == 0;
|
|
7887
|
-
return (r === null || typeof r == "string" || typeof r == "object") && (t.operator == "isEmpty" ? e : !e);
|
|
7888
|
-
}
|
|
7889
|
-
case "isNull": return r === null;
|
|
7890
|
-
case "isNotNull": return r !== null;
|
|
7891
|
-
case "isTrue": return r === !0;
|
|
7892
|
-
case "isFalse": return r === !1;
|
|
7893
|
-
}
|
|
8075
|
+
return n.length == r.length && n.every(([e, t]) => Object.hasOwn(i, e) && op(t, i[e]));
|
|
7894
8076
|
}
|
|
7895
|
-
function
|
|
8077
|
+
function sp(e, t) {
|
|
7896
8078
|
if (e === void 0) return {};
|
|
7897
8079
|
if (typeof e != "object" || !e || Array.isArray(e)) throw Error(`Node "${t}" must return an object.`);
|
|
7898
8080
|
return e;
|
|
7899
8081
|
}
|
|
7900
|
-
function
|
|
8082
|
+
function cp(e, t) {
|
|
7901
8083
|
let n = t.kind == "task" && t.taskId != null ? e.tasks[t.taskId] : void 0;
|
|
7902
8084
|
return n?.executor.kind == "agent" ? n.executor : void 0;
|
|
7903
8085
|
}
|
|
7904
|
-
function
|
|
7905
|
-
let r =
|
|
8086
|
+
function lp(e, t, n) {
|
|
8087
|
+
let r = cp(e, t)?.notification;
|
|
7906
8088
|
if (r == null) return;
|
|
7907
8089
|
let i = e.tasks[r.taskId];
|
|
7908
8090
|
return {
|
|
@@ -7911,17 +8093,17 @@ function Uf(e, t, n) {
|
|
|
7911
8093
|
input: Object.fromEntries(i.inputs.flatMap((e) => {
|
|
7912
8094
|
if (!("handle" in e) || e.handle == r.messageHandle) return [];
|
|
7913
8095
|
let t = r.inputs[e.handle];
|
|
7914
|
-
return [[e.handle, t == null ? e.value ?? null :
|
|
8096
|
+
return [[e.handle, t == null ? e.value ?? null : Nf(t, n)]];
|
|
7915
8097
|
}))
|
|
7916
8098
|
};
|
|
7917
8099
|
}
|
|
7918
|
-
function
|
|
8100
|
+
function up(e, t, n) {
|
|
7919
8101
|
let r = e.tools.find((e) => e.id == t.toolId);
|
|
7920
8102
|
if (r == null || !r.approval || t.rounds > e.maxRounds) throw Error("Agent pause does not match its tool declaration.");
|
|
7921
8103
|
for (let e of r.inputs) {
|
|
7922
8104
|
let r = t.input[e.handle];
|
|
7923
|
-
if (r === void 0 || !(r === null && e.nullable) && !
|
|
7924
|
-
if (e.source.kind != "model" && !
|
|
8105
|
+
if (r === void 0 || !(r === null && e.nullable) && !Mf(r, e.jsonSchema)) throw Error("Agent pause arguments are invalid.");
|
|
8106
|
+
if (e.source.kind != "model" && !op(r, Nf(e.source, n))) throw Error("Agent pause changed fixed arguments.");
|
|
7925
8107
|
}
|
|
7926
8108
|
if (Object.keys(t.input).length != r.inputs.length) throw Error("Agent pause contains undeclared arguments.");
|
|
7927
8109
|
return {
|
|
@@ -7932,8 +8114,8 @@ function Wf(e, t, n) {
|
|
|
7932
8114
|
input: t.input
|
|
7933
8115
|
};
|
|
7934
8116
|
}
|
|
7935
|
-
function
|
|
7936
|
-
let i =
|
|
8117
|
+
function dp(e, t, n, r) {
|
|
8118
|
+
let i = sp(r, t), a = n.kind == "task" && n.taskId != null && e.tasks[n.taskId].executor.kind == "connector", o = Bf(n) ? Uf(n) : n.kind == "task" ? gl(n.task == null ? e.tasks[n.taskId].outputs : n.task.outputs) : n.kind == "subflow" ? gl(e.subflows[n.subflowId].outputs) : n.kind == "value" ? gl(n.values) : {}, s = sp(np(Object.fromEntries(Object.entries(i).map(([e, t]) => [e, Object.hasOwn(o, e) && t === void 0 ? null : t])), `Node "${t}" outputs`), t), c = n.kind == "condition" || Bf(n) ? s : {
|
|
7937
8119
|
...Object.fromEntries(Object.keys(o).map((e) => [e, null])),
|
|
7938
8120
|
...s
|
|
7939
8121
|
}, l = {};
|
|
@@ -7943,12 +8125,12 @@ function Gf(e, t, n, r) {
|
|
|
7943
8125
|
if (a) continue;
|
|
7944
8126
|
throw Error(`Node "${t}" output "${e}" does not match its declaration.`);
|
|
7945
8127
|
}
|
|
7946
|
-
if (!(n === null && r.nullable) && !
|
|
8128
|
+
if (!(n === null && r.nullable) && !Mf(n, r.jsonSchema)) throw Error(`Node "${t}" output "${e}" does not match its declaration.`);
|
|
7947
8129
|
l[e] = n;
|
|
7948
8130
|
}
|
|
7949
8131
|
return l;
|
|
7950
8132
|
}
|
|
7951
|
-
function
|
|
8133
|
+
function fp(e, t, n, r) {
|
|
7952
8134
|
let i = n.inputs, a = n.agents;
|
|
7953
8135
|
if ([...Object.keys(n.results), ...Object.keys(i)].some((e) => t.graph.nodes[e] == null)) throw Error("Checkpoint nodes do not match the prepared graph.");
|
|
7954
8136
|
for (let [r, i] of Object.entries(n.counts)) {
|
|
@@ -7965,10 +8147,10 @@ function Kf(e, t, n, r) {
|
|
|
7965
8147
|
if (r == null) throw Error("Checkpoint result node is missing.");
|
|
7966
8148
|
if ("inputs" in r) {
|
|
7967
8149
|
if (n.counts[""]?.[a] == null) throw Error("Checkpoint execution count is missing.");
|
|
7968
|
-
if (!
|
|
8150
|
+
if (!op(dp(e, a, r, o), o)) throw Error("Checkpoint node outputs are incomplete.");
|
|
7969
8151
|
let t = Object.keys(o).length;
|
|
7970
|
-
if (r.kind == "condition" &&
|
|
7971
|
-
} else if (!
|
|
8152
|
+
if (r.kind == "condition" && t != 0 || Bf(r) && (Vf(r).filter((e) => Object.hasOwn(o, e)).length > 1 || !Vf(r).some((e) => Object.hasOwn(o, e)) && !(i && Object.hasOwn(o, "pending")))) throw Error("Checkpoint branch result is invalid.");
|
|
8153
|
+
} else if (!zf(r, o)) throw Error("Checkpoint Trigger output is invalid.");
|
|
7972
8154
|
}
|
|
7973
8155
|
};
|
|
7974
8156
|
o(Object.fromEntries(Object.entries(n.results).map(([e, t]) => [e, t.outputs])));
|
|
@@ -7977,36 +8159,36 @@ function Kf(e, t, n, r) {
|
|
|
7977
8159
|
for (let e of Object.values(n.frames)) {
|
|
7978
8160
|
o(e, !0);
|
|
7979
8161
|
let r = Object.keys(e).filter((e) => !("inputs" in t.graph.nodes[e]));
|
|
7980
|
-
if (r.length != 1 || r[0] != s[0] || !
|
|
8162
|
+
if (r.length != 1 || r[0] != s[0] || !op(e[r[0]], n.results[r[0]].outputs)) throw Error("Checkpoint frame Trigger does not match the Run.");
|
|
7981
8163
|
}
|
|
7982
8164
|
let c = /* @__PURE__ */ new Map();
|
|
7983
8165
|
for (let e of n.waits) c.set(e.nodeId, (c.get(e.nodeId) ?? 0) + 1);
|
|
7984
8166
|
for (let [e, t] of c) if ((n.counts[""]?.[e] ?? 0) < t + (n.results[e] == null ? 0 : 1)) throw Error("Checkpoint waiting execution count is incomplete.");
|
|
7985
8167
|
for (let [n, r] of Object.entries(i)) {
|
|
7986
8168
|
let i = t.graph.nodes[n];
|
|
7987
|
-
if (!("inputs" in i) || Object.keys(r).some((t) =>
|
|
8169
|
+
if (!("inputs" in i) || Object.keys(r).some((t) => Xf(e, i)[t] == null)) throw Error("Checkpoint launch inputs do not match the prepared graph.");
|
|
7988
8170
|
}
|
|
7989
8171
|
for (let i of n.waits) {
|
|
7990
8172
|
let o = t.graph.nodes[i.nodeId];
|
|
7991
8173
|
if (o == null || !("inputs" in o)) throw Error("Checkpoint waiting node is missing.");
|
|
7992
|
-
let s =
|
|
7993
|
-
if (!
|
|
8174
|
+
let s = cp(e, o), c = a[i.jobId];
|
|
8175
|
+
if (!Bf(o) && s == null) throw Error("Checkpoint waiting node cannot suspend.");
|
|
7994
8176
|
if (s != null) {
|
|
7995
8177
|
if (c != null && c.invocationId != i.jobId) throw Error("Checkpoint Agent invocation identity changed.");
|
|
7996
8178
|
if (c == null || o.timeoutMs == null != (c.remainingMs == null) || c.remainingMs != null && c.remainingMs > o.timeoutMs) throw Error("Checkpoint Agent budget is invalid.");
|
|
7997
|
-
let e =
|
|
7998
|
-
if (!
|
|
7999
|
-
if (!
|
|
8179
|
+
let e = up(s, c.checkpoint, c.input);
|
|
8180
|
+
if (!op(i.value, e)) throw Error("Checkpoint Agent approval does not match its saved call.");
|
|
8181
|
+
if (!op(r(i.nodeId, o, i.jobId), c.input)) throw Error("Checkpoint Agent inputs changed.");
|
|
8000
8182
|
} else {
|
|
8001
8183
|
if (c != null) throw Error("Checkpoint Wait contains Agent state.");
|
|
8002
|
-
if (!
|
|
8003
|
-
if (
|
|
8004
|
-
i.pending != null &&
|
|
8184
|
+
if (!Bf(o) || !op(r(i.nodeId, o, i.jobId), i.value)) throw Error("Checkpoint resolution input changed.");
|
|
8185
|
+
if (qf(t.graph, i.nodeId) != (i.pending != null)) throw Error("Checkpoint Wait pending output is missing or unexpected.");
|
|
8186
|
+
i.pending != null && dp(e, i.nodeId, o, { pending: i.pending });
|
|
8005
8187
|
}
|
|
8006
8188
|
if (n.counts[""]?.[i.nodeId] == null) throw Error("Checkpoint waiting execution count is missing.");
|
|
8007
8189
|
}
|
|
8008
8190
|
}
|
|
8009
|
-
function
|
|
8191
|
+
function pp(i, o, s, c, l, u = {}, d, f) {
|
|
8010
8192
|
return t.scoped(t.gen(function* () {
|
|
8011
8193
|
f ?? (yield* i.emit({
|
|
8012
8194
|
flowId: o.flowId,
|
|
@@ -8027,30 +8209,34 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8027
8209
|
if (f == null) {
|
|
8028
8210
|
if (d != null) {
|
|
8029
8211
|
let e = o.graph.nodes[d.nodeId];
|
|
8030
|
-
if (e == null || "inputs" in e || !
|
|
8212
|
+
if (e == null || "inputs" in e || !zf(e, d.outputs)) throw Error("Trigger outputs are invalid.");
|
|
8031
8213
|
}
|
|
8032
8214
|
for (let [e, t] of Object.entries(o.graph.nodes)) "inputs" in t || d?.nodeId == e && ee.set(e, {
|
|
8033
8215
|
jobId: e,
|
|
8034
8216
|
outputs: d.outputs
|
|
8035
8217
|
});
|
|
8036
8218
|
}
|
|
8037
|
-
let ie = yield* n.make(), ae = yield* n.runtime(ie)(), oe, se, _ = new Map((f?.checkpoint.waits ?? []).map((e) => [e.jobId, e])), v = yield* r.unbounded(), y = i.remainingMs, ce = yield* e.currentTimeMillis, le, ue = { ...f?.checkpoint.agents }, de = (e, t, n, r, a) => {
|
|
8038
|
-
let
|
|
8219
|
+
let ie = yield* n.make(), ae = yield* n.runtime(ie)(), oe, se, _ = new Map((f?.checkpoint.waits ?? []).map((e) => [e.jobId, e])), v = yield* r.unbounded(), y = i.remainingMs, ce = yield* e.currentTimeMillis, le, ue = { ...f?.checkpoint.agents }, de = (e, t, n, r, a, o = !1) => {
|
|
8220
|
+
let s = yc(e, n === void 0 ? t.value : n);
|
|
8039
8221
|
if (e?.kind == "sources") {
|
|
8040
8222
|
let t = e.sources.flatMap((e) => {
|
|
8041
8223
|
if (e.kind == "binding") return Object.hasOwn(i.bindingValues, e.bindingId) ? [i.bindingValues[e.bindingId]] : [];
|
|
8042
8224
|
if (e.kind == "flow") return Object.hasOwn(c, e.input) ? [c[e.input]] : [];
|
|
8043
8225
|
let t = a[e.nodeId];
|
|
8044
|
-
|
|
8226
|
+
if (t == null || !Object.hasOwn(t, e.output)) return [];
|
|
8227
|
+
let n = t[e.output];
|
|
8228
|
+
return e.field === void 0 ? [n] : typeof n == "object" && n && !Array.isArray(n) && Object.hasOwn(n, e.field) ? [n[e.field]] : [];
|
|
8045
8229
|
});
|
|
8046
8230
|
if (t.length > 1) throw Error(`${r} has multiple available sources.`);
|
|
8047
|
-
o
|
|
8231
|
+
if (o && t.length == 0) throw Error(`${r} Source has no value.`);
|
|
8232
|
+
s = t[0] ?? null;
|
|
8048
8233
|
}
|
|
8049
|
-
if (o
|
|
8050
|
-
|
|
8234
|
+
if (o && s === void 0) throw Error(`${r} is incomplete.`);
|
|
8235
|
+
if (s === void 0 && (s = null), !(s === null && t.nullable) && !Mf(s, t.jsonSchema)) throw Error(`${r} does not match its declared schema.`);
|
|
8236
|
+
return s;
|
|
8051
8237
|
}, fe = (e, t, n) => {
|
|
8052
|
-
let r = t
|
|
8053
|
-
return Object.fromEntries(Object.entries(
|
|
8238
|
+
let r = cl(t);
|
|
8239
|
+
return Object.fromEntries(Object.entries(Xf(i.prepared, t)).map(([i, a]) => [i, de(r[i], a, re[e]?.[i], `Node "${e}" input "${i}"`, ne[n], t.kind == "condition")]));
|
|
8054
8240
|
}, pe = (e, n, r, a = Object.keys(r)) => t.uninterruptible(t.gen(function* () {
|
|
8055
8241
|
yield* i.emit({
|
|
8056
8242
|
jobId: n,
|
|
@@ -8075,10 +8261,9 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8075
8261
|
}, ge = (e, t, n) => {
|
|
8076
8262
|
for (let r of h.get(e) ?? []) (r.sourceHandle == null || t.includes(r.sourceHandle)) && he(r.target, n);
|
|
8077
8263
|
}, _e = (e, n, r, a, c) => {
|
|
8078
|
-
let l =
|
|
8079
|
-
let p =
|
|
8080
|
-
|
|
8081
|
-
let t = n.inputs[e];
|
|
8264
|
+
let l = cp(i.prepared, n), u = ue[r], d = u?.remainingMs ?? n.timeoutMs, f = performance.now(), p = t.gen(function* () {
|
|
8265
|
+
let p = Qf(i.prepared, n), m = Zf(i.prepared, n), h = Object.fromEntries(Object.entries(a).filter(([e]) => {
|
|
8266
|
+
let t = cl(n)[e];
|
|
8082
8267
|
return t?.kind != "sources" || t.sources.every((e) => e.kind != "binding");
|
|
8083
8268
|
}));
|
|
8084
8269
|
c ?? (yield* i.emit({
|
|
@@ -8092,21 +8277,17 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8092
8277
|
}));
|
|
8093
8278
|
let g;
|
|
8094
8279
|
switch (n.kind) {
|
|
8095
|
-
case "condition": {
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
})?.output ?? n.defaultOutput;
|
|
8101
|
-
g = e == null ? {} : { [e]: a[n.input.handle] ?? null };
|
|
8102
|
-
break;
|
|
8103
|
-
}
|
|
8280
|
+
case "condition": return {
|
|
8281
|
+
kind: "completed",
|
|
8282
|
+
outputs: {},
|
|
8283
|
+
releasedHandles: hl(n, a)
|
|
8284
|
+
};
|
|
8104
8285
|
case "value":
|
|
8105
8286
|
g = Object.fromEntries(n.values.map((e) => [e.handle, e.value ?? null]));
|
|
8106
8287
|
break;
|
|
8107
8288
|
case "subflow": {
|
|
8108
8289
|
let e = i.prepared.subflows[n.subflowId];
|
|
8109
|
-
g = yield*
|
|
8290
|
+
g = yield* pp(i, {
|
|
8110
8291
|
flowId: n.subflowId,
|
|
8111
8292
|
graph: e.graph,
|
|
8112
8293
|
kind: "subflow"
|
|
@@ -8136,10 +8317,10 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8136
8317
|
}
|
|
8137
8318
|
});
|
|
8138
8319
|
if (l != null) {
|
|
8139
|
-
let n =
|
|
8320
|
+
let n = ip.parse(m);
|
|
8140
8321
|
if (n.kind == "suspended") {
|
|
8141
8322
|
if (o.kind != "flow") return yield* t.fail(/* @__PURE__ */ Error("Subflow Agent is not supported."));
|
|
8142
|
-
let i = n.checkpoint, s =
|
|
8323
|
+
let i = n.checkpoint, s = up(l, i, a), c = d == null ? void 0 : d - (performance.now() - f);
|
|
8143
8324
|
if (c != null && c <= 0) throw Error(`Node "${e}" timed out.`);
|
|
8144
8325
|
return {
|
|
8145
8326
|
kind: "suspended",
|
|
@@ -8153,7 +8334,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8153
8334
|
};
|
|
8154
8335
|
}
|
|
8155
8336
|
g = { output: n.output };
|
|
8156
|
-
} else g =
|
|
8337
|
+
} else g = sp(m, e);
|
|
8157
8338
|
break;
|
|
8158
8339
|
}
|
|
8159
8340
|
case "approval":
|
|
@@ -8162,7 +8343,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8162
8343
|
return yield* t.try({
|
|
8163
8344
|
try: () => ({
|
|
8164
8345
|
kind: "completed",
|
|
8165
|
-
outputs:
|
|
8346
|
+
outputs: dp(i.prepared, e, n, g)
|
|
8166
8347
|
}),
|
|
8167
8348
|
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
8168
8349
|
});
|
|
@@ -8173,18 +8354,18 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8173
8354
|
}));
|
|
8174
8355
|
}, ve = (e, n, s) => t.gen(function* () {
|
|
8175
8356
|
if (o.kind != "flow" || i.waits == null) return yield* t.fail(/* @__PURE__ */ Error("Wait host is unavailable."));
|
|
8176
|
-
let c = o.graph.nodes[e], l = a(), u =
|
|
8357
|
+
let c = o.graph.nodes[e], l = a(), u = Bf(c) && qf(o.graph, e), d = yield* i.waits.create({
|
|
8177
8358
|
jobId: n,
|
|
8178
8359
|
nodeId: e,
|
|
8179
8360
|
value: s,
|
|
8180
8361
|
waitId: l,
|
|
8181
8362
|
notify: u,
|
|
8182
|
-
actions:
|
|
8183
|
-
prompt:
|
|
8184
|
-
...
|
|
8363
|
+
actions: Bf(c) ? Vf(c) : ["approve", "reject"],
|
|
8364
|
+
prompt: Bf(c) ? c.prompt : JSON.stringify(s, null, 2),
|
|
8365
|
+
...Bf(c) ? {} : { notification: lp(i.prepared, c, ue[n].input) }
|
|
8185
8366
|
});
|
|
8186
8367
|
if (u) {
|
|
8187
|
-
|
|
8368
|
+
dp(i.prepared, e, c, { pending: d });
|
|
8188
8369
|
let t = {
|
|
8189
8370
|
...ne[n],
|
|
8190
8371
|
[e]: { pending: d }
|
|
@@ -8198,9 +8379,9 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8198
8379
|
waitId: l,
|
|
8199
8380
|
...u ? { pending: d } : {}
|
|
8200
8381
|
}), yield* r.offer(v, void 0);
|
|
8201
|
-
}), ye = (e, t, n) => n.kind == "completed" ? (delete ue[t], pe(e, t, n.outputs)) : (ue[t] = n.agent, ve(e, t, n.value)), be = (e, n, r) => r.pipe(t.catchDefect((e) => t.fail(e instanceof Error ? e : Error(String(e)))), t.tapError((r) => t.gen(function* () {
|
|
8382
|
+
}), ye = (e, t, n) => n.kind == "completed" ? (delete ue[t], pe(e, t, n.outputs, n.releasedHandles)) : (ue[t] = n.agent, ve(e, t, n.value)), be = (e, n, r) => r.pipe(t.catchDefect((e) => t.fail(e instanceof Error ? e : Error(String(e)))), t.tapError((r) => t.gen(function* () {
|
|
8202
8383
|
oe ?? (se ??= r), yield* i.emit({
|
|
8203
|
-
...
|
|
8384
|
+
...Yf(r, i.projectFailure),
|
|
8204
8385
|
jobId: n,
|
|
8205
8386
|
nodeId: e,
|
|
8206
8387
|
runId: s,
|
|
@@ -8222,17 +8403,19 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8222
8403
|
try: () => fe(e, a, c),
|
|
8223
8404
|
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
8224
8405
|
});
|
|
8225
|
-
if (
|
|
8226
|
-
let t = a.inputs[a.input.handle];
|
|
8406
|
+
if (Bf(a)) {
|
|
8227
8407
|
yield* i.emit({
|
|
8228
|
-
inputs:
|
|
8408
|
+
inputs: Object.fromEntries(Object.entries(n).filter(([e]) => {
|
|
8409
|
+
let t = cl(a)[e];
|
|
8410
|
+
return t?.kind != "sources" || t.sources.every((e) => e.kind != "binding");
|
|
8411
|
+
})),
|
|
8229
8412
|
jobId: c,
|
|
8230
8413
|
nodeId: e,
|
|
8231
8414
|
nodeKind: a.kind,
|
|
8232
8415
|
...a.name == null ? {} : { nodeTitle: a.name },
|
|
8233
8416
|
runId: s,
|
|
8234
8417
|
type: "node.started"
|
|
8235
|
-
}), yield* ve(e, c, n
|
|
8418
|
+
}), yield* ve(e, c, n);
|
|
8236
8419
|
return;
|
|
8237
8420
|
}
|
|
8238
8421
|
let r = yield* _e(e, a, c, n);
|
|
@@ -8240,7 +8423,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8240
8423
|
})).pipe(t.ensuring(r.offer(v, void 0))));
|
|
8241
8424
|
};
|
|
8242
8425
|
if (f != null && (yield* t.try({
|
|
8243
|
-
try: () =>
|
|
8426
|
+
try: () => fp(i.prepared, o, f.checkpoint, fe),
|
|
8244
8427
|
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
8245
8428
|
})), f == null) {
|
|
8246
8429
|
if (d != null) ge(d.nodeId, Object.keys(d.outputs), { [d.nodeId]: d.outputs });
|
|
@@ -8250,18 +8433,24 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8250
8433
|
for (let a of _.values()) {
|
|
8251
8434
|
let s = e[a.waitId];
|
|
8252
8435
|
if (s == null) continue;
|
|
8436
|
+
let { action: c, resolvedAt: l, comment: u } = s;
|
|
8253
8437
|
le != null && (le = void 0, ce = n), _.delete(a.jobId);
|
|
8254
|
-
let
|
|
8438
|
+
let d = o.graph.nodes[a.nodeId];
|
|
8255
8439
|
ae(be(a.nodeId, a.jobId, t.gen(function* () {
|
|
8256
|
-
if (
|
|
8257
|
-
if (!
|
|
8258
|
-
yield* pe(a.nodeId, a.jobId,
|
|
8440
|
+
if (Bf(d)) {
|
|
8441
|
+
if (!Vf(d).some((e) => e == c)) return yield* t.fail(/* @__PURE__ */ Error("Resolution does not match node actions."));
|
|
8442
|
+
yield* pe(a.nodeId, a.jobId, dp(i.prepared, a.nodeId, d, {
|
|
8259
8443
|
...a.pending == null ? {} : { pending: a.pending },
|
|
8260
|
-
[
|
|
8261
|
-
|
|
8444
|
+
[c]: {
|
|
8445
|
+
inputs: a.value,
|
|
8446
|
+
action: c,
|
|
8447
|
+
resolvedAt: l,
|
|
8448
|
+
comment: u
|
|
8449
|
+
}
|
|
8450
|
+
}), [c]);
|
|
8262
8451
|
} else {
|
|
8263
|
-
if (
|
|
8264
|
-
yield* ye(a.nodeId, a.jobId, yield* _e(a.nodeId,
|
|
8452
|
+
if (c == "continue") return yield* t.fail(/* @__PURE__ */ Error("Agent requires approve or reject."));
|
|
8453
|
+
yield* ye(a.nodeId, a.jobId, yield* _e(a.nodeId, d, a.jobId, ue[a.jobId].input, c));
|
|
8265
8454
|
}
|
|
8266
8455
|
})).pipe(t.ensuring(r.offer(v, void 0))));
|
|
8267
8456
|
}
|
|
@@ -8280,7 +8469,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8280
8469
|
if (oe != null) continue;
|
|
8281
8470
|
if (o == 0 && _.size == 0 && me.length == 0) break;
|
|
8282
8471
|
o > 0 || me.length > 0 ? le = void 0 : le ??= a;
|
|
8283
|
-
let c = le == null ? y :
|
|
8472
|
+
let c = le == null ? y : Jf - (a - le);
|
|
8284
8473
|
if (le != null && c <= 0) {
|
|
8285
8474
|
let e = {
|
|
8286
8475
|
bindingValues: i.bindingValues,
|
|
@@ -8294,7 +8483,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8294
8483
|
}, n = JSON.stringify(e);
|
|
8295
8484
|
return new TextEncoder().encode(n).byteLength > 16777216 ? yield* t.fail(/* @__PURE__ */ Error("Flow Run checkpoint exceeds 16 MiB.")) : {
|
|
8296
8485
|
kind: "waiting",
|
|
8297
|
-
checkpoint:
|
|
8486
|
+
checkpoint: ap(JSON.parse(n)),
|
|
8298
8487
|
...y == null ? {} : { remainingMs: y }
|
|
8299
8488
|
};
|
|
8300
8489
|
}
|
|
@@ -8342,15 +8531,15 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8342
8531
|
}), Se;
|
|
8343
8532
|
}));
|
|
8344
8533
|
}
|
|
8345
|
-
function
|
|
8534
|
+
function mp(e, n) {
|
|
8346
8535
|
let r = n.emit ?? (() => t.void);
|
|
8347
8536
|
return t.gen(function* () {
|
|
8348
8537
|
if (n.resume != null && (n.inputs != null || n.trigger != null || n.bindingValues != null)) return yield* t.fail(/* @__PURE__ */ Error("A resumed Flow Run cannot accept launch inputs, binding values, or a Trigger seed."));
|
|
8349
|
-
let i = n.resume == null ? void 0 :
|
|
8538
|
+
let i = n.resume == null ? void 0 : ap(n.resume.checkpoint);
|
|
8350
8539
|
if (i != null && new TextEncoder().encode(JSON.stringify(i)).byteLength > 16777216) return yield* t.fail(/* @__PURE__ */ Error("Flow Run checkpoint exceeds 16 MiB."));
|
|
8351
8540
|
if (i == null && n.trigger == null) return yield* t.fail(/* @__PURE__ */ Error("A Flow Run requires a Trigger seed."));
|
|
8352
8541
|
let a = n.trigger == null ? void 0 : e.graph.nodes[n.trigger.nodeId];
|
|
8353
|
-
return n.trigger != null && (a == null || "inputs" in a) ? yield* t.fail(/* @__PURE__ */ Error(`Node "${n.trigger.nodeId}" is not a TriggerNode in Flow "${n.flowId}".`)) : yield*
|
|
8542
|
+
return n.trigger != null && (a == null || "inputs" in a) ? yield* t.fail(/* @__PURE__ */ Error(`Node "${n.trigger.nodeId}" is not a TriggerNode in Flow "${n.flowId}".`)) : yield* pp({
|
|
8354
8543
|
counts: Object.fromEntries(Object.entries(i?.counts ?? {}).map(([e, t]) => [e, { ...t }])),
|
|
8355
8544
|
bindingValues: i?.bindingValues ?? n.bindingValues ?? {},
|
|
8356
8545
|
createId: n.createId,
|
|
@@ -8368,4 +8557,4 @@ function Jf(e, n) {
|
|
|
8368
8557
|
});
|
|
8369
8558
|
}
|
|
8370
8559
|
//#endregion
|
|
8371
|
-
export {
|
|
8560
|
+
export { ap as decodeFlowRunCheckpoint, Kf as normalizeWaitComment, mp as runFlow, Jf as waitRetentionMs };
|