@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,241 @@
|
|
|
1
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
2
|
+
export class ProviderAccounts extends HeyApiClient {
|
|
3
|
+
/**
|
|
4
|
+
* List connected accounts
|
|
5
|
+
*
|
|
6
|
+
* Requires `provider-accounts:manage` on API keys; dashboard browser sessions are also
|
|
7
|
+
* authorized. Returns your workspace's account metadata and the list of providers enabled for you;
|
|
8
|
+
* it never returns stored credentials.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
list(options) {
|
|
12
|
+
return (options?.client ?? this.client).get({
|
|
13
|
+
responseStyle: 'data',
|
|
14
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
15
|
+
in: 'cookie',
|
|
16
|
+
name: '__Host-boxrouter_session',
|
|
17
|
+
type: 'apiKey'
|
|
18
|
+
}],
|
|
19
|
+
url: '/provider-accounts',
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Connect a provider account
|
|
25
|
+
*
|
|
26
|
+
* Saves your own provider credentials so BoxRouter can run sandboxes on that account. Needs
|
|
27
|
+
* the `provider-accounts:manage` permission on the API key; a signed-in dashboard session also
|
|
28
|
+
* works. This permission is separate from the access that creates sandboxes.
|
|
29
|
+
*
|
|
30
|
+
* BoxRouter first makes one read-only request to the provider with the credentials. A clear
|
|
31
|
+
* rejection fails with `422 credentials_rejected`; an unreachable provider or an inconclusive
|
|
32
|
+
* answer does not block the save. The credentials are then stored encrypted and never
|
|
33
|
+
* returned. The account is enabled at once. Connecting starts no sandbox and prepares
|
|
34
|
+
* nothing in your provider account: the first sandbox that needs the standard image
|
|
35
|
+
* prepares it, or run the standard image setup to prepare it now.
|
|
36
|
+
*
|
|
37
|
+
* If the key matches one you already connected (same provider, settings and last four
|
|
38
|
+
* characters), the account is still connected and the response carries a
|
|
39
|
+
* `duplicate_credential` warning naming the other account. Connecting or testing an account
|
|
40
|
+
* whose provider is not enabled for you fails with `409 provider_not_enabled`.
|
|
41
|
+
*
|
|
42
|
+
* Provider connection settings, such as a custom URL or proxy, and credentials that run your
|
|
43
|
+
* code need extra authority on the key. Submitting a URL or proxy does not by itself give
|
|
44
|
+
* BoxRouter network access to that host. For credentials that run your code, send the ID of an
|
|
45
|
+
* artifact you uploaded; an unknown or expired artifact fails with `404`. The response
|
|
46
|
+
* returns account metadata only, never the code, configuration or tokens. Sending the same
|
|
47
|
+
* request again reuses the recorded outcome, and a request still waiting on the provider
|
|
48
|
+
* fails with `409` instead of running your code a second time.
|
|
49
|
+
*
|
|
50
|
+
* If the provider later answers with `401` or `403`, the account's status becomes
|
|
51
|
+
* `credentials_rejected`; the status carries a safe cause and the action that restores access.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
connect(options) {
|
|
55
|
+
return (options.client ?? this.client).post({
|
|
56
|
+
responseStyle: 'data',
|
|
57
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
58
|
+
in: 'cookie',
|
|
59
|
+
name: '__Host-boxrouter_session',
|
|
60
|
+
type: 'apiKey'
|
|
61
|
+
}],
|
|
62
|
+
url: '/provider-accounts',
|
|
63
|
+
...options,
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Type': 'application/json',
|
|
66
|
+
...options.headers
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Test provider credentials without saving them
|
|
72
|
+
*
|
|
73
|
+
* Checks credentials without saving them. Needs the `provider-accounts:manage` permission on
|
|
74
|
+
* the API key; a signed-in dashboard session also works. BoxRouter makes the same read-only
|
|
75
|
+
* request to the provider as when it tests a saved account, using the credentials in the body.
|
|
76
|
+
* Nothing is stored and no account is created or changed, so no idempotency key is needed.
|
|
77
|
+
*
|
|
78
|
+
* Credentials that run your code are not accepted here. Connection settings, such as a custom
|
|
79
|
+
* URL, are accepted and choose where the request goes; they need extra authority on the key,
|
|
80
|
+
* and submitting a URL or proxy does not by itself give BoxRouter network access to that host.
|
|
81
|
+
* The response returns the provider's own status and body, up to 4096 characters, without
|
|
82
|
+
* adding a validation message.
|
|
83
|
+
*
|
|
84
|
+
* Fails with `409 provider_not_enabled` when this provider is not enabled for you.
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
testCredentials(options) {
|
|
88
|
+
return (options.client ?? this.client).post({
|
|
89
|
+
responseStyle: 'data',
|
|
90
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
91
|
+
in: 'cookie',
|
|
92
|
+
name: '__Host-boxrouter_session',
|
|
93
|
+
type: 'apiKey'
|
|
94
|
+
}],
|
|
95
|
+
url: '/provider-accounts/test',
|
|
96
|
+
...options,
|
|
97
|
+
headers: {
|
|
98
|
+
'Content-Type': 'application/json',
|
|
99
|
+
...options.headers
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Remove a connected account
|
|
105
|
+
*
|
|
106
|
+
* Requires `provider-accounts:manage` on API keys; dashboard browser sessions are also
|
|
107
|
+
* authorized. Reject with 409 while owned
|
|
108
|
+
* resources, pending mutations or unresolved cleanup still depend on this
|
|
109
|
+
* credential. Never orphan sandboxes silently or transfer them to managed
|
|
110
|
+
* billing. Removes the stored secret; does not revoke the upstream token.
|
|
111
|
+
* For callable credentials, close all unreferenced factory workers and remove
|
|
112
|
+
* their retained code/configuration and acquired secrets. Pending acquisitions
|
|
113
|
+
* and retained credential-version dependencies also prevent disconnection.
|
|
114
|
+
*
|
|
115
|
+
* Removal waits for work already running on the account (standard-image setup,
|
|
116
|
+
* Actions runner-image checks), which can take minutes. With `wait=false` the
|
|
117
|
+
* request returns 202 at once with the account and `disconnect.state:
|
|
118
|
+
* disconnecting`, and finishes in the background: read the account until it
|
|
119
|
+
* returns 404 (removed) or `disconnect.state: failed`, whose `error` is the
|
|
120
|
+
* refusal this request would otherwise have returned, with the account still
|
|
121
|
+
* connected. Repeating the request while a removal runs returns the same 202 and
|
|
122
|
+
* starts nothing new.
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
disconnect(options) {
|
|
126
|
+
return (options.client ?? this.client).delete({
|
|
127
|
+
responseStyle: 'data',
|
|
128
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
129
|
+
in: 'cookie',
|
|
130
|
+
name: '__Host-boxrouter_session',
|
|
131
|
+
type: 'apiKey'
|
|
132
|
+
}],
|
|
133
|
+
url: '/provider-accounts/{account_id}',
|
|
134
|
+
...options
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get connected-account metadata
|
|
139
|
+
*
|
|
140
|
+
* Requires `provider-accounts:manage` on API keys; dashboard browser sessions are also
|
|
141
|
+
* authorized. The account must be visible within the caller's workspace. Never reveals
|
|
142
|
+
* key material.
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
get(options) {
|
|
146
|
+
return (options.client ?? this.client).get({
|
|
147
|
+
responseStyle: 'data',
|
|
148
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
149
|
+
in: 'cookie',
|
|
150
|
+
name: '__Host-boxrouter_session',
|
|
151
|
+
type: 'apiKey'
|
|
152
|
+
}],
|
|
153
|
+
url: '/provider-accounts/{account_id}',
|
|
154
|
+
...options
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Rotate a connected account's credentials
|
|
159
|
+
*
|
|
160
|
+
* Replaces a connected account's credentials, for example to rotate a key. Needs the
|
|
161
|
+
* `provider-accounts:manage` permission on the API key (a signed-in dashboard session also
|
|
162
|
+
* works) and the account's current `expected_version`.
|
|
163
|
+
*
|
|
164
|
+
* The new credentials must belong to the same provider. BoxRouter makes one read-only request
|
|
165
|
+
* to the provider and refuses a clear rejection with `422 credentials_rejected`; it does not
|
|
166
|
+
* check which account the key belongs to. Requests already running keep the old credentials,
|
|
167
|
+
* and requests that start afterward use the new ones. A provider that is not enabled for you
|
|
168
|
+
* fails with `409 provider_not_enabled`.
|
|
169
|
+
*
|
|
170
|
+
* Leave out the connection settings to keep the existing ones. Settings you send must match the
|
|
171
|
+
* existing route; changing the endpoint, proxy or header identity needs a new connected
|
|
172
|
+
* account, not a key rotation. Credentials that run your code need extra authority on the key
|
|
173
|
+
* and an artifact you uploaded. If the new credentials fail to activate, the old version stays
|
|
174
|
+
* in use. A token refresh that already happened with the provider is not undone.
|
|
175
|
+
*
|
|
176
|
+
*/
|
|
177
|
+
replaceCredentials(options) {
|
|
178
|
+
return (options.client ?? this.client).put({
|
|
179
|
+
responseStyle: 'data',
|
|
180
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
181
|
+
in: 'cookie',
|
|
182
|
+
name: '__Host-boxrouter_session',
|
|
183
|
+
type: 'apiKey'
|
|
184
|
+
}],
|
|
185
|
+
url: '/provider-accounts/{account_id}/credentials',
|
|
186
|
+
...options,
|
|
187
|
+
headers: {
|
|
188
|
+
'Content-Type': 'application/json',
|
|
189
|
+
...options.headers
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Test a saved provider account
|
|
195
|
+
*
|
|
196
|
+
* Requires `provider-accounts:manage` on API keys; dashboard browser sessions are also
|
|
197
|
+
* authorized. The credential check makes one read-only provider request using the saved
|
|
198
|
+
* credentials and returns the provider's native status and body, limited to 4096 characters.
|
|
199
|
+
* A successful test can update account health and register provider event webhooks. It
|
|
200
|
+
* starts no sandbox and prepares no image; run the standard image setup to prepare the
|
|
201
|
+
* standard image before the first sandbox needs it. The response reports the credential
|
|
202
|
+
* check.
|
|
203
|
+
* Fails with `409 provider_not_enabled` when this provider is not enabled for you.
|
|
204
|
+
*
|
|
205
|
+
*/
|
|
206
|
+
test(options) {
|
|
207
|
+
return (options.client ?? this.client).post({
|
|
208
|
+
responseStyle: 'data',
|
|
209
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
210
|
+
in: 'cookie',
|
|
211
|
+
name: '__Host-boxrouter_session',
|
|
212
|
+
type: 'apiKey'
|
|
213
|
+
}],
|
|
214
|
+
url: '/provider-accounts/{account_id}/test',
|
|
215
|
+
...options
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Run the standard image setup proof
|
|
220
|
+
*
|
|
221
|
+
* Requires `provider-accounts:manage` on API keys; dashboard browser sessions are also
|
|
222
|
+
* authorized. This explicit action first tests the saved key, then boots the provider's
|
|
223
|
+
* standard image, runs a bounded command, and destroys the proof sandbox. The provider
|
|
224
|
+
* may charge for that short sandbox. Readiness is recorded only after boot, command and
|
|
225
|
+
* cleanup succeed; failure returns the unavailable state and its setup fix. Requests are
|
|
226
|
+
* idempotent and must include an idempotency key.
|
|
227
|
+
*
|
|
228
|
+
*/
|
|
229
|
+
setupStandardImage(options) {
|
|
230
|
+
return (options.client ?? this.client).post({
|
|
231
|
+
responseStyle: 'data',
|
|
232
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
233
|
+
in: 'cookie',
|
|
234
|
+
name: '__Host-boxrouter_session',
|
|
235
|
+
type: 'apiKey'
|
|
236
|
+
}],
|
|
237
|
+
url: '/provider-accounts/{account_id}/standard-image/setup',
|
|
238
|
+
...options
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
2
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
3
|
+
import type { ProvidersListData, ProvidersListErrors, ProvidersListResponses } from './types.gen.js';
|
|
4
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
5
|
+
/**
|
|
6
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
7
|
+
* individual options. This might be also useful if you want to implement a
|
|
8
|
+
* custom client.
|
|
9
|
+
*/
|
|
10
|
+
client?: Client;
|
|
11
|
+
/**
|
|
12
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
13
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
14
|
+
*/
|
|
15
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
16
|
+
};
|
|
17
|
+
export declare class Providers extends HeyApiClient {
|
|
18
|
+
/**
|
|
19
|
+
* List available provider routes
|
|
20
|
+
*
|
|
21
|
+
* Returns only supply visible to the caller, including account-specific
|
|
22
|
+
* entitlements and limits. This is a point-in-time eligibility view, not a
|
|
23
|
+
* capacity reservation. Unknown or unverified capability guarantees are not
|
|
24
|
+
* advertised as supported. Server-side eligibility is rechecked at creation.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
list<ThrowOnError extends boolean = true>(options?: Options<ProvidersListData, ThrowOnError>): RequestResult<ProvidersListResponses, ProvidersListErrors, ThrowOnError, 'data'>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
2
|
+
export class Providers extends HeyApiClient {
|
|
3
|
+
/**
|
|
4
|
+
* List available provider routes
|
|
5
|
+
*
|
|
6
|
+
* Returns only supply visible to the caller, including account-specific
|
|
7
|
+
* entitlements and limits. This is a point-in-time eligibility view, not a
|
|
8
|
+
* capacity reservation. Unknown or unverified capability guarantees are not
|
|
9
|
+
* advertised as supported. Server-side eligibility is rechecked at creation.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
list(options) {
|
|
13
|
+
return (options?.client ?? this.client).get({
|
|
14
|
+
responseStyle: 'data',
|
|
15
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
16
|
+
in: 'cookie',
|
|
17
|
+
name: '__Host-boxrouter_session',
|
|
18
|
+
type: 'apiKey'
|
|
19
|
+
}],
|
|
20
|
+
url: '/providers',
|
|
21
|
+
...options
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
2
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
3
|
+
import type { RoutingPreviewData, RoutingPreviewErrors, RoutingPreviewResponses, RoutingSettingsData, RoutingSettingsErrors, RoutingSettingsResponses, RoutingUpdateSettingsData, RoutingUpdateSettingsErrors, RoutingUpdateSettingsResponses } from './types.gen.js';
|
|
4
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
5
|
+
/**
|
|
6
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
7
|
+
* individual options. This might be also useful if you want to implement a
|
|
8
|
+
* custom client.
|
|
9
|
+
*/
|
|
10
|
+
client?: Client;
|
|
11
|
+
/**
|
|
12
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
13
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
14
|
+
*/
|
|
15
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
16
|
+
};
|
|
17
|
+
export declare class Routing extends HeyApiClient {
|
|
18
|
+
/**
|
|
19
|
+
* Read workspace routing and provider funding
|
|
20
|
+
*
|
|
21
|
+
* Workspace read authority required. Returns each independently versioned section
|
|
22
|
+
* and its opaque ETag in section_etags. Never returns credentials. The GET itself
|
|
23
|
+
* has no whole-document validator; send a chosen section's token in If-Match to
|
|
24
|
+
* guard a write to that section.
|
|
25
|
+
* On a workspace's first read, the server atomically creates sections from its
|
|
26
|
+
* legacy funding state. Concurrent first reads return the same persisted sections
|
|
27
|
+
* and ETags. Later reads do not change settings unless a supported provider,
|
|
28
|
+
* managed offer or connected account changed and needs reconciliation; only a
|
|
29
|
+
* section that actually changes advances its ETag. The saved Prevent Overrides
|
|
30
|
+
* switch is retained across reads.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
settings<ThrowOnError extends boolean = true>(options?: Options<RoutingSettingsData, ThrowOnError>): RequestResult<RoutingSettingsResponses, RoutingSettingsErrors, ThrowOnError, 'data'>;
|
|
34
|
+
/**
|
|
35
|
+
* Update one workspace routing section
|
|
36
|
+
*
|
|
37
|
+
* Workspace admin (or provider-accounts:manage for provider funding) required;
|
|
38
|
+
* browser mutations also require Origin and X-CSRF-Token. The body names exactly
|
|
39
|
+
* one section: routing fields or one provider funding section. Send only the fields
|
|
40
|
+
* to change; every omitted field keeps its stored value, and the merged section is
|
|
41
|
+
* validated as a complete section before it is written. If-Match is optional. When
|
|
42
|
+
* sent, it must be the opaque token returned for THAT section by GET or the call
|
|
43
|
+
* fails 412 with no write; when omitted, the named fields are written to the
|
|
44
|
+
* current section. Atomically update only the named section and advance only its
|
|
45
|
+
* ETag. A stale token for that same section returns 412 with no write; a concurrent
|
|
46
|
+
* Routing edit cannot conflict with provider funding, and edits to distinct
|
|
47
|
+
* providers cannot conflict with one another. Reject duplicate account IDs,
|
|
48
|
+
* foreign/wrong-provider accounts and newly enabled Credits on unavailable managed
|
|
49
|
+
* providers before writing. Adding a key does not change provider exclusion.
|
|
50
|
+
* Identical idempotency replay returns the previously recorded response, not a
|
|
51
|
+
* second write.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
updateSettings<ThrowOnError extends boolean = true>(options: Options<RoutingUpdateSettingsData, ThrowOnError>): RequestResult<RoutingUpdateSettingsResponses, RoutingUpdateSettingsErrors, ThrowOnError, 'data'>;
|
|
55
|
+
/**
|
|
56
|
+
* Preview workspace route availability without dispatch
|
|
57
|
+
*
|
|
58
|
+
* Workspace read authority required. Side-effect-free current eligibility and
|
|
59
|
+
* versioned hold quotes from admission. No next-job prediction, workspace spend
|
|
60
|
+
* cap or promise that a later create can start. No secret or foreign balance.
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
preview<ThrowOnError extends boolean = true>(options?: Options<RoutingPreviewData, ThrowOnError>): RequestResult<RoutingPreviewResponses, RoutingPreviewErrors, ThrowOnError, 'data'>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
2
|
+
export class Routing extends HeyApiClient {
|
|
3
|
+
/**
|
|
4
|
+
* Read workspace routing and provider funding
|
|
5
|
+
*
|
|
6
|
+
* Workspace read authority required. Returns each independently versioned section
|
|
7
|
+
* and its opaque ETag in section_etags. Never returns credentials. The GET itself
|
|
8
|
+
* has no whole-document validator; send a chosen section's token in If-Match to
|
|
9
|
+
* guard a write to that section.
|
|
10
|
+
* On a workspace's first read, the server atomically creates sections from its
|
|
11
|
+
* legacy funding state. Concurrent first reads return the same persisted sections
|
|
12
|
+
* and ETags. Later reads do not change settings unless a supported provider,
|
|
13
|
+
* managed offer or connected account changed and needs reconciliation; only a
|
|
14
|
+
* section that actually changes advances its ETag. The saved Prevent Overrides
|
|
15
|
+
* switch is retained across reads.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
settings(options) {
|
|
19
|
+
return (options?.client ?? this.client).get({
|
|
20
|
+
responseStyle: 'data',
|
|
21
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
22
|
+
in: 'cookie',
|
|
23
|
+
name: '__Host-boxrouter_session',
|
|
24
|
+
type: 'apiKey'
|
|
25
|
+
}],
|
|
26
|
+
url: '/routing/settings',
|
|
27
|
+
...options
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Update one workspace routing section
|
|
32
|
+
*
|
|
33
|
+
* Workspace admin (or provider-accounts:manage for provider funding) required;
|
|
34
|
+
* browser mutations also require Origin and X-CSRF-Token. The body names exactly
|
|
35
|
+
* one section: routing fields or one provider funding section. Send only the fields
|
|
36
|
+
* to change; every omitted field keeps its stored value, and the merged section is
|
|
37
|
+
* validated as a complete section before it is written. If-Match is optional. When
|
|
38
|
+
* sent, it must be the opaque token returned for THAT section by GET or the call
|
|
39
|
+
* fails 412 with no write; when omitted, the named fields are written to the
|
|
40
|
+
* current section. Atomically update only the named section and advance only its
|
|
41
|
+
* ETag. A stale token for that same section returns 412 with no write; a concurrent
|
|
42
|
+
* Routing edit cannot conflict with provider funding, and edits to distinct
|
|
43
|
+
* providers cannot conflict with one another. Reject duplicate account IDs,
|
|
44
|
+
* foreign/wrong-provider accounts and newly enabled Credits on unavailable managed
|
|
45
|
+
* providers before writing. Adding a key does not change provider exclusion.
|
|
46
|
+
* Identical idempotency replay returns the previously recorded response, not a
|
|
47
|
+
* second write.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
updateSettings(options) {
|
|
51
|
+
return (options.client ?? this.client).put({
|
|
52
|
+
responseStyle: 'data',
|
|
53
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
54
|
+
in: 'cookie',
|
|
55
|
+
name: '__Host-boxrouter_session',
|
|
56
|
+
type: 'apiKey'
|
|
57
|
+
}],
|
|
58
|
+
url: '/routing/settings',
|
|
59
|
+
...options,
|
|
60
|
+
headers: {
|
|
61
|
+
'Content-Type': 'application/json',
|
|
62
|
+
...options.headers
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Preview workspace route availability without dispatch
|
|
68
|
+
*
|
|
69
|
+
* Workspace read authority required. Side-effect-free current eligibility and
|
|
70
|
+
* versioned hold quotes from admission. No next-job prediction, workspace spend
|
|
71
|
+
* cap or promise that a later create can start. No secret or foreign balance.
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
preview(options) {
|
|
75
|
+
return (options?.client ?? this.client).get({
|
|
76
|
+
responseStyle: 'data',
|
|
77
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
78
|
+
in: 'cookie',
|
|
79
|
+
name: '__Host-boxrouter_session',
|
|
80
|
+
type: 'apiKey'
|
|
81
|
+
}],
|
|
82
|
+
url: '/routing/preview',
|
|
83
|
+
...options
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|