openclaw-brokerkit 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -98
- package/dist/src/browser-session.js +7 -0
- package/dist/src/commands.js +8 -9
- package/dist/src/generated/openapi-operator-v1.js +5 -0
- package/dist/src/generated/operator-v1.js +14 -11
- package/dist/src/generated/operator-validators.js +2920 -0
- package/dist/src/http.js +92 -18
- package/dist/src/operator-v1.js +26 -80
- package/dist/src/revisions.js +108 -0
- package/dist/src/runtime.js +52 -17
- package/dist/ui/assets/index-xbT6e20b.js +149 -0
- package/dist/ui/index.html +1 -2
- package/package.json +24 -7
- package/dist/ui/assets/index-8w0_bcoC.js +0 -143
- package/dist/ui/assets/index-D8Ypbs3j.css +0 -1
|
@@ -0,0 +1,2920 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck -- generated Ajv standalone code
|
|
3
|
+
// Generated from protocol/openapi/operator-v1.yaml. Do not edit.
|
|
4
|
+
import formatsModule from "ajv-formats/dist/formats.js";
|
|
5
|
+
import equal from "ajv/dist/runtime/equal.js";
|
|
6
|
+
import ucs2length from "ajv/dist/runtime/ucs2length.js";
|
|
7
|
+
const formats = formatsModule.fullFormats;
|
|
8
|
+
"use strict";
|
|
9
|
+
export const validateDescriptor = validate20;
|
|
10
|
+
const schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/Descriptor", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor" };
|
|
11
|
+
const schema33 = { "type": "object", "additionalProperties": false, "required": ["api_version"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator/v1" } } };
|
|
12
|
+
function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/Descriptor" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate20.evaluated; if (evaluated0.dynamicProps) {
|
|
13
|
+
evaluated0.props = undefined;
|
|
14
|
+
} if (evaluated0.dynamicItems) {
|
|
15
|
+
evaluated0.items = undefined;
|
|
16
|
+
} const _errs0 = errors; if (errors === _errs0) {
|
|
17
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
18
|
+
let missing0;
|
|
19
|
+
if ((data.api_version === undefined) && (missing0 = "api_version")) {
|
|
20
|
+
validate20.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const _errs2 = errors;
|
|
25
|
+
for (const key0 in data) {
|
|
26
|
+
if (!(key0 === "api_version")) {
|
|
27
|
+
validate20.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
28
|
+
return false;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (_errs2 === errors) {
|
|
33
|
+
if (data.api_version !== undefined) {
|
|
34
|
+
let data0 = data.api_version;
|
|
35
|
+
if (typeof data0 !== "string") {
|
|
36
|
+
validate20.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/api_version/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if ("brokerkit.io/operator/v1" !== data0) {
|
|
40
|
+
validate20.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/api_version/const", keyword: "const", params: { allowedValue: "brokerkit.io/operator/v1" }, message: "must be equal to constant" }];
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
validate20.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
} validate20.errors = vErrors; return errors === 0; }
|
|
52
|
+
validate20.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
53
|
+
export const validateHealth = validate22;
|
|
54
|
+
const schema34 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/Health", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health" };
|
|
55
|
+
const schema35 = { "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "type": "string", "minLength": 1, "maxLength": 128 } } };
|
|
56
|
+
const func1 = ucs2length;
|
|
57
|
+
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/Health" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate22.evaluated; if (evaluated0.dynamicProps) {
|
|
58
|
+
evaluated0.props = undefined;
|
|
59
|
+
} if (evaluated0.dynamicItems) {
|
|
60
|
+
evaluated0.items = undefined;
|
|
61
|
+
} const _errs0 = errors; if (errors === _errs0) {
|
|
62
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
63
|
+
let missing0;
|
|
64
|
+
if ((data.status === undefined) && (missing0 = "status")) {
|
|
65
|
+
validate22.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const _errs2 = errors;
|
|
70
|
+
for (const key0 in data) {
|
|
71
|
+
if (!(key0 === "status")) {
|
|
72
|
+
validate22.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
73
|
+
return false;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (_errs2 === errors) {
|
|
78
|
+
if (data.status !== undefined) {
|
|
79
|
+
let data0 = data.status;
|
|
80
|
+
const _errs3 = errors;
|
|
81
|
+
if (errors === _errs3) {
|
|
82
|
+
if (typeof data0 === "string") {
|
|
83
|
+
if (func1(data0) > 128) {
|
|
84
|
+
validate22.errors = [{ instancePath: instancePath + "/status", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/status/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
if (func1(data0) < 1) {
|
|
89
|
+
validate22.errors = [{ instancePath: instancePath + "/status", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/status/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
validate22.errors = [{ instancePath: instancePath + "/status", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/status/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
validate22.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
} validate22.errors = vErrors; return errors === 0; }
|
|
108
|
+
validate22.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
109
|
+
export const validateBrokerRequest = validate23;
|
|
110
|
+
const schema36 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/BrokerRequest", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/BrokerRequest" };
|
|
111
|
+
const schema37 = { "type": "object", "additionalProperties": false, "required": ["id", "revision", "requester", "operation", "status", "requested_at", "requested_duration_seconds", "requested_max_uses", "granted_max_uses", "used_count", "presentation", "allowed_actions"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "integer", "minimum": 1 }, "requester": { "type": "string", "minLength": 1, "maxLength": 80 }, "operation": { "type": "string", "minLength": 1, "maxLength": 500 }, "status": { "$ref": "#/$defs/Status" }, "requested_at": { "type": "string", "format": "date-time" }, "pending_expires_at": { "type": "string", "format": "date-time" }, "active_expires_at": { "type": "string", "format": "date-time" }, "requested_duration_seconds": { "type": "integer", "minimum": 1 }, "requested_max_uses": { "type": ["integer", "null"], "minimum": 1 }, "granted_max_uses": { "type": ["integer", "null"], "minimum": 1 }, "used_count": { "type": "integer", "minimum": 0 }, "request_reason": { "type": "string", "maxLength": 2000 }, "decided_at": { "type": "string", "format": "date-time" }, "decided_by": { "type": "string", "maxLength": 200 }, "decided_on_behalf_of": { "type": "string", "maxLength": 200 }, "presentation": { "$ref": "#/$defs/Presentation" }, "presentation_unavailable": { "type": "boolean" }, "allowed_actions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/Action" } }, "approval_bounds": { "$ref": "#/$defs/ApprovalBounds" } } };
|
|
112
|
+
const schema38 = { "type": "string", "enum": ["pending", "active", "denied", "canceled", "expired", "consumed", "revoked"] };
|
|
113
|
+
const schema44 = { "type": "string", "enum": ["approve", "deny", "revoke"] };
|
|
114
|
+
const schema45 = { "type": "object", "additionalProperties": false, "required": ["max_duration_seconds", "max_uses"], "properties": { "max_duration_seconds": { "type": "integer", "minimum": 1 }, "max_uses": { "type": ["integer", "null"], "minimum": 1 } } };
|
|
115
|
+
const func3 = Object.prototype.hasOwnProperty;
|
|
116
|
+
const func0 = equal;
|
|
117
|
+
const formats0 = formats["date-time"];
|
|
118
|
+
const schema39 = { "type": "object", "additionalProperties": false, "required": ["risk", "title", "target"], "properties": { "risk": { "$ref": "#/$defs/PresentationRisk" }, "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "summary": { "type": "string", "maxLength": 2000 }, "target": { "type": "string", "minLength": 1, "maxLength": 500 }, "facts": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/Fact" } }, "warnings": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/Warning" } }, "plan_hash": { "type": "string", "maxLength": 128 } } };
|
|
119
|
+
const schema40 = { "type": "string", "enum": ["unknown", "low", "medium", "high", "critical"] };
|
|
120
|
+
const schema41 = { "type": "object", "additionalProperties": false, "required": ["label", "value"], "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 80 }, "value": { "type": "string", "minLength": 1, "maxLength": 500 } } };
|
|
121
|
+
const schema42 = { "type": "object", "additionalProperties": false, "required": ["severity", "text"], "properties": { "severity": { "$ref": "#/$defs/PresentationRisk" }, "text": { "type": "string", "minLength": 1, "maxLength": 500 } } };
|
|
122
|
+
function validate26(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate26.evaluated; if (evaluated0.dynamicProps) {
|
|
123
|
+
evaluated0.props = undefined;
|
|
124
|
+
} if (evaluated0.dynamicItems) {
|
|
125
|
+
evaluated0.items = undefined;
|
|
126
|
+
} if (errors === 0) {
|
|
127
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
128
|
+
let missing0;
|
|
129
|
+
if (((data.severity === undefined) && (missing0 = "severity")) || ((data.text === undefined) && (missing0 = "text"))) {
|
|
130
|
+
validate26.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
const _errs1 = errors;
|
|
135
|
+
for (const key0 in data) {
|
|
136
|
+
if (!((key0 === "severity") || (key0 === "text"))) {
|
|
137
|
+
validate26.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
138
|
+
return false;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (_errs1 === errors) {
|
|
143
|
+
if (data.severity !== undefined) {
|
|
144
|
+
let data0 = data.severity;
|
|
145
|
+
const _errs2 = errors;
|
|
146
|
+
if (typeof data0 !== "string") {
|
|
147
|
+
validate26.errors = [{ instancePath: instancePath + "/severity", schemaPath: "#/$defs/PresentationRisk/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
if (!(((((data0 === "unknown") || (data0 === "low")) || (data0 === "medium")) || (data0 === "high")) || (data0 === "critical"))) {
|
|
151
|
+
validate26.errors = [{ instancePath: instancePath + "/severity", schemaPath: "#/$defs/PresentationRisk/enum", keyword: "enum", params: { allowedValues: schema40.enum }, message: "must be equal to one of the allowed values" }];
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
var valid0 = _errs2 === errors;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
var valid0 = true;
|
|
158
|
+
}
|
|
159
|
+
if (valid0) {
|
|
160
|
+
if (data.text !== undefined) {
|
|
161
|
+
let data1 = data.text;
|
|
162
|
+
const _errs5 = errors;
|
|
163
|
+
if (errors === _errs5) {
|
|
164
|
+
if (typeof data1 === "string") {
|
|
165
|
+
if (func1(data1) > 500) {
|
|
166
|
+
validate26.errors = [{ instancePath: instancePath + "/text", schemaPath: "#/properties/text/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }];
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
if (func1(data1) < 1) {
|
|
171
|
+
validate26.errors = [{ instancePath: instancePath + "/text", schemaPath: "#/properties/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
validate26.errors = [{ instancePath: instancePath + "/text", schemaPath: "#/properties/text/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
var valid0 = _errs5 === errors;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
var valid0 = true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
validate26.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
} validate26.errors = vErrors; return errors === 0; }
|
|
195
|
+
validate26.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
196
|
+
function validate25(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate25.evaluated; if (evaluated0.dynamicProps) {
|
|
197
|
+
evaluated0.props = undefined;
|
|
198
|
+
} if (evaluated0.dynamicItems) {
|
|
199
|
+
evaluated0.items = undefined;
|
|
200
|
+
} if (errors === 0) {
|
|
201
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
202
|
+
let missing0;
|
|
203
|
+
if ((((data.risk === undefined) && (missing0 = "risk")) || ((data.title === undefined) && (missing0 = "title"))) || ((data.target === undefined) && (missing0 = "target"))) {
|
|
204
|
+
validate25.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
const _errs1 = errors;
|
|
209
|
+
for (const key0 in data) {
|
|
210
|
+
if (!(((((((key0 === "risk") || (key0 === "title")) || (key0 === "summary")) || (key0 === "target")) || (key0 === "facts")) || (key0 === "warnings")) || (key0 === "plan_hash"))) {
|
|
211
|
+
validate25.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
212
|
+
return false;
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (_errs1 === errors) {
|
|
217
|
+
if (data.risk !== undefined) {
|
|
218
|
+
let data0 = data.risk;
|
|
219
|
+
const _errs2 = errors;
|
|
220
|
+
if (typeof data0 !== "string") {
|
|
221
|
+
validate25.errors = [{ instancePath: instancePath + "/risk", schemaPath: "#/$defs/PresentationRisk/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
if (!(((((data0 === "unknown") || (data0 === "low")) || (data0 === "medium")) || (data0 === "high")) || (data0 === "critical"))) {
|
|
225
|
+
validate25.errors = [{ instancePath: instancePath + "/risk", schemaPath: "#/$defs/PresentationRisk/enum", keyword: "enum", params: { allowedValues: schema40.enum }, message: "must be equal to one of the allowed values" }];
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
var valid0 = _errs2 === errors;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
var valid0 = true;
|
|
232
|
+
}
|
|
233
|
+
if (valid0) {
|
|
234
|
+
if (data.title !== undefined) {
|
|
235
|
+
let data1 = data.title;
|
|
236
|
+
const _errs5 = errors;
|
|
237
|
+
if (errors === _errs5) {
|
|
238
|
+
if (typeof data1 === "string") {
|
|
239
|
+
if (func1(data1) > 200) {
|
|
240
|
+
validate25.errors = [{ instancePath: instancePath + "/title", schemaPath: "#/properties/title/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
if (func1(data1) < 1) {
|
|
245
|
+
validate25.errors = [{ instancePath: instancePath + "/title", schemaPath: "#/properties/title/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
validate25.errors = [{ instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
var valid0 = _errs5 === errors;
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
var valid0 = true;
|
|
259
|
+
}
|
|
260
|
+
if (valid0) {
|
|
261
|
+
if (data.summary !== undefined) {
|
|
262
|
+
let data2 = data.summary;
|
|
263
|
+
const _errs7 = errors;
|
|
264
|
+
if (errors === _errs7) {
|
|
265
|
+
if (typeof data2 === "string") {
|
|
266
|
+
if (func1(data2) > 2000) {
|
|
267
|
+
validate25.errors = [{ instancePath: instancePath + "/summary", schemaPath: "#/properties/summary/maxLength", keyword: "maxLength", params: { limit: 2000 }, message: "must NOT have more than 2000 characters" }];
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
validate25.errors = [{ instancePath: instancePath + "/summary", schemaPath: "#/properties/summary/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
var valid0 = _errs7 === errors;
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
var valid0 = true;
|
|
280
|
+
}
|
|
281
|
+
if (valid0) {
|
|
282
|
+
if (data.target !== undefined) {
|
|
283
|
+
let data3 = data.target;
|
|
284
|
+
const _errs9 = errors;
|
|
285
|
+
if (errors === _errs9) {
|
|
286
|
+
if (typeof data3 === "string") {
|
|
287
|
+
if (func1(data3) > 500) {
|
|
288
|
+
validate25.errors = [{ instancePath: instancePath + "/target", schemaPath: "#/properties/target/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }];
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
if (func1(data3) < 1) {
|
|
293
|
+
validate25.errors = [{ instancePath: instancePath + "/target", schemaPath: "#/properties/target/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
validate25.errors = [{ instancePath: instancePath + "/target", schemaPath: "#/properties/target/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
var valid0 = _errs9 === errors;
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
var valid0 = true;
|
|
307
|
+
}
|
|
308
|
+
if (valid0) {
|
|
309
|
+
if (data.facts !== undefined) {
|
|
310
|
+
let data4 = data.facts;
|
|
311
|
+
const _errs11 = errors;
|
|
312
|
+
if (errors === _errs11) {
|
|
313
|
+
if (Array.isArray(data4)) {
|
|
314
|
+
if (data4.length > 20) {
|
|
315
|
+
validate25.errors = [{ instancePath: instancePath + "/facts", schemaPath: "#/properties/facts/maxItems", keyword: "maxItems", params: { limit: 20 }, message: "must NOT have more than 20 items" }];
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
var valid2 = true;
|
|
320
|
+
const len0 = data4.length;
|
|
321
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
322
|
+
let data5 = data4[i0];
|
|
323
|
+
const _errs13 = errors;
|
|
324
|
+
const _errs14 = errors;
|
|
325
|
+
if (errors === _errs14) {
|
|
326
|
+
if (data5 && typeof data5 == "object" && !Array.isArray(data5)) {
|
|
327
|
+
let missing1;
|
|
328
|
+
if (((data5.label === undefined) && (missing1 = "label")) || ((data5.value === undefined) && (missing1 = "value"))) {
|
|
329
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0, schemaPath: "#/$defs/Fact/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
const _errs16 = errors;
|
|
334
|
+
for (const key1 in data5) {
|
|
335
|
+
if (!((key1 === "label") || (key1 === "value"))) {
|
|
336
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0, schemaPath: "#/$defs/Fact/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
|
|
337
|
+
return false;
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (_errs16 === errors) {
|
|
342
|
+
if (data5.label !== undefined) {
|
|
343
|
+
let data6 = data5.label;
|
|
344
|
+
const _errs17 = errors;
|
|
345
|
+
if (errors === _errs17) {
|
|
346
|
+
if (typeof data6 === "string") {
|
|
347
|
+
if (func1(data6) > 80) {
|
|
348
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0 + "/label", schemaPath: "#/$defs/Fact/properties/label/maxLength", keyword: "maxLength", params: { limit: 80 }, message: "must NOT have more than 80 characters" }];
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
if (func1(data6) < 1) {
|
|
353
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0 + "/label", schemaPath: "#/$defs/Fact/properties/label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0 + "/label", schemaPath: "#/$defs/Fact/properties/label/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
var valid4 = _errs17 === errors;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
var valid4 = true;
|
|
367
|
+
}
|
|
368
|
+
if (valid4) {
|
|
369
|
+
if (data5.value !== undefined) {
|
|
370
|
+
let data7 = data5.value;
|
|
371
|
+
const _errs19 = errors;
|
|
372
|
+
if (errors === _errs19) {
|
|
373
|
+
if (typeof data7 === "string") {
|
|
374
|
+
if (func1(data7) > 500) {
|
|
375
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0 + "/value", schemaPath: "#/$defs/Fact/properties/value/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }];
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
if (func1(data7) < 1) {
|
|
380
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0 + "/value", schemaPath: "#/$defs/Fact/properties/value/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0 + "/value", schemaPath: "#/$defs/Fact/properties/value/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
var valid4 = _errs19 === errors;
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
var valid4 = true;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
validate25.errors = [{ instancePath: instancePath + "/facts/" + i0, schemaPath: "#/$defs/Fact/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
var valid2 = _errs13 === errors;
|
|
405
|
+
if (!valid2) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
validate25.errors = [{ instancePath: instancePath + "/facts", schemaPath: "#/properties/facts/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
var valid0 = _errs11 === errors;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
var valid0 = true;
|
|
420
|
+
}
|
|
421
|
+
if (valid0) {
|
|
422
|
+
if (data.warnings !== undefined) {
|
|
423
|
+
let data8 = data.warnings;
|
|
424
|
+
const _errs21 = errors;
|
|
425
|
+
if (errors === _errs21) {
|
|
426
|
+
if (Array.isArray(data8)) {
|
|
427
|
+
if (data8.length > 10) {
|
|
428
|
+
validate25.errors = [{ instancePath: instancePath + "/warnings", schemaPath: "#/properties/warnings/maxItems", keyword: "maxItems", params: { limit: 10 }, message: "must NOT have more than 10 items" }];
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
var valid5 = true;
|
|
433
|
+
const len1 = data8.length;
|
|
434
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
435
|
+
const _errs23 = errors;
|
|
436
|
+
if (!(validate26(data8[i1], { instancePath: instancePath + "/warnings/" + i1, parentData: data8, parentDataProperty: i1, rootData, dynamicAnchors }))) {
|
|
437
|
+
vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);
|
|
438
|
+
errors = vErrors.length;
|
|
439
|
+
}
|
|
440
|
+
var valid5 = _errs23 === errors;
|
|
441
|
+
if (!valid5) {
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
validate25.errors = [{ instancePath: instancePath + "/warnings", schemaPath: "#/properties/warnings/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
var valid0 = _errs21 === errors;
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
var valid0 = true;
|
|
456
|
+
}
|
|
457
|
+
if (valid0) {
|
|
458
|
+
if (data.plan_hash !== undefined) {
|
|
459
|
+
let data10 = data.plan_hash;
|
|
460
|
+
const _errs24 = errors;
|
|
461
|
+
if (errors === _errs24) {
|
|
462
|
+
if (typeof data10 === "string") {
|
|
463
|
+
if (func1(data10) > 128) {
|
|
464
|
+
validate25.errors = [{ instancePath: instancePath + "/plan_hash", schemaPath: "#/properties/plan_hash/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
validate25.errors = [{ instancePath: instancePath + "/plan_hash", schemaPath: "#/properties/plan_hash/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
var valid0 = _errs24 === errors;
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
var valid0 = true;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
validate25.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
} validate25.errors = vErrors; return errors === 0; }
|
|
492
|
+
validate25.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
493
|
+
function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate24.evaluated; if (evaluated0.dynamicProps) {
|
|
494
|
+
evaluated0.props = undefined;
|
|
495
|
+
} if (evaluated0.dynamicItems) {
|
|
496
|
+
evaluated0.items = undefined;
|
|
497
|
+
} if (errors === 0) {
|
|
498
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
499
|
+
let missing0;
|
|
500
|
+
if (((((((((((((data.id === undefined) && (missing0 = "id")) || ((data.revision === undefined) && (missing0 = "revision"))) || ((data.requester === undefined) && (missing0 = "requester"))) || ((data.operation === undefined) && (missing0 = "operation"))) || ((data.status === undefined) && (missing0 = "status"))) || ((data.requested_at === undefined) && (missing0 = "requested_at"))) || ((data.requested_duration_seconds === undefined) && (missing0 = "requested_duration_seconds"))) || ((data.requested_max_uses === undefined) && (missing0 = "requested_max_uses"))) || ((data.granted_max_uses === undefined) && (missing0 = "granted_max_uses"))) || ((data.used_count === undefined) && (missing0 = "used_count"))) || ((data.presentation === undefined) && (missing0 = "presentation"))) || ((data.allowed_actions === undefined) && (missing0 = "allowed_actions"))) {
|
|
501
|
+
validate24.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
const _errs1 = errors;
|
|
506
|
+
for (const key0 in data) {
|
|
507
|
+
if (!(func3.call(schema37.properties, key0))) {
|
|
508
|
+
validate24.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
509
|
+
return false;
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (_errs1 === errors) {
|
|
514
|
+
if (data.id !== undefined) {
|
|
515
|
+
let data0 = data.id;
|
|
516
|
+
const _errs2 = errors;
|
|
517
|
+
if (errors === _errs2) {
|
|
518
|
+
if (typeof data0 === "string") {
|
|
519
|
+
if (func1(data0) > 128) {
|
|
520
|
+
validate24.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
521
|
+
return false;
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
if (func1(data0) < 1) {
|
|
525
|
+
validate24.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
validate24.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
var valid0 = _errs2 === errors;
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
var valid0 = true;
|
|
539
|
+
}
|
|
540
|
+
if (valid0) {
|
|
541
|
+
if (data.revision !== undefined) {
|
|
542
|
+
let data1 = data.revision;
|
|
543
|
+
const _errs4 = errors;
|
|
544
|
+
if (!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))) {
|
|
545
|
+
validate24.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
546
|
+
return false;
|
|
547
|
+
}
|
|
548
|
+
if (errors === _errs4) {
|
|
549
|
+
if ((typeof data1 == "number") && (isFinite(data1))) {
|
|
550
|
+
if (data1 < 1 || isNaN(data1)) {
|
|
551
|
+
validate24.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
var valid0 = _errs4 === errors;
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
var valid0 = true;
|
|
560
|
+
}
|
|
561
|
+
if (valid0) {
|
|
562
|
+
if (data.requester !== undefined) {
|
|
563
|
+
let data2 = data.requester;
|
|
564
|
+
const _errs6 = errors;
|
|
565
|
+
if (errors === _errs6) {
|
|
566
|
+
if (typeof data2 === "string") {
|
|
567
|
+
if (func1(data2) > 80) {
|
|
568
|
+
validate24.errors = [{ instancePath: instancePath + "/requester", schemaPath: "#/properties/requester/maxLength", keyword: "maxLength", params: { limit: 80 }, message: "must NOT have more than 80 characters" }];
|
|
569
|
+
return false;
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
if (func1(data2) < 1) {
|
|
573
|
+
validate24.errors = [{ instancePath: instancePath + "/requester", schemaPath: "#/properties/requester/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
validate24.errors = [{ instancePath: instancePath + "/requester", schemaPath: "#/properties/requester/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
580
|
+
return false;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
var valid0 = _errs6 === errors;
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
var valid0 = true;
|
|
587
|
+
}
|
|
588
|
+
if (valid0) {
|
|
589
|
+
if (data.operation !== undefined) {
|
|
590
|
+
let data3 = data.operation;
|
|
591
|
+
const _errs8 = errors;
|
|
592
|
+
if (errors === _errs8) {
|
|
593
|
+
if (typeof data3 === "string") {
|
|
594
|
+
if (func1(data3) > 500) {
|
|
595
|
+
validate24.errors = [{ instancePath: instancePath + "/operation", schemaPath: "#/properties/operation/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }];
|
|
596
|
+
return false;
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
if (func1(data3) < 1) {
|
|
600
|
+
validate24.errors = [{ instancePath: instancePath + "/operation", schemaPath: "#/properties/operation/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
601
|
+
return false;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
validate24.errors = [{ instancePath: instancePath + "/operation", schemaPath: "#/properties/operation/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
var valid0 = _errs8 === errors;
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
var valid0 = true;
|
|
614
|
+
}
|
|
615
|
+
if (valid0) {
|
|
616
|
+
if (data.status !== undefined) {
|
|
617
|
+
let data4 = data.status;
|
|
618
|
+
const _errs10 = errors;
|
|
619
|
+
if (typeof data4 !== "string") {
|
|
620
|
+
validate24.errors = [{ instancePath: instancePath + "/status", schemaPath: "#/$defs/Status/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
621
|
+
return false;
|
|
622
|
+
}
|
|
623
|
+
if (!(((((((data4 === "pending") || (data4 === "active")) || (data4 === "denied")) || (data4 === "canceled")) || (data4 === "expired")) || (data4 === "consumed")) || (data4 === "revoked"))) {
|
|
624
|
+
validate24.errors = [{ instancePath: instancePath + "/status", schemaPath: "#/$defs/Status/enum", keyword: "enum", params: { allowedValues: schema38.enum }, message: "must be equal to one of the allowed values" }];
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
var valid0 = _errs10 === errors;
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
var valid0 = true;
|
|
631
|
+
}
|
|
632
|
+
if (valid0) {
|
|
633
|
+
if (data.requested_at !== undefined) {
|
|
634
|
+
let data5 = data.requested_at;
|
|
635
|
+
const _errs13 = errors;
|
|
636
|
+
if (errors === _errs13) {
|
|
637
|
+
if (errors === _errs13) {
|
|
638
|
+
if (typeof data5 === "string") {
|
|
639
|
+
if (!(formats0.validate(data5))) {
|
|
640
|
+
validate24.errors = [{ instancePath: instancePath + "/requested_at", schemaPath: "#/properties/requested_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
validate24.errors = [{ instancePath: instancePath + "/requested_at", schemaPath: "#/properties/requested_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
646
|
+
return false;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
var valid0 = _errs13 === errors;
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
var valid0 = true;
|
|
654
|
+
}
|
|
655
|
+
if (valid0) {
|
|
656
|
+
if (data.pending_expires_at !== undefined) {
|
|
657
|
+
let data6 = data.pending_expires_at;
|
|
658
|
+
const _errs15 = errors;
|
|
659
|
+
if (errors === _errs15) {
|
|
660
|
+
if (errors === _errs15) {
|
|
661
|
+
if (typeof data6 === "string") {
|
|
662
|
+
if (!(formats0.validate(data6))) {
|
|
663
|
+
validate24.errors = [{ instancePath: instancePath + "/pending_expires_at", schemaPath: "#/properties/pending_expires_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
664
|
+
return false;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
validate24.errors = [{ instancePath: instancePath + "/pending_expires_at", schemaPath: "#/properties/pending_expires_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
669
|
+
return false;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
var valid0 = _errs15 === errors;
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
var valid0 = true;
|
|
677
|
+
}
|
|
678
|
+
if (valid0) {
|
|
679
|
+
if (data.active_expires_at !== undefined) {
|
|
680
|
+
let data7 = data.active_expires_at;
|
|
681
|
+
const _errs17 = errors;
|
|
682
|
+
if (errors === _errs17) {
|
|
683
|
+
if (errors === _errs17) {
|
|
684
|
+
if (typeof data7 === "string") {
|
|
685
|
+
if (!(formats0.validate(data7))) {
|
|
686
|
+
validate24.errors = [{ instancePath: instancePath + "/active_expires_at", schemaPath: "#/properties/active_expires_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
687
|
+
return false;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
else {
|
|
691
|
+
validate24.errors = [{ instancePath: instancePath + "/active_expires_at", schemaPath: "#/properties/active_expires_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
var valid0 = _errs17 === errors;
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
var valid0 = true;
|
|
700
|
+
}
|
|
701
|
+
if (valid0) {
|
|
702
|
+
if (data.requested_duration_seconds !== undefined) {
|
|
703
|
+
let data8 = data.requested_duration_seconds;
|
|
704
|
+
const _errs19 = errors;
|
|
705
|
+
if (!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))) {
|
|
706
|
+
validate24.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
707
|
+
return false;
|
|
708
|
+
}
|
|
709
|
+
if (errors === _errs19) {
|
|
710
|
+
if ((typeof data8 == "number") && (isFinite(data8))) {
|
|
711
|
+
if (data8 < 1 || isNaN(data8)) {
|
|
712
|
+
validate24.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
713
|
+
return false;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
var valid0 = _errs19 === errors;
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
var valid0 = true;
|
|
721
|
+
}
|
|
722
|
+
if (valid0) {
|
|
723
|
+
if (data.requested_max_uses !== undefined) {
|
|
724
|
+
let data9 = data.requested_max_uses;
|
|
725
|
+
const _errs21 = errors;
|
|
726
|
+
if ((!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))) && (data9 !== null)) {
|
|
727
|
+
validate24.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/type", keyword: "type", params: { type: schema37.properties.requested_max_uses.type }, message: "must be integer,null" }];
|
|
728
|
+
return false;
|
|
729
|
+
}
|
|
730
|
+
if (errors === _errs21) {
|
|
731
|
+
if ((typeof data9 == "number") && (isFinite(data9))) {
|
|
732
|
+
if (data9 < 1 || isNaN(data9)) {
|
|
733
|
+
validate24.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
734
|
+
return false;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
var valid0 = _errs21 === errors;
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
var valid0 = true;
|
|
742
|
+
}
|
|
743
|
+
if (valid0) {
|
|
744
|
+
if (data.granted_max_uses !== undefined) {
|
|
745
|
+
let data10 = data.granted_max_uses;
|
|
746
|
+
const _errs23 = errors;
|
|
747
|
+
if ((!(((typeof data10 == "number") && (!(data10 % 1) && !isNaN(data10))) && (isFinite(data10)))) && (data10 !== null)) {
|
|
748
|
+
validate24.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/type", keyword: "type", params: { type: schema37.properties.granted_max_uses.type }, message: "must be integer,null" }];
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
if (errors === _errs23) {
|
|
752
|
+
if ((typeof data10 == "number") && (isFinite(data10))) {
|
|
753
|
+
if (data10 < 1 || isNaN(data10)) {
|
|
754
|
+
validate24.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
755
|
+
return false;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
var valid0 = _errs23 === errors;
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
var valid0 = true;
|
|
763
|
+
}
|
|
764
|
+
if (valid0) {
|
|
765
|
+
if (data.used_count !== undefined) {
|
|
766
|
+
let data11 = data.used_count;
|
|
767
|
+
const _errs25 = errors;
|
|
768
|
+
if (!(((typeof data11 == "number") && (!(data11 % 1) && !isNaN(data11))) && (isFinite(data11)))) {
|
|
769
|
+
validate24.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
770
|
+
return false;
|
|
771
|
+
}
|
|
772
|
+
if (errors === _errs25) {
|
|
773
|
+
if ((typeof data11 == "number") && (isFinite(data11))) {
|
|
774
|
+
if (data11 < 0 || isNaN(data11)) {
|
|
775
|
+
validate24.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
var valid0 = _errs25 === errors;
|
|
781
|
+
}
|
|
782
|
+
else {
|
|
783
|
+
var valid0 = true;
|
|
784
|
+
}
|
|
785
|
+
if (valid0) {
|
|
786
|
+
if (data.request_reason !== undefined) {
|
|
787
|
+
let data12 = data.request_reason;
|
|
788
|
+
const _errs27 = errors;
|
|
789
|
+
if (errors === _errs27) {
|
|
790
|
+
if (typeof data12 === "string") {
|
|
791
|
+
if (func1(data12) > 2000) {
|
|
792
|
+
validate24.errors = [{ instancePath: instancePath + "/request_reason", schemaPath: "#/properties/request_reason/maxLength", keyword: "maxLength", params: { limit: 2000 }, message: "must NOT have more than 2000 characters" }];
|
|
793
|
+
return false;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
validate24.errors = [{ instancePath: instancePath + "/request_reason", schemaPath: "#/properties/request_reason/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
798
|
+
return false;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
var valid0 = _errs27 === errors;
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
var valid0 = true;
|
|
805
|
+
}
|
|
806
|
+
if (valid0) {
|
|
807
|
+
if (data.decided_at !== undefined) {
|
|
808
|
+
let data13 = data.decided_at;
|
|
809
|
+
const _errs29 = errors;
|
|
810
|
+
if (errors === _errs29) {
|
|
811
|
+
if (errors === _errs29) {
|
|
812
|
+
if (typeof data13 === "string") {
|
|
813
|
+
if (!(formats0.validate(data13))) {
|
|
814
|
+
validate24.errors = [{ instancePath: instancePath + "/decided_at", schemaPath: "#/properties/decided_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
815
|
+
return false;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
validate24.errors = [{ instancePath: instancePath + "/decided_at", schemaPath: "#/properties/decided_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
820
|
+
return false;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
var valid0 = _errs29 === errors;
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
var valid0 = true;
|
|
828
|
+
}
|
|
829
|
+
if (valid0) {
|
|
830
|
+
if (data.decided_by !== undefined) {
|
|
831
|
+
let data14 = data.decided_by;
|
|
832
|
+
const _errs31 = errors;
|
|
833
|
+
if (errors === _errs31) {
|
|
834
|
+
if (typeof data14 === "string") {
|
|
835
|
+
if (func1(data14) > 200) {
|
|
836
|
+
validate24.errors = [{ instancePath: instancePath + "/decided_by", schemaPath: "#/properties/decided_by/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
837
|
+
return false;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
validate24.errors = [{ instancePath: instancePath + "/decided_by", schemaPath: "#/properties/decided_by/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
842
|
+
return false;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
var valid0 = _errs31 === errors;
|
|
846
|
+
}
|
|
847
|
+
else {
|
|
848
|
+
var valid0 = true;
|
|
849
|
+
}
|
|
850
|
+
if (valid0) {
|
|
851
|
+
if (data.decided_on_behalf_of !== undefined) {
|
|
852
|
+
let data15 = data.decided_on_behalf_of;
|
|
853
|
+
const _errs33 = errors;
|
|
854
|
+
if (errors === _errs33) {
|
|
855
|
+
if (typeof data15 === "string") {
|
|
856
|
+
if (func1(data15) > 200) {
|
|
857
|
+
validate24.errors = [{ instancePath: instancePath + "/decided_on_behalf_of", schemaPath: "#/properties/decided_on_behalf_of/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
else {
|
|
862
|
+
validate24.errors = [{ instancePath: instancePath + "/decided_on_behalf_of", schemaPath: "#/properties/decided_on_behalf_of/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
863
|
+
return false;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
var valid0 = _errs33 === errors;
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
var valid0 = true;
|
|
870
|
+
}
|
|
871
|
+
if (valid0) {
|
|
872
|
+
if (data.presentation !== undefined) {
|
|
873
|
+
const _errs35 = errors;
|
|
874
|
+
if (!(validate25(data.presentation, { instancePath: instancePath + "/presentation", parentData: data, parentDataProperty: "presentation", rootData, dynamicAnchors }))) {
|
|
875
|
+
vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);
|
|
876
|
+
errors = vErrors.length;
|
|
877
|
+
}
|
|
878
|
+
var valid0 = _errs35 === errors;
|
|
879
|
+
}
|
|
880
|
+
else {
|
|
881
|
+
var valid0 = true;
|
|
882
|
+
}
|
|
883
|
+
if (valid0) {
|
|
884
|
+
if (data.presentation_unavailable !== undefined) {
|
|
885
|
+
const _errs36 = errors;
|
|
886
|
+
if (typeof data.presentation_unavailable !== "boolean") {
|
|
887
|
+
validate24.errors = [{ instancePath: instancePath + "/presentation_unavailable", schemaPath: "#/properties/presentation_unavailable/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
|
|
888
|
+
return false;
|
|
889
|
+
}
|
|
890
|
+
var valid0 = _errs36 === errors;
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
var valid0 = true;
|
|
894
|
+
}
|
|
895
|
+
if (valid0) {
|
|
896
|
+
if (data.allowed_actions !== undefined) {
|
|
897
|
+
let data18 = data.allowed_actions;
|
|
898
|
+
const _errs38 = errors;
|
|
899
|
+
if (errors === _errs38) {
|
|
900
|
+
if (Array.isArray(data18)) {
|
|
901
|
+
var valid2 = true;
|
|
902
|
+
const len0 = data18.length;
|
|
903
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
904
|
+
let data19 = data18[i0];
|
|
905
|
+
const _errs40 = errors;
|
|
906
|
+
if (typeof data19 !== "string") {
|
|
907
|
+
validate24.errors = [{ instancePath: instancePath + "/allowed_actions/" + i0, schemaPath: "#/$defs/Action/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
908
|
+
return false;
|
|
909
|
+
}
|
|
910
|
+
if (!(((data19 === "approve") || (data19 === "deny")) || (data19 === "revoke"))) {
|
|
911
|
+
validate24.errors = [{ instancePath: instancePath + "/allowed_actions/" + i0, schemaPath: "#/$defs/Action/enum", keyword: "enum", params: { allowedValues: schema44.enum }, message: "must be equal to one of the allowed values" }];
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
var valid2 = _errs40 === errors;
|
|
915
|
+
if (!valid2) {
|
|
916
|
+
break;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
if (valid2) {
|
|
920
|
+
let i1 = data18.length;
|
|
921
|
+
let j0;
|
|
922
|
+
if (i1 > 1) {
|
|
923
|
+
outer0: for (; i1--;) {
|
|
924
|
+
for (j0 = i1; j0--;) {
|
|
925
|
+
if (func0(data18[i1], data18[j0])) {
|
|
926
|
+
validate24.errors = [{ instancePath: instancePath + "/allowed_actions", schemaPath: "#/properties/allowed_actions/uniqueItems", keyword: "uniqueItems", params: { i: i1, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i1 + " are identical)" }];
|
|
927
|
+
return false;
|
|
928
|
+
break outer0;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
validate24.errors = [{ instancePath: instancePath + "/allowed_actions", schemaPath: "#/properties/allowed_actions/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
937
|
+
return false;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
var valid0 = _errs38 === errors;
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
var valid0 = true;
|
|
944
|
+
}
|
|
945
|
+
if (valid0) {
|
|
946
|
+
if (data.approval_bounds !== undefined) {
|
|
947
|
+
let data20 = data.approval_bounds;
|
|
948
|
+
const _errs43 = errors;
|
|
949
|
+
const _errs44 = errors;
|
|
950
|
+
if (errors === _errs44) {
|
|
951
|
+
if (data20 && typeof data20 == "object" && !Array.isArray(data20)) {
|
|
952
|
+
let missing1;
|
|
953
|
+
if (((data20.max_duration_seconds === undefined) && (missing1 = "max_duration_seconds")) || ((data20.max_uses === undefined) && (missing1 = "max_uses"))) {
|
|
954
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds", schemaPath: "#/$defs/ApprovalBounds/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
|
|
955
|
+
return false;
|
|
956
|
+
}
|
|
957
|
+
else {
|
|
958
|
+
const _errs46 = errors;
|
|
959
|
+
for (const key1 in data20) {
|
|
960
|
+
if (!((key1 === "max_duration_seconds") || (key1 === "max_uses"))) {
|
|
961
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds", schemaPath: "#/$defs/ApprovalBounds/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
|
|
962
|
+
return false;
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (_errs46 === errors) {
|
|
967
|
+
if (data20.max_duration_seconds !== undefined) {
|
|
968
|
+
let data21 = data20.max_duration_seconds;
|
|
969
|
+
const _errs47 = errors;
|
|
970
|
+
if (!(((typeof data21 == "number") && (!(data21 % 1) && !isNaN(data21))) && (isFinite(data21)))) {
|
|
971
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
972
|
+
return false;
|
|
973
|
+
}
|
|
974
|
+
if (errors === _errs47) {
|
|
975
|
+
if ((typeof data21 == "number") && (isFinite(data21))) {
|
|
976
|
+
if (data21 < 1 || isNaN(data21)) {
|
|
977
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
978
|
+
return false;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
var valid6 = _errs47 === errors;
|
|
983
|
+
}
|
|
984
|
+
else {
|
|
985
|
+
var valid6 = true;
|
|
986
|
+
}
|
|
987
|
+
if (valid6) {
|
|
988
|
+
if (data20.max_uses !== undefined) {
|
|
989
|
+
let data22 = data20.max_uses;
|
|
990
|
+
const _errs49 = errors;
|
|
991
|
+
if ((!(((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22))) && (isFinite(data22)))) && (data22 !== null)) {
|
|
992
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/type", keyword: "type", params: { type: schema45.properties.max_uses.type }, message: "must be integer,null" }];
|
|
993
|
+
return false;
|
|
994
|
+
}
|
|
995
|
+
if (errors === _errs49) {
|
|
996
|
+
if ((typeof data22 == "number") && (isFinite(data22))) {
|
|
997
|
+
if (data22 < 1 || isNaN(data22)) {
|
|
998
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
999
|
+
return false;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
var valid6 = _errs49 === errors;
|
|
1004
|
+
}
|
|
1005
|
+
else {
|
|
1006
|
+
var valid6 = true;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
validate24.errors = [{ instancePath: instancePath + "/approval_bounds", schemaPath: "#/$defs/ApprovalBounds/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1014
|
+
return false;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
var valid0 = _errs43 === errors;
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
var valid0 = true;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
else {
|
|
1045
|
+
validate24.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1046
|
+
return false;
|
|
1047
|
+
}
|
|
1048
|
+
} validate24.errors = vErrors; return errors === 0; }
|
|
1049
|
+
validate24.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1050
|
+
function validate23(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/BrokerRequest" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate23.evaluated; if (evaluated0.dynamicProps) {
|
|
1051
|
+
evaluated0.props = undefined;
|
|
1052
|
+
} if (evaluated0.dynamicItems) {
|
|
1053
|
+
evaluated0.items = undefined;
|
|
1054
|
+
} if (!(validate24(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
|
|
1055
|
+
vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);
|
|
1056
|
+
errors = vErrors.length;
|
|
1057
|
+
} validate23.errors = vErrors; return errors === 0; }
|
|
1058
|
+
validate23.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1059
|
+
export const validateRequestPage = validate30;
|
|
1060
|
+
const schema46 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/RequestPage", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/RequestPage" };
|
|
1061
|
+
const schema47 = { "type": "object", "additionalProperties": false, "required": ["requests"], "properties": { "requests": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/BrokerRequest" } }, "next_cursor": { "type": "string", "maxLength": 1024 }, "event_cursor": { "type": "string", "maxLength": 1024 } } };
|
|
1062
|
+
function validate32(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate32.evaluated; if (evaluated0.dynamicProps) {
|
|
1063
|
+
evaluated0.props = undefined;
|
|
1064
|
+
} if (evaluated0.dynamicItems) {
|
|
1065
|
+
evaluated0.items = undefined;
|
|
1066
|
+
} if (errors === 0) {
|
|
1067
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1068
|
+
let missing0;
|
|
1069
|
+
if (((((((((((((data.id === undefined) && (missing0 = "id")) || ((data.revision === undefined) && (missing0 = "revision"))) || ((data.requester === undefined) && (missing0 = "requester"))) || ((data.operation === undefined) && (missing0 = "operation"))) || ((data.status === undefined) && (missing0 = "status"))) || ((data.requested_at === undefined) && (missing0 = "requested_at"))) || ((data.requested_duration_seconds === undefined) && (missing0 = "requested_duration_seconds"))) || ((data.requested_max_uses === undefined) && (missing0 = "requested_max_uses"))) || ((data.granted_max_uses === undefined) && (missing0 = "granted_max_uses"))) || ((data.used_count === undefined) && (missing0 = "used_count"))) || ((data.presentation === undefined) && (missing0 = "presentation"))) || ((data.allowed_actions === undefined) && (missing0 = "allowed_actions"))) {
|
|
1070
|
+
validate32.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1071
|
+
return false;
|
|
1072
|
+
}
|
|
1073
|
+
else {
|
|
1074
|
+
const _errs1 = errors;
|
|
1075
|
+
for (const key0 in data) {
|
|
1076
|
+
if (!(func3.call(schema37.properties, key0))) {
|
|
1077
|
+
validate32.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1078
|
+
return false;
|
|
1079
|
+
break;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
if (_errs1 === errors) {
|
|
1083
|
+
if (data.id !== undefined) {
|
|
1084
|
+
let data0 = data.id;
|
|
1085
|
+
const _errs2 = errors;
|
|
1086
|
+
if (errors === _errs2) {
|
|
1087
|
+
if (typeof data0 === "string") {
|
|
1088
|
+
if (func1(data0) > 128) {
|
|
1089
|
+
validate32.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
if (func1(data0) < 1) {
|
|
1094
|
+
validate32.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
1095
|
+
return false;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
else {
|
|
1100
|
+
validate32.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1101
|
+
return false;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
var valid0 = _errs2 === errors;
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
var valid0 = true;
|
|
1108
|
+
}
|
|
1109
|
+
if (valid0) {
|
|
1110
|
+
if (data.revision !== undefined) {
|
|
1111
|
+
let data1 = data.revision;
|
|
1112
|
+
const _errs4 = errors;
|
|
1113
|
+
if (!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))) {
|
|
1114
|
+
validate32.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
if (errors === _errs4) {
|
|
1118
|
+
if ((typeof data1 == "number") && (isFinite(data1))) {
|
|
1119
|
+
if (data1 < 1 || isNaN(data1)) {
|
|
1120
|
+
validate32.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1121
|
+
return false;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
var valid0 = _errs4 === errors;
|
|
1126
|
+
}
|
|
1127
|
+
else {
|
|
1128
|
+
var valid0 = true;
|
|
1129
|
+
}
|
|
1130
|
+
if (valid0) {
|
|
1131
|
+
if (data.requester !== undefined) {
|
|
1132
|
+
let data2 = data.requester;
|
|
1133
|
+
const _errs6 = errors;
|
|
1134
|
+
if (errors === _errs6) {
|
|
1135
|
+
if (typeof data2 === "string") {
|
|
1136
|
+
if (func1(data2) > 80) {
|
|
1137
|
+
validate32.errors = [{ instancePath: instancePath + "/requester", schemaPath: "#/properties/requester/maxLength", keyword: "maxLength", params: { limit: 80 }, message: "must NOT have more than 80 characters" }];
|
|
1138
|
+
return false;
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
if (func1(data2) < 1) {
|
|
1142
|
+
validate32.errors = [{ instancePath: instancePath + "/requester", schemaPath: "#/properties/requester/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
1143
|
+
return false;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
else {
|
|
1148
|
+
validate32.errors = [{ instancePath: instancePath + "/requester", schemaPath: "#/properties/requester/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1149
|
+
return false;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
var valid0 = _errs6 === errors;
|
|
1153
|
+
}
|
|
1154
|
+
else {
|
|
1155
|
+
var valid0 = true;
|
|
1156
|
+
}
|
|
1157
|
+
if (valid0) {
|
|
1158
|
+
if (data.operation !== undefined) {
|
|
1159
|
+
let data3 = data.operation;
|
|
1160
|
+
const _errs8 = errors;
|
|
1161
|
+
if (errors === _errs8) {
|
|
1162
|
+
if (typeof data3 === "string") {
|
|
1163
|
+
if (func1(data3) > 500) {
|
|
1164
|
+
validate32.errors = [{ instancePath: instancePath + "/operation", schemaPath: "#/properties/operation/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }];
|
|
1165
|
+
return false;
|
|
1166
|
+
}
|
|
1167
|
+
else {
|
|
1168
|
+
if (func1(data3) < 1) {
|
|
1169
|
+
validate32.errors = [{ instancePath: instancePath + "/operation", schemaPath: "#/properties/operation/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
1170
|
+
return false;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
else {
|
|
1175
|
+
validate32.errors = [{ instancePath: instancePath + "/operation", schemaPath: "#/properties/operation/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1176
|
+
return false;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
var valid0 = _errs8 === errors;
|
|
1180
|
+
}
|
|
1181
|
+
else {
|
|
1182
|
+
var valid0 = true;
|
|
1183
|
+
}
|
|
1184
|
+
if (valid0) {
|
|
1185
|
+
if (data.status !== undefined) {
|
|
1186
|
+
let data4 = data.status;
|
|
1187
|
+
const _errs10 = errors;
|
|
1188
|
+
if (typeof data4 !== "string") {
|
|
1189
|
+
validate32.errors = [{ instancePath: instancePath + "/status", schemaPath: "#/$defs/Status/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1190
|
+
return false;
|
|
1191
|
+
}
|
|
1192
|
+
if (!(((((((data4 === "pending") || (data4 === "active")) || (data4 === "denied")) || (data4 === "canceled")) || (data4 === "expired")) || (data4 === "consumed")) || (data4 === "revoked"))) {
|
|
1193
|
+
validate32.errors = [{ instancePath: instancePath + "/status", schemaPath: "#/$defs/Status/enum", keyword: "enum", params: { allowedValues: schema38.enum }, message: "must be equal to one of the allowed values" }];
|
|
1194
|
+
return false;
|
|
1195
|
+
}
|
|
1196
|
+
var valid0 = _errs10 === errors;
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
var valid0 = true;
|
|
1200
|
+
}
|
|
1201
|
+
if (valid0) {
|
|
1202
|
+
if (data.requested_at !== undefined) {
|
|
1203
|
+
let data5 = data.requested_at;
|
|
1204
|
+
const _errs13 = errors;
|
|
1205
|
+
if (errors === _errs13) {
|
|
1206
|
+
if (errors === _errs13) {
|
|
1207
|
+
if (typeof data5 === "string") {
|
|
1208
|
+
if (!(formats0.validate(data5))) {
|
|
1209
|
+
validate32.errors = [{ instancePath: instancePath + "/requested_at", schemaPath: "#/properties/requested_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
1210
|
+
return false;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
else {
|
|
1214
|
+
validate32.errors = [{ instancePath: instancePath + "/requested_at", schemaPath: "#/properties/requested_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1215
|
+
return false;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
var valid0 = _errs13 === errors;
|
|
1220
|
+
}
|
|
1221
|
+
else {
|
|
1222
|
+
var valid0 = true;
|
|
1223
|
+
}
|
|
1224
|
+
if (valid0) {
|
|
1225
|
+
if (data.pending_expires_at !== undefined) {
|
|
1226
|
+
let data6 = data.pending_expires_at;
|
|
1227
|
+
const _errs15 = errors;
|
|
1228
|
+
if (errors === _errs15) {
|
|
1229
|
+
if (errors === _errs15) {
|
|
1230
|
+
if (typeof data6 === "string") {
|
|
1231
|
+
if (!(formats0.validate(data6))) {
|
|
1232
|
+
validate32.errors = [{ instancePath: instancePath + "/pending_expires_at", schemaPath: "#/properties/pending_expires_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
1233
|
+
return false;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
else {
|
|
1237
|
+
validate32.errors = [{ instancePath: instancePath + "/pending_expires_at", schemaPath: "#/properties/pending_expires_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1238
|
+
return false;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
var valid0 = _errs15 === errors;
|
|
1243
|
+
}
|
|
1244
|
+
else {
|
|
1245
|
+
var valid0 = true;
|
|
1246
|
+
}
|
|
1247
|
+
if (valid0) {
|
|
1248
|
+
if (data.active_expires_at !== undefined) {
|
|
1249
|
+
let data7 = data.active_expires_at;
|
|
1250
|
+
const _errs17 = errors;
|
|
1251
|
+
if (errors === _errs17) {
|
|
1252
|
+
if (errors === _errs17) {
|
|
1253
|
+
if (typeof data7 === "string") {
|
|
1254
|
+
if (!(formats0.validate(data7))) {
|
|
1255
|
+
validate32.errors = [{ instancePath: instancePath + "/active_expires_at", schemaPath: "#/properties/active_expires_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
1256
|
+
return false;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
else {
|
|
1260
|
+
validate32.errors = [{ instancePath: instancePath + "/active_expires_at", schemaPath: "#/properties/active_expires_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1261
|
+
return false;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
var valid0 = _errs17 === errors;
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
var valid0 = true;
|
|
1269
|
+
}
|
|
1270
|
+
if (valid0) {
|
|
1271
|
+
if (data.requested_duration_seconds !== undefined) {
|
|
1272
|
+
let data8 = data.requested_duration_seconds;
|
|
1273
|
+
const _errs19 = errors;
|
|
1274
|
+
if (!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))) {
|
|
1275
|
+
validate32.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
1276
|
+
return false;
|
|
1277
|
+
}
|
|
1278
|
+
if (errors === _errs19) {
|
|
1279
|
+
if ((typeof data8 == "number") && (isFinite(data8))) {
|
|
1280
|
+
if (data8 < 1 || isNaN(data8)) {
|
|
1281
|
+
validate32.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1282
|
+
return false;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
var valid0 = _errs19 === errors;
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
var valid0 = true;
|
|
1290
|
+
}
|
|
1291
|
+
if (valid0) {
|
|
1292
|
+
if (data.requested_max_uses !== undefined) {
|
|
1293
|
+
let data9 = data.requested_max_uses;
|
|
1294
|
+
const _errs21 = errors;
|
|
1295
|
+
if ((!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))) && (data9 !== null)) {
|
|
1296
|
+
validate32.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/type", keyword: "type", params: { type: schema37.properties.requested_max_uses.type }, message: "must be integer,null" }];
|
|
1297
|
+
return false;
|
|
1298
|
+
}
|
|
1299
|
+
if (errors === _errs21) {
|
|
1300
|
+
if ((typeof data9 == "number") && (isFinite(data9))) {
|
|
1301
|
+
if (data9 < 1 || isNaN(data9)) {
|
|
1302
|
+
validate32.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1303
|
+
return false;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
var valid0 = _errs21 === errors;
|
|
1308
|
+
}
|
|
1309
|
+
else {
|
|
1310
|
+
var valid0 = true;
|
|
1311
|
+
}
|
|
1312
|
+
if (valid0) {
|
|
1313
|
+
if (data.granted_max_uses !== undefined) {
|
|
1314
|
+
let data10 = data.granted_max_uses;
|
|
1315
|
+
const _errs23 = errors;
|
|
1316
|
+
if ((!(((typeof data10 == "number") && (!(data10 % 1) && !isNaN(data10))) && (isFinite(data10)))) && (data10 !== null)) {
|
|
1317
|
+
validate32.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/type", keyword: "type", params: { type: schema37.properties.granted_max_uses.type }, message: "must be integer,null" }];
|
|
1318
|
+
return false;
|
|
1319
|
+
}
|
|
1320
|
+
if (errors === _errs23) {
|
|
1321
|
+
if ((typeof data10 == "number") && (isFinite(data10))) {
|
|
1322
|
+
if (data10 < 1 || isNaN(data10)) {
|
|
1323
|
+
validate32.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1324
|
+
return false;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
var valid0 = _errs23 === errors;
|
|
1329
|
+
}
|
|
1330
|
+
else {
|
|
1331
|
+
var valid0 = true;
|
|
1332
|
+
}
|
|
1333
|
+
if (valid0) {
|
|
1334
|
+
if (data.used_count !== undefined) {
|
|
1335
|
+
let data11 = data.used_count;
|
|
1336
|
+
const _errs25 = errors;
|
|
1337
|
+
if (!(((typeof data11 == "number") && (!(data11 % 1) && !isNaN(data11))) && (isFinite(data11)))) {
|
|
1338
|
+
validate32.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
1339
|
+
return false;
|
|
1340
|
+
}
|
|
1341
|
+
if (errors === _errs25) {
|
|
1342
|
+
if ((typeof data11 == "number") && (isFinite(data11))) {
|
|
1343
|
+
if (data11 < 0 || isNaN(data11)) {
|
|
1344
|
+
validate32.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
|
|
1345
|
+
return false;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
var valid0 = _errs25 === errors;
|
|
1350
|
+
}
|
|
1351
|
+
else {
|
|
1352
|
+
var valid0 = true;
|
|
1353
|
+
}
|
|
1354
|
+
if (valid0) {
|
|
1355
|
+
if (data.request_reason !== undefined) {
|
|
1356
|
+
let data12 = data.request_reason;
|
|
1357
|
+
const _errs27 = errors;
|
|
1358
|
+
if (errors === _errs27) {
|
|
1359
|
+
if (typeof data12 === "string") {
|
|
1360
|
+
if (func1(data12) > 2000) {
|
|
1361
|
+
validate32.errors = [{ instancePath: instancePath + "/request_reason", schemaPath: "#/properties/request_reason/maxLength", keyword: "maxLength", params: { limit: 2000 }, message: "must NOT have more than 2000 characters" }];
|
|
1362
|
+
return false;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
else {
|
|
1366
|
+
validate32.errors = [{ instancePath: instancePath + "/request_reason", schemaPath: "#/properties/request_reason/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1367
|
+
return false;
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
var valid0 = _errs27 === errors;
|
|
1371
|
+
}
|
|
1372
|
+
else {
|
|
1373
|
+
var valid0 = true;
|
|
1374
|
+
}
|
|
1375
|
+
if (valid0) {
|
|
1376
|
+
if (data.decided_at !== undefined) {
|
|
1377
|
+
let data13 = data.decided_at;
|
|
1378
|
+
const _errs29 = errors;
|
|
1379
|
+
if (errors === _errs29) {
|
|
1380
|
+
if (errors === _errs29) {
|
|
1381
|
+
if (typeof data13 === "string") {
|
|
1382
|
+
if (!(formats0.validate(data13))) {
|
|
1383
|
+
validate32.errors = [{ instancePath: instancePath + "/decided_at", schemaPath: "#/properties/decided_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
else {
|
|
1388
|
+
validate32.errors = [{ instancePath: instancePath + "/decided_at", schemaPath: "#/properties/decided_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1389
|
+
return false;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
var valid0 = _errs29 === errors;
|
|
1394
|
+
}
|
|
1395
|
+
else {
|
|
1396
|
+
var valid0 = true;
|
|
1397
|
+
}
|
|
1398
|
+
if (valid0) {
|
|
1399
|
+
if (data.decided_by !== undefined) {
|
|
1400
|
+
let data14 = data.decided_by;
|
|
1401
|
+
const _errs31 = errors;
|
|
1402
|
+
if (errors === _errs31) {
|
|
1403
|
+
if (typeof data14 === "string") {
|
|
1404
|
+
if (func1(data14) > 200) {
|
|
1405
|
+
validate32.errors = [{ instancePath: instancePath + "/decided_by", schemaPath: "#/properties/decided_by/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
1406
|
+
return false;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
else {
|
|
1410
|
+
validate32.errors = [{ instancePath: instancePath + "/decided_by", schemaPath: "#/properties/decided_by/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1411
|
+
return false;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
var valid0 = _errs31 === errors;
|
|
1415
|
+
}
|
|
1416
|
+
else {
|
|
1417
|
+
var valid0 = true;
|
|
1418
|
+
}
|
|
1419
|
+
if (valid0) {
|
|
1420
|
+
if (data.decided_on_behalf_of !== undefined) {
|
|
1421
|
+
let data15 = data.decided_on_behalf_of;
|
|
1422
|
+
const _errs33 = errors;
|
|
1423
|
+
if (errors === _errs33) {
|
|
1424
|
+
if (typeof data15 === "string") {
|
|
1425
|
+
if (func1(data15) > 200) {
|
|
1426
|
+
validate32.errors = [{ instancePath: instancePath + "/decided_on_behalf_of", schemaPath: "#/properties/decided_on_behalf_of/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
1427
|
+
return false;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
else {
|
|
1431
|
+
validate32.errors = [{ instancePath: instancePath + "/decided_on_behalf_of", schemaPath: "#/properties/decided_on_behalf_of/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1432
|
+
return false;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
var valid0 = _errs33 === errors;
|
|
1436
|
+
}
|
|
1437
|
+
else {
|
|
1438
|
+
var valid0 = true;
|
|
1439
|
+
}
|
|
1440
|
+
if (valid0) {
|
|
1441
|
+
if (data.presentation !== undefined) {
|
|
1442
|
+
const _errs35 = errors;
|
|
1443
|
+
if (!(validate25(data.presentation, { instancePath: instancePath + "/presentation", parentData: data, parentDataProperty: "presentation", rootData, dynamicAnchors }))) {
|
|
1444
|
+
vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);
|
|
1445
|
+
errors = vErrors.length;
|
|
1446
|
+
}
|
|
1447
|
+
var valid0 = _errs35 === errors;
|
|
1448
|
+
}
|
|
1449
|
+
else {
|
|
1450
|
+
var valid0 = true;
|
|
1451
|
+
}
|
|
1452
|
+
if (valid0) {
|
|
1453
|
+
if (data.presentation_unavailable !== undefined) {
|
|
1454
|
+
const _errs36 = errors;
|
|
1455
|
+
if (typeof data.presentation_unavailable !== "boolean") {
|
|
1456
|
+
validate32.errors = [{ instancePath: instancePath + "/presentation_unavailable", schemaPath: "#/properties/presentation_unavailable/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
|
|
1457
|
+
return false;
|
|
1458
|
+
}
|
|
1459
|
+
var valid0 = _errs36 === errors;
|
|
1460
|
+
}
|
|
1461
|
+
else {
|
|
1462
|
+
var valid0 = true;
|
|
1463
|
+
}
|
|
1464
|
+
if (valid0) {
|
|
1465
|
+
if (data.allowed_actions !== undefined) {
|
|
1466
|
+
let data18 = data.allowed_actions;
|
|
1467
|
+
const _errs38 = errors;
|
|
1468
|
+
if (errors === _errs38) {
|
|
1469
|
+
if (Array.isArray(data18)) {
|
|
1470
|
+
var valid2 = true;
|
|
1471
|
+
const len0 = data18.length;
|
|
1472
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
1473
|
+
let data19 = data18[i0];
|
|
1474
|
+
const _errs40 = errors;
|
|
1475
|
+
if (typeof data19 !== "string") {
|
|
1476
|
+
validate32.errors = [{ instancePath: instancePath + "/allowed_actions/" + i0, schemaPath: "#/$defs/Action/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1477
|
+
return false;
|
|
1478
|
+
}
|
|
1479
|
+
if (!(((data19 === "approve") || (data19 === "deny")) || (data19 === "revoke"))) {
|
|
1480
|
+
validate32.errors = [{ instancePath: instancePath + "/allowed_actions/" + i0, schemaPath: "#/$defs/Action/enum", keyword: "enum", params: { allowedValues: schema44.enum }, message: "must be equal to one of the allowed values" }];
|
|
1481
|
+
return false;
|
|
1482
|
+
}
|
|
1483
|
+
var valid2 = _errs40 === errors;
|
|
1484
|
+
if (!valid2) {
|
|
1485
|
+
break;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
if (valid2) {
|
|
1489
|
+
let i1 = data18.length;
|
|
1490
|
+
let j0;
|
|
1491
|
+
if (i1 > 1) {
|
|
1492
|
+
outer0: for (; i1--;) {
|
|
1493
|
+
for (j0 = i1; j0--;) {
|
|
1494
|
+
if (func0(data18[i1], data18[j0])) {
|
|
1495
|
+
validate32.errors = [{ instancePath: instancePath + "/allowed_actions", schemaPath: "#/properties/allowed_actions/uniqueItems", keyword: "uniqueItems", params: { i: i1, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i1 + " are identical)" }];
|
|
1496
|
+
return false;
|
|
1497
|
+
break outer0;
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
else {
|
|
1505
|
+
validate32.errors = [{ instancePath: instancePath + "/allowed_actions", schemaPath: "#/properties/allowed_actions/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
1506
|
+
return false;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
var valid0 = _errs38 === errors;
|
|
1510
|
+
}
|
|
1511
|
+
else {
|
|
1512
|
+
var valid0 = true;
|
|
1513
|
+
}
|
|
1514
|
+
if (valid0) {
|
|
1515
|
+
if (data.approval_bounds !== undefined) {
|
|
1516
|
+
let data20 = data.approval_bounds;
|
|
1517
|
+
const _errs43 = errors;
|
|
1518
|
+
const _errs44 = errors;
|
|
1519
|
+
if (errors === _errs44) {
|
|
1520
|
+
if (data20 && typeof data20 == "object" && !Array.isArray(data20)) {
|
|
1521
|
+
let missing1;
|
|
1522
|
+
if (((data20.max_duration_seconds === undefined) && (missing1 = "max_duration_seconds")) || ((data20.max_uses === undefined) && (missing1 = "max_uses"))) {
|
|
1523
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds", schemaPath: "#/$defs/ApprovalBounds/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
|
|
1524
|
+
return false;
|
|
1525
|
+
}
|
|
1526
|
+
else {
|
|
1527
|
+
const _errs46 = errors;
|
|
1528
|
+
for (const key1 in data20) {
|
|
1529
|
+
if (!((key1 === "max_duration_seconds") || (key1 === "max_uses"))) {
|
|
1530
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds", schemaPath: "#/$defs/ApprovalBounds/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
|
|
1531
|
+
return false;
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
if (_errs46 === errors) {
|
|
1536
|
+
if (data20.max_duration_seconds !== undefined) {
|
|
1537
|
+
let data21 = data20.max_duration_seconds;
|
|
1538
|
+
const _errs47 = errors;
|
|
1539
|
+
if (!(((typeof data21 == "number") && (!(data21 % 1) && !isNaN(data21))) && (isFinite(data21)))) {
|
|
1540
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
1541
|
+
return false;
|
|
1542
|
+
}
|
|
1543
|
+
if (errors === _errs47) {
|
|
1544
|
+
if ((typeof data21 == "number") && (isFinite(data21))) {
|
|
1545
|
+
if (data21 < 1 || isNaN(data21)) {
|
|
1546
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1547
|
+
return false;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
var valid6 = _errs47 === errors;
|
|
1552
|
+
}
|
|
1553
|
+
else {
|
|
1554
|
+
var valid6 = true;
|
|
1555
|
+
}
|
|
1556
|
+
if (valid6) {
|
|
1557
|
+
if (data20.max_uses !== undefined) {
|
|
1558
|
+
let data22 = data20.max_uses;
|
|
1559
|
+
const _errs49 = errors;
|
|
1560
|
+
if ((!(((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22))) && (isFinite(data22)))) && (data22 !== null)) {
|
|
1561
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/type", keyword: "type", params: { type: schema45.properties.max_uses.type }, message: "must be integer,null" }];
|
|
1562
|
+
return false;
|
|
1563
|
+
}
|
|
1564
|
+
if (errors === _errs49) {
|
|
1565
|
+
if ((typeof data22 == "number") && (isFinite(data22))) {
|
|
1566
|
+
if (data22 < 1 || isNaN(data22)) {
|
|
1567
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1568
|
+
return false;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
var valid6 = _errs49 === errors;
|
|
1573
|
+
}
|
|
1574
|
+
else {
|
|
1575
|
+
var valid6 = true;
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
validate32.errors = [{ instancePath: instancePath + "/approval_bounds", schemaPath: "#/$defs/ApprovalBounds/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1583
|
+
return false;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
var valid0 = _errs43 === errors;
|
|
1587
|
+
}
|
|
1588
|
+
else {
|
|
1589
|
+
var valid0 = true;
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
validate32.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1615
|
+
return false;
|
|
1616
|
+
}
|
|
1617
|
+
} validate32.errors = vErrors; return errors === 0; }
|
|
1618
|
+
validate32.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1619
|
+
function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate31.evaluated; if (evaluated0.dynamicProps) {
|
|
1620
|
+
evaluated0.props = undefined;
|
|
1621
|
+
} if (evaluated0.dynamicItems) {
|
|
1622
|
+
evaluated0.items = undefined;
|
|
1623
|
+
} if (errors === 0) {
|
|
1624
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1625
|
+
let missing0;
|
|
1626
|
+
if ((data.requests === undefined) && (missing0 = "requests")) {
|
|
1627
|
+
validate31.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1628
|
+
return false;
|
|
1629
|
+
}
|
|
1630
|
+
else {
|
|
1631
|
+
const _errs1 = errors;
|
|
1632
|
+
for (const key0 in data) {
|
|
1633
|
+
if (!(((key0 === "requests") || (key0 === "next_cursor")) || (key0 === "event_cursor"))) {
|
|
1634
|
+
validate31.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1635
|
+
return false;
|
|
1636
|
+
break;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
if (_errs1 === errors) {
|
|
1640
|
+
if (data.requests !== undefined) {
|
|
1641
|
+
let data0 = data.requests;
|
|
1642
|
+
const _errs2 = errors;
|
|
1643
|
+
if (errors === _errs2) {
|
|
1644
|
+
if (Array.isArray(data0)) {
|
|
1645
|
+
if (data0.length > 100) {
|
|
1646
|
+
validate31.errors = [{ instancePath: instancePath + "/requests", schemaPath: "#/properties/requests/maxItems", keyword: "maxItems", params: { limit: 100 }, message: "must NOT have more than 100 items" }];
|
|
1647
|
+
return false;
|
|
1648
|
+
}
|
|
1649
|
+
else {
|
|
1650
|
+
var valid1 = true;
|
|
1651
|
+
const len0 = data0.length;
|
|
1652
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
1653
|
+
const _errs4 = errors;
|
|
1654
|
+
if (!(validate32(data0[i0], { instancePath: instancePath + "/requests/" + i0, parentData: data0, parentDataProperty: i0, rootData, dynamicAnchors }))) {
|
|
1655
|
+
vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
|
|
1656
|
+
errors = vErrors.length;
|
|
1657
|
+
}
|
|
1658
|
+
var valid1 = _errs4 === errors;
|
|
1659
|
+
if (!valid1) {
|
|
1660
|
+
break;
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
else {
|
|
1666
|
+
validate31.errors = [{ instancePath: instancePath + "/requests", schemaPath: "#/properties/requests/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
1667
|
+
return false;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
var valid0 = _errs2 === errors;
|
|
1671
|
+
}
|
|
1672
|
+
else {
|
|
1673
|
+
var valid0 = true;
|
|
1674
|
+
}
|
|
1675
|
+
if (valid0) {
|
|
1676
|
+
if (data.next_cursor !== undefined) {
|
|
1677
|
+
let data2 = data.next_cursor;
|
|
1678
|
+
const _errs5 = errors;
|
|
1679
|
+
if (errors === _errs5) {
|
|
1680
|
+
if (typeof data2 === "string") {
|
|
1681
|
+
if (func1(data2) > 1024) {
|
|
1682
|
+
validate31.errors = [{ instancePath: instancePath + "/next_cursor", schemaPath: "#/properties/next_cursor/maxLength", keyword: "maxLength", params: { limit: 1024 }, message: "must NOT have more than 1024 characters" }];
|
|
1683
|
+
return false;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
validate31.errors = [{ instancePath: instancePath + "/next_cursor", schemaPath: "#/properties/next_cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1688
|
+
return false;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
var valid0 = _errs5 === errors;
|
|
1692
|
+
}
|
|
1693
|
+
else {
|
|
1694
|
+
var valid0 = true;
|
|
1695
|
+
}
|
|
1696
|
+
if (valid0) {
|
|
1697
|
+
if (data.event_cursor !== undefined) {
|
|
1698
|
+
let data3 = data.event_cursor;
|
|
1699
|
+
const _errs7 = errors;
|
|
1700
|
+
if (errors === _errs7) {
|
|
1701
|
+
if (typeof data3 === "string") {
|
|
1702
|
+
if (func1(data3) > 1024) {
|
|
1703
|
+
validate31.errors = [{ instancePath: instancePath + "/event_cursor", schemaPath: "#/properties/event_cursor/maxLength", keyword: "maxLength", params: { limit: 1024 }, message: "must NOT have more than 1024 characters" }];
|
|
1704
|
+
return false;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
else {
|
|
1708
|
+
validate31.errors = [{ instancePath: instancePath + "/event_cursor", schemaPath: "#/properties/event_cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1709
|
+
return false;
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
var valid0 = _errs7 === errors;
|
|
1713
|
+
}
|
|
1714
|
+
else {
|
|
1715
|
+
var valid0 = true;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
else {
|
|
1723
|
+
validate31.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1724
|
+
return false;
|
|
1725
|
+
}
|
|
1726
|
+
} validate31.errors = vErrors; return errors === 0; }
|
|
1727
|
+
validate31.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1728
|
+
function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/RequestPage" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate30.evaluated; if (evaluated0.dynamicProps) {
|
|
1729
|
+
evaluated0.props = undefined;
|
|
1730
|
+
} if (evaluated0.dynamicItems) {
|
|
1731
|
+
evaluated0.items = undefined;
|
|
1732
|
+
} if (!(validate31(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
|
|
1733
|
+
vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
|
|
1734
|
+
errors = vErrors.length;
|
|
1735
|
+
} validate30.errors = vErrors; return errors === 0; }
|
|
1736
|
+
validate30.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1737
|
+
export const validateBrokerEvent = validate36;
|
|
1738
|
+
const schema52 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/BrokerEvent", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/BrokerEvent" };
|
|
1739
|
+
const schema53 = { "type": "object", "additionalProperties": false, "required": ["cursor", "kind", "request_id", "revision", "status", "occurred_at", "used_count"], "properties": { "cursor": { "type": "string", "minLength": 1, "maxLength": 1024 }, "kind": { "type": "string", "enum": ["request.created", "request.approved", "request.denied", "request.canceled", "request.expired", "grant.revoked", "grant.reserved", "grant.consumed", "grant.released", "execution.succeeded", "execution.failed", "execution.ambiguous"] }, "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "integer", "minimum": 1 }, "status": { "$ref": "#/$defs/Status" }, "occurred_at": { "type": "string", "format": "date-time" }, "used_count": { "type": "integer", "minimum": 0 } } };
|
|
1740
|
+
function validate37(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate37.evaluated; if (evaluated0.dynamicProps) {
|
|
1741
|
+
evaluated0.props = undefined;
|
|
1742
|
+
} if (evaluated0.dynamicItems) {
|
|
1743
|
+
evaluated0.items = undefined;
|
|
1744
|
+
} if (errors === 0) {
|
|
1745
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1746
|
+
let missing0;
|
|
1747
|
+
if ((((((((data.cursor === undefined) && (missing0 = "cursor")) || ((data.kind === undefined) && (missing0 = "kind"))) || ((data.request_id === undefined) && (missing0 = "request_id"))) || ((data.revision === undefined) && (missing0 = "revision"))) || ((data.status === undefined) && (missing0 = "status"))) || ((data.occurred_at === undefined) && (missing0 = "occurred_at"))) || ((data.used_count === undefined) && (missing0 = "used_count"))) {
|
|
1748
|
+
validate37.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1749
|
+
return false;
|
|
1750
|
+
}
|
|
1751
|
+
else {
|
|
1752
|
+
const _errs1 = errors;
|
|
1753
|
+
for (const key0 in data) {
|
|
1754
|
+
if (!(((((((key0 === "cursor") || (key0 === "kind")) || (key0 === "request_id")) || (key0 === "revision")) || (key0 === "status")) || (key0 === "occurred_at")) || (key0 === "used_count"))) {
|
|
1755
|
+
validate37.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1756
|
+
return false;
|
|
1757
|
+
break;
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
if (_errs1 === errors) {
|
|
1761
|
+
if (data.cursor !== undefined) {
|
|
1762
|
+
let data0 = data.cursor;
|
|
1763
|
+
const _errs2 = errors;
|
|
1764
|
+
if (errors === _errs2) {
|
|
1765
|
+
if (typeof data0 === "string") {
|
|
1766
|
+
if (func1(data0) > 1024) {
|
|
1767
|
+
validate37.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "#/properties/cursor/maxLength", keyword: "maxLength", params: { limit: 1024 }, message: "must NOT have more than 1024 characters" }];
|
|
1768
|
+
return false;
|
|
1769
|
+
}
|
|
1770
|
+
else {
|
|
1771
|
+
if (func1(data0) < 1) {
|
|
1772
|
+
validate37.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "#/properties/cursor/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
1773
|
+
return false;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
else {
|
|
1778
|
+
validate37.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "#/properties/cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1779
|
+
return false;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
var valid0 = _errs2 === errors;
|
|
1783
|
+
}
|
|
1784
|
+
else {
|
|
1785
|
+
var valid0 = true;
|
|
1786
|
+
}
|
|
1787
|
+
if (valid0) {
|
|
1788
|
+
if (data.kind !== undefined) {
|
|
1789
|
+
let data1 = data.kind;
|
|
1790
|
+
const _errs4 = errors;
|
|
1791
|
+
if (typeof data1 !== "string") {
|
|
1792
|
+
validate37.errors = [{ instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1793
|
+
return false;
|
|
1794
|
+
}
|
|
1795
|
+
if (!((((((((((((data1 === "request.created") || (data1 === "request.approved")) || (data1 === "request.denied")) || (data1 === "request.canceled")) || (data1 === "request.expired")) || (data1 === "grant.revoked")) || (data1 === "grant.reserved")) || (data1 === "grant.consumed")) || (data1 === "grant.released")) || (data1 === "execution.succeeded")) || (data1 === "execution.failed")) || (data1 === "execution.ambiguous"))) {
|
|
1796
|
+
validate37.errors = [{ instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema53.properties.kind.enum }, message: "must be equal to one of the allowed values" }];
|
|
1797
|
+
return false;
|
|
1798
|
+
}
|
|
1799
|
+
var valid0 = _errs4 === errors;
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
var valid0 = true;
|
|
1803
|
+
}
|
|
1804
|
+
if (valid0) {
|
|
1805
|
+
if (data.request_id !== undefined) {
|
|
1806
|
+
let data2 = data.request_id;
|
|
1807
|
+
const _errs6 = errors;
|
|
1808
|
+
if (errors === _errs6) {
|
|
1809
|
+
if (typeof data2 === "string") {
|
|
1810
|
+
if (func1(data2) > 128) {
|
|
1811
|
+
validate37.errors = [{ instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
1812
|
+
return false;
|
|
1813
|
+
}
|
|
1814
|
+
else {
|
|
1815
|
+
if (func1(data2) < 1) {
|
|
1816
|
+
validate37.errors = [{ instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
1817
|
+
return false;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
else {
|
|
1822
|
+
validate37.errors = [{ instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1823
|
+
return false;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
var valid0 = _errs6 === errors;
|
|
1827
|
+
}
|
|
1828
|
+
else {
|
|
1829
|
+
var valid0 = true;
|
|
1830
|
+
}
|
|
1831
|
+
if (valid0) {
|
|
1832
|
+
if (data.revision !== undefined) {
|
|
1833
|
+
let data3 = data.revision;
|
|
1834
|
+
const _errs8 = errors;
|
|
1835
|
+
if (!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) {
|
|
1836
|
+
validate37.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
1837
|
+
return false;
|
|
1838
|
+
}
|
|
1839
|
+
if (errors === _errs8) {
|
|
1840
|
+
if ((typeof data3 == "number") && (isFinite(data3))) {
|
|
1841
|
+
if (data3 < 1 || isNaN(data3)) {
|
|
1842
|
+
validate37.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
|
|
1843
|
+
return false;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
var valid0 = _errs8 === errors;
|
|
1848
|
+
}
|
|
1849
|
+
else {
|
|
1850
|
+
var valid0 = true;
|
|
1851
|
+
}
|
|
1852
|
+
if (valid0) {
|
|
1853
|
+
if (data.status !== undefined) {
|
|
1854
|
+
let data4 = data.status;
|
|
1855
|
+
const _errs10 = errors;
|
|
1856
|
+
if (typeof data4 !== "string") {
|
|
1857
|
+
validate37.errors = [{ instancePath: instancePath + "/status", schemaPath: "#/$defs/Status/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1858
|
+
return false;
|
|
1859
|
+
}
|
|
1860
|
+
if (!(((((((data4 === "pending") || (data4 === "active")) || (data4 === "denied")) || (data4 === "canceled")) || (data4 === "expired")) || (data4 === "consumed")) || (data4 === "revoked"))) {
|
|
1861
|
+
validate37.errors = [{ instancePath: instancePath + "/status", schemaPath: "#/$defs/Status/enum", keyword: "enum", params: { allowedValues: schema38.enum }, message: "must be equal to one of the allowed values" }];
|
|
1862
|
+
return false;
|
|
1863
|
+
}
|
|
1864
|
+
var valid0 = _errs10 === errors;
|
|
1865
|
+
}
|
|
1866
|
+
else {
|
|
1867
|
+
var valid0 = true;
|
|
1868
|
+
}
|
|
1869
|
+
if (valid0) {
|
|
1870
|
+
if (data.occurred_at !== undefined) {
|
|
1871
|
+
let data5 = data.occurred_at;
|
|
1872
|
+
const _errs13 = errors;
|
|
1873
|
+
if (errors === _errs13) {
|
|
1874
|
+
if (errors === _errs13) {
|
|
1875
|
+
if (typeof data5 === "string") {
|
|
1876
|
+
if (!(formats0.validate(data5))) {
|
|
1877
|
+
validate37.errors = [{ instancePath: instancePath + "/occurred_at", schemaPath: "#/properties/occurred_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
1878
|
+
return false;
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
else {
|
|
1882
|
+
validate37.errors = [{ instancePath: instancePath + "/occurred_at", schemaPath: "#/properties/occurred_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1883
|
+
return false;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
var valid0 = _errs13 === errors;
|
|
1888
|
+
}
|
|
1889
|
+
else {
|
|
1890
|
+
var valid0 = true;
|
|
1891
|
+
}
|
|
1892
|
+
if (valid0) {
|
|
1893
|
+
if (data.used_count !== undefined) {
|
|
1894
|
+
let data6 = data.used_count;
|
|
1895
|
+
const _errs15 = errors;
|
|
1896
|
+
if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
|
|
1897
|
+
validate37.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
1898
|
+
return false;
|
|
1899
|
+
}
|
|
1900
|
+
if (errors === _errs15) {
|
|
1901
|
+
if ((typeof data6 == "number") && (isFinite(data6))) {
|
|
1902
|
+
if (data6 < 0 || isNaN(data6)) {
|
|
1903
|
+
validate37.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
|
|
1904
|
+
return false;
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
var valid0 = _errs15 === errors;
|
|
1909
|
+
}
|
|
1910
|
+
else {
|
|
1911
|
+
var valid0 = true;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
else {
|
|
1923
|
+
validate37.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1924
|
+
return false;
|
|
1925
|
+
}
|
|
1926
|
+
} validate37.errors = vErrors; return errors === 0; }
|
|
1927
|
+
validate37.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1928
|
+
function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/BrokerEvent" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate36.evaluated; if (evaluated0.dynamicProps) {
|
|
1929
|
+
evaluated0.props = undefined;
|
|
1930
|
+
} if (evaluated0.dynamicItems) {
|
|
1931
|
+
evaluated0.items = undefined;
|
|
1932
|
+
} if (!(validate37(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
|
|
1933
|
+
vErrors = vErrors === null ? validate37.errors : vErrors.concat(validate37.errors);
|
|
1934
|
+
errors = vErrors.length;
|
|
1935
|
+
} validate36.errors = vErrors; return errors === 0; }
|
|
1936
|
+
validate36.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
1937
|
+
export const validateErrorEnvelope = validate39;
|
|
1938
|
+
const schema55 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/ErrorEnvelope", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/ErrorEnvelope" };
|
|
1939
|
+
const schema56 = { "type": "object", "additionalProperties": false, "required": ["error"], "properties": { "error": { "$ref": "#/$defs/Error" } } };
|
|
1940
|
+
const schema57 = { "type": "object", "additionalProperties": false, "required": ["code", "message", "correlation_id"], "properties": { "code": { "type": "string", "enum": ["invalid_request", "unauthorized", "forbidden", "not_found", "method_not_allowed", "revision_conflict", "idempotency_conflict", "constraint_exceeded", "invalid_transition", "invalid_decision_token", "cursor_expired", "temporarily_unavailable", "internal_error"] }, "message": { "type": "string", "minLength": 1, "maxLength": 500 }, "correlation_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "current": { "$ref": "#/$defs/BrokerRequest" } } };
|
|
1941
|
+
function validate41(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate41.evaluated; if (evaluated0.dynamicProps) {
|
|
1942
|
+
evaluated0.props = undefined;
|
|
1943
|
+
} if (evaluated0.dynamicItems) {
|
|
1944
|
+
evaluated0.items = undefined;
|
|
1945
|
+
} if (errors === 0) {
|
|
1946
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1947
|
+
let missing0;
|
|
1948
|
+
if ((((data.code === undefined) && (missing0 = "code")) || ((data.message === undefined) && (missing0 = "message"))) || ((data.correlation_id === undefined) && (missing0 = "correlation_id"))) {
|
|
1949
|
+
validate41.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1950
|
+
return false;
|
|
1951
|
+
}
|
|
1952
|
+
else {
|
|
1953
|
+
const _errs1 = errors;
|
|
1954
|
+
for (const key0 in data) {
|
|
1955
|
+
if (!((((key0 === "code") || (key0 === "message")) || (key0 === "correlation_id")) || (key0 === "current"))) {
|
|
1956
|
+
validate41.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1957
|
+
return false;
|
|
1958
|
+
break;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
if (_errs1 === errors) {
|
|
1962
|
+
if (data.code !== undefined) {
|
|
1963
|
+
let data0 = data.code;
|
|
1964
|
+
const _errs2 = errors;
|
|
1965
|
+
if (typeof data0 !== "string") {
|
|
1966
|
+
validate41.errors = [{ instancePath: instancePath + "/code", schemaPath: "#/properties/code/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1967
|
+
return false;
|
|
1968
|
+
}
|
|
1969
|
+
if (!(((((((((((((data0 === "invalid_request") || (data0 === "unauthorized")) || (data0 === "forbidden")) || (data0 === "not_found")) || (data0 === "method_not_allowed")) || (data0 === "revision_conflict")) || (data0 === "idempotency_conflict")) || (data0 === "constraint_exceeded")) || (data0 === "invalid_transition")) || (data0 === "invalid_decision_token")) || (data0 === "cursor_expired")) || (data0 === "temporarily_unavailable")) || (data0 === "internal_error"))) {
|
|
1970
|
+
validate41.errors = [{ instancePath: instancePath + "/code", schemaPath: "#/properties/code/enum", keyword: "enum", params: { allowedValues: schema57.properties.code.enum }, message: "must be equal to one of the allowed values" }];
|
|
1971
|
+
return false;
|
|
1972
|
+
}
|
|
1973
|
+
var valid0 = _errs2 === errors;
|
|
1974
|
+
}
|
|
1975
|
+
else {
|
|
1976
|
+
var valid0 = true;
|
|
1977
|
+
}
|
|
1978
|
+
if (valid0) {
|
|
1979
|
+
if (data.message !== undefined) {
|
|
1980
|
+
let data1 = data.message;
|
|
1981
|
+
const _errs4 = errors;
|
|
1982
|
+
if (errors === _errs4) {
|
|
1983
|
+
if (typeof data1 === "string") {
|
|
1984
|
+
if (func1(data1) > 500) {
|
|
1985
|
+
validate41.errors = [{ instancePath: instancePath + "/message", schemaPath: "#/properties/message/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }];
|
|
1986
|
+
return false;
|
|
1987
|
+
}
|
|
1988
|
+
else {
|
|
1989
|
+
if (func1(data1) < 1) {
|
|
1990
|
+
validate41.errors = [{ instancePath: instancePath + "/message", schemaPath: "#/properties/message/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
1991
|
+
return false;
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
else {
|
|
1996
|
+
validate41.errors = [{ instancePath: instancePath + "/message", schemaPath: "#/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1997
|
+
return false;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
var valid0 = _errs4 === errors;
|
|
2001
|
+
}
|
|
2002
|
+
else {
|
|
2003
|
+
var valid0 = true;
|
|
2004
|
+
}
|
|
2005
|
+
if (valid0) {
|
|
2006
|
+
if (data.correlation_id !== undefined) {
|
|
2007
|
+
let data2 = data.correlation_id;
|
|
2008
|
+
const _errs6 = errors;
|
|
2009
|
+
if (errors === _errs6) {
|
|
2010
|
+
if (typeof data2 === "string") {
|
|
2011
|
+
if (func1(data2) > 128) {
|
|
2012
|
+
validate41.errors = [{ instancePath: instancePath + "/correlation_id", schemaPath: "#/properties/correlation_id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2013
|
+
return false;
|
|
2014
|
+
}
|
|
2015
|
+
else {
|
|
2016
|
+
if (func1(data2) < 1) {
|
|
2017
|
+
validate41.errors = [{ instancePath: instancePath + "/correlation_id", schemaPath: "#/properties/correlation_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2018
|
+
return false;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
else {
|
|
2023
|
+
validate41.errors = [{ instancePath: instancePath + "/correlation_id", schemaPath: "#/properties/correlation_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2024
|
+
return false;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
var valid0 = _errs6 === errors;
|
|
2028
|
+
}
|
|
2029
|
+
else {
|
|
2030
|
+
var valid0 = true;
|
|
2031
|
+
}
|
|
2032
|
+
if (valid0) {
|
|
2033
|
+
if (data.current !== undefined) {
|
|
2034
|
+
const _errs8 = errors;
|
|
2035
|
+
if (!(validate32(data.current, { instancePath: instancePath + "/current", parentData: data, parentDataProperty: "current", rootData, dynamicAnchors }))) {
|
|
2036
|
+
vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
|
|
2037
|
+
errors = vErrors.length;
|
|
2038
|
+
}
|
|
2039
|
+
var valid0 = _errs8 === errors;
|
|
2040
|
+
}
|
|
2041
|
+
else {
|
|
2042
|
+
var valid0 = true;
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
else {
|
|
2051
|
+
validate41.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2052
|
+
return false;
|
|
2053
|
+
}
|
|
2054
|
+
} validate41.errors = vErrors; return errors === 0; }
|
|
2055
|
+
validate41.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2056
|
+
function validate40(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate40.evaluated; if (evaluated0.dynamicProps) {
|
|
2057
|
+
evaluated0.props = undefined;
|
|
2058
|
+
} if (evaluated0.dynamicItems) {
|
|
2059
|
+
evaluated0.items = undefined;
|
|
2060
|
+
} if (errors === 0) {
|
|
2061
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2062
|
+
let missing0;
|
|
2063
|
+
if ((data.error === undefined) && (missing0 = "error")) {
|
|
2064
|
+
validate40.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2065
|
+
return false;
|
|
2066
|
+
}
|
|
2067
|
+
else {
|
|
2068
|
+
const _errs1 = errors;
|
|
2069
|
+
for (const key0 in data) {
|
|
2070
|
+
if (!(key0 === "error")) {
|
|
2071
|
+
validate40.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2072
|
+
return false;
|
|
2073
|
+
break;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
if (_errs1 === errors) {
|
|
2077
|
+
if (data.error !== undefined) {
|
|
2078
|
+
if (!(validate41(data.error, { instancePath: instancePath + "/error", parentData: data, parentDataProperty: "error", rootData, dynamicAnchors }))) {
|
|
2079
|
+
vErrors = vErrors === null ? validate41.errors : vErrors.concat(validate41.errors);
|
|
2080
|
+
errors = vErrors.length;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
else {
|
|
2087
|
+
validate40.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2088
|
+
return false;
|
|
2089
|
+
}
|
|
2090
|
+
} validate40.errors = vErrors; return errors === 0; }
|
|
2091
|
+
validate40.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2092
|
+
function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/ErrorEnvelope" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate39.evaluated; if (evaluated0.dynamicProps) {
|
|
2093
|
+
evaluated0.props = undefined;
|
|
2094
|
+
} if (evaluated0.dynamicItems) {
|
|
2095
|
+
evaluated0.items = undefined;
|
|
2096
|
+
} if (!(validate40(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
|
|
2097
|
+
vErrors = vErrors === null ? validate40.errors : vErrors.concat(validate40.errors);
|
|
2098
|
+
errors = vErrors.length;
|
|
2099
|
+
} validate39.errors = vErrors; return errors === 0; }
|
|
2100
|
+
validate39.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2101
|
+
export const validateUISnapshot = validate45;
|
|
2102
|
+
const schema58 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/UISnapshot", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshot" };
|
|
2103
|
+
const schema59 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "synchronized_at", "sources", "requests"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "synchronized_at": { "type": "string", "format": "date-time" }, "sources": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/UISourceHealth" } }, "requests": { "type": "array", "maxItems": 1000, "items": { "$ref": "#/$defs/UIRequest" } }, "delivery_failures": { "type": "integer", "minimum": 0 } } };
|
|
2104
|
+
const schema60 = { "type": "object", "additionalProperties": false, "required": ["id", "label", "healthy"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "label": { "type": "string", "minLength": 1, "maxLength": 200 }, "healthy": { "type": "boolean" }, "last_sync_at": { "type": "string", "format": "date-time" }, "error": { "type": "string", "maxLength": 200 } } };
|
|
2105
|
+
const schema61 = { "type": "object", "additionalProperties": false, "required": ["source_id", "source_label", "handle", "request"], "properties": { "source_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "source_label": { "type": "string", "minLength": 1, "maxLength": 200 }, "handle": { "type": "string", "minLength": 22, "maxLength": 256, "pattern": "^[A-Za-z0-9_-]+$" }, "request": { "$ref": "#/$defs/BrokerRequest" } } };
|
|
2106
|
+
const pattern4 = new RegExp("^[A-Za-z0-9_-]+$", "u");
|
|
2107
|
+
function validate47(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate47.evaluated; if (evaluated0.dynamicProps) {
|
|
2108
|
+
evaluated0.props = undefined;
|
|
2109
|
+
} if (evaluated0.dynamicItems) {
|
|
2110
|
+
evaluated0.items = undefined;
|
|
2111
|
+
} if (errors === 0) {
|
|
2112
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2113
|
+
let missing0;
|
|
2114
|
+
if (((((data.source_id === undefined) && (missing0 = "source_id")) || ((data.source_label === undefined) && (missing0 = "source_label"))) || ((data.handle === undefined) && (missing0 = "handle"))) || ((data.request === undefined) && (missing0 = "request"))) {
|
|
2115
|
+
validate47.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2116
|
+
return false;
|
|
2117
|
+
}
|
|
2118
|
+
else {
|
|
2119
|
+
const _errs1 = errors;
|
|
2120
|
+
for (const key0 in data) {
|
|
2121
|
+
if (!((((key0 === "source_id") || (key0 === "source_label")) || (key0 === "handle")) || (key0 === "request"))) {
|
|
2122
|
+
validate47.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2123
|
+
return false;
|
|
2124
|
+
break;
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
if (_errs1 === errors) {
|
|
2128
|
+
if (data.source_id !== undefined) {
|
|
2129
|
+
let data0 = data.source_id;
|
|
2130
|
+
const _errs2 = errors;
|
|
2131
|
+
if (errors === _errs2) {
|
|
2132
|
+
if (typeof data0 === "string") {
|
|
2133
|
+
if (func1(data0) > 128) {
|
|
2134
|
+
validate47.errors = [{ instancePath: instancePath + "/source_id", schemaPath: "#/properties/source_id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2135
|
+
return false;
|
|
2136
|
+
}
|
|
2137
|
+
else {
|
|
2138
|
+
if (func1(data0) < 1) {
|
|
2139
|
+
validate47.errors = [{ instancePath: instancePath + "/source_id", schemaPath: "#/properties/source_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2140
|
+
return false;
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
validate47.errors = [{ instancePath: instancePath + "/source_id", schemaPath: "#/properties/source_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2146
|
+
return false;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
var valid0 = _errs2 === errors;
|
|
2150
|
+
}
|
|
2151
|
+
else {
|
|
2152
|
+
var valid0 = true;
|
|
2153
|
+
}
|
|
2154
|
+
if (valid0) {
|
|
2155
|
+
if (data.source_label !== undefined) {
|
|
2156
|
+
let data1 = data.source_label;
|
|
2157
|
+
const _errs4 = errors;
|
|
2158
|
+
if (errors === _errs4) {
|
|
2159
|
+
if (typeof data1 === "string") {
|
|
2160
|
+
if (func1(data1) > 200) {
|
|
2161
|
+
validate47.errors = [{ instancePath: instancePath + "/source_label", schemaPath: "#/properties/source_label/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
2162
|
+
return false;
|
|
2163
|
+
}
|
|
2164
|
+
else {
|
|
2165
|
+
if (func1(data1) < 1) {
|
|
2166
|
+
validate47.errors = [{ instancePath: instancePath + "/source_label", schemaPath: "#/properties/source_label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2167
|
+
return false;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
else {
|
|
2172
|
+
validate47.errors = [{ instancePath: instancePath + "/source_label", schemaPath: "#/properties/source_label/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2173
|
+
return false;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
var valid0 = _errs4 === errors;
|
|
2177
|
+
}
|
|
2178
|
+
else {
|
|
2179
|
+
var valid0 = true;
|
|
2180
|
+
}
|
|
2181
|
+
if (valid0) {
|
|
2182
|
+
if (data.handle !== undefined) {
|
|
2183
|
+
let data2 = data.handle;
|
|
2184
|
+
const _errs6 = errors;
|
|
2185
|
+
if (errors === _errs6) {
|
|
2186
|
+
if (typeof data2 === "string") {
|
|
2187
|
+
if (func1(data2) > 256) {
|
|
2188
|
+
validate47.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
|
|
2189
|
+
return false;
|
|
2190
|
+
}
|
|
2191
|
+
else {
|
|
2192
|
+
if (func1(data2) < 22) {
|
|
2193
|
+
validate47.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/minLength", keyword: "minLength", params: { limit: 22 }, message: "must NOT have fewer than 22 characters" }];
|
|
2194
|
+
return false;
|
|
2195
|
+
}
|
|
2196
|
+
else {
|
|
2197
|
+
if (!pattern4.test(data2)) {
|
|
2198
|
+
validate47.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: "must match pattern \"" + "^[A-Za-z0-9_-]+$" + "\"" }];
|
|
2199
|
+
return false;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
else {
|
|
2205
|
+
validate47.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
var valid0 = _errs6 === errors;
|
|
2210
|
+
}
|
|
2211
|
+
else {
|
|
2212
|
+
var valid0 = true;
|
|
2213
|
+
}
|
|
2214
|
+
if (valid0) {
|
|
2215
|
+
if (data.request !== undefined) {
|
|
2216
|
+
const _errs8 = errors;
|
|
2217
|
+
if (!(validate32(data.request, { instancePath: instancePath + "/request", parentData: data, parentDataProperty: "request", rootData, dynamicAnchors }))) {
|
|
2218
|
+
vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
|
|
2219
|
+
errors = vErrors.length;
|
|
2220
|
+
}
|
|
2221
|
+
var valid0 = _errs8 === errors;
|
|
2222
|
+
}
|
|
2223
|
+
else {
|
|
2224
|
+
var valid0 = true;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
else {
|
|
2233
|
+
validate47.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2234
|
+
return false;
|
|
2235
|
+
}
|
|
2236
|
+
} validate47.errors = vErrors; return errors === 0; }
|
|
2237
|
+
validate47.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2238
|
+
function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate46.evaluated; if (evaluated0.dynamicProps) {
|
|
2239
|
+
evaluated0.props = undefined;
|
|
2240
|
+
} if (evaluated0.dynamicItems) {
|
|
2241
|
+
evaluated0.items = undefined;
|
|
2242
|
+
} if (errors === 0) {
|
|
2243
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2244
|
+
let missing0;
|
|
2245
|
+
if ((((((data.api_version === undefined) && (missing0 = "api_version")) || ((data.cursor === undefined) && (missing0 = "cursor"))) || ((data.synchronized_at === undefined) && (missing0 = "synchronized_at"))) || ((data.sources === undefined) && (missing0 = "sources"))) || ((data.requests === undefined) && (missing0 = "requests"))) {
|
|
2246
|
+
validate46.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2247
|
+
return false;
|
|
2248
|
+
}
|
|
2249
|
+
else {
|
|
2250
|
+
const _errs1 = errors;
|
|
2251
|
+
for (const key0 in data) {
|
|
2252
|
+
if (!((((((key0 === "api_version") || (key0 === "cursor")) || (key0 === "synchronized_at")) || (key0 === "sources")) || (key0 === "requests")) || (key0 === "delivery_failures"))) {
|
|
2253
|
+
validate46.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2254
|
+
return false;
|
|
2255
|
+
break;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
if (_errs1 === errors) {
|
|
2259
|
+
if (data.api_version !== undefined) {
|
|
2260
|
+
let data0 = data.api_version;
|
|
2261
|
+
const _errs2 = errors;
|
|
2262
|
+
if (typeof data0 !== "string") {
|
|
2263
|
+
validate46.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "#/properties/api_version/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2264
|
+
return false;
|
|
2265
|
+
}
|
|
2266
|
+
if ("brokerkit.io/operator-ui/v1" !== data0) {
|
|
2267
|
+
validate46.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "#/properties/api_version/const", keyword: "const", params: { allowedValue: "brokerkit.io/operator-ui/v1" }, message: "must be equal to constant" }];
|
|
2268
|
+
return false;
|
|
2269
|
+
}
|
|
2270
|
+
var valid0 = _errs2 === errors;
|
|
2271
|
+
}
|
|
2272
|
+
else {
|
|
2273
|
+
var valid0 = true;
|
|
2274
|
+
}
|
|
2275
|
+
if (valid0) {
|
|
2276
|
+
if (data.cursor !== undefined) {
|
|
2277
|
+
let data1 = data.cursor;
|
|
2278
|
+
const _errs4 = errors;
|
|
2279
|
+
if (errors === _errs4) {
|
|
2280
|
+
if (typeof data1 === "string") {
|
|
2281
|
+
if (func1(data1) > 128) {
|
|
2282
|
+
validate46.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "#/properties/cursor/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2283
|
+
return false;
|
|
2284
|
+
}
|
|
2285
|
+
else {
|
|
2286
|
+
if (func1(data1) < 1) {
|
|
2287
|
+
validate46.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "#/properties/cursor/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2288
|
+
return false;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
else {
|
|
2293
|
+
validate46.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "#/properties/cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2294
|
+
return false;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
var valid0 = _errs4 === errors;
|
|
2298
|
+
}
|
|
2299
|
+
else {
|
|
2300
|
+
var valid0 = true;
|
|
2301
|
+
}
|
|
2302
|
+
if (valid0) {
|
|
2303
|
+
if (data.synchronized_at !== undefined) {
|
|
2304
|
+
let data2 = data.synchronized_at;
|
|
2305
|
+
const _errs6 = errors;
|
|
2306
|
+
if (errors === _errs6) {
|
|
2307
|
+
if (errors === _errs6) {
|
|
2308
|
+
if (typeof data2 === "string") {
|
|
2309
|
+
if (!(formats0.validate(data2))) {
|
|
2310
|
+
validate46.errors = [{ instancePath: instancePath + "/synchronized_at", schemaPath: "#/properties/synchronized_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
2311
|
+
return false;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
else {
|
|
2315
|
+
validate46.errors = [{ instancePath: instancePath + "/synchronized_at", schemaPath: "#/properties/synchronized_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2316
|
+
return false;
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
var valid0 = _errs6 === errors;
|
|
2321
|
+
}
|
|
2322
|
+
else {
|
|
2323
|
+
var valid0 = true;
|
|
2324
|
+
}
|
|
2325
|
+
if (valid0) {
|
|
2326
|
+
if (data.sources !== undefined) {
|
|
2327
|
+
let data3 = data.sources;
|
|
2328
|
+
const _errs8 = errors;
|
|
2329
|
+
if (errors === _errs8) {
|
|
2330
|
+
if (Array.isArray(data3)) {
|
|
2331
|
+
if (data3.length > 100) {
|
|
2332
|
+
validate46.errors = [{ instancePath: instancePath + "/sources", schemaPath: "#/properties/sources/maxItems", keyword: "maxItems", params: { limit: 100 }, message: "must NOT have more than 100 items" }];
|
|
2333
|
+
return false;
|
|
2334
|
+
}
|
|
2335
|
+
else {
|
|
2336
|
+
var valid1 = true;
|
|
2337
|
+
const len0 = data3.length;
|
|
2338
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
2339
|
+
let data4 = data3[i0];
|
|
2340
|
+
const _errs10 = errors;
|
|
2341
|
+
const _errs11 = errors;
|
|
2342
|
+
if (errors === _errs11) {
|
|
2343
|
+
if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
|
|
2344
|
+
let missing1;
|
|
2345
|
+
if ((((data4.id === undefined) && (missing1 = "id")) || ((data4.label === undefined) && (missing1 = "label"))) || ((data4.healthy === undefined) && (missing1 = "healthy"))) {
|
|
2346
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0, schemaPath: "#/$defs/UISourceHealth/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
|
|
2347
|
+
return false;
|
|
2348
|
+
}
|
|
2349
|
+
else {
|
|
2350
|
+
const _errs13 = errors;
|
|
2351
|
+
for (const key1 in data4) {
|
|
2352
|
+
if (!(((((key1 === "id") || (key1 === "label")) || (key1 === "healthy")) || (key1 === "last_sync_at")) || (key1 === "error"))) {
|
|
2353
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0, schemaPath: "#/$defs/UISourceHealth/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
|
|
2354
|
+
return false;
|
|
2355
|
+
break;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
if (_errs13 === errors) {
|
|
2359
|
+
if (data4.id !== undefined) {
|
|
2360
|
+
let data5 = data4.id;
|
|
2361
|
+
const _errs14 = errors;
|
|
2362
|
+
if (errors === _errs14) {
|
|
2363
|
+
if (typeof data5 === "string") {
|
|
2364
|
+
if (func1(data5) > 128) {
|
|
2365
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/id", schemaPath: "#/$defs/UISourceHealth/properties/id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2366
|
+
return false;
|
|
2367
|
+
}
|
|
2368
|
+
else {
|
|
2369
|
+
if (func1(data5) < 1) {
|
|
2370
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/id", schemaPath: "#/$defs/UISourceHealth/properties/id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2371
|
+
return false;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
else {
|
|
2376
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/id", schemaPath: "#/$defs/UISourceHealth/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2377
|
+
return false;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
var valid3 = _errs14 === errors;
|
|
2381
|
+
}
|
|
2382
|
+
else {
|
|
2383
|
+
var valid3 = true;
|
|
2384
|
+
}
|
|
2385
|
+
if (valid3) {
|
|
2386
|
+
if (data4.label !== undefined) {
|
|
2387
|
+
let data6 = data4.label;
|
|
2388
|
+
const _errs16 = errors;
|
|
2389
|
+
if (errors === _errs16) {
|
|
2390
|
+
if (typeof data6 === "string") {
|
|
2391
|
+
if (func1(data6) > 200) {
|
|
2392
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/label", schemaPath: "#/$defs/UISourceHealth/properties/label/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
2393
|
+
return false;
|
|
2394
|
+
}
|
|
2395
|
+
else {
|
|
2396
|
+
if (func1(data6) < 1) {
|
|
2397
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/label", schemaPath: "#/$defs/UISourceHealth/properties/label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2398
|
+
return false;
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
else {
|
|
2403
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/label", schemaPath: "#/$defs/UISourceHealth/properties/label/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2404
|
+
return false;
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
var valid3 = _errs16 === errors;
|
|
2408
|
+
}
|
|
2409
|
+
else {
|
|
2410
|
+
var valid3 = true;
|
|
2411
|
+
}
|
|
2412
|
+
if (valid3) {
|
|
2413
|
+
if (data4.healthy !== undefined) {
|
|
2414
|
+
const _errs18 = errors;
|
|
2415
|
+
if (typeof data4.healthy !== "boolean") {
|
|
2416
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/healthy", schemaPath: "#/$defs/UISourceHealth/properties/healthy/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
|
|
2417
|
+
return false;
|
|
2418
|
+
}
|
|
2419
|
+
var valid3 = _errs18 === errors;
|
|
2420
|
+
}
|
|
2421
|
+
else {
|
|
2422
|
+
var valid3 = true;
|
|
2423
|
+
}
|
|
2424
|
+
if (valid3) {
|
|
2425
|
+
if (data4.last_sync_at !== undefined) {
|
|
2426
|
+
let data8 = data4.last_sync_at;
|
|
2427
|
+
const _errs20 = errors;
|
|
2428
|
+
if (errors === _errs20) {
|
|
2429
|
+
if (errors === _errs20) {
|
|
2430
|
+
if (typeof data8 === "string") {
|
|
2431
|
+
if (!(formats0.validate(data8))) {
|
|
2432
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/last_sync_at", schemaPath: "#/$defs/UISourceHealth/properties/last_sync_at/format", keyword: "format", params: { format: "date-time" }, message: "must match format \"" + "date-time" + "\"" }];
|
|
2433
|
+
return false;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
else {
|
|
2437
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/last_sync_at", schemaPath: "#/$defs/UISourceHealth/properties/last_sync_at/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2438
|
+
return false;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
var valid3 = _errs20 === errors;
|
|
2443
|
+
}
|
|
2444
|
+
else {
|
|
2445
|
+
var valid3 = true;
|
|
2446
|
+
}
|
|
2447
|
+
if (valid3) {
|
|
2448
|
+
if (data4.error !== undefined) {
|
|
2449
|
+
let data9 = data4.error;
|
|
2450
|
+
const _errs22 = errors;
|
|
2451
|
+
if (errors === _errs22) {
|
|
2452
|
+
if (typeof data9 === "string") {
|
|
2453
|
+
if (func1(data9) > 200) {
|
|
2454
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/error", schemaPath: "#/$defs/UISourceHealth/properties/error/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
2455
|
+
return false;
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
else {
|
|
2459
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0 + "/error", schemaPath: "#/$defs/UISourceHealth/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2460
|
+
return false;
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
var valid3 = _errs22 === errors;
|
|
2464
|
+
}
|
|
2465
|
+
else {
|
|
2466
|
+
var valid3 = true;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
else {
|
|
2476
|
+
validate46.errors = [{ instancePath: instancePath + "/sources/" + i0, schemaPath: "#/$defs/UISourceHealth/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2477
|
+
return false;
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
var valid1 = _errs10 === errors;
|
|
2481
|
+
if (!valid1) {
|
|
2482
|
+
break;
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
else {
|
|
2488
|
+
validate46.errors = [{ instancePath: instancePath + "/sources", schemaPath: "#/properties/sources/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
2489
|
+
return false;
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
var valid0 = _errs8 === errors;
|
|
2493
|
+
}
|
|
2494
|
+
else {
|
|
2495
|
+
var valid0 = true;
|
|
2496
|
+
}
|
|
2497
|
+
if (valid0) {
|
|
2498
|
+
if (data.requests !== undefined) {
|
|
2499
|
+
let data10 = data.requests;
|
|
2500
|
+
const _errs24 = errors;
|
|
2501
|
+
if (errors === _errs24) {
|
|
2502
|
+
if (Array.isArray(data10)) {
|
|
2503
|
+
if (data10.length > 1000) {
|
|
2504
|
+
validate46.errors = [{ instancePath: instancePath + "/requests", schemaPath: "#/properties/requests/maxItems", keyword: "maxItems", params: { limit: 1000 }, message: "must NOT have more than 1000 items" }];
|
|
2505
|
+
return false;
|
|
2506
|
+
}
|
|
2507
|
+
else {
|
|
2508
|
+
var valid4 = true;
|
|
2509
|
+
const len1 = data10.length;
|
|
2510
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
2511
|
+
const _errs26 = errors;
|
|
2512
|
+
if (!(validate47(data10[i1], { instancePath: instancePath + "/requests/" + i1, parentData: data10, parentDataProperty: i1, rootData, dynamicAnchors }))) {
|
|
2513
|
+
vErrors = vErrors === null ? validate47.errors : vErrors.concat(validate47.errors);
|
|
2514
|
+
errors = vErrors.length;
|
|
2515
|
+
}
|
|
2516
|
+
var valid4 = _errs26 === errors;
|
|
2517
|
+
if (!valid4) {
|
|
2518
|
+
break;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
else {
|
|
2524
|
+
validate46.errors = [{ instancePath: instancePath + "/requests", schemaPath: "#/properties/requests/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
2525
|
+
return false;
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
var valid0 = _errs24 === errors;
|
|
2529
|
+
}
|
|
2530
|
+
else {
|
|
2531
|
+
var valid0 = true;
|
|
2532
|
+
}
|
|
2533
|
+
if (valid0) {
|
|
2534
|
+
if (data.delivery_failures !== undefined) {
|
|
2535
|
+
let data12 = data.delivery_failures;
|
|
2536
|
+
const _errs27 = errors;
|
|
2537
|
+
if (!(((typeof data12 == "number") && (!(data12 % 1) && !isNaN(data12))) && (isFinite(data12)))) {
|
|
2538
|
+
validate46.errors = [{ instancePath: instancePath + "/delivery_failures", schemaPath: "#/properties/delivery_failures/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
2539
|
+
return false;
|
|
2540
|
+
}
|
|
2541
|
+
if (errors === _errs27) {
|
|
2542
|
+
if ((typeof data12 == "number") && (isFinite(data12))) {
|
|
2543
|
+
if (data12 < 0 || isNaN(data12)) {
|
|
2544
|
+
validate46.errors = [{ instancePath: instancePath + "/delivery_failures", schemaPath: "#/properties/delivery_failures/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
|
|
2545
|
+
return false;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
var valid0 = _errs27 === errors;
|
|
2550
|
+
}
|
|
2551
|
+
else {
|
|
2552
|
+
var valid0 = true;
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
else {
|
|
2563
|
+
validate46.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2564
|
+
return false;
|
|
2565
|
+
}
|
|
2566
|
+
} validate46.errors = vErrors; return errors === 0; }
|
|
2567
|
+
validate46.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2568
|
+
function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/UISnapshot" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate45.evaluated; if (evaluated0.dynamicProps) {
|
|
2569
|
+
evaluated0.props = undefined;
|
|
2570
|
+
} if (evaluated0.dynamicItems) {
|
|
2571
|
+
evaluated0.items = undefined;
|
|
2572
|
+
} if (!(validate46(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
|
|
2573
|
+
vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);
|
|
2574
|
+
errors = vErrors.length;
|
|
2575
|
+
} validate45.errors = vErrors; return errors === 0; }
|
|
2576
|
+
validate45.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2577
|
+
export const validateUISnapshotEvent = validate51;
|
|
2578
|
+
const schema62 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/UISnapshotEvent", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent" };
|
|
2579
|
+
const schema63 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "changed"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "changed": { "type": "boolean" } } };
|
|
2580
|
+
function validate51(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/UISnapshotEvent" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate51.evaluated; if (evaluated0.dynamicProps) {
|
|
2581
|
+
evaluated0.props = undefined;
|
|
2582
|
+
} if (evaluated0.dynamicItems) {
|
|
2583
|
+
evaluated0.items = undefined;
|
|
2584
|
+
} const _errs0 = errors; if (errors === _errs0) {
|
|
2585
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2586
|
+
let missing0;
|
|
2587
|
+
if ((((data.api_version === undefined) && (missing0 = "api_version")) || ((data.cursor === undefined) && (missing0 = "cursor"))) || ((data.changed === undefined) && (missing0 = "changed"))) {
|
|
2588
|
+
validate51.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2589
|
+
return false;
|
|
2590
|
+
}
|
|
2591
|
+
else {
|
|
2592
|
+
const _errs2 = errors;
|
|
2593
|
+
for (const key0 in data) {
|
|
2594
|
+
if (!(((key0 === "api_version") || (key0 === "cursor")) || (key0 === "changed"))) {
|
|
2595
|
+
validate51.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2596
|
+
return false;
|
|
2597
|
+
break;
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
if (_errs2 === errors) {
|
|
2601
|
+
if (data.api_version !== undefined) {
|
|
2602
|
+
let data0 = data.api_version;
|
|
2603
|
+
const _errs3 = errors;
|
|
2604
|
+
if (typeof data0 !== "string") {
|
|
2605
|
+
validate51.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/properties/api_version/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2606
|
+
return false;
|
|
2607
|
+
}
|
|
2608
|
+
if ("brokerkit.io/operator-ui/v1" !== data0) {
|
|
2609
|
+
validate51.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/properties/api_version/const", keyword: "const", params: { allowedValue: "brokerkit.io/operator-ui/v1" }, message: "must be equal to constant" }];
|
|
2610
|
+
return false;
|
|
2611
|
+
}
|
|
2612
|
+
var valid1 = _errs3 === errors;
|
|
2613
|
+
}
|
|
2614
|
+
else {
|
|
2615
|
+
var valid1 = true;
|
|
2616
|
+
}
|
|
2617
|
+
if (valid1) {
|
|
2618
|
+
if (data.cursor !== undefined) {
|
|
2619
|
+
let data1 = data.cursor;
|
|
2620
|
+
const _errs5 = errors;
|
|
2621
|
+
if (errors === _errs5) {
|
|
2622
|
+
if (typeof data1 === "string") {
|
|
2623
|
+
if (func1(data1) > 128) {
|
|
2624
|
+
validate51.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/properties/cursor/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2625
|
+
return false;
|
|
2626
|
+
}
|
|
2627
|
+
else {
|
|
2628
|
+
if (func1(data1) < 1) {
|
|
2629
|
+
validate51.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/properties/cursor/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2630
|
+
return false;
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
else {
|
|
2635
|
+
validate51.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/properties/cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2636
|
+
return false;
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
var valid1 = _errs5 === errors;
|
|
2640
|
+
}
|
|
2641
|
+
else {
|
|
2642
|
+
var valid1 = true;
|
|
2643
|
+
}
|
|
2644
|
+
if (valid1) {
|
|
2645
|
+
if (data.changed !== undefined) {
|
|
2646
|
+
const _errs7 = errors;
|
|
2647
|
+
if (typeof data.changed !== "boolean") {
|
|
2648
|
+
validate51.errors = [{ instancePath: instancePath + "/changed", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/properties/changed/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
|
|
2649
|
+
return false;
|
|
2650
|
+
}
|
|
2651
|
+
var valid1 = _errs7 === errors;
|
|
2652
|
+
}
|
|
2653
|
+
else {
|
|
2654
|
+
var valid1 = true;
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
else {
|
|
2662
|
+
validate51.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshotEvent/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2663
|
+
return false;
|
|
2664
|
+
}
|
|
2665
|
+
} validate51.errors = vErrors; return errors === 0; }
|
|
2666
|
+
validate51.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2667
|
+
export const validateUISummary = validate52;
|
|
2668
|
+
const schema64 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/UISummary", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary" };
|
|
2669
|
+
const schema65 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "pending", "healthy"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "pending": { "type": "integer", "minimum": 0 }, "healthy": { "type": "boolean" } } };
|
|
2670
|
+
function validate52(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/UISummary" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate52.evaluated; if (evaluated0.dynamicProps) {
|
|
2671
|
+
evaluated0.props = undefined;
|
|
2672
|
+
} if (evaluated0.dynamicItems) {
|
|
2673
|
+
evaluated0.items = undefined;
|
|
2674
|
+
} const _errs0 = errors; if (errors === _errs0) {
|
|
2675
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2676
|
+
let missing0;
|
|
2677
|
+
if (((((data.api_version === undefined) && (missing0 = "api_version")) || ((data.cursor === undefined) && (missing0 = "cursor"))) || ((data.pending === undefined) && (missing0 = "pending"))) || ((data.healthy === undefined) && (missing0 = "healthy"))) {
|
|
2678
|
+
validate52.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2679
|
+
return false;
|
|
2680
|
+
}
|
|
2681
|
+
else {
|
|
2682
|
+
const _errs2 = errors;
|
|
2683
|
+
for (const key0 in data) {
|
|
2684
|
+
if (!((((key0 === "api_version") || (key0 === "cursor")) || (key0 === "pending")) || (key0 === "healthy"))) {
|
|
2685
|
+
validate52.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2686
|
+
return false;
|
|
2687
|
+
break;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
if (_errs2 === errors) {
|
|
2691
|
+
if (data.api_version !== undefined) {
|
|
2692
|
+
let data0 = data.api_version;
|
|
2693
|
+
const _errs3 = errors;
|
|
2694
|
+
if (typeof data0 !== "string") {
|
|
2695
|
+
validate52.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/api_version/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2696
|
+
return false;
|
|
2697
|
+
}
|
|
2698
|
+
if ("brokerkit.io/operator-ui/v1" !== data0) {
|
|
2699
|
+
validate52.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/api_version/const", keyword: "const", params: { allowedValue: "brokerkit.io/operator-ui/v1" }, message: "must be equal to constant" }];
|
|
2700
|
+
return false;
|
|
2701
|
+
}
|
|
2702
|
+
var valid1 = _errs3 === errors;
|
|
2703
|
+
}
|
|
2704
|
+
else {
|
|
2705
|
+
var valid1 = true;
|
|
2706
|
+
}
|
|
2707
|
+
if (valid1) {
|
|
2708
|
+
if (data.cursor !== undefined) {
|
|
2709
|
+
let data1 = data.cursor;
|
|
2710
|
+
const _errs5 = errors;
|
|
2711
|
+
if (errors === _errs5) {
|
|
2712
|
+
if (typeof data1 === "string") {
|
|
2713
|
+
if (func1(data1) > 128) {
|
|
2714
|
+
validate52.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/cursor/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2715
|
+
return false;
|
|
2716
|
+
}
|
|
2717
|
+
else {
|
|
2718
|
+
if (func1(data1) < 1) {
|
|
2719
|
+
validate52.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/cursor/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2720
|
+
return false;
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
else {
|
|
2725
|
+
validate52.errors = [{ instancePath: instancePath + "/cursor", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2726
|
+
return false;
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
var valid1 = _errs5 === errors;
|
|
2730
|
+
}
|
|
2731
|
+
else {
|
|
2732
|
+
var valid1 = true;
|
|
2733
|
+
}
|
|
2734
|
+
if (valid1) {
|
|
2735
|
+
if (data.pending !== undefined) {
|
|
2736
|
+
let data2 = data.pending;
|
|
2737
|
+
const _errs7 = errors;
|
|
2738
|
+
if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
|
|
2739
|
+
validate52.errors = [{ instancePath: instancePath + "/pending", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/pending/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
2740
|
+
return false;
|
|
2741
|
+
}
|
|
2742
|
+
if (errors === _errs7) {
|
|
2743
|
+
if ((typeof data2 == "number") && (isFinite(data2))) {
|
|
2744
|
+
if (data2 < 0 || isNaN(data2)) {
|
|
2745
|
+
validate52.errors = [{ instancePath: instancePath + "/pending", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/pending/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
|
|
2746
|
+
return false;
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
var valid1 = _errs7 === errors;
|
|
2751
|
+
}
|
|
2752
|
+
else {
|
|
2753
|
+
var valid1 = true;
|
|
2754
|
+
}
|
|
2755
|
+
if (valid1) {
|
|
2756
|
+
if (data.healthy !== undefined) {
|
|
2757
|
+
const _errs9 = errors;
|
|
2758
|
+
if (typeof data.healthy !== "boolean") {
|
|
2759
|
+
validate52.errors = [{ instancePath: instancePath + "/healthy", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/healthy/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
|
|
2760
|
+
return false;
|
|
2761
|
+
}
|
|
2762
|
+
var valid1 = _errs9 === errors;
|
|
2763
|
+
}
|
|
2764
|
+
else {
|
|
2765
|
+
var valid1 = true;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
else {
|
|
2774
|
+
validate52.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2775
|
+
return false;
|
|
2776
|
+
}
|
|
2777
|
+
} validate52.errors = vErrors; return errors === 0; }
|
|
2778
|
+
validate52.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2779
|
+
export const validateUIRequest = validate53;
|
|
2780
|
+
const schema66 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/UIRequest", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UIRequest" };
|
|
2781
|
+
function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate54.evaluated; if (evaluated0.dynamicProps) {
|
|
2782
|
+
evaluated0.props = undefined;
|
|
2783
|
+
} if (evaluated0.dynamicItems) {
|
|
2784
|
+
evaluated0.items = undefined;
|
|
2785
|
+
} if (errors === 0) {
|
|
2786
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2787
|
+
let missing0;
|
|
2788
|
+
if (((((data.source_id === undefined) && (missing0 = "source_id")) || ((data.source_label === undefined) && (missing0 = "source_label"))) || ((data.handle === undefined) && (missing0 = "handle"))) || ((data.request === undefined) && (missing0 = "request"))) {
|
|
2789
|
+
validate54.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2790
|
+
return false;
|
|
2791
|
+
}
|
|
2792
|
+
else {
|
|
2793
|
+
const _errs1 = errors;
|
|
2794
|
+
for (const key0 in data) {
|
|
2795
|
+
if (!((((key0 === "source_id") || (key0 === "source_label")) || (key0 === "handle")) || (key0 === "request"))) {
|
|
2796
|
+
validate54.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2797
|
+
return false;
|
|
2798
|
+
break;
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
if (_errs1 === errors) {
|
|
2802
|
+
if (data.source_id !== undefined) {
|
|
2803
|
+
let data0 = data.source_id;
|
|
2804
|
+
const _errs2 = errors;
|
|
2805
|
+
if (errors === _errs2) {
|
|
2806
|
+
if (typeof data0 === "string") {
|
|
2807
|
+
if (func1(data0) > 128) {
|
|
2808
|
+
validate54.errors = [{ instancePath: instancePath + "/source_id", schemaPath: "#/properties/source_id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
|
|
2809
|
+
return false;
|
|
2810
|
+
}
|
|
2811
|
+
else {
|
|
2812
|
+
if (func1(data0) < 1) {
|
|
2813
|
+
validate54.errors = [{ instancePath: instancePath + "/source_id", schemaPath: "#/properties/source_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2814
|
+
return false;
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
else {
|
|
2819
|
+
validate54.errors = [{ instancePath: instancePath + "/source_id", schemaPath: "#/properties/source_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2820
|
+
return false;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
var valid0 = _errs2 === errors;
|
|
2824
|
+
}
|
|
2825
|
+
else {
|
|
2826
|
+
var valid0 = true;
|
|
2827
|
+
}
|
|
2828
|
+
if (valid0) {
|
|
2829
|
+
if (data.source_label !== undefined) {
|
|
2830
|
+
let data1 = data.source_label;
|
|
2831
|
+
const _errs4 = errors;
|
|
2832
|
+
if (errors === _errs4) {
|
|
2833
|
+
if (typeof data1 === "string") {
|
|
2834
|
+
if (func1(data1) > 200) {
|
|
2835
|
+
validate54.errors = [{ instancePath: instancePath + "/source_label", schemaPath: "#/properties/source_label/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }];
|
|
2836
|
+
return false;
|
|
2837
|
+
}
|
|
2838
|
+
else {
|
|
2839
|
+
if (func1(data1) < 1) {
|
|
2840
|
+
validate54.errors = [{ instancePath: instancePath + "/source_label", schemaPath: "#/properties/source_label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
|
|
2841
|
+
return false;
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
else {
|
|
2846
|
+
validate54.errors = [{ instancePath: instancePath + "/source_label", schemaPath: "#/properties/source_label/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2847
|
+
return false;
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
var valid0 = _errs4 === errors;
|
|
2851
|
+
}
|
|
2852
|
+
else {
|
|
2853
|
+
var valid0 = true;
|
|
2854
|
+
}
|
|
2855
|
+
if (valid0) {
|
|
2856
|
+
if (data.handle !== undefined) {
|
|
2857
|
+
let data2 = data.handle;
|
|
2858
|
+
const _errs6 = errors;
|
|
2859
|
+
if (errors === _errs6) {
|
|
2860
|
+
if (typeof data2 === "string") {
|
|
2861
|
+
if (func1(data2) > 256) {
|
|
2862
|
+
validate54.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
|
|
2863
|
+
return false;
|
|
2864
|
+
}
|
|
2865
|
+
else {
|
|
2866
|
+
if (func1(data2) < 22) {
|
|
2867
|
+
validate54.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/minLength", keyword: "minLength", params: { limit: 22 }, message: "must NOT have fewer than 22 characters" }];
|
|
2868
|
+
return false;
|
|
2869
|
+
}
|
|
2870
|
+
else {
|
|
2871
|
+
if (!pattern4.test(data2)) {
|
|
2872
|
+
validate54.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: "must match pattern \"" + "^[A-Za-z0-9_-]+$" + "\"" }];
|
|
2873
|
+
return false;
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
else {
|
|
2879
|
+
validate54.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
2880
|
+
return false;
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
var valid0 = _errs6 === errors;
|
|
2884
|
+
}
|
|
2885
|
+
else {
|
|
2886
|
+
var valid0 = true;
|
|
2887
|
+
}
|
|
2888
|
+
if (valid0) {
|
|
2889
|
+
if (data.request !== undefined) {
|
|
2890
|
+
const _errs8 = errors;
|
|
2891
|
+
if (!(validate32(data.request, { instancePath: instancePath + "/request", parentData: data, parentDataProperty: "request", rootData, dynamicAnchors }))) {
|
|
2892
|
+
vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
|
|
2893
|
+
errors = vErrors.length;
|
|
2894
|
+
}
|
|
2895
|
+
var valid0 = _errs8 === errors;
|
|
2896
|
+
}
|
|
2897
|
+
else {
|
|
2898
|
+
var valid0 = true;
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
else {
|
|
2907
|
+
validate54.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2908
|
+
return false;
|
|
2909
|
+
}
|
|
2910
|
+
} validate54.errors = vErrors; return errors === 0; }
|
|
2911
|
+
validate54.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
2912
|
+
function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/UIRequest" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate53.evaluated; if (evaluated0.dynamicProps) {
|
|
2913
|
+
evaluated0.props = undefined;
|
|
2914
|
+
} if (evaluated0.dynamicItems) {
|
|
2915
|
+
evaluated0.items = undefined;
|
|
2916
|
+
} if (!(validate54(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
|
|
2917
|
+
vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
|
|
2918
|
+
errors = vErrors.length;
|
|
2919
|
+
} validate53.errors = vErrors; return errors === 0; }
|
|
2920
|
+
validate53.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|