@nosana/types 2.14.2 → 2.21.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/dist/Common/index.d.ts +29 -7
- package/dist/Common/index.d.ts.map +1 -1
- package/dist/Common/index.js +6 -0
- package/dist/Common/index.js.map +1 -1
- package/dist/Jobs/Flows/index.d.ts +9 -5
- package/dist/Jobs/Flows/index.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/args/expose.d.ts +17 -2
- package/dist/Jobs/JobDefinition/args/expose.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/args/expose.js.map +1 -1
- package/dist/Jobs/JobDefinition/args/index.d.ts +38 -0
- package/dist/Jobs/JobDefinition/args/index.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/args/index.js +660 -41
- package/dist/Jobs/JobDefinition/args/index.js.map +1 -1
- package/dist/Jobs/JobDefinition/args/output.d.ts +2 -0
- package/dist/Jobs/JobDefinition/args/output.d.ts.map +1 -0
- package/dist/Jobs/JobDefinition/args/output.js +2 -0
- package/dist/Jobs/JobDefinition/args/output.js.map +1 -0
- package/dist/Jobs/JobDefinition/args/required_vram.d.ts +2 -0
- package/dist/Jobs/JobDefinition/args/required_vram.d.ts.map +1 -0
- package/dist/Jobs/JobDefinition/args/required_vram.js +2 -0
- package/dist/Jobs/JobDefinition/args/required_vram.js.map +1 -0
- package/dist/Jobs/JobDefinition/args/trusted_execution_env.d.ts +6 -0
- package/dist/Jobs/JobDefinition/args/trusted_execution_env.d.ts.map +1 -0
- package/dist/Jobs/JobDefinition/args/trusted_execution_env.js +5 -0
- package/dist/Jobs/JobDefinition/args/trusted_execution_env.js.map +1 -0
- package/dist/Jobs/JobDefinition/index.d.ts +8 -4
- package/dist/Jobs/JobDefinition/index.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/logistics/index.d.ts +2 -2
- package/dist/Jobs/JobDefinition/logistics/index.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/logistics/index.js +10 -10
- package/dist/Jobs/JobDefinition/meta/index.d.ts +1 -1
- package/dist/Jobs/JobDefinition/meta/index.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/meta/index.js +2 -48
- package/dist/Jobs/JobDefinition/meta/index.js.map +1 -1
- package/dist/Jobs/JobDefinition/operations/index.d.ts +18 -3
- package/dist/Jobs/JobDefinition/operations/index.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/operations/index.js +759 -201
- package/dist/Jobs/JobDefinition/operations/index.js.map +1 -1
- package/dist/Jobs/JobDefinition/operations/rules.d.ts +1 -0
- package/dist/Jobs/JobDefinition/operations/rules.d.ts.map +1 -1
- package/dist/Jobs/JobDefinition/operations/rules.js +3 -0
- package/dist/Jobs/JobDefinition/operations/rules.js.map +1 -1
- package/dist/Jobs/index.d.ts +2 -2
- package/dist/Jobs/index.d.ts.map +1 -1
- package/dist/Jobs/index.js +450 -215
- package/dist/Jobs/index.js.map +1 -1
- package/dist/Schemas/job.js +198 -85
- package/dist/Schemas/job.js.map +1 -1
- package/dist/Schemas/node.d.ts +81 -24
- package/dist/Schemas/node.d.ts.map +1 -1
- package/dist/Schemas/nodeOpenApi.d.ts.map +1 -1
- package/dist/Schemas/nodeOpenApi.js +234 -79
- package/dist/Schemas/nodeOpenApi.js.map +1 -1
- package/openapi/node.openapi.json +289 -97
- package/package.json +2 -2
package/dist/Jobs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export * from "./Diagnostics/index.js";
|
|
|
6
6
|
export * from "./Flows/index.js";
|
|
7
7
|
export * from "./JobDefinition/index.js";
|
|
8
8
|
export * from "./Logs/index.js";
|
|
9
|
-
export const validateJobDefinition = (() => { const _io0 = (input, _exceptionable = true) => "
|
|
9
|
+
export const validateJobDefinition = (() => { const _io0 = (input, _exceptionable = true) => (undefined === input.type || "string" === typeof input.type) && "string" === typeof input.version && (undefined === input.logistics || "object" === typeof input.logistics && null !== input.logistics && false === Array.isArray(input.logistics) && _io1(input.logistics, true && _exceptionable)) && (undefined === input.deployment_id || "string" === typeof input.deployment_id) && (undefined === input.ssh || "object" === typeof input.ssh && null !== input.ssh && false === Array.isArray(input.ssh) && _io4(input.ssh, true && _exceptionable)) && (undefined === input.meta || "object" === typeof input.meta && null !== input.meta && false === Array.isArray(input.meta) && _io5(input.meta, true && _exceptionable)) && (undefined === input.global || "object" === typeof input.global && null !== input.global && false === Array.isArray(input.global) && _io7(input.global, true && _exceptionable)) && (Array.isArray(input.ops) && (Array.isArray(input.ops) && (() => {
|
|
10
10
|
const seen = new Set();
|
|
11
11
|
for (const it of input.ops) {
|
|
12
12
|
if (typeof it?.id !== "string")
|
|
@@ -16,14 +16,14 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
16
16
|
seen.add(it.id);
|
|
17
17
|
}
|
|
18
18
|
return true;
|
|
19
|
-
})() && input.ops.every((elem, _index1) => "object" === typeof elem && null !== elem &&
|
|
19
|
+
})() && (Array.isArray(input.ops) && input.ops.every(op => !(op?.args?.gpu === true && op?.args?.trusted_execution_env !== undefined))) && input.ops.every((elem, _index1) => "object" === typeof elem && null !== elem && _io10(elem, true && _exceptionable)))) && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
20
20
|
if (["type", "version", "logistics", "deployment_id", "ssh", "meta", "global", "ops"].some(prop => key === prop))
|
|
21
21
|
return true;
|
|
22
22
|
const value = input[key];
|
|
23
23
|
if (undefined === value)
|
|
24
24
|
return true;
|
|
25
25
|
return false;
|
|
26
|
-
})); const _io1 = (input, _exceptionable = true) => "object" === typeof input.send && null !== input.send && _io2(input.send, true && _exceptionable) && ("object" === typeof input.receive && null !== input.receive && _io2(input.receive, true && _exceptionable)) && (
|
|
26
|
+
})); const _io1 = (input, _exceptionable = true) => (undefined === input.send || "object" === typeof input.send && null !== input.send && _io2(input.send, true && _exceptionable)) && (undefined === input.receive || "object" === typeof input.receive && null !== input.receive && _io2(input.receive, true && _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
27
27
|
if (["send", "receive"].some(prop => key === prop))
|
|
28
28
|
return true;
|
|
29
29
|
const value = input[key];
|
|
@@ -57,42 +57,43 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
57
57
|
const value = input[key];
|
|
58
58
|
if (undefined === value)
|
|
59
59
|
return true;
|
|
60
|
-
return
|
|
60
|
+
return true;
|
|
61
61
|
}); const _io6 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
62
62
|
const value = input[key];
|
|
63
63
|
if (undefined === value)
|
|
64
64
|
return true;
|
|
65
65
|
return "string" === typeof value || "number" === typeof value;
|
|
66
|
-
}); const _io7 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
67
|
-
const value = input[key];
|
|
68
|
-
if (undefined === value)
|
|
69
|
-
return true;
|
|
70
|
-
return null !== value && undefined !== value && ("string" === typeof value || "number" === typeof value || Array.isArray(value) && value.every((elem, _index4) => "string" === typeof elem || "number" === typeof elem));
|
|
71
|
-
}); const _io8 = (input, _exceptionable = true) => (undefined === input.image || "string" === typeof input.image) && (undefined === input.gpu || "boolean" === typeof input.gpu) && (null !== input.entrypoint && (undefined === input.entrypoint || "string" === typeof input.entrypoint || Array.isArray(input.entrypoint) && input.entrypoint.every((elem, _index5) => "string" === typeof elem))) && (undefined === input.env || "object" === typeof input.env && null !== input.env && false === Array.isArray(input.env) && _io9(input.env, true && _exceptionable)) && (undefined === input.work_dir || "string" === typeof input.work_dir) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && _io10(input.variables, true && _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
66
|
+
}); const _io7 = (input, _exceptionable = true) => (undefined === input.image || "string" === typeof input.image) && (undefined === input.gpu || "boolean" === typeof input.gpu) && (null !== input.entrypoint && (undefined === input.entrypoint || "string" === typeof input.entrypoint || Array.isArray(input.entrypoint) && input.entrypoint.every((elem, _index3) => "string" === typeof elem))) && (undefined === input.env || "object" === typeof input.env && null !== input.env && false === Array.isArray(input.env) && _io8(input.env, true && _exceptionable)) && (undefined === input.work_dir || "string" === typeof input.work_dir) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && _io9(input.variables, true && _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
72
67
|
if (["image", "gpu", "entrypoint", "env", "work_dir", "variables"].some(prop => key === prop))
|
|
73
68
|
return true;
|
|
74
69
|
const value = input[key];
|
|
75
70
|
if (undefined === value)
|
|
76
71
|
return true;
|
|
77
72
|
return false;
|
|
78
|
-
})); const
|
|
73
|
+
})); const _io8 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
79
74
|
const value = input[key];
|
|
80
75
|
if (undefined === value)
|
|
81
76
|
return true;
|
|
82
77
|
return "string" === typeof value;
|
|
83
|
-
}); const
|
|
78
|
+
}); const _io9 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
84
79
|
const value = input[key];
|
|
85
80
|
if (undefined === value)
|
|
86
81
|
return true;
|
|
87
82
|
return "string" === typeof value;
|
|
88
|
-
}); const
|
|
83
|
+
}); const _io10 = (input, _exceptionable = true) => ("container/run" === input.type || "container/create-volume" === input.type || "vm/run" === input.type || "cvm/run" === input.type) && ("string" === typeof input.id && (typeof input.id === "string" && !input.id.includes(" ") && !input.id.includes("."))) && ("object" === typeof input.args && null !== input.args && _iu3(input.args, true && _exceptionable)) && (undefined === input.results || "object" === typeof input.results && null !== input.results && false === Array.isArray(input.results) && _io30(input.results, true && _exceptionable)) && (undefined === input.execution || "object" === typeof input.execution && null !== input.execution && false === Array.isArray(input.execution) && _io32(input.execution, true && _exceptionable)) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
89
84
|
if (["type", "id", "args", "results", "execution"].some(prop => key === prop))
|
|
90
85
|
return true;
|
|
91
86
|
const value = input[key];
|
|
92
87
|
if (undefined === value)
|
|
93
88
|
return true;
|
|
94
89
|
return false;
|
|
95
|
-
})); const
|
|
90
|
+
})); const _io11 = (input, _exceptionable = true) => "string" === typeof input.image && (null !== input.aliases && (undefined === input.aliases || "string" === typeof input.aliases || Array.isArray(input.aliases) && input.aliases.every((elem, _index4) => "string" === typeof elem))) && (null !== input.cmd && (undefined === input.cmd || "string" === typeof input.cmd || Array.isArray(input.cmd) && input.cmd.every((elem, _index5) => "string" === typeof elem))) && (undefined === input.volumes || Array.isArray(input.volumes) && input.volumes.every((elem, _index6) => "object" === typeof elem && null !== elem && _io12(elem, true && _exceptionable))) && (null !== input.expose && (undefined === input.expose || "number" === typeof input.expose || "string" === typeof input.expose && (typeof input.expose === "string" && /^%%(ops|global).[^%]+%%$/.test(input.expose) || typeof input.expose === "string" && (() => {
|
|
91
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(input.expose);
|
|
92
|
+
if (!match)
|
|
93
|
+
return false;
|
|
94
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
95
|
+
return a < b;
|
|
96
|
+
})()) || (Array.isArray(input.expose) && ((() => {
|
|
96
97
|
if (!Array.isArray(input.expose))
|
|
97
98
|
return true;
|
|
98
99
|
const numbers = new Set();
|
|
@@ -127,123 +128,189 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
return true;
|
|
130
|
-
})() && input.expose.every((elem,
|
|
131
|
-
|
|
131
|
+
})() && input.expose.every((elem, _index7) => null !== elem && undefined !== elem && ("number" === typeof elem || "string" === typeof elem && (typeof elem === "string" && /^%%(ops|global).[^%]+%%$/.test(elem) || typeof elem === "string" && (() => {
|
|
132
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(elem);
|
|
133
|
+
if (!match)
|
|
134
|
+
return false;
|
|
135
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
136
|
+
return a < b;
|
|
137
|
+
})()) || "object" === typeof elem && null !== elem && _iu1(elem, true && _exceptionable)))) || "object" === typeof input.expose && null !== input.expose && _iu1(input.expose, true && _exceptionable)))) && (undefined === input.gpu || "boolean" === typeof input.gpu) && (undefined === input.work_dir || "string" === typeof input.work_dir) && (undefined === input.output || "string" === typeof input.output) && (null !== input.entrypoint && (undefined === input.entrypoint || "string" === typeof input.entrypoint || Array.isArray(input.entrypoint) && input.entrypoint.every((elem, _index8) => "string" === typeof elem))) && (undefined === input.env || "object" === typeof input.env && null !== input.env && false === Array.isArray(input.env) && _io8(input.env, true && _exceptionable)) && (null !== input.restart_policy && (undefined === input.restart_policy || "on-failure" === input.restart_policy || "no" === input.restart_policy || "always" === input.restart_policy || "unless-stopped" === input.restart_policy || "object" === typeof input.restart_policy && null !== input.restart_policy && _io18(input.restart_policy, true && _exceptionable))) && (undefined === input.required_vram || "number" === typeof input.required_vram) && (undefined === input["private"] || "boolean" === typeof input["private"]) && (undefined === input.resources || Array.isArray(input.resources) && input.resources.every((elem, _index9) => null !== elem && undefined !== elem && ("__remove-if-empty__" === elem || "object" === typeof elem && null !== elem && _iu2(elem, true && _exceptionable)))) && (undefined === input.authentication || "object" === typeof input.authentication && null !== input.authentication && false === Array.isArray(input.authentication) && _io26(input.authentication, true && _exceptionable)) && (undefined === input.trusted_execution_env || "SEV-SNP" === input.trusted_execution_env || "SEV-GUEST" === input.trusted_execution_env) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
138
|
+
if (["image", "aliases", "cmd", "volumes", "expose", "gpu", "work_dir", "output", "entrypoint", "env", "restart_policy", "required_vram", "private", "resources", "authentication", "trusted_execution_env"].some(prop => key === prop))
|
|
132
139
|
return true;
|
|
133
140
|
const value = input[key];
|
|
134
141
|
if (undefined === value)
|
|
135
142
|
return true;
|
|
136
143
|
return false;
|
|
137
|
-
})); const
|
|
144
|
+
})); const _io12 = (input, _exceptionable = true) => "string" === typeof input.name && "string" === typeof input.dest && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
138
145
|
if (["name", "dest"].some(prop => key === prop))
|
|
139
146
|
return true;
|
|
140
147
|
const value = input[key];
|
|
141
148
|
if (undefined === value)
|
|
142
149
|
return true;
|
|
143
150
|
return false;
|
|
144
|
-
})); const
|
|
151
|
+
})); const _io13 = (input, _exceptionable = true) => "string" === typeof input.__spread__ && (typeof input.__spread__ === "string" && /^%%(ops|global).[^%]+%%$/.test(input.__spread__)) && (undefined === input.chunked || "boolean" === typeof input.chunked) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
145
152
|
if (["__spread__", "chunked"].some(prop => key === prop))
|
|
146
153
|
return true;
|
|
147
154
|
const value = input[key];
|
|
148
155
|
if (undefined === value)
|
|
149
156
|
return true;
|
|
150
157
|
return false;
|
|
151
|
-
})); const
|
|
158
|
+
})); const _io14 = (input, _exceptionable = true) => ("number" === typeof input.port || "string" === typeof input.port && (typeof input.port === "string" && (() => {
|
|
159
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(input.port);
|
|
160
|
+
if (!match)
|
|
161
|
+
return false;
|
|
162
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
163
|
+
return a < b;
|
|
164
|
+
})())) && (undefined === input.type || "api" === input.type || "web" === input.type || "websocket" === input.type || "webapi" === input.type || "none" === input.type) && (undefined === input.health_checks || Array.isArray(input.health_checks) && input.health_checks.every((elem, _index10) => "object" === typeof elem && null !== elem && _iu0(elem, true && _exceptionable))) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
152
165
|
if (["port", "type", "health_checks"].some(prop => key === prop))
|
|
153
166
|
return true;
|
|
154
167
|
const value = input[key];
|
|
155
168
|
if (undefined === value)
|
|
156
169
|
return true;
|
|
157
170
|
return false;
|
|
158
|
-
})); const
|
|
171
|
+
})); const _io15 = (input, _exceptionable = true) => "http" === input.type && "string" === typeof input.path && ("GET" === input.method || "POST" === input.method || "PUT" === input.method || "DELETE" === input.method) && "number" === typeof input.expected_status && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && _io16(input.headers, true && _exceptionable)) && true && "boolean" === typeof input.continuous && (5 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
159
172
|
if (["type", "path", "method", "expected_status", "headers", "body", "continuous"].some(prop => key === prop))
|
|
160
173
|
return true;
|
|
161
174
|
const value = input[key];
|
|
162
175
|
if (undefined === value)
|
|
163
176
|
return true;
|
|
164
177
|
return false;
|
|
165
|
-
})); const
|
|
178
|
+
})); const _io16 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
166
179
|
const value = input[key];
|
|
167
180
|
if (undefined === value)
|
|
168
181
|
return true;
|
|
169
182
|
return "string" === typeof value;
|
|
170
|
-
}); const
|
|
183
|
+
}); const _io17 = (input, _exceptionable = true) => "websocket" === input.type && "string" === typeof input.expected_response && "boolean" === typeof input.continuous && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
171
184
|
if (["type", "expected_response", "continuous"].some(prop => key === prop))
|
|
172
185
|
return true;
|
|
173
186
|
const value = input[key];
|
|
174
187
|
if (undefined === value)
|
|
175
188
|
return true;
|
|
176
189
|
return false;
|
|
177
|
-
})); const
|
|
190
|
+
})); const _io18 = (input, _exceptionable = true) => "on-failure" === input.policy && (undefined === input.restart_tries || "number" === typeof input.restart_tries) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
178
191
|
if (["policy", "restart_tries"].some(prop => key === prop))
|
|
179
192
|
return true;
|
|
180
193
|
const value = input[key];
|
|
181
194
|
if (undefined === value)
|
|
182
195
|
return true;
|
|
183
196
|
return false;
|
|
184
|
-
})); const
|
|
197
|
+
})); const _io19 = (input, _exceptionable = true) => "S3" === input.type && "string" === typeof input.target && (undefined === input.url || "string" === typeof input.url) && (undefined === input.allowWrite || "boolean" === typeof input.allowWrite) && (undefined === input.files || Array.isArray(input.files) && input.files.every((elem, _index11) => "string" === typeof elem)) && (undefined === input.IAM || "object" === typeof input.IAM && null !== input.IAM && _io20(input.IAM, true && _exceptionable)) && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
185
198
|
if (["type", "target", "url", "allowWrite", "files", "IAM"].some(prop => key === prop))
|
|
186
199
|
return true;
|
|
187
200
|
const value = input[key];
|
|
188
201
|
if (undefined === value)
|
|
189
202
|
return true;
|
|
190
203
|
return false;
|
|
191
|
-
})); const
|
|
204
|
+
})); const _io20 = (input, _exceptionable = true) => "string" === typeof input.REGION && "string" === typeof input.ACCESS_KEY_ID && "string" === typeof input.SECRET_ACCESS_KEY && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
192
205
|
if (["REGION", "ACCESS_KEY_ID", "SECRET_ACCESS_KEY"].some(prop => key === prop))
|
|
193
206
|
return true;
|
|
194
207
|
const value = input[key];
|
|
195
208
|
if (undefined === value)
|
|
196
209
|
return true;
|
|
197
210
|
return false;
|
|
198
|
-
})); const
|
|
211
|
+
})); const _io21 = (input, _exceptionable = true) => "S3" === input.type && "string" === typeof input.target && "string" === typeof input.bucket && (undefined === input.url || "string" === typeof input.url) && (undefined === input.allowWrite || "boolean" === typeof input.allowWrite) && (undefined === input.IAM || "object" === typeof input.IAM && null !== input.IAM && _io20(input.IAM, true && _exceptionable)) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
199
212
|
if (["type", "target", "bucket", "url", "allowWrite", "IAM"].some(prop => key === prop))
|
|
200
213
|
return true;
|
|
201
214
|
const value = input[key];
|
|
202
215
|
if (undefined === value)
|
|
203
216
|
return true;
|
|
204
217
|
return false;
|
|
205
|
-
})); const
|
|
218
|
+
})); const _io22 = (input, _exceptionable = true) => "S3" === input.type && "string" === typeof input.target && (Array.isArray(input.buckets) && input.buckets.every((elem, _index12) => "object" === typeof elem && null !== elem && _io23(elem, true && _exceptionable))) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.allowWrite || "boolean" === typeof input.allowWrite) && (undefined === input.IAM || "object" === typeof input.IAM && null !== input.IAM && _io20(input.IAM, true && _exceptionable)) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
206
219
|
if (["type", "target", "buckets", "url", "allowWrite", "IAM"].some(prop => key === prop))
|
|
207
220
|
return true;
|
|
208
221
|
const value = input[key];
|
|
209
222
|
if (undefined === value)
|
|
210
223
|
return true;
|
|
211
224
|
return false;
|
|
212
|
-
})); const
|
|
225
|
+
})); const _io23 = (input, _exceptionable = true) => "string" === typeof input.url && (undefined === input.files || Array.isArray(input.files) && input.files.every((elem, _index13) => "string" === typeof elem)) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
213
226
|
if (["url", "files"].some(prop => key === prop))
|
|
214
227
|
return true;
|
|
215
228
|
const value = input[key];
|
|
216
229
|
if (undefined === value)
|
|
217
230
|
return true;
|
|
218
231
|
return false;
|
|
219
|
-
})); const
|
|
232
|
+
})); const _io24 = (input, _exceptionable = true) => "HF" === input.type && "string" === typeof input.target && "string" === typeof input.repo && (undefined === input.revision || "string" === typeof input.revision) && (undefined === input.files || Array.isArray(input.files) && input.files.every((elem, _index14) => "string" === typeof elem)) && (undefined === input.accessToken || "string" === typeof input.accessToken) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
220
233
|
if (["type", "target", "repo", "revision", "files", "accessToken"].some(prop => key === prop))
|
|
221
234
|
return true;
|
|
222
235
|
const value = input[key];
|
|
223
236
|
if (undefined === value)
|
|
224
237
|
return true;
|
|
225
238
|
return false;
|
|
226
|
-
})); const
|
|
239
|
+
})); const _io25 = (input, _exceptionable = true) => "Ollama" === input.type && "string" === typeof input.model && (undefined === input.target || "string" === typeof input.target) && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
227
240
|
if (["type", "model", "target"].some(prop => key === prop))
|
|
228
241
|
return true;
|
|
229
242
|
const value = input[key];
|
|
230
243
|
if (undefined === value)
|
|
231
244
|
return true;
|
|
232
245
|
return false;
|
|
233
|
-
})); const
|
|
246
|
+
})); const _io26 = (input, _exceptionable = true) => (undefined === input.docker || "object" === typeof input.docker && null !== input.docker && false === Array.isArray(input.docker) && _io27(input.docker, true && _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
234
247
|
if (["docker"].some(prop => key === prop))
|
|
235
248
|
return true;
|
|
236
249
|
const value = input[key];
|
|
237
250
|
if (undefined === value)
|
|
238
251
|
return true;
|
|
239
252
|
return false;
|
|
240
|
-
})); const
|
|
253
|
+
})); const _io27 = (input, _exceptionable = true) => (undefined === input.username || "string" === typeof input.username) && (undefined === input.password || "string" === typeof input.password) && (undefined === input.email || "string" === typeof input.email) && (undefined === input.server || "string" === typeof input.server) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
241
254
|
if (["username", "password", "email", "server"].some(prop => key === prop))
|
|
242
255
|
return true;
|
|
243
256
|
const value = input[key];
|
|
244
257
|
if (undefined === value)
|
|
245
258
|
return true;
|
|
246
259
|
return false;
|
|
260
|
+
})); const _io28 = (input, _exceptionable = true) => "string" === typeof input.image && (undefined === input.cpu || "number" === typeof input.cpu) && (undefined === input.memory || "string" === typeof input.memory || "number" === typeof input.memory) && (undefined === input.disk || "string" === typeof input.disk || "number" === typeof input.disk) && (undefined === input.gpu || "boolean" === typeof input.gpu) && (null !== input.cmd && (undefined === input.cmd || "string" === typeof input.cmd || Array.isArray(input.cmd) && input.cmd.every((elem, _index15) => "string" === typeof elem))) && (undefined === input.env || "object" === typeof input.env && null !== input.env && false === Array.isArray(input.env) && _io8(input.env, true && _exceptionable)) && (null !== input.expose && (undefined === input.expose || "number" === typeof input.expose || "string" === typeof input.expose && (typeof input.expose === "string" && /^%%(ops|global).[^%]+%%$/.test(input.expose) || typeof input.expose === "string" && (() => {
|
|
261
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(input.expose);
|
|
262
|
+
if (!match)
|
|
263
|
+
return false;
|
|
264
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
265
|
+
return a < b;
|
|
266
|
+
})()) || (Array.isArray(input.expose) && ((() => {
|
|
267
|
+
if (!Array.isArray(input.expose))
|
|
268
|
+
return true;
|
|
269
|
+
const numbers = new Set();
|
|
270
|
+
const ranges = [];
|
|
271
|
+
for (const el of input.expose) {
|
|
272
|
+
if (typeof el === "string" && /^%%(ops|global).[^%]+%%$/.test(el))
|
|
273
|
+
continue;
|
|
274
|
+
if (el && typeof el === "object" && !Array.isArray(el) && el.__spread__)
|
|
275
|
+
continue;
|
|
276
|
+
const port = typeof el === "object" ? el.port : el;
|
|
277
|
+
if (typeof port === "number") {
|
|
278
|
+
if (numbers.has(port))
|
|
279
|
+
return false;
|
|
280
|
+
numbers.add(port);
|
|
281
|
+
}
|
|
282
|
+
else if (typeof port === "string") {
|
|
283
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(port);
|
|
284
|
+
if (!match)
|
|
285
|
+
return false;
|
|
286
|
+
const start = Number(match[1]), end = Number(match[2]);
|
|
287
|
+
for (const [rStart, rEnd] of ranges) {
|
|
288
|
+
if (start <= rEnd && end >= rStart)
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
ranges.push([start, end]);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
for (const port of numbers) {
|
|
295
|
+
for (const [start, end] of ranges) {
|
|
296
|
+
if (port >= start && port <= end)
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return true;
|
|
301
|
+
})() && input.expose.every((elem, _index16) => null !== elem && undefined !== elem && ("number" === typeof elem || "string" === typeof elem && (typeof elem === "string" && /^%%(ops|global).[^%]+%%$/.test(elem) || typeof elem === "string" && (() => {
|
|
302
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(elem);
|
|
303
|
+
if (!match)
|
|
304
|
+
return false;
|
|
305
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
306
|
+
return a < b;
|
|
307
|
+
})()) || "object" === typeof elem && null !== elem && _iu1(elem, true && _exceptionable)))) || "object" === typeof input.expose && null !== input.expose && _iu1(input.expose, true && _exceptionable)))) && (undefined === input["private"] || "boolean" === typeof input["private"]) && (null !== input.restart_policy && (undefined === input.restart_policy || "on-failure" === input.restart_policy || "no" === input.restart_policy || "always" === input.restart_policy || "unless-stopped" === input.restart_policy || "object" === typeof input.restart_policy && null !== input.restart_policy && _io18(input.restart_policy, true && _exceptionable))) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
308
|
+
if (["image", "cpu", "memory", "disk", "gpu", "cmd", "env", "expose", "private", "restart_policy"].some(prop => key === prop))
|
|
309
|
+
return true;
|
|
310
|
+
const value = input[key];
|
|
311
|
+
if (undefined === value)
|
|
312
|
+
return true;
|
|
313
|
+
return false;
|
|
247
314
|
})); const _io29 = (input, _exceptionable = true) => "string" === typeof input.name && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
248
315
|
if (["name"].some(prop => key === prop))
|
|
249
316
|
return true;
|
|
@@ -280,47 +347,51 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
280
347
|
return false;
|
|
281
348
|
})); const _iu0 = (input, _exceptionable = true) => (() => {
|
|
282
349
|
if ("http" === input.type)
|
|
283
|
-
return
|
|
350
|
+
return _io15(input, true && _exceptionable);
|
|
284
351
|
else if ("websocket" === input.type)
|
|
285
|
-
return
|
|
352
|
+
return _io17(input, true && _exceptionable);
|
|
286
353
|
else
|
|
287
354
|
return false;
|
|
288
355
|
})(); const _iu1 = (input, _exceptionable = true) => (() => {
|
|
289
356
|
if (undefined !== input.__spread__)
|
|
290
|
-
return
|
|
357
|
+
return _io13(input, true && _exceptionable);
|
|
291
358
|
else if (undefined !== input.port)
|
|
292
|
-
return
|
|
359
|
+
return _io14(input, true && _exceptionable);
|
|
293
360
|
else
|
|
294
361
|
return false;
|
|
295
362
|
})(); const _iu2 = (input, _exceptionable = true) => (() => {
|
|
296
363
|
if (undefined !== input.__spread__)
|
|
297
|
-
return
|
|
364
|
+
return _io13(input, true && _exceptionable);
|
|
298
365
|
else if (undefined !== input.bucket)
|
|
299
|
-
return
|
|
366
|
+
return _io21(input, true && _exceptionable);
|
|
300
367
|
else if (undefined !== input.buckets)
|
|
301
|
-
return
|
|
368
|
+
return _io22(input, true && _exceptionable);
|
|
302
369
|
else if ("HF" === input.type)
|
|
303
|
-
return
|
|
370
|
+
return _io24(input, true && _exceptionable);
|
|
304
371
|
else if ("Ollama" === input.type)
|
|
305
|
-
return
|
|
372
|
+
return _io25(input, true && _exceptionable);
|
|
306
373
|
else
|
|
307
|
-
return
|
|
374
|
+
return _io19(input, true && _exceptionable);
|
|
308
375
|
})(); const _iu3 = (input, _exceptionable = true) => (() => {
|
|
309
|
-
if (undefined !== input.
|
|
310
|
-
return _io12(input, true && _exceptionable);
|
|
311
|
-
else if (undefined !== input.name)
|
|
376
|
+
if (undefined !== input.name)
|
|
312
377
|
return _io29(input, true && _exceptionable);
|
|
313
378
|
else
|
|
314
|
-
return
|
|
315
|
-
|
|
379
|
+
return (() => {
|
|
380
|
+
if (_io11(input, false && _exceptionable))
|
|
381
|
+
return _io11(input, true && _exceptionable);
|
|
382
|
+
if (_io28(input, false && _exceptionable))
|
|
383
|
+
return _io28(input, true && _exceptionable);
|
|
384
|
+
return false;
|
|
385
|
+
})();
|
|
386
|
+
})(); const _vo0 = (input, _path, _exceptionable = true) => [undefined === input.type || "string" === typeof input.type || _report(_exceptionable, {
|
|
316
387
|
path: _path + ".type",
|
|
317
|
-
expected: "
|
|
388
|
+
expected: "(string | undefined)",
|
|
318
389
|
value: input.type
|
|
319
|
-
}), "
|
|
390
|
+
}), "string" === typeof input.version || _report(_exceptionable, {
|
|
320
391
|
path: _path + ".version",
|
|
321
|
-
expected: "
|
|
392
|
+
expected: "string",
|
|
322
393
|
value: input.version
|
|
323
|
-
}), undefined === input.logistics || ("object" === typeof input.logistics && null !== input.logistics || _report(_exceptionable, {
|
|
394
|
+
}), undefined === input.logistics || ("object" === typeof input.logistics && null !== input.logistics && false === Array.isArray(input.logistics) || _report(_exceptionable, {
|
|
324
395
|
path: _path + ".logistics",
|
|
325
396
|
expected: "(Logistics | undefined)",
|
|
326
397
|
value: input.logistics
|
|
@@ -352,13 +423,13 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
352
423
|
path: _path + ".global",
|
|
353
424
|
expected: "(Global | undefined)",
|
|
354
425
|
value: input.global
|
|
355
|
-
})) &&
|
|
426
|
+
})) && _vo7(input.global, _path + ".global", true && _exceptionable) || _report(_exceptionable, {
|
|
356
427
|
path: _path + ".global",
|
|
357
428
|
expected: "(Global | undefined)",
|
|
358
429
|
value: input.global
|
|
359
430
|
}), (Array.isArray(input.ops) || _report(_exceptionable, {
|
|
360
431
|
path: _path + ".ops",
|
|
361
|
-
expected: "(Ops & UniqueById)",
|
|
432
|
+
expected: "(Ops & UniqueById & GpuTeeConflict)",
|
|
362
433
|
value: input.ops
|
|
363
434
|
})) && ((Array.isArray(input.ops) && (() => {
|
|
364
435
|
const seen = new Set();
|
|
@@ -374,19 +445,23 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
374
445
|
path: _path + ".ops",
|
|
375
446
|
expected: "Array<> & UniqueById",
|
|
376
447
|
value: input.ops
|
|
448
|
+
})) && (Array.isArray(input.ops) && input.ops.every(op => !(op?.args?.gpu === true && op?.args?.trusted_execution_env !== undefined)) || _report(_exceptionable, {
|
|
449
|
+
path: _path + ".ops",
|
|
450
|
+
expected: "Array<> & GpuTeeConflict",
|
|
451
|
+
value: input.ops
|
|
377
452
|
})) && input.ops.map((elem, _index19) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
378
453
|
path: _path + ".ops[" + _index19 + "]",
|
|
379
454
|
expected: "Operation<keyof OperationArgsMap>",
|
|
380
455
|
value: elem
|
|
381
|
-
})) &&
|
|
456
|
+
})) && _vo10(elem, _path + ".ops[" + _index19 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
382
457
|
path: _path + ".ops[" + _index19 + "]",
|
|
383
458
|
expected: "Operation<keyof OperationArgsMap>",
|
|
384
459
|
value: elem
|
|
385
460
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
386
461
|
path: _path + ".ops",
|
|
387
|
-
expected: "(Ops & UniqueById)",
|
|
462
|
+
expected: "(Ops & UniqueById & GpuTeeConflict)",
|
|
388
463
|
value: input.ops
|
|
389
|
-
}),
|
|
464
|
+
}), 2 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
390
465
|
if (["type", "version", "logistics", "deployment_id", "ssh", "meta", "global", "ops"].some(prop => key === prop))
|
|
391
466
|
return true;
|
|
392
467
|
const value = input[key];
|
|
@@ -402,23 +477,23 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
402
477
|
"Please remove the property next time."
|
|
403
478
|
].join("\n")
|
|
404
479
|
});
|
|
405
|
-
}).every(flag => flag))].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.send && null !== input.send || _report(_exceptionable, {
|
|
480
|
+
}).every(flag => flag))].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.send || ("object" === typeof input.send && null !== input.send || _report(_exceptionable, {
|
|
406
481
|
path: _path + ".send",
|
|
407
|
-
expected: "Logistic",
|
|
482
|
+
expected: "(Logistic | undefined)",
|
|
408
483
|
value: input.send
|
|
409
484
|
})) && _vo2(input.send, _path + ".send", true && _exceptionable) || _report(_exceptionable, {
|
|
410
485
|
path: _path + ".send",
|
|
411
|
-
expected: "Logistic",
|
|
486
|
+
expected: "(Logistic | undefined)",
|
|
412
487
|
value: input.send
|
|
413
|
-
}), ("object" === typeof input.receive && null !== input.receive || _report(_exceptionable, {
|
|
488
|
+
}), undefined === input.receive || ("object" === typeof input.receive && null !== input.receive || _report(_exceptionable, {
|
|
414
489
|
path: _path + ".receive",
|
|
415
|
-
expected: "Logistic",
|
|
490
|
+
expected: "(Logistic | undefined)",
|
|
416
491
|
value: input.receive
|
|
417
492
|
})) && _vo2(input.receive, _path + ".receive", true && _exceptionable) || _report(_exceptionable, {
|
|
418
493
|
path: _path + ".receive",
|
|
419
|
-
expected: "Logistic",
|
|
494
|
+
expected: "(Logistic | undefined)",
|
|
420
495
|
value: input.receive
|
|
421
|
-
}),
|
|
496
|
+
}), 0 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
422
497
|
if (["send", "receive"].some(prop => key === prop))
|
|
423
498
|
return true;
|
|
424
499
|
const value = input[key];
|
|
@@ -528,23 +603,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
528
603
|
const value = input[key];
|
|
529
604
|
if (undefined === value)
|
|
530
605
|
return true;
|
|
531
|
-
return
|
|
532
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
533
|
-
expected: "(Array<string | number> | Record<string, string | number | (string | number)[]> | number | string | undefined)",
|
|
534
|
-
value: value
|
|
535
|
-
})) && (undefined === value || "string" === typeof value || "number" === typeof value || (Array.isArray(value) && value.map((elem, _index21) => "string" === typeof elem || "number" === typeof elem || _report(_exceptionable, {
|
|
536
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key) + "[" + _index21 + "]",
|
|
537
|
-
expected: "(number | string)",
|
|
538
|
-
value: elem
|
|
539
|
-
})).every(flag => flag) || "object" === typeof value && null !== value && false === Array.isArray(value) && _vo7(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
540
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
541
|
-
expected: "(Array<string | number> | Record<string, string | number | (string | number)[]> | number | string | undefined)",
|
|
542
|
-
value: value
|
|
543
|
-
})) || _report(_exceptionable, {
|
|
544
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
545
|
-
expected: "(Array<string | number> | Record<string, string | number | (string | number)[]> | number | string | undefined)",
|
|
546
|
-
value: value
|
|
547
|
-
}));
|
|
606
|
+
return true;
|
|
548
607
|
}).every(flag => flag)].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
549
608
|
const value = input[key];
|
|
550
609
|
if (undefined === value)
|
|
@@ -554,32 +613,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
554
613
|
expected: "(number | string)",
|
|
555
614
|
value: value
|
|
556
615
|
});
|
|
557
|
-
}).every(flag => flag)].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [
|
|
558
|
-
const value = input[key];
|
|
559
|
-
if (undefined === value)
|
|
560
|
-
return true;
|
|
561
|
-
return (null !== value || _report(_exceptionable, {
|
|
562
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
563
|
-
expected: "(Array<string | number> | number | string)",
|
|
564
|
-
value: value
|
|
565
|
-
})) && (undefined !== value || _report(_exceptionable, {
|
|
566
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
567
|
-
expected: "(Array<string | number> | number | string)",
|
|
568
|
-
value: value
|
|
569
|
-
})) && ("string" === typeof value || "number" === typeof value || (Array.isArray(value) || _report(_exceptionable, {
|
|
570
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
571
|
-
expected: "(Array<string | number> | number | string)",
|
|
572
|
-
value: value
|
|
573
|
-
})) && value.map((elem, _index22) => "string" === typeof elem || "number" === typeof elem || _report(_exceptionable, {
|
|
574
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key) + "[" + _index22 + "]",
|
|
575
|
-
expected: "(number | string)",
|
|
576
|
-
value: elem
|
|
577
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
578
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
579
|
-
expected: "(Array<string | number> | number | string)",
|
|
580
|
-
value: value
|
|
581
|
-
}));
|
|
582
|
-
}).every(flag => flag)].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [undefined === input.image || "string" === typeof input.image || _report(_exceptionable, {
|
|
616
|
+
}).every(flag => flag)].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [undefined === input.image || "string" === typeof input.image || _report(_exceptionable, {
|
|
583
617
|
path: _path + ".image",
|
|
584
618
|
expected: "(string | undefined)",
|
|
585
619
|
value: input.image
|
|
@@ -595,8 +629,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
595
629
|
path: _path + ".entrypoint",
|
|
596
630
|
expected: "(CMDArray | string | undefined)",
|
|
597
631
|
value: input.entrypoint
|
|
598
|
-
})) && input.entrypoint.map((elem,
|
|
599
|
-
path: _path + ".entrypoint[" +
|
|
632
|
+
})) && input.entrypoint.map((elem, _index21) => "string" === typeof elem || _report(_exceptionable, {
|
|
633
|
+
path: _path + ".entrypoint[" + _index21 + "]",
|
|
600
634
|
expected: "string",
|
|
601
635
|
value: elem
|
|
602
636
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -607,7 +641,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
607
641
|
path: _path + ".env",
|
|
608
642
|
expected: "(Env | undefined)",
|
|
609
643
|
value: input.env
|
|
610
|
-
})) &&
|
|
644
|
+
})) && _vo8(input.env, _path + ".env", true && _exceptionable) || _report(_exceptionable, {
|
|
611
645
|
path: _path + ".env",
|
|
612
646
|
expected: "(Env | undefined)",
|
|
613
647
|
value: input.env
|
|
@@ -619,7 +653,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
619
653
|
path: _path + ".variables",
|
|
620
654
|
expected: "(Variables | undefined)",
|
|
621
655
|
value: input.variables
|
|
622
|
-
})) &&
|
|
656
|
+
})) && _vo9(input.variables, _path + ".variables", true && _exceptionable) || _report(_exceptionable, {
|
|
623
657
|
path: _path + ".variables",
|
|
624
658
|
expected: "(Variables | undefined)",
|
|
625
659
|
value: input.variables
|
|
@@ -639,7 +673,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
639
673
|
"Please remove the property next time."
|
|
640
674
|
].join("\n")
|
|
641
675
|
});
|
|
642
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
676
|
+
}).every(flag => flag))].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
643
677
|
const value = input[key];
|
|
644
678
|
if (undefined === value)
|
|
645
679
|
return true;
|
|
@@ -648,7 +682,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
648
682
|
expected: "string",
|
|
649
683
|
value: value
|
|
650
684
|
});
|
|
651
|
-
}).every(flag => flag)].every(flag => flag); const
|
|
685
|
+
}).every(flag => flag)].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
652
686
|
const value = input[key];
|
|
653
687
|
if (undefined === value)
|
|
654
688
|
return true;
|
|
@@ -657,9 +691,9 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
657
691
|
expected: "string",
|
|
658
692
|
value: value
|
|
659
693
|
});
|
|
660
|
-
}).every(flag => flag)].every(flag => flag); const
|
|
694
|
+
}).every(flag => flag)].every(flag => flag); const _vo10 = (input, _path, _exceptionable = true) => ["container/run" === input.type || "container/create-volume" === input.type || "vm/run" === input.type || "cvm/run" === input.type || _report(_exceptionable, {
|
|
661
695
|
path: _path + ".type",
|
|
662
|
-
expected: "(\"container/create-volume\" | \"container/run\")",
|
|
696
|
+
expected: "(\"container/create-volume\" | \"container/run\" | \"cvm/run\" | \"vm/run\")",
|
|
663
697
|
value: input.type
|
|
664
698
|
}), "string" === typeof input.id && (typeof input.id === "string" && !input.id.includes(" ") && !input.id.includes(".") || _report(_exceptionable, {
|
|
665
699
|
path: _path + ".id",
|
|
@@ -671,11 +705,11 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
671
705
|
value: input.id
|
|
672
706
|
}), ("object" === typeof input.args && null !== input.args || _report(_exceptionable, {
|
|
673
707
|
path: _path + ".args",
|
|
674
|
-
expected: "(ContainerCreateVolume | ContainerRun)",
|
|
708
|
+
expected: "(ContainerCreateVolume | ContainerRun | VmRunArgs)",
|
|
675
709
|
value: input.args
|
|
676
710
|
})) && _vu3(input.args, _path + ".args", true && _exceptionable) || _report(_exceptionable, {
|
|
677
711
|
path: _path + ".args",
|
|
678
|
-
expected: "(ContainerCreateVolume | ContainerRun)",
|
|
712
|
+
expected: "(ContainerCreateVolume | ContainerRun | VmRunArgs)",
|
|
679
713
|
value: input.args
|
|
680
714
|
}), undefined === input.results || ("object" === typeof input.results && null !== input.results && false === Array.isArray(input.results) || _report(_exceptionable, {
|
|
681
715
|
path: _path + ".results",
|
|
@@ -709,7 +743,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
709
743
|
"Please remove the property next time."
|
|
710
744
|
].join("\n")
|
|
711
745
|
});
|
|
712
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
746
|
+
}).every(flag => flag))].every(flag => flag); const _vo11 = (input, _path, _exceptionable = true) => ["string" === typeof input.image || _report(_exceptionable, {
|
|
713
747
|
path: _path + ".image",
|
|
714
748
|
expected: "string",
|
|
715
749
|
value: input.image
|
|
@@ -721,8 +755,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
721
755
|
path: _path + ".aliases",
|
|
722
756
|
expected: "(Aliases | string | undefined)",
|
|
723
757
|
value: input.aliases
|
|
724
|
-
})) && input.aliases.map((elem,
|
|
725
|
-
path: _path + ".aliases[" +
|
|
758
|
+
})) && input.aliases.map((elem, _index22) => "string" === typeof elem || _report(_exceptionable, {
|
|
759
|
+
path: _path + ".aliases[" + _index22 + "]",
|
|
726
760
|
expected: "string",
|
|
727
761
|
value: elem
|
|
728
762
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -737,8 +771,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
737
771
|
path: _path + ".cmd",
|
|
738
772
|
expected: "(CMDArray | string | undefined)",
|
|
739
773
|
value: input.cmd
|
|
740
|
-
})) && input.cmd.map((elem,
|
|
741
|
-
path: _path + ".cmd[" +
|
|
774
|
+
})) && input.cmd.map((elem, _index23) => "string" === typeof elem || _report(_exceptionable, {
|
|
775
|
+
path: _path + ".cmd[" + _index23 + "]",
|
|
742
776
|
expected: "string",
|
|
743
777
|
value: elem
|
|
744
778
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -749,12 +783,12 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
749
783
|
path: _path + ".volumes",
|
|
750
784
|
expected: "(Array<Volume> | undefined)",
|
|
751
785
|
value: input.volumes
|
|
752
|
-
})) && input.volumes.map((elem,
|
|
753
|
-
path: _path + ".volumes[" +
|
|
786
|
+
})) && input.volumes.map((elem, _index24) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
787
|
+
path: _path + ".volumes[" + _index24 + "]",
|
|
754
788
|
expected: "Volume",
|
|
755
789
|
value: elem
|
|
756
|
-
})) &&
|
|
757
|
-
path: _path + ".volumes[" +
|
|
790
|
+
})) && _vo12(elem, _path + ".volumes[" + _index24 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
791
|
+
path: _path + ".volumes[" + _index24 + "]",
|
|
758
792
|
expected: "Volume",
|
|
759
793
|
value: elem
|
|
760
794
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -763,11 +797,17 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
763
797
|
value: input.volumes
|
|
764
798
|
}), (null !== input.expose || _report(_exceptionable, {
|
|
765
799
|
path: _path + ".expose",
|
|
766
|
-
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number | undefined)",
|
|
800
|
+
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number | undefined)",
|
|
767
801
|
value: input.expose
|
|
768
|
-
})) && (undefined === input.expose || "number" === typeof input.expose || "string" === typeof input.expose && (typeof input.expose === "string" && /^%%(ops|global).[^%]+%%$/.test(input.expose) ||
|
|
802
|
+
})) && (undefined === input.expose || "number" === typeof input.expose || "string" === typeof input.expose && (typeof input.expose === "string" && /^%%(ops|global).[^%]+%%$/.test(input.expose) || typeof input.expose === "string" && (() => {
|
|
803
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(input.expose);
|
|
804
|
+
if (!match)
|
|
805
|
+
return false;
|
|
806
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
807
|
+
return a < b;
|
|
808
|
+
})() || _report(_exceptionable, {
|
|
769
809
|
path: _path + ".expose",
|
|
770
|
-
expected: "string & TagBase<__type>",
|
|
810
|
+
expected: "(string & (TagBase<__type> | TagBase<__type>))",
|
|
771
811
|
value: input.expose
|
|
772
812
|
})) || (Array.isArray(input.expose) && (((() => {
|
|
773
813
|
if (!Array.isArray(input.expose))
|
|
@@ -808,33 +848,39 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
808
848
|
path: _path + ".expose",
|
|
809
849
|
expected: "Array<> & TagBase<__type>",
|
|
810
850
|
value: input.expose
|
|
811
|
-
})) && input.expose.map((elem,
|
|
812
|
-
path: _path + ".expose[" +
|
|
813
|
-
expected: "((__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number)",
|
|
851
|
+
})) && input.expose.map((elem, _index25) => (null !== elem || _report(_exceptionable, {
|
|
852
|
+
path: _path + ".expose[" + _index25 + "]",
|
|
853
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
814
854
|
value: elem
|
|
815
855
|
})) && (undefined !== elem || _report(_exceptionable, {
|
|
816
|
-
path: _path + ".expose[" +
|
|
817
|
-
expected: "((__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number)",
|
|
856
|
+
path: _path + ".expose[" + _index25 + "]",
|
|
857
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
818
858
|
value: elem
|
|
819
|
-
})) && ("number" === typeof elem || "string" === typeof elem && (typeof elem === "string" && /^%%(ops|global).[^%]+%%$/.test(elem) ||
|
|
820
|
-
|
|
821
|
-
|
|
859
|
+
})) && ("number" === typeof elem || "string" === typeof elem && (typeof elem === "string" && /^%%(ops|global).[^%]+%%$/.test(elem) || typeof elem === "string" && (() => {
|
|
860
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(elem);
|
|
861
|
+
if (!match)
|
|
862
|
+
return false;
|
|
863
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
864
|
+
return a < b;
|
|
865
|
+
})() || _report(_exceptionable, {
|
|
866
|
+
path: _path + ".expose[" + _index25 + "]",
|
|
867
|
+
expected: "(string & (TagBase<__type> | TagBase<__type>))",
|
|
822
868
|
value: elem
|
|
823
869
|
})) || ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
824
|
-
path: _path + ".expose[" +
|
|
825
|
-
expected: "((__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number)",
|
|
870
|
+
path: _path + ".expose[" + _index25 + "]",
|
|
871
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
826
872
|
value: elem
|
|
827
|
-
})) && _vu1(elem, _path + ".expose[" +
|
|
828
|
-
path: _path + ".expose[" +
|
|
829
|
-
expected: "((__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number)",
|
|
873
|
+
})) && _vu1(elem, _path + ".expose[" + _index25 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
874
|
+
path: _path + ".expose[" + _index25 + "]",
|
|
875
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
830
876
|
value: elem
|
|
831
877
|
}))).every(flag => flag)) || "object" === typeof input.expose && null !== input.expose && _vu1(input.expose, _path + ".expose", true && _exceptionable) || _report(_exceptionable, {
|
|
832
878
|
path: _path + ".expose",
|
|
833
|
-
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number | undefined)",
|
|
879
|
+
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number | undefined)",
|
|
834
880
|
value: input.expose
|
|
835
881
|
})) || _report(_exceptionable, {
|
|
836
882
|
path: _path + ".expose",
|
|
837
|
-
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & TagBase<__type>) | ExposedPort | number | undefined)",
|
|
883
|
+
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number | undefined)",
|
|
838
884
|
value: input.expose
|
|
839
885
|
})), undefined === input.gpu || "boolean" === typeof input.gpu || _report(_exceptionable, {
|
|
840
886
|
path: _path + ".gpu",
|
|
@@ -844,6 +890,10 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
844
890
|
path: _path + ".work_dir",
|
|
845
891
|
expected: "(string | undefined)",
|
|
846
892
|
value: input.work_dir
|
|
893
|
+
}), undefined === input.output || "string" === typeof input.output || _report(_exceptionable, {
|
|
894
|
+
path: _path + ".output",
|
|
895
|
+
expected: "(string | undefined)",
|
|
896
|
+
value: input.output
|
|
847
897
|
}), (null !== input.entrypoint || _report(_exceptionable, {
|
|
848
898
|
path: _path + ".entrypoint",
|
|
849
899
|
expected: "(CMDArray | string | undefined)",
|
|
@@ -852,8 +902,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
852
902
|
path: _path + ".entrypoint",
|
|
853
903
|
expected: "(CMDArray | string | undefined)",
|
|
854
904
|
value: input.entrypoint
|
|
855
|
-
})) && input.entrypoint.map((elem,
|
|
856
|
-
path: _path + ".entrypoint[" +
|
|
905
|
+
})) && input.entrypoint.map((elem, _index26) => "string" === typeof elem || _report(_exceptionable, {
|
|
906
|
+
path: _path + ".entrypoint[" + _index26 + "]",
|
|
857
907
|
expected: "string",
|
|
858
908
|
value: elem
|
|
859
909
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -864,23 +914,27 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
864
914
|
path: _path + ".env",
|
|
865
915
|
expected: "(Env | undefined)",
|
|
866
916
|
value: input.env
|
|
867
|
-
})) &&
|
|
917
|
+
})) && _vo8(input.env, _path + ".env", true && _exceptionable) || _report(_exceptionable, {
|
|
868
918
|
path: _path + ".env",
|
|
869
919
|
expected: "(Env | undefined)",
|
|
870
920
|
value: input.env
|
|
871
921
|
}), (null !== input.restart_policy || _report(_exceptionable, {
|
|
872
922
|
path: _path + ".restart_policy",
|
|
873
|
-
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.
|
|
923
|
+
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.o5 | undefined)",
|
|
874
924
|
value: input.restart_policy
|
|
875
925
|
})) && (undefined === input.restart_policy || "on-failure" === input.restart_policy || "no" === input.restart_policy || "always" === input.restart_policy || "unless-stopped" === input.restart_policy || ("object" === typeof input.restart_policy && null !== input.restart_policy || _report(_exceptionable, {
|
|
876
926
|
path: _path + ".restart_policy",
|
|
877
|
-
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.
|
|
927
|
+
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.o5 | undefined)",
|
|
878
928
|
value: input.restart_policy
|
|
879
|
-
})) &&
|
|
929
|
+
})) && _vo18(input.restart_policy, _path + ".restart_policy", true && _exceptionable) || _report(_exceptionable, {
|
|
880
930
|
path: _path + ".restart_policy",
|
|
881
|
-
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.
|
|
931
|
+
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.o5 | undefined)",
|
|
882
932
|
value: input.restart_policy
|
|
883
|
-
})), undefined === input
|
|
933
|
+
})), undefined === input.required_vram || "number" === typeof input.required_vram || _report(_exceptionable, {
|
|
934
|
+
path: _path + ".required_vram",
|
|
935
|
+
expected: "(number | undefined)",
|
|
936
|
+
value: input.required_vram
|
|
937
|
+
}), undefined === input["private"] || "boolean" === typeof input["private"] || _report(_exceptionable, {
|
|
884
938
|
path: _path + "[\"private\"]",
|
|
885
939
|
expected: "(boolean | undefined)",
|
|
886
940
|
value: input["private"]
|
|
@@ -888,20 +942,20 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
888
942
|
path: _path + ".resources",
|
|
889
943
|
expected: "(Resources | undefined)",
|
|
890
944
|
value: input.resources
|
|
891
|
-
})) && input.resources.map((elem,
|
|
892
|
-
path: _path + ".resources[" +
|
|
945
|
+
})) && input.resources.map((elem, _index27) => (null !== elem || _report(_exceptionable, {
|
|
946
|
+
path: _path + ".resources[" + _index27 + "]",
|
|
893
947
|
expected: "(\"__remove-if-empty__\" | (__type & TagBase<__type>) | HFResource | OllamaResource | S3Base | S3WithBucket | S3WithBuckets)",
|
|
894
948
|
value: elem
|
|
895
949
|
})) && (undefined !== elem || _report(_exceptionable, {
|
|
896
|
-
path: _path + ".resources[" +
|
|
950
|
+
path: _path + ".resources[" + _index27 + "]",
|
|
897
951
|
expected: "(\"__remove-if-empty__\" | (__type & TagBase<__type>) | HFResource | OllamaResource | S3Base | S3WithBucket | S3WithBuckets)",
|
|
898
952
|
value: elem
|
|
899
953
|
})) && ("__remove-if-empty__" === elem || ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
900
|
-
path: _path + ".resources[" +
|
|
954
|
+
path: _path + ".resources[" + _index27 + "]",
|
|
901
955
|
expected: "(\"__remove-if-empty__\" | (__type & TagBase<__type>) | HFResource | OllamaResource | S3Base | S3WithBucket | S3WithBuckets)",
|
|
902
956
|
value: elem
|
|
903
|
-
})) && _vu2(elem, _path + ".resources[" +
|
|
904
|
-
path: _path + ".resources[" +
|
|
957
|
+
})) && _vu2(elem, _path + ".resources[" + _index27 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
958
|
+
path: _path + ".resources[" + _index27 + "]",
|
|
905
959
|
expected: "(\"__remove-if-empty__\" | (__type & TagBase<__type>) | HFResource | OllamaResource | S3Base | S3WithBucket | S3WithBuckets)",
|
|
906
960
|
value: elem
|
|
907
961
|
}))).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -912,12 +966,16 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
912
966
|
path: _path + ".authentication",
|
|
913
967
|
expected: "(Authentication | undefined)",
|
|
914
968
|
value: input.authentication
|
|
915
|
-
})) &&
|
|
969
|
+
})) && _vo26(input.authentication, _path + ".authentication", true && _exceptionable) || _report(_exceptionable, {
|
|
916
970
|
path: _path + ".authentication",
|
|
917
971
|
expected: "(Authentication | undefined)",
|
|
918
972
|
value: input.authentication
|
|
973
|
+
}), undefined === input.trusted_execution_env || "SEV-SNP" === input.trusted_execution_env || "SEV-GUEST" === input.trusted_execution_env || _report(_exceptionable, {
|
|
974
|
+
path: _path + ".trusted_execution_env",
|
|
975
|
+
expected: "(\"SEV-GUEST\" | \"SEV-SNP\" | undefined)",
|
|
976
|
+
value: input.trusted_execution_env
|
|
919
977
|
}), 1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
920
|
-
if (["image", "aliases", "cmd", "volumes", "expose", "gpu", "work_dir", "entrypoint", "env", "restart_policy", "private", "resources", "authentication"].some(prop => key === prop))
|
|
978
|
+
if (["image", "aliases", "cmd", "volumes", "expose", "gpu", "work_dir", "output", "entrypoint", "env", "restart_policy", "required_vram", "private", "resources", "authentication", "trusted_execution_env"].some(prop => key === prop))
|
|
921
979
|
return true;
|
|
922
980
|
const value = input[key];
|
|
923
981
|
if (undefined === value)
|
|
@@ -932,7 +990,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
932
990
|
"Please remove the property next time."
|
|
933
991
|
].join("\n")
|
|
934
992
|
});
|
|
935
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
993
|
+
}).every(flag => flag))].every(flag => flag); const _vo12 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
936
994
|
path: _path + ".name",
|
|
937
995
|
expected: "string",
|
|
938
996
|
value: input.name
|
|
@@ -956,7 +1014,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
956
1014
|
"Please remove the property next time."
|
|
957
1015
|
].join("\n")
|
|
958
1016
|
});
|
|
959
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1017
|
+
}).every(flag => flag))].every(flag => flag); const _vo13 = (input, _path, _exceptionable = true) => ["string" === typeof input.__spread__ && (typeof input.__spread__ === "string" && /^%%(ops|global).[^%]+%%$/.test(input.__spread__) || _report(_exceptionable, {
|
|
960
1018
|
path: _path + ".__spread__",
|
|
961
1019
|
expected: "string & TagBase<__type>",
|
|
962
1020
|
value: input.__spread__
|
|
@@ -984,9 +1042,19 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
984
1042
|
"Please remove the property next time."
|
|
985
1043
|
].join("\n")
|
|
986
1044
|
});
|
|
987
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1045
|
+
}).every(flag => flag))].every(flag => flag); const _vo14 = (input, _path, _exceptionable = true) => ["number" === typeof input.port || "string" === typeof input.port && (typeof input.port === "string" && (() => {
|
|
1046
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(input.port);
|
|
1047
|
+
if (!match)
|
|
1048
|
+
return false;
|
|
1049
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
1050
|
+
return a < b;
|
|
1051
|
+
})() || _report(_exceptionable, {
|
|
988
1052
|
path: _path + ".port",
|
|
989
|
-
expected: "
|
|
1053
|
+
expected: "string & TagBase<__type>",
|
|
1054
|
+
value: input.port
|
|
1055
|
+
})) || _report(_exceptionable, {
|
|
1056
|
+
path: _path + ".port",
|
|
1057
|
+
expected: "((string & TagBase<__type>) | number)",
|
|
990
1058
|
value: input.port
|
|
991
1059
|
}), undefined === input.type || "api" === input.type || "web" === input.type || "websocket" === input.type || "webapi" === input.type || "none" === input.type || _report(_exceptionable, {
|
|
992
1060
|
path: _path + ".type",
|
|
@@ -996,12 +1064,12 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
996
1064
|
path: _path + ".health_checks",
|
|
997
1065
|
expected: "(Array<HealthCheck> | undefined)",
|
|
998
1066
|
value: input.health_checks
|
|
999
|
-
})) && input.health_checks.map((elem,
|
|
1000
|
-
path: _path + ".health_checks[" +
|
|
1067
|
+
})) && input.health_checks.map((elem, _index28) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1068
|
+
path: _path + ".health_checks[" + _index28 + "]",
|
|
1001
1069
|
expected: "(HttpHealthCheck | WebSocketHealthCheck)",
|
|
1002
1070
|
value: elem
|
|
1003
|
-
})) && _vu0(elem, _path + ".health_checks[" +
|
|
1004
|
-
path: _path + ".health_checks[" +
|
|
1071
|
+
})) && _vu0(elem, _path + ".health_checks[" + _index28 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1072
|
+
path: _path + ".health_checks[" + _index28 + "]",
|
|
1005
1073
|
expected: "(HttpHealthCheck | WebSocketHealthCheck)",
|
|
1006
1074
|
value: elem
|
|
1007
1075
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1024,7 +1092,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1024
1092
|
"Please remove the property next time."
|
|
1025
1093
|
].join("\n")
|
|
1026
1094
|
});
|
|
1027
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1095
|
+
}).every(flag => flag))].every(flag => flag); const _vo15 = (input, _path, _exceptionable = true) => ["http" === input.type || _report(_exceptionable, {
|
|
1028
1096
|
path: _path + ".type",
|
|
1029
1097
|
expected: "\"http\"",
|
|
1030
1098
|
value: input.type
|
|
@@ -1044,7 +1112,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1044
1112
|
path: _path + ".headers",
|
|
1045
1113
|
expected: "(Record<string, string> | undefined)",
|
|
1046
1114
|
value: input.headers
|
|
1047
|
-
})) &&
|
|
1115
|
+
})) && _vo16(input.headers, _path + ".headers", true && _exceptionable) || _report(_exceptionable, {
|
|
1048
1116
|
path: _path + ".headers",
|
|
1049
1117
|
expected: "(Record<string, string> | undefined)",
|
|
1050
1118
|
value: input.headers
|
|
@@ -1068,7 +1136,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1068
1136
|
"Please remove the property next time."
|
|
1069
1137
|
].join("\n")
|
|
1070
1138
|
});
|
|
1071
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1139
|
+
}).every(flag => flag))].every(flag => flag); const _vo16 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
1072
1140
|
const value = input[key];
|
|
1073
1141
|
if (undefined === value)
|
|
1074
1142
|
return true;
|
|
@@ -1077,7 +1145,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1077
1145
|
expected: "string",
|
|
1078
1146
|
value: value
|
|
1079
1147
|
});
|
|
1080
|
-
}).every(flag => flag)].every(flag => flag); const
|
|
1148
|
+
}).every(flag => flag)].every(flag => flag); const _vo17 = (input, _path, _exceptionable = true) => ["websocket" === input.type || _report(_exceptionable, {
|
|
1081
1149
|
path: _path + ".type",
|
|
1082
1150
|
expected: "\"websocket\"",
|
|
1083
1151
|
value: input.type
|
|
@@ -1105,7 +1173,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1105
1173
|
"Please remove the property next time."
|
|
1106
1174
|
].join("\n")
|
|
1107
1175
|
});
|
|
1108
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1176
|
+
}).every(flag => flag))].every(flag => flag); const _vo18 = (input, _path, _exceptionable = true) => ["on-failure" === input.policy || _report(_exceptionable, {
|
|
1109
1177
|
path: _path + ".policy",
|
|
1110
1178
|
expected: "\"on-failure\"",
|
|
1111
1179
|
value: input.policy
|
|
@@ -1129,7 +1197,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1129
1197
|
"Please remove the property next time."
|
|
1130
1198
|
].join("\n")
|
|
1131
1199
|
});
|
|
1132
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1200
|
+
}).every(flag => flag))].every(flag => flag); const _vo19 = (input, _path, _exceptionable = true) => ["S3" === input.type || _report(_exceptionable, {
|
|
1133
1201
|
path: _path + ".type",
|
|
1134
1202
|
expected: "\"S3\"",
|
|
1135
1203
|
value: input.type
|
|
@@ -1149,8 +1217,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1149
1217
|
path: _path + ".files",
|
|
1150
1218
|
expected: "(Array<string> | undefined)",
|
|
1151
1219
|
value: input.files
|
|
1152
|
-
})) && input.files.map((elem,
|
|
1153
|
-
path: _path + ".files[" +
|
|
1220
|
+
})) && input.files.map((elem, _index29) => "string" === typeof elem || _report(_exceptionable, {
|
|
1221
|
+
path: _path + ".files[" + _index29 + "]",
|
|
1154
1222
|
expected: "string",
|
|
1155
1223
|
value: elem
|
|
1156
1224
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1161,7 +1229,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1161
1229
|
path: _path + ".IAM",
|
|
1162
1230
|
expected: "(S3Auth | undefined)",
|
|
1163
1231
|
value: input.IAM
|
|
1164
|
-
})) &&
|
|
1232
|
+
})) && _vo20(input.IAM, _path + ".IAM", true && _exceptionable) || _report(_exceptionable, {
|
|
1165
1233
|
path: _path + ".IAM",
|
|
1166
1234
|
expected: "(S3Auth | undefined)",
|
|
1167
1235
|
value: input.IAM
|
|
@@ -1181,7 +1249,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1181
1249
|
"Please remove the property next time."
|
|
1182
1250
|
].join("\n")
|
|
1183
1251
|
});
|
|
1184
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1252
|
+
}).every(flag => flag))].every(flag => flag); const _vo20 = (input, _path, _exceptionable = true) => ["string" === typeof input.REGION || _report(_exceptionable, {
|
|
1185
1253
|
path: _path + ".REGION",
|
|
1186
1254
|
expected: "string",
|
|
1187
1255
|
value: input.REGION
|
|
@@ -1209,7 +1277,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1209
1277
|
"Please remove the property next time."
|
|
1210
1278
|
].join("\n")
|
|
1211
1279
|
});
|
|
1212
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1280
|
+
}).every(flag => flag))].every(flag => flag); const _vo21 = (input, _path, _exceptionable = true) => ["S3" === input.type || _report(_exceptionable, {
|
|
1213
1281
|
path: _path + ".type",
|
|
1214
1282
|
expected: "\"S3\"",
|
|
1215
1283
|
value: input.type
|
|
@@ -1233,7 +1301,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1233
1301
|
path: _path + ".IAM",
|
|
1234
1302
|
expected: "(S3Auth | undefined)",
|
|
1235
1303
|
value: input.IAM
|
|
1236
|
-
})) &&
|
|
1304
|
+
})) && _vo20(input.IAM, _path + ".IAM", true && _exceptionable) || _report(_exceptionable, {
|
|
1237
1305
|
path: _path + ".IAM",
|
|
1238
1306
|
expected: "(S3Auth | undefined)",
|
|
1239
1307
|
value: input.IAM
|
|
@@ -1253,7 +1321,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1253
1321
|
"Please remove the property next time."
|
|
1254
1322
|
].join("\n")
|
|
1255
1323
|
});
|
|
1256
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1324
|
+
}).every(flag => flag))].every(flag => flag); const _vo22 = (input, _path, _exceptionable = true) => ["S3" === input.type || _report(_exceptionable, {
|
|
1257
1325
|
path: _path + ".type",
|
|
1258
1326
|
expected: "\"S3\"",
|
|
1259
1327
|
value: input.type
|
|
@@ -1265,13 +1333,13 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1265
1333
|
path: _path + ".buckets",
|
|
1266
1334
|
expected: "Array<__type>",
|
|
1267
1335
|
value: input.buckets
|
|
1268
|
-
})) && input.buckets.map((elem,
|
|
1269
|
-
path: _path + ".buckets[" +
|
|
1270
|
-
expected: "__type.
|
|
1336
|
+
})) && input.buckets.map((elem, _index30) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1337
|
+
path: _path + ".buckets[" + _index30 + "]",
|
|
1338
|
+
expected: "__type.o6",
|
|
1271
1339
|
value: elem
|
|
1272
|
-
})) &&
|
|
1273
|
-
path: _path + ".buckets[" +
|
|
1274
|
-
expected: "__type.
|
|
1340
|
+
})) && _vo23(elem, _path + ".buckets[" + _index30 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1341
|
+
path: _path + ".buckets[" + _index30 + "]",
|
|
1342
|
+
expected: "__type.o6",
|
|
1275
1343
|
value: elem
|
|
1276
1344
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
1277
1345
|
path: _path + ".buckets",
|
|
@@ -1289,7 +1357,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1289
1357
|
path: _path + ".IAM",
|
|
1290
1358
|
expected: "(S3Auth | undefined)",
|
|
1291
1359
|
value: input.IAM
|
|
1292
|
-
})) &&
|
|
1360
|
+
})) && _vo20(input.IAM, _path + ".IAM", true && _exceptionable) || _report(_exceptionable, {
|
|
1293
1361
|
path: _path + ".IAM",
|
|
1294
1362
|
expected: "(S3Auth | undefined)",
|
|
1295
1363
|
value: input.IAM
|
|
@@ -1309,7 +1377,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1309
1377
|
"Please remove the property next time."
|
|
1310
1378
|
].join("\n")
|
|
1311
1379
|
});
|
|
1312
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1380
|
+
}).every(flag => flag))].every(flag => flag); const _vo23 = (input, _path, _exceptionable = true) => ["string" === typeof input.url || _report(_exceptionable, {
|
|
1313
1381
|
path: _path + ".url",
|
|
1314
1382
|
expected: "string",
|
|
1315
1383
|
value: input.url
|
|
@@ -1317,8 +1385,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1317
1385
|
path: _path + ".files",
|
|
1318
1386
|
expected: "(Array<string> | undefined)",
|
|
1319
1387
|
value: input.files
|
|
1320
|
-
})) && input.files.map((elem,
|
|
1321
|
-
path: _path + ".files[" +
|
|
1388
|
+
})) && input.files.map((elem, _index31) => "string" === typeof elem || _report(_exceptionable, {
|
|
1389
|
+
path: _path + ".files[" + _index31 + "]",
|
|
1322
1390
|
expected: "string",
|
|
1323
1391
|
value: elem
|
|
1324
1392
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1341,7 +1409,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1341
1409
|
"Please remove the property next time."
|
|
1342
1410
|
].join("\n")
|
|
1343
1411
|
});
|
|
1344
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1412
|
+
}).every(flag => flag))].every(flag => flag); const _vo24 = (input, _path, _exceptionable = true) => ["HF" === input.type || _report(_exceptionable, {
|
|
1345
1413
|
path: _path + ".type",
|
|
1346
1414
|
expected: "\"HF\"",
|
|
1347
1415
|
value: input.type
|
|
@@ -1361,8 +1429,8 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1361
1429
|
path: _path + ".files",
|
|
1362
1430
|
expected: "(Array<string> | undefined)",
|
|
1363
1431
|
value: input.files
|
|
1364
|
-
})) && input.files.map((elem,
|
|
1365
|
-
path: _path + ".files[" +
|
|
1432
|
+
})) && input.files.map((elem, _index32) => "string" === typeof elem || _report(_exceptionable, {
|
|
1433
|
+
path: _path + ".files[" + _index32 + "]",
|
|
1366
1434
|
expected: "string",
|
|
1367
1435
|
value: elem
|
|
1368
1436
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1389,7 +1457,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1389
1457
|
"Please remove the property next time."
|
|
1390
1458
|
].join("\n")
|
|
1391
1459
|
});
|
|
1392
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1460
|
+
}).every(flag => flag))].every(flag => flag); const _vo25 = (input, _path, _exceptionable = true) => ["Ollama" === input.type || _report(_exceptionable, {
|
|
1393
1461
|
path: _path + ".type",
|
|
1394
1462
|
expected: "\"Ollama\"",
|
|
1395
1463
|
value: input.type
|
|
@@ -1417,11 +1485,11 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1417
1485
|
"Please remove the property next time."
|
|
1418
1486
|
].join("\n")
|
|
1419
1487
|
});
|
|
1420
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1488
|
+
}).every(flag => flag))].every(flag => flag); const _vo26 = (input, _path, _exceptionable = true) => [undefined === input.docker || ("object" === typeof input.docker && null !== input.docker && false === Array.isArray(input.docker) || _report(_exceptionable, {
|
|
1421
1489
|
path: _path + ".docker",
|
|
1422
1490
|
expected: "(DockerAuth | undefined)",
|
|
1423
1491
|
value: input.docker
|
|
1424
|
-
})) &&
|
|
1492
|
+
})) && _vo27(input.docker, _path + ".docker", true && _exceptionable) || _report(_exceptionable, {
|
|
1425
1493
|
path: _path + ".docker",
|
|
1426
1494
|
expected: "(DockerAuth | undefined)",
|
|
1427
1495
|
value: input.docker
|
|
@@ -1441,7 +1509,7 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1441
1509
|
"Please remove the property next time."
|
|
1442
1510
|
].join("\n")
|
|
1443
1511
|
});
|
|
1444
|
-
}).every(flag => flag))].every(flag => flag); const
|
|
1512
|
+
}).every(flag => flag))].every(flag => flag); const _vo27 = (input, _path, _exceptionable = true) => [undefined === input.username || "string" === typeof input.username || _report(_exceptionable, {
|
|
1445
1513
|
path: _path + ".username",
|
|
1446
1514
|
expected: "(string | undefined)",
|
|
1447
1515
|
value: input.username
|
|
@@ -1473,6 +1541,169 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1473
1541
|
"Please remove the property next time."
|
|
1474
1542
|
].join("\n")
|
|
1475
1543
|
});
|
|
1544
|
+
}).every(flag => flag))].every(flag => flag); const _vo28 = (input, _path, _exceptionable = true) => ["string" === typeof input.image || _report(_exceptionable, {
|
|
1545
|
+
path: _path + ".image",
|
|
1546
|
+
expected: "string",
|
|
1547
|
+
value: input.image
|
|
1548
|
+
}), undefined === input.cpu || "number" === typeof input.cpu || _report(_exceptionable, {
|
|
1549
|
+
path: _path + ".cpu",
|
|
1550
|
+
expected: "(number | undefined)",
|
|
1551
|
+
value: input.cpu
|
|
1552
|
+
}), undefined === input.memory || "string" === typeof input.memory || "number" === typeof input.memory || _report(_exceptionable, {
|
|
1553
|
+
path: _path + ".memory",
|
|
1554
|
+
expected: "(number | string | undefined)",
|
|
1555
|
+
value: input.memory
|
|
1556
|
+
}), undefined === input.disk || "string" === typeof input.disk || "number" === typeof input.disk || _report(_exceptionable, {
|
|
1557
|
+
path: _path + ".disk",
|
|
1558
|
+
expected: "(number | string | undefined)",
|
|
1559
|
+
value: input.disk
|
|
1560
|
+
}), undefined === input.gpu || "boolean" === typeof input.gpu || _report(_exceptionable, {
|
|
1561
|
+
path: _path + ".gpu",
|
|
1562
|
+
expected: "(boolean | undefined)",
|
|
1563
|
+
value: input.gpu
|
|
1564
|
+
}), (null !== input.cmd || _report(_exceptionable, {
|
|
1565
|
+
path: _path + ".cmd",
|
|
1566
|
+
expected: "(Array<string> | string | undefined)",
|
|
1567
|
+
value: input.cmd
|
|
1568
|
+
})) && (undefined === input.cmd || "string" === typeof input.cmd || (Array.isArray(input.cmd) || _report(_exceptionable, {
|
|
1569
|
+
path: _path + ".cmd",
|
|
1570
|
+
expected: "(Array<string> | string | undefined)",
|
|
1571
|
+
value: input.cmd
|
|
1572
|
+
})) && input.cmd.map((elem, _index33) => "string" === typeof elem || _report(_exceptionable, {
|
|
1573
|
+
path: _path + ".cmd[" + _index33 + "]",
|
|
1574
|
+
expected: "string",
|
|
1575
|
+
value: elem
|
|
1576
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1577
|
+
path: _path + ".cmd",
|
|
1578
|
+
expected: "(Array<string> | string | undefined)",
|
|
1579
|
+
value: input.cmd
|
|
1580
|
+
})), undefined === input.env || ("object" === typeof input.env && null !== input.env && false === Array.isArray(input.env) || _report(_exceptionable, {
|
|
1581
|
+
path: _path + ".env",
|
|
1582
|
+
expected: "(Env | undefined)",
|
|
1583
|
+
value: input.env
|
|
1584
|
+
})) && _vo8(input.env, _path + ".env", true && _exceptionable) || _report(_exceptionable, {
|
|
1585
|
+
path: _path + ".env",
|
|
1586
|
+
expected: "(Env | undefined)",
|
|
1587
|
+
value: input.env
|
|
1588
|
+
}), (null !== input.expose || _report(_exceptionable, {
|
|
1589
|
+
path: _path + ".expose",
|
|
1590
|
+
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number | undefined)",
|
|
1591
|
+
value: input.expose
|
|
1592
|
+
})) && (undefined === input.expose || "number" === typeof input.expose || "string" === typeof input.expose && (typeof input.expose === "string" && /^%%(ops|global).[^%]+%%$/.test(input.expose) || typeof input.expose === "string" && (() => {
|
|
1593
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(input.expose);
|
|
1594
|
+
if (!match)
|
|
1595
|
+
return false;
|
|
1596
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
1597
|
+
return a < b;
|
|
1598
|
+
})() || _report(_exceptionable, {
|
|
1599
|
+
path: _path + ".expose",
|
|
1600
|
+
expected: "(string & (TagBase<__type> | TagBase<__type>))",
|
|
1601
|
+
value: input.expose
|
|
1602
|
+
})) || (Array.isArray(input.expose) && (((() => {
|
|
1603
|
+
if (!Array.isArray(input.expose))
|
|
1604
|
+
return true;
|
|
1605
|
+
const numbers = new Set();
|
|
1606
|
+
const ranges = [];
|
|
1607
|
+
for (const el of input.expose) {
|
|
1608
|
+
if (typeof el === "string" && /^%%(ops|global).[^%]+%%$/.test(el))
|
|
1609
|
+
continue;
|
|
1610
|
+
if (el && typeof el === "object" && !Array.isArray(el) && el.__spread__)
|
|
1611
|
+
continue;
|
|
1612
|
+
const port = typeof el === "object" ? el.port : el;
|
|
1613
|
+
if (typeof port === "number") {
|
|
1614
|
+
if (numbers.has(port))
|
|
1615
|
+
return false;
|
|
1616
|
+
numbers.add(port);
|
|
1617
|
+
}
|
|
1618
|
+
else if (typeof port === "string") {
|
|
1619
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(port);
|
|
1620
|
+
if (!match)
|
|
1621
|
+
return false;
|
|
1622
|
+
const start = Number(match[1]), end = Number(match[2]);
|
|
1623
|
+
for (const [rStart, rEnd] of ranges) {
|
|
1624
|
+
if (start <= rEnd && end >= rStart)
|
|
1625
|
+
return false;
|
|
1626
|
+
}
|
|
1627
|
+
ranges.push([start, end]);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
for (const port of numbers) {
|
|
1631
|
+
for (const [start, end] of ranges) {
|
|
1632
|
+
if (port >= start && port <= end)
|
|
1633
|
+
return false;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
return true;
|
|
1637
|
+
})() || _report(_exceptionable, {
|
|
1638
|
+
path: _path + ".expose",
|
|
1639
|
+
expected: "Array<> & TagBase<__type>",
|
|
1640
|
+
value: input.expose
|
|
1641
|
+
})) && input.expose.map((elem, _index34) => (null !== elem || _report(_exceptionable, {
|
|
1642
|
+
path: _path + ".expose[" + _index34 + "]",
|
|
1643
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
1644
|
+
value: elem
|
|
1645
|
+
})) && (undefined !== elem || _report(_exceptionable, {
|
|
1646
|
+
path: _path + ".expose[" + _index34 + "]",
|
|
1647
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
1648
|
+
value: elem
|
|
1649
|
+
})) && ("number" === typeof elem || "string" === typeof elem && (typeof elem === "string" && /^%%(ops|global).[^%]+%%$/.test(elem) || typeof elem === "string" && (() => {
|
|
1650
|
+
const match = /^([0-9]+)-([0-9]+)$/.exec(elem);
|
|
1651
|
+
if (!match)
|
|
1652
|
+
return false;
|
|
1653
|
+
const a = Number(match[1]), b = Number(match[2]);
|
|
1654
|
+
return a < b;
|
|
1655
|
+
})() || _report(_exceptionable, {
|
|
1656
|
+
path: _path + ".expose[" + _index34 + "]",
|
|
1657
|
+
expected: "(string & (TagBase<__type> | TagBase<__type>))",
|
|
1658
|
+
value: elem
|
|
1659
|
+
})) || ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1660
|
+
path: _path + ".expose[" + _index34 + "]",
|
|
1661
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
1662
|
+
value: elem
|
|
1663
|
+
})) && _vu1(elem, _path + ".expose[" + _index34 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1664
|
+
path: _path + ".expose[" + _index34 + "]",
|
|
1665
|
+
expected: "((__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number)",
|
|
1666
|
+
value: elem
|
|
1667
|
+
}))).every(flag => flag)) || "object" === typeof input.expose && null !== input.expose && _vu1(input.expose, _path + ".expose", true && _exceptionable) || _report(_exceptionable, {
|
|
1668
|
+
path: _path + ".expose",
|
|
1669
|
+
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number | undefined)",
|
|
1670
|
+
value: input.expose
|
|
1671
|
+
})) || _report(_exceptionable, {
|
|
1672
|
+
path: _path + ".expose",
|
|
1673
|
+
expected: "((Array<ExposeBase> & TagBase<__type>) | (__type & TagBase<__type>) | (string & (TagBase<__type> | TagBase<__type>)) | ExposedPort | number | undefined)",
|
|
1674
|
+
value: input.expose
|
|
1675
|
+
})), undefined === input["private"] || "boolean" === typeof input["private"] || _report(_exceptionable, {
|
|
1676
|
+
path: _path + "[\"private\"]",
|
|
1677
|
+
expected: "(boolean | undefined)",
|
|
1678
|
+
value: input["private"]
|
|
1679
|
+
}), (null !== input.restart_policy || _report(_exceptionable, {
|
|
1680
|
+
path: _path + ".restart_policy",
|
|
1681
|
+
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.o5 | undefined)",
|
|
1682
|
+
value: input.restart_policy
|
|
1683
|
+
})) && (undefined === input.restart_policy || "on-failure" === input.restart_policy || "no" === input.restart_policy || "always" === input.restart_policy || "unless-stopped" === input.restart_policy || ("object" === typeof input.restart_policy && null !== input.restart_policy || _report(_exceptionable, {
|
|
1684
|
+
path: _path + ".restart_policy",
|
|
1685
|
+
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.o5 | undefined)",
|
|
1686
|
+
value: input.restart_policy
|
|
1687
|
+
})) && _vo18(input.restart_policy, _path + ".restart_policy", true && _exceptionable) || _report(_exceptionable, {
|
|
1688
|
+
path: _path + ".restart_policy",
|
|
1689
|
+
expected: "(\"always\" | \"no\" | \"on-failure\" | \"unless-stopped\" | __type.o5 | undefined)",
|
|
1690
|
+
value: input.restart_policy
|
|
1691
|
+
})), 1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
1692
|
+
if (["image", "cpu", "memory", "disk", "gpu", "cmd", "env", "expose", "private", "restart_policy"].some(prop => key === prop))
|
|
1693
|
+
return true;
|
|
1694
|
+
const value = input[key];
|
|
1695
|
+
if (undefined === value)
|
|
1696
|
+
return true;
|
|
1697
|
+
return _report(_exceptionable, {
|
|
1698
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
1699
|
+
expected: "undefined",
|
|
1700
|
+
value: value,
|
|
1701
|
+
description: [
|
|
1702
|
+
`The property \`${key}\` is not defined in the object type.`,
|
|
1703
|
+
"",
|
|
1704
|
+
"Please remove the property next time."
|
|
1705
|
+
].join("\n")
|
|
1706
|
+
});
|
|
1476
1707
|
}).every(flag => flag))].every(flag => flag); const _vo29 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
1477
1708
|
path: _path + ".name",
|
|
1478
1709
|
expected: "string",
|
|
@@ -1600,9 +1831,9 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1600
1831
|
});
|
|
1601
1832
|
}).every(flag => flag))].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1602
1833
|
if ("http" === input.type)
|
|
1603
|
-
return
|
|
1834
|
+
return _vo15(input, _path, true && _exceptionable);
|
|
1604
1835
|
else if ("websocket" === input.type)
|
|
1605
|
-
return
|
|
1836
|
+
return _vo17(input, _path, true && _exceptionable);
|
|
1606
1837
|
else
|
|
1607
1838
|
return _report(_exceptionable, {
|
|
1608
1839
|
path: _path,
|
|
@@ -1611,9 +1842,9 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1611
1842
|
});
|
|
1612
1843
|
})(); const _vu1 = (input, _path, _exceptionable = true) => (() => {
|
|
1613
1844
|
if (undefined !== input.__spread__)
|
|
1614
|
-
return
|
|
1845
|
+
return _vo13(input, _path, true && _exceptionable);
|
|
1615
1846
|
else if (undefined !== input.port)
|
|
1616
|
-
return
|
|
1847
|
+
return _vo14(input, _path, true && _exceptionable);
|
|
1617
1848
|
else
|
|
1618
1849
|
return _report(_exceptionable, {
|
|
1619
1850
|
path: _path,
|
|
@@ -1622,28 +1853,32 @@ export const validateJobDefinition = (() => { const _io0 = (input, _exceptionabl
|
|
|
1622
1853
|
});
|
|
1623
1854
|
})(); const _vu2 = (input, _path, _exceptionable = true) => (() => {
|
|
1624
1855
|
if (undefined !== input.__spread__)
|
|
1625
|
-
return
|
|
1856
|
+
return _vo13(input, _path, true && _exceptionable);
|
|
1626
1857
|
else if (undefined !== input.bucket)
|
|
1627
|
-
return
|
|
1858
|
+
return _vo21(input, _path, true && _exceptionable);
|
|
1628
1859
|
else if (undefined !== input.buckets)
|
|
1629
|
-
return
|
|
1860
|
+
return _vo22(input, _path, true && _exceptionable);
|
|
1630
1861
|
else if ("HF" === input.type)
|
|
1631
|
-
return
|
|
1862
|
+
return _vo24(input, _path, true && _exceptionable);
|
|
1632
1863
|
else if ("Ollama" === input.type)
|
|
1633
|
-
return
|
|
1864
|
+
return _vo25(input, _path, true && _exceptionable);
|
|
1634
1865
|
else
|
|
1635
|
-
return
|
|
1866
|
+
return _vo19(input, _path, true && _exceptionable);
|
|
1636
1867
|
})(); const _vu3 = (input, _path, _exceptionable = true) => (() => {
|
|
1637
|
-
if (undefined !== input.
|
|
1638
|
-
return _vo12(input, _path, true && _exceptionable);
|
|
1639
|
-
else if (undefined !== input.name)
|
|
1868
|
+
if (undefined !== input.name)
|
|
1640
1869
|
return _vo29(input, _path, true && _exceptionable);
|
|
1641
1870
|
else
|
|
1642
|
-
return
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1871
|
+
return (() => {
|
|
1872
|
+
if (_vo11(input, _path, false && _exceptionable))
|
|
1873
|
+
return _vo11(input, _path, true && _exceptionable);
|
|
1874
|
+
if (_vo28(input, _path, false && _exceptionable))
|
|
1875
|
+
return _vo28(input, _path, true && _exceptionable);
|
|
1876
|
+
return _report(_exceptionable, {
|
|
1877
|
+
path: _path,
|
|
1878
|
+
expected: "(ContainerRun | VmRunArgs)",
|
|
1879
|
+
value: input
|
|
1880
|
+
});
|
|
1881
|
+
})();
|
|
1647
1882
|
})(); const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true); let errors; let _report; return __typia_transform__createStandardSchema._createStandardSchema(input => {
|
|
1648
1883
|
if (false === __is(input)) {
|
|
1649
1884
|
errors = [];
|