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