@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,14 @@
|
|
|
1
|
+
export declare const command: (value: unknown) => boolean;
|
|
2
|
+
export declare const env: (value: unknown) => boolean;
|
|
3
|
+
export declare const cwd: (value: unknown) => boolean;
|
|
4
|
+
export declare const timeout_seconds: (value: unknown) => boolean;
|
|
5
|
+
export declare const output: (value: unknown) => boolean;
|
|
6
|
+
export declare const output_limit_bytes: (value: unknown) => boolean;
|
|
7
|
+
export declare const process_command: (value: unknown) => boolean;
|
|
8
|
+
export declare const process_env: (value: unknown) => boolean;
|
|
9
|
+
export declare const process_cwd: (value: unknown) => boolean;
|
|
10
|
+
export declare const process_stdin: (value: unknown) => boolean;
|
|
11
|
+
export declare const process_wait_for_port: (value: unknown) => boolean;
|
|
12
|
+
export declare const creation_preferences: (value: unknown) => boolean;
|
|
13
|
+
export declare const launch_inputs: (value: unknown) => boolean;
|
|
14
|
+
export declare const launch_run: (value: unknown) => boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IncompleteStream, StreamValidationError } from './streamErrors';
|
|
2
|
+
export interface EventValidator {
|
|
3
|
+
(value: unknown): boolean;
|
|
4
|
+
errors?: ReadonlyArray<{
|
|
5
|
+
instancePath: string;
|
|
6
|
+
keyword: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
}> | null;
|
|
9
|
+
}
|
|
10
|
+
export { IncompleteStream, StreamValidationError };
|
|
11
|
+
/** Load before dispatch, preserving caller cancellation and trace context. */
|
|
12
|
+
export declare function withEventValidators<T>(signal: AbortSignal | null | undefined, run: (validators: typeof import('./eventValidators.cjs')) => Promise<T>): Promise<T>;
|
|
13
|
+
/** Validate the wire envelope before user transforms, callbacks or iteration. */
|
|
14
|
+
export declare function validateEvent(schema: string, validate: EventValidator, observer?: (data: unknown) => Promise<unknown>, terminalTypes?: readonly string[], isTerminal?: EventValidator, kinds?: readonly string[]): {
|
|
15
|
+
responseValidator: (data: unknown) => Promise<unknown>;
|
|
16
|
+
validateStreamEnd: () => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StreamValidationError = exports.IncompleteStream = void 0;
|
|
4
|
+
exports.withEventValidators = withEventValidators;
|
|
5
|
+
exports.validateEvent = validateEvent;
|
|
6
|
+
const api_1 = require("@opentelemetry/api");
|
|
7
|
+
const streamErrors_1 = require("./streamErrors");
|
|
8
|
+
Object.defineProperty(exports, "IncompleteStream", { enumerable: true, get: function () { return streamErrors_1.IncompleteStream; } });
|
|
9
|
+
Object.defineProperty(exports, "StreamValidationError", { enumerable: true, get: function () { return streamErrors_1.StreamValidationError; } });
|
|
10
|
+
/** Load before dispatch, preserving caller cancellation and trace context. */
|
|
11
|
+
async function withEventValidators(signal, run) {
|
|
12
|
+
signal?.throwIfAborted();
|
|
13
|
+
const parent = api_1.context.active();
|
|
14
|
+
const loaded = import('./eventValidators.cjs');
|
|
15
|
+
let abort;
|
|
16
|
+
const cancelled = signal ? new Promise((_, reject) => {
|
|
17
|
+
abort = () => reject(signal.reason);
|
|
18
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
19
|
+
}) : undefined;
|
|
20
|
+
try {
|
|
21
|
+
const validators = await (cancelled ? Promise.race([loaded, cancelled]) : loaded);
|
|
22
|
+
signal?.throwIfAborted();
|
|
23
|
+
return api_1.context.with(parent, () => run(validators));
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
if (abort)
|
|
27
|
+
signal?.removeEventListener('abort', abort);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Validate the wire envelope before user transforms, callbacks or iteration. */
|
|
31
|
+
function validateEvent(schema, validate, observer, terminalTypes = [], isTerminal, kinds = []) {
|
|
32
|
+
let terminal = false;
|
|
33
|
+
return { responseValidator: async (data) => {
|
|
34
|
+
// Nothing may follow a terminal event, whatever its kind.
|
|
35
|
+
if (terminal)
|
|
36
|
+
throw new TypeError('Event received after terminal event');
|
|
37
|
+
if (!validate(data)) {
|
|
38
|
+
// A newer API may add event kinds: skip one this client does not know.
|
|
39
|
+
const kind = data?.data?.type;
|
|
40
|
+
if (kinds.length && typeof kind === 'string' && !kinds.includes(kind))
|
|
41
|
+
throw new streamErrors_1.UnknownEventKind(kind);
|
|
42
|
+
// Do not retain event payloads in errors or AJV's schema-specific parameters.
|
|
43
|
+
const issues = (validate.errors ?? []).map(({ instancePath, keyword, message }) => ({ instancePath, keyword, message }));
|
|
44
|
+
throw new streamErrors_1.StreamValidationError(schema, issues);
|
|
45
|
+
}
|
|
46
|
+
if (terminalTypes.length || isTerminal) {
|
|
47
|
+
// The full envelope has passed its generated schema validator above.
|
|
48
|
+
const envelope = data;
|
|
49
|
+
terminal = terminalTypes.includes(envelope.data.type) || (isTerminal?.(envelope.data) ?? false);
|
|
50
|
+
}
|
|
51
|
+
return observer ? observer(data) : undefined;
|
|
52
|
+
}, validateStreamEnd: () => {
|
|
53
|
+
if ((terminalTypes.length || isTerminal) && !terminal)
|
|
54
|
+
throw new streamErrors_1.IncompleteStream();
|
|
55
|
+
} };
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.validate0 = validate16;const schema38 = {"type":"object","required":["data"],"properties":{"id":{"type":"string","description":"Hosted replay cursor when supplied; availability and retention follow the operation."},"event":{"type":"string"},"data":{"$ref":"#/components/schemas/SandboxTerminalEvent"}},"description":"SSE transport envelope. The JSON payload retains its own type and native fields; EOF is not workload completion."};const schema39 = {"anyOf":[{"$ref":"#/components/schemas/SandboxTerminalOutputEvent"},{"$ref":"#/components/schemas/SandboxTerminalExitEvent"},{"$ref":"#/components/schemas/SandboxTerminalErrorEvent"}],"discriminator":{"propertyName":"type","mapping":{"output":"#/components/schemas/SandboxTerminalOutputEvent","exit":"#/components/schemas/SandboxTerminalExitEvent","error":"#/components/schemas/SandboxTerminalErrorEvent"}}};const schema40 = {"type":"object","required":["type","sequence","data_base64"],"properties":{"type":{"type":"string","const":"output"},"sequence":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"data_base64":{"type":"string","contentEncoding":"base64","description":"Exact PTY output bytes. Chunk boundaries may change."}}};const schema41 = {"type":"object","required":["type","sequence","exit_code"],"properties":{"type":{"type":"string","const":"exit"},"sequence":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"exit_code":{"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}]}}};const schema42 = {"type":"object","required":["type","error"],"properties":{"type":{"type":"string","const":"error"},"sequence":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"error":{"$ref":"#/components/schemas/error"}}};const schema43 = {"type":"object","required":["code","message","request_id","outcome","retry","retry_after_seconds"],"properties":{"code":{"type":"string","description":"Stable machine category. Operation failures use SandboxProviderSpec error codes,\nincluding invalid_request, invalid_state, not_found, unauthorized,\nincompatible_requirements, no_eligible_route, capacity_unavailable,\ncapability_unavailable, contract_violation, resource_limit, timeout and\nprovider_error. Hosted service failures add method_not_allowed,\nunauthenticated, forbidden, actions_sandbox_protected,\ninsufficient_credit, spend_limit_exceeded,\nprovider_not_enabled, credentials_rejected, conflict, rate_limited, provider_quota, request_timeout, overloaded,\ndatabase_unavailable, payment_method_required, payment_declined, promotion_already_redeemed, account_exists, and internal_error. unsupported_feature and\noutput_limit are earlier names still returned by some routes.\nOrganization and membership operations also use organization_changed, last_admin,\nstale_membership, directory_managed and change_in_progress. Key ownership and\ninvitation operations use idempotency_key_reused and conflict.\nCredit refunds and purchase quotes also use refund_window_closed,\nnothing_to_refund, refund_below_minimum, refund_in_progress,\npurchase_in_progress, dispute_open, already_refunded,\nrefund_amount_changed, refund_fee_unavailable, quote_changed,\nsession_required, refund_daily_limit, refund_rate_limit,\nrefund_retry_requires_support, idempotency_key_reused and fraud_review.\nCard setup adds card_setup_rate_limit (429, with Retry-After): a workspace may start five\ncard setups an hour.\nA provider that refuses the request for its own plan or quota limit answers\n429 provider_quota with the provider's words in native_message; rate_limited is\nBoxRouter's own limit.\nRouting Prevent Overrides refuses a request containing preferences.order,\npreferences.sort or preferences.allow_fallbacks with routing_overrides_forbidden,\noutcome not_started and details.fields naming the prohibited inputs. No provider\neffect occurs.\nLaunch operations also use invalid_request, secret_missing, agent_not_found,\nno_eligible_route and launch_failed.\nA process or terminal is observed by one API task. When that task stops, process\noutput, result and stdin answer 410 process_observer_lost (reading or cancelling the\nprocess still works), and a terminal on a provider that cannot reattach it answers\n410 terminal_observer_lost. invalid_observer_hop (403) refuses an internal hop\nbetween API tasks that is not signed; clients never send one.\nOpening a preview that the provider answered with other access than the request\nasked for returns 502 preview_access_refused: that preview is never returned, and\ndetails say whether it was ended.\nStarting a process with wait_for_port answers 409 port_not_listening, outcome partial,\nwhen the process exits before the port accepts connections or the port stays closed for\n30 seconds; the process is ended and details carry the output so far.\nA request that must store content (a volume, a saved artifact) under transient content\nretention answers 409 privacy_persistence_conflict with outcome not_started.\nVolume operations also use volume_busy, volume_lease_lost, volume_not_attached,\nvolume_incompatible, volume_save_failed and volume_restore_failed. Creating a\nsandbox on a volume whose writer is ending waits for the release (at most 120\nseconds) before it can answer volume_busy.\nA team member's new personal API key is paused until WorkOS membership sync catches\nup: it answers 403 forbidden whose message and fix say the key becomes active once\nthe team membership syncs, usually within a minute, and the call can be retried.\nClients must preserve and handle unknown categories explicitly.\n","x-boxrouter-error-codes":{"account_exists":[409],"account_unhealthy":[402],"actions_sandbox_protected":[403],"agent_not_found":[404],"already_refunded":[409],"authorization_error":[403],"capability_unavailable":[409,503],"capability_unverified":[409],"card_setup_rate_limit":[429],"change_in_progress":[409],"code_repository_not_found":[404],"command_failed":[409],"command_observation_busy":[409],"conflict":[409],"contract_violation":[409],"credentials_rejected":[409,422],"database_unavailable":[503],"directory_managed":[409],"dispute_open":[409],"expired":[410],"forbidden":[403],"fraud_review":[409],"gate_unavailable":[409],"idempotency_key_reused":[409,422],"identity_unavailable":[503],"insufficient_credit":[402],"internal_error":[500],"invalid_observer_hop":[403],"invalid_request":[400,413,422,428],"invalid_state":[409],"last_admin":[409],"launch_failed":[409],"lifetime_limit":[409],"lifetime_used_up":[409],"method_not_allowed":[405],"no_eligible_route":[409],"not_found":[404],"not_named":[409],"not_running":[409],"nothing_to_refund":[409],"organization_changed":[409],"output_limit":[413],"overloaded":[503],"payment_declined":[402],"payment_method_required":[409],"payment_provider_rejected":[502],"payment_provider_unavailable":[503],"payments_unavailable":[503],"port_not_listening":[409],"preview_access_refused":[502],"privacy_persistence_conflict":[409],"process_observer_lost":[410],"promotion_already_redeemed":[409],"promotion_code_invalid":[404],"provider_error":[502],"provider_not_enabled":[409],"provider_quota":[429],"purchase_in_progress":[409],"quote_changed":[409],"rate_limited":[429],"refund_amount_changed":[409],"refund_below_minimum":[409],"refund_daily_limit":[429],"refund_fee_unavailable":[409],"refund_in_progress":[409],"refund_rate_limit":[429],"refund_retry_requires_support":[409],"refund_window_closed":[409],"request_timeout":[408],"resource_limit":[413,507],"routing_overrides_forbidden":[400],"run_limit_exceeded":[429],"sandbox_ended":[410],"secret_missing":[400],"session_required":[403],"source_repository_not_accessible":[404],"spend_limit_exceeded":[402],"stale_membership":[409],"terminal_closed":[410],"terminal_observer_lost":[410],"timeout":[504],"unauthenticated":[401],"unavailable":[503],"unsupported_feature":[422],"volume_busy":[409],"volume_incompatible":[409],"volume_lease_lost":[409],"volume_not_attached":[409],"volume_restore_failed":[502],"volume_save_failed":[409,502],"volume_unavailable":[409],"wrong_region":[421]},"x-boxrouter-error-retry":{"account_exists":"after_fix","account_unhealthy":"after_fix","actions_sandbox_protected":"never","agent_not_found":"after_fix","already_refunded":"never","authorization_error":"check_outcome","capability_unavailable":"check_outcome","capability_unverified":"after_fix","card_setup_rate_limit":"safe","change_in_progress":"safe","code_repository_not_found":"after_fix","command_failed":"after_fix","command_observation_busy":"safe","conflict":"check_outcome","contract_violation":"check_outcome","credentials_rejected":"after_fix","database_unavailable":"check_outcome","directory_managed":"never","dispute_open":"after_fix","expired":"check_outcome","forbidden":"after_fix","fraud_review":"safe","gate_unavailable":"after_fix","idempotency_key_reused":"after_fix","identity_unavailable":"safe","insufficient_credit":"after_fix","internal_error":"never","invalid_observer_hop":"after_fix","invalid_request":"after_fix","invalid_state":"check_outcome","last_admin":"after_fix","launch_failed":"check_outcome","lifetime_limit":"check_outcome","lifetime_used_up":"after_fix","method_not_allowed":"after_fix","no_eligible_route":"after_fix","not_found":"check_outcome","not_named":"after_fix","not_running":"after_fix","nothing_to_refund":"never","organization_changed":"safe","output_limit":"check_outcome","overloaded":"safe","payment_declined":"after_fix","payment_method_required":"after_fix","payment_provider_rejected":"check_outcome","payment_provider_unavailable":"check_outcome","payments_unavailable":"safe","port_not_listening":"after_fix","preview_access_refused":"never","privacy_persistence_conflict":"after_fix","process_observer_lost":"check_outcome","promotion_already_redeemed":"never","promotion_code_invalid":"after_fix","provider_error":"check_outcome","provider_not_enabled":"after_fix","provider_quota":"after_fix","purchase_in_progress":"safe","quote_changed":"after_fix","rate_limited":"check_outcome","refund_amount_changed":"after_fix","refund_below_minimum":"never","refund_daily_limit":"safe","refund_fee_unavailable":"safe","refund_in_progress":"safe","refund_rate_limit":"safe","refund_retry_requires_support":"never","refund_window_closed":"never","request_timeout":"safe","resource_limit":"check_outcome","routing_overrides_forbidden":"after_fix","run_limit_exceeded":"after_fix","sandbox_ended":"check_outcome","secret_missing":"after_fix","session_required":"never","source_repository_not_accessible":"after_fix","spend_limit_exceeded":"after_fix","stale_membership":"after_fix","terminal_closed":"after_fix","terminal_observer_lost":"after_fix","timeout":"never","unauthenticated":"after_fix","unavailable":"safe","unsupported_feature":"after_fix","volume_busy":"after_fix","volume_incompatible":"after_fix","volume_lease_lost":"after_fix","volume_not_attached":"after_fix","volume_restore_failed":"check_outcome","volume_save_failed":"check_outcome","volume_unavailable":"after_fix","wrong_region":"after_fix"}},"message":{"type":"string"},"details":{"type":"object","description":"Code-specific context, spelled for programs. no_eligible_route carries considered,\nexcluded, closest and nearest; knob_not_named the knob and its values;\nunrecognised_word the path, the word and the known ones; not_named the gate, what\nthe call needed beyond the grant and the corrected requirements line; gate_unavailable\nthe gate and account; lifetime_limit the ceiling and this run. A creation that\nstopped before a sandbox existed may also carry `fallbacks_allowed`, `stopped_reason`\nand `attempts`, spelled and bounded as in the sandbox route selection.\ncapability_unavailable may identify the needed capability. A launch preparation failure can follow sandbox creation;\ninspect outcome and cleanup details before creating another. Clients must\npreserve fields they do not know.\n","properties":{"selection_version":{"minimum":0,"description":"Current selected organization version for organization_changed.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"considered":{"minimum":0,"description":"no_eligible_route only; how many routes were considered.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"excluded":{"type":"array","description":"no_eligible_route only; every considered route that cannot serve the request. Each entry names its `provider` and the checks it failed (`failed` for a sandbox request, `reasons` and `exclusions` for a launch); clients must preserve fields they do not know.","items":{"type":"object","required":["provider"],"properties":{"provider":{"type":"string"}}}},"closest":{"type":["object","null"],"description":"no_eligible_route only; the excluded route that fails fewest checks, or null."},"nearest":{"type":"array","description":"no_eligible_route only; the smallest changes that would make a route eligible, nearest first. An entry names the change (`change` and `then_eligible` for a sandbox request, `provider`, `distance` and `failing` for a launch); clients must preserve fields they do not know.","items":{"type":"object"}},"requirement":{"type":"string","description":"The SandboxProviderSpec family whose requirement would make this operation available."},"purchase_id":{"type":"string","description":"Retained failed credit purchase ID, when a saved-card charge was declined."},"preview":{"$ref":"#/components/schemas/CreditRefundPreview","description":"Current refund preview returned with 409 refund_amount_changed."},"quote":{"$ref":"#/components/schemas/CreditPurchaseQuote","description":"Current purchase quote returned with 409 quote_changed."},"redemption":{"$ref":"#/components/schemas/CreditPromotion","description":"Original promotion redemption returned with 409 promotion_already_redeemed."},"scope":{"type":"string","enum":["workspace"],"description":"spend_limit_exceeded only; which configured cap refused admission."},"period":{"type":"string","enum":["total","daily","monthly"],"description":"spend_limit_exceeded only; the cap period that applies."},"limit_nanodollars":{"minimum":1,"description":"spend_limit_exceeded only; exact configured USD nanodollars.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":1}},"requested_nanodollars":{"minimum":1,"description":"spend_limit_exceeded only; exact proposed managed hold.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":1}},"sign_in_method":{"type":"string","description":"account_exists only: how the existing account with this verified address signs in (google, github, email or other)."},"masked_email":{"type":"string","description":"account_exists only: that account's address, masked as `t…@gmail.com`."},"failure_reason":{"type":"string","maxLength":100,"description":"Short safe card-decline reason; raw Stripe messages are not returned."},"names":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/SecretName"},"description":"All manifest secret names that could not be resolved."},"fields":{"type":"array","uniqueItems":true,"items":{"type":"string","enum":["preferences.order","preferences.sort","preferences.allow_fallbacks"]},"description":"routing_overrides_forbidden only; the prohibited request inputs."},"volume_id":{"type":"string","description":"BoxRouter Volume ID involved in the error."},"writer_sandbox_id":{"type":"string","description":"volume_busy only; the sandbox that holds the volume's writer lease, when it is a recorded sandbox."},"checkpoint":{"minimum":1,"description":"Volume checkpoint involved in the error.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":1}},"limit_bytes":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"observed_bytes":{"minimum":0,"allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"mismatch":{"type":"object","required":["field","recorded","requested"],"properties":{"field":{"type":"string","enum":["image","arch"]},"recorded":{"type":"string"},"requested":{"type":"string"}}},"volume_phase":{"type":"string","enum":["check","branch","lease","identity","install","credential","mount","metadata","checkpoint","commit","write"]},"phase":{"type":"string","enum":["code","setup","files","background","previews"],"description":"Preparation phase that failed."},"command":{"type":"string","description":"Command whose nonzero exit stopped launch preparation."},"exit_code":{"description":"Exit code of the failed command, or of the process that exited before its port listened.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}]},"stderr_tail":{"type":"string","description":"At most the final 4 KiB of stderr from the failed command, with resolved secret values\nredacted. port_not_listening carries the same tail of the process's stderr.\n"},"stdout_tail":{"type":"string","description":"port_not_listening only; at most the final 4 KiB of the process's stdout."},"agent":{"type":"string","description":"Unknown catalog agent name."},"port":{"minimum":1,"maximum":65535,"description":"The sandbox port whose preview was refused (preview_access_refused) or that never accepted connections (port_not_listening).","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":1,"maximum":65535}},"revoked":{"type":"boolean","description":"preview_access_refused only; true when the unwanted preview was ended and no\naccess to the port remains. False: it may still be reachable (outcome unknown).\n"},"preview_id":{"type":"string","description":"preview_access_refused only; the identifier the provider gave the preview that may\nstill be reachable. Present only for a public preview.\n"},"url":{"type":"string","format":"uri","description":"preview_access_refused only; the address of a public preview that may still be\nreachable. Never present for a private preview, whose address holds a credential,\nand never when it was ended.\n"}}},"request_id":{"type":"string"},"doc_url":{"type":["string","null"],"format":"uri","description":"Where the documentation explains this code: `https://boxrouter.ai/docs/error-codes#` followed by the code, for example `https://boxrouter.ai/docs/error-codes#no_eligible_route`. The page has one anchored row per code with what it means and what to do. BoxRouter sends it with every error; it is null for a code that has no documented row. Clients must accept an error body that omits it."},"fix":{"type":["string","null"],"minLength":1,"description":"Actionable change for the caller when the request cannot be completed. A refusal (4xx) always carries one; a server or provider fault, including an error event that ends a terminal or process stream, can answer null."},"operation_id":{"type":["string","null"],"description":"Durable server operation ID for reconciliation after uncertain mutations."},"outcome":{"type":"string","enum":["not_started","completed","partial","unknown"],"description":"What is known about the requested side effect. `not_started` means nothing ran\nanywhere, at BoxRouter or at a provider; a launch-setup or process-start failure\nafter dispatch is `partial` or `unknown`. Unknown and partial forbid automatic\nreplay and always carry `retry: check_outcome`. An HTTP status alone does not establish\noutcome.\nMany refusals report not_started before the provider is asked anything. A read\n(GET or HEAD) has no side effect to be unsure about, so its failures report\nnot_started and carry the code's own retry value. A launch preparation failure\nhappens after the sandbox was created and setup commands may already have run, and\ndeleting the sandbox does not undo effects outside it: it reports partial once the\ncleanup is confirmed and unknown if it is not. A process that wait_for_port ended\nreports partial. volume_restore_failed on a resume or create,\nand volume_save_failed after the guest was read, report unknown or partial; they\ncarry the operation_id when the call was recorded, and their fix does not offer to\nsend the call again unchanged.\n"},"retry":{"type":"string","x-boxrouter-open-enum":true,"description":"What the caller may do next, fixed per code (x-boxrouter-error-retry): safe resends the\nsame request, after_fix changes the request or setup first, check_outcome reads\n`outcome` and the resource before resending, never does not resend. Branch on this\ninstead of the HTTP status.\n"},"retry_after_seconds":{"minimum":0,"description":"How long to wait before a `retry: safe` resend, as the Retry-After header says it; null when there is no wait to name.","allOf":[{"anyOf":[{"type":["integer","null"]},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"provider":{"type":["string","null"]},"native_code":{"type":["string","null"],"description":"The provider's machine-readable error code, unchanged, when it reports one."},"native_status":{"description":"The provider's HTTP status, unchanged, when the failure came from a provider response.","allOf":[{"anyOf":[{"type":["integer","null"]},{"x-boxrouter-bigint":true}]}]},"native_message":{"type":["string","null"],"maxLength":4096,"description":"The provider's own error message when it answered with an HTTP 4xx refusal (for example a plan limit); null otherwise. Capped at 512 characters, with whitespace collapsed. Credential secrets and token-shaped strings are removed before return. The literal `[redacted]` marker is used when all credential secret fields are at least 12 characters; legacy saved secrets shorter than 12 characters are removed without the marker."}}};const schema47 = {"type":"object","required":["code","amount_nanodollars","description","redeemed_at"],"properties":{"code":{"type":"string","description":"The code in its canonical upper-case form."},"amount_nanodollars":{"type":"string","maxLength":19,"pattern":"^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-9]{17}|92[0-1][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$","description":"Credit granted, in billionths of a US dollar, as a canonical positive signed 64-bit nanodollar string."},"description":{"type":"string","description":"What the credit is for, as the promotion describes it."},"redeemed_at":{"type":"string","format":"date-time"}}};const schema48 = {"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Z][A-Z0-9_]{0,127}$"};const schema44 = {"type":"object","required":["unused","held_excluded","fee","principal","tax","total","card"],"properties":{"unused":{"minimum":0,"description":"Unused purchased credit in US cents, before held credit is excluded.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"held_excluded":{"minimum":0,"description":"Credit held for running sandboxes, in US cents.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"fee":{"minimum":0,"description":"Original Stripe processing fee retained, in US cents.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"principal":{"minimum":0,"description":"Tax-exclusive principal returned to the original card, in US cents.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"tax":{"minimum":0,"description":"Tax Stripe adds to the credit note, in US cents.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"total":{"minimum":0,"description":"Total Stripe will refund, in US cents.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"card":{"$ref":"#/components/schemas/MaskedCreditCard"}}};const schema45 = {"type":"object","properties":{"brand":{"type":["string","null"],"description":"Card brand; absent for Link methods."},"last4":{"type":["string","null"],"pattern":"^[0-9]{4}$","description":"Last four card digits; absent for Link methods."},"type":{"type":"string","x-boxrouter-open-enum":true},"email":{"type":"string","format":"email","description":"Link account email; present only when type is link."}},"allOf":[{"if":{"properties":{"type":{"const":"link"}},"required":["type"]},"then":{"required":["email"],"properties":{"brand":{"type":"null"},"last4":{"type":"null"}}}},{"if":{"properties":{"type":{"const":"card"}},"required":["type"]},"then":{"required":["brand","last4"],"properties":{"brand":{"type":"string"},"last4":{"type":"string","pattern":"^[0-9]{4}$"}}}}]};const pattern4 = new RegExp("^[0-9]{4}$", "u");const formats0 = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i;function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs1 = errors;const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.type === undefined) && (missing0 = "type")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.type !== undefined){if("link" !== data.type){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}if(_valid0){const _errs5 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.email === undefined) && (missing1 = "email")){validate21.errors = [{instancePath,schemaPath:"#/allOf/0/then/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data.brand !== undefined){const _errs6 = errors;if(data.brand !== null){validate21.errors = [{instancePath:instancePath+"/brand",schemaPath:"#/allOf/0/then/properties/brand/type",keyword:"type",params:{type: "null"},message:"must be null"}];return false;}var valid3 = _errs6 === errors;}else {var valid3 = true;}if(valid3){if(data.last4 !== undefined){const _errs8 = errors;if(data.last4 !== null){validate21.errors = [{instancePath:instancePath+"/last4",schemaPath:"#/allOf/0/then/properties/last4/type",keyword:"type",params:{type: "null"},message:"must be null"}];return false;}var valid3 = _errs8 === errors;}else {var valid3 = true;}}}}var _valid0 = _errs5 === errors;valid1 = _valid0;if(valid1){var props0 = {};props0.brand = true;props0.last4 = true;props0.type = true;}}if(!valid1){const err2 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate21.errors = vErrors;return false;}var valid0 = _errs1 === errors;if(valid0){const _errs10 = errors;const _errs11 = errors;let valid4 = true;const _errs12 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing2;if((data.type === undefined) && (missing2 = "type")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data.type !== undefined){if("card" !== data.type){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var _valid1 = _errs12 === errors;errors = _errs11;if(vErrors !== null){if(_errs11){vErrors.length = _errs11;}else {vErrors = null;}}if(_valid1){const _errs14 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing3;if(((data.brand === undefined) && (missing3 = "brand")) || ((data.last4 === undefined) && (missing3 = "last4"))){validate21.errors = [{instancePath,schemaPath:"#/allOf/1/then/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {if(data.brand !== undefined){const _errs15 = errors;if(typeof data.brand !== "string"){validate21.errors = [{instancePath:instancePath+"/brand",schemaPath:"#/allOf/1/then/properties/brand/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid6 = _errs15 === errors;}else {var valid6 = true;}if(valid6){if(data.last4 !== undefined){let data5 = data.last4;const _errs17 = errors;if(errors === _errs17){if(typeof data5 === "string"){if(!pattern4.test(data5)){validate21.errors = [{instancePath:instancePath+"/last4",schemaPath:"#/allOf/1/then/properties/last4/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}$"},message:"must match pattern \""+"^[0-9]{4}$"+"\""}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/last4",schemaPath:"#/allOf/1/then/properties/last4/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid6 = _errs17 === errors;}else {var valid6 = true;}}}}var _valid1 = _errs14 === errors;valid4 = _valid1;if(valid4){var props1 = {};props1.brand = true;props1.last4 = true;props1.type = true;}}if(!valid4){const err5 = {instancePath,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;validate21.errors = vErrors;return false;}var valid0 = _errs10 === errors;if(valid0){if(props0 !== true && props1 !== undefined){if(props1 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props1);}}}}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(props0 !== true){props0 = props0 || {};props0.brand = true;props0.last4 = true;props0.type = true;props0.email = true;}if(data.brand !== undefined){let data6 = data.brand;const _errs19 = errors;if((typeof data6 !== "string") && (data6 !== null)){validate21.errors = [{instancePath:instancePath+"/brand",schemaPath:"#/properties/brand/type",keyword:"type",params:{type: schema45.properties.brand.type},message:"must be string,null"}];return false;}var valid7 = _errs19 === errors;}else {var valid7 = true;}if(valid7){if(data.last4 !== undefined){let data7 = data.last4;const _errs21 = errors;if((typeof data7 !== "string") && (data7 !== null)){validate21.errors = [{instancePath:instancePath+"/last4",schemaPath:"#/properties/last4/type",keyword:"type",params:{type: schema45.properties.last4.type},message:"must be string,null"}];return false;}if(errors === _errs21){if(typeof data7 === "string"){if(!pattern4.test(data7)){validate21.errors = [{instancePath:instancePath+"/last4",schemaPath:"#/properties/last4/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}$"},message:"must match pattern \""+"^[0-9]{4}$"+"\""}];return false;}}}var valid7 = _errs21 === errors;}else {var valid7 = true;}if(valid7){if(data.type !== undefined){const _errs23 = errors;if(typeof data.type !== "string"){validate21.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid7 = _errs23 === errors;}else {var valid7 = true;}if(valid7){if(data.email !== undefined){let data9 = data.email;const _errs25 = errors;if(errors === _errs25){if(errors === _errs25){if(typeof data9 === "string"){if(!(formats0.test(data9))){validate21.errors = [{instancePath:instancePath+"/email",schemaPath:"#/properties/email/format",keyword:"format",params:{format: "email"},message:"must match format \""+"email"+"\""}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/email",schemaPath:"#/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid7 = _errs25 === errors;}else {var valid7 = true;}}}}}else {validate21.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate21.errors = vErrors;evaluated0.props = props0;return errors === 0;}validate21.evaluated = {"dynamicProps":true,"dynamicItems":false};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate20.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.unused === undefined) && (missing0 = "unused")) || ((data.held_excluded === undefined) && (missing0 = "held_excluded"))) || ((data.fee === undefined) && (missing0 = "fee"))) || ((data.principal === undefined) && (missing0 = "principal"))) || ((data.tax === undefined) && (missing0 = "tax"))) || ((data.total === undefined) && (missing0 = "total"))) || ((data.card === undefined) && (missing0 = "card"))){validate20.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.unused !== undefined){let data0 = data.unused;const _errs1 = errors;const _errs2 = errors;const _errs3 = errors;let valid2 = false;const _errs4 = errors;if(!((typeof data0 == "number") && (!(data0 % 1) && !isNaN(data0)))){const err0 = {instancePath:instancePath+"/unused",schemaPath:"#/properties/unused/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 = _errs4 === errors;valid2 = valid2 || _valid0;const _errs6 = errors;if(typeof data0 !== "bigint"){const err1 = {instancePath:instancePath+"/unused",schemaPath:"#/properties/unused/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 = _errs6 === errors;valid2 = valid2 || _valid0;if(!valid2){const err2 = {instancePath:instancePath+"/unused",schemaPath:"#/properties/unused/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}var valid1 = _errs2 === errors;if(valid1){if(typeof data0 === "bigint"){if(data0 < 0){validate20.errors = [{instancePath:instancePath+"/unused",schemaPath:"#/properties/unused/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs1){if(typeof data0 == "number"){if(data0 < 0 || isNaN(data0)){validate20.errors = [{instancePath:instancePath+"/unused",schemaPath:"#/properties/unused/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.held_excluded !== undefined){let data1 = data.held_excluded;const _errs7 = errors;const _errs8 = errors;const _errs9 = errors;let valid4 = false;const _errs10 = errors;if(!((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1)))){const err3 = {instancePath:instancePath+"/held_excluded",schemaPath:"#/properties/held_excluded/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid1 = _errs10 === errors;valid4 = valid4 || _valid1;const _errs12 = errors;if(typeof data1 !== "bigint"){const err4 = {instancePath:instancePath+"/held_excluded",schemaPath:"#/properties/held_excluded/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid1 = _errs12 === errors;valid4 = valid4 || _valid1;if(!valid4){const err5 = {instancePath:instancePath+"/held_excluded",schemaPath:"#/properties/held_excluded/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}var valid3 = _errs8 === errors;if(valid3){if(typeof data1 === "bigint"){if(data1 < 0){validate20.errors = [{instancePath:instancePath+"/held_excluded",schemaPath:"#/properties/held_excluded/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs7){if(typeof data1 == "number"){if(data1 < 0 || isNaN(data1)){validate20.errors = [{instancePath:instancePath+"/held_excluded",schemaPath:"#/properties/held_excluded/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.fee !== undefined){let data2 = data.fee;const _errs13 = errors;const _errs14 = errors;const _errs15 = errors;let valid6 = false;const _errs16 = errors;if(!((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2)))){const err6 = {instancePath:instancePath+"/fee",schemaPath:"#/properties/fee/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid2 = _errs16 === errors;valid6 = valid6 || _valid2;const _errs18 = errors;if(typeof data2 !== "bigint"){const err7 = {instancePath:instancePath+"/fee",schemaPath:"#/properties/fee/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid2 = _errs18 === errors;valid6 = valid6 || _valid2;if(!valid6){const err8 = {instancePath:instancePath+"/fee",schemaPath:"#/properties/fee/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}}var valid5 = _errs14 === errors;if(valid5){if(typeof data2 === "bigint"){if(data2 < 0){validate20.errors = [{instancePath:instancePath+"/fee",schemaPath:"#/properties/fee/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs13){if(typeof data2 == "number"){if(data2 < 0 || isNaN(data2)){validate20.errors = [{instancePath:instancePath+"/fee",schemaPath:"#/properties/fee/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.principal !== undefined){let data3 = data.principal;const _errs19 = errors;const _errs20 = errors;const _errs21 = errors;let valid8 = false;const _errs22 = errors;if(!((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3)))){const err9 = {instancePath:instancePath+"/principal",schemaPath:"#/properties/principal/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var _valid3 = _errs22 === errors;valid8 = valid8 || _valid3;const _errs24 = errors;if(typeof data3 !== "bigint"){const err10 = {instancePath:instancePath+"/principal",schemaPath:"#/properties/principal/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid3 = _errs24 === errors;valid8 = valid8 || _valid3;if(!valid8){const err11 = {instancePath:instancePath+"/principal",schemaPath:"#/properties/principal/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}var valid7 = _errs20 === errors;if(valid7){if(typeof data3 === "bigint"){if(data3 < 0){validate20.errors = [{instancePath:instancePath+"/principal",schemaPath:"#/properties/principal/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs19){if(typeof data3 == "number"){if(data3 < 0 || isNaN(data3)){validate20.errors = [{instancePath:instancePath+"/principal",schemaPath:"#/properties/principal/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs19 === errors;}else {var valid0 = true;}if(valid0){if(data.tax !== undefined){let data4 = data.tax;const _errs25 = errors;const _errs26 = errors;const _errs27 = errors;let valid10 = false;const _errs28 = errors;if(!((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4)))){const err12 = {instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid4 = _errs28 === errors;valid10 = valid10 || _valid4;const _errs30 = errors;if(typeof data4 !== "bigint"){const err13 = {instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid4 = _errs30 === errors;valid10 = valid10 || _valid4;if(!valid10){const err14 = {instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}var valid9 = _errs26 === errors;if(valid9){if(typeof data4 === "bigint"){if(data4 < 0){validate20.errors = [{instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs25){if(typeof data4 == "number"){if(data4 < 0 || isNaN(data4)){validate20.errors = [{instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs25 === errors;}else {var valid0 = true;}if(valid0){if(data.total !== undefined){let data5 = data.total;const _errs31 = errors;const _errs32 = errors;const _errs33 = errors;let valid12 = false;const _errs34 = errors;if(!((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5)))){const err15 = {instancePath:instancePath+"/total",schemaPath:"#/properties/total/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var _valid5 = _errs34 === errors;valid12 = valid12 || _valid5;const _errs36 = errors;if(typeof data5 !== "bigint"){const err16 = {instancePath:instancePath+"/total",schemaPath:"#/properties/total/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}var _valid5 = _errs36 === errors;valid12 = valid12 || _valid5;if(!valid12){const err17 = {instancePath:instancePath+"/total",schemaPath:"#/properties/total/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}var valid11 = _errs32 === errors;if(valid11){if(typeof data5 === "bigint"){if(data5 < 0){validate20.errors = [{instancePath:instancePath+"/total",schemaPath:"#/properties/total/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs31){if(typeof data5 == "number"){if(data5 < 0 || isNaN(data5)){validate20.errors = [{instancePath:instancePath+"/total",schemaPath:"#/properties/total/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs31 === errors;}else {var valid0 = true;}if(valid0){if(data.card !== undefined){const _errs37 = errors;if(!(validate21(data.card, {instancePath:instancePath+"/card",parentData:data,parentDataProperty:"card",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}var valid0 = _errs37 === errors;}else {var valid0 = true;}}}}}}}}}else {validate20.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":{"unused":true,"held_excluded":true,"fee":true,"principal":true,"tax":true,"total":true,"card":true},"dynamicProps":false,"dynamicItems":false};const schema46 = {"type":"object","required":["amount","tax","total","address_required"],"properties":{"amount":{"minimum":1,"description":"Tax-exclusive credit amount in US cents; this is what is added to the balance.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":1}},"fee_minor":{"minimum":0,"description":"BoxRouter's purchase fee in US cents, computed by the server and charged on top of amount. Tax applies to amount plus fee. Absent on older services.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"tax":{"minimum":0,"description":"Estimated tax in US cents, on the credits and the fee.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":0}},"total":{"minimum":1,"description":"Estimated total to charge in US cents: amount plus fee_minor plus tax.","allOf":[{"anyOf":[{"type":"integer"},{"x-boxrouter-bigint":true}]}],"x-boxrouter-bigint-range":{"minimum":1}},"address_required":{"type":"boolean"},"missing":{"type":"array","items":{"type":"string"},"description":"Required billing address fields missing for an exact tax quote."}}};function validate24(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate24.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.amount === undefined) && (missing0 = "amount")) || ((data.tax === undefined) && (missing0 = "tax"))) || ((data.total === undefined) && (missing0 = "total"))) || ((data.address_required === undefined) && (missing0 = "address_required"))){validate24.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.amount !== undefined){let data0 = data.amount;const _errs1 = errors;const _errs2 = errors;const _errs3 = errors;let valid2 = false;const _errs4 = errors;if(!((typeof data0 == "number") && (!(data0 % 1) && !isNaN(data0)))){const err0 = {instancePath:instancePath+"/amount",schemaPath:"#/properties/amount/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 = _errs4 === errors;valid2 = valid2 || _valid0;const _errs6 = errors;if(typeof data0 !== "bigint"){const err1 = {instancePath:instancePath+"/amount",schemaPath:"#/properties/amount/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 = _errs6 === errors;valid2 = valid2 || _valid0;if(!valid2){const err2 = {instancePath:instancePath+"/amount",schemaPath:"#/properties/amount/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate24.errors = vErrors;return false;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}var valid1 = _errs2 === errors;if(valid1){if(typeof data0 === "bigint"){if(data0 < 1){validate24.errors = [{instancePath:instancePath+"/amount",schemaPath:"#/properties/amount/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs1){if(typeof data0 == "number"){if(data0 < 1 || isNaN(data0)){validate24.errors = [{instancePath:instancePath+"/amount",schemaPath:"#/properties/amount/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.fee_minor !== undefined){let data1 = data.fee_minor;const _errs7 = errors;const _errs8 = errors;const _errs9 = errors;let valid4 = false;const _errs10 = errors;if(!((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1)))){const err3 = {instancePath:instancePath+"/fee_minor",schemaPath:"#/properties/fee_minor/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid1 = _errs10 === errors;valid4 = valid4 || _valid1;const _errs12 = errors;if(typeof data1 !== "bigint"){const err4 = {instancePath:instancePath+"/fee_minor",schemaPath:"#/properties/fee_minor/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid1 = _errs12 === errors;valid4 = valid4 || _valid1;if(!valid4){const err5 = {instancePath:instancePath+"/fee_minor",schemaPath:"#/properties/fee_minor/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;validate24.errors = vErrors;return false;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}var valid3 = _errs8 === errors;if(valid3){if(typeof data1 === "bigint"){if(data1 < 0){validate24.errors = [{instancePath:instancePath+"/fee_minor",schemaPath:"#/properties/fee_minor/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs7){if(typeof data1 == "number"){if(data1 < 0 || isNaN(data1)){validate24.errors = [{instancePath:instancePath+"/fee_minor",schemaPath:"#/properties/fee_minor/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.tax !== undefined){let data2 = data.tax;const _errs13 = errors;const _errs14 = errors;const _errs15 = errors;let valid6 = false;const _errs16 = errors;if(!((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2)))){const err6 = {instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid2 = _errs16 === errors;valid6 = valid6 || _valid2;const _errs18 = errors;if(typeof data2 !== "bigint"){const err7 = {instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid2 = _errs18 === errors;valid6 = valid6 || _valid2;if(!valid6){const err8 = {instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;validate24.errors = vErrors;return false;}else {errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}}var valid5 = _errs14 === errors;if(valid5){if(typeof data2 === "bigint"){if(data2 < 0){validate24.errors = [{instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs13){if(typeof data2 == "number"){if(data2 < 0 || isNaN(data2)){validate24.errors = [{instancePath:instancePath+"/tax",schemaPath:"#/properties/tax/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.total !== undefined){let data3 = data.total;const _errs19 = errors;const _errs20 = errors;const _errs21 = errors;let valid8 = false;const _errs22 = errors;if(!((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3)))){const err9 = {instancePath:instancePath+"/total",schemaPath:"#/properties/total/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var _valid3 = _errs22 === errors;valid8 = valid8 || _valid3;const _errs24 = errors;if(typeof data3 !== "bigint"){const err10 = {instancePath:instancePath+"/total",schemaPath:"#/properties/total/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid3 = _errs24 === errors;valid8 = valid8 || _valid3;if(!valid8){const err11 = {instancePath:instancePath+"/total",schemaPath:"#/properties/total/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;validate24.errors = vErrors;return false;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}var valid7 = _errs20 === errors;if(valid7){if(typeof data3 === "bigint"){if(data3 < 1){validate24.errors = [{instancePath:instancePath+"/total",schemaPath:"#/properties/total/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs19){if(typeof data3 == "number"){if(data3 < 1 || isNaN(data3)){validate24.errors = [{instancePath:instancePath+"/total",schemaPath:"#/properties/total/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid0 = _errs19 === errors;}else {var valid0 = true;}if(valid0){if(data.address_required !== undefined){const _errs25 = errors;if(typeof data.address_required !== "boolean"){validate24.errors = [{instancePath:instancePath+"/address_required",schemaPath:"#/properties/address_required/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs25 === errors;}else {var valid0 = true;}if(valid0){if(data.missing !== undefined){let data5 = data.missing;const _errs27 = errors;if(errors === _errs27){if(Array.isArray(data5)){var valid9 = true;const len0 = data5.length;for(let i0=0; i0<len0; i0++){const _errs29 = errors;if(typeof data5[i0] !== "string"){validate24.errors = [{instancePath:instancePath+"/missing/" + i0,schemaPath:"#/properties/missing/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs29 === errors;if(!valid9){break;}}}else {validate24.errors = [{instancePath:instancePath+"/missing",schemaPath:"#/properties/missing/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs27 === errors;}else {var valid0 = true;}}}}}}}}else {validate24.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {"props":{"amount":true,"fee_minor":true,"tax":true,"total":true,"address_required":true,"missing":true},"dynamicProps":false,"dynamicItems":false};const func1 = require("ajv/dist/runtime/ucs2length").default;const func0 = require("ajv/dist/runtime/equal").default;const pattern6 = new RegExp("^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-9]{17}|92[0-1][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$", "u");const pattern7 = new RegExp("^[A-Z][A-Z0-9_]{0,127}$", "u");const formats2 = require("ajv-formats/dist/formats").fullFormats["date-time"];const formats4 = require("ajv-formats/dist/formats").fullFormats.uri;function validate19(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate19.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.code === undefined) && (missing0 = "code")) || ((data.message === undefined) && (missing0 = "message"))) || ((data.request_id === undefined) && (missing0 = "request_id"))) || ((data.outcome === undefined) && (missing0 = "outcome"))) || ((data.retry === undefined) && (missing0 = "retry"))) || ((data.retry_after_seconds === undefined) && (missing0 = "retry_after_seconds"))){validate19.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.code !== undefined){const _errs1 = errors;if(typeof data.code !== "string"){validate19.errors = [{instancePath:instancePath+"/code",schemaPath:"#/properties/code/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.message !== undefined){const _errs3 = errors;if(typeof data.message !== "string"){validate19.errors = [{instancePath:instancePath+"/message",schemaPath:"#/properties/message/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.details !== undefined){let data2 = data.details;const _errs5 = errors;if(errors === _errs5){if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.selection_version !== undefined){let data3 = data2.selection_version;const _errs7 = errors;const _errs8 = errors;const _errs9 = errors;let valid3 = false;const _errs10 = errors;if(!((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3)))){const err0 = {instancePath:instancePath+"/details/selection_version",schemaPath:"#/properties/details/properties/selection_version/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 = _errs10 === errors;valid3 = valid3 || _valid0;const _errs12 = errors;if(typeof data3 !== "bigint"){const err1 = {instancePath:instancePath+"/details/selection_version",schemaPath:"#/properties/details/properties/selection_version/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 = _errs12 === errors;valid3 = valid3 || _valid0;if(!valid3){const err2 = {instancePath:instancePath+"/details/selection_version",schemaPath:"#/properties/details/properties/selection_version/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}var valid2 = _errs8 === errors;if(valid2){if(typeof data3 === "bigint"){if(data3 < 0){validate19.errors = [{instancePath:instancePath+"/details/selection_version",schemaPath:"#/properties/details/properties/selection_version/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs7){if(typeof data3 == "number"){if(data3 < 0 || isNaN(data3)){validate19.errors = [{instancePath:instancePath+"/details/selection_version",schemaPath:"#/properties/details/properties/selection_version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data2.considered !== undefined){let data4 = data2.considered;const _errs13 = errors;const _errs14 = errors;const _errs15 = errors;let valid5 = false;const _errs16 = errors;if(!((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4)))){const err3 = {instancePath:instancePath+"/details/considered",schemaPath:"#/properties/details/properties/considered/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid1 = _errs16 === errors;valid5 = valid5 || _valid1;const _errs18 = errors;if(typeof data4 !== "bigint"){const err4 = {instancePath:instancePath+"/details/considered",schemaPath:"#/properties/details/properties/considered/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid1 = _errs18 === errors;valid5 = valid5 || _valid1;if(!valid5){const err5 = {instancePath:instancePath+"/details/considered",schemaPath:"#/properties/details/properties/considered/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}}var valid4 = _errs14 === errors;if(valid4){if(typeof data4 === "bigint"){if(data4 < 0){validate19.errors = [{instancePath:instancePath+"/details/considered",schemaPath:"#/properties/details/properties/considered/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs13){if(typeof data4 == "number"){if(data4 < 0 || isNaN(data4)){validate19.errors = [{instancePath:instancePath+"/details/considered",schemaPath:"#/properties/details/properties/considered/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid1 = _errs13 === errors;}else {var valid1 = true;}if(valid1){if(data2.excluded !== undefined){let data5 = data2.excluded;const _errs19 = errors;if(errors === _errs19){if(Array.isArray(data5)){var valid6 = true;const len0 = data5.length;for(let i0=0; i0<len0; i0++){let data6 = data5[i0];const _errs21 = errors;if(errors === _errs21){if(data6 && typeof data6 == "object" && !Array.isArray(data6)){let missing1;if((data6.provider === undefined) && (missing1 = "provider")){validate19.errors = [{instancePath:instancePath+"/details/excluded/" + i0,schemaPath:"#/properties/details/properties/excluded/items/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data6.provider !== undefined){if(typeof data6.provider !== "string"){validate19.errors = [{instancePath:instancePath+"/details/excluded/" + i0+"/provider",schemaPath:"#/properties/details/properties/excluded/items/properties/provider/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}}else {validate19.errors = [{instancePath:instancePath+"/details/excluded/" + i0,schemaPath:"#/properties/details/properties/excluded/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid6 = _errs21 === errors;if(!valid6){break;}}}else {validate19.errors = [{instancePath:instancePath+"/details/excluded",schemaPath:"#/properties/details/properties/excluded/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid1 = _errs19 === errors;}else {var valid1 = true;}if(valid1){if(data2.closest !== undefined){let data8 = data2.closest;const _errs25 = errors;if((!(data8 && typeof data8 == "object" && !Array.isArray(data8))) && (data8 !== null)){validate19.errors = [{instancePath:instancePath+"/details/closest",schemaPath:"#/properties/details/properties/closest/type",keyword:"type",params:{type: schema43.properties.details.properties.closest.type},message:"must be object,null"}];return false;}var valid1 = _errs25 === errors;}else {var valid1 = true;}if(valid1){if(data2.nearest !== undefined){let data9 = data2.nearest;const _errs27 = errors;if(errors === _errs27){if(Array.isArray(data9)){var valid8 = true;const len1 = data9.length;for(let i1=0; i1<len1; i1++){let data10 = data9[i1];const _errs29 = errors;if(!(data10 && typeof data10 == "object" && !Array.isArray(data10))){validate19.errors = [{instancePath:instancePath+"/details/nearest/" + i1,schemaPath:"#/properties/details/properties/nearest/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid8 = _errs29 === errors;if(!valid8){break;}}}else {validate19.errors = [{instancePath:instancePath+"/details/nearest",schemaPath:"#/properties/details/properties/nearest/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid1 = _errs27 === errors;}else {var valid1 = true;}if(valid1){if(data2.requirement !== undefined){const _errs31 = errors;if(typeof data2.requirement !== "string"){validate19.errors = [{instancePath:instancePath+"/details/requirement",schemaPath:"#/properties/details/properties/requirement/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs31 === errors;}else {var valid1 = true;}if(valid1){if(data2.purchase_id !== undefined){const _errs33 = errors;if(typeof data2.purchase_id !== "string"){validate19.errors = [{instancePath:instancePath+"/details/purchase_id",schemaPath:"#/properties/details/properties/purchase_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs33 === errors;}else {var valid1 = true;}if(valid1){if(data2.preview !== undefined){const _errs35 = errors;if(!(validate20(data2.preview, {instancePath:instancePath+"/details/preview",parentData:data2,parentDataProperty:"preview",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);errors = vErrors.length;}var valid1 = _errs35 === errors;}else {var valid1 = true;}if(valid1){if(data2.quote !== undefined){const _errs36 = errors;if(!(validate24(data2.quote, {instancePath:instancePath+"/details/quote",parentData:data2,parentDataProperty:"quote",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);errors = vErrors.length;}var valid1 = _errs36 === errors;}else {var valid1 = true;}if(valid1){if(data2.redemption !== undefined){let data15 = data2.redemption;const _errs37 = errors;const _errs38 = errors;if(errors === _errs38){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){let missing2;if(((((data15.code === undefined) && (missing2 = "code")) || ((data15.amount_nanodollars === undefined) && (missing2 = "amount_nanodollars"))) || ((data15.description === undefined) && (missing2 = "description"))) || ((data15.redeemed_at === undefined) && (missing2 = "redeemed_at"))){validate19.errors = [{instancePath:instancePath+"/details/redemption",schemaPath:"#/components/schemas/CreditPromotion/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {if(data15.code !== undefined){const _errs40 = errors;if(typeof data15.code !== "string"){validate19.errors = [{instancePath:instancePath+"/details/redemption/code",schemaPath:"#/components/schemas/CreditPromotion/properties/code/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid10 = _errs40 === errors;}else {var valid10 = true;}if(valid10){if(data15.amount_nanodollars !== undefined){let data17 = data15.amount_nanodollars;const _errs42 = errors;if(errors === _errs42){if(typeof data17 === "string"){if(func1(data17) > 19){validate19.errors = [{instancePath:instancePath+"/details/redemption/amount_nanodollars",schemaPath:"#/components/schemas/CreditPromotion/properties/amount_nanodollars/maxLength",keyword:"maxLength",params:{limit: 19},message:"must NOT have more than 19 characters"}];return false;}else {if(!pattern6.test(data17)){validate19.errors = [{instancePath:instancePath+"/details/redemption/amount_nanodollars",schemaPath:"#/components/schemas/CreditPromotion/properties/amount_nanodollars/pattern",keyword:"pattern",params:{pattern: "^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-9]{17}|92[0-1][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$"},message:"must match pattern \""+"^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-9]{17}|92[0-1][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$"+"\""}];return false;}}}else {validate19.errors = [{instancePath:instancePath+"/details/redemption/amount_nanodollars",schemaPath:"#/components/schemas/CreditPromotion/properties/amount_nanodollars/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid10 = _errs42 === errors;}else {var valid10 = true;}if(valid10){if(data15.description !== undefined){const _errs44 = errors;if(typeof data15.description !== "string"){validate19.errors = [{instancePath:instancePath+"/details/redemption/description",schemaPath:"#/components/schemas/CreditPromotion/properties/description/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid10 = _errs44 === errors;}else {var valid10 = true;}if(valid10){if(data15.redeemed_at !== undefined){let data19 = data15.redeemed_at;const _errs46 = errors;if(errors === _errs46){if(errors === _errs46){if(typeof data19 === "string"){if(!(formats2.validate(data19))){validate19.errors = [{instancePath:instancePath+"/details/redemption/redeemed_at",schemaPath:"#/components/schemas/CreditPromotion/properties/redeemed_at/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""}];return false;}}else {validate19.errors = [{instancePath:instancePath+"/details/redemption/redeemed_at",schemaPath:"#/components/schemas/CreditPromotion/properties/redeemed_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid10 = _errs46 === errors;}else {var valid10 = true;}}}}}}else {validate19.errors = [{instancePath:instancePath+"/details/redemption",schemaPath:"#/components/schemas/CreditPromotion/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid1 = _errs37 === errors;}else {var valid1 = true;}if(valid1){if(data2.scope !== undefined){let data20 = data2.scope;const _errs48 = errors;if(typeof data20 !== "string"){validate19.errors = [{instancePath:instancePath+"/details/scope",schemaPath:"#/properties/details/properties/scope/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data20 === "workspace")){validate19.errors = [{instancePath:instancePath+"/details/scope",schemaPath:"#/properties/details/properties/scope/enum",keyword:"enum",params:{allowedValues: schema43.properties.details.properties.scope.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs48 === errors;}else {var valid1 = true;}if(valid1){if(data2.period !== undefined){let data21 = data2.period;const _errs50 = errors;if(typeof data21 !== "string"){validate19.errors = [{instancePath:instancePath+"/details/period",schemaPath:"#/properties/details/properties/period/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((data21 === "total") || (data21 === "daily")) || (data21 === "monthly"))){validate19.errors = [{instancePath:instancePath+"/details/period",schemaPath:"#/properties/details/properties/period/enum",keyword:"enum",params:{allowedValues: schema43.properties.details.properties.period.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs50 === errors;}else {var valid1 = true;}if(valid1){if(data2.limit_nanodollars !== undefined){let data22 = data2.limit_nanodollars;const _errs52 = errors;const _errs53 = errors;const _errs54 = errors;let valid12 = false;const _errs55 = errors;if(!((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22)))){const err6 = {instancePath:instancePath+"/details/limit_nanodollars",schemaPath:"#/properties/details/properties/limit_nanodollars/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid2 = _errs55 === errors;valid12 = valid12 || _valid2;const _errs57 = errors;if(typeof data22 !== "bigint"){const err7 = {instancePath:instancePath+"/details/limit_nanodollars",schemaPath:"#/properties/details/properties/limit_nanodollars/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid2 = _errs57 === errors;valid12 = valid12 || _valid2;if(!valid12){const err8 = {instancePath:instancePath+"/details/limit_nanodollars",schemaPath:"#/properties/details/properties/limit_nanodollars/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs54;if(vErrors !== null){if(_errs54){vErrors.length = _errs54;}else {vErrors = null;}}}var valid11 = _errs53 === errors;if(valid11){if(typeof data22 === "bigint"){if(data22 < 1){validate19.errors = [{instancePath:instancePath+"/details/limit_nanodollars",schemaPath:"#/properties/details/properties/limit_nanodollars/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs52){if(typeof data22 == "number"){if(data22 < 1 || isNaN(data22)){validate19.errors = [{instancePath:instancePath+"/details/limit_nanodollars",schemaPath:"#/properties/details/properties/limit_nanodollars/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid1 = _errs52 === errors;}else {var valid1 = true;}if(valid1){if(data2.requested_nanodollars !== undefined){let data23 = data2.requested_nanodollars;const _errs58 = errors;const _errs59 = errors;const _errs60 = errors;let valid14 = false;const _errs61 = errors;if(!((typeof data23 == "number") && (!(data23 % 1) && !isNaN(data23)))){const err9 = {instancePath:instancePath+"/details/requested_nanodollars",schemaPath:"#/properties/details/properties/requested_nanodollars/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var _valid3 = _errs61 === errors;valid14 = valid14 || _valid3;const _errs63 = errors;if(typeof data23 !== "bigint"){const err10 = {instancePath:instancePath+"/details/requested_nanodollars",schemaPath:"#/properties/details/properties/requested_nanodollars/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid3 = _errs63 === errors;valid14 = valid14 || _valid3;if(!valid14){const err11 = {instancePath:instancePath+"/details/requested_nanodollars",schemaPath:"#/properties/details/properties/requested_nanodollars/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs60;if(vErrors !== null){if(_errs60){vErrors.length = _errs60;}else {vErrors = null;}}}var valid13 = _errs59 === errors;if(valid13){if(typeof data23 === "bigint"){if(data23 < 1){validate19.errors = [{instancePath:instancePath+"/details/requested_nanodollars",schemaPath:"#/properties/details/properties/requested_nanodollars/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs58){if(typeof data23 == "number"){if(data23 < 1 || isNaN(data23)){validate19.errors = [{instancePath:instancePath+"/details/requested_nanodollars",schemaPath:"#/properties/details/properties/requested_nanodollars/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid1 = _errs58 === errors;}else {var valid1 = true;}if(valid1){if(data2.sign_in_method !== undefined){const _errs64 = errors;if(typeof data2.sign_in_method !== "string"){validate19.errors = [{instancePath:instancePath+"/details/sign_in_method",schemaPath:"#/properties/details/properties/sign_in_method/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs64 === errors;}else {var valid1 = true;}if(valid1){if(data2.masked_email !== undefined){const _errs66 = errors;if(typeof data2.masked_email !== "string"){validate19.errors = [{instancePath:instancePath+"/details/masked_email",schemaPath:"#/properties/details/properties/masked_email/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs66 === errors;}else {var valid1 = true;}if(valid1){if(data2.failure_reason !== undefined){let data26 = data2.failure_reason;const _errs68 = errors;if(errors === _errs68){if(typeof data26 === "string"){if(func1(data26) > 100){validate19.errors = [{instancePath:instancePath+"/details/failure_reason",schemaPath:"#/properties/details/properties/failure_reason/maxLength",keyword:"maxLength",params:{limit: 100},message:"must NOT have more than 100 characters"}];return false;}}else {validate19.errors = [{instancePath:instancePath+"/details/failure_reason",schemaPath:"#/properties/details/properties/failure_reason/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid1 = _errs68 === errors;}else {var valid1 = true;}if(valid1){if(data2.names !== undefined){let data27 = data2.names;const _errs70 = errors;if(errors === _errs70){if(Array.isArray(data27)){var valid15 = true;const len2 = data27.length;for(let i2=0; i2<len2; i2++){let data28 = data27[i2];const _errs72 = errors;const _errs73 = errors;if(errors === _errs73){if(typeof data28 === "string"){if(func1(data28) > 128){validate19.errors = [{instancePath:instancePath+"/details/names/" + i2,schemaPath:"#/components/schemas/SecretName/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"}];return false;}else {if(func1(data28) < 1){validate19.errors = [{instancePath:instancePath+"/details/names/" + i2,schemaPath:"#/components/schemas/SecretName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}else {if(!pattern7.test(data28)){validate19.errors = [{instancePath:instancePath+"/details/names/" + i2,schemaPath:"#/components/schemas/SecretName/pattern",keyword:"pattern",params:{pattern: "^[A-Z][A-Z0-9_]{0,127}$"},message:"must match pattern \""+"^[A-Z][A-Z0-9_]{0,127}$"+"\""}];return false;}}}}else {validate19.errors = [{instancePath:instancePath+"/details/names/" + i2,schemaPath:"#/components/schemas/SecretName/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid15 = _errs72 === errors;if(!valid15){break;}}if(valid15){let i3 = data27.length;let j0;if(i3 > 1){outer0:for(;i3--;){for(j0 = i3; j0--;){if(func0(data27[i3], data27[j0])){validate19.errors = [{instancePath:instancePath+"/details/names",schemaPath:"#/properties/details/properties/names/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i3+" are identical)"}];return false;break outer0;}}}}}}else {validate19.errors = [{instancePath:instancePath+"/details/names",schemaPath:"#/properties/details/properties/names/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid1 = _errs70 === errors;}else {var valid1 = true;}if(valid1){if(data2.fields !== undefined){let data29 = data2.fields;const _errs75 = errors;if(errors === _errs75){if(Array.isArray(data29)){var valid18 = true;const len3 = data29.length;for(let i4=0; i4<len3; i4++){let data30 = data29[i4];const _errs77 = errors;if(typeof data30 !== "string"){validate19.errors = [{instancePath:instancePath+"/details/fields/" + i4,schemaPath:"#/properties/details/properties/fields/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((data30 === "preferences.order") || (data30 === "preferences.sort")) || (data30 === "preferences.allow_fallbacks"))){validate19.errors = [{instancePath:instancePath+"/details/fields/" + i4,schemaPath:"#/properties/details/properties/fields/items/enum",keyword:"enum",params:{allowedValues: schema43.properties.details.properties.fields.items.enum},message:"must be equal to one of the allowed values"}];return false;}var valid18 = _errs77 === errors;if(!valid18){break;}}if(valid18){let i5 = data29.length;let j1;if(i5 > 1){const indices0 = {};for(;i5--;){let item0 = data29[i5];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j1 = indices0[item0];validate19.errors = [{instancePath:instancePath+"/details/fields",schemaPath:"#/properties/details/properties/fields/uniqueItems",keyword:"uniqueItems",params:{i: i5, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i5+" are identical)"}];return false;break;}indices0[item0] = i5;}}}}else {validate19.errors = [{instancePath:instancePath+"/details/fields",schemaPath:"#/properties/details/properties/fields/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid1 = _errs75 === errors;}else {var valid1 = true;}if(valid1){if(data2.volume_id !== undefined){const _errs79 = errors;if(typeof data2.volume_id !== "string"){validate19.errors = [{instancePath:instancePath+"/details/volume_id",schemaPath:"#/properties/details/properties/volume_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs79 === errors;}else {var valid1 = true;}if(valid1){if(data2.writer_sandbox_id !== undefined){const _errs81 = errors;if(typeof data2.writer_sandbox_id !== "string"){validate19.errors = [{instancePath:instancePath+"/details/writer_sandbox_id",schemaPath:"#/properties/details/properties/writer_sandbox_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs81 === errors;}else {var valid1 = true;}if(valid1){if(data2.checkpoint !== undefined){let data33 = data2.checkpoint;const _errs83 = errors;const _errs84 = errors;const _errs85 = errors;let valid21 = false;const _errs86 = errors;if(!((typeof data33 == "number") && (!(data33 % 1) && !isNaN(data33)))){const err12 = {instancePath:instancePath+"/details/checkpoint",schemaPath:"#/properties/details/properties/checkpoint/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid4 = _errs86 === errors;valid21 = valid21 || _valid4;const _errs88 = errors;if(typeof data33 !== "bigint"){const err13 = {instancePath:instancePath+"/details/checkpoint",schemaPath:"#/properties/details/properties/checkpoint/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid4 = _errs88 === errors;valid21 = valid21 || _valid4;if(!valid21){const err14 = {instancePath:instancePath+"/details/checkpoint",schemaPath:"#/properties/details/properties/checkpoint/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs85;if(vErrors !== null){if(_errs85){vErrors.length = _errs85;}else {vErrors = null;}}}var valid20 = _errs84 === errors;if(valid20){if(typeof data33 === "bigint"){if(data33 < 1){validate19.errors = [{instancePath:instancePath+"/details/checkpoint",schemaPath:"#/properties/details/properties/checkpoint/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs83){if(typeof data33 == "number"){if(data33 < 1 || isNaN(data33)){validate19.errors = [{instancePath:instancePath+"/details/checkpoint",schemaPath:"#/properties/details/properties/checkpoint/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}var valid1 = _errs83 === errors;}else {var valid1 = true;}if(valid1){if(data2.limit_bytes !== undefined){let data34 = data2.limit_bytes;const _errs89 = errors;const _errs90 = errors;const _errs91 = errors;let valid23 = false;const _errs92 = errors;if(!((typeof data34 == "number") && (!(data34 % 1) && !isNaN(data34)))){const err15 = {instancePath:instancePath+"/details/limit_bytes",schemaPath:"#/properties/details/properties/limit_bytes/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var _valid5 = _errs92 === errors;valid23 = valid23 || _valid5;const _errs94 = errors;if(typeof data34 !== "bigint"){const err16 = {instancePath:instancePath+"/details/limit_bytes",schemaPath:"#/properties/details/properties/limit_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 = [err16];}else {vErrors.push(err16);}errors++;}var _valid5 = _errs94 === errors;valid23 = valid23 || _valid5;if(!valid23){const err17 = {instancePath:instancePath+"/details/limit_bytes",schemaPath:"#/properties/details/properties/limit_bytes/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs91;if(vErrors !== null){if(_errs91){vErrors.length = _errs91;}else {vErrors = null;}}}var valid22 = _errs90 === errors;if(valid22){if(typeof data34 === "bigint"){if(data34 < 0){validate19.errors = [{instancePath:instancePath+"/details/limit_bytes",schemaPath:"#/properties/details/properties/limit_bytes/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs89){if(typeof data34 == "number"){if(data34 < 0 || isNaN(data34)){validate19.errors = [{instancePath:instancePath+"/details/limit_bytes",schemaPath:"#/properties/details/properties/limit_bytes/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid1 = _errs89 === errors;}else {var valid1 = true;}if(valid1){if(data2.observed_bytes !== undefined){let data35 = data2.observed_bytes;const _errs95 = errors;const _errs96 = errors;const _errs97 = errors;let valid25 = false;const _errs98 = errors;if(!((typeof data35 == "number") && (!(data35 % 1) && !isNaN(data35)))){const err18 = {instancePath:instancePath+"/details/observed_bytes",schemaPath:"#/properties/details/properties/observed_bytes/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}var _valid6 = _errs98 === errors;valid25 = valid25 || _valid6;const _errs100 = errors;if(typeof data35 !== "bigint"){const err19 = {instancePath:instancePath+"/details/observed_bytes",schemaPath:"#/properties/details/properties/observed_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 = [err19];}else {vErrors.push(err19);}errors++;}var _valid6 = _errs100 === errors;valid25 = valid25 || _valid6;if(!valid25){const err20 = {instancePath:instancePath+"/details/observed_bytes",schemaPath:"#/properties/details/properties/observed_bytes/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs97;if(vErrors !== null){if(_errs97){vErrors.length = _errs97;}else {vErrors = null;}}}var valid24 = _errs96 === errors;if(valid24){if(typeof data35 === "bigint"){if(data35 < 0){validate19.errors = [{instancePath:instancePath+"/details/observed_bytes",schemaPath:"#/properties/details/properties/observed_bytes/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs95){if(typeof data35 == "number"){if(data35 < 0 || isNaN(data35)){validate19.errors = [{instancePath:instancePath+"/details/observed_bytes",schemaPath:"#/properties/details/properties/observed_bytes/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid1 = _errs95 === errors;}else {var valid1 = true;}if(valid1){if(data2.mismatch !== undefined){let data36 = data2.mismatch;const _errs101 = errors;if(errors === _errs101){if(data36 && typeof data36 == "object" && !Array.isArray(data36)){let missing3;if((((data36.field === undefined) && (missing3 = "field")) || ((data36.recorded === undefined) && (missing3 = "recorded"))) || ((data36.requested === undefined) && (missing3 = "requested"))){validate19.errors = [{instancePath:instancePath+"/details/mismatch",schemaPath:"#/properties/details/properties/mismatch/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {if(data36.field !== undefined){let data37 = data36.field;const _errs103 = errors;if(typeof data37 !== "string"){validate19.errors = [{instancePath:instancePath+"/details/mismatch/field",schemaPath:"#/properties/details/properties/mismatch/properties/field/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data37 === "image") || (data37 === "arch"))){validate19.errors = [{instancePath:instancePath+"/details/mismatch/field",schemaPath:"#/properties/details/properties/mismatch/properties/field/enum",keyword:"enum",params:{allowedValues: schema43.properties.details.properties.mismatch.properties.field.enum},message:"must be equal to one of the allowed values"}];return false;}var valid26 = _errs103 === errors;}else {var valid26 = true;}if(valid26){if(data36.recorded !== undefined){const _errs105 = errors;if(typeof data36.recorded !== "string"){validate19.errors = [{instancePath:instancePath+"/details/mismatch/recorded",schemaPath:"#/properties/details/properties/mismatch/properties/recorded/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid26 = _errs105 === errors;}else {var valid26 = true;}if(valid26){if(data36.requested !== undefined){const _errs107 = errors;if(typeof data36.requested !== "string"){validate19.errors = [{instancePath:instancePath+"/details/mismatch/requested",schemaPath:"#/properties/details/properties/mismatch/properties/requested/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid26 = _errs107 === errors;}else {var valid26 = true;}}}}}else {validate19.errors = [{instancePath:instancePath+"/details/mismatch",schemaPath:"#/properties/details/properties/mismatch/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid1 = _errs101 === errors;}else {var valid1 = true;}if(valid1){if(data2.volume_phase !== undefined){let data40 = data2.volume_phase;const _errs109 = errors;if(typeof data40 !== "string"){validate19.errors = [{instancePath:instancePath+"/details/volume_phase",schemaPath:"#/properties/details/properties/volume_phase/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((((((((((data40 === "check") || (data40 === "branch")) || (data40 === "lease")) || (data40 === "identity")) || (data40 === "install")) || (data40 === "credential")) || (data40 === "mount")) || (data40 === "metadata")) || (data40 === "checkpoint")) || (data40 === "commit")) || (data40 === "write"))){validate19.errors = [{instancePath:instancePath+"/details/volume_phase",schemaPath:"#/properties/details/properties/volume_phase/enum",keyword:"enum",params:{allowedValues: schema43.properties.details.properties.volume_phase.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs109 === errors;}else {var valid1 = true;}if(valid1){if(data2.phase !== undefined){let data41 = data2.phase;const _errs111 = errors;if(typeof data41 !== "string"){validate19.errors = [{instancePath:instancePath+"/details/phase",schemaPath:"#/properties/details/properties/phase/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((((data41 === "code") || (data41 === "setup")) || (data41 === "files")) || (data41 === "background")) || (data41 === "previews"))){validate19.errors = [{instancePath:instancePath+"/details/phase",schemaPath:"#/properties/details/properties/phase/enum",keyword:"enum",params:{allowedValues: schema43.properties.details.properties.phase.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs111 === errors;}else {var valid1 = true;}if(valid1){if(data2.command !== undefined){const _errs113 = errors;if(typeof data2.command !== "string"){validate19.errors = [{instancePath:instancePath+"/details/command",schemaPath:"#/properties/details/properties/command/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs113 === errors;}else {var valid1 = true;}if(valid1){if(data2.exit_code !== undefined){let data43 = data2.exit_code;const _errs115 = errors;const _errs117 = errors;let valid28 = false;const _errs118 = errors;if(!((typeof data43 == "number") && (!(data43 % 1) && !isNaN(data43)))){const err21 = {instancePath:instancePath+"/details/exit_code",schemaPath:"#/properties/details/properties/exit_code/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid7 = _errs118 === errors;valid28 = valid28 || _valid7;const _errs120 = errors;if(typeof data43 !== "bigint"){const err22 = {instancePath:instancePath+"/details/exit_code",schemaPath:"#/properties/details/properties/exit_code/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid7 = _errs120 === errors;valid28 = valid28 || _valid7;if(!valid28){const err23 = {instancePath:instancePath+"/details/exit_code",schemaPath:"#/properties/details/properties/exit_code/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs117;if(vErrors !== null){if(_errs117){vErrors.length = _errs117;}else {vErrors = null;}}}var valid1 = _errs115 === errors;}else {var valid1 = true;}if(valid1){if(data2.stderr_tail !== undefined){const _errs121 = errors;if(typeof data2.stderr_tail !== "string"){validate19.errors = [{instancePath:instancePath+"/details/stderr_tail",schemaPath:"#/properties/details/properties/stderr_tail/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs121 === errors;}else {var valid1 = true;}if(valid1){if(data2.stdout_tail !== undefined){const _errs123 = errors;if(typeof data2.stdout_tail !== "string"){validate19.errors = [{instancePath:instancePath+"/details/stdout_tail",schemaPath:"#/properties/details/properties/stdout_tail/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs123 === errors;}else {var valid1 = true;}if(valid1){if(data2.agent !== undefined){const _errs125 = errors;if(typeof data2.agent !== "string"){validate19.errors = [{instancePath:instancePath+"/details/agent",schemaPath:"#/properties/details/properties/agent/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs125 === errors;}else {var valid1 = true;}if(valid1){if(data2.port !== undefined){let data47 = data2.port;const _errs127 = errors;const _errs128 = errors;const _errs129 = errors;let valid30 = false;const _errs130 = errors;if(!((typeof data47 == "number") && (!(data47 % 1) && !isNaN(data47)))){const err24 = {instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}var _valid8 = _errs130 === errors;valid30 = valid30 || _valid8;const _errs132 = errors;if(typeof data47 !== "bigint"){const err25 = {instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid8 = _errs132 === errors;valid30 = valid30 || _valid8;if(!valid30){const err26 = {instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs129;if(vErrors !== null){if(_errs129){vErrors.length = _errs129;}else {vErrors = null;}}}var valid29 = _errs128 === errors;if(valid29){if(typeof data47 === "bigint"){if(data47 < 1){validate19.errors = [{instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}else {if(data47 > 65535){validate19.errors = [{instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}}if(errors === _errs127){if(typeof data47 == "number"){if(data47 > 65535 || isNaN(data47)){validate19.errors = [{instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/maximum",keyword:"maximum",params:{comparison: "<=", limit: 65535},message:"must be <= 65535"}];return false;}else {if(data47 < 1 || isNaN(data47)){validate19.errors = [{instancePath:instancePath+"/details/port",schemaPath:"#/properties/details/properties/port/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}}}var valid1 = _errs127 === errors;}else {var valid1 = true;}if(valid1){if(data2.revoked !== undefined){const _errs133 = errors;if(typeof data2.revoked !== "boolean"){validate19.errors = [{instancePath:instancePath+"/details/revoked",schemaPath:"#/properties/details/properties/revoked/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs133 === errors;}else {var valid1 = true;}if(valid1){if(data2.preview_id !== undefined){const _errs135 = errors;if(typeof data2.preview_id !== "string"){validate19.errors = [{instancePath:instancePath+"/details/preview_id",schemaPath:"#/properties/details/properties/preview_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs135 === errors;}else {var valid1 = true;}if(valid1){if(data2.url !== undefined){let data50 = data2.url;const _errs137 = errors;if(errors === _errs137){if(errors === _errs137){if(typeof data50 === "string"){if(!(formats4(data50))){validate19.errors = [{instancePath:instancePath+"/details/url",schemaPath:"#/properties/details/properties/url/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];return false;}}else {validate19.errors = [{instancePath:instancePath+"/details/url",schemaPath:"#/properties/details/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid1 = _errs137 === errors;}else {var valid1 = true;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}else {validate19.errors = [{instancePath:instancePath+"/details",schemaPath:"#/properties/details/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.request_id !== undefined){const _errs139 = errors;if(typeof data.request_id !== "string"){validate19.errors = [{instancePath:instancePath+"/request_id",schemaPath:"#/properties/request_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs139 === errors;}else {var valid0 = true;}if(valid0){if(data.doc_url !== undefined){let data52 = data.doc_url;const _errs141 = errors;if((typeof data52 !== "string") && (data52 !== null)){validate19.errors = [{instancePath:instancePath+"/doc_url",schemaPath:"#/properties/doc_url/type",keyword:"type",params:{type: schema43.properties.doc_url.type},message:"must be string,null"}];return false;}if(errors === _errs141){if(errors === _errs141){if(typeof data52 === "string"){if(!(formats4(data52))){validate19.errors = [{instancePath:instancePath+"/doc_url",schemaPath:"#/properties/doc_url/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];return false;}}}}var valid0 = _errs141 === errors;}else {var valid0 = true;}if(valid0){if(data.fix !== undefined){let data53 = data.fix;const _errs143 = errors;if((typeof data53 !== "string") && (data53 !== null)){validate19.errors = [{instancePath:instancePath+"/fix",schemaPath:"#/properties/fix/type",keyword:"type",params:{type: schema43.properties.fix.type},message:"must be string,null"}];return false;}if(errors === _errs143){if(typeof data53 === "string"){if(func1(data53) < 1){validate19.errors = [{instancePath:instancePath+"/fix",schemaPath:"#/properties/fix/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"}];return false;}}}var valid0 = _errs143 === errors;}else {var valid0 = true;}if(valid0){if(data.operation_id !== undefined){let data54 = data.operation_id;const _errs145 = errors;if((typeof data54 !== "string") && (data54 !== null)){validate19.errors = [{instancePath:instancePath+"/operation_id",schemaPath:"#/properties/operation_id/type",keyword:"type",params:{type: schema43.properties.operation_id.type},message:"must be string,null"}];return false;}var valid0 = _errs145 === errors;}else {var valid0 = true;}if(valid0){if(data.outcome !== undefined){let data55 = data.outcome;const _errs147 = errors;if(typeof data55 !== "string"){validate19.errors = [{instancePath:instancePath+"/outcome",schemaPath:"#/properties/outcome/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((((data55 === "not_started") || (data55 === "completed")) || (data55 === "partial")) || (data55 === "unknown"))){validate19.errors = [{instancePath:instancePath+"/outcome",schemaPath:"#/properties/outcome/enum",keyword:"enum",params:{allowedValues: schema43.properties.outcome.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs147 === errors;}else {var valid0 = true;}if(valid0){if(data.retry !== undefined){const _errs149 = errors;if(typeof data.retry !== "string"){validate19.errors = [{instancePath:instancePath+"/retry",schemaPath:"#/properties/retry/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs149 === errors;}else {var valid0 = true;}if(valid0){if(data.retry_after_seconds !== undefined){let data57 = data.retry_after_seconds;const _errs151 = errors;const _errs152 = errors;const _errs153 = errors;let valid32 = false;const _errs154 = errors;if((!((typeof data57 == "number") && (!(data57 % 1) && !isNaN(data57)))) && (data57 !== null)){const err27 = {instancePath:instancePath+"/retry_after_seconds",schemaPath:"#/properties/retry_after_seconds/allOf/0/anyOf/0/type",keyword:"type",params:{type: schema43.properties.retry_after_seconds.allOf[0].anyOf[0].type},message:"must be integer,null"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}var _valid9 = _errs154 === errors;valid32 = valid32 || _valid9;const _errs156 = errors;if(typeof data57 !== "bigint"){const err28 = {instancePath:instancePath+"/retry_after_seconds",schemaPath:"#/properties/retry_after_seconds/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}var _valid9 = _errs156 === errors;valid32 = valid32 || _valid9;if(!valid32){const err29 = {instancePath:instancePath+"/retry_after_seconds",schemaPath:"#/properties/retry_after_seconds/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs153;if(vErrors !== null){if(_errs153){vErrors.length = _errs153;}else {vErrors = null;}}}var valid31 = _errs152 === errors;if(valid31){if(typeof data57 === "bigint"){if(data57 < 0){validate19.errors = [{instancePath:instancePath+"/retry_after_seconds",schemaPath:"#/properties/retry_after_seconds/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"}];return false;}}}if(errors === _errs151){if(typeof data57 == "number"){if(data57 < 0 || isNaN(data57)){validate19.errors = [{instancePath:instancePath+"/retry_after_seconds",schemaPath:"#/properties/retry_after_seconds/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}}var valid0 = _errs151 === errors;}else {var valid0 = true;}if(valid0){if(data.provider !== undefined){let data58 = data.provider;const _errs157 = errors;if((typeof data58 !== "string") && (data58 !== null)){validate19.errors = [{instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/type",keyword:"type",params:{type: schema43.properties.provider.type},message:"must be string,null"}];return false;}var valid0 = _errs157 === errors;}else {var valid0 = true;}if(valid0){if(data.native_code !== undefined){let data59 = data.native_code;const _errs159 = errors;if((typeof data59 !== "string") && (data59 !== null)){validate19.errors = [{instancePath:instancePath+"/native_code",schemaPath:"#/properties/native_code/type",keyword:"type",params:{type: schema43.properties.native_code.type},message:"must be string,null"}];return false;}var valid0 = _errs159 === errors;}else {var valid0 = true;}if(valid0){if(data.native_status !== undefined){let data60 = data.native_status;const _errs161 = errors;const _errs163 = errors;let valid34 = false;const _errs164 = errors;if((!((typeof data60 == "number") && (!(data60 % 1) && !isNaN(data60)))) && (data60 !== null)){const err30 = {instancePath:instancePath+"/native_status",schemaPath:"#/properties/native_status/allOf/0/anyOf/0/type",keyword:"type",params:{type: schema43.properties.native_status.allOf[0].anyOf[0].type},message:"must be integer,null"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}var _valid10 = _errs164 === errors;valid34 = valid34 || _valid10;const _errs166 = errors;if(typeof data60 !== "bigint"){const err31 = {instancePath:instancePath+"/native_status",schemaPath:"#/properties/native_status/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}var _valid10 = _errs166 === errors;valid34 = valid34 || _valid10;if(!valid34){const err32 = {instancePath:instancePath+"/native_status",schemaPath:"#/properties/native_status/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;validate19.errors = vErrors;return false;}else {errors = _errs163;if(vErrors !== null){if(_errs163){vErrors.length = _errs163;}else {vErrors = null;}}}var valid0 = _errs161 === errors;}else {var valid0 = true;}if(valid0){if(data.native_message !== undefined){let data61 = data.native_message;const _errs167 = errors;if((typeof data61 !== "string") && (data61 !== null)){validate19.errors = [{instancePath:instancePath+"/native_message",schemaPath:"#/properties/native_message/type",keyword:"type",params:{type: schema43.properties.native_message.type},message:"must be string,null"}];return false;}if(errors === _errs167){if(typeof data61 === "string"){if(func1(data61) > 4096){validate19.errors = [{instancePath:instancePath+"/native_message",schemaPath:"#/properties/native_message/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"}];return false;}}}var valid0 = _errs167 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}else {validate19.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate19.errors = vErrors;return errors === 0;}validate19.evaluated = {"props":{"code":true,"message":true,"details":true,"request_id":true,"doc_url":true,"fix":true,"operation_id":true,"outcome":true,"retry":true,"retry_after_seconds":true,"provider":true,"native_code":true,"native_status":true,"native_message":true},"dynamicProps":false,"dynamicItems":false};function validate18(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate18.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.type === undefined) && (missing0 = "type")) || ((data.error === undefined) && (missing0 = "error"))){validate18.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.type !== undefined){let data0 = data.type;const _errs1 = errors;if(typeof data0 !== "string"){validate18.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if("error" !== data0){validate18.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/const",keyword:"const",params:{allowedValue: "error"},message:"must be equal to constant"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.sequence !== undefined){let data1 = data.sequence;const _errs3 = errors;const _errs4 = errors;const _errs5 = errors;let valid2 = false;const _errs6 = errors;if(!((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1)))){const err0 = {instancePath:instancePath+"/sequence",schemaPath:"#/properties/sequence/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+"/sequence",schemaPath:"#/properties/sequence/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+"/sequence",schemaPath:"#/properties/sequence/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;validate18.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){validate18.errors = [{instancePath:instancePath+"/sequence",schemaPath:"#/properties/sequence/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"){if(data1 < 0 || isNaN(data1)){validate18.errors = [{instancePath:instancePath+"/sequence",schemaPath:"#/properties/sequence/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.error !== undefined){const _errs9 = errors;if(!(validate19(data.error, {instancePath:instancePath+"/error",parentData:data,parentDataProperty:"error",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate19.errors : vErrors.concat(validate19.errors);errors = vErrors.length;}var valid0 = _errs9 === errors;}else {var valid0 = true;}}}}}else {validate18.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate18.errors = vErrors;return errors === 0;}validate18.evaluated = {"props":{"type":true,"sequence":true,"error":true},"dynamicProps":false,"dynamicItems":false};function validate17(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate17.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs0 = errors;let valid0 = false;const _errs1 = errors;const _errs2 = errors;if(errors === _errs2){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((data.type === undefined) && (missing0 = "type")) || ((data.sequence === undefined) && (missing0 = "sequence"))) || ((data.data_base64 === undefined) && (missing0 = "data_base64"))){const err0 = {instancePath,schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.type !== undefined){let data0 = data.type;const _errs4 = errors;if(typeof data0 !== "string"){const err1 = {instancePath:instancePath+"/type",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if("output" !== data0){const err2 = {instancePath:instancePath+"/type",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/type/const",keyword:"const",params:{allowedValue: "output"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}var valid2 = _errs4 === errors;}else {var valid2 = true;}if(valid2){if(data.sequence !== undefined){let data1 = data.sequence;const _errs6 = errors;const _errs7 = errors;const _errs8 = errors;let valid4 = false;const _errs9 = errors;if(!((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1)))){const err3 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/sequence/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid1 = _errs9 === errors;valid4 = valid4 || _valid1;const _errs11 = errors;if(typeof data1 !== "bigint"){const err4 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/sequence/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid1 = _errs11 === errors;valid4 = valid4 || _valid1;if(!valid4){const err5 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/sequence/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}var valid3 = _errs7 === errors;if(valid3){if(typeof data1 === "bigint"){if(data1 < 0){const err6 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/sequence/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}if(errors === _errs6){if(typeof data1 == "number"){if(data1 < 0 || isNaN(data1)){const err7 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/sequence/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}var valid2 = _errs6 === errors;}else {var valid2 = true;}if(valid2){if(data.data_base64 !== undefined){const _errs12 = errors;if(typeof data.data_base64 !== "string"){const err8 = {instancePath:instancePath+"/data_base64",schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/properties/data_base64/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}var valid2 = _errs12 === errors;}else {var valid2 = true;}}}}}else {const err9 = {instancePath,schemaPath:"#/components/schemas/SandboxTerminalOutputEvent/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}var _valid0 = _errs1 === errors;valid0 = valid0 || _valid0;if(_valid0){var props0 = {};props0.type = true;props0.sequence = true;props0.data_base64 = true;}const _errs14 = errors;const _errs15 = errors;if(errors === _errs15){if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((((data.type === undefined) && (missing1 = "type")) || ((data.sequence === undefined) && (missing1 = "sequence"))) || ((data.exit_code === undefined) && (missing1 = "exit_code"))){const err10 = {instancePath,schemaPath:"#/components/schemas/SandboxTerminalExitEvent/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}else {if(data.type !== undefined){let data3 = data.type;const _errs17 = errors;if(typeof data3 !== "string"){const err11 = {instancePath:instancePath+"/type",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if("exit" !== data3){const err12 = {instancePath:instancePath+"/type",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/type/const",keyword:"const",params:{allowedValue: "exit"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var valid6 = _errs17 === errors;}else {var valid6 = true;}if(valid6){if(data.sequence !== undefined){let data4 = data.sequence;const _errs19 = errors;const _errs20 = errors;const _errs21 = errors;let valid8 = false;const _errs22 = errors;if(!((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4)))){const err13 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/sequence/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid2 = _errs22 === errors;valid8 = valid8 || _valid2;const _errs24 = errors;if(typeof data4 !== "bigint"){const err14 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/sequence/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}var _valid2 = _errs24 === errors;valid8 = valid8 || _valid2;if(!valid8){const err15 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/sequence/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}var valid7 = _errs20 === errors;if(valid7){if(typeof data4 === "bigint"){if(data4 < 0){const err16 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/sequence/x-boxrouter-bigint-range",keyword:"x-boxrouter-bigint-range",params:{},message:"must pass \"x-boxrouter-bigint-range\" keyword validation"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}if(errors === _errs19){if(typeof data4 == "number"){if(data4 < 0 || isNaN(data4)){const err17 = {instancePath:instancePath+"/sequence",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/sequence/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}var valid6 = _errs19 === errors;}else {var valid6 = true;}if(valid6){if(data.exit_code !== undefined){let data5 = data.exit_code;const _errs25 = errors;const _errs27 = errors;let valid10 = false;const _errs28 = errors;if(!((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5)))){const err18 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/exit_code/allOf/0/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}var _valid3 = _errs28 === errors;valid10 = valid10 || _valid3;const _errs30 = errors;if(typeof data5 !== "bigint"){const err19 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/exit_code/allOf/0/anyOf/1/x-boxrouter-bigint",keyword:"x-boxrouter-bigint",params:{},message:"must pass \"x-boxrouter-bigint\" keyword validation"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}var _valid3 = _errs30 === errors;valid10 = valid10 || _valid3;if(!valid10){const err20 = {instancePath:instancePath+"/exit_code",schemaPath:"#/components/schemas/SandboxTerminalExitEvent/properties/exit_code/allOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}var valid6 = _errs25 === errors;}else {var valid6 = true;}}}}}else {const err21 = {instancePath,schemaPath:"#/components/schemas/SandboxTerminalExitEvent/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}var _valid0 = _errs14 === errors;valid0 = valid0 || _valid0;if(_valid0){if(props0 !== true){props0 = props0 || {};props0.type = true;props0.sequence = true;props0.exit_code = true;}}const _errs31 = errors;if(!(validate18(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);errors = vErrors.length;}var _valid0 = _errs31 === errors;valid0 = valid0 || _valid0;if(_valid0){if(props0 !== true){props0 = props0 || {};props0.type = true;props0.sequence = true;props0.error = true;}}if(!valid0){const err22 = {instancePath,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;validate17.errors = vErrors;return false;}else {errors = _errs0;if(vErrors !== null){if(_errs0){vErrors.length = _errs0;}else {vErrors = null;}}}validate17.errors = vErrors;evaluated0.props = props0;return errors === 0;}validate17.evaluated = {"dynamicProps":true,"dynamicItems":false};function validate16(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate16.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.data === undefined) && (missing0 = "data")){validate16.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"){validate16.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.event !== undefined){const _errs3 = errors;if(typeof data.event !== "string"){validate16.errors = [{instancePath:instancePath+"/event",schemaPath:"#/properties/event/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.data !== undefined){const _errs5 = errors;if(!(validate17(data.data, {instancePath:instancePath+"/data",parentData:data,parentDataProperty:"data",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate17.errors : vErrors.concat(validate17.errors);errors = vErrors.length;}var valid0 = _errs5 === errors;}else {var valid0 = true;}}}}}else {validate16.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate16.errors = vErrors;return errors === 0;}validate16.evaluated = {"props":{"id":true,"event":true,"data":true},"dynamicProps":false,"dynamicItems":false};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseJson = parseJson;
|
|
4
|
+
exports.stringifyJson = stringifyJson;
|
|
5
|
+
const lossless_json_1 = require("lossless-json");
|
|
6
|
+
/** Keep ordinary numbers ergonomic and large integer wire values exact. */
|
|
7
|
+
function number(value) {
|
|
8
|
+
const parsed = Number(value);
|
|
9
|
+
if (!Number.isFinite(parsed))
|
|
10
|
+
throw new SyntaxError('JSON numbers must be finite');
|
|
11
|
+
if (!Number.isInteger(parsed))
|
|
12
|
+
return parsed;
|
|
13
|
+
const { sign, digits, exponent } = (0, lossless_json_1.splitNumber)(value);
|
|
14
|
+
const zeros = exponent + 1 - digits.length;
|
|
15
|
+
if (zeros < 0)
|
|
16
|
+
throw new TypeError('JSON number exceeds numeric precision');
|
|
17
|
+
if (Math.abs(parsed) <= Number.MAX_SAFE_INTEGER)
|
|
18
|
+
return parsed;
|
|
19
|
+
return BigInt(sign + digits + '0'.repeat(zeros));
|
|
20
|
+
}
|
|
21
|
+
function parseJson(text) {
|
|
22
|
+
return (0, lossless_json_1.parse)(text, null, { parseNumber: number, onDuplicateKey: ({ newValue }) => newValue });
|
|
23
|
+
}
|
|
24
|
+
/** Bigints remain JSON integer tokens, never quoted decimal strings. */
|
|
25
|
+
function stringifyJson(value) {
|
|
26
|
+
return (0, lossless_json_1.stringify)(value, (_key, item) => {
|
|
27
|
+
if (typeof item === 'number' && (!Number.isFinite(item)
|
|
28
|
+
|| (Number.isInteger(item) && !Number.isSafeInteger(item)))) {
|
|
29
|
+
throw new TypeError('Use bigint for integers outside the safe number range');
|
|
30
|
+
}
|
|
31
|
+
return item;
|
|
32
|
+
}) ?? '';
|
|
33
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
type Slot = 'body' | 'headers' | 'path' | 'query';
|
|
2
|
+
export type Field = {
|
|
3
|
+
in: Exclude<Slot, 'body'>;
|
|
4
|
+
/**
|
|
5
|
+
* Field name. This is the name we want the user to see and use.
|
|
6
|
+
*/
|
|
7
|
+
key: string;
|
|
8
|
+
/**
|
|
9
|
+
* Field mapped name. This is the name we want to use in the request.
|
|
10
|
+
* If omitted, we use the same value as `key`.
|
|
11
|
+
*/
|
|
12
|
+
map?: string;
|
|
13
|
+
} | {
|
|
14
|
+
in: Extract<Slot, 'body'>;
|
|
15
|
+
/**
|
|
16
|
+
* Key isn't required for bodies.
|
|
17
|
+
*/
|
|
18
|
+
key?: string;
|
|
19
|
+
map?: string;
|
|
20
|
+
} | {
|
|
21
|
+
/**
|
|
22
|
+
* Field name. This is the name we want the user to see and use.
|
|
23
|
+
*/
|
|
24
|
+
key: string;
|
|
25
|
+
/**
|
|
26
|
+
* Field mapped name. This is the name we want to use in the request.
|
|
27
|
+
* If `in` is omitted, `map` aliases `key` to the transport layer.
|
|
28
|
+
*/
|
|
29
|
+
map: Slot;
|
|
30
|
+
};
|
|
31
|
+
export interface Fields {
|
|
32
|
+
allowExtra?: Partial<Record<Slot, boolean>>;
|
|
33
|
+
args?: ReadonlyArray<Field>;
|
|
34
|
+
}
|
|
35
|
+
export type FieldsConfig = ReadonlyArray<Field | Fields>;
|
|
36
|
+
interface Params {
|
|
37
|
+
body?: unknown;
|
|
38
|
+
headers: Record<string, unknown>;
|
|
39
|
+
path: Record<string, unknown>;
|
|
40
|
+
query: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export declare function buildClientParams(args: ReadonlyArray<unknown>, fields: FieldsConfig): Params;
|
|
43
|
+
export {};
|