@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
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
2
|
+
export class Credits extends HeyApiClient {
|
|
3
|
+
/**
|
|
4
|
+
* Get the workspace credit balance
|
|
5
|
+
*
|
|
6
|
+
* Requires account-management permission; execution keys receive 403. Returns 503
|
|
7
|
+
* payments_unavailable while credit purchases are not configured. BYOK work never
|
|
8
|
+
* depends on this balance.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
balance(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: '/credits',
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List recent credit purchases
|
|
25
|
+
*
|
|
26
|
+
* Workspace-owned purchases in every state, ordered by creation time and ID descending. Invoice and receipt links appear only after confirmed payment. New purchases do not shift subsequent pages. Invalid or another workspace's cursor is a 400.
|
|
27
|
+
*/
|
|
28
|
+
purchases(options) {
|
|
29
|
+
return (options?.client ?? this.client).get({
|
|
30
|
+
responseStyle: 'data',
|
|
31
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
32
|
+
in: 'cookie',
|
|
33
|
+
name: '__Host-boxrouter_session',
|
|
34
|
+
type: 'apiKey'
|
|
35
|
+
}],
|
|
36
|
+
url: '/credits/purchases',
|
|
37
|
+
...options
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Start a credit purchase through Checkout or a saved card
|
|
42
|
+
*
|
|
43
|
+
* Without payment_method_id, records a pending purchase and returns the hosted
|
|
44
|
+
* Checkout page; success_url and cancel_url are required for this path. The response
|
|
45
|
+
* reports fee_minor and total_minor before redirect: Checkout charges total_minor
|
|
46
|
+
* (amount_minor plus BoxRouter's purchase fee, before tax) in two line items, and only
|
|
47
|
+
* amount_minor is added as credit. A refund returns credit only; the fee is not
|
|
48
|
+
* refunded. With a
|
|
49
|
+
* workspace-owned payment_method_id, creates and pays a
|
|
50
|
+
* Stripe invoice using that card. A verified paid invoice returns confirmed; when
|
|
51
|
+
* payer authentication is required, returns pending with the hosted invoice
|
|
52
|
+
* authentication_url. Send the payer there, then poll this purchase after they
|
|
53
|
+
* return to the dashboard. Credit is added only after BoxRouter fetches and validates
|
|
54
|
+
* the paid invoice. A definitive card decline returns payment_declined with the
|
|
55
|
+
* purchase ID and a short safe decline reason in error details, outcome not_started;
|
|
56
|
+
* the failed purchase remains in history. Repeating a request with the same
|
|
57
|
+
* Idempotency-Key returns its original result; a different amount or card under that
|
|
58
|
+
* key is a 409. After a payment_provider_unavailable response with outcome unknown,
|
|
59
|
+
* retry with the same key.
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
purchase(options) {
|
|
63
|
+
return (options.client ?? this.client).post({
|
|
64
|
+
responseStyle: 'data',
|
|
65
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
66
|
+
in: 'cookie',
|
|
67
|
+
name: '__Host-boxrouter_session',
|
|
68
|
+
type: 'apiKey'
|
|
69
|
+
}],
|
|
70
|
+
url: '/credits/purchases',
|
|
71
|
+
...options,
|
|
72
|
+
headers: {
|
|
73
|
+
'Content-Type': 'application/json',
|
|
74
|
+
...options.headers
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Preview a credit purchase and its tax
|
|
80
|
+
*
|
|
81
|
+
* Returns Stripe's current tax preview for the requested top-up amount. Requires account-management permission and is available only when in-page card purchases are enabled.
|
|
82
|
+
*/
|
|
83
|
+
quotePurchase(options) {
|
|
84
|
+
return (options.client ?? this.client).post({
|
|
85
|
+
responseStyle: 'data',
|
|
86
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
87
|
+
in: 'cookie',
|
|
88
|
+
name: '__Host-boxrouter_session',
|
|
89
|
+
type: 'apiKey'
|
|
90
|
+
}],
|
|
91
|
+
url: '/credits/purchases/quote',
|
|
92
|
+
...options,
|
|
93
|
+
headers: {
|
|
94
|
+
'Content-Type': 'application/json',
|
|
95
|
+
...options.headers
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* List managed-compute credit movements
|
|
101
|
+
*
|
|
102
|
+
* Requires account-management permission; execution keys receive 403. Returns
|
|
103
|
+
* confirmed, nonzero charges from the configured test or live billing book, the later
|
|
104
|
+
* corrections to them, reservations still held, and reservations released with no
|
|
105
|
+
* charge, newest first. Results are limited to the calling workspace. BYOK work,
|
|
106
|
+
* supplier costs, provider account identities, API-key digests and raw usage evidence
|
|
107
|
+
* are not returned; a row's `key_id` names the workspace API key it belongs to. A
|
|
108
|
+
* cursor belongs to this workspace and billing mode; invalid or foreign cursors
|
|
109
|
+
* return 400. New rows do not shift subsequent pages. No provider or payment-provider
|
|
110
|
+
* calls are made.
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
usage(options) {
|
|
114
|
+
return (options?.client ?? this.client).get({
|
|
115
|
+
responseStyle: 'data',
|
|
116
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
117
|
+
in: 'cookie',
|
|
118
|
+
name: '__Host-boxrouter_session',
|
|
119
|
+
type: 'apiKey'
|
|
120
|
+
}],
|
|
121
|
+
url: '/credits/usage',
|
|
122
|
+
...options
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get one credit purchase
|
|
127
|
+
*
|
|
128
|
+
* The authoritative state to poll after the payer returns from Checkout. Another workspace's purchase is a 404.
|
|
129
|
+
*/
|
|
130
|
+
getPurchase(options) {
|
|
131
|
+
return (options.client ?? this.client).get({
|
|
132
|
+
responseStyle: 'data',
|
|
133
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
134
|
+
in: 'cookie',
|
|
135
|
+
name: '__Host-boxrouter_session',
|
|
136
|
+
type: 'apiKey'
|
|
137
|
+
}],
|
|
138
|
+
url: '/credits/purchases/{purchase_id}',
|
|
139
|
+
...options
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Close an unpaid Checkout session
|
|
144
|
+
*
|
|
145
|
+
* Expires a known open Checkout session for this workspace-owned purchase. A
|
|
146
|
+
* completed payment is reconciled and remains confirmed. If Checkout creation
|
|
147
|
+
* had an unknown outcome and no session ID was recorded, the same stable Stripe
|
|
148
|
+
* idempotency key recovers that request before BoxRouter expires the session.
|
|
149
|
+
* Repeating this request is safe. The request needs no body: the return URLs are
|
|
150
|
+
* optional and unused when closing a purchase.
|
|
151
|
+
*
|
|
152
|
+
*/
|
|
153
|
+
cancelPurchase(options) {
|
|
154
|
+
return (options.client ?? this.client).post({
|
|
155
|
+
responseStyle: 'data',
|
|
156
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
157
|
+
in: 'cookie',
|
|
158
|
+
name: '__Host-boxrouter_session',
|
|
159
|
+
type: 'apiKey'
|
|
160
|
+
}],
|
|
161
|
+
url: '/credits/purchases/{purchase_id}/cancel',
|
|
162
|
+
...options,
|
|
163
|
+
headers: {
|
|
164
|
+
'Content-Type': 'application/json',
|
|
165
|
+
...options.headers
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* List redeemed promotion codes
|
|
171
|
+
*
|
|
172
|
+
* Promotion codes this workspace redeemed, newest first.
|
|
173
|
+
*/
|
|
174
|
+
promotions(options) {
|
|
175
|
+
return (options?.client ?? this.client).get({
|
|
176
|
+
responseStyle: 'data',
|
|
177
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
178
|
+
in: 'cookie',
|
|
179
|
+
name: '__Host-boxrouter_session',
|
|
180
|
+
type: 'apiKey'
|
|
181
|
+
}],
|
|
182
|
+
url: '/credits/promotions',
|
|
183
|
+
...options
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Redeem a promotion code for free credit
|
|
188
|
+
*
|
|
189
|
+
* Adds the code's credit to the workspace balance, once per workspace. Codes are
|
|
190
|
+
* case-insensitive and surrounding spaces are ignored. An unknown, expired, disabled
|
|
191
|
+
* or fully used code is 404 promotion_code_invalid; these cases are not told apart.
|
|
192
|
+
* A new redemption answers 201. A code this workspace already redeemed is refused
|
|
193
|
+
* with 409 promotion_already_redeemed and details.redemption containing the original redemption;
|
|
194
|
+
* its message names the redemption date. No credit is granted again. Promotional
|
|
195
|
+
* credit does not expire. Requires account-management permission; 503 payments_unavailable while
|
|
196
|
+
* credits are not configured.
|
|
197
|
+
*
|
|
198
|
+
*/
|
|
199
|
+
redeem(options) {
|
|
200
|
+
return (options.client ?? this.client).post({
|
|
201
|
+
responseStyle: 'data',
|
|
202
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
203
|
+
in: 'cookie',
|
|
204
|
+
name: '__Host-boxrouter_session',
|
|
205
|
+
type: 'apiKey'
|
|
206
|
+
}],
|
|
207
|
+
url: '/credits/promotions',
|
|
208
|
+
...options,
|
|
209
|
+
headers: {
|
|
210
|
+
'Content-Type': 'application/json',
|
|
211
|
+
...options.headers
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get workspace billing details
|
|
217
|
+
*
|
|
218
|
+
* Requires account-management permission. Reads the workspace Stripe customer. When multiple customer tax IDs exist, tax_id is the newest by creation time (ID breaks ties). Unset details are null.
|
|
219
|
+
*/
|
|
220
|
+
billingDetails(options) {
|
|
221
|
+
return (options?.client ?? this.client).get({
|
|
222
|
+
responseStyle: 'data',
|
|
223
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
224
|
+
in: 'cookie',
|
|
225
|
+
name: '__Host-boxrouter_session',
|
|
226
|
+
type: 'apiKey'
|
|
227
|
+
}],
|
|
228
|
+
url: '/credits/billing-details',
|
|
229
|
+
...options
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Replace workspace billing details
|
|
234
|
+
*
|
|
235
|
+
* Stores legal name, invoice email, address and one tax ID on the workspace Stripe customer, creating it when absent. Details apply to future invoices. PUT replaces all customer tax IDs with the supplied single ID, adding the replacement before deleting old IDs so a rejected replacement preserves them. Stripe tax ID verification can be pending or unsuccessful. Repeat an uncertain update with the same Idempotency-Key; a changed body under that key returns 409. Stripe rejection returns 502; the update can have partially completed, so read current details before correcting it.
|
|
236
|
+
*/
|
|
237
|
+
updateBillingDetails(options) {
|
|
238
|
+
return (options.client ?? this.client).put({
|
|
239
|
+
responseStyle: 'data',
|
|
240
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
241
|
+
in: 'cookie',
|
|
242
|
+
name: '__Host-boxrouter_session',
|
|
243
|
+
type: 'apiKey'
|
|
244
|
+
}],
|
|
245
|
+
url: '/credits/billing-details',
|
|
246
|
+
...options,
|
|
247
|
+
headers: {
|
|
248
|
+
'Content-Type': 'application/json',
|
|
249
|
+
...options.headers
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Get workspace credit alert settings
|
|
255
|
+
*
|
|
256
|
+
* Requires account-management permission. Returns workspace-owned settings only.
|
|
257
|
+
*/
|
|
258
|
+
alerts(options) {
|
|
259
|
+
return (options?.client ?? this.client).get({
|
|
260
|
+
responseStyle: 'data',
|
|
261
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
262
|
+
in: 'cookie',
|
|
263
|
+
name: '__Host-boxrouter_session',
|
|
264
|
+
type: 'apiKey'
|
|
265
|
+
}],
|
|
266
|
+
url: '/credits/alerts',
|
|
267
|
+
...options
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Replace workspace credit alert settings
|
|
272
|
+
*
|
|
273
|
+
* Atomically replaces the optional trigger level and evaluates the current available balance. Repeating identical settings is idempotent and requires no Idempotency-Key. Sends the owner one alert per crossing below the trigger level and one when available credit is zero or negative; a repeated evaluation does not resend. Re-arms at or above the trigger level and above zero respectively. BYOK work is unaffected by credit balance.
|
|
274
|
+
*/
|
|
275
|
+
updateAlerts(options) {
|
|
276
|
+
return (options.client ?? this.client).put({
|
|
277
|
+
responseStyle: 'data',
|
|
278
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
279
|
+
in: 'cookie',
|
|
280
|
+
name: '__Host-boxrouter_session',
|
|
281
|
+
type: 'apiKey'
|
|
282
|
+
}],
|
|
283
|
+
url: '/credits/alerts',
|
|
284
|
+
...options,
|
|
285
|
+
headers: {
|
|
286
|
+
'Content-Type': 'application/json',
|
|
287
|
+
...options.headers
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* List saved workspace payment methods
|
|
293
|
+
*
|
|
294
|
+
* Returns masked card details only. Saved methods can be charged for a workspace member's purchase or immediately when enabling auto top-up with a trigger level above the current balance.
|
|
295
|
+
*/
|
|
296
|
+
paymentMethods(options) {
|
|
297
|
+
return (options?.client ?? this.client).get({
|
|
298
|
+
responseStyle: 'data',
|
|
299
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
300
|
+
in: 'cookie',
|
|
301
|
+
name: '__Host-boxrouter_session',
|
|
302
|
+
type: 'apiKey'
|
|
303
|
+
}],
|
|
304
|
+
url: '/credits/payment-methods',
|
|
305
|
+
...options
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Start hosted setup for a saved payment method
|
|
310
|
+
*
|
|
311
|
+
* Creates a Stripe-hosted setup page and returns its URL. Setup does not charge the
|
|
312
|
+
* payer. The completed method can be charged for a later user-initiated purchase or immediately when enabling auto top-up with a trigger level above the current balance.
|
|
313
|
+
* Repeating the request with the same Idempotency-Key returns the same page.
|
|
314
|
+
*
|
|
315
|
+
*/
|
|
316
|
+
setupPaymentMethod(options) {
|
|
317
|
+
return (options.client ?? this.client).post({
|
|
318
|
+
responseStyle: 'data',
|
|
319
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
320
|
+
in: 'cookie',
|
|
321
|
+
name: '__Host-boxrouter_session',
|
|
322
|
+
type: 'apiKey'
|
|
323
|
+
}],
|
|
324
|
+
url: '/credits/payment-methods/setup',
|
|
325
|
+
...options,
|
|
326
|
+
headers: {
|
|
327
|
+
'Content-Type': 'application/json',
|
|
328
|
+
...options.headers
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Start in-page saved card setup
|
|
334
|
+
*
|
|
335
|
+
* Creates a Stripe SetupIntent for in-page card collection. Requires account-management permission and the in-page cards feature.
|
|
336
|
+
*/
|
|
337
|
+
setupPaymentMethodIntent(options) {
|
|
338
|
+
return (options?.client ?? this.client).post({
|
|
339
|
+
responseStyle: 'data',
|
|
340
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
341
|
+
in: 'cookie',
|
|
342
|
+
name: '__Host-boxrouter_session',
|
|
343
|
+
type: 'apiKey'
|
|
344
|
+
}],
|
|
345
|
+
url: '/credits/payment-methods/setup-intent',
|
|
346
|
+
...options
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Set saved card charge order
|
|
351
|
+
*
|
|
352
|
+
* Replaces the order of every saved card and Link method for automatic top-up. Requires account-management permission and the multi-card top-up feature.
|
|
353
|
+
*/
|
|
354
|
+
reorderPaymentMethods(options) {
|
|
355
|
+
return (options.client ?? this.client).put({
|
|
356
|
+
responseStyle: 'data',
|
|
357
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
358
|
+
in: 'cookie',
|
|
359
|
+
name: '__Host-boxrouter_session',
|
|
360
|
+
type: 'apiKey'
|
|
361
|
+
}],
|
|
362
|
+
url: '/credits/payment-methods/order',
|
|
363
|
+
...options,
|
|
364
|
+
headers: {
|
|
365
|
+
'Content-Type': 'application/json',
|
|
366
|
+
...options.headers
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Get a saved payment method setup status
|
|
372
|
+
*
|
|
373
|
+
* Reads Stripe's current setup state after the payer returns. Another workspace's setup is a 404.
|
|
374
|
+
*/
|
|
375
|
+
getPaymentMethodSetup(options) {
|
|
376
|
+
return (options.client ?? this.client).get({
|
|
377
|
+
responseStyle: 'data',
|
|
378
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
379
|
+
in: 'cookie',
|
|
380
|
+
name: '__Host-boxrouter_session',
|
|
381
|
+
type: 'apiKey'
|
|
382
|
+
}],
|
|
383
|
+
url: '/credits/payment-method-setups/{setup_id}',
|
|
384
|
+
...options
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Remove a saved workspace payment method
|
|
389
|
+
*
|
|
390
|
+
* Detaches a saved card. Another workspace's payment method is a 404. If the card
|
|
391
|
+
* was the default, the next saved card becomes default; removing the last card
|
|
392
|
+
* disables auto top-up with disabled_reason payment_method_required.
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
395
|
+
deletePaymentMethod(options) {
|
|
396
|
+
return (options.client ?? this.client).delete({
|
|
397
|
+
responseStyle: 'data',
|
|
398
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
399
|
+
in: 'cookie',
|
|
400
|
+
name: '__Host-boxrouter_session',
|
|
401
|
+
type: 'apiKey'
|
|
402
|
+
}],
|
|
403
|
+
url: '/credits/payment-methods/{payment_method_id}',
|
|
404
|
+
...options
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Set the workspace's default saved card
|
|
409
|
+
*
|
|
410
|
+
* Makes this workspace-owned saved card the only default card. The first saved
|
|
411
|
+
* card becomes default automatically. This local setting is used by one-click
|
|
412
|
+
* purchases and auto top-up; repeating the request is safe. Another workspace's
|
|
413
|
+
* card is a 404.
|
|
414
|
+
*
|
|
415
|
+
*/
|
|
416
|
+
setDefaultPaymentMethod(options) {
|
|
417
|
+
return (options.client ?? this.client).post({
|
|
418
|
+
responseStyle: 'data',
|
|
419
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
420
|
+
in: 'cookie',
|
|
421
|
+
name: '__Host-boxrouter_session',
|
|
422
|
+
type: 'apiKey'
|
|
423
|
+
}],
|
|
424
|
+
url: '/credits/payment-methods/{payment_method_id}/default',
|
|
425
|
+
...options
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Get automatic credit top-up settings
|
|
430
|
+
*
|
|
431
|
+
* Requires account-management permission. Auto top-up is off until explicitly enabled.
|
|
432
|
+
*/
|
|
433
|
+
autoTopUp(options) {
|
|
434
|
+
return (options?.client ?? this.client).get({
|
|
435
|
+
responseStyle: 'data',
|
|
436
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
437
|
+
in: 'cookie',
|
|
438
|
+
name: '__Host-boxrouter_session',
|
|
439
|
+
type: 'apiKey'
|
|
440
|
+
}],
|
|
441
|
+
url: '/credits/auto-top-up',
|
|
442
|
+
...options
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Replace automatic credit top-up settings
|
|
447
|
+
*
|
|
448
|
+
* Stores the enabled state, trigger level and purchase amount. The amount must be
|
|
449
|
+
* within current purchase_bounds_minor and the trigger level must be zero or greater.
|
|
450
|
+
* Enabling requires a default saved card. Enabling with a trigger level above current
|
|
451
|
+
* available credit evaluates and attempts one top-up immediately. An attempt is
|
|
452
|
+
* made once per crossing below the trigger level and is never retried automatically. A
|
|
453
|
+
* decline or required authentication disables auto top-up and records the reason.
|
|
454
|
+
* Repeating the same settings is idempotent and does not start a second attempt for
|
|
455
|
+
* the same balance crossing. After a 503 with outcome unknown, retry the identical
|
|
456
|
+
* settings or GET the settings; inspect last_attempt.purchase_id and poll that
|
|
457
|
+
* purchase to reconcile the original attempt.
|
|
458
|
+
*
|
|
459
|
+
*/
|
|
460
|
+
updateAutoTopUp(options) {
|
|
461
|
+
return (options.client ?? this.client).put({
|
|
462
|
+
responseStyle: 'data',
|
|
463
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
464
|
+
in: 'cookie',
|
|
465
|
+
name: '__Host-boxrouter_session',
|
|
466
|
+
type: 'apiKey'
|
|
467
|
+
}],
|
|
468
|
+
url: '/credits/auto-top-up',
|
|
469
|
+
...options,
|
|
470
|
+
headers: {
|
|
471
|
+
'Content-Type': 'application/json',
|
|
472
|
+
...options.headers
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { BinaryStreamResponses } from "./core/binaryStream.js";
|
|
2
|
+
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
3
|
+
import { HeyApiClient } from './namespace-base.mjs';
|
|
4
|
+
import type { FilesAbortUploadData, FilesAbortUploadErrors, FilesAbortUploadResponses, FilesCompleteUploadData, FilesCompleteUploadErrors, FilesCompleteUploadResponses, FilesCreateDownloadData, FilesCreateDownloadErrors, FilesCreateDownloadResponses, FilesCreateUploadData, FilesCreateUploadErrors, FilesCreateUploadResponses, FilesExistsData, FilesExistsErrors, FilesExistsResponses, FilesListData, FilesListErrors, FilesListResponses, FilesMkdirData, FilesMkdirErrors, FilesMkdirResponses, FilesReadData, FilesReadErrors, FilesReadResponses, FilesRemoveData, FilesRemoveErrors, FilesRemoveResponses, FilesWriteData, FilesWriteErrors, FilesWriteResponses } from './types.gen.js';
|
|
5
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
6
|
+
/**
|
|
7
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
8
|
+
* individual options. This might be also useful if you want to implement a
|
|
9
|
+
* custom client.
|
|
10
|
+
*/
|
|
11
|
+
client?: Client;
|
|
12
|
+
/**
|
|
13
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
14
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
15
|
+
*/
|
|
16
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
17
|
+
};
|
|
18
|
+
export declare class Files extends HeyApiClient {
|
|
19
|
+
/**
|
|
20
|
+
* Read exact file bytes
|
|
21
|
+
*
|
|
22
|
+
* You can rely on:
|
|
23
|
+
* - Returns complete bytes, or resource_limit with no prefix returned.
|
|
24
|
+
* - Reading a directory or another path that is not a regular file fails and returns no data.
|
|
25
|
+
* - An absent path is not_found, outcome failed: a read has no effect, so its outcome is never unknown.
|
|
26
|
+
*
|
|
27
|
+
* You can set: path.
|
|
28
|
+
*
|
|
29
|
+
* Not promised: consistency while another writer changes the file.
|
|
30
|
+
*
|
|
31
|
+
* The limit is the advertised limits.file_transfer_bytes. Bytes are not text-decoded.
|
|
32
|
+
* Closing the transfer does not destroy the sandbox. A stream that ends before
|
|
33
|
+
* Content-Length is an incomplete transfer, not a successful file read.
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
read<ThrowOnError extends boolean = true>(options: Options<FilesReadData, ThrowOnError>): RequestResult<FilesReadResponses, FilesReadErrors, ThrowOnError, 'data'>;
|
|
37
|
+
/**
|
|
38
|
+
* Read exact file bytes
|
|
39
|
+
*
|
|
40
|
+
* You can rely on:
|
|
41
|
+
* - Returns complete bytes, or resource_limit with no prefix returned.
|
|
42
|
+
* - Reading a directory or another path that is not a regular file fails and returns no data.
|
|
43
|
+
* - An absent path is not_found, outcome failed: a read has no effect, so its outcome is never unknown.
|
|
44
|
+
*
|
|
45
|
+
* You can set: path.
|
|
46
|
+
*
|
|
47
|
+
* Not promised: consistency while another writer changes the file.
|
|
48
|
+
*
|
|
49
|
+
* The limit is the advertised limits.file_transfer_bytes. Bytes are not text-decoded.
|
|
50
|
+
* Closing the transfer does not destroy the sandbox. A stream that ends before
|
|
51
|
+
* Content-Length is an incomplete transfer, not a successful file read.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
readStream<ThrowOnError extends boolean = true>(options: Omit<Options<FilesReadData, ThrowOnError>, "parseAs" | "responseStyle">): RequestResult<BinaryStreamResponses<FilesReadResponses>, FilesReadErrors, ThrowOnError, "fields">;
|
|
55
|
+
/**
|
|
56
|
+
* Write exact file bytes
|
|
57
|
+
*
|
|
58
|
+
* You can rely on:
|
|
59
|
+
* - Writes exact bytes.
|
|
60
|
+
* - Creates missing parents.
|
|
61
|
+
* - A new file is readable and writable by the command user.
|
|
62
|
+
* - The size limit is enforced.
|
|
63
|
+
*
|
|
64
|
+
* You can set: path, data.
|
|
65
|
+
*
|
|
66
|
+
* Not promised: owner, mode or executable bit; atomic replace; whether a symbolic link at the path is followed or replaced.
|
|
67
|
+
*
|
|
68
|
+
* The limit is the advertised limits.file_transfer_bytes. A failed transfer may leave
|
|
69
|
+
* partial data; the error's outcome describes what is known. SDK text helpers must encode
|
|
70
|
+
* text as UTF-8 before transfer.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
write<ThrowOnError extends boolean = true>(options: Options<FilesWriteData, ThrowOnError>): RequestResult<FilesWriteResponses, FilesWriteErrors, ThrowOnError, 'data'>;
|
|
74
|
+
/**
|
|
75
|
+
* Create a sandbox file upload
|
|
76
|
+
*
|
|
77
|
+
* You can rely on:
|
|
78
|
+
* - A completed upload leaves exactly the declared bytes at the path; a body of another length is refused.
|
|
79
|
+
*
|
|
80
|
+
* You can set: path, size.
|
|
81
|
+
*
|
|
82
|
+
* Not promised: removing bytes already written when an upload is aborted.
|
|
83
|
+
*
|
|
84
|
+
* Starts an upload of a file of known size to an absolute path in a running sandbox. Send
|
|
85
|
+
* every returned part as described by its `TransferPart`, then call `completeSandboxUpload`
|
|
86
|
+
* with each part's response `ETag`, if any. BoxRouter chooses the `route`; it is
|
|
87
|
+
* informational and clients must not branch on it. Upload links and the session last up to
|
|
88
|
+
* six hours after creation; `expires_at` says when they end. Launch behaviour is always
|
|
89
|
+
* exactly one part. Idempotency-Key is required on create, complete and abort; repeat an
|
|
90
|
+
* uncertain call with the same key.
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
createUpload<ThrowOnError extends boolean = true>(options: Options<FilesCreateUploadData, ThrowOnError>): RequestResult<FilesCreateUploadResponses, FilesCreateUploadErrors, ThrowOnError, 'data'>;
|
|
94
|
+
/**
|
|
95
|
+
* Complete a sandbox file upload
|
|
96
|
+
*
|
|
97
|
+
* You can rely on:
|
|
98
|
+
* - A completed upload leaves exactly the declared bytes at the path; a body of another length is refused.
|
|
99
|
+
*
|
|
100
|
+
* You can set: path, size.
|
|
101
|
+
*
|
|
102
|
+
* Not promised: removing bytes already written when an upload is aborted.
|
|
103
|
+
*
|
|
104
|
+
* Supply each part number exactly once with the `ETag` header returned by its request, if
|
|
105
|
+
* it returned one. Repeating the call with the same idempotency key returns the same result.
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
completeUpload<ThrowOnError extends boolean = true>(options: Options<FilesCompleteUploadData, ThrowOnError>): RequestResult<FilesCompleteUploadResponses, FilesCompleteUploadErrors, ThrowOnError, 'data'>;
|
|
109
|
+
/**
|
|
110
|
+
* Abort a sandbox file upload
|
|
111
|
+
*
|
|
112
|
+
* You can rely on:
|
|
113
|
+
* - A completed upload leaves exactly the declared bytes at the path; a body of another length is refused.
|
|
114
|
+
*
|
|
115
|
+
* You can set: path, size.
|
|
116
|
+
*
|
|
117
|
+
* Not promised: removing bytes already written when an upload is aborted.
|
|
118
|
+
*
|
|
119
|
+
* Idempotent.
|
|
120
|
+
*
|
|
121
|
+
*/
|
|
122
|
+
abortUpload<ThrowOnError extends boolean = true>(options: Options<FilesAbortUploadData, ThrowOnError>): RequestResult<FilesAbortUploadResponses, FilesAbortUploadErrors, ThrowOnError, 'data'>;
|
|
123
|
+
/**
|
|
124
|
+
* Create a sandbox file download
|
|
125
|
+
*
|
|
126
|
+
* You can rely on:
|
|
127
|
+
* - A complete download returns exactly the file's bytes; a transfer that ends short fails instead of returning a prefix.
|
|
128
|
+
*
|
|
129
|
+
* You can set: path.
|
|
130
|
+
*
|
|
131
|
+
* Not promised: the file's size before the download starts.
|
|
132
|
+
*
|
|
133
|
+
* Creates a temporary download link for a file in a running sandbox. The link lasts up to
|
|
134
|
+
* one hour after creation; `expires_at` says when it ends. `route` is informational and
|
|
135
|
+
* clients must not branch on it.
|
|
136
|
+
*
|
|
137
|
+
*/
|
|
138
|
+
createDownload<ThrowOnError extends boolean = true>(options: Options<FilesCreateDownloadData, ThrowOnError>): RequestResult<FilesCreateDownloadResponses, FilesCreateDownloadErrors, ThrowOnError, 'data'>;
|
|
139
|
+
/**
|
|
140
|
+
* List the immediate entries of a directory
|
|
141
|
+
*
|
|
142
|
+
* You can rely on:
|
|
143
|
+
* - Returns every immediate entry, including hidden ones and broken symbolic links, sorted by name.
|
|
144
|
+
* - Each entry has its type (file, directory, symlink, other); a link is not followed.
|
|
145
|
+
* - More entries than the advertised limit fail; the list is never truncated.
|
|
146
|
+
*
|
|
147
|
+
* You can set: path.
|
|
148
|
+
*
|
|
149
|
+
* Not promised: metadata beyond the type; a consistent snapshot while the directory changes.
|
|
150
|
+
*
|
|
151
|
+
* An unreadable or missing directory fails; it does not appear empty. No recursion.
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
list<ThrowOnError extends boolean = true>(options: Options<FilesListData, ThrowOnError>): RequestResult<FilesListResponses, FilesListErrors, ThrowOnError, 'data'>;
|
|
155
|
+
/**
|
|
156
|
+
* Create a directory
|
|
157
|
+
*
|
|
158
|
+
* You can rely on:
|
|
159
|
+
* - parents=true (the default) creates missing parents and accepts an existing directory.
|
|
160
|
+
* - parents=false requires the parent and refuses an existing path.
|
|
161
|
+
*
|
|
162
|
+
* You can set: path, parents.
|
|
163
|
+
*
|
|
164
|
+
* Not promised: mode and owner beyond command-user usability.
|
|
165
|
+
*
|
|
166
|
+
* A failure may leave some parent directories created. An uncertain mutation is never automatically replayed.
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
169
|
+
mkdir<ThrowOnError extends boolean = true>(options: Options<FilesMkdirData, ThrowOnError>): RequestResult<FilesMkdirResponses, FilesMkdirErrors, ThrowOnError, 'data'>;
|
|
170
|
+
/**
|
|
171
|
+
* Check for an accessible filesystem target
|
|
172
|
+
*
|
|
173
|
+
* You can rely on:
|
|
174
|
+
* - Follows symbolic links. True when the target exists; false when it is missing, the link is broken, or the target is not accessible.
|
|
175
|
+
* - A failure to check raises an error; it never reads as false.
|
|
176
|
+
*
|
|
177
|
+
* You can set: path.
|
|
178
|
+
*
|
|
179
|
+
* Not promised: whether the answer still holds after the call.
|
|
180
|
+
*
|
|
181
|
+
* Transport and command-startup failures remain errors. This read does not reserve the path or guarantee it remains present.
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
exists<ThrowOnError extends boolean = true>(options: Options<FilesExistsData, ThrowOnError>): RequestResult<FilesExistsResponses, FilesExistsErrors, ThrowOnError, 'data'>;
|
|
185
|
+
/**
|
|
186
|
+
* Remove a file, symbolic link or directory
|
|
187
|
+
*
|
|
188
|
+
* You can rely on:
|
|
189
|
+
* - Removes only the named entry.
|
|
190
|
+
* - A nonempty directory needs recursive.
|
|
191
|
+
* - A symbolic link, broken or not, is unlinked and its target kept.
|
|
192
|
+
* - A missing path fails.
|
|
193
|
+
* - The sandbox root is refused.
|
|
194
|
+
*
|
|
195
|
+
* You can set: path, recursive.
|
|
196
|
+
*
|
|
197
|
+
* Not promised: atomicity; partial progress after a failure.
|
|
198
|
+
*
|
|
199
|
+
* A final slash does not change which entry is removed. Failures may leave partial changes. An uncertain mutation is never automatically replayed.
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
remove<ThrowOnError extends boolean = true>(options: Options<FilesRemoveData, ThrowOnError>): RequestResult<FilesRemoveResponses, FilesRemoveErrors, ThrowOnError, 'data'>;
|
|
203
|
+
}
|