withruntime 0.11.1 → 0.12.0
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/BLAXEL.md +3 -3
- package/COMPATIBILITY.md +74 -9
- package/DAYTONA.md +33 -5
- package/E2B.md +137 -48
- package/README.md +11 -9
- package/README.src.md +11 -9
- package/VERCEL.md +43 -5
- package/compatibility-lock.json +58 -49
- package/dist/billing-cli.d.ts +1 -1
- package/dist/billing-cli.js +77 -1
- package/dist/blaxel/errors.d.ts +14 -0
- package/dist/blaxel/errors.js +33 -4
- package/dist/blaxel/index.d.ts +2 -2
- package/dist/blaxel/index.js +4 -4
- package/dist/blaxel/interpreter.d.ts +2 -5
- package/dist/blaxel/sandbox.d.ts +15 -7
- package/dist/blaxel/sandbox.js +64 -9
- package/dist/blaxel/snapshot.d.ts +4 -0
- package/dist/blaxel/snapshot.js +4 -0
- package/dist/cli/logs.d.ts +21 -0
- package/dist/cli/logs.js +188 -0
- package/dist/cli/logs.test.d.ts +1 -0
- package/dist/cli/logs.test.js +272 -0
- package/dist/cli-extras.d.ts +3 -3
- package/dist/cli-extras.js +17 -12
- package/dist/cli-words.d.ts +10 -1
- package/dist/cli-words.js +18 -0
- package/dist/cli.d.ts +6 -2
- package/dist/cli.js +468 -219
- package/dist/client.d.ts +13 -63
- package/dist/client.js +35 -124
- package/dist/cloudflare/errors.d.ts +143 -0
- package/dist/cloudflare/errors.js +167 -0
- package/dist/cloudflare/index.d.ts +175 -6
- package/dist/cloudflare/index.js +416 -26
- package/dist/cloudflare/interpreter.d.ts +119 -0
- package/dist/cloudflare/interpreter.js +223 -0
- package/dist/cloudflare/streams.d.ts +38 -0
- package/dist/cloudflare/streams.js +145 -0
- package/dist/cloudflare/watch.d.ts +9 -0
- package/dist/cloudflare/watch.js +24 -0
- package/dist/codesandbox/index.d.ts +216 -28
- package/dist/codesandbox/index.js +478 -78
- package/dist/compat/core.d.ts +18 -0
- package/dist/compat/core.js +29 -0
- package/dist/compat/files.d.ts +1 -0
- package/dist/compat/files.js +25 -5
- package/dist/daytona/computer-use.d.ts +13 -4
- package/dist/daytona/computer-use.js +66 -8
- package/dist/daytona/daytona.d.ts +7 -2
- package/dist/daytona/daytona.js +31 -5
- package/dist/daytona/errors.d.ts +11 -0
- package/dist/daytona/errors.js +18 -0
- package/dist/daytona/filesystem.js +2 -1
- package/dist/daytona/image.d.ts +13 -9
- package/dist/daytona/image.js +18 -12
- package/dist/daytona/index.d.ts +1 -1
- package/dist/daytona/sandbox.d.ts +9 -3
- package/dist/daytona/sandbox.js +17 -3
- package/dist/domains/index.d.ts +9 -0
- package/dist/domains/index.js +10 -0
- package/dist/e2b/client.d.ts +15 -2
- package/dist/e2b/client.js +61 -7
- package/dist/e2b/commands.d.ts +4 -1
- package/dist/e2b/commands.js +17 -7
- package/dist/e2b/errors.d.ts +43 -2
- package/dist/e2b/errors.js +78 -6
- package/dist/e2b/filesystem.d.ts +1 -1
- package/dist/e2b/filesystem.js +82 -16
- package/dist/e2b/index.d.ts +3 -3
- package/dist/e2b/index.js +2 -2
- package/dist/e2b/sandbox.d.ts +50 -35
- package/dist/e2b/sandbox.js +228 -185
- package/dist/e2b/unsupported.d.ts +19 -0
- package/dist/e2b/unsupported.js +22 -1
- package/dist/e2b/users.d.ts +9 -0
- package/dist/e2b/users.js +22 -0
- package/dist/errors.d.ts +14 -5
- package/dist/errors.js +28 -14
- package/dist/freestyle/index.d.ts +285 -37
- package/dist/freestyle/index.js +656 -144
- package/dist/identity.d.ts +3 -0
- package/dist/identity.js +27 -0
- package/dist/images/index.d.ts +9 -0
- package/dist/images/index.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/ips/index.d.ts +9 -0
- package/dist/ips/index.js +10 -0
- package/dist/jobs/index.d.ts +9 -0
- package/dist/jobs/index.js +10 -0
- package/dist/keys.js +2 -0
- package/dist/login.js +2 -0
- package/dist/machine.d.ts +189 -0
- package/dist/machine.js +521 -0
- package/dist/mcp.js +1 -1
- package/dist/modal/index.d.ts +339 -61
- package/dist/modal/index.js +781 -121
- package/dist/network-cli.d.ts +3 -1
- package/dist/network-cli.js +78 -36
- package/dist/networks/index.d.ts +11 -0
- package/dist/networks/index.js +10 -0
- package/dist/openai-agents/index.d.ts +1 -1
- package/dist/openai-agents/index.js +1 -1
- package/dist/ports/index.d.ts +9 -0
- package/dist/ports/index.js +10 -0
- package/dist/product-names.d.ts +52 -0
- package/dist/product-names.js +164 -0
- package/dist/product-renames.d.ts +103 -0
- package/dist/product-renames.js +189 -0
- package/dist/products/apps.d.ts +176 -0
- package/dist/products/apps.js +165 -0
- package/dist/products/billing.d.ts +41 -0
- package/dist/products/billing.js +13 -0
- package/dist/products/browser.d.ts +10 -0
- package/dist/products/browsers.d.ts +71 -0
- package/dist/products/browsers.js +102 -0
- package/dist/products/builds.d.ts +126 -0
- package/dist/products/builds.js +221 -0
- package/dist/products/index.d.ts +3 -16
- package/dist/products/index.js +3 -14
- package/dist/products/jobs.d.ts +19 -3
- package/dist/products/jobs.js +28 -12
- package/dist/products/limits.d.ts +4 -10
- package/dist/products/logs.d.ts +245 -0
- package/dist/products/logs.js +274 -0
- package/dist/products/logs.test.d.ts +1 -0
- package/dist/products/logs.test.js +343 -0
- package/dist/products/network-products.d.ts +38 -7
- package/dist/products/network-products.js +31 -18
- package/dist/products/network.d.ts +1 -1
- package/dist/products/observability.d.ts +3 -2
- package/dist/products/private-network.js +1 -1
- package/dist/products/queues.d.ts +149 -0
- package/dist/products/queues.js +213 -0
- package/dist/products/referrals.d.ts +21 -7
- package/dist/products/referrals.js +3 -3
- package/dist/products/secrets.d.ts +8 -4
- package/dist/products/secrets.js +39 -18
- package/dist/products/signed-requests.d.ts +21 -0
- package/dist/products/signed-requests.js +11 -0
- package/dist/products/streams.d.ts +73 -0
- package/dist/products/streams.js +17 -0
- package/dist/products/switching.d.ts +37 -10
- package/dist/products/switching.js +4 -3
- package/dist/products/volumes.d.ts +3 -0
- package/dist/record-cli.d.ts +23 -0
- package/dist/record-cli.js +308 -0
- package/dist/renamed-products.d.ts +38 -0
- package/dist/renamed-products.js +34 -0
- package/dist/runloop/index.d.ts +9 -2
- package/dist/runloop/index.js +29 -8
- package/dist/runloop/sdk.d.ts +131 -0
- package/dist/runloop/sdk.js +167 -0
- package/dist/sandbox.d.ts +10 -94
- package/dist/sandbox.js +22 -371
- package/dist/sandboxes/index.d.ts +11 -0
- package/dist/sandboxes/index.js +12 -0
- package/dist/snapshots/index.d.ts +9 -0
- package/dist/snapshots/index.js +11 -0
- package/dist/snapshots.d.ts +7 -4
- package/dist/sprites/index.d.ts +343 -31
- package/dist/sprites/index.js +866 -84
- package/dist/ssh.d.ts +1 -1
- package/dist/ssh.js +11 -11
- package/dist/terminal.d.ts +24 -0
- package/dist/terminal.js +32 -0
- package/dist/transport.d.ts +18 -2
- package/dist/transport.js +61 -6
- package/dist/tunnel.js +1 -1
- package/dist/types.d.ts +116 -8
- package/dist/vercel/sandbox.d.ts +1 -2
- package/dist/vercel/sandbox.js +6 -5
- package/dist/vercel/snapshot.js +10 -2
- package/dist/volumes/index.d.ts +9 -0
- package/dist/volumes/index.js +10 -0
- package/package.json +48 -2
|
@@ -11,8 +11,10 @@ export type SecretRule = {
|
|
|
11
11
|
};
|
|
12
12
|
/** A secret your sandboxes use without seeing it. Every sandbox of your
|
|
13
13
|
* organization has an environment variable of the secret's name holding
|
|
14
|
-
* `placeholder`; the egress proxy
|
|
15
|
-
* `hosts
|
|
14
|
+
* `placeholder`; the egress proxy sets `header` on every HTTPS request to
|
|
15
|
+
* `hosts`, or, without `header`, replaces the placeholder in a credential
|
|
16
|
+
* header (Authorization, x-api-key, x-goog-api-key, api-key, xi-api-key,
|
|
17
|
+
* x-subscription-token, private-token). Never in the URL or another header.
|
|
16
18
|
* The value is never returned. */
|
|
17
19
|
export type Secret = {
|
|
18
20
|
name: string;
|
|
@@ -33,7 +35,9 @@ export type SetSecret = {
|
|
|
33
35
|
/** Where the value may go: `api.openai.com`, `*.github.com`. 1 to 16.
|
|
34
36
|
* Required unless `jobs` is true. */
|
|
35
37
|
hosts?: string[];
|
|
36
|
-
/** Set this header on every request to the hosts, replacing the sandbox's
|
|
38
|
+
/** Set this header on every request to the hosts, replacing the sandbox's
|
|
39
|
+
* own; the value then goes nowhere else. Needed when the API reads its key
|
|
40
|
+
* from a header that is not a credential header (see `Secret`). */
|
|
37
41
|
header?: string;
|
|
38
42
|
/** With `header`: its value, `{value}` where the secret goes. Default `{value}`. */
|
|
39
43
|
format?: string;
|
|
@@ -121,6 +125,6 @@ export declare function secrets(t: Transport): {
|
|
|
121
125
|
name: string;
|
|
122
126
|
deleted: true;
|
|
123
127
|
enforced: boolean;
|
|
124
|
-
from: ("
|
|
128
|
+
from: ("sandboxes" | "jobs")[];
|
|
125
129
|
}>;
|
|
126
130
|
};
|
package/dist/products/secrets.js
CHANGED
|
@@ -36,16 +36,47 @@ export function secrets(t) {
|
|
|
36
36
|
const key = (options, part) => options?.idempotencyKey
|
|
37
37
|
? { ...options, idempotencyKey: `${options.idempotencyKey}:${part}`.slice(0, 128) }
|
|
38
38
|
: options;
|
|
39
|
+
const create = (name, value, options) => store({ method: "POST", path: "/v1/secrets", body: { name, value }, ...options });
|
|
40
|
+
const rotate = (live, value, version, options) => store({
|
|
41
|
+
method: "POST",
|
|
42
|
+
path: `${jobPath(live.id)}:rotate`,
|
|
43
|
+
body: { value, expectedVersion: version },
|
|
44
|
+
...options,
|
|
45
|
+
});
|
|
46
|
+
/** Rotates the jobs copy from the version it has now. A key used before,
|
|
47
|
+
* by this same call whose answer was lost, is answered by the identical
|
|
48
|
+
* request again, with no second rotation: the rotate from the version
|
|
49
|
+
* before, or one of `earlier` (a set's create). Until 10 October 2026 the
|
|
50
|
+
* retry read the copy as it is now, changed its request, and was refused
|
|
51
|
+
* as a conflict. */
|
|
52
|
+
async function rotateOrReplay(live, value, options, earlier = []) {
|
|
53
|
+
try {
|
|
54
|
+
return await rotate(live, value, live.version, options);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (!(error instanceof RuntimeError) || error.code !== "idempotency_conflict")
|
|
58
|
+
throw error;
|
|
59
|
+
const replays = [
|
|
60
|
+
...earlier,
|
|
61
|
+
...(live.version > 1 ? [() => rotate(live, value, live.version - 1, options)] : []),
|
|
62
|
+
];
|
|
63
|
+
for (const replay of replays) {
|
|
64
|
+
const answer = await replay().catch((again) => {
|
|
65
|
+
if (again instanceof RuntimeError && again.status === 409)
|
|
66
|
+
return undefined;
|
|
67
|
+
throw again;
|
|
68
|
+
});
|
|
69
|
+
if (answer)
|
|
70
|
+
return answer;
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
39
75
|
async function setJobCopy(name, value, options) {
|
|
40
76
|
const copies = await jobCopies(options);
|
|
41
77
|
const live = copies.find((s) => s.name === name && s.deletedAt === null);
|
|
42
78
|
if (live)
|
|
43
|
-
return
|
|
44
|
-
method: "POST",
|
|
45
|
-
path: `${jobPath(live.id)}:rotate`,
|
|
46
|
-
body: { value, expectedVersion: live.version },
|
|
47
|
-
...options,
|
|
48
|
-
});
|
|
79
|
+
return rotateOrReplay(live, value, options, [() => create(name, value, options)]);
|
|
49
80
|
if (copies.some((s) => s.name === name))
|
|
50
81
|
throw new RuntimeError({
|
|
51
82
|
message: `A jobs secret named ${name} was deleted, and a deleted name cannot be used again.`,
|
|
@@ -54,12 +85,7 @@ export function secrets(t) {
|
|
|
54
85
|
hint: "Store it under another name.",
|
|
55
86
|
details: { field: "name" },
|
|
56
87
|
});
|
|
57
|
-
return
|
|
58
|
-
method: "POST",
|
|
59
|
-
path: "/v1/secrets",
|
|
60
|
-
body: { name, value },
|
|
61
|
-
...options,
|
|
62
|
-
});
|
|
88
|
+
return create(name, value, options);
|
|
63
89
|
}
|
|
64
90
|
async function all(options) {
|
|
65
91
|
const [forSandboxes, forJobs] = await Promise.all([
|
|
@@ -156,12 +182,7 @@ export function secrets(t) {
|
|
|
156
182
|
status: 404,
|
|
157
183
|
hint: "Store one with set(name, { value, jobs: true }). The sandboxes' copy is replaced by set, not rotated.",
|
|
158
184
|
});
|
|
159
|
-
return
|
|
160
|
-
method: "POST",
|
|
161
|
-
path: `${jobPath(live.id)}:rotate`,
|
|
162
|
-
body: { value, expectedVersion: live.version },
|
|
163
|
-
...options,
|
|
164
|
-
});
|
|
185
|
+
return rotateOrReplay(live, value, options);
|
|
165
186
|
},
|
|
166
187
|
/** Read the jobs copy's value back (needs the key's secrets_reveal
|
|
167
188
|
* permission). The sandboxes' copy can never be read back. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RequestOptions, Transport } from "../transport.js";
|
|
2
|
+
export type SignedRequests = {
|
|
3
|
+
/** Whether your sandboxes may get Runtime's request signature now. */
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
/** Whether this account may turn it on: it must have credit. */
|
|
6
|
+
allowed: boolean;
|
|
7
|
+
/** Why not, when `allowed` is false: `no_credit`, `revoked` or `suspended`. */
|
|
8
|
+
why: string | null;
|
|
9
|
+
enabledAt: string | null;
|
|
10
|
+
disabledAt: string | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function signedRequests(t: Transport): {
|
|
13
|
+
/** On or off, and whether this account may turn it on. */
|
|
14
|
+
get: (options?: RequestOptions) => Promise<SignedRequests>;
|
|
15
|
+
/** `enabled: true` lets your sandboxes get Runtime's request signature;
|
|
16
|
+
* `false` stops new signatures at once, and ones already given expire
|
|
17
|
+
* within 5 minutes. */
|
|
18
|
+
set: (input: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
}, options?: RequestOptions) => Promise<SignedRequests>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function signedRequests(t) {
|
|
2
|
+
const path = "/v1/networks/signed-requests";
|
|
3
|
+
return {
|
|
4
|
+
/** On or off, and whether this account may turn it on. */
|
|
5
|
+
get: (options) => t.json({ method: "GET", path, ...options }),
|
|
6
|
+
/** `enabled: true` lets your sandboxes get Runtime's request signature;
|
|
7
|
+
* `false` stops new signatures at once, and ones already given expire
|
|
8
|
+
* within 5 minutes. */
|
|
9
|
+
set: (input, options) => t.json({ method: "PUT", path, body: input, ...options }),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { RequestOptions, Transport } from "../transport.js";
|
|
2
|
+
import { type RecordResource } from "./queues.js";
|
|
3
|
+
/** Private until launch.
|
|
4
|
+
* Kafka clients use kafka.bootstrap and kafka.topic unchanged.
|
|
5
|
+
* Offsets and byte counts use decimal strings so JSON never rounds them. */
|
|
6
|
+
export type Stream = RecordResource & {
|
|
7
|
+
partitions: number;
|
|
8
|
+
retentionMs: number;
|
|
9
|
+
retentionBytes: string;
|
|
10
|
+
kafka: {
|
|
11
|
+
bootstrap: string;
|
|
12
|
+
topic: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type CreateStream = {
|
|
16
|
+
name: string;
|
|
17
|
+
labels?: Record<string, string>;
|
|
18
|
+
partitions?: number;
|
|
19
|
+
retentionMs?: number;
|
|
20
|
+
retentionBytes?: string;
|
|
21
|
+
};
|
|
22
|
+
export type UpdateStream = Partial<CreateStream>;
|
|
23
|
+
/** Text values are UTF-8. Use a Kafka client for arbitrary binary records. */
|
|
24
|
+
export type StreamRecord = {
|
|
25
|
+
key?: string | null;
|
|
26
|
+
value: string | null;
|
|
27
|
+
headers?: {
|
|
28
|
+
key: string;
|
|
29
|
+
value: string | null;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
export type PublishRecords = {
|
|
33
|
+
records: StreamRecord[];
|
|
34
|
+
};
|
|
35
|
+
export type ReadStream = {
|
|
36
|
+
partition: number;
|
|
37
|
+
maxBytes?: number;
|
|
38
|
+
waitMs?: number;
|
|
39
|
+
} & ({
|
|
40
|
+
offset: string;
|
|
41
|
+
time?: never;
|
|
42
|
+
} | {
|
|
43
|
+
time: number;
|
|
44
|
+
offset?: never;
|
|
45
|
+
});
|
|
46
|
+
export type PublishedRecord = {
|
|
47
|
+
partition: number;
|
|
48
|
+
offset: string;
|
|
49
|
+
};
|
|
50
|
+
export type StreamRead = {
|
|
51
|
+
records: (StreamRecord & PublishedRecord & {
|
|
52
|
+
time: number;
|
|
53
|
+
})[];
|
|
54
|
+
nextOffset: string;
|
|
55
|
+
};
|
|
56
|
+
/** Private until launch. Proposed routes only; nothing is registered here. */
|
|
57
|
+
export declare function streams(t: Transport): {
|
|
58
|
+
publish: (id: string, input: PublishRecords, options?: RequestOptions) => Promise<{
|
|
59
|
+
records: PublishedRecord[];
|
|
60
|
+
}>;
|
|
61
|
+
read: (id: string, input: ReadStream, options?: RequestOptions) => Promise<StreamRead>;
|
|
62
|
+
/** Trim returns the resource; follow its state with wait(id). */
|
|
63
|
+
trim: (id: string, input: {
|
|
64
|
+
partition: number;
|
|
65
|
+
before: string;
|
|
66
|
+
}, options?: RequestOptions) => Promise<Stream>;
|
|
67
|
+
create: (input: CreateStream, options?: RequestOptions) => Promise<Stream>;
|
|
68
|
+
get: (id: string, options?: RequestOptions) => Promise<Stream>;
|
|
69
|
+
list: (query?: import("./queues.js").RecordListQuery, options?: RequestOptions) => Promise<import("../page.js").Page<Stream>>;
|
|
70
|
+
update: (id: string, input: Partial<CreateStream>, options?: RequestOptions) => Promise<Stream>;
|
|
71
|
+
delete: (id: string, options?: RequestOptions) => Promise<Stream>;
|
|
72
|
+
wait(id: string, target?: "ready" | "deleted", options?: import("./queues.js").RecordWaitOptions): Promise<Stream>;
|
|
73
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { recordResources } from "./queues.js";
|
|
2
|
+
/** Private until launch. Proposed routes only; nothing is registered here. */
|
|
3
|
+
export function streams(t) {
|
|
4
|
+
const path = (id) => `/v1/streams/${encodeURIComponent(id)}`;
|
|
5
|
+
return {
|
|
6
|
+
...recordResources(t, "streams"),
|
|
7
|
+
publish: (id, input, options) => t.json({
|
|
8
|
+
...options,
|
|
9
|
+
method: "POST",
|
|
10
|
+
path: `${path(id)}:publish`,
|
|
11
|
+
body: input,
|
|
12
|
+
}),
|
|
13
|
+
read: (id, input, options) => t.json({ ...options, method: "GET", path: `${path(id)}:read`, query: input }),
|
|
14
|
+
/** Trim returns the resource; follow its state with wait(id). */
|
|
15
|
+
trim: (id, input, options) => t.json({ ...options, method: "POST", path: `${path(id)}:trim`, body: input }),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -9,7 +9,7 @@ export type SwitchProvider = "e2b" | "daytona" | "vercel" | "modal" | "cloudflar
|
|
|
9
9
|
export type SwitchingSummary = {
|
|
10
10
|
/** False while the programme is paused. */
|
|
11
11
|
enabled: boolean;
|
|
12
|
-
/** The most
|
|
12
|
+
/** The most the organization's payments are matched to, in total. */
|
|
13
13
|
maxMicros: string;
|
|
14
14
|
providers: SwitchProvider[];
|
|
15
15
|
/** Whether this organization can record a switch now: none recorded, and
|
|
@@ -17,14 +17,41 @@ export type SwitchingSummary = {
|
|
|
17
17
|
eligible: boolean;
|
|
18
18
|
switch: {
|
|
19
19
|
provider: SwitchProvider;
|
|
20
|
-
/** superseded: a referral
|
|
20
|
+
/** superseded: a referral matches the payments instead, which is
|
|
21
21
|
* never less. The two are never both paid. */
|
|
22
22
|
status: "pending" | "paid" | "superseded" | "refused" | "reversed";
|
|
23
|
-
refusedReason: "program_off" | "suspended" | "same_card" | "fraud" | null;
|
|
23
|
+
refusedReason: "program_off" | "suspended" | "same_card" | "fraud" | "too_late" | null;
|
|
24
24
|
recordedAt: string;
|
|
25
|
-
/** The
|
|
25
|
+
/** The matches this organization got and kept. */
|
|
26
26
|
creditMicros: string;
|
|
27
27
|
} | null;
|
|
28
|
+
/** The welcome match: credit an organization adds within 30 days of
|
|
29
|
+
* signing up is matched, up to $1,000 in total. */
|
|
30
|
+
welcome: WelcomeMatch;
|
|
31
|
+
};
|
|
32
|
+
export type WelcomeMatch = {
|
|
33
|
+
/** False while the match is paused. */
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
/** The most the organization's payments are matched to, in total. */
|
|
36
|
+
maxMicros: string;
|
|
37
|
+
/** When the offer ends: 30 days after the organization signed up. */
|
|
38
|
+
endsAt: string;
|
|
39
|
+
/** Whether credit added now would be matched: some is left, before endsAt. */
|
|
40
|
+
eligible: boolean;
|
|
41
|
+
/** Whether credit has been added. */
|
|
42
|
+
toppedUp: boolean;
|
|
43
|
+
/** Null until a payment is decided; paid while a match is kept.
|
|
44
|
+
* superseded: a referral matches the payments instead, which is never
|
|
45
|
+
* less. */
|
|
46
|
+
status: "pending" | "paid" | "superseded" | "refused" | "reversed" | null;
|
|
47
|
+
/** The matches this organization got and kept. */
|
|
48
|
+
creditMicros: string;
|
|
49
|
+
/** The part of maxMicros used so far. Absent from a server before
|
|
50
|
+
* 8 October 2026. */
|
|
51
|
+
usedMicros?: string;
|
|
52
|
+
/** What credit added now could still get; "0" once the offer ends. Absent
|
|
53
|
+
* from a server before 8 October 2026. */
|
|
54
|
+
leftMicros?: string;
|
|
28
55
|
};
|
|
29
56
|
export type UsageComparison = {
|
|
30
57
|
provider: CompareProvider;
|
|
@@ -52,14 +79,13 @@ export type UsageComparison = {
|
|
|
52
79
|
runSeconds: number;
|
|
53
80
|
activeCpuSeconds: number;
|
|
54
81
|
unpricedSandboxes: number;
|
|
55
|
-
/** Of `sandboxes`, how many
|
|
56
|
-
* time. The trial charged nothing for them; `runtimeMicros` prices them at
|
|
82
|
+
/** Of `sandboxes`, how many free usage paid for, and their running time. It charged nothing for them; `runtimeMicros` prices them at
|
|
57
83
|
* Runtime's standard rates, what the same work costs on paid credit. */
|
|
58
84
|
trialSandboxes: number;
|
|
59
85
|
trialRunSeconds: number;
|
|
60
86
|
};
|
|
61
87
|
/** What the usage costs on Runtime on paid credit: each paid sandbox at the
|
|
62
|
-
* rates it was quoted, a
|
|
88
|
+
* rates it was quoted, a sandbox free usage paid for at the standard rates. */
|
|
63
89
|
runtimeMicros: string;
|
|
64
90
|
rivalMicros: string;
|
|
65
91
|
/** Rival less Runtime: negative when the rival would cost less. */
|
|
@@ -77,8 +103,9 @@ export type UsageComparison = {
|
|
|
77
103
|
switching: SwitchingSummary;
|
|
78
104
|
};
|
|
79
105
|
/** `runtime.switching`: compare your usage with a rival's published rates,
|
|
80
|
-
*
|
|
81
|
-
* $
|
|
106
|
+
* record the rival you are leaving, and read the welcome match: credit added
|
|
107
|
+
* within 30 days of signing up is matched, up to $1,000 in total, as each
|
|
108
|
+
* payment settles. */
|
|
82
109
|
export declare function switching(t: Transport): {
|
|
83
110
|
/** Your settled sandbox usage over the last `days` (default 30, at most
|
|
84
111
|
* 90), priced on Runtime and at the rival, with the saving. */
|
|
@@ -86,7 +113,7 @@ export declare function switching(t: Transport): {
|
|
|
86
113
|
provider: CompareProvider;
|
|
87
114
|
days?: number;
|
|
88
115
|
}, options?: RequestOptions) => Promise<UsageComparison>;
|
|
89
|
-
/** Whether a switch can still be recorded, and what
|
|
116
|
+
/** Whether a switch can still be recorded, and what the welcome match paid. */
|
|
90
117
|
get: (options?: RequestOptions) => Promise<SwitchingSummary>;
|
|
91
118
|
/** Once per organization, before its first top-up. Recording the same
|
|
92
119
|
* provider again answers the same summary; another fails with 409. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** `runtime.switching`: compare your usage with a rival's published rates,
|
|
2
|
-
*
|
|
3
|
-
* $
|
|
2
|
+
* record the rival you are leaving, and read the welcome match: credit added
|
|
3
|
+
* within 30 days of signing up is matched, up to $1,000 in total, as each
|
|
4
|
+
* payment settles. */
|
|
4
5
|
export function switching(t) {
|
|
5
6
|
return {
|
|
6
7
|
/** Your settled sandbox usage over the last `days` (default 30, at most
|
|
@@ -11,7 +12,7 @@ export function switching(t) {
|
|
|
11
12
|
query: { provider: input.provider, days: input.days },
|
|
12
13
|
...options,
|
|
13
14
|
}),
|
|
14
|
-
/** Whether a switch can still be recorded, and what
|
|
15
|
+
/** Whether a switch can still be recorded, and what the welcome match paid. */
|
|
15
16
|
get: (options) => t.json({ method: "GET", path: "/v1/switching", ...options }),
|
|
16
17
|
/** Once per organization, before its first top-up. Recording the same
|
|
17
18
|
* provider again answers the same summary; another fails with 409. */
|
|
@@ -86,6 +86,9 @@ export type VolumeBackup = {
|
|
|
86
86
|
storedBytes: number | null;
|
|
87
87
|
meteredBytes: number | null;
|
|
88
88
|
error: string | null;
|
|
89
|
+
/** Why it failed, when a code says it: `backup_stalled` when its copy off
|
|
90
|
+
* the host never began; back it up again. */
|
|
91
|
+
errorCode?: string | null;
|
|
89
92
|
createdAt: string;
|
|
90
93
|
readyAt: string | null;
|
|
91
94
|
expiresAt: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { queues } from "./products/queues.js";
|
|
2
|
+
import type { streams } from "./products/streams.js";
|
|
3
|
+
/** Private until launch. CLOUD.md section 4. cli.ts does not call this module. */
|
|
4
|
+
export declare const RECORD_PRODUCTS: readonly ["queue", "stream"];
|
|
5
|
+
export type RecordProduct = (typeof RECORD_PRODUCTS)[number];
|
|
6
|
+
export type RecordClient = {
|
|
7
|
+
queues: ReturnType<typeof queues>;
|
|
8
|
+
streams: ReturnType<typeof streams>;
|
|
9
|
+
};
|
|
10
|
+
type Args = {
|
|
11
|
+
positional: string[];
|
|
12
|
+
flags: Map<string, string[]>;
|
|
13
|
+
rest?: string[];
|
|
14
|
+
};
|
|
15
|
+
type Out = {
|
|
16
|
+
json: boolean;
|
|
17
|
+
write(text: string): void;
|
|
18
|
+
error(text: string): void;
|
|
19
|
+
};
|
|
20
|
+
export declare const RECORD_HELP: Record<RecordProduct, string>;
|
|
21
|
+
/** Parsed like networkProductCommand; never obtains credentials for help or bad flags. */
|
|
22
|
+
export declare function recordCommand(product: RecordProduct, args: Args, out: Out, client: () => Promise<RecordClient>, signal?: AbortSignal): Promise<number>;
|
|
23
|
+
export {};
|