@boxrouter/sdk 0.0.1-alpha.0 → 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/NOTICE +29 -5
- package/README.md +497 -24
- 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 +1 -1
- package/dist/client/client.gen.js +46 -94
- package/dist/client/index.d.ts +10 -10
- package/dist/client/index.js +16 -5
- package/dist/client/types.gen.d.ts +6 -6
- package/dist/client/types.gen.js +2 -1
- package/dist/client/utils.gen.d.ts +2 -2
- package/dist/client/utils.gen.js +31 -20
- package/dist/client.gen.d.ts +2 -2
- package/dist/client.gen.js +5 -2
- 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.js +5 -1
- package/dist/core/binaryStream.d.ts +8 -0
- package/dist/core/binaryStream.js +76 -0
- package/dist/core/bodySerializer.gen.d.ts +1 -1
- package/dist/core/bodySerializer.gen.js +8 -5
- 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.js +4 -1
- package/dist/core/pathSerializer.gen.js +20 -11
- package/dist/core/queryKeySerializer.gen.js +12 -6
- 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 +21 -62
- package/dist/core/serverSentEvents.gen.js +297 -116
- package/dist/core/streamErrors.d.ts +32 -0
- package/dist/core/streamErrors.js +51 -0
- package/dist/core/types.gen.d.ts +2 -2
- package/dist/core/types.gen.js +2 -1
- package/dist/core/utils.gen.d.ts +1 -1
- package/dist/core/utils.gen.js +16 -10
- 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 -2
- package/dist/index.js +79 -1
- 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 +2016 -12
- package/dist/sdk.gen.js +3862 -16
- 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 +14936 -110
- package/dist/types.gen.js +2 -1
- 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 +124 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Auth } from '../core/auth.gen
|
|
2
|
-
import type { ServerSentEventsOptions, ServerSentEventsResult } from '../core/serverSentEvents.gen
|
|
3
|
-
import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen
|
|
4
|
-
import type { Middleware } from './utils.gen
|
|
1
|
+
import type { Auth } from '../core/auth.gen';
|
|
2
|
+
import type { ServerSentEventsOptions, ServerSentEventsResult } from '../core/serverSentEvents.gen';
|
|
3
|
+
import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen';
|
|
4
|
+
import type { Middleware } from './utils.gen';
|
|
5
5
|
export type ResponseStyle = 'data' | 'fields';
|
|
6
6
|
export interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, CoreConfig {
|
|
7
7
|
/**
|
|
@@ -30,7 +30,7 @@ export interface Config<T extends ClientOptions = ClientOptions> extends Omit<Re
|
|
|
30
30
|
*
|
|
31
31
|
* @default 'auto'
|
|
32
32
|
*/
|
|
33
|
-
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
33
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'binaryStream' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
34
34
|
/**
|
|
35
35
|
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
36
36
|
*
|
|
@@ -47,7 +47,7 @@ export interface Config<T extends ClientOptions = ClientOptions> extends Omit<Re
|
|
|
47
47
|
export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
48
48
|
responseStyle: TResponseStyle;
|
|
49
49
|
throwOnError: ThrowOnError;
|
|
50
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | '
|
|
50
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseMaxBufferSize' | 'validateStreamEnd'> {
|
|
51
51
|
/**
|
|
52
52
|
* Any body that you want to add to your request.
|
|
53
53
|
*
|
package/dist/client/types.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QuerySerializerOptions } from '../core/bodySerializer.gen
|
|
2
|
-
import type { Client, ClientOptions, Config, RequestOptions } from './types.gen
|
|
1
|
+
import type { QuerySerializerOptions } from '../core/bodySerializer.gen';
|
|
2
|
+
import type { Client, ClientOptions, Config, RequestOptions } from './types.gen';
|
|
3
3
|
export declare const createQuerySerializer: <T = unknown>({ parameters, ...args }?: QuerySerializerOptions) => ((queryParams: T) => string);
|
|
4
4
|
/**
|
|
5
5
|
* Infers parseAs value from provided Content-Type header.
|
package/dist/client/utils.gen.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.createConfig = exports.createInterceptors = exports.mergeHeaders = exports.mergeConfigs = exports.buildUrl = exports.getParseAs = exports.createQuerySerializer = void 0;
|
|
5
|
+
exports.setAuthParams = setAuthParams;
|
|
6
|
+
const auth_gen_1 = require("../core/auth.gen");
|
|
7
|
+
const bodySerializer_gen_1 = require("../core/bodySerializer.gen");
|
|
8
|
+
const pathSerializer_gen_1 = require("../core/pathSerializer.gen");
|
|
9
|
+
const utils_gen_1 = require("../core/utils.gen");
|
|
10
|
+
const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
7
11
|
const querySerializer = (queryParams) => {
|
|
8
12
|
const search = [];
|
|
9
13
|
if (queryParams && typeof queryParams === 'object') {
|
|
@@ -14,7 +18,7 @@ export const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
|
14
18
|
}
|
|
15
19
|
const options = parameters[name] || args;
|
|
16
20
|
if (Array.isArray(value)) {
|
|
17
|
-
const serializedArray = serializeArrayParam({
|
|
21
|
+
const serializedArray = (0, pathSerializer_gen_1.serializeArrayParam)({
|
|
18
22
|
allowReserved: options.allowReserved,
|
|
19
23
|
explode: true,
|
|
20
24
|
name,
|
|
@@ -26,7 +30,7 @@ export const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
|
26
30
|
search.push(serializedArray);
|
|
27
31
|
}
|
|
28
32
|
else if (typeof value === 'object') {
|
|
29
|
-
const serializedObject = serializeObjectParam({
|
|
33
|
+
const serializedObject = (0, pathSerializer_gen_1.serializeObjectParam)({
|
|
30
34
|
allowReserved: options.allowReserved,
|
|
31
35
|
explode: true,
|
|
32
36
|
name,
|
|
@@ -38,7 +42,7 @@ export const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
|
38
42
|
search.push(serializedObject);
|
|
39
43
|
}
|
|
40
44
|
else {
|
|
41
|
-
const serializedPrimitive = serializePrimitiveParam({
|
|
45
|
+
const serializedPrimitive = (0, pathSerializer_gen_1.serializePrimitiveParam)({
|
|
42
46
|
allowReserved: options.allowReserved,
|
|
43
47
|
name,
|
|
44
48
|
value: value,
|
|
@@ -52,10 +56,11 @@ export const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
|
52
56
|
};
|
|
53
57
|
return querySerializer;
|
|
54
58
|
};
|
|
59
|
+
exports.createQuerySerializer = createQuerySerializer;
|
|
55
60
|
/**
|
|
56
61
|
* Infers parseAs value from provided Content-Type header.
|
|
57
62
|
*/
|
|
58
|
-
|
|
63
|
+
const getParseAs = (contentType) => {
|
|
59
64
|
if (!contentType) {
|
|
60
65
|
// If no Content-Type header is provided, the best we can do is return the raw response body,
|
|
61
66
|
// which is effectively the same as the 'stream' option.
|
|
@@ -79,6 +84,7 @@ export const getParseAs = (contentType) => {
|
|
|
79
84
|
}
|
|
80
85
|
return;
|
|
81
86
|
};
|
|
87
|
+
exports.getParseAs = getParseAs;
|
|
82
88
|
const checkForExistence = (options, name) => {
|
|
83
89
|
if (!name) {
|
|
84
90
|
return false;
|
|
@@ -90,12 +96,12 @@ const checkForExistence = (options, name) => {
|
|
|
90
96
|
}
|
|
91
97
|
return false;
|
|
92
98
|
};
|
|
93
|
-
|
|
99
|
+
async function setAuthParams(options) {
|
|
94
100
|
for (const auth of options.security ?? []) {
|
|
95
101
|
if (checkForExistence(options, auth.name)) {
|
|
96
102
|
continue;
|
|
97
103
|
}
|
|
98
|
-
const token = await getAuthToken(auth, options.auth);
|
|
104
|
+
const token = await (0, auth_gen_1.getAuthToken)(auth, options.auth);
|
|
99
105
|
if (!token) {
|
|
100
106
|
continue;
|
|
101
107
|
}
|
|
@@ -117,23 +123,25 @@ export async function setAuthParams(options) {
|
|
|
117
123
|
}
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
|
-
|
|
126
|
+
const buildUrl = (options) => (0, utils_gen_1.getUrl)({
|
|
121
127
|
baseUrl: options.baseUrl,
|
|
122
128
|
path: options.path,
|
|
123
129
|
query: options.query,
|
|
124
130
|
querySerializer: typeof options.querySerializer === 'function'
|
|
125
131
|
? options.querySerializer
|
|
126
|
-
: createQuerySerializer(options.querySerializer),
|
|
132
|
+
: (0, exports.createQuerySerializer)(options.querySerializer),
|
|
127
133
|
url: options.url,
|
|
128
134
|
});
|
|
129
|
-
|
|
135
|
+
exports.buildUrl = buildUrl;
|
|
136
|
+
const mergeConfigs = (a, b) => {
|
|
130
137
|
const config = { ...a, ...b };
|
|
131
138
|
if (config.baseUrl?.endsWith('/')) {
|
|
132
139
|
config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
|
133
140
|
}
|
|
134
|
-
config.headers = mergeHeaders(a.headers, b.headers);
|
|
141
|
+
config.headers = (0, exports.mergeHeaders)(a.headers, b.headers);
|
|
135
142
|
return config;
|
|
136
143
|
};
|
|
144
|
+
exports.mergeConfigs = mergeConfigs;
|
|
137
145
|
const headersEntries = (headers) => {
|
|
138
146
|
const entries = [];
|
|
139
147
|
headers.forEach((value, key) => {
|
|
@@ -141,7 +149,7 @@ const headersEntries = (headers) => {
|
|
|
141
149
|
});
|
|
142
150
|
return entries;
|
|
143
151
|
};
|
|
144
|
-
|
|
152
|
+
const mergeHeaders = (...headers) => {
|
|
145
153
|
const mergedHeaders = new Headers();
|
|
146
154
|
for (const header of headers) {
|
|
147
155
|
if (!header) {
|
|
@@ -166,6 +174,7 @@ export const mergeHeaders = (...headers) => {
|
|
|
166
174
|
}
|
|
167
175
|
return mergedHeaders;
|
|
168
176
|
};
|
|
177
|
+
exports.mergeHeaders = mergeHeaders;
|
|
169
178
|
class Interceptors {
|
|
170
179
|
fns = [];
|
|
171
180
|
clear() {
|
|
@@ -200,12 +209,13 @@ class Interceptors {
|
|
|
200
209
|
return this.fns.length - 1;
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
|
-
|
|
212
|
+
const createInterceptors = () => ({
|
|
204
213
|
error: new Interceptors(),
|
|
205
214
|
request: new Interceptors(),
|
|
206
215
|
response: new Interceptors(),
|
|
207
216
|
});
|
|
208
|
-
|
|
217
|
+
exports.createInterceptors = createInterceptors;
|
|
218
|
+
const defaultQuerySerializer = (0, exports.createQuerySerializer)({
|
|
209
219
|
allowReserved: false,
|
|
210
220
|
array: {
|
|
211
221
|
explode: true,
|
|
@@ -219,10 +229,11 @@ const defaultQuerySerializer = createQuerySerializer({
|
|
|
219
229
|
const defaultHeaders = {
|
|
220
230
|
'Content-Type': 'application/json',
|
|
221
231
|
};
|
|
222
|
-
|
|
223
|
-
...jsonBodySerializer,
|
|
232
|
+
const createConfig = (override = {}) => ({
|
|
233
|
+
...bodySerializer_gen_1.jsonBodySerializer,
|
|
224
234
|
headers: defaultHeaders,
|
|
225
235
|
parseAs: 'auto',
|
|
226
236
|
querySerializer: defaultQuerySerializer,
|
|
227
237
|
...override,
|
|
228
238
|
});
|
|
239
|
+
exports.createConfig = createConfig;
|
package/dist/client.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Client, type ClientOptions, type Config } from './client
|
|
2
|
-
import type { ClientOptions as ClientOptions2 } from './types.gen
|
|
1
|
+
import { type Client, type ClientOptions, type Config } from './client';
|
|
2
|
+
import type { ClientOptions as ClientOptions2 } from './types.gen';
|
|
3
3
|
/**
|
|
4
4
|
* The `createClientConfig()` function will be called on client initialization
|
|
5
5
|
* and the returned object will become the client's initial configuration.
|
package/dist/client.gen.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.client = void 0;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
exports.client = (0, client_1.createClient)((0, client_1.createConfig)({ baseUrl: '/api/v1', throwOnError: true }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandBytesResult } from './sandboxes';
|
|
2
|
+
import type { CommandResult } from './types.gen';
|
|
3
|
+
type Result = CommandResult | CommandBytesResult;
|
|
4
|
+
/** A command's result failed the check it was asked for; the result is on `result`. */
|
|
5
|
+
export declare class CommandFailed extends Error {
|
|
6
|
+
readonly result: Result;
|
|
7
|
+
constructor(result: Result);
|
|
8
|
+
get exit_code(): Result['exit_code'];
|
|
9
|
+
get stdout(): Result['stdout'];
|
|
10
|
+
get stderr(): Result['stderr'];
|
|
11
|
+
get timed_out(): Result['timed_out'];
|
|
12
|
+
}
|
|
13
|
+
export declare function checkedCommand<T extends Result>(result: T, check: boolean | undefined): T;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandFailed = void 0;
|
|
4
|
+
exports.checkedCommand = checkedCommand;
|
|
5
|
+
/** A command's result failed the check it was asked for; the result is on `result`. */
|
|
6
|
+
class CommandFailed extends Error {
|
|
7
|
+
result;
|
|
8
|
+
constructor(result) {
|
|
9
|
+
super(`Command failed: exit_code=${result.exit_code}, timed_out=${result.timed_out}`);
|
|
10
|
+
this.result = result;
|
|
11
|
+
this.name = 'CommandFailed';
|
|
12
|
+
}
|
|
13
|
+
get exit_code() { return this.result.exit_code; }
|
|
14
|
+
get stdout() { return this.result.stdout; }
|
|
15
|
+
get stderr() { return this.result.stderr; }
|
|
16
|
+
get timed_out() { return this.result.timed_out; }
|
|
17
|
+
}
|
|
18
|
+
exports.CommandFailed = CommandFailed;
|
|
19
|
+
function checkedCommand(result, check) {
|
|
20
|
+
if (check && (result.exit_code !== 0 || result.timed_out))
|
|
21
|
+
throw new CommandFailed(result);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RunCommand, StartProcess, CreateSandbox } from './types.gen';
|
|
2
|
+
export declare function validateCommand(value: RunCommand): void;
|
|
3
|
+
export declare function validateProcess(value: StartProcess): void;
|
|
4
|
+
export declare function validateCreation(value: Partial<Pick<CreateSandbox, 'preferences'>>): void;
|
|
5
|
+
export declare function validateLaunchRun(value: unknown): void;
|
|
6
|
+
export declare function validateLaunchInputs(value: unknown): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validateCommand = validateCommand;
|
|
7
|
+
exports.validateProcess = validateProcess;
|
|
8
|
+
exports.validateCreation = validateCreation;
|
|
9
|
+
exports.validateLaunchRun = validateLaunchRun;
|
|
10
|
+
exports.validateLaunchInputs = validateLaunchInputs;
|
|
11
|
+
const commandValidators_cjs_1 = __importDefault(require("./core/commandValidators.cjs"));
|
|
12
|
+
function validateCommand(value) {
|
|
13
|
+
if (!commandValidators_cjs_1.default.command(value.command))
|
|
14
|
+
throw new TypeError("Command must not contain NUL bytes");
|
|
15
|
+
if (value.env !== undefined && !commandValidators_cjs_1.default.env(value.env))
|
|
16
|
+
throw new TypeError("Command env requires valid shell variable names and values without NUL");
|
|
17
|
+
if (value.cwd !== undefined && !commandValidators_cjs_1.default.cwd(value.cwd))
|
|
18
|
+
throw new TypeError("Command cwd must be an absolute sandbox path without NUL bytes");
|
|
19
|
+
if (value.timeout_seconds !== undefined && !commandValidators_cjs_1.default.timeout_seconds(value.timeout_seconds))
|
|
20
|
+
throw new TypeError("Command timeout_seconds must be a positive integer");
|
|
21
|
+
if (value.output !== undefined && !commandValidators_cjs_1.default.output(value.output))
|
|
22
|
+
throw new TypeError("Invalid command field: output");
|
|
23
|
+
if (value.output_limit_bytes !== undefined && !commandValidators_cjs_1.default.output_limit_bytes(value.output_limit_bytes))
|
|
24
|
+
throw new TypeError("Invalid command field: output_limit_bytes");
|
|
25
|
+
}
|
|
26
|
+
function validateProcess(value) {
|
|
27
|
+
if (!commandValidators_cjs_1.default.process_command(value.command))
|
|
28
|
+
throw new TypeError("Command must not contain NUL bytes");
|
|
29
|
+
if (value.env !== undefined && !commandValidators_cjs_1.default.process_env(value.env))
|
|
30
|
+
throw new TypeError("Command env requires valid shell variable names and values without NUL");
|
|
31
|
+
if (value.cwd !== undefined && !commandValidators_cjs_1.default.process_cwd(value.cwd))
|
|
32
|
+
throw new TypeError("Command cwd must be an absolute sandbox path without NUL bytes");
|
|
33
|
+
if (value.stdin !== undefined && !commandValidators_cjs_1.default.process_stdin(value.stdin))
|
|
34
|
+
throw new TypeError("Invalid process field: stdin");
|
|
35
|
+
if (value.wait_for_port !== undefined && !commandValidators_cjs_1.default.process_wait_for_port(value.wait_for_port))
|
|
36
|
+
throw new TypeError("Invalid process field: wait_for_port");
|
|
37
|
+
}
|
|
38
|
+
function validateCreation(value) {
|
|
39
|
+
if (value.preferences !== undefined && !commandValidators_cjs_1.default.creation_preferences(value.preferences))
|
|
40
|
+
throw new TypeError("Invalid creation field: preferences");
|
|
41
|
+
}
|
|
42
|
+
function validateLaunchRun(value) { if (!commandValidators_cjs_1.default.launch_run(value))
|
|
43
|
+
throw new TypeError('Invalid LaunchRunRequest'); }
|
|
44
|
+
function validateLaunchInputs(value) { if (!commandValidators_cjs_1.default.launch_inputs(value))
|
|
45
|
+
throw new TypeError('Invalid launch input'); }
|
package/dist/core/auth.gen.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getAuthToken = void 0;
|
|
5
|
+
const getAuthToken = async (auth, callback) => {
|
|
3
6
|
const token = typeof callback === 'function' ? await callback(auth) : callback;
|
|
4
7
|
if (!token) {
|
|
5
8
|
return;
|
|
@@ -12,3 +15,4 @@ export const getAuthToken = async (auth, callback) => {
|
|
|
12
15
|
}
|
|
13
16
|
return token;
|
|
14
17
|
};
|
|
18
|
+
exports.getAuthToken = getAuthToken;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RequestTrace } from '../telemetry';
|
|
2
|
+
type StreamBody<T> = T extends Blob ? ReadableStream<Uint8Array> : T;
|
|
3
|
+
export type BinaryStreamResponses<T> = {
|
|
4
|
+
[Status in keyof T]: StreamBody<T[Status]>;
|
|
5
|
+
};
|
|
6
|
+
/** Retain mutation identity and observe consumption without prefetching bytes. */
|
|
7
|
+
export declare function binaryStream(body: ReadableStream<Uint8Array> | null, response: Response, request: Request, telemetry: RequestTrace): ReadableStream<Uint8Array>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.binaryStream = binaryStream;
|
|
4
|
+
const api_error_1 = require("../api-error");
|
|
5
|
+
const telemetry_1 = require("../telemetry");
|
|
6
|
+
/** Retain mutation identity and observe consumption without prefetching bytes. */
|
|
7
|
+
function binaryStream(body, response, request, telemetry) {
|
|
8
|
+
const reader = body?.getReader();
|
|
9
|
+
let ended = false;
|
|
10
|
+
let bytes = 0;
|
|
11
|
+
let abort;
|
|
12
|
+
telemetry.finishObserverOutcome('success');
|
|
13
|
+
telemetry.streaming = true;
|
|
14
|
+
telemetry.startStreamLifetime();
|
|
15
|
+
const finish = (outcome, reason) => {
|
|
16
|
+
if (ended)
|
|
17
|
+
return;
|
|
18
|
+
ended = true;
|
|
19
|
+
request.signal.removeEventListener('abort', abort);
|
|
20
|
+
telemetry.span.setAttribute('boxrouter.stream.bytes', bytes);
|
|
21
|
+
telemetry.span.setAttribute('boxrouter.stream.end', outcome);
|
|
22
|
+
if (outcome === 'error')
|
|
23
|
+
telemetry.error(reason);
|
|
24
|
+
telemetry.finishStreamLifetime(outcome === 'completed' ? 'success'
|
|
25
|
+
: outcome === 'cancelled' ? 'stream_cancelled' : 'stream_error');
|
|
26
|
+
telemetry.span.end();
|
|
27
|
+
};
|
|
28
|
+
const release = async () => {
|
|
29
|
+
if (!reader)
|
|
30
|
+
return;
|
|
31
|
+
await reader.cancel().catch(() => { });
|
|
32
|
+
reader.releaseLock();
|
|
33
|
+
};
|
|
34
|
+
return new ReadableStream({
|
|
35
|
+
start(controller) {
|
|
36
|
+
abort = () => {
|
|
37
|
+
if (ended)
|
|
38
|
+
return;
|
|
39
|
+
const reason = request.signal.reason;
|
|
40
|
+
finish(reason instanceof DOMException && reason.name === 'AbortError' ? 'cancelled' : 'error', reason);
|
|
41
|
+
controller.error((0, api_error_1.invalidResponse)(response, request));
|
|
42
|
+
void release();
|
|
43
|
+
};
|
|
44
|
+
request.signal.addEventListener('abort', abort, { once: true });
|
|
45
|
+
if (request.signal.aborted)
|
|
46
|
+
abort();
|
|
47
|
+
},
|
|
48
|
+
async pull(controller) {
|
|
49
|
+
try {
|
|
50
|
+
const next = await reader?.read();
|
|
51
|
+
if (ended)
|
|
52
|
+
return;
|
|
53
|
+
if (!next || next.done) {
|
|
54
|
+
finish('completed');
|
|
55
|
+
reader?.releaseLock();
|
|
56
|
+
controller.close();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
bytes += next.value.byteLength;
|
|
60
|
+
controller.enqueue(next.value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (ended)
|
|
65
|
+
return;
|
|
66
|
+
finish('error', error);
|
|
67
|
+
controller.error((0, api_error_1.invalidResponse)(response, request));
|
|
68
|
+
await release();
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
async cancel(reason) {
|
|
72
|
+
finish((0, telemetry_1.isTimeoutError)(reason) ? 'error' : 'cancelled', reason);
|
|
73
|
+
await release();
|
|
74
|
+
},
|
|
75
|
+
}, { highWaterMark: 0 });
|
|
76
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen
|
|
1
|
+
import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen';
|
|
2
2
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
3
3
|
export type BodySerializer = (body: unknown) => unknown;
|
|
4
4
|
type QuerySerializerOptionsObject = {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.urlSearchParamsBodySerializer = exports.jsonBodySerializer = exports.formDataBodySerializer = void 0;
|
|
4
|
+
const json_1 = require("./json");
|
|
2
5
|
const serializeFormDataPair = (data, key, value) => {
|
|
3
6
|
if (typeof value === 'string' || value instanceof Blob) {
|
|
4
7
|
data.append(key, value);
|
|
@@ -18,7 +21,7 @@ const serializeUrlSearchParamsPair = (data, key, value) => {
|
|
|
18
21
|
data.append(key, JSON.stringify(value));
|
|
19
22
|
}
|
|
20
23
|
};
|
|
21
|
-
|
|
24
|
+
exports.formDataBodySerializer = {
|
|
22
25
|
bodySerializer: (body) => {
|
|
23
26
|
const data = new FormData();
|
|
24
27
|
Object.entries(body).forEach(([key, value]) => {
|
|
@@ -35,10 +38,10 @@ export const formDataBodySerializer = {
|
|
|
35
38
|
return data;
|
|
36
39
|
},
|
|
37
40
|
};
|
|
38
|
-
|
|
39
|
-
bodySerializer: (body) =>
|
|
41
|
+
exports.jsonBodySerializer = {
|
|
42
|
+
bodySerializer: (body) => (0, json_1.stringifyJson)(body),
|
|
40
43
|
};
|
|
41
|
-
|
|
44
|
+
exports.urlSearchParamsBodySerializer = {
|
|
42
45
|
bodySerializer: (body) => {
|
|
43
46
|
const data = new URLSearchParams();
|
|
44
47
|
Object.entries(body).forEach(([key, value]) => {
|