@boxrouter/sdk 0.0.0-stage → 0.12.190
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/LICENSE +202 -0
- package/NOTICE +40 -0
- package/README.md +508 -2
- package/dist/addresses.d.ts +5 -0
- package/dist/addresses.js +10 -0
- package/dist/api-error.d.ts +62 -0
- package/dist/api-error.js +264 -0
- package/dist/boxrouter.d.ts +68 -0
- package/dist/boxrouter.js +291 -0
- package/dist/browser-session/index.d.ts +17 -0
- package/dist/browser-session/index.js +48 -0
- package/dist/browser-session/operations.gen.d.ts +272 -0
- package/dist/browser-session/operations.gen.js +58 -0
- package/dist/browser-session/responseContracts/api_keys.d.ts +2 -0
- package/dist/browser-session/responseContracts/api_keys.js +10 -0
- package/dist/browser-session/responseContracts/credits.d.ts +2 -0
- package/dist/browser-session/responseContracts/credits.js +8 -0
- package/dist/browser-session/responseContracts/github.d.ts +2 -0
- package/dist/browser-session/responseContracts/github.js +11 -0
- package/dist/browser-session/responseContracts/identity.d.ts +2 -0
- package/dist/browser-session/responseContracts/identity.js +30 -0
- package/dist/browser-session/responseContracts/organizations.d.ts +2 -0
- package/dist/browser-session/responseContracts/organizations.js +17 -0
- package/dist/browser-session/responseContracts/privacy.d.ts +2 -0
- package/dist/browser-session/responseContracts/privacy.js +7 -0
- package/dist/browser-session/responseContracts.gen.d.ts +3 -0
- package/dist/browser-session/responseContracts.gen.js +10 -0
- package/dist/browser-session/responseValidators/api_keys-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/api_keys-diagnostics.d.cts +4 -0
- package/dist/browser-session/responseValidators/api_keys.cjs +2 -0
- package/dist/browser-session/responseValidators/api_keys.d.cts +4 -0
- package/dist/browser-session/responseValidators/credits-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/credits-diagnostics.d.cts +3 -0
- package/dist/browser-session/responseValidators/credits.cjs +2 -0
- package/dist/browser-session/responseValidators/credits.d.cts +3 -0
- package/dist/browser-session/responseValidators/github-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/github-diagnostics.d.cts +3 -0
- package/dist/browser-session/responseValidators/github.cjs +2 -0
- package/dist/browser-session/responseValidators/github.d.cts +3 -0
- package/dist/browser-session/responseValidators/identity-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/identity-diagnostics.d.cts +23 -0
- package/dist/browser-session/responseValidators/identity.cjs +2 -0
- package/dist/browser-session/responseValidators/identity.d.cts +23 -0
- package/dist/browser-session/responseValidators/organizations-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/organizations-diagnostics.d.cts +15 -0
- package/dist/browser-session/responseValidators/organizations.cjs +2 -0
- package/dist/browser-session/responseValidators/organizations.d.cts +15 -0
- package/dist/browser-session/responseValidators/privacy-diagnostics.cjs +1 -0
- package/dist/browser-session/responseValidators/privacy-diagnostics.d.cts +2 -0
- package/dist/browser-session/responseValidators/privacy.cjs +2 -0
- package/dist/browser-session/responseValidators/privacy.d.cts +2 -0
- package/dist/client/client.gen.d.ts +2 -0
- package/dist/client/client.gen.js +168 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.js +17 -0
- package/dist/client/types.gen.d.ts +120 -0
- package/dist/client/types.gen.js +3 -0
- package/dist/client/utils.gen.d.ts +37 -0
- package/dist/client/utils.gen.js +239 -0
- package/dist/client.gen.d.ts +12 -0
- package/dist/client.gen.js +6 -0
- package/dist/command-check.gen.d.ts +14 -0
- package/dist/command-check.gen.js +23 -0
- package/dist/command-input.gen.d.ts +6 -0
- package/dist/command-input.gen.js +45 -0
- package/dist/core/auth.gen.d.ts +25 -0
- package/dist/core/auth.gen.js +18 -0
- package/dist/core/binaryStream.d.ts +8 -0
- package/dist/core/binaryStream.js +76 -0
- package/dist/core/bodySerializer.gen.d.ts +25 -0
- package/dist/core/bodySerializer.gen.js +60 -0
- package/dist/core/commandValidators.cjs +1 -0
- package/dist/core/commandValidators.d.cts +14 -0
- package/dist/core/eventValidation.d.ts +17 -0
- package/dist/core/eventValidation.js +56 -0
- package/dist/core/eventValidators.cjs +1 -0
- package/dist/core/eventValidators.d.cts +2 -0
- package/dist/core/json.d.ts +3 -0
- package/dist/core/json.js +33 -0
- package/dist/core/params.gen.d.ts +43 -0
- package/dist/core/params.gen.js +112 -0
- package/dist/core/pathSerializer.gen.d.ts +33 -0
- package/dist/core/pathSerializer.gen.js +115 -0
- package/dist/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/core/queryKeySerializer.gen.js +98 -0
- package/dist/core/responseContracts/actions.d.ts +2 -0
- package/dist/core/responseContracts/actions.js +30 -0
- package/dist/core/responseContracts/agents.d.ts +2 -0
- package/dist/core/responseContracts/agents.js +7 -0
- package/dist/core/responseContracts/artifacts.d.ts +2 -0
- package/dist/core/responseContracts/artifacts.js +8 -0
- package/dist/core/responseContracts/commands.d.ts +2 -0
- package/dist/core/responseContracts/commands.js +6 -0
- package/dist/core/responseContracts/credits.d.ts +2 -0
- package/dist/core/responseContracts/credits.js +27 -0
- package/dist/core/responseContracts/files.d.ts +2 -0
- package/dist/core/responseContracts/files.js +15 -0
- package/dist/core/responseContracts/github.d.ts +2 -0
- package/dist/core/responseContracts/github.js +8 -0
- package/dist/core/responseContracts/images.d.ts +2 -0
- package/dist/core/responseContracts/images.js +8 -0
- package/dist/core/responseContracts/launchRuns.d.ts +2 -0
- package/dist/core/responseContracts/launchRuns.js +10 -0
- package/dist/core/responseContracts/launches.d.ts +2 -0
- package/dist/core/responseContracts/launches.js +10 -0
- package/dist/core/responseContracts/operations.d.ts +2 -0
- package/dist/core/responseContracts/operations.js +7 -0
- package/dist/core/responseContracts/previews.d.ts +2 -0
- package/dist/core/responseContracts/previews.js +8 -0
- package/dist/core/responseContracts/pricing.d.ts +2 -0
- package/dist/core/responseContracts/pricing.js +6 -0
- package/dist/core/responseContracts/processes.d.ts +2 -0
- package/dist/core/responseContracts/processes.js +11 -0
- package/dist/core/responseContracts/provider_accounts.d.ts +2 -0
- package/dist/core/responseContracts/provider_accounts.js +13 -0
- package/dist/core/responseContracts/providers.d.ts +2 -0
- package/dist/core/responseContracts/providers.js +6 -0
- package/dist/core/responseContracts/routing.d.ts +2 -0
- package/dist/core/responseContracts/routing.js +8 -0
- package/dist/core/responseContracts/sandboxes.d.ts +2 -0
- package/dist/core/responseContracts/sandboxes.js +15 -0
- package/dist/core/responseContracts/secrets.d.ts +2 -0
- package/dist/core/responseContracts/secrets.js +8 -0
- package/dist/core/responseContracts/spend_limits.d.ts +2 -0
- package/dist/core/responseContracts/spend_limits.js +8 -0
- package/dist/core/responseContracts/terminals.d.ts +2 -0
- package/dist/core/responseContracts/terminals.js +11 -0
- package/dist/core/responseContracts/usage.d.ts +2 -0
- package/dist/core/responseContracts/usage.js +7 -0
- package/dist/core/responseContracts/volumes.d.ts +2 -0
- package/dist/core/responseContracts/volumes.js +19 -0
- package/dist/core/responseContracts.gen.d.ts +3 -0
- package/dist/core/responseContracts.gen.js +27 -0
- package/dist/core/responseModes.d.ts +19 -0
- package/dist/core/responseModes.js +13 -0
- package/dist/core/responseValidation.d.ts +44 -0
- package/dist/core/responseValidation.js +174 -0
- package/dist/core/responseValidators/actions-diagnostics.cjs +4 -0
- package/dist/core/responseValidators/actions-diagnostics.d.cts +24 -0
- package/dist/core/responseValidators/actions.cjs +2 -0
- package/dist/core/responseValidators/actions.d.cts +24 -0
- package/dist/core/responseValidators/agents-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/agents-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/agents.cjs +2 -0
- package/dist/core/responseValidators/agents.d.cts +2 -0
- package/dist/core/responseValidators/artifacts-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/artifacts-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/artifacts.cjs +2 -0
- package/dist/core/responseValidators/artifacts.d.cts +2 -0
- package/dist/core/responseValidators/commands-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/commands-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/commands.cjs +2 -0
- package/dist/core/responseValidators/commands.d.cts +1 -0
- package/dist/core/responseValidators/compact.cjs +122 -0
- package/dist/core/responseValidators/credits-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/credits-diagnostics.d.cts +21 -0
- package/dist/core/responseValidators/credits.cjs +2 -0
- package/dist/core/responseValidators/credits.d.cts +21 -0
- package/dist/core/responseValidators/files-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/files-diagnostics.d.cts +5 -0
- package/dist/core/responseValidators/files.cjs +2 -0
- package/dist/core/responseValidators/files.d.cts +5 -0
- package/dist/core/responseValidators/github-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/github-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/github.cjs +2 -0
- package/dist/core/responseValidators/github.d.cts +2 -0
- package/dist/core/responseValidators/images-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/images-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/images.cjs +2 -0
- package/dist/core/responseValidators/images.d.cts +3 -0
- package/dist/core/responseValidators/launchRuns-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/launchRuns-diagnostics.d.cts +5 -0
- package/dist/core/responseValidators/launchRuns.cjs +2 -0
- package/dist/core/responseValidators/launchRuns.d.cts +5 -0
- package/dist/core/responseValidators/launches-diagnostics.cjs +10 -0
- package/dist/core/responseValidators/launches-diagnostics.d.cts +5 -0
- package/dist/core/responseValidators/launches.cjs +2 -0
- package/dist/core/responseValidators/launches.d.cts +5 -0
- package/dist/core/responseValidators/operations-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/operations-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/operations.cjs +2 -0
- package/dist/core/responseValidators/operations.d.cts +2 -0
- package/dist/core/responseValidators/previews-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/previews-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/previews.cjs +2 -0
- package/dist/core/responseValidators/previews.d.cts +3 -0
- package/dist/core/responseValidators/pricing-diagnostics.cjs +7 -0
- package/dist/core/responseValidators/pricing-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/pricing.cjs +2 -0
- package/dist/core/responseValidators/pricing.d.cts +1 -0
- package/dist/core/responseValidators/processes-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/processes-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/processes.cjs +2 -0
- package/dist/core/responseValidators/processes.d.cts +2 -0
- package/dist/core/responseValidators/provider_accounts-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/provider_accounts-diagnostics.d.cts +8 -0
- package/dist/core/responseValidators/provider_accounts.cjs +2 -0
- package/dist/core/responseValidators/provider_accounts.d.cts +8 -0
- package/dist/core/responseValidators/providers-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/providers-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/providers.cjs +2 -0
- package/dist/core/responseValidators/providers.d.cts +1 -0
- package/dist/core/responseValidators/routing-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/routing-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/routing.cjs +2 -0
- package/dist/core/responseValidators/routing.d.cts +3 -0
- package/dist/core/responseValidators/sandboxes-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/sandboxes-diagnostics.d.cts +10 -0
- package/dist/core/responseValidators/sandboxes.cjs +2 -0
- package/dist/core/responseValidators/sandboxes.d.cts +10 -0
- package/dist/core/responseValidators/secrets-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/secrets-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/secrets.cjs +2 -0
- package/dist/core/responseValidators/secrets.d.cts +1 -0
- package/dist/core/responseValidators/spend_limits-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/spend_limits-diagnostics.d.cts +3 -0
- package/dist/core/responseValidators/spend_limits.cjs +2 -0
- package/dist/core/responseValidators/spend_limits.d.cts +3 -0
- package/dist/core/responseValidators/terminals-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/terminals-diagnostics.d.cts +2 -0
- package/dist/core/responseValidators/terminals.cjs +2 -0
- package/dist/core/responseValidators/terminals.d.cts +2 -0
- package/dist/core/responseValidators/usage-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/usage-diagnostics.d.cts +1 -0
- package/dist/core/responseValidators/usage.cjs +2 -0
- package/dist/core/responseValidators/usage.d.cts +1 -0
- package/dist/core/responseValidators/volumes-diagnostics.cjs +1 -0
- package/dist/core/responseValidators/volumes-diagnostics.d.cts +10 -0
- package/dist/core/responseValidators/volumes.cjs +2 -0
- package/dist/core/responseValidators/volumes.d.cts +10 -0
- package/dist/core/serverSentEvents.gen.d.ts +30 -0
- package/dist/core/serverSentEvents.gen.js +313 -0
- package/dist/core/streamErrors.d.ts +32 -0
- package/dist/core/streamErrors.js +51 -0
- package/dist/core/types.gen.d.ts +83 -0
- package/dist/core/types.gen.js +3 -0
- package/dist/core/utils.gen.d.ts +19 -0
- package/dist/core/utils.gen.js +93 -0
- package/dist/creation.gen.d.ts +21 -0
- package/dist/creation.gen.js +35 -0
- package/dist/data-origin.d.ts +25 -0
- package/dist/data-origin.js +57 -0
- package/dist/error-codes.gen.d.ts +2 -0
- package/dist/error-codes.gen.js +2 -0
- package/dist/idempotency.gen.d.ts +1 -0
- package/dist/idempotency.gen.js +60 -0
- package/dist/images.d.ts +74 -0
- package/dist/images.js +88 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +80 -0
- package/dist/launch-input.gen.d.ts +9 -0
- package/dist/launch-input.gen.js +83 -0
- package/dist/launch.d.ts +28 -0
- package/dist/launch.js +222 -0
- package/dist/namespace-actions.d.mts +307 -0
- package/dist/namespace-actions.mjs +595 -0
- package/dist/namespace-agents.d.mts +33 -0
- package/dist/namespace-agents.mjs +40 -0
- package/dist/namespace-artifacts.d.mts +46 -0
- package/dist/namespace-artifacts.mjs +69 -0
- package/dist/namespace-base.d.mts +7 -0
- package/dist/namespace-base.mjs +7 -0
- package/dist/namespace-commands.d.mts +57 -0
- package/dist/namespace-commands.mjs +57 -0
- package/dist/namespace-credits.d.mts +213 -0
- package/dist/namespace-credits.mjs +476 -0
- package/dist/namespace-files.d.mts +203 -0
- package/dist/namespace-files.mjs +334 -0
- package/dist/namespace-github.d.mts +50 -0
- package/dist/namespace-github.mjs +68 -0
- package/dist/namespace-images.d.mts +52 -0
- package/dist/namespace-images.mjs +78 -0
- package/dist/namespace-launch_runs.d.mts +89 -0
- package/dist/namespace-launch_runs.mjs +133 -0
- package/dist/namespace-launches.d.mts +89 -0
- package/dist/namespace-launches.mjs +133 -0
- package/dist/namespace-operations.d.mts +45 -0
- package/dist/namespace-operations.mjs +52 -0
- package/dist/namespace-previews.d.mts +79 -0
- package/dist/namespace-previews.mjs +101 -0
- package/dist/namespace-pricing.d.mts +31 -0
- package/dist/namespace-pricing.mjs +22 -0
- package/dist/namespace-processes.d.mts +125 -0
- package/dist/namespace-processes.mjs +184 -0
- package/dist/namespace-provider_accounts.d.mts +156 -0
- package/dist/namespace-provider_accounts.mjs +241 -0
- package/dist/namespace-providers.d.mts +28 -0
- package/dist/namespace-providers.mjs +24 -0
- package/dist/namespace-routing.d.mts +64 -0
- package/dist/namespace-routing.mjs +86 -0
- package/dist/namespace-sandboxes.d.mts +287 -0
- package/dist/namespace-sandboxes.mjs +402 -0
- package/dist/namespace-secrets.d.mts +46 -0
- package/dist/namespace-secrets.mjs +68 -0
- package/dist/namespace-spend_limits.d.mts +48 -0
- package/dist/namespace-spend_limits.mjs +70 -0
- package/dist/namespace-terminals.d.mts +112 -0
- package/dist/namespace-terminals.mjs +177 -0
- package/dist/namespace-usage.d.mts +46 -0
- package/dist/namespace-usage.mjs +53 -0
- package/dist/namespace-volumes.d.mts +110 -0
- package/dist/namespace-volumes.mjs +269 -0
- package/dist/operations.d.ts +14 -0
- package/dist/operations.js +31 -0
- package/dist/retry.d.ts +8 -0
- package/dist/retry.js +63 -0
- package/dist/routing-choices.gen.d.ts +132 -0
- package/dist/routing-choices.gen.js +136 -0
- package/dist/routing.d.ts +23 -0
- package/dist/routing.js +38 -0
- package/dist/sandbox-handle.gen.d.ts +8 -0
- package/dist/sandbox-handle.gen.js +14 -0
- package/dist/sandboxes.d.ts +213 -0
- package/dist/sandboxes.js +507 -0
- package/dist/sdk.gen.d.ts +2029 -0
- package/dist/sdk.gen.js +3862 -0
- package/dist/server-timing.d.ts +19 -0
- package/dist/server-timing.gen.d.ts +265 -0
- package/dist/server-timing.gen.js +254 -0
- package/dist/server-timing.js +421 -0
- package/dist/spend-limits.d.ts +17 -0
- package/dist/spend-limits.js +26 -0
- package/dist/telemetry.d.ts +51 -0
- package/dist/telemetry.gen.d.ts +1 -0
- package/dist/telemetry.gen.js +5 -0
- package/dist/telemetry.js +438 -0
- package/dist/terminal.d.ts +61 -0
- package/dist/terminal.js +266 -0
- package/dist/transfer.d.ts +75 -0
- package/dist/transfer.js +389 -0
- package/dist/types.gen.d.ts +15016 -0
- package/dist/types.gen.js +3 -0
- package/dist/user-agent.d.ts +2 -0
- package/dist/user-agent.js +18 -0
- package/dist/version.gen.d.ts +1 -0
- package/dist/version.gen.js +5 -0
- package/dist/volumes.d.ts +33 -0
- package/dist/volumes.js +221 -0
- package/dist/waits.d.ts +31 -0
- package/dist/waits.js +42 -0
- package/dist/workflow-policy.gen.d.ts +41 -0
- package/dist/workflow-policy.gen.js +45 -0
- package/package.json +135 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.validate0 = validate235;const schema242 = {"type":"object","required":["id","size_bytes","sha256","expires_at"],"properties":{"id":{"type":"string"},"size_bytes":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expires_at":{"type":"string","format":"date-time","description":"Staging retention deadline. This is not a persistent volume or checkpointed volume data."}}};const pattern181 = new RegExp("^[a-f0-9]{64}$", "u");const formats0 = require("ajv-formats/dist/formats").fullFormats["date-time"];function validate235(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate235.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((data.id === undefined) && (missing0 = "id")) || ((data.size_bytes === undefined) && (missing0 = "size_bytes"))) || ((data.sha256 === undefined) && (missing0 = "sha256"))) || ((data.expires_at === undefined) && (missing0 = "expires_at"))){validate235.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.id !== undefined){const _errs1 = errors;if(typeof data.id !== "string"){validate235.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.size_bytes !== undefined){let data1 = data.size_bytes;const _errs3 = errors;const _errs4 = errors;const _errs5 = errors;let valid2 = false;const _errs6 = errors;if(!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err0 = {instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs6 === errors;valid2 = valid2 || _valid0;const _errs8 = errors;if(typeof data1 !== "bigint"){const err1 = {instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs8 === errors;valid2 = valid2 || _valid0;if(!valid2){const err2 = {instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate235.errors = vErrors;return false;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}var valid1 = _errs4 === errors;if(valid1){if(typeof data1 === "bigint"){if(data1 < 0){validate235.errors = [{instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs3){if((typeof data1 == "number") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){validate235.errors = [{instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.sha256 !== undefined){let data2 = data.sha256;const _errs9 = errors;if(errors === _errs9){if(typeof data2 === "string"){if(!pattern181.test(data2)){validate235.errors = [{instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""}];return false;}}else {validate235.errors = [{instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.expires_at !== undefined){let data3 = data.expires_at;const _errs11 = errors;if(errors === _errs11){if(errors === _errs11){if(typeof data3 === "string"){if(!(formats0.validate(data3))){validate235.errors = [{instancePath:instancePath+"/expires_at",schemaPath:"#/properties/expires_at/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""}];return false;}}else {validate235.errors = [{instancePath:instancePath+"/expires_at",schemaPath:"#/properties/expires_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid0 = _errs11 === errors;}else {var valid0 = true;}}}}}}else {validate235.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate235.errors = vErrors;return errors === 0;}validate235.evaluated = {"props":{"id":true,"size_bytes":true,"sha256":true,"expires_at":true},"dynamicProps":false,"dynamicItems":false};exports.validate1 = validate236;function validate236(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate236.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((data.id === undefined) && (missing0 = "id")) || ((data.size_bytes === undefined) && (missing0 = "size_bytes"))) || ((data.sha256 === undefined) && (missing0 = "sha256"))) || ((data.expires_at === undefined) && (missing0 = "expires_at"))){validate236.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.id !== undefined){const _errs1 = errors;if(typeof data.id !== "string"){validate236.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.size_bytes !== undefined){let data1 = data.size_bytes;const _errs3 = errors;const _errs4 = errors;const _errs5 = errors;let valid2 = false;const _errs6 = errors;if(!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err0 = {instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs6 === errors;valid2 = valid2 || _valid0;const _errs8 = errors;if(typeof data1 !== "bigint"){const err1 = {instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs8 === errors;valid2 = valid2 || _valid0;if(!valid2){const err2 = {instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate236.errors = vErrors;return false;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}var valid1 = _errs4 === errors;if(valid1){if(typeof data1 === "bigint"){if(data1 < 0){validate236.errors = [{instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs3){if((typeof data1 == "number") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){validate236.errors = [{instancePath:instancePath+"/size_bytes",schemaPath:"#/properties/size_bytes/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.sha256 !== undefined){let data2 = data.sha256;const _errs9 = errors;if(errors === _errs9){if(typeof data2 === "string"){if(!pattern181.test(data2)){validate236.errors = [{instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""}];return false;}}else {validate236.errors = [{instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.expires_at !== undefined){let data3 = data.expires_at;const _errs11 = errors;if(errors === _errs11){if(errors === _errs11){if(typeof data3 === "string"){if(!(formats0.validate(data3))){validate236.errors = [{instancePath:instancePath+"/expires_at",schemaPath:"#/properties/expires_at/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""}];return false;}}else {validate236.errors = [{instancePath:instancePath+"/expires_at",schemaPath:"#/properties/expires_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid0 = _errs11 === errors;}else {var valid0 = true;}}}}}}else {validate236.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate236.errors = vErrors;return errors === 0;}validate236.evaluated = {"props":{"id":true,"size_bytes":true,"sha256":true,"expires_at":true},"dynamicProps":false,"dynamicItems":false};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
module.exports = require("./compact.cjs")({"roots":{"validate0":{"$":0},"validate1":{"$":0}},"definitions":[{"type":"object","required":["id","size_bytes","sha256","expires_at"],"properties":{"id":{"type":"string"},"size_bytes":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expires_at":{"type":"string","format":"date-time"}}}]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.validate0 = validate537;const schema748 = {"anyOf":[{"$ref":"#/components/schemas/CommandResult"},{"$ref":"#/components/schemas/ByteCommandResult"}]};const schema749 = {"type":"object","required":["stdout","stderr","exit_code","timed_out","stdout_truncated","stderr_truncated"],"description":"What a command answers. A nonzero exit_code and a timeout are both a 200 with a result,\nnever an HTTP failure; a client that wants an error raises it from the result (check).\n","properties":{"stdout":{"type":"string"},"stderr":{"type":"string"},"exit_code":{"$ref":"#/components/schemas/ExitCode"},"timed_out":{"$ref":"#/components/schemas/TimedOut"},"stdout_truncated":{"$ref":"#/components/schemas/OutputTruncated"},"stderr_truncated":{"$ref":"#/components/schemas/OutputTruncated"},"native_error":{"type":["string","null"],"description":"Provider-reported error for this command, unchanged, when the provider supplies\none; otherwise null. It supplements exit_code without changing its meaning.\n"}}};const schema750 = {"description":"The command's exit status. Null only when timed_out is true: a command that was ended at its\ndeadline did not exit on its own, so it has no status.\n","allOf":[{"anyOf":[{"type":["integer","null"]},{"x-boxrouter-bigint":true}]}]};const schema751 = {"type":"boolean","description":"True when the command reached its timeout_seconds and BoxRouter ended its process group.\nThe result then carries the output the command wrote before that point, and exit_code is\nnull. False for every command that exited on its own, whatever its exit_code.\n"};const schema752 = {"type":"boolean","description":"True when the stream wrote more than output_limit_bytes and only the first output_limit_bytes are returned."};function validate538(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate538.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((((data.stdout === undefined) && (missing0 = "stdout")) || ((data.stderr === undefined) && (missing0 = "stderr"))) || ((data.exit_code === undefined) && (missing0 = "exit_code"))) || ((data.timed_out === undefined) && (missing0 = "timed_out"))) || ((data.stdout_truncated === undefined) && (missing0 = "stdout_truncated"))) || ((data.stderr_truncated === undefined) && (missing0 = "stderr_truncated"))){validate538.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.stdout !== undefined){const _errs1 = errors;if(typeof data.stdout !== "string"){validate538.errors = [{instancePath:instancePath+"/stdout",schemaPath:"#/properties/stdout/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.stderr !== undefined){const _errs3 = errors;if(typeof data.stderr !== "string"){validate538.errors = [{instancePath:instancePath+"/stderr",schemaPath:"#/properties/stderr/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.exit_code !== undefined){let data2 = data.exit_code;const _errs5 = errors;const _errs8 = errors;let valid3 = false;const _errs9 = errors;if((!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) && (data2 !== null)){const err0 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/ExitCode/allOf/0/anyOf/0/type",keyword:"type",params:{type: schema750.allOf[0].anyOf[0].type},message:"must be integer,null"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs9 === errors;valid3 = valid3 || _valid0;const _errs11 = errors;if(typeof data2 !== "bigint"){const err1 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/ExitCode/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs11 === errors;valid3 = valid3 || _valid0;if(!valid3){const err2 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/ExitCode/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate538.errors = vErrors;return false;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.timed_out !== undefined){const _errs12 = errors;if(typeof data.timed_out !== "boolean"){validate538.errors = [{instancePath:instancePath+"/timed_out",schemaPath:"#/components/schemas/TimedOut/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.stdout_truncated !== undefined){const _errs15 = errors;if(typeof data.stdout_truncated !== "boolean"){validate538.errors = [{instancePath:instancePath+"/stdout_truncated",schemaPath:"#/components/schemas/OutputTruncated/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs15 === errors;}else {var valid0 = true;}if(valid0){if(data.stderr_truncated !== undefined){const _errs18 = errors;if(typeof data.stderr_truncated !== "boolean"){validate538.errors = [{instancePath:instancePath+"/stderr_truncated",schemaPath:"#/components/schemas/OutputTruncated/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.native_error !== undefined){let data6 = data.native_error;const _errs21 = errors;if((typeof data6 !== "string") && (data6 !== null)){validate538.errors = [{instancePath:instancePath+"/native_error",schemaPath:"#/properties/native_error/type",keyword:"type",params:{type: schema749.properties.native_error.type},message:"must be string,null"}];return false;}var valid0 = _errs21 === errors;}else {var valid0 = true;}}}}}}}}}else {validate538.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate538.errors = vErrors;return errors === 0;}validate538.evaluated = {"props":{"stdout":true,"stderr":true,"exit_code":true,"timed_out":true,"stdout_truncated":true,"stderr_truncated":true,"native_error":true},"dynamicProps":false,"dynamicItems":false};const schema754 = {"type":"object","required":["stdout_base64","stderr_base64","exit_code","timed_out","stdout_truncated","stderr_truncated","native_error"],"description":"What a command asked for bytes answers: the exact bytes it wrote, base64, in place of\nthe strings. A nonzero exit_code and a timeout are still a 200.\n","properties":{"stdout_base64":{"type":"string","contentEncoding":"base64"},"stderr_base64":{"type":"string","contentEncoding":"base64"},"exit_code":{"$ref":"#/components/schemas/ExitCode"},"timed_out":{"$ref":"#/components/schemas/TimedOut"},"stdout_truncated":{"$ref":"#/components/schemas/OutputTruncated"},"stderr_truncated":{"$ref":"#/components/schemas/OutputTruncated"},"native_error":{"type":["string","null"],"description":"Always null in this form: a provider reports one against the text result, which is\nthe only one that has it. Present so no field of a result is ever absent.\n"}}};function validate540(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate540.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((((((data.stdout_base64 === undefined) && (missing0 = "stdout_base64")) || ((data.stderr_base64 === undefined) && (missing0 = "stderr_base64"))) || ((data.exit_code === undefined) && (missing0 = "exit_code"))) || ((data.timed_out === undefined) && (missing0 = "timed_out"))) || ((data.stdout_truncated === undefined) && (missing0 = "stdout_truncated"))) || ((data.stderr_truncated === undefined) && (missing0 = "stderr_truncated"))) || ((data.native_error === undefined) && (missing0 = "native_error"))){validate540.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.stdout_base64 !== undefined){const _errs1 = errors;if(typeof data.stdout_base64 !== "string"){validate540.errors = [{instancePath:instancePath+"/stdout_base64",schemaPath:"#/properties/stdout_base64/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.stderr_base64 !== undefined){const _errs3 = errors;if(typeof data.stderr_base64 !== "string"){validate540.errors = [{instancePath:instancePath+"/stderr_base64",schemaPath:"#/properties/stderr_base64/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.exit_code !== undefined){let data2 = data.exit_code;const _errs5 = errors;const _errs8 = errors;let valid3 = false;const _errs9 = errors;if((!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) && (data2 !== null)){const err0 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/ExitCode/allOf/0/anyOf/0/type",keyword:"type",params:{type: schema750.allOf[0].anyOf[0].type},message:"must be integer,null"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs9 === errors;valid3 = valid3 || _valid0;const _errs11 = errors;if(typeof data2 !== "bigint"){const err1 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/ExitCode/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs11 === errors;valid3 = valid3 || _valid0;if(!valid3){const err2 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/ExitCode/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate540.errors = vErrors;return false;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.timed_out !== undefined){const _errs12 = errors;if(typeof data.timed_out !== "boolean"){validate540.errors = [{instancePath:instancePath+"/timed_out",schemaPath:"#/components/schemas/TimedOut/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.stdout_truncated !== undefined){const _errs15 = errors;if(typeof data.stdout_truncated !== "boolean"){validate540.errors = [{instancePath:instancePath+"/stdout_truncated",schemaPath:"#/components/schemas/OutputTruncated/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs15 === errors;}else {var valid0 = true;}if(valid0){if(data.stderr_truncated !== undefined){const _errs18 = errors;if(typeof data.stderr_truncated !== "boolean"){validate540.errors = [{instancePath:instancePath+"/stderr_truncated",schemaPath:"#/components/schemas/OutputTruncated/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.native_error !== undefined){let data6 = data.native_error;const _errs21 = errors;if((typeof data6 !== "string") && (data6 !== null)){validate540.errors = [{instancePath:instancePath+"/native_error",schemaPath:"#/properties/native_error/type",keyword:"type",params:{type: schema754.properties.native_error.type},message:"must be string,null"}];return false;}var valid0 = _errs21 === errors;}else {var valid0 = true;}}}}}}}}}else {validate540.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate540.errors = vErrors;return errors === 0;}validate540.evaluated = {"props":{"stdout_base64":true,"stderr_base64":true,"exit_code":true,"timed_out":true,"stdout_truncated":true,"stderr_truncated":true,"native_error":true},"dynamicProps":false,"dynamicItems":false};function validate537(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate537.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs0 = errors;let valid0 = false;const _errs1 = errors;if(!(validate538(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate538.errors : vErrors.concat(validate538.errors);errors = vErrors.length;}var _valid0 = _errs1 === errors;valid0 = valid0 || _valid0;if(_valid0){var props0 = {};props0.stdout = true;props0.stderr = true;props0.exit_code = true;props0.timed_out = true;props0.stdout_truncated = true;props0.stderr_truncated = true;props0.native_error = true;}const _errs2 = errors;if(!(validate540(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate540.errors : vErrors.concat(validate540.errors);errors = vErrors.length;}var _valid0 = _errs2 === errors;valid0 = valid0 || _valid0;if(_valid0){if(props0 !== true){props0 = props0 || {};props0.stdout_base64 = true;props0.stderr_base64 = true;props0.exit_code = true;props0.timed_out = true;props0.stdout_truncated = true;props0.stderr_truncated = true;props0.native_error = true;}}if(!valid0){const err0 = {instancePath,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;validate537.errors = vErrors;return false;}else {errors = _errs0;if(vErrors !== null){if(_errs0){vErrors.length = _errs0;}else {vErrors = null;}}}validate537.errors = vErrors;evaluated0.props = props0;return errors === 0;}validate537.evaluated = {"dynamicProps":true,"dynamicItems":false};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validate0: (value: unknown) => boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
module.exports = require("./compact.cjs")({"roots":{"validate0":{"anyOf":[{"$":0},{"$":4}]}},"definitions":[{"type":"object","required":["stdout","stderr","exit_code","timed_out","stdout_truncated","stderr_truncated"],"properties":{"stdout":{"type":"string"},"stderr":{"type":"string"},"exit_code":{"$":1},"timed_out":{"$":2},"stdout_truncated":{"$":3},"stderr_truncated":{"$":3},"native_error":{"type":["string","null"]}}},{"allOf":[{"anyOf":[{"type":["integer","null"]},{"x-boxrouter-bigint":true}]}]},{"type":"boolean"},{"type":"boolean"},{"type":"object","required":["stdout_base64","stderr_base64","exit_code","timed_out","stdout_truncated","stderr_truncated","native_error"],"properties":{"stdout_base64":{"type":"string"},"stderr_base64":{"type":"string"},"exit_code":{"$":1},"timed_out":{"$":2},"stdout_truncated":{"$":3},"stderr_truncated":{"$":3},"native_error":{"type":["string","null"]}}}]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validate0: (value: unknown) => boolean;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const dateTime = require("ajv-formats/dist/formats").fullFormats["date-time"];
|
|
4
|
+
|
|
5
|
+
module.exports = ({ roots, definitions }) => {
|
|
6
|
+
const patterns = new Map();
|
|
7
|
+
const matches = (pattern, value) => {
|
|
8
|
+
let expression = patterns.get(pattern);
|
|
9
|
+
if (!expression) {
|
|
10
|
+
expression = new RegExp(pattern, "u");
|
|
11
|
+
patterns.set(pattern, expression);
|
|
12
|
+
}
|
|
13
|
+
return expression.test(value);
|
|
14
|
+
};
|
|
15
|
+
const equal = (left, right) => {
|
|
16
|
+
if (left === right) return true;
|
|
17
|
+
if (!left || !right || typeof left !== "object" || typeof right !== "object") return false;
|
|
18
|
+
if (Array.isArray(left) !== Array.isArray(right)) return false;
|
|
19
|
+
const keys = Object.keys(left);
|
|
20
|
+
return keys.length === Object.keys(right).length && keys.every(key =>
|
|
21
|
+
Object.prototype.hasOwnProperty.call(right, key) && equal(left[key], right[key]));
|
|
22
|
+
};
|
|
23
|
+
const isObject = value => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
24
|
+
const hasType = (type, value) => {
|
|
25
|
+
switch (type) {
|
|
26
|
+
case "null": return value === null;
|
|
27
|
+
case "array": return Array.isArray(value);
|
|
28
|
+
case "object": return isObject(value);
|
|
29
|
+
case "integer": return typeof value === "number" && Number.isFinite(value) && Number.isInteger(value);
|
|
30
|
+
case "number": return typeof value === "number" && Number.isFinite(value);
|
|
31
|
+
default: return typeof value === type;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const validate = (schema, value) => {
|
|
35
|
+
if (typeof schema === "boolean") return schema;
|
|
36
|
+
if (schema.$ !== undefined && !validate(definitions[schema.$], value)) return false;
|
|
37
|
+
if (schema.type !== undefined && !(Array.isArray(schema.type)
|
|
38
|
+
? schema.type.some(type => hasType(type, value)) : hasType(schema.type, value))) return false;
|
|
39
|
+
if (schema["x-boxrouter-bigint"] && typeof value !== "bigint") return false;
|
|
40
|
+
if (schema.const !== undefined && !equal(value, schema.const)) return false;
|
|
41
|
+
if (schema.enum && !schema.enum.some(item => equal(value, item))) return false;
|
|
42
|
+
if (schema.allOf && !schema.allOf.every(item => validate(item, value))) return false;
|
|
43
|
+
if (schema.anyOf && !schema.anyOf.some(item => validate(item, value))) return false;
|
|
44
|
+
if (schema.oneOf && schema.oneOf.filter(item => validate(item, value)).length !== 1) return false;
|
|
45
|
+
if (schema.not && validate(schema.not, value)) return false;
|
|
46
|
+
if (schema.if !== undefined) {
|
|
47
|
+
const branch = validate(schema.if, value) ? schema.then : schema.else;
|
|
48
|
+
if (branch !== undefined && !validate(branch, value)) return false;
|
|
49
|
+
}
|
|
50
|
+
if (typeof value === "number") {
|
|
51
|
+
if (schema.minimum !== undefined && value < schema.minimum) return false;
|
|
52
|
+
if (schema.maximum !== undefined && value > schema.maximum) return false;
|
|
53
|
+
if (schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum) return false;
|
|
54
|
+
if (schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum) return false;
|
|
55
|
+
if (schema.multipleOf !== undefined && !Number.isInteger(value / schema.multipleOf)) return false;
|
|
56
|
+
}
|
|
57
|
+
if (typeof value === "bigint" && schema["x-boxrouter-bigint-range"]) {
|
|
58
|
+
const range = schema["x-boxrouter-bigint-range"];
|
|
59
|
+
if (range.minimum !== undefined && value < BigInt(range.minimum)) return false;
|
|
60
|
+
if (range.maximum !== undefined && value > BigInt(range.maximum)) return false;
|
|
61
|
+
if (range.exclusiveMinimum !== undefined && value <= BigInt(range.exclusiveMinimum)) return false;
|
|
62
|
+
if (range.exclusiveMaximum !== undefined && value >= BigInt(range.exclusiveMaximum)) return false;
|
|
63
|
+
if (range.multipleOf !== undefined && value % BigInt(range.multipleOf) !== 0n) return false;
|
|
64
|
+
}
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
if (schema.minLength !== undefined && [...value].length < schema.minLength) return false;
|
|
67
|
+
if (schema.maxLength !== undefined && [...value].length > schema.maxLength) return false;
|
|
68
|
+
if (schema.pattern !== undefined && !matches(schema.pattern, value)) return false;
|
|
69
|
+
if (schema.format === "date-time" && !dateTime.validate(value)) return false;
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(value)) {
|
|
72
|
+
if (schema.minItems !== undefined && value.length < schema.minItems) return false;
|
|
73
|
+
if (schema.maxItems !== undefined && value.length > schema.maxItems) return false;
|
|
74
|
+
if (schema.uniqueItems && value.some((item, index) => value.slice(0, index).some(other => equal(item, other)))) return false;
|
|
75
|
+
const prefix = schema.prefixItems ?? [];
|
|
76
|
+
for (let index = 0; index < Math.min(prefix.length, value.length); index++) {
|
|
77
|
+
if (!validate(prefix[index], value[index])) return false;
|
|
78
|
+
}
|
|
79
|
+
if (schema.items !== undefined) {
|
|
80
|
+
for (let index = prefix.length; index < value.length; index++) {
|
|
81
|
+
if (!validate(schema.items, value[index])) return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (schema.contains !== undefined) {
|
|
85
|
+
let count = 0;
|
|
86
|
+
for (let index = 0; index < value.length; index++) {
|
|
87
|
+
if (validate(schema.contains, value[index])) count++;
|
|
88
|
+
}
|
|
89
|
+
if (count < (schema.minContains ?? 1) ||
|
|
90
|
+
(schema.maxContains !== undefined && count > schema.maxContains)) return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (isObject(value)) {
|
|
94
|
+
const keys = Object.keys(value);
|
|
95
|
+
if (schema.minProperties !== undefined && keys.length < schema.minProperties) return false;
|
|
96
|
+
if (schema.maxProperties !== undefined && keys.length > schema.maxProperties) return false;
|
|
97
|
+
if (schema.required?.some(key => value[key] === undefined)) return false;
|
|
98
|
+
if (schema.propertyNames !== undefined && keys.some(key => !validate(schema.propertyNames, key))) return false;
|
|
99
|
+
for (const [key, child] of Object.entries(schema.properties ?? {})) {
|
|
100
|
+
if (value[key] !== undefined && !validate(child, value[key])) return false;
|
|
101
|
+
}
|
|
102
|
+
for (const [pattern, child] of Object.entries(schema.patternProperties ?? {})) {
|
|
103
|
+
if (keys.some(key => matches(pattern, key) && !validate(child, value[key]))) return false;
|
|
104
|
+
}
|
|
105
|
+
if (schema.additionalProperties !== undefined) {
|
|
106
|
+
for (const key of keys) {
|
|
107
|
+
if (Object.prototype.hasOwnProperty.call(schema.properties ?? {}, key) ||
|
|
108
|
+
Object.keys(schema.patternProperties ?? {}).some(pattern => matches(pattern, key))) continue;
|
|
109
|
+
if (!validate(schema.additionalProperties, value[key])) return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const [key, dependencies] of Object.entries(schema.dependentRequired ?? {})) {
|
|
113
|
+
if (value[key] !== undefined && dependencies.some(name => value[name] === undefined)) return false;
|
|
114
|
+
}
|
|
115
|
+
for (const [key, child] of Object.entries(schema.dependentSchemas ?? {})) {
|
|
116
|
+
if (value[key] !== undefined && !validate(child, value)) return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
};
|
|
121
|
+
return Object.fromEntries(Object.entries(roots).map(([name, schema]) => [name, value => validate(schema, value)]));
|
|
122
|
+
};
|