@oomol-lab/open-flow 0.1.0-beta.30 → 0.1.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{createResourceDialog-_y2xHaUA.js → createResourceDialog-FBRnCMK6.js} +1 -1
- package/dist/browser/{editorComponent-Dq4IKp5R.js → editorComponent-CyH2o-Ji.js} +21 -0
- package/dist/browser/flow-authoring.js +68 -72
- package/dist/browser/flow-change.d.ts +3 -3
- package/dist/browser/flow-change.js +796 -792
- package/dist/browser/{flowChanges-AdN0Iqma.js → flowChanges-ScpWTKtQ.js} +581 -592
- package/dist/browser/{flowWorkspace-BrtzLKWB.js → flowWorkspace-CY1r6dwz.js} +26551 -26516
- package/dist/browser/{inputValues-DJfFraxG.js → inputValues-C21gYJuc.js} +1 -1
- package/dist/browser/ui.css +1 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +6 -6
- package/dist/browser/{workbenchSelect-BDPIQxYK.js → workbenchSelect-DAaGuZwP.js} +110 -106
- package/dist/common/control-api-conformance.js +80 -78
- package/dist/common/control-api.d.ts +15 -1
- package/dist/common/control-api.js +158 -153
- package/dist/common/control-requests.d.ts +6 -0
- package/dist/common/control-requests.js +761 -772
- package/dist/common/flow-encoding.js +757 -752
- package/dist/common/flow-semantics.js +260 -263
- package/dist/common/mcp.d.ts +1 -0
- package/dist/common/mcp.js +120 -114
- package/dist/common/provider-triggers.js +1284 -1283
- package/dist/common/scheduler.d.ts +7 -1
- package/dist/common/scheduler.js +696 -690
- package/package.json +1 -1
package/dist/common/scheduler.js
CHANGED
|
@@ -4855,33 +4855,33 @@ var vc = class {
|
|
|
4855
4855
|
jsonSchema: bc,
|
|
4856
4856
|
nullable: Jo(),
|
|
4857
4857
|
handle: B
|
|
4858
|
-
}),
|
|
4858
|
+
}), Cc = Sc.extend({ value: bc.optional() }), wc = P({
|
|
4859
4859
|
collapsed: Jo().optional(),
|
|
4860
4860
|
group: B
|
|
4861
|
-
}),
|
|
4861
|
+
}), Tc = P({
|
|
4862
4862
|
kind: R("node"),
|
|
4863
4863
|
nodeId: B,
|
|
4864
4864
|
output: B
|
|
4865
|
-
}),
|
|
4865
|
+
}), Ec = P({
|
|
4866
4866
|
kind: R("flow"),
|
|
4867
4867
|
input: B
|
|
4868
|
-
}),
|
|
4869
|
-
wc,
|
|
4868
|
+
}), Dc = F([
|
|
4870
4869
|
Tc,
|
|
4870
|
+
Ec,
|
|
4871
4871
|
P({
|
|
4872
4872
|
kind: R("binding"),
|
|
4873
4873
|
bindingId: B
|
|
4874
4874
|
})
|
|
4875
|
-
]),
|
|
4875
|
+
]), Oc = F([P({
|
|
4876
4876
|
kind: R("value"),
|
|
4877
4877
|
value: bc
|
|
4878
4878
|
}), P({
|
|
4879
4879
|
kind: R("sources"),
|
|
4880
|
-
sources: N(
|
|
4881
|
-
})]),
|
|
4882
|
-
inputs: N(F([
|
|
4883
|
-
outputs: N(F([Sc,
|
|
4884
|
-
},
|
|
4880
|
+
sources: N(Dc)
|
|
4881
|
+
})]), kc = I(B, Oc), Ac = {
|
|
4882
|
+
inputs: N(F([Cc, wc])),
|
|
4883
|
+
outputs: N(F([Sc, wc]))
|
|
4884
|
+
}, jc = P({
|
|
4885
4885
|
kind: R("connector"),
|
|
4886
4886
|
action: B,
|
|
4887
4887
|
connectionId: B.optional(),
|
|
@@ -4889,19 +4889,19 @@ var vc = class {
|
|
|
4889
4889
|
connectionId: B,
|
|
4890
4890
|
alias: B.optional()
|
|
4891
4891
|
}))
|
|
4892
|
-
}),
|
|
4893
|
-
...
|
|
4892
|
+
}), Mc = P({
|
|
4893
|
+
...Ac,
|
|
4894
4894
|
name: B,
|
|
4895
4895
|
moduleId: B,
|
|
4896
|
-
capabilities: N(
|
|
4897
|
-
}),
|
|
4896
|
+
capabilities: N(jc).optional()
|
|
4897
|
+
}), Nc = F([P({
|
|
4898
4898
|
kind: R("value"),
|
|
4899
4899
|
value: bc
|
|
4900
4900
|
}), P({
|
|
4901
4901
|
kind: R("input"),
|
|
4902
4902
|
input: B
|
|
4903
|
-
})]),
|
|
4904
|
-
...
|
|
4903
|
+
})]), Pc = F([Nc, P({ kind: R("model") })]), Fc = P({
|
|
4904
|
+
...Ac,
|
|
4905
4905
|
name: B,
|
|
4906
4906
|
executor: F([
|
|
4907
4907
|
P({
|
|
@@ -4917,7 +4917,7 @@ var vc = class {
|
|
|
4917
4917
|
kind: R("agent"),
|
|
4918
4918
|
code: Jo().optional(),
|
|
4919
4919
|
model: B,
|
|
4920
|
-
prompt:
|
|
4920
|
+
prompt: Nc,
|
|
4921
4921
|
system: B,
|
|
4922
4922
|
maxRounds: M(),
|
|
4923
4923
|
tools: N(P({
|
|
@@ -4927,17 +4927,17 @@ var vc = class {
|
|
|
4927
4927
|
action: B,
|
|
4928
4928
|
connectionId: B.optional(),
|
|
4929
4929
|
approval: Jo(),
|
|
4930
|
-
inputs: N(
|
|
4930
|
+
inputs: N(Cc.extend({ source: Pc }))
|
|
4931
4931
|
})),
|
|
4932
4932
|
notification: P({
|
|
4933
4933
|
taskId: B,
|
|
4934
4934
|
messageHandle: B,
|
|
4935
|
-
inputs: I(B,
|
|
4935
|
+
inputs: I(B, Nc)
|
|
4936
4936
|
}).optional()
|
|
4937
4937
|
})
|
|
4938
4938
|
])
|
|
4939
|
-
}),
|
|
4940
|
-
input:
|
|
4939
|
+
}), Ic = {
|
|
4940
|
+
input: Cc,
|
|
4941
4941
|
cases: N(P({
|
|
4942
4942
|
output: B,
|
|
4943
4943
|
relation: L(["all", "any"]),
|
|
@@ -4969,8 +4969,11 @@ var vc = class {
|
|
|
4969
4969
|
}))
|
|
4970
4970
|
})),
|
|
4971
4971
|
defaultOutput: B.optional()
|
|
4972
|
-
},
|
|
4973
|
-
|
|
4972
|
+
}, Lc = {
|
|
4973
|
+
inputDefinitions: N(Cc),
|
|
4974
|
+
prompt: B
|
|
4975
|
+
}, Rc = {
|
|
4976
|
+
bodyFields: N(Cc),
|
|
4974
4977
|
options: P({
|
|
4975
4978
|
allowedMethods: xc.optional(),
|
|
4976
4979
|
allowedOrigins: xc.optional(),
|
|
@@ -4979,7 +4982,7 @@ var vc = class {
|
|
|
4979
4982
|
responseHeaders: I(B, B).optional(),
|
|
4980
4983
|
responseStatusCode: M().optional()
|
|
4981
4984
|
}).optional()
|
|
4982
|
-
},
|
|
4985
|
+
}, zc = {
|
|
4983
4986
|
configSchema: bc,
|
|
4984
4987
|
definitionVersion: R(2),
|
|
4985
4988
|
description: B,
|
|
@@ -4988,7 +4991,7 @@ var vc = class {
|
|
|
4988
4991
|
name: B,
|
|
4989
4992
|
outputs: N(Sc).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
|
|
4990
4993
|
provider: B
|
|
4991
|
-
},
|
|
4994
|
+
}, Bc = P({
|
|
4992
4995
|
body: P({
|
|
4993
4996
|
allowArray: Jo(),
|
|
4994
4997
|
allowEmpty: Jo(),
|
|
@@ -5008,111 +5011,109 @@ var vc = class {
|
|
|
5008
5011
|
"PUT"
|
|
5009
5012
|
])),
|
|
5010
5013
|
successStatus: M()
|
|
5011
|
-
}),
|
|
5014
|
+
}), Vc = {
|
|
5012
5015
|
name: B,
|
|
5013
5016
|
description: B.optional(),
|
|
5014
5017
|
icon: B.optional()
|
|
5015
|
-
},
|
|
5018
|
+
}, Hc = {
|
|
5016
5019
|
maxExecutions: M().int().positive().max(2 ** 53 - 1).optional(),
|
|
5017
|
-
inputs:
|
|
5020
|
+
inputs: kc,
|
|
5018
5021
|
name: B.optional(),
|
|
5019
5022
|
description: B.optional(),
|
|
5020
5023
|
icon: B.optional(),
|
|
5021
5024
|
timeoutMs: M().optional()
|
|
5022
|
-
},
|
|
5025
|
+
}, Uc = F([
|
|
5023
5026
|
P({
|
|
5024
|
-
...
|
|
5027
|
+
...Hc,
|
|
5025
5028
|
kind: R("condition"),
|
|
5026
|
-
...
|
|
5029
|
+
...Ic
|
|
5027
5030
|
}),
|
|
5028
5031
|
P({
|
|
5029
|
-
...
|
|
5032
|
+
...Hc,
|
|
5030
5033
|
inputs: Qo().transform(() => ({})).default({}),
|
|
5031
5034
|
kind: R("value"),
|
|
5032
|
-
values: N(
|
|
5035
|
+
values: N(Cc)
|
|
5033
5036
|
}),
|
|
5034
5037
|
P({
|
|
5035
|
-
...
|
|
5038
|
+
...Hc,
|
|
5036
5039
|
kind: R("subflow"),
|
|
5037
5040
|
subflowId: B
|
|
5038
5041
|
}),
|
|
5039
5042
|
P({
|
|
5040
|
-
...
|
|
5043
|
+
...Hc,
|
|
5041
5044
|
kind: R("task"),
|
|
5042
|
-
task:
|
|
5043
|
-
additionalInputs: N(
|
|
5045
|
+
task: Mc,
|
|
5046
|
+
additionalInputs: N(Cc).optional()
|
|
5044
5047
|
}),
|
|
5045
5048
|
P({
|
|
5046
|
-
...
|
|
5049
|
+
...Hc,
|
|
5047
5050
|
kind: R("task"),
|
|
5048
5051
|
taskId: B,
|
|
5049
|
-
additionalInputs: N(
|
|
5052
|
+
additionalInputs: N(Cc).optional()
|
|
5050
5053
|
}),
|
|
5051
5054
|
rs({
|
|
5052
|
-
...
|
|
5055
|
+
...Hc,
|
|
5053
5056
|
kind: R("approval"),
|
|
5054
|
-
|
|
5055
|
-
...Ic
|
|
5057
|
+
...Lc
|
|
5056
5058
|
}).omit({ timeoutMs: !0 }),
|
|
5057
5059
|
rs({
|
|
5058
|
-
...
|
|
5060
|
+
...Hc,
|
|
5059
5061
|
kind: R("wait"),
|
|
5060
|
-
|
|
5061
|
-
...Ic
|
|
5062
|
+
...Lc
|
|
5062
5063
|
}).omit({ timeoutMs: !0 }),
|
|
5063
5064
|
P({
|
|
5064
|
-
...
|
|
5065
|
+
...Vc,
|
|
5065
5066
|
kind: R("manual")
|
|
5066
5067
|
}),
|
|
5067
5068
|
P({
|
|
5068
|
-
...
|
|
5069
|
+
...Vc,
|
|
5069
5070
|
kind: R("webhook"),
|
|
5070
|
-
...
|
|
5071
|
+
...Rc
|
|
5071
5072
|
}),
|
|
5072
5073
|
P({
|
|
5073
|
-
...
|
|
5074
|
+
...Vc,
|
|
5074
5075
|
kind: R("cron"),
|
|
5075
5076
|
cronTimes: yc
|
|
5076
5077
|
}),
|
|
5077
5078
|
P({
|
|
5078
|
-
...
|
|
5079
|
+
...Vc,
|
|
5079
5080
|
kind: R("poll"),
|
|
5080
5081
|
bindingId: B,
|
|
5081
5082
|
config: I(B, bc),
|
|
5082
5083
|
definition: P({
|
|
5083
|
-
...
|
|
5084
|
+
...zc,
|
|
5084
5085
|
type: R("poll")
|
|
5085
5086
|
}),
|
|
5086
5087
|
pollTimes: yc
|
|
5087
5088
|
}),
|
|
5088
5089
|
P({
|
|
5089
|
-
...
|
|
5090
|
+
...Vc,
|
|
5090
5091
|
kind: R("integration"),
|
|
5091
5092
|
bindingId: B,
|
|
5092
5093
|
config: I(B, bc),
|
|
5093
5094
|
definition: P({
|
|
5094
|
-
...
|
|
5095
|
+
...zc,
|
|
5095
5096
|
type: R("integration"),
|
|
5096
|
-
endpoint:
|
|
5097
|
+
endpoint: Bc
|
|
5097
5098
|
})
|
|
5098
5099
|
})
|
|
5099
|
-
]),
|
|
5100
|
+
]), Wc = F([P({ kind: R("flow") }), P({
|
|
5100
5101
|
kind: R("subflow"),
|
|
5101
5102
|
id: B
|
|
5102
|
-
})]),
|
|
5103
|
+
})]), Gc = P({
|
|
5103
5104
|
source: B,
|
|
5104
5105
|
target: B,
|
|
5105
5106
|
sourceHandle: B.optional()
|
|
5106
|
-
}),
|
|
5107
|
+
}), V = {
|
|
5107
5108
|
nodeId: B,
|
|
5108
|
-
target:
|
|
5109
|
+
target: Wc
|
|
5109
5110
|
}, Kc = P({
|
|
5110
5111
|
name: B,
|
|
5111
|
-
inputs: N(
|
|
5112
|
-
outputs: N(Sc.extend({ sources: N(F([
|
|
5112
|
+
inputs: N(Cc),
|
|
5113
|
+
outputs: N(Sc.extend({ sources: N(F([Tc, Ec])) }))
|
|
5113
5114
|
}), qc = P({
|
|
5114
|
-
nodes: I(B,
|
|
5115
|
-
edges: N(
|
|
5115
|
+
nodes: I(B, Uc),
|
|
5116
|
+
edges: N(Gc).default([])
|
|
5116
5117
|
}), Jc = P({
|
|
5117
5118
|
kind: L(["connection", "variable"]),
|
|
5118
5119
|
target: B
|
|
@@ -5124,17 +5125,17 @@ var vc = class {
|
|
|
5124
5125
|
bindings: I(B, Jc),
|
|
5125
5126
|
graph: qc,
|
|
5126
5127
|
subflows: I(B, Kc.extend({ graph: qc })),
|
|
5127
|
-
tasks: I(B,
|
|
5128
|
-
})
|
|
5128
|
+
tasks: I(B, Fc)
|
|
5129
|
+
});
|
|
5130
|
+
P({
|
|
5129
5131
|
modelVersion: F([R(2), R(3)]),
|
|
5130
5132
|
document: Xc,
|
|
5131
5133
|
modules: I(B, Yc)
|
|
5132
|
-
})
|
|
5133
|
-
Zc.extend({ modelVersion: R(3) }), Zc.extend({
|
|
5134
|
+
}).extend({
|
|
5134
5135
|
kind: R("open-flow-flow-revision"),
|
|
5135
5136
|
version: R(1)
|
|
5136
5137
|
});
|
|
5137
|
-
var
|
|
5138
|
+
var Zc = {
|
|
5138
5139
|
"binding.create": {
|
|
5139
5140
|
bindingId: B,
|
|
5140
5141
|
binding: Jc
|
|
@@ -5146,21 +5147,21 @@ var Qc = {
|
|
|
5146
5147
|
value: B
|
|
5147
5148
|
},
|
|
5148
5149
|
"graph.edge.connect": {
|
|
5149
|
-
target:
|
|
5150
|
-
edge:
|
|
5150
|
+
target: Wc,
|
|
5151
|
+
edge: Gc
|
|
5151
5152
|
},
|
|
5152
5153
|
"graph.edge.disconnect": {
|
|
5153
|
-
target:
|
|
5154
|
-
edge:
|
|
5154
|
+
target: Wc,
|
|
5155
|
+
edge: Gc
|
|
5155
5156
|
},
|
|
5156
5157
|
"graph.node.create": {
|
|
5157
|
-
...
|
|
5158
|
-
node:
|
|
5158
|
+
...V,
|
|
5159
|
+
node: Uc
|
|
5159
5160
|
},
|
|
5160
|
-
"graph.node.delete":
|
|
5161
|
+
"graph.node.delete": V,
|
|
5161
5162
|
"graph.node.field.set": F([
|
|
5162
5163
|
P({
|
|
5163
|
-
...
|
|
5164
|
+
...V,
|
|
5164
5165
|
kind: R("graph.node.field.set"),
|
|
5165
5166
|
field: L([
|
|
5166
5167
|
"description",
|
|
@@ -5171,14 +5172,14 @@ var Qc = {
|
|
|
5171
5172
|
value: B.optional()
|
|
5172
5173
|
}),
|
|
5173
5174
|
P({
|
|
5174
|
-
...
|
|
5175
|
+
...V,
|
|
5175
5176
|
kind: R("graph.node.field.set"),
|
|
5176
5177
|
field: R("maxExecutions"),
|
|
5177
5178
|
before: M().int().positive().max(2 ** 53 - 1).optional(),
|
|
5178
5179
|
value: M().int().positive().max(2 ** 53 - 1).optional()
|
|
5179
5180
|
}),
|
|
5180
5181
|
P({
|
|
5181
|
-
...
|
|
5182
|
+
...V,
|
|
5182
5183
|
kind: R("graph.node.field.set"),
|
|
5183
5184
|
field: R("timeoutMs"),
|
|
5184
5185
|
before: M().optional(),
|
|
@@ -5186,52 +5187,52 @@ var Qc = {
|
|
|
5186
5187
|
})
|
|
5187
5188
|
]),
|
|
5188
5189
|
"graph.node.input.set": {
|
|
5189
|
-
...
|
|
5190
|
+
...V,
|
|
5190
5191
|
handle: B,
|
|
5191
|
-
before:
|
|
5192
|
-
value:
|
|
5192
|
+
before: Oc.optional(),
|
|
5193
|
+
value: Oc.optional()
|
|
5193
5194
|
},
|
|
5194
5195
|
"graph.node.additional-inputs.set": {
|
|
5195
|
-
...
|
|
5196
|
-
before: N(
|
|
5197
|
-
value: N(
|
|
5196
|
+
...V,
|
|
5197
|
+
before: N(Cc).optional(),
|
|
5198
|
+
value: N(Cc).optional()
|
|
5198
5199
|
},
|
|
5199
5200
|
"graph.node.condition.set": {
|
|
5200
|
-
...
|
|
5201
|
-
before: P(
|
|
5202
|
-
value: P(
|
|
5201
|
+
...V,
|
|
5202
|
+
before: P(Ic),
|
|
5203
|
+
value: P(Ic)
|
|
5203
5204
|
},
|
|
5204
5205
|
"graph.node.values.set": {
|
|
5205
|
-
...
|
|
5206
|
-
before: N(
|
|
5207
|
-
value: N(
|
|
5206
|
+
...V,
|
|
5207
|
+
before: N(Cc),
|
|
5208
|
+
value: N(Cc)
|
|
5208
5209
|
},
|
|
5209
5210
|
"graph.node.resolution.set": {
|
|
5210
|
-
...
|
|
5211
|
+
...V,
|
|
5211
5212
|
target: P({ kind: R("flow") }),
|
|
5212
|
-
before: P(
|
|
5213
|
-
value: P(
|
|
5213
|
+
before: P(Lc),
|
|
5214
|
+
value: P(Lc)
|
|
5214
5215
|
},
|
|
5215
5216
|
"graph.node.webhook.set": {
|
|
5216
|
-
...
|
|
5217
|
+
...V,
|
|
5217
5218
|
target: P({ kind: R("flow") }),
|
|
5218
|
-
before: P(
|
|
5219
|
-
value: P(
|
|
5219
|
+
before: P(Rc),
|
|
5220
|
+
value: P(Rc)
|
|
5220
5221
|
},
|
|
5221
5222
|
"graph.node.task.ports.set": {
|
|
5222
|
-
...
|
|
5223
|
-
before: P(
|
|
5224
|
-
value: P(
|
|
5223
|
+
...V,
|
|
5224
|
+
before: P(Ac),
|
|
5225
|
+
value: P(Ac)
|
|
5225
5226
|
},
|
|
5226
5227
|
"graph.node.task.name.set": {
|
|
5227
|
-
...
|
|
5228
|
+
...V,
|
|
5228
5229
|
before: B,
|
|
5229
5230
|
value: B
|
|
5230
5231
|
},
|
|
5231
5232
|
"graph.node.task.capabilities.set": {
|
|
5232
|
-
...
|
|
5233
|
-
before: N(
|
|
5234
|
-
value: N(
|
|
5233
|
+
...V,
|
|
5234
|
+
before: N(jc).optional(),
|
|
5235
|
+
value: N(jc).optional()
|
|
5235
5236
|
},
|
|
5236
5237
|
"graph.trigger.config.set": {
|
|
5237
5238
|
nodeId: B,
|
|
@@ -5273,7 +5274,7 @@ var Qc = {
|
|
|
5273
5274
|
"subflow.delete": { subflowId: B },
|
|
5274
5275
|
"task.create": {
|
|
5275
5276
|
taskId: B,
|
|
5276
|
-
task:
|
|
5277
|
+
task: Fc
|
|
5277
5278
|
},
|
|
5278
5279
|
"task.delete": { taskId: B },
|
|
5279
5280
|
"task.connector.connection.set": {
|
|
@@ -5283,8 +5284,8 @@ var Qc = {
|
|
|
5283
5284
|
},
|
|
5284
5285
|
"task.agent.set": {
|
|
5285
5286
|
taskId: B,
|
|
5286
|
-
before:
|
|
5287
|
-
value:
|
|
5287
|
+
before: Fc,
|
|
5288
|
+
value: Fc
|
|
5288
5289
|
},
|
|
5289
5290
|
"task.llm.mode.set": {
|
|
5290
5291
|
taskId: B,
|
|
@@ -5297,56 +5298,56 @@ var Qc = {
|
|
|
5297
5298
|
value: B
|
|
5298
5299
|
}
|
|
5299
5300
|
};
|
|
5300
|
-
N(F([...new Map(Object.entries(
|
|
5301
|
+
N(F([...new Map(Object.entries(Zc).map(([e, t]) => [e, t instanceof k ? t : P({
|
|
5301
5302
|
kind: R(e),
|
|
5302
5303
|
...t
|
|
5303
5304
|
})])).values()])).min(1);
|
|
5304
5305
|
//#endregion
|
|
5305
5306
|
//#region src/flow/common/change.ts
|
|
5306
|
-
function
|
|
5307
|
+
function Qc(e) {
|
|
5307
5308
|
return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
|
|
5308
5309
|
}
|
|
5309
5310
|
//#endregion
|
|
5310
5311
|
//#region src/json-schema-subset/utils.ts
|
|
5311
|
-
var
|
|
5312
|
-
function
|
|
5313
|
-
let e =
|
|
5314
|
-
return
|
|
5312
|
+
var $c = 0;
|
|
5313
|
+
function el() {
|
|
5314
|
+
let e = $c;
|
|
5315
|
+
return $c += 1, e;
|
|
5315
5316
|
}
|
|
5316
|
-
function
|
|
5317
|
+
function tl(e) {
|
|
5317
5318
|
if (typeof e == "object" && e && !Object.isFrozen(e)) {
|
|
5318
|
-
for (let t of Object.getOwnPropertyNames(e))
|
|
5319
|
+
for (let t of Object.getOwnPropertyNames(e)) tl(Reflect.get(e, t));
|
|
5319
5320
|
Object.freeze(e);
|
|
5320
5321
|
}
|
|
5321
5322
|
return e;
|
|
5322
5323
|
}
|
|
5323
|
-
function
|
|
5324
|
+
function nl(e, t) {
|
|
5324
5325
|
let n = {};
|
|
5325
5326
|
for (let r of t) r in e && (n[r] = e[r]);
|
|
5326
5327
|
return n;
|
|
5327
5328
|
}
|
|
5328
|
-
function
|
|
5329
|
+
function rl(e) {
|
|
5329
5330
|
if (typeof e != "object" || !e) return e;
|
|
5330
5331
|
if (Array.isArray(e)) {
|
|
5331
5332
|
let t = [];
|
|
5332
|
-
for (let [n, r] of e.entries()) t[n] =
|
|
5333
|
+
for (let [n, r] of e.entries()) t[n] = rl(r);
|
|
5333
5334
|
return t;
|
|
5334
5335
|
}
|
|
5335
5336
|
{
|
|
5336
5337
|
let t = {};
|
|
5337
|
-
for (let n in e) t[n] =
|
|
5338
|
+
for (let n in e) t[n] = rl(e[n]);
|
|
5338
5339
|
return t;
|
|
5339
5340
|
}
|
|
5340
5341
|
}
|
|
5341
|
-
function
|
|
5342
|
+
function il(e, t) {
|
|
5342
5343
|
if (e === t) return !0;
|
|
5343
5344
|
if (typeof e != "object" || !e || typeof e != typeof t) return !1;
|
|
5344
5345
|
if (Array.isArray(e)) {
|
|
5345
5346
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
5346
|
-
for (let [n, r] of e.entries()) if (!
|
|
5347
|
+
for (let [n, r] of e.entries()) if (!il(r, t[n])) return !1;
|
|
5347
5348
|
} else {
|
|
5348
5349
|
if (Array.isArray(t)) return !1;
|
|
5349
|
-
for (let n in e) if (!(n in t) || !
|
|
5350
|
+
for (let n in e) if (!(n in t) || !il(e[n], t[n])) return !1;
|
|
5350
5351
|
for (let n in t) if (!(n in e)) return !1;
|
|
5351
5352
|
}
|
|
5352
5353
|
return !0;
|
|
@@ -5359,48 +5360,48 @@ var H = Object.freeze({
|
|
|
5359
5360
|
ContainedBy: 2,
|
|
5360
5361
|
Rejection: 3,
|
|
5361
5362
|
Intersection: 4
|
|
5362
|
-
}), U =
|
|
5363
|
+
}), U = fl(H.Equals), W = fl(H.Containing), G = fl(H.ContainedBy), K = fl(H.Rejection), q = fl(H.Intersection), al = tl([
|
|
5363
5364
|
[H.Equals, U],
|
|
5364
5365
|
[H.Containing, W],
|
|
5365
5366
|
[H.ContainedBy, G],
|
|
5366
5367
|
[H.Rejection, K],
|
|
5367
5368
|
[H.Intersection, q]
|
|
5368
|
-
]),
|
|
5369
|
+
]), ol = (() => {
|
|
5369
5370
|
let e = 0;
|
|
5370
|
-
for (let [t, n] of
|
|
5371
|
+
for (let [t, n] of al) e |= n;
|
|
5371
5372
|
return e;
|
|
5372
5373
|
})();
|
|
5373
|
-
function
|
|
5374
|
+
function sl(e) {
|
|
5374
5375
|
return !!(e & U);
|
|
5375
5376
|
}
|
|
5376
|
-
function
|
|
5377
|
+
function cl(e) {
|
|
5377
5378
|
return !!(e & W);
|
|
5378
5379
|
}
|
|
5379
|
-
function
|
|
5380
|
+
function ll(e) {
|
|
5380
5381
|
return !!(e & G);
|
|
5381
5382
|
}
|
|
5382
|
-
function
|
|
5383
|
+
function ul(e) {
|
|
5383
5384
|
return !!(e & K);
|
|
5384
5385
|
}
|
|
5385
|
-
function
|
|
5386
|
+
function dl(e) {
|
|
5386
5387
|
return !!(e & q);
|
|
5387
5388
|
}
|
|
5388
|
-
function
|
|
5389
|
+
function fl(e) {
|
|
5389
5390
|
return 1 << e;
|
|
5390
5391
|
}
|
|
5391
5392
|
//#endregion
|
|
5392
5393
|
//#region src/json-schema-subset/expression/combination.ts
|
|
5393
|
-
function
|
|
5394
|
-
let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r :
|
|
5394
|
+
function pl(e) {
|
|
5395
|
+
let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r : ml(t, r, e), n += 1, t) };
|
|
5395
5396
|
return Object.defineProperties(r, {
|
|
5396
5397
|
result: { get: () => t },
|
|
5397
5398
|
count: { get: () => n }
|
|
5398
5399
|
}), r;
|
|
5399
5400
|
}
|
|
5400
|
-
function
|
|
5401
|
+
function ml(e, t, n) {
|
|
5401
5402
|
let r = 0;
|
|
5402
|
-
for (let [i, a] of
|
|
5403
|
-
for (let [e, a] of
|
|
5403
|
+
for (let [i, a] of al) if (a & e) {
|
|
5404
|
+
for (let [e, a] of al) if (a & t && (r |= n(i, e), r === ol)) return r;
|
|
5404
5405
|
}
|
|
5405
5406
|
return r;
|
|
5406
5407
|
}
|
|
@@ -5414,59 +5415,59 @@ var J = Object.freeze({
|
|
|
5414
5415
|
Not: 4,
|
|
5415
5416
|
Swap: 5
|
|
5416
5417
|
});
|
|
5417
|
-
function
|
|
5418
|
+
function hl(e, t) {
|
|
5418
5419
|
switch (e) {
|
|
5419
5420
|
case J.Save: return t[0];
|
|
5420
|
-
case J.OneOf: return
|
|
5421
|
+
case J.OneOf: return _l(t);
|
|
5421
5422
|
case J.AllOf:
|
|
5422
|
-
case J.AnyOf: return
|
|
5423
|
+
case J.AnyOf: return vl(e, t);
|
|
5423
5424
|
case J.Not:
|
|
5424
|
-
case J.Swap: return
|
|
5425
|
+
case J.Swap: return yl(e, t[0]);
|
|
5425
5426
|
}
|
|
5426
5427
|
}
|
|
5427
|
-
function
|
|
5428
|
-
return
|
|
5428
|
+
function gl(e) {
|
|
5429
|
+
return yl(J.Swap, e);
|
|
5429
5430
|
}
|
|
5430
|
-
function
|
|
5431
|
+
function _l(e) {
|
|
5431
5432
|
if (e.length === 1) return e[0];
|
|
5432
|
-
let t =
|
|
5433
|
+
let t = vl(J.AnyOf, e), n = [];
|
|
5433
5434
|
for (let t = 0; t < e.length; ++t) for (let r = t + 1; r < e.length; ++r) {
|
|
5434
|
-
let i = e[t], a = e[r], o =
|
|
5435
|
+
let i = e[t], a = e[r], o = vl(J.AllOf, [i, a]);
|
|
5435
5436
|
n.push(o);
|
|
5436
5437
|
}
|
|
5437
|
-
let r =
|
|
5438
|
-
return
|
|
5438
|
+
let r = vl(J.AnyOf, n), i = yl(J.Not, r);
|
|
5439
|
+
return vl(J.AllOf, [t, i]);
|
|
5439
5440
|
}
|
|
5440
|
-
function
|
|
5441
|
+
function vl(e, t) {
|
|
5441
5442
|
if (t.length < 0) throw Error("invalid expressions: empty array");
|
|
5442
5443
|
let n;
|
|
5443
5444
|
switch (e) {
|
|
5444
5445
|
case J.AllOf:
|
|
5445
|
-
n =
|
|
5446
|
+
n = pl(bl);
|
|
5446
5447
|
break;
|
|
5447
5448
|
case J.AnyOf:
|
|
5448
|
-
n =
|
|
5449
|
+
n = pl(xl);
|
|
5449
5450
|
break;
|
|
5450
5451
|
default: throw Error(`invalid operator ${e}`);
|
|
5451
5452
|
}
|
|
5452
5453
|
for (let e of t) n.push(e);
|
|
5453
5454
|
return n.result;
|
|
5454
5455
|
}
|
|
5455
|
-
function
|
|
5456
|
+
function yl(e, t) {
|
|
5456
5457
|
let n, r = 0;
|
|
5457
5458
|
switch (e) {
|
|
5458
5459
|
case J.Not:
|
|
5459
|
-
n =
|
|
5460
|
+
n = Sl;
|
|
5460
5461
|
break;
|
|
5461
5462
|
case J.Swap:
|
|
5462
|
-
n =
|
|
5463
|
+
n = Cl;
|
|
5463
5464
|
break;
|
|
5464
5465
|
default: throw Error(`invalid operator ${e}`);
|
|
5465
5466
|
}
|
|
5466
|
-
for (let [e, i] of
|
|
5467
|
+
for (let [e, i] of al) i & t && (r |= n(e));
|
|
5467
5468
|
return r;
|
|
5468
5469
|
}
|
|
5469
|
-
function
|
|
5470
|
+
function bl(e, t) {
|
|
5470
5471
|
let n = 0;
|
|
5471
5472
|
switch (e) {
|
|
5472
5473
|
case H.Equals:
|
|
@@ -5555,7 +5556,7 @@ function xl(e, t) {
|
|
|
5555
5556
|
}
|
|
5556
5557
|
return n;
|
|
5557
5558
|
}
|
|
5558
|
-
function
|
|
5559
|
+
function xl(e, t) {
|
|
5559
5560
|
let n = 0;
|
|
5560
5561
|
switch (e) {
|
|
5561
5562
|
case H.Equals:
|
|
@@ -5644,7 +5645,7 @@ function Sl(e, t) {
|
|
|
5644
5645
|
}
|
|
5645
5646
|
return n;
|
|
5646
5647
|
}
|
|
5647
|
-
function
|
|
5648
|
+
function Sl(e) {
|
|
5648
5649
|
let t = 0;
|
|
5649
5650
|
switch (e) {
|
|
5650
5651
|
case H.Equals:
|
|
@@ -5663,7 +5664,7 @@ function Cl(e) {
|
|
|
5663
5664
|
}
|
|
5664
5665
|
return t;
|
|
5665
5666
|
}
|
|
5666
|
-
function
|
|
5667
|
+
function Cl(e) {
|
|
5667
5668
|
let t = 0;
|
|
5668
5669
|
switch (e) {
|
|
5669
5670
|
case H.Equals:
|
|
@@ -5684,13 +5685,13 @@ function wl(e) {
|
|
|
5684
5685
|
}
|
|
5685
5686
|
//#endregion
|
|
5686
5687
|
//#region src/json-schema-subset/expression/types.ts
|
|
5687
|
-
var
|
|
5688
|
+
var wl = Object.freeze({
|
|
5688
5689
|
Leaf: 0,
|
|
5689
5690
|
Not: 1,
|
|
5690
5691
|
AllOf: 2,
|
|
5691
5692
|
AnyOf: 3,
|
|
5692
5693
|
OneOf: 4
|
|
5693
|
-
}),
|
|
5694
|
+
}), Tl = (e) => (t, n) => {
|
|
5694
5695
|
let r = {
|
|
5695
5696
|
parent: null,
|
|
5696
5697
|
swapped: !1,
|
|
@@ -5718,7 +5719,7 @@ var Tl = Object.freeze({
|
|
|
5718
5719
|
let n = U, [r, o] = t.expressions;
|
|
5719
5720
|
if (!e.equals(r, o)) {
|
|
5720
5721
|
let a = e.describe(r);
|
|
5721
|
-
if (a.kind !==
|
|
5722
|
+
if (a.kind !== wl.Leaf) {
|
|
5722
5723
|
let [e, n] = s(a, !1);
|
|
5723
5724
|
t.expressions = null, t.calculation = e;
|
|
5724
5725
|
for (let [e, r] of n.entries()) i.push({
|
|
@@ -5733,7 +5734,7 @@ var Tl = Object.freeze({
|
|
|
5733
5734
|
return;
|
|
5734
5735
|
}
|
|
5735
5736
|
let c = e.describe(o);
|
|
5736
|
-
if (c.kind !==
|
|
5737
|
+
if (c.kind !== wl.Leaf) {
|
|
5737
5738
|
let [e, n] = s(c, !0);
|
|
5738
5739
|
t.expressions = null, t.calculation = e;
|
|
5739
5740
|
for (let [e, a] of n.entries()) i.push({
|
|
@@ -5759,16 +5760,16 @@ var Tl = Object.freeze({
|
|
|
5759
5760
|
function s(e, t) {
|
|
5760
5761
|
let n = J.Save, r;
|
|
5761
5762
|
switch (e.kind) {
|
|
5762
|
-
case
|
|
5763
|
+
case wl.Not:
|
|
5763
5764
|
n = J.Not, r = [e.expression];
|
|
5764
5765
|
break;
|
|
5765
|
-
case
|
|
5766
|
+
case wl.AllOf:
|
|
5766
5767
|
n = J.AllOf, r = [...e.expressions];
|
|
5767
5768
|
break;
|
|
5768
|
-
case
|
|
5769
|
+
case wl.AnyOf:
|
|
5769
5770
|
n = J.AnyOf, r = [...e.expressions];
|
|
5770
5771
|
break;
|
|
5771
|
-
case
|
|
5772
|
+
case wl.OneOf:
|
|
5772
5773
|
n = J.OneOf, r = [...e.expressions];
|
|
5773
5774
|
break;
|
|
5774
5775
|
default: throw Error(`invalid kind ${e.kind}`);
|
|
@@ -5781,8 +5782,8 @@ var Tl = Object.freeze({
|
|
|
5781
5782
|
}, r];
|
|
5782
5783
|
}
|
|
5783
5784
|
function c(e) {
|
|
5784
|
-
let t = e.calculation, n = e.parent, r =
|
|
5785
|
-
if (r === 0 && (r = G), t.willSwap && (r =
|
|
5785
|
+
let t = e.calculation, n = e.parent, r = hl(t.operator, t.results);
|
|
5786
|
+
if (r === 0 && (r = G), t.willSwap && (r = gl(r)), n) {
|
|
5786
5787
|
let e = n.node.calculation, t = e.results;
|
|
5787
5788
|
t[n.index] = r, e.count += 1, e.count >= t.length && a.push(n.node);
|
|
5788
5789
|
}
|
|
@@ -5790,79 +5791,79 @@ var Tl = Object.freeze({
|
|
|
5790
5791
|
let l = r.calculation.results[0];
|
|
5791
5792
|
if (l === 0) throw Error("cannot find result of root");
|
|
5792
5793
|
return l;
|
|
5793
|
-
},
|
|
5794
|
+
}, El = class extends Error {
|
|
5794
5795
|
constructor(e = []) {
|
|
5795
|
-
super(
|
|
5796
|
+
super(kl(e)), this.name = "SchemaError", this.items = e;
|
|
5796
5797
|
}
|
|
5797
|
-
},
|
|
5798
|
+
}, Dl = Object.freeze({
|
|
5798
5799
|
Compiled: 0,
|
|
5799
5800
|
External: 1
|
|
5800
5801
|
});
|
|
5801
|
-
function
|
|
5802
|
+
function Ol(e) {
|
|
5802
5803
|
switch (e.kind) {
|
|
5803
|
-
case
|
|
5804
|
+
case Dl.Compiled: {
|
|
5804
5805
|
let { message: t, path: n } = e;
|
|
5805
5806
|
return `${t} (at ${n.length > 0 ? n.join(".") : "$root"})`;
|
|
5806
5807
|
}
|
|
5807
|
-
case
|
|
5808
|
+
case Dl.External: return String(e.error);
|
|
5808
5809
|
}
|
|
5809
5810
|
}
|
|
5810
|
-
function
|
|
5811
|
+
function kl(e) {
|
|
5811
5812
|
switch (e.length) {
|
|
5812
5813
|
case 0: return "without any items";
|
|
5813
|
-
case 1: return
|
|
5814
|
-
default: return `${
|
|
5814
|
+
case 1: return Ol(e[0]);
|
|
5815
|
+
default: return `${Ol(e[0])} ... omit the rest ${e.length - 1} items`;
|
|
5815
5816
|
}
|
|
5816
5817
|
}
|
|
5817
5818
|
//#endregion
|
|
5818
5819
|
//#region src/json-schema-subset/compiler/common.ts
|
|
5819
|
-
var
|
|
5820
|
-
function
|
|
5821
|
-
return
|
|
5820
|
+
var Al = /* @__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("."));
|
|
5821
|
+
function jl(e) {
|
|
5822
|
+
return Al.has(e);
|
|
5822
5823
|
}
|
|
5823
|
-
function
|
|
5824
|
-
for (let t in e) if (
|
|
5824
|
+
function Ml(e) {
|
|
5825
|
+
for (let t in e) if (jl(t)) return !1;
|
|
5825
5826
|
return !0;
|
|
5826
5827
|
}
|
|
5827
|
-
function
|
|
5828
|
+
function Nl(e, ...t) {
|
|
5828
5829
|
return {
|
|
5829
5830
|
...e,
|
|
5830
5831
|
path: [...e.path, ...t]
|
|
5831
5832
|
};
|
|
5832
5833
|
}
|
|
5833
|
-
function
|
|
5834
|
+
function Pl(e) {
|
|
5834
5835
|
if (typeof e == "boolean") throw Error("JSONSchema7Definition cannot be boolean");
|
|
5835
5836
|
return e;
|
|
5836
5837
|
}
|
|
5837
|
-
function
|
|
5838
|
-
t.push(
|
|
5838
|
+
function Fl({ path: e, errors: t }, n, ...r) {
|
|
5839
|
+
t.push(Il(e, r, n));
|
|
5839
5840
|
}
|
|
5840
5841
|
function Y({ path: e, warns: t }, n, ...r) {
|
|
5841
|
-
t.push(
|
|
5842
|
+
t.push(Il(e, r, n));
|
|
5842
5843
|
}
|
|
5843
|
-
function
|
|
5844
|
+
function Il(e, t, n) {
|
|
5844
5845
|
return {
|
|
5845
|
-
kind:
|
|
5846
|
+
kind: Dl.Compiled,
|
|
5846
5847
|
message: n,
|
|
5847
5848
|
path: [...e, ...t]
|
|
5848
5849
|
};
|
|
5849
5850
|
}
|
|
5850
5851
|
//#endregion
|
|
5851
5852
|
//#region src/json-schema-subset/compiler/utils.ts
|
|
5852
|
-
function
|
|
5853
|
+
function Ll(e) {
|
|
5853
5854
|
for (let t in e) {
|
|
5854
5855
|
let n = e[t];
|
|
5855
|
-
n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] :
|
|
5856
|
+
n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] : Rl(n) && delete e[t]);
|
|
5856
5857
|
}
|
|
5857
5858
|
return e;
|
|
5858
5859
|
}
|
|
5859
|
-
function
|
|
5860
|
+
function Rl(e) {
|
|
5860
5861
|
for (let t in e) return !1;
|
|
5861
5862
|
return !0;
|
|
5862
5863
|
}
|
|
5863
5864
|
//#endregion
|
|
5864
5865
|
//#region src/json-schema-subset/compiler/wrapper.ts
|
|
5865
|
-
var
|
|
5866
|
+
var zl = Symbol("compiledId"), Bl = Symbol("compiledKind"), Vl = Symbol("compiledPath"), Hl = Symbol("validatorLoader"), X = Object.freeze({
|
|
5866
5867
|
Extends: 0,
|
|
5867
5868
|
Never: 1,
|
|
5868
5869
|
Any: 2,
|
|
@@ -5875,62 +5876,62 @@ var Bl = Symbol("compiledId"), Vl = Symbol("compiledKind"), Hl = Symbol("compile
|
|
|
5875
5876
|
Not: 9,
|
|
5876
5877
|
Combination: 10,
|
|
5877
5878
|
EnumOrConst: 11
|
|
5878
|
-
}),
|
|
5879
|
+
}), Ul = tl(Zl(X.Any, el(), {}, () => () => !0)), Wl = tl(Zl(X.Never, el(), {
|
|
5879
5880
|
type: "string",
|
|
5880
5881
|
maxLength: 0,
|
|
5881
5882
|
minLength: 1
|
|
5882
5883
|
}, () => () => !1));
|
|
5883
|
-
function
|
|
5884
|
-
return typeof e != "object" || !e ? !1 :
|
|
5884
|
+
function Gl(e) {
|
|
5885
|
+
return typeof e != "object" || !e ? !1 : zl in e;
|
|
5885
5886
|
}
|
|
5886
|
-
function
|
|
5887
|
-
return typeof e != "object" || !e ? !1 :
|
|
5887
|
+
function Kl(e) {
|
|
5888
|
+
return typeof e != "object" || !e ? !1 : zl in e && Bl in e;
|
|
5888
5889
|
}
|
|
5889
5890
|
function Z(e) {
|
|
5890
|
-
return
|
|
5891
|
+
return Kl(e) ? e[Bl] : X.Extends;
|
|
5892
|
+
}
|
|
5893
|
+
function ql(e) {
|
|
5894
|
+
return Kl(e) || Gl(e) ? e[zl] : e.id;
|
|
5891
5895
|
}
|
|
5892
5896
|
function Jl(e) {
|
|
5893
|
-
return
|
|
5897
|
+
return Kl(e) ? e[Vl] : void 0;
|
|
5894
5898
|
}
|
|
5895
5899
|
function Yl(e) {
|
|
5896
|
-
return
|
|
5897
|
-
|
|
5898
|
-
function Xl(e) {
|
|
5899
|
-
return typeof e != "object" || !e || Object.defineProperty(e, Bl, {
|
|
5900
|
-
value: tl(),
|
|
5900
|
+
return typeof e != "object" || !e || Object.defineProperty(e, zl, {
|
|
5901
|
+
value: el(),
|
|
5901
5902
|
configurable: !1,
|
|
5902
5903
|
writable: !1,
|
|
5903
5904
|
enumerable: !1
|
|
5904
5905
|
}), e;
|
|
5905
5906
|
}
|
|
5906
5907
|
function Q(e, t, n, r = []) {
|
|
5907
|
-
return
|
|
5908
|
+
return Zl(e, el(), t, n && (() => n.compile(t)), r);
|
|
5908
5909
|
}
|
|
5909
|
-
function
|
|
5910
|
-
return
|
|
5910
|
+
function Xl(e) {
|
|
5911
|
+
return Zl(X.Never, el(), { ...e }, e[Hl], e[Vl]);
|
|
5911
5912
|
}
|
|
5912
|
-
function
|
|
5913
|
+
function Zl(e, t, n, r, i = []) {
|
|
5913
5914
|
let a = null;
|
|
5914
5915
|
return Object.defineProperties(n, {
|
|
5915
|
-
[
|
|
5916
|
+
[Bl]: {
|
|
5916
5917
|
value: e,
|
|
5917
5918
|
configurable: !1,
|
|
5918
5919
|
writable: !1,
|
|
5919
5920
|
enumerable: !1
|
|
5920
5921
|
},
|
|
5921
|
-
[
|
|
5922
|
+
[zl]: {
|
|
5922
5923
|
value: t,
|
|
5923
5924
|
configurable: !1,
|
|
5924
5925
|
writable: !1,
|
|
5925
5926
|
enumerable: !1
|
|
5926
5927
|
},
|
|
5927
|
-
[
|
|
5928
|
+
[Vl]: {
|
|
5928
5929
|
value: i,
|
|
5929
5930
|
configurable: !1,
|
|
5930
5931
|
writable: !1,
|
|
5931
5932
|
enumerable: !1
|
|
5932
5933
|
},
|
|
5933
|
-
[
|
|
5934
|
+
[Hl]: {
|
|
5934
5935
|
value: r,
|
|
5935
5936
|
configurable: !1,
|
|
5936
5937
|
writable: !1,
|
|
@@ -5947,16 +5948,16 @@ function Ql(e, t, n, r, i = []) {
|
|
|
5947
5948
|
}
|
|
5948
5949
|
//#endregion
|
|
5949
5950
|
//#region src/json-schema-subset/compiler/array.ts
|
|
5950
|
-
function
|
|
5951
|
-
let n =
|
|
5952
|
-
if (Array.isArray(n) ? s =
|
|
5951
|
+
function Ql(e, t) {
|
|
5952
|
+
let n = $l(e, t), r = eu(e, "maxItems", t), i = eu(e, "minItems", t), a = tu(e, t), o = t.uniqueItems, s;
|
|
5953
|
+
if (Array.isArray(n) ? s = nu(e, t) : t.additionalItems && Y(e, "it is needless when items is not array", "additionalItems"), !n || !a || s === null) return null;
|
|
5953
5954
|
let c = !1, l = !1;
|
|
5954
5955
|
if (Array.isArray(n)) {
|
|
5955
|
-
r !== void 0 && r <= n.length && (n = n.splice(r), s =
|
|
5956
|
+
r !== void 0 && r <= n.length && (n = n.splice(r), s = ru(s, e.delegate));
|
|
5956
5957
|
let t = n.findIndex((e) => Z(e) === X.Never);
|
|
5957
|
-
t !== -1 && (n = n.splice(t), s =
|
|
5958
|
+
t !== -1 && (n = n.splice(t), s = ru(s, e.delegate), r === void 0 && (r = n.length, l = !0)), i !== void 0 && n.length < i && (Y(e, `length(${n.length}) of items if less than minItems(${i})`), c = !0), n.length === 0 && s && Z(s) === X.Never && (c = !0);
|
|
5958
5959
|
} else Z(n) === X.Never && (c = !0);
|
|
5959
|
-
return r !== void 0 && i !== void 0 && r < i && (l || Y(e, `maxItems(${r}) is less than minItems(${i})`), c = !0), Q(c ? X.Never : X.Array,
|
|
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, Ll({
|
|
5960
5961
|
type: "array",
|
|
5961
5962
|
items: n,
|
|
5962
5963
|
contains: a,
|
|
@@ -5966,12 +5967,12 @@ function $l(e, t) {
|
|
|
5966
5967
|
additionalItems: s
|
|
5967
5968
|
}), e.delegate, e.path);
|
|
5968
5969
|
}
|
|
5969
|
-
function
|
|
5970
|
+
function $l(e, { items: t }) {
|
|
5970
5971
|
if (!t) return Q(X.Any, {}, e.delegate, e.path);
|
|
5971
5972
|
if (Array.isArray(t)) {
|
|
5972
5973
|
let n = [], r = !1;
|
|
5973
5974
|
for (let [i, a] of t.entries()) {
|
|
5974
|
-
let t =
|
|
5975
|
+
let t = Lu(Nl(e, "items", i), Pl(a));
|
|
5975
5976
|
if (!t) {
|
|
5976
5977
|
r = !0;
|
|
5977
5978
|
continue;
|
|
@@ -5980,9 +5981,9 @@ function eu(e, { items: t }) {
|
|
|
5980
5981
|
}
|
|
5981
5982
|
return r ? null : n;
|
|
5982
5983
|
}
|
|
5983
|
-
return
|
|
5984
|
+
return Lu(Nl(e, "items"), Pl(t));
|
|
5984
5985
|
}
|
|
5985
|
-
function
|
|
5986
|
+
function eu(e, t, n) {
|
|
5986
5987
|
let r = n[t];
|
|
5987
5988
|
if (r !== void 0) {
|
|
5988
5989
|
if (Number.isNaN(r)) {
|
|
@@ -5996,35 +5997,35 @@ function tu(e, t, n) {
|
|
|
5996
5997
|
return r;
|
|
5997
5998
|
}
|
|
5998
5999
|
}
|
|
5999
|
-
function
|
|
6000
|
-
return t ?
|
|
6000
|
+
function tu(e, { contains: t }) {
|
|
6001
|
+
return t ? Lu(Nl(e, "contains"), Pl(t)) : Q(X.Any, {}, e.delegate, e.path);
|
|
6001
6002
|
}
|
|
6002
|
-
function
|
|
6003
|
+
function nu(e, { additionalItems: t }) {
|
|
6003
6004
|
switch (typeof t) {
|
|
6004
6005
|
case "boolean": return t ? Q(X.Any, {}, e.delegate, e.path) : !1;
|
|
6005
|
-
case "object": return
|
|
6006
|
+
case "object": return Lu(Nl(e, "additionalItems"), t);
|
|
6006
6007
|
default: return Q(X.Any, {}, e.delegate, e.path);
|
|
6007
6008
|
}
|
|
6008
6009
|
}
|
|
6009
|
-
function
|
|
6010
|
+
function ru(e, t) {
|
|
6010
6011
|
return e === void 0 ? Q(X.Never, {
|
|
6011
6012
|
type: "string",
|
|
6012
6013
|
maxLength: 0,
|
|
6013
6014
|
minLength: 1
|
|
6014
|
-
}, t) :
|
|
6015
|
+
}, t) : Kl(e) ? Z(e) === X.Never ? e : Xl(e) : e;
|
|
6015
6016
|
}
|
|
6016
6017
|
//#endregion
|
|
6017
6018
|
//#region src/json-schema-subset/compiler/combination.ts
|
|
6018
|
-
var
|
|
6019
|
+
var iu = Object.freeze([
|
|
6019
6020
|
"allOf",
|
|
6020
6021
|
"anyOf",
|
|
6021
6022
|
"oneOf"
|
|
6022
6023
|
]);
|
|
6023
|
-
function
|
|
6024
|
-
if (n.length === 0) return
|
|
6024
|
+
function au(e, t, n, r) {
|
|
6025
|
+
if (n.length === 0) return Fl(e, "disable empty list", t), null;
|
|
6025
6026
|
let i = [];
|
|
6026
6027
|
for (let [r, a] of n.entries()) {
|
|
6027
|
-
let n =
|
|
6028
|
+
let n = Lu(Nl(e, t, r), Pl(a));
|
|
6028
6029
|
n && i.push(n);
|
|
6029
6030
|
}
|
|
6030
6031
|
if (i.length < n.length) return null;
|
|
@@ -6038,7 +6039,7 @@ function ou(e, t, n, r) {
|
|
|
6038
6039
|
let s = X.Combination;
|
|
6039
6040
|
switch (t) {
|
|
6040
6041
|
case "allOf":
|
|
6041
|
-
o > 0 ? s = X.Never : a === i.length ? s = X.Any :
|
|
6042
|
+
o > 0 ? s = X.Never : a === i.length ? s = X.Any : ou(i) || (s = X.Never);
|
|
6042
6043
|
break;
|
|
6043
6044
|
case "anyOf":
|
|
6044
6045
|
a > 0 ? s = X.Any : o === i.length && (s = X.Never);
|
|
@@ -6047,7 +6048,7 @@ function ou(e, t, n, r) {
|
|
|
6047
6048
|
}
|
|
6048
6049
|
return Q(s, { [t]: i }, r, e.path);
|
|
6049
6050
|
}
|
|
6050
|
-
function
|
|
6051
|
+
function ou(e) {
|
|
6051
6052
|
let t = null;
|
|
6052
6053
|
for (let n of e) {
|
|
6053
6054
|
let e = Z(n);
|
|
@@ -6062,35 +6063,35 @@ function su(e) {
|
|
|
6062
6063
|
}
|
|
6063
6064
|
//#endregion
|
|
6064
6065
|
//#region src/json-schema-subset/checker/validator.ts
|
|
6065
|
-
var
|
|
6066
|
+
var su = Object.freeze({
|
|
6066
6067
|
Valid: 0,
|
|
6067
6068
|
Invalid: 1,
|
|
6068
6069
|
Unknown: 2
|
|
6069
6070
|
});
|
|
6070
|
-
function
|
|
6071
|
+
function cu(e, t) {
|
|
6071
6072
|
let n = e.isValid;
|
|
6072
|
-
return n ? n(t) === !0 ?
|
|
6073
|
+
return n ? n(t) === !0 ? su.Valid : su.Invalid : su.Unknown;
|
|
6073
6074
|
}
|
|
6074
6075
|
//#endregion
|
|
6075
6076
|
//#region src/json-schema-subset/compiler/enumAndConst.ts
|
|
6076
|
-
function
|
|
6077
|
+
function lu(e, t, n, r) {
|
|
6077
6078
|
let i, a = !1;
|
|
6078
6079
|
if (t) {
|
|
6079
|
-
if (t.length === 0) return
|
|
6080
|
+
if (t.length === 0) return Fl(e, "disable empty list", "enum"), null;
|
|
6080
6081
|
i = [];
|
|
6081
|
-
for (let [n, a] of t.entries()) switch (
|
|
6082
|
-
case
|
|
6083
|
-
i.push(
|
|
6082
|
+
for (let [n, a] of t.entries()) switch (cu(r, a)) {
|
|
6083
|
+
case su.Valid:
|
|
6084
|
+
i.push(Yl(a));
|
|
6084
6085
|
break;
|
|
6085
|
-
case
|
|
6086
|
+
case su.Invalid: Y(e, "cannot pass JSON schema of currently schema object", "enum", n);
|
|
6086
6087
|
}
|
|
6087
6088
|
i.length === 0 && Y(e, "all of elements from list is rejected by currently schema object", "enum");
|
|
6088
6089
|
}
|
|
6089
|
-
if (n &&
|
|
6090
|
+
if (n && cu(r, n) === su.Invalid && (a = !0), i) {
|
|
6090
6091
|
if (i.length === 0) a = !0;
|
|
6091
6092
|
else if (n) {
|
|
6092
6093
|
let e = !1;
|
|
6093
|
-
for (let t of i) if (
|
|
6094
|
+
for (let t of i) if (il(t, n)) {
|
|
6094
6095
|
e = !0;
|
|
6095
6096
|
break;
|
|
6096
6097
|
}
|
|
@@ -6098,11 +6099,11 @@ function uu(e, t, n, r) {
|
|
|
6098
6099
|
}
|
|
6099
6100
|
}
|
|
6100
6101
|
let o = a ? X.Never : X.EnumOrConst, s = {};
|
|
6101
|
-
return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const =
|
|
6102
|
+
return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const = Yl(rl(n))), Q(o, s, e.delegate, e.path);
|
|
6102
6103
|
}
|
|
6103
6104
|
//#endregion
|
|
6104
6105
|
//#region src/json-schema-subset/compiler/object.ts
|
|
6105
|
-
var
|
|
6106
|
+
var uu = /* @__PURE__ */ new Set([
|
|
6106
6107
|
"type",
|
|
6107
6108
|
"maxProperties",
|
|
6108
6109
|
"minProperties",
|
|
@@ -6113,27 +6114,27 @@ var du = /* @__PURE__ */ new Set([
|
|
|
6113
6114
|
"dependencies",
|
|
6114
6115
|
"propertyNames"
|
|
6115
6116
|
]);
|
|
6116
|
-
function
|
|
6117
|
-
let n = Object.keys(t).filter((e) => !
|
|
6117
|
+
function du(e, t) {
|
|
6118
|
+
let n = Object.keys(t).filter((e) => !uu.has(e) && jl(e));
|
|
6118
6119
|
n.length > 0 && Y(e, `type="object" will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
6119
|
-
let r =
|
|
6120
|
+
let r = fu(e, "maxProperties", t), i = fu(e, "minProperties", t), a = pu(e, t), o = mu(e, t), s = hu(e, t), c = _u(e, t);
|
|
6120
6121
|
if (!a || !o || !s || !c) return null;
|
|
6121
|
-
let l =
|
|
6122
|
+
let l = gu(e, o, s, t);
|
|
6122
6123
|
if (!l) return null;
|
|
6123
|
-
let u =
|
|
6124
|
-
return Q(
|
|
6124
|
+
let u = yu(e, vu(a, o, s, l), c, t);
|
|
6125
|
+
return Q(bu(e, a, l, u, r, i) ? X.Never : X.Object, Ll({
|
|
6125
6126
|
type: "object",
|
|
6126
6127
|
required: u,
|
|
6127
6128
|
properties: l,
|
|
6128
6129
|
minProperties: i,
|
|
6129
6130
|
maxProperties: r,
|
|
6130
6131
|
additionalProperties: a,
|
|
6131
|
-
patternProperties:
|
|
6132
|
-
dependencies:
|
|
6132
|
+
patternProperties: Tu(o),
|
|
6133
|
+
dependencies: Eu(c, t),
|
|
6133
6134
|
propertyNames: s
|
|
6134
6135
|
}), e.delegate, e.path);
|
|
6135
6136
|
}
|
|
6136
|
-
function
|
|
6137
|
+
function fu(e, t, n) {
|
|
6137
6138
|
let r = n[t];
|
|
6138
6139
|
if (r !== void 0) {
|
|
6139
6140
|
if (Number.isNaN(r)) {
|
|
@@ -6147,22 +6148,22 @@ function pu(e, t, n) {
|
|
|
6147
6148
|
return r;
|
|
6148
6149
|
}
|
|
6149
6150
|
}
|
|
6150
|
-
function
|
|
6151
|
+
function pu(e, { additionalProperties: t }) {
|
|
6151
6152
|
return t === !1 ? Q(X.Never, {
|
|
6152
6153
|
type: "string",
|
|
6153
6154
|
maxLength: 0,
|
|
6154
6155
|
minLength: 1
|
|
6155
|
-
}, e.delegate, e.path) : typeof t == "object" ?
|
|
6156
|
+
}, e.delegate, e.path) : typeof t == "object" ? Lu(Nl(e, "additionalProperties"), Pl(t)) : Q(X.Any, {}, e.delegate, e.path);
|
|
6156
6157
|
}
|
|
6157
|
-
function
|
|
6158
|
+
function mu(e, { patternProperties: t }) {
|
|
6158
6159
|
let n = !1, r = {};
|
|
6159
6160
|
for (let i in t) {
|
|
6160
|
-
let a =
|
|
6161
|
+
let a = wu(i);
|
|
6161
6162
|
if (a instanceof Error) {
|
|
6162
6163
|
Y(e, `property name invalid. ${i}`, "patternProperties", i);
|
|
6163
6164
|
continue;
|
|
6164
6165
|
}
|
|
6165
|
-
let o =
|
|
6166
|
+
let o = Pl(t[i]), s = Lu(Nl(e, "patternProperties", i), o);
|
|
6166
6167
|
if (!s) {
|
|
6167
6168
|
n = !0;
|
|
6168
6169
|
continue;
|
|
@@ -6171,29 +6172,29 @@ function hu(e, { patternProperties: t }) {
|
|
|
6171
6172
|
}
|
|
6172
6173
|
return n ? null : r;
|
|
6173
6174
|
}
|
|
6174
|
-
function
|
|
6175
|
+
function hu(e, { propertyNames: t }) {
|
|
6175
6176
|
if (!t) return Q(X.Any, {}, e.delegate, e.path);
|
|
6176
|
-
t =
|
|
6177
|
-
let n =
|
|
6177
|
+
t = Pl(t);
|
|
6178
|
+
let n = Lu(Nl(e, "propertyNames"), t);
|
|
6178
6179
|
if (!n) return null;
|
|
6179
6180
|
let r = Z(n);
|
|
6180
|
-
return r !== X.String && r !== X.Any ?
|
|
6181
|
+
return r !== X.String && r !== X.Any ? Xl(n) : n;
|
|
6181
6182
|
}
|
|
6182
|
-
function
|
|
6183
|
+
function gu(e, t, n, { properties: r }) {
|
|
6183
6184
|
let i = !1;
|
|
6184
6185
|
if (!r) return {};
|
|
6185
6186
|
let a = {};
|
|
6186
6187
|
for (let o in r) {
|
|
6187
|
-
if (
|
|
6188
|
+
if (cu(n, o) === su.Invalid) {
|
|
6188
6189
|
Y(e, `key ${JSON.stringify(o)} cannot pass JSON schema from propertyNames`, "properties");
|
|
6189
6190
|
continue;
|
|
6190
6191
|
}
|
|
6191
|
-
let s =
|
|
6192
|
+
let s = Cu(t, o);
|
|
6192
6193
|
if (s && Z(s) === X.Never) {
|
|
6193
6194
|
Y(e, `key ${JSON.stringify(o)} matches a pattern that has a impossible(never) schema`, "properties");
|
|
6194
6195
|
continue;
|
|
6195
6196
|
}
|
|
6196
|
-
let c =
|
|
6197
|
+
let c = Pl(r[o]), l = Lu(Nl(e, "properties", o), c);
|
|
6197
6198
|
if (!l) {
|
|
6198
6199
|
i = !0;
|
|
6199
6200
|
continue;
|
|
@@ -6202,40 +6203,40 @@ function _u(e, t, n, { properties: r }) {
|
|
|
6202
6203
|
}
|
|
6203
6204
|
return i ? null : a;
|
|
6204
6205
|
}
|
|
6205
|
-
function
|
|
6206
|
+
function _u(e, { dependencies: t }) {
|
|
6206
6207
|
if (!t) return [{}, {}];
|
|
6207
6208
|
let n = {}, r = {};
|
|
6208
6209
|
for (let i in t) {
|
|
6209
|
-
let a =
|
|
6210
|
+
let a = Pl(t[i]);
|
|
6210
6211
|
if (Array.isArray(a)) {
|
|
6211
|
-
let { keys: t, duplicated: r } =
|
|
6212
|
+
let { keys: t, duplicated: r } = Su(a);
|
|
6212
6213
|
r && Y(e, `found duplicated property names: ${r.join(", ")}`, "dependencies", i), n[i] = t;
|
|
6213
6214
|
} else {
|
|
6214
|
-
let t =
|
|
6215
|
+
let t = Lu(Nl(e, "dependencies", i), a);
|
|
6215
6216
|
if (t) {
|
|
6216
6217
|
let e = Z(t);
|
|
6217
|
-
r[i] = e === X.Object || e === X.Any ? t : e === X.Extends ?
|
|
6218
|
+
r[i] = e === X.Object || e === X.Any ? t : e === X.Extends ? Wl : Xl(t);
|
|
6218
6219
|
}
|
|
6219
6220
|
}
|
|
6220
6221
|
}
|
|
6221
6222
|
return [n, r];
|
|
6222
6223
|
}
|
|
6223
|
-
function
|
|
6224
|
+
function vu(e, t, n, r) {
|
|
6224
6225
|
return (i) => {
|
|
6225
|
-
if (
|
|
6226
|
-
let a =
|
|
6226
|
+
if (cu(n, i) === su.Invalid) return !0;
|
|
6227
|
+
let a = Cu(t, i);
|
|
6227
6228
|
return !!(a && Z(a) === X.Never || Z(r[i] ?? e) === X.Never);
|
|
6228
6229
|
};
|
|
6229
6230
|
}
|
|
6230
|
-
function
|
|
6231
|
+
function yu(e, t, n, { required: r }) {
|
|
6231
6232
|
if (!r) return [];
|
|
6232
|
-
let i =
|
|
6233
|
+
let i = Su(r);
|
|
6233
6234
|
i.duplicated && Y(e, `found duplicated required keys: ${i.duplicated.join(", ")}`, "required");
|
|
6234
6235
|
let a = [], o = [];
|
|
6235
|
-
for (let e of i.keys)
|
|
6236
|
+
for (let e of i.keys) xu(n, e).some((e) => t(e)) ? o.push(e) : a.push(e);
|
|
6236
6237
|
return o.length > 0 && Y(e, `key ${o.map((e) => JSON.stringify(e)).join(", ")} will ban by another condition`, "required"), a;
|
|
6237
6238
|
}
|
|
6238
|
-
function
|
|
6239
|
+
function bu(e, t, n, r, i, a) {
|
|
6239
6240
|
if (i !== void 0 && a !== void 0 && i < a) return Y(e, `maxProperties(${i}) is less than minProperties(${a})`), !0;
|
|
6240
6241
|
if (i !== void 0 && r.length > i) return Y(e, `length(${r.length}) of required is greater than maxProperties(${i})`), !0;
|
|
6241
6242
|
if (a !== void 0 && r.length < a) return Y(e, `length(${r.length}) of required is less than minProperties(${a})`), !0;
|
|
@@ -6246,7 +6247,7 @@ function xu(e, t, n, r, i, a) {
|
|
|
6246
6247
|
}
|
|
6247
6248
|
return !0;
|
|
6248
6249
|
}
|
|
6249
|
-
function
|
|
6250
|
+
function xu([e, t], n) {
|
|
6250
6251
|
let r = [n], i = new Set(r);
|
|
6251
6252
|
for (; r.length > 0;) {
|
|
6252
6253
|
let n = r.pop(), i = t[n], o = e[n];
|
|
@@ -6257,7 +6258,7 @@ function Su([e, t], n) {
|
|
|
6257
6258
|
}
|
|
6258
6259
|
return [...i];
|
|
6259
6260
|
}
|
|
6260
|
-
function
|
|
6261
|
+
function Su(e) {
|
|
6261
6262
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
6262
6263
|
for (let r of e) t.has(r) ? n.add(r) : t.add(r);
|
|
6263
6264
|
return n.size === 0 ? {
|
|
@@ -6268,14 +6269,14 @@ function Cu(e) {
|
|
|
6268
6269
|
duplicated: [...n]
|
|
6269
6270
|
};
|
|
6270
6271
|
}
|
|
6271
|
-
function
|
|
6272
|
+
function Cu(e, t) {
|
|
6272
6273
|
for (let n in e) {
|
|
6273
6274
|
let [r, i] = e[n];
|
|
6274
6275
|
if (i.test(t)) return r;
|
|
6275
6276
|
}
|
|
6276
6277
|
return null;
|
|
6277
6278
|
}
|
|
6278
|
-
function
|
|
6279
|
+
function wu(e) {
|
|
6279
6280
|
try {
|
|
6280
6281
|
return new RegExp(e, "i");
|
|
6281
6282
|
} catch (e) {
|
|
@@ -6283,12 +6284,12 @@ function Tu(e) {
|
|
|
6283
6284
|
throw e;
|
|
6284
6285
|
}
|
|
6285
6286
|
}
|
|
6286
|
-
function
|
|
6287
|
+
function Tu(e) {
|
|
6287
6288
|
let t = {};
|
|
6288
6289
|
for (let n in e) t[n] = e[n][0];
|
|
6289
6290
|
return t;
|
|
6290
6291
|
}
|
|
6291
|
-
function
|
|
6292
|
+
function Eu([e, t], { dependencies: n }) {
|
|
6292
6293
|
let r = {};
|
|
6293
6294
|
for (let i in n) {
|
|
6294
6295
|
let n = e[i], a = t[i];
|
|
@@ -6298,39 +6299,39 @@ function Du([e, t], { dependencies: n }) {
|
|
|
6298
6299
|
}
|
|
6299
6300
|
//#endregion
|
|
6300
6301
|
//#region src/json-schema-subset/compiler/primitive.ts
|
|
6301
|
-
var
|
|
6302
|
+
var Du = /* @__PURE__ */ new Set([
|
|
6302
6303
|
"type",
|
|
6303
6304
|
"multipleOf",
|
|
6304
6305
|
"maximum",
|
|
6305
6306
|
"exclusiveMaximum",
|
|
6306
6307
|
"minimum",
|
|
6307
6308
|
"exclusiveMinimum"
|
|
6308
|
-
]),
|
|
6309
|
+
]), Ou = /* @__PURE__ */ new Set([
|
|
6309
6310
|
"type",
|
|
6310
6311
|
"format",
|
|
6311
6312
|
"maxLength",
|
|
6312
6313
|
"minLength",
|
|
6313
6314
|
"pattern"
|
|
6314
6315
|
]);
|
|
6315
|
-
function
|
|
6316
|
+
function ku(e, t) {
|
|
6316
6317
|
let { type: n } = t;
|
|
6317
6318
|
switch (n) {
|
|
6318
6319
|
case "number":
|
|
6319
|
-
case "integer": return
|
|
6320
|
-
case "string": return
|
|
6320
|
+
case "integer": return Au(e, t);
|
|
6321
|
+
case "string": return Mu(e, t);
|
|
6321
6322
|
case "boolean":
|
|
6322
6323
|
case "null": {
|
|
6323
|
-
let r = Object.keys(t).filter((e) =>
|
|
6324
|
+
let r = Object.keys(t).filter((e) => jl(e) && e !== "type");
|
|
6324
6325
|
return r.length > 0 && Y(e, `key "type" will exclude other keys: ${r.toSorted().join(", ")}`), Q(n === "null" ? X.Null : X.Boolean, { type: n }, e.delegate, e.path);
|
|
6325
6326
|
}
|
|
6326
|
-
default: return
|
|
6327
|
+
default: return Fl(e, `invalid type ${JSON.stringify(n)}`), null;
|
|
6327
6328
|
}
|
|
6328
6329
|
}
|
|
6329
|
-
function
|
|
6330
|
-
let n = Object.keys(t).filter((e) => !
|
|
6330
|
+
function Au(e, t) {
|
|
6331
|
+
let n = Object.keys(t).filter((e) => !Du.has(e) && jl(e));
|
|
6331
6332
|
n.length > 0 && Y(e, `type=${JSON.stringify(t.type)} will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
6332
|
-
let r =
|
|
6333
|
-
for (let t of
|
|
6333
|
+
let r = nl(t, Du);
|
|
6334
|
+
for (let t of Du) {
|
|
6334
6335
|
let n = r[t];
|
|
6335
6336
|
t !== "type" && n !== void 0 && Number.isNaN(n) && (Y(e, "found NaN", t), delete r[t]);
|
|
6336
6337
|
}
|
|
@@ -6339,38 +6340,38 @@ function ju(e, t) {
|
|
|
6339
6340
|
let { multipleOf: c } = r;
|
|
6340
6341
|
c === 0 && (delete r.multipleOf, r.type = "number", Y(e, "cannot be 0", "multipleOf"));
|
|
6341
6342
|
let l = X.Numeric;
|
|
6342
|
-
return
|
|
6343
|
+
return ju(r) || (l = X.Never), Q(l, r, e.delegate, e.path);
|
|
6343
6344
|
}
|
|
6344
|
-
function
|
|
6345
|
+
function ju(e) {
|
|
6345
6346
|
let { maximum: t, exclusiveMaximum: n, minimum: r, exclusiveMinimum: i } = e;
|
|
6346
6347
|
return t !== void 0 && r !== void 0 ? t >= r : n !== void 0 && r !== void 0 ? n > r : t !== void 0 && i !== void 0 ? t > i : n !== void 0 && i !== void 0 ? n > i : !0;
|
|
6347
6348
|
}
|
|
6348
|
-
function
|
|
6349
|
-
let n = Object.keys(t).filter((e) => !
|
|
6349
|
+
function Mu(e, t) {
|
|
6350
|
+
let n = Object.keys(t).filter((e) => !Ou.has(e) && jl(e));
|
|
6350
6351
|
n.length > 0 && Y(e, `type="string" will exclude other keys: ${n.toSorted().join(", ")}`);
|
|
6351
|
-
let r =
|
|
6352
|
-
|
|
6352
|
+
let r = nl(t, Ou);
|
|
6353
|
+
Nu(e, r, "maxLength"), Nu(e, r, "minLength");
|
|
6353
6354
|
let i = r.maxLength, a = r.minLength, o = X.String;
|
|
6354
6355
|
return i !== void 0 && (i < 0 || i !== void 0 && a !== void 0 && i < a) && (o = X.Never), Q(o, r, e.delegate, e.path);
|
|
6355
6356
|
}
|
|
6356
|
-
function
|
|
6357
|
+
function Nu(e, t, n) {
|
|
6357
6358
|
let r = t[n];
|
|
6358
6359
|
r !== void 0 && Number.isNaN(r) && (Y(e, "found NaN", n), delete t[n]);
|
|
6359
6360
|
}
|
|
6360
6361
|
//#endregion
|
|
6361
6362
|
//#region src/json-schema-subset/compiler/compiler.ts
|
|
6362
|
-
var
|
|
6363
|
-
function
|
|
6364
|
-
if (
|
|
6363
|
+
var Pu = Object.freeze([]);
|
|
6364
|
+
function Fu(e, t, n, r) {
|
|
6365
|
+
if (Kl(e) || t.isExtendsSchema(e)) return {
|
|
6365
6366
|
schema: e,
|
|
6366
|
-
warns:
|
|
6367
|
+
warns: Pu
|
|
6367
6368
|
};
|
|
6368
6369
|
if (r) {
|
|
6369
6370
|
let t = r.isSchema(e);
|
|
6370
6371
|
if (typeof t == "object") {
|
|
6371
6372
|
let e = [];
|
|
6372
6373
|
for (let n of t) e.push({
|
|
6373
|
-
kind:
|
|
6374
|
+
kind: Dl.External,
|
|
6374
6375
|
error: n
|
|
6375
6376
|
});
|
|
6376
6377
|
if (e.length > 0) return e;
|
|
@@ -6383,19 +6384,19 @@ function Iu(e, t, n, r) {
|
|
|
6383
6384
|
path: [],
|
|
6384
6385
|
errors: [],
|
|
6385
6386
|
warns: []
|
|
6386
|
-
}, a =
|
|
6387
|
-
if (a)
|
|
6388
|
-
else return
|
|
6387
|
+
}, a = Lu(i, e);
|
|
6388
|
+
if (a) Iu(i.errors.length === 0, "found errors (it should be empty)");
|
|
6389
|
+
else return Iu(i.errors.length > 0, "cannot found any errors"), i.errors;
|
|
6389
6390
|
return {
|
|
6390
6391
|
schema: a,
|
|
6391
6392
|
warns: i.warns
|
|
6392
6393
|
};
|
|
6393
6394
|
}
|
|
6394
|
-
function
|
|
6395
|
+
function Iu(e, t) {
|
|
6395
6396
|
if (!e) throw Error(t);
|
|
6396
6397
|
}
|
|
6397
|
-
function
|
|
6398
|
-
if (e.extends.isExtendsSchema(t) ||
|
|
6398
|
+
function Lu(e, t) {
|
|
6399
|
+
if (e.extends.isExtendsSchema(t) || Kl(t)) return t;
|
|
6399
6400
|
let n = e.extends.tryCompiledExtendsSchema(t, e.payload);
|
|
6400
6401
|
if (n) return n;
|
|
6401
6402
|
let r = t, i = !1, { enum: a, const: o } = t;
|
|
@@ -6403,23 +6404,23 @@ function Ru(e, t) {
|
|
|
6403
6404
|
let { enum: e, const: n, ...a } = t;
|
|
6404
6405
|
r = a, i = !0;
|
|
6405
6406
|
}
|
|
6406
|
-
let s =
|
|
6407
|
-
return s && i && (s =
|
|
6407
|
+
let s = Ru(e, r);
|
|
6408
|
+
return s && i && (s = lu(e, a, o, s)), s || null;
|
|
6408
6409
|
}
|
|
6409
|
-
function
|
|
6410
|
-
for (let n of
|
|
6410
|
+
function Ru(e, t) {
|
|
6411
|
+
for (let n of iu) {
|
|
6411
6412
|
let r = t[n];
|
|
6412
6413
|
if (r) {
|
|
6413
|
-
let i = Object.keys(t).filter((e) =>
|
|
6414
|
-
return i.length > 0 && Y(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`),
|
|
6414
|
+
let i = Object.keys(t).filter((e) => jl(e) && e !== n);
|
|
6415
|
+
return i.length > 0 && Y(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`), au(e, n, r) || null;
|
|
6415
6416
|
}
|
|
6416
6417
|
}
|
|
6417
6418
|
{
|
|
6418
|
-
let n =
|
|
6419
|
+
let n = Pl(t.not);
|
|
6419
6420
|
if (n) {
|
|
6420
|
-
let r = Object.keys(t).filter((e) =>
|
|
6421
|
+
let r = Object.keys(t).filter((e) => jl(e) && e !== "not");
|
|
6421
6422
|
r.length > 0 && Y(e, `key "not" will exclude other keys: ${r.toSorted().join(", ")}`);
|
|
6422
|
-
let i =
|
|
6423
|
+
let i = Lu(Nl(e, "not"), n);
|
|
6423
6424
|
if (!i) return null;
|
|
6424
6425
|
let a = X.Not;
|
|
6425
6426
|
switch (Z(i)) {
|
|
@@ -6435,26 +6436,26 @@ function zu(e, t) {
|
|
|
6435
6436
|
let { type: n } = t;
|
|
6436
6437
|
if (Array.isArray(n)) {
|
|
6437
6438
|
let { type: r, ...i } = t;
|
|
6438
|
-
return
|
|
6439
|
+
return au(e, "anyOf", n.map((e) => ({
|
|
6439
6440
|
...i,
|
|
6440
6441
|
type: e
|
|
6441
6442
|
})));
|
|
6442
6443
|
}
|
|
6443
6444
|
switch (n) {
|
|
6444
|
-
case "object": return
|
|
6445
|
-
case "array": return
|
|
6446
|
-
default: return
|
|
6445
|
+
case "object": return du(e, t);
|
|
6446
|
+
case "array": return Ql(e, t);
|
|
6447
|
+
default: return ku(e, t);
|
|
6447
6448
|
}
|
|
6448
6449
|
}
|
|
6449
|
-
return
|
|
6450
|
+
return Ml(t) ? Q(X.Any, {}, e.delegate, e.path) : (Fl(e, "unrecognized"), null);
|
|
6450
6451
|
}
|
|
6451
6452
|
//#endregion
|
|
6452
6453
|
//#region src/json-schema-subset/checker/tools/mark.ts
|
|
6453
|
-
var
|
|
6454
|
+
var zu = class {
|
|
6454
6455
|
constructor(e) {
|
|
6455
6456
|
let t = Object.freeze(e.toSorted());
|
|
6456
6457
|
if (t.length > 32) throw Error(`cannot define ${t.length} keys which is greater than 32`);
|
|
6457
|
-
this.keys = t, this.clazz = class extends
|
|
6458
|
+
this.keys = t, this.clazz = class extends Bu {
|
|
6458
6459
|
constructor(e) {
|
|
6459
6460
|
super(t, e);
|
|
6460
6461
|
}
|
|
@@ -6478,7 +6479,7 @@ var Bu = class {
|
|
|
6478
6479
|
else if (e) for (let [n, r] of this.keys.entries()) e[r] && (t |= 1 << n);
|
|
6479
6480
|
return new this.clazz(t);
|
|
6480
6481
|
}
|
|
6481
|
-
},
|
|
6482
|
+
}, Bu = class {
|
|
6482
6483
|
constructor(e, t) {
|
|
6483
6484
|
this.keys = e, this.int32 = t;
|
|
6484
6485
|
}
|
|
@@ -6493,21 +6494,21 @@ var Bu = class {
|
|
|
6493
6494
|
};
|
|
6494
6495
|
//#endregion
|
|
6495
6496
|
//#region src/json-schema-subset/checker/tools/quantum.ts
|
|
6496
|
-
function
|
|
6497
|
-
return new
|
|
6497
|
+
function Vu(e) {
|
|
6498
|
+
return new Hu(e);
|
|
6498
6499
|
}
|
|
6499
|
-
var
|
|
6500
|
+
var Hu = class {
|
|
6500
6501
|
constructor(e) {
|
|
6501
|
-
this.description = new
|
|
6502
|
+
this.description = new zu(e);
|
|
6502
6503
|
}
|
|
6503
6504
|
get keys() {
|
|
6504
6505
|
return this.description.keys;
|
|
6505
6506
|
}
|
|
6506
6507
|
variable(e) {
|
|
6507
6508
|
let t;
|
|
6508
|
-
return e && (t = this.description.toBundle(e).toInt32()), new
|
|
6509
|
+
return e && (t = this.description.toBundle(e).toInt32()), new Uu(this.description, t);
|
|
6509
6510
|
}
|
|
6510
|
-
},
|
|
6511
|
+
}, Uu = class {
|
|
6511
6512
|
constructor(e, t) {
|
|
6512
6513
|
this.values = /* @__PURE__ */ new Set(), this.description = e, t !== void 0 && this.values.add(t);
|
|
6513
6514
|
}
|
|
@@ -6528,7 +6529,7 @@ var Uu = class {
|
|
|
6528
6529
|
}
|
|
6529
6530
|
push(e, t) {
|
|
6530
6531
|
let n = /* @__PURE__ */ new Set();
|
|
6531
|
-
for (let r of this.values) for (let [i, a] of
|
|
6532
|
+
for (let r of this.values) for (let [i, a] of al) if (e & a) {
|
|
6532
6533
|
let e = this.description.toBundle(r);
|
|
6533
6534
|
t(i, e), n.add(e.toInt32());
|
|
6534
6535
|
}
|
|
@@ -6545,11 +6546,11 @@ var Uu = class {
|
|
|
6545
6546
|
};
|
|
6546
6547
|
//#endregion
|
|
6547
6548
|
//#region src/json-schema-subset/checker/tools/range.ts
|
|
6548
|
-
function
|
|
6549
|
+
function Wu(e, t) {
|
|
6549
6550
|
let [n] = e, [r] = t;
|
|
6550
|
-
return n.num < r.num ?
|
|
6551
|
+
return n.num < r.num ? Gu(e, t) : n.num > r.num ? Ku(e, t) : qu(e, t);
|
|
6551
6552
|
}
|
|
6552
|
-
function
|
|
6553
|
+
function Gu(e, t) {
|
|
6553
6554
|
let [n, r] = e, [i, a] = t;
|
|
6554
6555
|
if (r.num <= i.num) {
|
|
6555
6556
|
let n = r.exclusive, a = i.exclusive;
|
|
@@ -6574,11 +6575,11 @@ function Ku(e, t) {
|
|
|
6574
6575
|
let t;
|
|
6575
6576
|
return e && (t = {
|
|
6576
6577
|
fromLeft: !1,
|
|
6577
|
-
range: [
|
|
6578
|
+
range: [Ju(r), a]
|
|
6578
6579
|
}), {
|
|
6579
6580
|
left: {
|
|
6580
6581
|
fromLeft: !0,
|
|
6581
|
-
range: [n,
|
|
6582
|
+
range: [n, Ju(i)]
|
|
6582
6583
|
},
|
|
6583
6584
|
center: [i, r],
|
|
6584
6585
|
right: t
|
|
@@ -6588,16 +6589,16 @@ function Ku(e, t) {
|
|
|
6588
6589
|
return {
|
|
6589
6590
|
left: {
|
|
6590
6591
|
fromLeft: !0,
|
|
6591
|
-
range: [n,
|
|
6592
|
+
range: [n, Ju(i)]
|
|
6592
6593
|
},
|
|
6593
6594
|
center: [i, a],
|
|
6594
6595
|
right: {
|
|
6595
6596
|
fromLeft: !0,
|
|
6596
|
-
range: [
|
|
6597
|
+
range: [Ju(a), r]
|
|
6597
6598
|
}
|
|
6598
6599
|
};
|
|
6599
6600
|
}
|
|
6600
|
-
function
|
|
6601
|
+
function Ku(e, t) {
|
|
6601
6602
|
let [n, r] = e, [i, a] = t;
|
|
6602
6603
|
if (n.num >= a.num) {
|
|
6603
6604
|
let r = a.exclusive, i = n.exclusive;
|
|
@@ -6622,11 +6623,11 @@ function qu(e, t) {
|
|
|
6622
6623
|
let t;
|
|
6623
6624
|
return e && (t = {
|
|
6624
6625
|
fromLeft: !0,
|
|
6625
|
-
range: [
|
|
6626
|
+
range: [Ju(a), r]
|
|
6626
6627
|
}), {
|
|
6627
6628
|
left: {
|
|
6628
6629
|
fromLeft: !1,
|
|
6629
|
-
range: [i,
|
|
6630
|
+
range: [i, Ju(n)]
|
|
6630
6631
|
},
|
|
6631
6632
|
center: [n, a],
|
|
6632
6633
|
right: t
|
|
@@ -6636,23 +6637,23 @@ function qu(e, t) {
|
|
|
6636
6637
|
return {
|
|
6637
6638
|
left: {
|
|
6638
6639
|
fromLeft: !1,
|
|
6639
|
-
range: [i,
|
|
6640
|
+
range: [i, Ju(n)]
|
|
6640
6641
|
},
|
|
6641
6642
|
center: [n, r],
|
|
6642
6643
|
right: {
|
|
6643
6644
|
fromLeft: !1,
|
|
6644
|
-
range: [
|
|
6645
|
+
range: [Ju(r), a]
|
|
6645
6646
|
}
|
|
6646
6647
|
};
|
|
6647
6648
|
}
|
|
6648
|
-
function
|
|
6649
|
+
function qu(e, t) {
|
|
6649
6650
|
let [n, r] = e, [i, a] = t, o = n.exclusive, s = i.exclusive, c, l = n;
|
|
6650
6651
|
if (!o && s ? (l = i, c = {
|
|
6651
6652
|
fromLeft: !0,
|
|
6652
|
-
range: [n,
|
|
6653
|
+
range: [n, Ju(i)]
|
|
6653
6654
|
}) : o && !s && (c = {
|
|
6654
6655
|
fromLeft: !1,
|
|
6655
|
-
range: [i,
|
|
6656
|
+
range: [i, Ju(n)]
|
|
6656
6657
|
}), r.num <= a.num) {
|
|
6657
6658
|
let e = !0, t = !1;
|
|
6658
6659
|
if (r.num === a.num) {
|
|
@@ -6663,7 +6664,7 @@ function Ju(e, t) {
|
|
|
6663
6664
|
let t;
|
|
6664
6665
|
return e && (t = {
|
|
6665
6666
|
fromLeft: !1,
|
|
6666
|
-
range: [
|
|
6667
|
+
range: [Ju(r), a]
|
|
6667
6668
|
}), {
|
|
6668
6669
|
left: c,
|
|
6669
6670
|
center: [l, r],
|
|
@@ -6676,11 +6677,11 @@ function Ju(e, t) {
|
|
|
6676
6677
|
center: [l, a],
|
|
6677
6678
|
right: {
|
|
6678
6679
|
fromLeft: !0,
|
|
6679
|
-
range: [
|
|
6680
|
+
range: [Ju(a), r]
|
|
6680
6681
|
}
|
|
6681
6682
|
};
|
|
6682
6683
|
}
|
|
6683
|
-
function
|
|
6684
|
+
function Ju(e) {
|
|
6684
6685
|
return {
|
|
6685
6686
|
num: e.num,
|
|
6686
6687
|
exclusive: !e.exclusive
|
|
@@ -6688,8 +6689,8 @@ function Yu(e) {
|
|
|
6688
6689
|
}
|
|
6689
6690
|
//#endregion
|
|
6690
6691
|
//#region src/json-schema-subset/checker/range.ts
|
|
6691
|
-
var
|
|
6692
|
-
let { left: a, center: o, right: s } =
|
|
6692
|
+
var Yu = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
|
|
6693
|
+
let { left: a, center: o, right: s } = Wu([{
|
|
6693
6694
|
num: t,
|
|
6694
6695
|
exclusive: !1
|
|
6695
6696
|
}, {
|
|
@@ -6719,24 +6720,24 @@ var Xu = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
|
|
|
6719
6720
|
intersection: u
|
|
6720
6721
|
};
|
|
6721
6722
|
};
|
|
6722
|
-
function
|
|
6723
|
+
function Xu({ left: e, right: t, intersection: n }) {
|
|
6723
6724
|
if (!n) return H.Rejection;
|
|
6724
6725
|
let r = !1, i = !1;
|
|
6725
6726
|
return e && (e.isFrom1 ? r = !0 : i = !0), t && (t.isFrom1 ? r = !0 : i = !0), r && i ? H.Intersection : r ? H.Containing : i ? H.ContainedBy : H.Equals;
|
|
6726
6727
|
}
|
|
6727
6728
|
//#endregion
|
|
6728
6729
|
//#region src/json-schema-subset/checker/array.ts
|
|
6729
|
-
var
|
|
6730
|
+
var Zu = Yu(0), Qu = Vu([
|
|
6730
6731
|
"hasCommon",
|
|
6731
6732
|
"hasExtra1",
|
|
6732
6733
|
"hasExtra2",
|
|
6733
6734
|
"hasRejection",
|
|
6734
6735
|
"hasCommonBroken"
|
|
6735
6736
|
]);
|
|
6736
|
-
function
|
|
6737
|
-
let r =
|
|
6737
|
+
function $u({ calculate: e }, t, n) {
|
|
6738
|
+
let r = Zu(t.minItems, t.maxItems, n.minItems, n.maxItems), i = Xu(r);
|
|
6738
6739
|
if (i === H.Rejection) return K;
|
|
6739
|
-
let [a, o] =
|
|
6740
|
+
let [a, o] = ed(t), [s, c] = ed(n), l = Math.max(a.length, s.length) + 1, u = Math.min(l, r.intersection.max), d = Qu.variable({}), f = Math.min(t.minItems ?? 0, n.minItems ?? 0);
|
|
6740
6741
|
for (let t = 0; t < u; t++) {
|
|
6741
6742
|
let n = e(a[t] ?? o, s[t] ?? c);
|
|
6742
6743
|
d.push(n, (e, n) => {
|
|
@@ -6776,69 +6777,69 @@ function ed({ calculate: e }, t, n) {
|
|
|
6776
6777
|
}
|
|
6777
6778
|
return p;
|
|
6778
6779
|
}
|
|
6779
|
-
function
|
|
6780
|
-
return Array.isArray(e) ? [e, t ??
|
|
6780
|
+
function ed({ items: e, additionalItems: t }) {
|
|
6781
|
+
return Array.isArray(e) ? [e, t ?? Ul] : [[], e ?? Ul];
|
|
6781
6782
|
}
|
|
6782
6783
|
//#endregion
|
|
6783
6784
|
//#region src/json-schema-subset/checker/cache.ts
|
|
6784
|
-
function
|
|
6785
|
+
function td(e) {
|
|
6785
6786
|
let t = /* @__PURE__ */ new Map();
|
|
6786
6787
|
return (n, r) => {
|
|
6787
|
-
let i =
|
|
6788
|
-
return i ===
|
|
6788
|
+
let i = Gl(n);
|
|
6789
|
+
return i === Gl(r) ? i ? rd(t, n, r, e) : n === r : !1;
|
|
6789
6790
|
};
|
|
6790
6791
|
}
|
|
6791
|
-
function
|
|
6792
|
+
function nd(e) {
|
|
6792
6793
|
let t = /* @__PURE__ */ new Map();
|
|
6793
|
-
return (n, r) =>
|
|
6794
|
+
return (n, r) => rd(t, n, r, e);
|
|
6794
6795
|
}
|
|
6795
|
-
function
|
|
6796
|
-
let i = `${
|
|
6796
|
+
function rd(e, t, n, r) {
|
|
6797
|
+
let i = `${ql(t)}/${ql(n)}`, a = e.get(i);
|
|
6797
6798
|
return a === void 0 && e.set(i, a = r(t, n)), a;
|
|
6798
6799
|
}
|
|
6799
6800
|
//#endregion
|
|
6800
6801
|
//#region src/json-schema-subset/checker/enumAndConst.ts
|
|
6801
|
-
function
|
|
6802
|
-
let r =
|
|
6803
|
-
for (let t of r) if (
|
|
6804
|
-
for (let t of i) if (
|
|
6802
|
+
function id(e, t, n) {
|
|
6803
|
+
let r = od(t), i = od(n), a = !1, o = !1, s = !1;
|
|
6804
|
+
for (let t of r) if (sd(e, i, t) ? s = !0 : a = !0, a && s) break;
|
|
6805
|
+
for (let t of i) if (sd(e, r, t) ? s = !0 : o = !0, o && s) break;
|
|
6805
6806
|
return s ? a && o ? q : a ? W : o ? G : U : K;
|
|
6806
6807
|
}
|
|
6807
|
-
function
|
|
6808
|
+
function ad(e, t) {
|
|
6808
6809
|
let n = !1, r = !1;
|
|
6809
|
-
for (let i of
|
|
6810
|
-
switch (
|
|
6811
|
-
case
|
|
6810
|
+
for (let i of od(e)) {
|
|
6811
|
+
switch (cu(t, i)) {
|
|
6812
|
+
case su.Valid:
|
|
6812
6813
|
n = !0;
|
|
6813
6814
|
break;
|
|
6814
|
-
case
|
|
6815
|
+
case su.Invalid:
|
|
6815
6816
|
r = !0;
|
|
6816
6817
|
break;
|
|
6817
|
-
case
|
|
6818
|
+
case su.Unknown: return ol;
|
|
6818
6819
|
}
|
|
6819
6820
|
if (n && r) break;
|
|
6820
6821
|
}
|
|
6821
6822
|
return n && r ? q : n ? U | G : r ? K : Z(t) === X.Never ? U : G;
|
|
6822
6823
|
}
|
|
6823
|
-
function
|
|
6824
|
+
function od({ const: e, enum: t }) {
|
|
6824
6825
|
if (e !== void 0) return [e];
|
|
6825
6826
|
if (t) return t;
|
|
6826
6827
|
throw Error("invalid branch");
|
|
6827
6828
|
}
|
|
6828
|
-
function
|
|
6829
|
+
function sd({ isEquals: e }, t, n) {
|
|
6829
6830
|
for (let r of t) if (e(r, n)) return !0;
|
|
6830
6831
|
return !1;
|
|
6831
6832
|
}
|
|
6832
6833
|
//#endregion
|
|
6833
6834
|
//#region src/json-schema-subset/checker/equals.ts
|
|
6834
|
-
function
|
|
6835
|
+
function cd(e) {
|
|
6835
6836
|
function t(t, n) {
|
|
6836
6837
|
let i = e.isExtendsSchema(t), a = e.isExtendsSchema(n);
|
|
6837
6838
|
return i || a ? e.equals(t, n) : r(t, n);
|
|
6838
6839
|
}
|
|
6839
6840
|
let n = /* @__PURE__ */ new Map();
|
|
6840
6841
|
function r(e, t) {
|
|
6841
|
-
let r =
|
|
6842
|
+
let r = ql(e), a = ql(t);
|
|
6842
6843
|
if (r === a) return !0;
|
|
6843
6844
|
let o = `${r}/${a}`, s = n.get(o);
|
|
6844
6845
|
return s === void 0 && (s = i(e, t), n.set(o, s)), s;
|
|
@@ -6855,25 +6856,25 @@ function ld(e) {
|
|
|
6855
6856
|
return !0;
|
|
6856
6857
|
}
|
|
6857
6858
|
function a(e, t) {
|
|
6858
|
-
return e === t ? !0 : typeof e != "object" || !e || typeof e != typeof t ? !1 :
|
|
6859
|
+
return e === t ? !0 : typeof e != "object" || !e || typeof e != typeof t ? !1 : Kl(e) && Kl(t) ? r(e, t) : i(e, t);
|
|
6859
6860
|
}
|
|
6860
6861
|
return t;
|
|
6861
6862
|
}
|
|
6862
6863
|
//#endregion
|
|
6863
6864
|
//#region src/json-schema-subset/checker/numeric/integerNormalizer.ts
|
|
6864
|
-
function
|
|
6865
|
-
let t =
|
|
6865
|
+
function ld(e) {
|
|
6866
|
+
let t = gd(e), n = e.multipleOf ?? 1, r = dd(t, n);
|
|
6866
6867
|
return r ? {
|
|
6867
6868
|
multipleOf: n,
|
|
6868
6869
|
range: r
|
|
6869
6870
|
} : null;
|
|
6870
6871
|
}
|
|
6871
|
-
function
|
|
6872
|
+
function ud([e, t]) {
|
|
6872
6873
|
return !(e.num !== t.num || e.exclusive || t.exclusive);
|
|
6873
6874
|
}
|
|
6874
|
-
function
|
|
6875
|
+
function dd(e, t) {
|
|
6875
6876
|
if (!e) return;
|
|
6876
|
-
let [n, r] = e, i =
|
|
6877
|
+
let [n, r] = e, i = fd(n.num, t), a = pd(r.num, t);
|
|
6877
6878
|
if (i === n.num && n.exclusive && (i += t), a === r.num && r.exclusive && (a -= t), !(i > a) && (i !== a || i !== Infinity && i !== -Infinity)) return [{
|
|
6878
6879
|
num: i,
|
|
6879
6880
|
exclusive: !1
|
|
@@ -6882,29 +6883,29 @@ function fd(e, t) {
|
|
|
6882
6883
|
exclusive: !1
|
|
6883
6884
|
}];
|
|
6884
6885
|
}
|
|
6885
|
-
function
|
|
6886
|
+
function fd(e, t) {
|
|
6886
6887
|
return Math.ceil(e / t) * t;
|
|
6887
6888
|
}
|
|
6888
|
-
function
|
|
6889
|
+
function pd(e, t) {
|
|
6889
6890
|
return Math.floor(e / t) * t;
|
|
6890
6891
|
}
|
|
6891
6892
|
//#endregion
|
|
6892
6893
|
//#region src/json-schema-subset/checker/numeric/float.ts
|
|
6893
|
-
function
|
|
6894
|
-
let { left: n, right: r, center: i } =
|
|
6894
|
+
function md(e, t) {
|
|
6895
|
+
let { left: n, right: r, center: i } = Wu(gd(e), gd(t));
|
|
6895
6896
|
if (!i) return K;
|
|
6896
6897
|
let a = !1, o = !1;
|
|
6897
6898
|
return n && (n.fromLeft ? a = !0 : o = !0), r && (r.fromLeft ? a = !0 : o = !0), a && o ? q : a ? W : o ? G : U;
|
|
6898
6899
|
}
|
|
6899
|
-
function
|
|
6900
|
-
let n =
|
|
6900
|
+
function hd(e, t) {
|
|
6901
|
+
let n = gd(e), r = ld(t);
|
|
6901
6902
|
if (!r) return W;
|
|
6902
|
-
let i =
|
|
6903
|
+
let i = Wu(n, r.range), a = dd(i.center, r.multipleOf), o = _d(i.left, r.multipleOf), s = _d(i.right, r.multipleOf);
|
|
6903
6904
|
if (!i.center) return K;
|
|
6904
6905
|
let c = !1, l = !1;
|
|
6905
|
-
return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !
|
|
6906
|
+
return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !ud(i.center)) && (c = !0), o && (l = !0), s && (l = !0), c && l ? q : c ? W : l ? G : U;
|
|
6906
6907
|
}
|
|
6907
|
-
function
|
|
6908
|
+
function gd(e) {
|
|
6908
6909
|
let t, n;
|
|
6909
6910
|
return t = e.exclusiveMinimum === void 0 ? e.minimum === void 0 ? {
|
|
6910
6911
|
num: -Infinity,
|
|
@@ -6926,84 +6927,84 @@ function _d(e) {
|
|
|
6926
6927
|
exclusive: !0
|
|
6927
6928
|
}, [t, n];
|
|
6928
6929
|
}
|
|
6929
|
-
function
|
|
6930
|
-
if (e && !e.fromLeft) return
|
|
6930
|
+
function _d(e, t) {
|
|
6931
|
+
if (e && !e.fromLeft) return dd(e.range, t);
|
|
6931
6932
|
}
|
|
6932
6933
|
//#endregion
|
|
6933
6934
|
//#region src/json-schema-subset/checker/numeric/integer.ts
|
|
6934
|
-
function
|
|
6935
|
-
let n =
|
|
6935
|
+
function vd(e, t) {
|
|
6936
|
+
let n = ld(e), r = ld(t);
|
|
6936
6937
|
if (!n && !r) return U;
|
|
6937
6938
|
if (!n) return G;
|
|
6938
6939
|
if (!r) return W;
|
|
6939
|
-
let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c =
|
|
6940
|
-
if (c.center && (u =
|
|
6940
|
+
let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c = Wu(i, o), l, u = 0;
|
|
6941
|
+
if (c.center && (u = bd(a, s), l = dd(c.center, u)), !l) return K;
|
|
6941
6942
|
let d = !1, f = !1, { left: p, right: m } = c;
|
|
6942
|
-
return p &&
|
|
6943
|
+
return p && dd(p.range, p.fromLeft ? a : s) && (p.fromLeft ? d = !0 : f = !0), m && dd(m.range, m.fromLeft ? a : s) && (m.fromLeft ? d = !0 : f = !0), d ||= yd(n, l, u), f ||= yd(r, l, u), d && f ? q : d ? W : f ? G : U;
|
|
6943
6944
|
}
|
|
6944
|
-
function
|
|
6945
|
-
let i =
|
|
6946
|
-
if (
|
|
6947
|
-
let a =
|
|
6945
|
+
function yd({ range: e, multipleOf: t }, n, r) {
|
|
6946
|
+
let i = Wu(e, n);
|
|
6947
|
+
if (dd(i.left?.range, t) || dd(i.right?.range, t)) return !0;
|
|
6948
|
+
let a = dd(i.center, t);
|
|
6948
6949
|
if (!a) return !1;
|
|
6949
|
-
let o =
|
|
6950
|
-
return
|
|
6950
|
+
let o = Sd(n);
|
|
6951
|
+
return Sd(a) > o || o !== 1 && t < r;
|
|
6951
6952
|
}
|
|
6952
|
-
function
|
|
6953
|
-
return e * t /
|
|
6953
|
+
function bd(e, t) {
|
|
6954
|
+
return e * t / xd(e, t);
|
|
6954
6955
|
}
|
|
6955
|
-
function
|
|
6956
|
-
return e === 0 ? t :
|
|
6956
|
+
function xd(e, t) {
|
|
6957
|
+
return e === 0 ? t : xd(t % e, e);
|
|
6957
6958
|
}
|
|
6958
|
-
function
|
|
6959
|
+
function Sd(e) {
|
|
6959
6960
|
if (!e) return 0;
|
|
6960
6961
|
let [t, n] = e;
|
|
6961
6962
|
return n.num - t.num + 1;
|
|
6962
6963
|
}
|
|
6963
6964
|
//#endregion
|
|
6964
6965
|
//#region src/json-schema-subset/checker/numeric/checker.ts
|
|
6965
|
-
function
|
|
6966
|
-
if (
|
|
6967
|
-
let n =
|
|
6968
|
-
return n && r ?
|
|
6966
|
+
function Cd(e, t) {
|
|
6967
|
+
if (wd(e) || wd(t)) return ol;
|
|
6968
|
+
let n = Td(e), r = Td(t);
|
|
6969
|
+
return n && r ? md(e, t) : n ? hd(e, t) : r ? gl(hd(t, e)) : vd(e, t);
|
|
6969
6970
|
}
|
|
6970
|
-
function
|
|
6971
|
+
function wd(e) {
|
|
6971
6972
|
let { multipleOf: t } = e;
|
|
6972
6973
|
return t === void 0 ? !1 : !Number.isInteger(t) || t < 0;
|
|
6973
6974
|
}
|
|
6974
|
-
function
|
|
6975
|
+
function Td(e) {
|
|
6975
6976
|
let { multipleOf: t } = e;
|
|
6976
6977
|
return !(t !== void 0 && Number.isInteger(t) || e.type === "integer");
|
|
6977
6978
|
}
|
|
6978
6979
|
//#endregion
|
|
6979
6980
|
//#region src/json-schema-subset/checker/object.ts
|
|
6980
|
-
var
|
|
6981
|
+
var Ed = Yu(0), Dd = Vu([
|
|
6981
6982
|
"hasCommonInRequired",
|
|
6982
6983
|
"hasCommonOutRequired",
|
|
6983
6984
|
"hasExtra1",
|
|
6984
6985
|
"hasExtra2",
|
|
6985
6986
|
"hasRejection"
|
|
6986
6987
|
]);
|
|
6987
|
-
function
|
|
6988
|
-
if (
|
|
6989
|
-
let r =
|
|
6988
|
+
function Od(e, t, n) {
|
|
6989
|
+
if (kd(t, n)) return K;
|
|
6990
|
+
let r = Ad(t, n);
|
|
6990
6991
|
if (!r) return K;
|
|
6991
|
-
let i =
|
|
6992
|
+
let i = Id(t), a = Id(n), o = (t) => {
|
|
6992
6993
|
let n = i(t), r = a(t);
|
|
6993
|
-
return
|
|
6994
|
-
}, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u =
|
|
6995
|
-
for (let e of [...s].toSorted()) u.push(o(e),
|
|
6996
|
-
for (let e of [...c].toSorted()) u.push(o(e),
|
|
6997
|
-
for (let e of [...l].toSorted()) u.push(o(e),
|
|
6994
|
+
return Ld(n, r) ? e.calculate(n, r) : 0;
|
|
6995
|
+
}, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u = Dd.variable({});
|
|
6996
|
+
for (let e of [...s].toSorted()) u.push(o(e), Md);
|
|
6997
|
+
for (let e of [...c].toSorted()) u.push(o(e), Nd);
|
|
6998
|
+
for (let e of [...l].toSorted()) u.push(o(e), Pd);
|
|
6998
6999
|
let { hasOptional1: d, hasOptional2: f } = r;
|
|
6999
7000
|
if (d || f) {
|
|
7000
|
-
let r =
|
|
7001
|
-
for (let e of [...
|
|
7001
|
+
let r = Fd(d, f);
|
|
7002
|
+
for (let e of [...jd(t, n)].toSorted()) {
|
|
7002
7003
|
let t = o(e);
|
|
7003
7004
|
t !== 0 && u.push(t, r);
|
|
7004
7005
|
}
|
|
7005
|
-
let i = t.additionalProperties ??
|
|
7006
|
-
if (
|
|
7006
|
+
let i = t.additionalProperties ?? Ul, a = n.additionalProperties ?? Ul;
|
|
7007
|
+
if (Ld(i, a)) {
|
|
7007
7008
|
let t = e.calculate(i, a);
|
|
7008
7009
|
u.push(t, r);
|
|
7009
7010
|
}
|
|
@@ -7015,10 +7016,10 @@ function kd(e, t, n) {
|
|
|
7015
7016
|
for (let { hasExtra1: e, hasExtra2: t, hasCommonInRequired: n, hasCommonOutRequired: r, hasRejection: i } of u) m |= !n && p > 0 || !r && p === 0 || i ? K : e && t ? q : e ? W : t ? G : U;
|
|
7016
7017
|
return m;
|
|
7017
7018
|
}
|
|
7018
|
-
function
|
|
7019
|
-
return
|
|
7019
|
+
function kd(e, t) {
|
|
7020
|
+
return Xu(Ed(e.minProperties, e.maxProperties, t.minProperties, t.maxProperties)) === H.Rejection;
|
|
7020
7021
|
}
|
|
7021
|
-
function
|
|
7022
|
+
function Ad(e, t) {
|
|
7022
7023
|
let n = new Set(e.required), r = new Set(t.required), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = n.size, s = r.size;
|
|
7023
7024
|
for (let e of n) r.has(e) && i.add(e), a.add(e);
|
|
7024
7025
|
for (let e of r) n.has(e) && i.add(e), a.add(e);
|
|
@@ -7034,7 +7035,7 @@ function jd(e, t) {
|
|
|
7034
7035
|
hasOptional2: u > s
|
|
7035
7036
|
};
|
|
7036
7037
|
}
|
|
7037
|
-
function
|
|
7038
|
+
function jd(e, t) {
|
|
7038
7039
|
let n = new Set(e.required), r = e.properties, i = t.properties, a = e.required, o = t.required;
|
|
7039
7040
|
if (r) for (let e in r) n.add(e);
|
|
7040
7041
|
if (i) for (let e in i) n.add(e);
|
|
@@ -7042,7 +7043,7 @@ function Md(e, t) {
|
|
|
7042
7043
|
if (o) for (let e of o) n.delete(e);
|
|
7043
7044
|
return n;
|
|
7044
7045
|
}
|
|
7045
|
-
var
|
|
7046
|
+
var Md = (e, t) => {
|
|
7046
7047
|
switch (e) {
|
|
7047
7048
|
case H.Equals:
|
|
7048
7049
|
t.hasCommonInRequired = !0;
|
|
@@ -7058,7 +7059,7 @@ var Nd = (e, t) => {
|
|
|
7058
7059
|
break;
|
|
7059
7060
|
case H.Rejection: t.hasRejection = !0;
|
|
7060
7061
|
}
|
|
7061
|
-
},
|
|
7062
|
+
}, Nd = (e, t) => {
|
|
7062
7063
|
switch (e) {
|
|
7063
7064
|
case H.Equals:
|
|
7064
7065
|
case H.ContainedBy:
|
|
@@ -7070,7 +7071,7 @@ var Nd = (e, t) => {
|
|
|
7070
7071
|
break;
|
|
7071
7072
|
case H.Rejection: t.hasRejection = !0;
|
|
7072
7073
|
}
|
|
7073
|
-
},
|
|
7074
|
+
}, Pd = (e, t) => {
|
|
7074
7075
|
switch (e) {
|
|
7075
7076
|
case H.Equals:
|
|
7076
7077
|
case H.Containing:
|
|
@@ -7082,7 +7083,7 @@ var Nd = (e, t) => {
|
|
|
7082
7083
|
break;
|
|
7083
7084
|
case H.Rejection: t.hasRejection = !0;
|
|
7084
7085
|
}
|
|
7085
|
-
},
|
|
7086
|
+
}, Fd = (e, t) => (n, r) => {
|
|
7086
7087
|
if (r.hasRejection) return;
|
|
7087
7088
|
let i = !1, a = !1, o = !1;
|
|
7088
7089
|
switch (n) {
|
|
@@ -7102,7 +7103,7 @@ var Nd = (e, t) => {
|
|
|
7102
7103
|
}
|
|
7103
7104
|
e && i && (r.hasExtra1 = !0), t && a && (r.hasExtra2 = !0), e && t && o && (r.hasCommonOutRequired = !0);
|
|
7104
7105
|
};
|
|
7105
|
-
function
|
|
7106
|
+
function Id(e) {
|
|
7106
7107
|
let t = e.properties, n = e.propertyNames, r = e.additionalProperties, i = [];
|
|
7107
7108
|
if (e.patternProperties) for (let t in e.patternProperties) {
|
|
7108
7109
|
let n = e.patternProperties[t], r = new RegExp(t, "i");
|
|
@@ -7112,41 +7113,41 @@ function Ld(e) {
|
|
|
7112
7113
|
});
|
|
7113
7114
|
}
|
|
7114
7115
|
return (e) => {
|
|
7115
|
-
if (n &&
|
|
7116
|
+
if (n && cu(n, e) === su.Invalid) return Wl;
|
|
7116
7117
|
for (let { pattern: t, schema: n } of i) if (t.test(e)) return n;
|
|
7117
|
-
return ((t && t[e]) ?? r) ||
|
|
7118
|
+
return ((t && t[e]) ?? r) || Ul;
|
|
7118
7119
|
};
|
|
7119
7120
|
}
|
|
7120
|
-
function
|
|
7121
|
+
function Ld(e, t) {
|
|
7121
7122
|
let n = Z(e), r = Z(t);
|
|
7122
7123
|
return n !== X.Never || r !== X.Never;
|
|
7123
7124
|
}
|
|
7124
7125
|
//#endregion
|
|
7125
7126
|
//#region src/json-schema-subset/checker/string.ts
|
|
7126
|
-
var
|
|
7127
|
-
function
|
|
7127
|
+
var Rd = Yu(0);
|
|
7128
|
+
function zd(e, t) {
|
|
7128
7129
|
if (t.format && !e.format) return W;
|
|
7129
|
-
if (e.format && t.format && e.format !== t.format) return
|
|
7130
|
-
let n =
|
|
7130
|
+
if (e.format && t.format && e.format !== t.format) return ol;
|
|
7131
|
+
let n = Xu(Rd(e.minLength, e.maxLength, t.minLength, t.maxLength)), r = !!e.pattern, i = !!t.pattern;
|
|
7131
7132
|
switch (n) {
|
|
7132
7133
|
case H.Rejection: return K;
|
|
7133
|
-
case H.Containing: return r ?
|
|
7134
|
-
case H.ContainedBy: return i ?
|
|
7135
|
-
case H.Equals: return r && i ? e.pattern === t.pattern ? U :
|
|
7136
|
-
case H.Intersection: return r && i ?
|
|
7134
|
+
case H.Containing: return r ? ol : W;
|
|
7135
|
+
case H.ContainedBy: return i ? ol : G;
|
|
7136
|
+
case H.Equals: return r && i ? e.pattern === t.pattern ? U : ol : r ? U | G : i ? U | W : U;
|
|
7137
|
+
case H.Intersection: return r && i ? ol : r ? q | K | G : i ? q | K | W : q;
|
|
7137
7138
|
}
|
|
7138
7139
|
}
|
|
7139
7140
|
//#endregion
|
|
7140
7141
|
//#region src/json-schema-subset/checker/checker.ts
|
|
7141
|
-
function
|
|
7142
|
-
let r = {}, i = [], a =
|
|
7143
|
-
r.isEquals =
|
|
7142
|
+
function Bd(e, t, n) {
|
|
7143
|
+
let r = {}, i = [], a = nd(Hd(e, r)), o = Vd(), s = cd(e);
|
|
7144
|
+
r.isEquals = td(il), r.calculate = Tl({
|
|
7144
7145
|
describe: o,
|
|
7145
7146
|
equals: s,
|
|
7146
7147
|
calculate: a,
|
|
7147
7148
|
observeCalculation: (e, t, n, r) => {
|
|
7148
|
-
if (!
|
|
7149
|
-
let a = r ?
|
|
7149
|
+
if (!Wd(r ? gl(n) : n)) return;
|
|
7150
|
+
let a = r ? Gd(t, e) : Gd(e, t);
|
|
7150
7151
|
a && i.push(a);
|
|
7151
7152
|
}
|
|
7152
7153
|
}), Object.freeze(r);
|
|
@@ -7156,34 +7157,34 @@ function Vd(e, t, n) {
|
|
|
7156
7157
|
expression: c
|
|
7157
7158
|
};
|
|
7158
7159
|
}
|
|
7159
|
-
var
|
|
7160
|
+
var Vd = () => (e) => {
|
|
7160
7161
|
let t;
|
|
7161
7162
|
switch (Z(e)) {
|
|
7162
7163
|
case X.Not:
|
|
7163
7164
|
t = {
|
|
7164
|
-
kind:
|
|
7165
|
+
kind: wl.Not,
|
|
7165
7166
|
expression: e.not
|
|
7166
7167
|
};
|
|
7167
7168
|
break;
|
|
7168
7169
|
case X.Combination:
|
|
7169
7170
|
if ("allOf" in e) t = {
|
|
7170
|
-
kind:
|
|
7171
|
-
expressions:
|
|
7171
|
+
kind: wl.AllOf,
|
|
7172
|
+
expressions: Ud(e.allOf, X.Any)
|
|
7172
7173
|
};
|
|
7173
7174
|
else if ("anyOf" in e) t = {
|
|
7174
|
-
kind:
|
|
7175
|
-
expressions:
|
|
7175
|
+
kind: wl.AnyOf,
|
|
7176
|
+
expressions: Ud(e.anyOf, X.Never)
|
|
7176
7177
|
};
|
|
7177
7178
|
else if ("oneOf" in e) t = {
|
|
7178
|
-
kind:
|
|
7179
|
-
expressions:
|
|
7179
|
+
kind: wl.OneOf,
|
|
7180
|
+
expressions: Ud(e.oneOf, X.Never)
|
|
7180
7181
|
};
|
|
7181
7182
|
else throw Error(`invalid combination JSON Schema: ${JSON.stringify(e)}`);
|
|
7182
7183
|
break;
|
|
7183
|
-
default: t = { kind:
|
|
7184
|
+
default: t = { kind: wl.Leaf };
|
|
7184
7185
|
}
|
|
7185
7186
|
return t;
|
|
7186
|
-
},
|
|
7187
|
+
}, Hd = (e, t) => (n, r) => {
|
|
7187
7188
|
let i = Z(n), a = Z(r);
|
|
7188
7189
|
if (i === X.Extends || a === X.Extends) return e.calculate(n, r);
|
|
7189
7190
|
switch (i) {
|
|
@@ -7194,28 +7195,28 @@ var Hd = () => (e) => {
|
|
|
7194
7195
|
case X.Any: return G;
|
|
7195
7196
|
case X.Never: return W;
|
|
7196
7197
|
}
|
|
7197
|
-
if (i === X.EnumOrConst && a === X.EnumOrConst) return
|
|
7198
|
-
if (i === X.EnumOrConst) return
|
|
7199
|
-
if (a === X.EnumOrConst) return
|
|
7198
|
+
if (i === X.EnumOrConst && a === X.EnumOrConst) return id(t, n, r);
|
|
7199
|
+
if (i === X.EnumOrConst) return ad(n, r);
|
|
7200
|
+
if (a === X.EnumOrConst) return gl(ad(r, n));
|
|
7200
7201
|
if (i !== a) return K;
|
|
7201
7202
|
switch (i) {
|
|
7202
7203
|
case X.Null: return U;
|
|
7203
|
-
case X.Numeric: return
|
|
7204
|
-
case X.String: return
|
|
7204
|
+
case X.Numeric: return Cd(n, r);
|
|
7205
|
+
case X.String: return zd(n, r);
|
|
7205
7206
|
case X.Boolean: return U;
|
|
7206
|
-
case X.Object: return
|
|
7207
|
-
case X.Array: return
|
|
7207
|
+
case X.Object: return Od(t, n, r);
|
|
7208
|
+
case X.Array: return $u(t, n, r);
|
|
7208
7209
|
default: throw Error(`invalid kind ${i}`);
|
|
7209
7210
|
}
|
|
7210
7211
|
};
|
|
7211
|
-
function
|
|
7212
|
+
function Ud(e, t) {
|
|
7212
7213
|
return e.filter((e) => Z(e) !== t);
|
|
7213
7214
|
}
|
|
7214
|
-
function
|
|
7215
|
-
return !
|
|
7215
|
+
function Wd(e) {
|
|
7216
|
+
return !sl(e) && !ll(e) && (cl(e) || dl(e) || ul(e));
|
|
7216
7217
|
}
|
|
7217
|
-
function
|
|
7218
|
-
let n =
|
|
7218
|
+
function Gd(e, t) {
|
|
7219
|
+
let n = Jl(t);
|
|
7219
7220
|
if (!n) return;
|
|
7220
7221
|
let r = Z(e), i = Z(t);
|
|
7221
7222
|
if (r !== i) return [...n, "type"];
|
|
@@ -7250,12 +7251,12 @@ function Kd(e, t) {
|
|
|
7250
7251
|
}
|
|
7251
7252
|
//#endregion
|
|
7252
7253
|
//#region src/json-schema-subset/extends/extendsContext.ts
|
|
7253
|
-
var
|
|
7254
|
+
var Kd = class e {
|
|
7254
7255
|
constructor(e = []) {
|
|
7255
7256
|
this.extendsSchemaClasses = Object.freeze([...e]);
|
|
7256
7257
|
}
|
|
7257
7258
|
tryCompiledExtendsSchema(e, t) {
|
|
7258
|
-
for (let n of this.extendsSchemaClasses) if (n.isMatch(e)) return new n(
|
|
7259
|
+
for (let n of this.extendsSchemaClasses) if (n.isMatch(e)) return new n(el(), e, t);
|
|
7259
7260
|
return null;
|
|
7260
7261
|
}
|
|
7261
7262
|
isExtendsSchema(e) {
|
|
@@ -7265,7 +7266,7 @@ var qd = class e {
|
|
|
7265
7266
|
calculate(t, n) {
|
|
7266
7267
|
let r = !(t instanceof this.findMatchedClass(t, n)), i = 0, a;
|
|
7267
7268
|
a = r ? n.compare(t) : t.compare(n);
|
|
7268
|
-
for (let t of a) r && (t = e.swap(t)), i |=
|
|
7269
|
+
for (let t of a) r && (t = e.swap(t)), i |= fl(t);
|
|
7269
7270
|
return i;
|
|
7270
7271
|
}
|
|
7271
7272
|
equals(e, t) {
|
|
@@ -7285,35 +7286,35 @@ var qd = class e {
|
|
|
7285
7286
|
};
|
|
7286
7287
|
//#endregion
|
|
7287
7288
|
//#region src/json-schema-subset/preprocessing.ts
|
|
7288
|
-
function
|
|
7289
|
+
function qd(e, t, n = !1) {
|
|
7289
7290
|
let r = t(e);
|
|
7290
7291
|
if (Array.isArray(r)) {
|
|
7291
7292
|
let e = [];
|
|
7292
|
-
throw
|
|
7293
|
+
throw Yd(e, r, "$"), new El(e);
|
|
7293
7294
|
}
|
|
7294
7295
|
let { schema: i, warns: a } = r;
|
|
7295
7296
|
if (n && a.length > 0) {
|
|
7296
7297
|
console.warn(`found ${a.length} warns after compile schema`);
|
|
7297
|
-
for (let e of a) console.warn(
|
|
7298
|
+
for (let e of a) console.warn(Ol(e));
|
|
7298
7299
|
}
|
|
7299
7300
|
return i;
|
|
7300
7301
|
}
|
|
7301
|
-
function
|
|
7302
|
+
function Jd(e, t, n, r = !1) {
|
|
7302
7303
|
let i = n(e), a = n(t);
|
|
7303
7304
|
if (Array.isArray(i) || Array.isArray(a)) {
|
|
7304
7305
|
let e = [];
|
|
7305
|
-
throw Array.isArray(i) &&
|
|
7306
|
+
throw Array.isArray(i) && Yd(e, i, "$1"), Array.isArray(a) && Yd(e, a, "$2"), new El(e);
|
|
7306
7307
|
}
|
|
7307
7308
|
let { schema: o, warns: s } = i, { schema: c, warns: l } = a;
|
|
7308
7309
|
if (r) {
|
|
7309
7310
|
s.length > 0 && console.warn(`found ${s.length} warns after compile superSchema`);
|
|
7310
|
-
for (let e of s) console.warn(
|
|
7311
|
+
for (let e of s) console.warn(Ol(e));
|
|
7311
7312
|
l.length > 0 && console.warn(`found ${l.length} warns after compile subSchema`);
|
|
7312
|
-
for (let e of l) console.warn(
|
|
7313
|
+
for (let e of l) console.warn(Ol(e));
|
|
7313
7314
|
}
|
|
7314
7315
|
return [o, c];
|
|
7315
7316
|
}
|
|
7316
|
-
function
|
|
7317
|
+
function Yd(e, t, n) {
|
|
7317
7318
|
for (let r of t) {
|
|
7318
7319
|
let t = {
|
|
7319
7320
|
...r,
|
|
@@ -7324,60 +7325,60 @@ function Xd(e, t, n) {
|
|
|
7324
7325
|
}
|
|
7325
7326
|
//#endregion
|
|
7326
7327
|
//#region src/json-schema-subset/global.ts
|
|
7327
|
-
var
|
|
7328
|
+
var Xd = Object.freeze({
|
|
7328
7329
|
True: 0,
|
|
7329
7330
|
False: 1,
|
|
7330
7331
|
Unknown: 2
|
|
7331
7332
|
});
|
|
7332
|
-
function
|
|
7333
|
-
let n = new
|
|
7333
|
+
function Zd({ extendsSchemaClasses: e, delegate: t } = {}) {
|
|
7334
|
+
let n = new Kd(e);
|
|
7334
7335
|
return Object.freeze({
|
|
7335
|
-
compile: (e, r, i) =>
|
|
7336
|
+
compile: (e, r, i) => qd(e, (e) => Fu(e, n, r, t), i),
|
|
7336
7337
|
isSubset: (e, r, i = !1) => {
|
|
7337
|
-
let [a, o] =
|
|
7338
|
-
return l && !u ? { result:
|
|
7338
|
+
let [a, o] = Jd(e, r, (e) => Fu(e, n, void 0, t), i), { errorPath: s, expression: c } = Bd(n, a, o), l = sl(c) || ll(c), u = cl(c) || dl(c) || ul(c);
|
|
7339
|
+
return l && !u ? { result: Xd.True } : !l && u ? {
|
|
7339
7340
|
errorPath: s,
|
|
7340
|
-
result:
|
|
7341
|
-
} : { result:
|
|
7341
|
+
result: Xd.False
|
|
7342
|
+
} : { result: Xd.Unknown };
|
|
7342
7343
|
}
|
|
7343
7344
|
});
|
|
7344
7345
|
}
|
|
7345
7346
|
//#endregion
|
|
7346
7347
|
//#region ../../node_modules/.bun/@wopjs+cast@0.1.16/node_modules/@wopjs/cast/dist/index.mjs
|
|
7347
|
-
var
|
|
7348
|
+
var Qd = (e) => typeof e == "string", $d = Array.isArray, ef = (e) => typeof e == "object" && !!e, tf = (e) => ef(e) && !$d(e), nf = (e) => tf(e) ? e : void 0;
|
|
7348
7349
|
//#endregion
|
|
7349
7350
|
//#region src/manifest/common/schemaComparer.ts
|
|
7351
|
+
function rf(e) {
|
|
7352
|
+
return nf(e)?.type === "string";
|
|
7353
|
+
}
|
|
7350
7354
|
function af(e) {
|
|
7351
|
-
|
|
7355
|
+
let t = nf(e), n = nf(t?.error);
|
|
7356
|
+
if (t == null || n == null || t.packageId != null && !Qd(t.packageId) || n.message != null && !Qd(n.message)) throw TypeError("Invalid schema comparison context.");
|
|
7352
7357
|
}
|
|
7353
7358
|
function of(e) {
|
|
7354
|
-
|
|
7355
|
-
if (t == null || n == null || t.packageId != null && !$d(t.packageId) || n.message != null && !$d(n.message)) throw TypeError("Invalid schema comparison context.");
|
|
7356
|
-
}
|
|
7357
|
-
function sf(e) {
|
|
7358
|
-
return e == null ? { error: {} } : (of(e), e);
|
|
7359
|
+
return e == null ? { error: {} } : (af(e), e);
|
|
7359
7360
|
}
|
|
7360
|
-
var
|
|
7361
|
+
var sf = class e {
|
|
7361
7362
|
static setError(t, n, r) {
|
|
7362
7363
|
t instanceof e ? t.context.error.message = r : n instanceof e && (n.context.error.message = r);
|
|
7363
7364
|
}
|
|
7364
7365
|
constructor(e, t, n) {
|
|
7365
|
-
this.id = e, this.value = t, this.context =
|
|
7366
|
+
this.id = e, this.value = t, this.context = of(n);
|
|
7366
7367
|
}
|
|
7367
7368
|
compare(e) {
|
|
7368
|
-
return
|
|
7369
|
+
return Kl(e) && Z(e) === X.Any ? [H.ContainedBy] : this.compareImpl(e);
|
|
7369
7370
|
}
|
|
7370
|
-
},
|
|
7371
|
+
}, cf = class e extends sf {
|
|
7371
7372
|
static isMatch(e) {
|
|
7372
|
-
let t =
|
|
7373
|
-
return Array.isArray(t) && t.every((e) =>
|
|
7373
|
+
let t = nf(e)?.enum;
|
|
7374
|
+
return Array.isArray(t) && t.every((e) => Qd(e));
|
|
7374
7375
|
}
|
|
7375
7376
|
constructor(t, n, r) {
|
|
7376
7377
|
if (!e.isMatch(n)) throw TypeError("Invalid single-select schema.");
|
|
7377
7378
|
super(t, n, r);
|
|
7378
7379
|
}
|
|
7379
7380
|
compareImpl(t) {
|
|
7380
|
-
if (
|
|
7381
|
+
if (rf(t)) return [H.ContainedBy];
|
|
7381
7382
|
if (t instanceof e) {
|
|
7382
7383
|
let e = new Set(this.value.enum), n = H.Equals;
|
|
7383
7384
|
for (let r of t.value.enum) e.has(r) || (n = H.ContainedBy), e.delete(r);
|
|
@@ -7396,58 +7397,58 @@ var cf = class e {
|
|
|
7396
7397
|
}
|
|
7397
7398
|
return !1;
|
|
7398
7399
|
}
|
|
7399
|
-
},
|
|
7400
|
+
}, lf = class e extends sf {
|
|
7400
7401
|
static isMatch(e) {
|
|
7401
|
-
return
|
|
7402
|
+
return nf(e)?.contentMediaType === "oomol/bin";
|
|
7402
7403
|
}
|
|
7403
7404
|
constructor(t, n, r) {
|
|
7404
7405
|
if (!e.isMatch(n)) throw TypeError("Invalid binary schema.");
|
|
7405
7406
|
super(t, n, r);
|
|
7406
7407
|
}
|
|
7407
7408
|
compareImpl(t) {
|
|
7408
|
-
return t instanceof e ? [H.Equals] : (
|
|
7409
|
+
return t instanceof e ? [H.Equals] : (sf.setError(this, t, "edgeError.binDiffType"), [H.Rejection]);
|
|
7409
7410
|
}
|
|
7410
7411
|
equals(t) {
|
|
7411
7412
|
return t instanceof e;
|
|
7412
7413
|
}
|
|
7413
|
-
},
|
|
7414
|
+
}, uf = class e extends sf {
|
|
7414
7415
|
static isMatch(e) {
|
|
7415
|
-
return
|
|
7416
|
+
return nf(e)?.contentMediaType === "oomol/artifact";
|
|
7416
7417
|
}
|
|
7417
7418
|
constructor(t, n, r) {
|
|
7418
7419
|
if (!e.isMatch(n)) throw TypeError("Invalid Artifact schema.");
|
|
7419
7420
|
super(t, n, r);
|
|
7420
7421
|
}
|
|
7421
7422
|
compareImpl(t) {
|
|
7422
|
-
return t instanceof e ? [H.Equals] : (
|
|
7423
|
+
return t instanceof e ? [H.Equals] : (sf.setError(this, t, "edgeError.artifactDiffType"), [H.Rejection]);
|
|
7423
7424
|
}
|
|
7424
7425
|
equals(t) {
|
|
7425
7426
|
return t instanceof e;
|
|
7426
7427
|
}
|
|
7427
7428
|
};
|
|
7428
|
-
function
|
|
7429
|
-
return
|
|
7429
|
+
function df() {
|
|
7430
|
+
return Zd({ extendsSchemaClasses: [
|
|
7431
|
+
cf,
|
|
7430
7432
|
lf,
|
|
7431
|
-
uf
|
|
7432
|
-
df
|
|
7433
|
+
uf
|
|
7433
7434
|
] });
|
|
7434
7435
|
}
|
|
7435
|
-
|
|
7436
|
+
df();
|
|
7436
7437
|
//#endregion
|
|
7437
7438
|
//#region src/flow/common/schema.ts
|
|
7438
|
-
function
|
|
7439
|
+
function ff(e) {
|
|
7439
7440
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
7440
7441
|
}
|
|
7441
|
-
var
|
|
7442
|
-
function
|
|
7442
|
+
var pf = /* @__PURE__ */ new WeakMap();
|
|
7443
|
+
function mf(e, t) {
|
|
7443
7444
|
if (typeof t == "boolean") return t;
|
|
7444
|
-
let n =
|
|
7445
|
-
if (n == null || n.properties != null &&
|
|
7445
|
+
let n = ff(t);
|
|
7446
|
+
if (n == null || n.properties != null && ff(n.properties) == null) return !1;
|
|
7446
7447
|
try {
|
|
7447
|
-
let t =
|
|
7448
|
+
let t = pf.get(n);
|
|
7448
7449
|
if (t == null) {
|
|
7449
7450
|
let e = typeof n.$schema == "string" ? n.$schema : "", r = e.includes("draft-04") ? "4" : e.includes("draft-07") ? "7" : e.includes("2020-12") ? "2020-12" : "2019-09";
|
|
7450
|
-
t = new vc(structuredClone(n), r),
|
|
7451
|
+
t = new vc(structuredClone(n), r), pf.set(n, t);
|
|
7451
7452
|
}
|
|
7452
7453
|
return t.validate(e).valid;
|
|
7453
7454
|
} catch {
|
|
@@ -7543,14 +7544,14 @@ var $ = js(() => F([Jo(), rs({
|
|
|
7543
7544
|
exclusiveMinimum: M().optional(),
|
|
7544
7545
|
exclusiveMaximum: M().optional()
|
|
7545
7546
|
}).transform(({ title: e, default: t, examples: n, readOnly: r, writeOnly: i, deprecated: a, $comment: o, ...s }) => s)]));
|
|
7546
|
-
function
|
|
7547
|
+
function hf(e, t) {
|
|
7547
7548
|
if (e.kind == "value") return e.value;
|
|
7548
7549
|
if (!Object.hasOwn(t, e.input)) throw Error(`Agent input ${e.input} is missing.`);
|
|
7549
7550
|
return t[e.input];
|
|
7550
7551
|
}
|
|
7551
7552
|
//#endregion
|
|
7552
7553
|
//#region src/base/common/json.ts
|
|
7553
|
-
function
|
|
7554
|
+
function gf(e) {
|
|
7554
7555
|
if (e === null || typeof e == "boolean" || typeof e == "string") return !0;
|
|
7555
7556
|
if (typeof e == "number") return Number.isFinite(e);
|
|
7556
7557
|
if (typeof e != "object") return !1;
|
|
@@ -7601,16 +7602,16 @@ function _f(e) {
|
|
|
7601
7602
|
}
|
|
7602
7603
|
}
|
|
7603
7604
|
}
|
|
7604
|
-
function
|
|
7605
|
+
function _f(e) {
|
|
7605
7606
|
try {
|
|
7606
|
-
return typeof e == "object" && !!e && !Array.isArray(e) &&
|
|
7607
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && gf(e);
|
|
7607
7608
|
} catch {
|
|
7608
7609
|
return !1;
|
|
7609
7610
|
}
|
|
7610
7611
|
}
|
|
7611
7612
|
//#endregion
|
|
7612
7613
|
//#region src/trigger/common/contract.ts
|
|
7613
|
-
var
|
|
7614
|
+
var vf = [
|
|
7614
7615
|
{
|
|
7615
7616
|
handle: "headers",
|
|
7616
7617
|
jsonSchema: {
|
|
@@ -7643,7 +7644,7 @@ var yf = [
|
|
|
7643
7644
|
jsonSchema: { type: "string" },
|
|
7644
7645
|
nullable: !1
|
|
7645
7646
|
}
|
|
7646
|
-
],
|
|
7647
|
+
], yf = [{
|
|
7647
7648
|
description: "The scheduled time that triggered this run, in ISO 8601 format.",
|
|
7648
7649
|
handle: "scheduledAt",
|
|
7649
7650
|
jsonSchema: {
|
|
@@ -7652,13 +7653,13 @@ var yf = [
|
|
|
7652
7653
|
},
|
|
7653
7654
|
nullable: !1
|
|
7654
7655
|
}];
|
|
7655
|
-
function
|
|
7656
|
+
function bf(e) {
|
|
7656
7657
|
switch (e.kind) {
|
|
7657
7658
|
case "manual": return [];
|
|
7658
|
-
case "cron": return
|
|
7659
|
+
case "cron": return yf;
|
|
7659
7660
|
case "poll":
|
|
7660
7661
|
case "integration": return e.definition.outputs;
|
|
7661
|
-
case "webhook": return
|
|
7662
|
+
case "webhook": return vf.map((t) => t.handle === "body" ? Object.assign({}, t, { jsonSchema: {
|
|
7662
7663
|
type: "object",
|
|
7663
7664
|
additionalProperties: !1,
|
|
7664
7665
|
properties: Object.fromEntries(e.bodyFields.map((e) => [e.handle, e.jsonSchema])),
|
|
@@ -7666,82 +7667,80 @@ function xf(e) {
|
|
|
7666
7667
|
} }) : t);
|
|
7667
7668
|
}
|
|
7668
7669
|
}
|
|
7669
|
-
function
|
|
7670
|
-
if (!
|
|
7671
|
-
let n =
|
|
7672
|
-
return new Set(n.map((e) => e.handle)).size === n.length && Object.keys(t).length === n.length && n.every((e) => Object.hasOwn(t, e.handle) && (t[e.handle] === null && e.nullable ||
|
|
7670
|
+
function xf(e, t) {
|
|
7671
|
+
if (!_f(t)) return !1;
|
|
7672
|
+
let n = bf(e);
|
|
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 || mf(t[e.handle], e.jsonSchema)));
|
|
7673
7674
|
}
|
|
7674
7675
|
//#endregion
|
|
7675
7676
|
//#region src/flow/common/graph.ts
|
|
7676
|
-
function
|
|
7677
|
+
function Sf(e) {
|
|
7677
7678
|
return e?.kind == "approval" || e?.kind == "wait";
|
|
7678
7679
|
}
|
|
7679
|
-
function
|
|
7680
|
+
function Cf(e) {
|
|
7680
7681
|
return e.kind == "wait" ? ["continue"] : ["approve", "reject"];
|
|
7681
7682
|
}
|
|
7683
|
+
var wf = (e) => ({
|
|
7684
|
+
nullable: !1,
|
|
7685
|
+
jsonSchema: {
|
|
7686
|
+
type: "object",
|
|
7687
|
+
properties: e,
|
|
7688
|
+
required: Object.keys(e),
|
|
7689
|
+
additionalProperties: !1
|
|
7690
|
+
}
|
|
7691
|
+
});
|
|
7682
7692
|
function Tf(e) {
|
|
7683
|
-
let t =
|
|
7693
|
+
let t = Cf(e), n = {
|
|
7694
|
+
type: "object",
|
|
7695
|
+
properties: Object.fromEntries(e.inputDefinitions.map((e) => [e.handle, {}])),
|
|
7696
|
+
required: e.inputDefinitions.map((e) => e.handle),
|
|
7697
|
+
additionalProperties: !1
|
|
7698
|
+
};
|
|
7684
7699
|
return {
|
|
7685
|
-
pending: {
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
action: { enum: t },
|
|
7698
|
-
url: { type: "string" }
|
|
7699
|
-
},
|
|
7700
|
-
required: ["action", "url"],
|
|
7701
|
-
additionalProperties: !1
|
|
7702
|
-
}
|
|
7703
|
-
},
|
|
7704
|
-
expiresAt: { type: "string" }
|
|
7705
|
-
},
|
|
7706
|
-
required: [
|
|
7707
|
-
"value",
|
|
7708
|
-
"prompt",
|
|
7709
|
-
"actions",
|
|
7710
|
-
"expiresAt"
|
|
7711
|
-
],
|
|
7712
|
-
additionalProperties: !1
|
|
7713
|
-
}
|
|
7714
|
-
},
|
|
7715
|
-
...Object.fromEntries(t.map((t) => [t, {
|
|
7716
|
-
jsonSchema: e.input.jsonSchema,
|
|
7717
|
-
nullable: e.input.nullable,
|
|
7718
|
-
...e.input.description == null ? {} : { description: e.input.description }
|
|
7719
|
-
}]))
|
|
7700
|
+
pending: wf({
|
|
7701
|
+
inputs: n,
|
|
7702
|
+
prompt: { type: "string" },
|
|
7703
|
+
...Object.fromEntries(t.map((e) => [`${e}Url`, { type: "string" }])),
|
|
7704
|
+
expiresAt: { type: "string" }
|
|
7705
|
+
}),
|
|
7706
|
+
...Object.fromEntries(t.map((e) => [e, wf({
|
|
7707
|
+
inputs: n,
|
|
7708
|
+
action: { const: e },
|
|
7709
|
+
resolvedAt: { type: "string" },
|
|
7710
|
+
comment: { type: ["string", "null"] }
|
|
7711
|
+
})]))
|
|
7720
7712
|
};
|
|
7721
7713
|
}
|
|
7722
7714
|
//#endregion
|
|
7715
|
+
//#region src/execution/common/wait.ts
|
|
7716
|
+
var Ef = A().trim().refine((e) => [...e].length <= 2e3, "Wait comment must contain at most 2,000 Unicode code points.").nullable().optional();
|
|
7717
|
+
function Df(e) {
|
|
7718
|
+
return Ef.parse(e) || null;
|
|
7719
|
+
}
|
|
7720
|
+
//#endregion
|
|
7723
7721
|
//#region src/execution/common/scheduler.ts
|
|
7724
|
-
|
|
7722
|
+
var Of = Df;
|
|
7723
|
+
function kf(e, t) {
|
|
7725
7724
|
return e.edges.some((e) => e.source == t && e.sourceHandle == "pending") || Object.values(e.nodes).some((e) => "inputs" in e && Object.values(e.inputs).some((e) => e.kind == "sources" && e.sources.some((e) => e.kind == "node" && e.nodeId == t && e.output == "pending")));
|
|
7726
7725
|
}
|
|
7727
|
-
var
|
|
7728
|
-
function
|
|
7726
|
+
var Af = 12e4;
|
|
7727
|
+
function jf(e, t) {
|
|
7729
7728
|
return t?.(e) ?? {
|
|
7730
7729
|
code: "node.failed",
|
|
7731
7730
|
message: e instanceof Error ? e.message : String(e)
|
|
7732
7731
|
};
|
|
7733
7732
|
}
|
|
7734
|
-
function
|
|
7733
|
+
function Mf(e, t) {
|
|
7735
7734
|
switch (t.kind) {
|
|
7736
7735
|
case "condition": return { [t.input.handle]: t.input };
|
|
7737
7736
|
case "value": return {};
|
|
7738
|
-
case "subflow": return
|
|
7739
|
-
case "task": return
|
|
7737
|
+
case "subflow": return Qc(e.subflows[t.subflowId].inputs);
|
|
7738
|
+
case "task": return Qc([...t.task == null ? e.tasks[t.taskId].inputs : t.task.inputs, ...t.additionalInputs ?? []]);
|
|
7740
7739
|
case "approval":
|
|
7741
|
-
case "wait": return
|
|
7740
|
+
case "wait": return Qc(t.inputDefinitions);
|
|
7742
7741
|
}
|
|
7743
7742
|
}
|
|
7744
|
-
function
|
|
7743
|
+
function Nf(e, t) {
|
|
7745
7744
|
if (t.name != null) return t.name;
|
|
7746
7745
|
switch (t.kind) {
|
|
7747
7746
|
case "condition": return;
|
|
@@ -7752,45 +7751,45 @@ function Af(e, t) {
|
|
|
7752
7751
|
case "wait": return "Wait";
|
|
7753
7752
|
}
|
|
7754
7753
|
}
|
|
7755
|
-
function
|
|
7754
|
+
function Pf(e, t) {
|
|
7756
7755
|
return t.kind == "task" ? t.task == null ? e.tasks[t.taskId].executor.kind : "javascript" : t.kind;
|
|
7757
7756
|
}
|
|
7758
|
-
function
|
|
7757
|
+
function Ff(e, t) {
|
|
7759
7758
|
if (typeof e != "object" || !e || Array.isArray(e)) throw Error(`${t} must be an object.`);
|
|
7760
7759
|
return e;
|
|
7761
7760
|
}
|
|
7762
|
-
function
|
|
7761
|
+
function If(e, t, n) {
|
|
7763
7762
|
let r = Object.keys(e);
|
|
7764
7763
|
if (r.length != t.length || r.some((e) => !t.includes(e))) throw Error(`${n} contains unsupported fields.`);
|
|
7765
7764
|
}
|
|
7766
|
-
function
|
|
7765
|
+
function Lf(e, t) {
|
|
7767
7766
|
if (typeof e != "string" || e.length == 0) throw Error(`${t} must be a non-empty string.`);
|
|
7768
7767
|
return e;
|
|
7769
7768
|
}
|
|
7770
|
-
function
|
|
7769
|
+
function Rf(e, t, n = 0) {
|
|
7771
7770
|
if (n > 64) throw Error(`${t} exceeds the maximum JSON depth.`);
|
|
7772
7771
|
if (e === null || typeof e == "boolean" || typeof e == "string" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
7773
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
7774
|
-
let r =
|
|
7775
|
-
return Object.fromEntries(Object.entries(r).map(([e, r]) => [e,
|
|
7772
|
+
if (Array.isArray(e)) return e.map((e) => Rf(e, t, n + 1));
|
|
7773
|
+
let r = Ff(e, t);
|
|
7774
|
+
return Object.fromEntries(Object.entries(r).map(([e, r]) => [e, Rf(r, t, n + 1)]));
|
|
7776
7775
|
}
|
|
7777
|
-
var
|
|
7776
|
+
var zf = rs({
|
|
7778
7777
|
state: Fs(),
|
|
7779
7778
|
callId: A().min(1),
|
|
7780
7779
|
toolId: A().min(1),
|
|
7781
7780
|
input: I(A(), Fs()),
|
|
7782
7781
|
rounds: M().int().nonnegative(),
|
|
7783
7782
|
version: R(1)
|
|
7784
|
-
}),
|
|
7783
|
+
}), Bf = F([rs({
|
|
7785
7784
|
kind: R("completed"),
|
|
7786
7785
|
output: Fs()
|
|
7787
7786
|
}), rs({
|
|
7788
7787
|
kind: R("suspended"),
|
|
7789
|
-
checkpoint:
|
|
7788
|
+
checkpoint: zf
|
|
7790
7789
|
})]);
|
|
7791
|
-
function
|
|
7792
|
-
let t =
|
|
7793
|
-
if (
|
|
7790
|
+
function Vf(e) {
|
|
7791
|
+
let t = Ff(e, "Flow Run checkpoint");
|
|
7792
|
+
if (If(t, [
|
|
7794
7793
|
"agents",
|
|
7795
7794
|
"bindingValues",
|
|
7796
7795
|
"counts",
|
|
@@ -7800,14 +7799,14 @@ function Rf(e) {
|
|
|
7800
7799
|
"version",
|
|
7801
7800
|
"waits"
|
|
7802
7801
|
], "Flow Run checkpoint"), t.version != 5) throw Error("Flow Run checkpoint version is unsupported.");
|
|
7803
|
-
let n = Object.fromEntries(Object.entries(
|
|
7802
|
+
let n = Object.fromEntries(Object.entries(Ff(t.bindingValues, "Checkpoint bindings")).map(([e, t]) => {
|
|
7804
7803
|
if (typeof t != "string") throw Error("Checkpoint binding must be a string.");
|
|
7805
7804
|
return [e, t];
|
|
7806
|
-
})), r = Object.fromEntries(Object.entries(
|
|
7807
|
-
let n =
|
|
7808
|
-
return
|
|
7809
|
-
jobId:
|
|
7810
|
-
outputs: Object.fromEntries(Object.entries(
|
|
7805
|
+
})), r = Object.fromEntries(Object.entries(Ff(t.inputs, "Checkpoint inputs")).map(([e, t]) => [e, Object.fromEntries(Object.entries(Ff(t, "Checkpoint node inputs")).map(([e, t]) => [e, Rf(t, "Checkpoint input")]))])), i = Object.fromEntries(Object.entries(Ff(t.results, "Checkpoint results")).map(([e, t]) => {
|
|
7806
|
+
let n = Ff(t, "Checkpoint result");
|
|
7807
|
+
return If(n, ["jobId", "outputs"], "Checkpoint result"), [e, {
|
|
7808
|
+
jobId: Lf(n.jobId, "Checkpoint job ID"),
|
|
7809
|
+
outputs: Object.fromEntries(Object.entries(Ff(n.outputs, "Checkpoint outputs")).map(([e, t]) => [e, Rf(t, "Checkpoint output")]))
|
|
7811
7810
|
}];
|
|
7812
7811
|
})), a = I(A(), I(A(), M().int().positive().max(2 ** 53 - 1))).parse(t.counts), o = I(A(), I(A(), I(A(), Fs()))).parse(t.frames), s = {
|
|
7813
7812
|
jobId: A().min(1),
|
|
@@ -7827,7 +7826,7 @@ function Rf(e) {
|
|
|
7827
7826
|
invocationId: A().min(1),
|
|
7828
7827
|
input: I(A(), Fs()),
|
|
7829
7828
|
remainingMs: M().positive().optional(),
|
|
7830
|
-
checkpoint:
|
|
7829
|
+
checkpoint: zf
|
|
7831
7830
|
})).parse(t.agents), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
7832
7831
|
for (let e of c) {
|
|
7833
7832
|
if (u.has(e.jobId) || d.has(e.waitId) || o[e.jobId] == null || Object.values(i).some((t) => t.jobId == e.jobId)) throw Error("Checkpoint waiting execution states conflict.");
|
|
@@ -7846,18 +7845,18 @@ function Rf(e) {
|
|
|
7846
7845
|
waits: c
|
|
7847
7846
|
};
|
|
7848
7847
|
}
|
|
7849
|
-
function
|
|
7848
|
+
function Hf(e, t) {
|
|
7850
7849
|
if (e === t) return !0;
|
|
7851
7850
|
if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
|
|
7852
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) =>
|
|
7851
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => Hf(e, t[n]));
|
|
7853
7852
|
let n = Object.entries(e), r = Object.entries(t), i = t;
|
|
7854
|
-
return n.length == r.length && n.every(([e, t]) => Object.hasOwn(i, e) &&
|
|
7853
|
+
return n.length == r.length && n.every(([e, t]) => Object.hasOwn(i, e) && Hf(t, i[e]));
|
|
7855
7854
|
}
|
|
7856
|
-
function
|
|
7855
|
+
function Uf(e, t, n) {
|
|
7857
7856
|
let r = Object.hasOwn(n, t.input) ? n[t.input] : null, i = t.value;
|
|
7858
7857
|
switch (t.operator) {
|
|
7859
|
-
case "==": return i !== void 0 &&
|
|
7860
|
-
case "!=": return i !== void 0 && !
|
|
7858
|
+
case "==": return i !== void 0 && Hf(r, i);
|
|
7859
|
+
case "!=": return i !== void 0 && !Hf(r, i);
|
|
7861
7860
|
case ">": return typeof r == "number" && typeof i == "number" && r > i;
|
|
7862
7861
|
case ">=": return typeof r == "number" && typeof i == "number" && r >= i;
|
|
7863
7862
|
case "<": return typeof r == "number" && typeof i == "number" && r < i;
|
|
@@ -7865,7 +7864,7 @@ function Bf(e, t, n) {
|
|
|
7865
7864
|
case "contains":
|
|
7866
7865
|
case "notContains": {
|
|
7867
7866
|
let e;
|
|
7868
|
-
return typeof r == "string" && typeof i == "string" ? e = r.includes(i) : Array.isArray(r) && i !== void 0 && (e = r.some((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;
|
|
7869
7868
|
}
|
|
7870
7869
|
case "startsWith": return typeof r == "string" && typeof i == "string" && r.startsWith(i);
|
|
7871
7870
|
case "endsWith": return typeof r == "string" && typeof i == "string" && r.endsWith(i);
|
|
@@ -7878,7 +7877,7 @@ function Bf(e, t, n) {
|
|
|
7878
7877
|
case "hasValue":
|
|
7879
7878
|
case "notHasValue": {
|
|
7880
7879
|
if (r == null || Array.isArray(r) || typeof r != "object" || i === void 0) return !1;
|
|
7881
|
-
let e = Object.values(r).some((e) =>
|
|
7880
|
+
let e = Object.values(r).some((e) => Hf(e, i));
|
|
7882
7881
|
return t.operator == "hasValue" ? e : !e;
|
|
7883
7882
|
}
|
|
7884
7883
|
case "isEmpty":
|
|
@@ -7892,17 +7891,17 @@ function Bf(e, t, n) {
|
|
|
7892
7891
|
case "isFalse": return r === !1;
|
|
7893
7892
|
}
|
|
7894
7893
|
}
|
|
7895
|
-
function
|
|
7894
|
+
function Wf(e, t) {
|
|
7896
7895
|
if (e === void 0) return {};
|
|
7897
7896
|
if (typeof e != "object" || !e || Array.isArray(e)) throw Error(`Node "${t}" must return an object.`);
|
|
7898
7897
|
return e;
|
|
7899
7898
|
}
|
|
7900
|
-
function
|
|
7899
|
+
function Gf(e, t) {
|
|
7901
7900
|
let n = t.kind == "task" && t.taskId != null ? e.tasks[t.taskId] : void 0;
|
|
7902
7901
|
return n?.executor.kind == "agent" ? n.executor : void 0;
|
|
7903
7902
|
}
|
|
7904
|
-
function
|
|
7905
|
-
let r =
|
|
7903
|
+
function Kf(e, t, n) {
|
|
7904
|
+
let r = Gf(e, t)?.notification;
|
|
7906
7905
|
if (r == null) return;
|
|
7907
7906
|
let i = e.tasks[r.taskId];
|
|
7908
7907
|
return {
|
|
@@ -7911,17 +7910,17 @@ function Uf(e, t, n) {
|
|
|
7911
7910
|
input: Object.fromEntries(i.inputs.flatMap((e) => {
|
|
7912
7911
|
if (!("handle" in e) || e.handle == r.messageHandle) return [];
|
|
7913
7912
|
let t = r.inputs[e.handle];
|
|
7914
|
-
return [[e.handle, t == null ? e.value ?? null :
|
|
7913
|
+
return [[e.handle, t == null ? e.value ?? null : hf(t, n)]];
|
|
7915
7914
|
}))
|
|
7916
7915
|
};
|
|
7917
7916
|
}
|
|
7918
|
-
function
|
|
7917
|
+
function qf(e, t, n) {
|
|
7919
7918
|
let r = e.tools.find((e) => e.id == t.toolId);
|
|
7920
7919
|
if (r == null || !r.approval || t.rounds > e.maxRounds) throw Error("Agent pause does not match its tool declaration.");
|
|
7921
7920
|
for (let e of r.inputs) {
|
|
7922
7921
|
let r = t.input[e.handle];
|
|
7923
|
-
if (r === void 0 || !(r === null && e.nullable) && !
|
|
7924
|
-
if (e.source.kind != "model" && !
|
|
7922
|
+
if (r === void 0 || !(r === null && e.nullable) && !mf(r, e.jsonSchema)) throw Error("Agent pause arguments are invalid.");
|
|
7923
|
+
if (e.source.kind != "model" && !Hf(r, hf(e.source, n))) throw Error("Agent pause changed fixed arguments.");
|
|
7925
7924
|
}
|
|
7926
7925
|
if (Object.keys(t.input).length != r.inputs.length) throw Error("Agent pause contains undeclared arguments.");
|
|
7927
7926
|
return {
|
|
@@ -7932,8 +7931,8 @@ function Wf(e, t, n) {
|
|
|
7932
7931
|
input: t.input
|
|
7933
7932
|
};
|
|
7934
7933
|
}
|
|
7935
|
-
function
|
|
7936
|
-
let i =
|
|
7934
|
+
function Jf(e, t, n, r) {
|
|
7935
|
+
let i = Wf(r, t), a = n.kind == "task" && n.taskId != null && e.tasks[n.taskId].executor.kind == "connector", o = Sf(n) ? Tf(n) : n.kind == "task" ? Qc(n.task == null ? e.tasks[n.taskId].outputs : n.task.outputs) : n.kind == "subflow" ? Qc(e.subflows[n.subflowId].outputs) : n.kind == "value" ? Qc(n.values) : Object.fromEntries([...n.cases.map((e) => e.output), ...n.defaultOutput == null ? [] : [n.defaultOutput]].map((e) => [e, n.input])), s = Wf(Rf(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" || Sf(n) ? s : {
|
|
7937
7936
|
...Object.fromEntries(Object.keys(o).map((e) => [e, null])),
|
|
7938
7937
|
...s
|
|
7939
7938
|
}, l = {};
|
|
@@ -7943,12 +7942,12 @@ function Gf(e, t, n, r) {
|
|
|
7943
7942
|
if (a) continue;
|
|
7944
7943
|
throw Error(`Node "${t}" output "${e}" does not match its declaration.`);
|
|
7945
7944
|
}
|
|
7946
|
-
if (!(n === null && r.nullable) && !
|
|
7945
|
+
if (!(n === null && r.nullable) && !mf(n, r.jsonSchema)) throw Error(`Node "${t}" output "${e}" does not match its declaration.`);
|
|
7947
7946
|
l[e] = n;
|
|
7948
7947
|
}
|
|
7949
7948
|
return l;
|
|
7950
7949
|
}
|
|
7951
|
-
function
|
|
7950
|
+
function Yf(e, t, n, r) {
|
|
7952
7951
|
let i = n.inputs, a = n.agents;
|
|
7953
7952
|
if ([...Object.keys(n.results), ...Object.keys(i)].some((e) => t.graph.nodes[e] == null)) throw Error("Checkpoint nodes do not match the prepared graph.");
|
|
7954
7953
|
for (let [r, i] of Object.entries(n.counts)) {
|
|
@@ -7965,10 +7964,10 @@ function Kf(e, t, n, r) {
|
|
|
7965
7964
|
if (r == null) throw Error("Checkpoint result node is missing.");
|
|
7966
7965
|
if ("inputs" in r) {
|
|
7967
7966
|
if (n.counts[""]?.[a] == null) throw Error("Checkpoint execution count is missing.");
|
|
7968
|
-
if (!
|
|
7967
|
+
if (!Hf(Jf(e, a, r, o), o)) throw Error("Checkpoint node outputs are incomplete.");
|
|
7969
7968
|
let t = Object.keys(o).length;
|
|
7970
|
-
if (r.kind == "condition" && (t > 1 || r.defaultOutput != null && t != 1) ||
|
|
7971
|
-
} else if (!
|
|
7969
|
+
if (r.kind == "condition" && (t > 1 || r.defaultOutput != null && t != 1) || Sf(r) && (Cf(r).filter((e) => Object.hasOwn(o, e)).length > 1 || !Cf(r).some((e) => Object.hasOwn(o, e)) && !(i && Object.hasOwn(o, "pending")))) throw Error("Checkpoint branch result is invalid.");
|
|
7970
|
+
} else if (!xf(r, o)) throw Error("Checkpoint Trigger output is invalid.");
|
|
7972
7971
|
}
|
|
7973
7972
|
};
|
|
7974
7973
|
o(Object.fromEntries(Object.entries(n.results).map(([e, t]) => [e, t.outputs])));
|
|
@@ -7977,36 +7976,36 @@ function Kf(e, t, n, r) {
|
|
|
7977
7976
|
for (let e of Object.values(n.frames)) {
|
|
7978
7977
|
o(e, !0);
|
|
7979
7978
|
let r = Object.keys(e).filter((e) => !("inputs" in t.graph.nodes[e]));
|
|
7980
|
-
if (r.length != 1 || r[0] != s[0] || !
|
|
7979
|
+
if (r.length != 1 || r[0] != s[0] || !Hf(e[r[0]], n.results[r[0]].outputs)) throw Error("Checkpoint frame Trigger does not match the Run.");
|
|
7981
7980
|
}
|
|
7982
7981
|
let c = /* @__PURE__ */ new Map();
|
|
7983
7982
|
for (let e of n.waits) c.set(e.nodeId, (c.get(e.nodeId) ?? 0) + 1);
|
|
7984
7983
|
for (let [e, t] of c) if ((n.counts[""]?.[e] ?? 0) < t + (n.results[e] == null ? 0 : 1)) throw Error("Checkpoint waiting execution count is incomplete.");
|
|
7985
7984
|
for (let [n, r] of Object.entries(i)) {
|
|
7986
7985
|
let i = t.graph.nodes[n];
|
|
7987
|
-
if (!("inputs" in i) || Object.keys(r).some((t) =>
|
|
7986
|
+
if (!("inputs" in i) || Object.keys(r).some((t) => Mf(e, i)[t] == null)) throw Error("Checkpoint launch inputs do not match the prepared graph.");
|
|
7988
7987
|
}
|
|
7989
7988
|
for (let i of n.waits) {
|
|
7990
7989
|
let o = t.graph.nodes[i.nodeId];
|
|
7991
7990
|
if (o == null || !("inputs" in o)) throw Error("Checkpoint waiting node is missing.");
|
|
7992
|
-
let s =
|
|
7993
|
-
if (!
|
|
7991
|
+
let s = Gf(e, o), c = a[i.jobId];
|
|
7992
|
+
if (!Sf(o) && s == null) throw Error("Checkpoint waiting node cannot suspend.");
|
|
7994
7993
|
if (s != null) {
|
|
7995
7994
|
if (c != null && c.invocationId != i.jobId) throw Error("Checkpoint Agent invocation identity changed.");
|
|
7996
7995
|
if (c == null || o.timeoutMs == null != (c.remainingMs == null) || c.remainingMs != null && c.remainingMs > o.timeoutMs) throw Error("Checkpoint Agent budget is invalid.");
|
|
7997
|
-
let e =
|
|
7998
|
-
if (!
|
|
7999
|
-
if (!
|
|
7996
|
+
let e = qf(s, c.checkpoint, c.input);
|
|
7997
|
+
if (!Hf(i.value, e)) throw Error("Checkpoint Agent approval does not match its saved call.");
|
|
7998
|
+
if (!Hf(r(i.nodeId, o, i.jobId), c.input)) throw Error("Checkpoint Agent inputs changed.");
|
|
8000
7999
|
} else {
|
|
8001
8000
|
if (c != null) throw Error("Checkpoint Wait contains Agent state.");
|
|
8002
|
-
if (!
|
|
8003
|
-
if (
|
|
8004
|
-
i.pending != null &&
|
|
8001
|
+
if (!Sf(o) || !Hf(r(i.nodeId, o, i.jobId), i.value)) throw Error("Checkpoint resolution input changed.");
|
|
8002
|
+
if (kf(t.graph, i.nodeId) != (i.pending != null)) throw Error("Checkpoint Wait pending output is missing or unexpected.");
|
|
8003
|
+
i.pending != null && Jf(e, i.nodeId, o, { pending: i.pending });
|
|
8005
8004
|
}
|
|
8006
8005
|
if (n.counts[""]?.[i.nodeId] == null) throw Error("Checkpoint waiting execution count is missing.");
|
|
8007
8006
|
}
|
|
8008
8007
|
}
|
|
8009
|
-
function
|
|
8008
|
+
function Xf(i, o, s, c, l, u = {}, d, f) {
|
|
8010
8009
|
return t.scoped(t.gen(function* () {
|
|
8011
8010
|
f ?? (yield* i.emit({
|
|
8012
8011
|
flowId: o.flowId,
|
|
@@ -8027,7 +8026,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8027
8026
|
if (f == null) {
|
|
8028
8027
|
if (d != null) {
|
|
8029
8028
|
let e = o.graph.nodes[d.nodeId];
|
|
8030
|
-
if (e == null || "inputs" in e || !
|
|
8029
|
+
if (e == null || "inputs" in e || !xf(e, d.outputs)) throw Error("Trigger outputs are invalid.");
|
|
8031
8030
|
}
|
|
8032
8031
|
for (let [e, t] of Object.entries(o.graph.nodes)) "inputs" in t || d?.nodeId == e && ee.set(e, {
|
|
8033
8032
|
jobId: e,
|
|
@@ -8046,11 +8045,11 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8046
8045
|
if (t.length > 1) throw Error(`${r} has multiple available sources.`);
|
|
8047
8046
|
o = t[0] ?? null;
|
|
8048
8047
|
}
|
|
8049
|
-
if (o === void 0 && (o = null), !(o === null && t.nullable) && !
|
|
8048
|
+
if (o === void 0 && (o = null), !(o === null && t.nullable) && !mf(o, t.jsonSchema)) throw Error(`${r} does not match its declared schema.`);
|
|
8050
8049
|
return o;
|
|
8051
8050
|
}, fe = (e, t, n) => {
|
|
8052
8051
|
let r = t.inputs;
|
|
8053
|
-
return Object.fromEntries(Object.entries(
|
|
8052
|
+
return Object.fromEntries(Object.entries(Mf(i.prepared, t)).map(([t, i]) => [t, de(r[t], i, re[e]?.[t], `Node "${e}" input "${t}"`, ne[n])]));
|
|
8054
8053
|
}, pe = (e, n, r, a = Object.keys(r)) => t.uninterruptible(t.gen(function* () {
|
|
8055
8054
|
yield* i.emit({
|
|
8056
8055
|
jobId: n,
|
|
@@ -8075,9 +8074,8 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8075
8074
|
}, ge = (e, t, n) => {
|
|
8076
8075
|
for (let r of h.get(e) ?? []) (r.sourceHandle == null || t.includes(r.sourceHandle)) && he(r.target, n);
|
|
8077
8076
|
}, _e = (e, n, r, a, c) => {
|
|
8078
|
-
let l =
|
|
8079
|
-
let p =
|
|
8080
|
-
if (Cf(n)) return e == n.input.handle;
|
|
8077
|
+
let l = Gf(i.prepared, n), u = ue[r], d = u?.remainingMs ?? n.timeoutMs, f = performance.now(), p = t.gen(function* () {
|
|
8078
|
+
let p = Pf(i.prepared, n), m = Nf(i.prepared, n), h = Object.fromEntries(Object.entries(a).filter(([e]) => {
|
|
8081
8079
|
let t = n.inputs[e];
|
|
8082
8080
|
return t?.kind != "sources" || t.sources.every((e) => e.kind != "binding");
|
|
8083
8081
|
}));
|
|
@@ -8095,7 +8093,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8095
8093
|
case "condition": {
|
|
8096
8094
|
let e = n.cases.find((e) => {
|
|
8097
8095
|
if (e.expressions.length == 0) return !1;
|
|
8098
|
-
let t = e.expressions.map((e) =>
|
|
8096
|
+
let t = e.expressions.map((e) => Uf(n, e, a));
|
|
8099
8097
|
return e.relation == "all" ? t.every(Boolean) : t.some(Boolean);
|
|
8100
8098
|
})?.output ?? n.defaultOutput;
|
|
8101
8099
|
g = e == null ? {} : { [e]: a[n.input.handle] ?? null };
|
|
@@ -8106,7 +8104,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8106
8104
|
break;
|
|
8107
8105
|
case "subflow": {
|
|
8108
8106
|
let e = i.prepared.subflows[n.subflowId];
|
|
8109
|
-
g = yield*
|
|
8107
|
+
g = yield* Xf(i, {
|
|
8110
8108
|
flowId: n.subflowId,
|
|
8111
8109
|
graph: e.graph,
|
|
8112
8110
|
kind: "subflow"
|
|
@@ -8136,10 +8134,10 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8136
8134
|
}
|
|
8137
8135
|
});
|
|
8138
8136
|
if (l != null) {
|
|
8139
|
-
let n =
|
|
8137
|
+
let n = Bf.parse(m);
|
|
8140
8138
|
if (n.kind == "suspended") {
|
|
8141
8139
|
if (o.kind != "flow") return yield* t.fail(/* @__PURE__ */ Error("Subflow Agent is not supported."));
|
|
8142
|
-
let i = n.checkpoint, s =
|
|
8140
|
+
let i = n.checkpoint, s = qf(l, i, a), c = d == null ? void 0 : d - (performance.now() - f);
|
|
8143
8141
|
if (c != null && c <= 0) throw Error(`Node "${e}" timed out.`);
|
|
8144
8142
|
return {
|
|
8145
8143
|
kind: "suspended",
|
|
@@ -8153,7 +8151,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8153
8151
|
};
|
|
8154
8152
|
}
|
|
8155
8153
|
g = { output: n.output };
|
|
8156
|
-
} else g =
|
|
8154
|
+
} else g = Wf(m, e);
|
|
8157
8155
|
break;
|
|
8158
8156
|
}
|
|
8159
8157
|
case "approval":
|
|
@@ -8162,7 +8160,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8162
8160
|
return yield* t.try({
|
|
8163
8161
|
try: () => ({
|
|
8164
8162
|
kind: "completed",
|
|
8165
|
-
outputs:
|
|
8163
|
+
outputs: Jf(i.prepared, e, n, g)
|
|
8166
8164
|
}),
|
|
8167
8165
|
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
8168
8166
|
});
|
|
@@ -8173,18 +8171,18 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8173
8171
|
}));
|
|
8174
8172
|
}, ve = (e, n, s) => t.gen(function* () {
|
|
8175
8173
|
if (o.kind != "flow" || i.waits == null) return yield* t.fail(/* @__PURE__ */ Error("Wait host is unavailable."));
|
|
8176
|
-
let c = o.graph.nodes[e], l = a(), u =
|
|
8174
|
+
let c = o.graph.nodes[e], l = a(), u = Sf(c) && kf(o.graph, e), d = yield* i.waits.create({
|
|
8177
8175
|
jobId: n,
|
|
8178
8176
|
nodeId: e,
|
|
8179
8177
|
value: s,
|
|
8180
8178
|
waitId: l,
|
|
8181
8179
|
notify: u,
|
|
8182
|
-
actions:
|
|
8183
|
-
prompt:
|
|
8184
|
-
...
|
|
8180
|
+
actions: Sf(c) ? Cf(c) : ["approve", "reject"],
|
|
8181
|
+
prompt: Sf(c) ? c.prompt : JSON.stringify(s, null, 2),
|
|
8182
|
+
...Sf(c) ? {} : { notification: Kf(i.prepared, c, ue[n].input) }
|
|
8185
8183
|
});
|
|
8186
8184
|
if (u) {
|
|
8187
|
-
|
|
8185
|
+
Jf(i.prepared, e, c, { pending: d });
|
|
8188
8186
|
let t = {
|
|
8189
8187
|
...ne[n],
|
|
8190
8188
|
[e]: { pending: d }
|
|
@@ -8200,7 +8198,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8200
8198
|
}), yield* r.offer(v, void 0);
|
|
8201
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* () {
|
|
8202
8200
|
oe ?? (se ??= r), yield* i.emit({
|
|
8203
|
-
...
|
|
8201
|
+
...jf(r, i.projectFailure),
|
|
8204
8202
|
jobId: n,
|
|
8205
8203
|
nodeId: e,
|
|
8206
8204
|
runId: s,
|
|
@@ -8222,17 +8220,19 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8222
8220
|
try: () => fe(e, a, c),
|
|
8223
8221
|
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
8224
8222
|
});
|
|
8225
|
-
if (
|
|
8226
|
-
let t = a.inputs[a.input.handle];
|
|
8223
|
+
if (Sf(a)) {
|
|
8227
8224
|
yield* i.emit({
|
|
8228
|
-
inputs:
|
|
8225
|
+
inputs: Object.fromEntries(Object.entries(n).filter(([e]) => {
|
|
8226
|
+
let t = a.inputs[e];
|
|
8227
|
+
return t?.kind != "sources" || t.sources.every((e) => e.kind != "binding");
|
|
8228
|
+
})),
|
|
8229
8229
|
jobId: c,
|
|
8230
8230
|
nodeId: e,
|
|
8231
8231
|
nodeKind: a.kind,
|
|
8232
8232
|
...a.name == null ? {} : { nodeTitle: a.name },
|
|
8233
8233
|
runId: s,
|
|
8234
8234
|
type: "node.started"
|
|
8235
|
-
}), yield* ve(e, c, n
|
|
8235
|
+
}), yield* ve(e, c, n);
|
|
8236
8236
|
return;
|
|
8237
8237
|
}
|
|
8238
8238
|
let r = yield* _e(e, a, c, n);
|
|
@@ -8240,7 +8240,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8240
8240
|
})).pipe(t.ensuring(r.offer(v, void 0))));
|
|
8241
8241
|
};
|
|
8242
8242
|
if (f != null && (yield* t.try({
|
|
8243
|
-
try: () =>
|
|
8243
|
+
try: () => Yf(i.prepared, o, f.checkpoint, fe),
|
|
8244
8244
|
catch: (e) => e instanceof Error ? e : Error(String(e))
|
|
8245
8245
|
})), f == null) {
|
|
8246
8246
|
if (d != null) ge(d.nodeId, Object.keys(d.outputs), { [d.nodeId]: d.outputs });
|
|
@@ -8250,18 +8250,24 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8250
8250
|
for (let a of _.values()) {
|
|
8251
8251
|
let s = e[a.waitId];
|
|
8252
8252
|
if (s == null) continue;
|
|
8253
|
+
let { action: c, resolvedAt: l, comment: u } = s;
|
|
8253
8254
|
le != null && (le = void 0, ce = n), _.delete(a.jobId);
|
|
8254
|
-
let
|
|
8255
|
+
let d = o.graph.nodes[a.nodeId];
|
|
8255
8256
|
ae(be(a.nodeId, a.jobId, t.gen(function* () {
|
|
8256
|
-
if (
|
|
8257
|
-
if (!
|
|
8258
|
-
yield* pe(a.nodeId, a.jobId,
|
|
8257
|
+
if (Sf(d)) {
|
|
8258
|
+
if (!Cf(d).some((e) => e == c)) return yield* t.fail(/* @__PURE__ */ Error("Resolution does not match node actions."));
|
|
8259
|
+
yield* pe(a.nodeId, a.jobId, Jf(i.prepared, a.nodeId, d, {
|
|
8259
8260
|
...a.pending == null ? {} : { pending: a.pending },
|
|
8260
|
-
[
|
|
8261
|
-
|
|
8261
|
+
[c]: {
|
|
8262
|
+
inputs: a.value,
|
|
8263
|
+
action: c,
|
|
8264
|
+
resolvedAt: l,
|
|
8265
|
+
comment: u
|
|
8266
|
+
}
|
|
8267
|
+
}), [c]);
|
|
8262
8268
|
} else {
|
|
8263
|
-
if (
|
|
8264
|
-
yield* ye(a.nodeId, a.jobId, yield* _e(a.nodeId,
|
|
8269
|
+
if (c == "continue") return yield* t.fail(/* @__PURE__ */ Error("Agent requires approve or reject."));
|
|
8270
|
+
yield* ye(a.nodeId, a.jobId, yield* _e(a.nodeId, d, a.jobId, ue[a.jobId].input, c));
|
|
8265
8271
|
}
|
|
8266
8272
|
})).pipe(t.ensuring(r.offer(v, void 0))));
|
|
8267
8273
|
}
|
|
@@ -8280,7 +8286,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8280
8286
|
if (oe != null) continue;
|
|
8281
8287
|
if (o == 0 && _.size == 0 && me.length == 0) break;
|
|
8282
8288
|
o > 0 || me.length > 0 ? le = void 0 : le ??= a;
|
|
8283
|
-
let c = le == null ? y :
|
|
8289
|
+
let c = le == null ? y : Af - (a - le);
|
|
8284
8290
|
if (le != null && c <= 0) {
|
|
8285
8291
|
let e = {
|
|
8286
8292
|
bindingValues: i.bindingValues,
|
|
@@ -8294,7 +8300,7 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8294
8300
|
}, n = JSON.stringify(e);
|
|
8295
8301
|
return new TextEncoder().encode(n).byteLength > 16777216 ? yield* t.fail(/* @__PURE__ */ Error("Flow Run checkpoint exceeds 16 MiB.")) : {
|
|
8296
8302
|
kind: "waiting",
|
|
8297
|
-
checkpoint:
|
|
8303
|
+
checkpoint: Vf(JSON.parse(n)),
|
|
8298
8304
|
...y == null ? {} : { remainingMs: y }
|
|
8299
8305
|
};
|
|
8300
8306
|
}
|
|
@@ -8342,15 +8348,15 @@ function qf(i, o, s, c, l, u = {}, d, f) {
|
|
|
8342
8348
|
}), Se;
|
|
8343
8349
|
}));
|
|
8344
8350
|
}
|
|
8345
|
-
function
|
|
8351
|
+
function Zf(e, n) {
|
|
8346
8352
|
let r = n.emit ?? (() => t.void);
|
|
8347
8353
|
return t.gen(function* () {
|
|
8348
8354
|
if (n.resume != null && (n.inputs != null || n.trigger != null || n.bindingValues != null)) return yield* t.fail(/* @__PURE__ */ Error("A resumed Flow Run cannot accept launch inputs, binding values, or a Trigger seed."));
|
|
8349
|
-
let i = n.resume == null ? void 0 :
|
|
8355
|
+
let i = n.resume == null ? void 0 : Vf(n.resume.checkpoint);
|
|
8350
8356
|
if (i != null && new TextEncoder().encode(JSON.stringify(i)).byteLength > 16777216) return yield* t.fail(/* @__PURE__ */ Error("Flow Run checkpoint exceeds 16 MiB."));
|
|
8351
8357
|
if (i == null && n.trigger == null) return yield* t.fail(/* @__PURE__ */ Error("A Flow Run requires a Trigger seed."));
|
|
8352
8358
|
let a = n.trigger == null ? void 0 : e.graph.nodes[n.trigger.nodeId];
|
|
8353
|
-
return n.trigger != null && (a == null || "inputs" in a) ? yield* t.fail(/* @__PURE__ */ Error(`Node "${n.trigger.nodeId}" is not a TriggerNode in Flow "${n.flowId}".`)) : yield*
|
|
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* Xf({
|
|
8354
8360
|
counts: Object.fromEntries(Object.entries(i?.counts ?? {}).map(([e, t]) => [e, { ...t }])),
|
|
8355
8361
|
bindingValues: i?.bindingValues ?? n.bindingValues ?? {},
|
|
8356
8362
|
createId: n.createId,
|
|
@@ -8368,4 +8374,4 @@ function Jf(e, n) {
|
|
|
8368
8374
|
});
|
|
8369
8375
|
}
|
|
8370
8376
|
//#endregion
|
|
8371
|
-
export {
|
|
8377
|
+
export { Vf as decodeFlowRunCheckpoint, Of as normalizeWaitComment, Zf as runFlow, Af as waitRetentionMs };
|