withruntime 1.1.2 → 1.4.58
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/README.md +5 -2
- package/dist/generated/agentSessions.d.ts +2 -2
- package/dist/generated/agentSessions.js +2 -2
- package/dist/generated/agents.d.ts +2 -2
- package/dist/generated/agents.js +1 -1
- package/dist/generated/apps.d.ts +8 -6
- package/dist/generated/apps.js +10 -6
- package/dist/generated/browsers.d.ts +8 -6
- package/dist/generated/browsers.js +10 -6
- package/dist/generated/builds.d.ts +8 -6
- package/dist/generated/builds.js +10 -6
- package/dist/generated/ci.d.ts +106 -6
- package/dist/generated/ci.js +14 -6
- package/dist/generated/containers.d.ts +8 -6
- package/dist/generated/containers.js +10 -6
- package/dist/generated/desktops.d.ts +8 -6
- package/dist/generated/desktops.js +10 -6
- package/dist/generated/dropins/e2b.d.ts +180 -0
- package/dist/generated/dropins/e2b.js +342 -0
- package/dist/generated/dropins/e2b_code_interpreter.d.ts +180 -0
- package/dist/generated/dropins/e2b_code_interpreter.js +342 -0
- package/dist/generated/dropins/modal.d.ts +195 -0
- package/dist/generated/dropins/modal.js +375 -0
- package/dist/generated/dropins/runtime.d.ts +74 -0
- package/dist/generated/dropins/runtime.js +180 -0
- package/dist/generated/dropins/vercel.d.ts +78 -0
- package/dist/generated/dropins/vercel.js +154 -0
- package/dist/generated/egressIps.d.ts +2 -2
- package/dist/generated/egressIps.js +2 -2
- package/dist/generated/functions.d.ts +8 -6
- package/dist/generated/functions.js +10 -6
- package/dist/generated/identities.d.ts +42 -4
- package/dist/generated/identities.js +60 -0
- package/dist/generated/images.d.ts +3 -0
- package/dist/generated/images.js +4 -0
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/jobs.d.ts +2 -2
- package/dist/generated/jobs.js +1 -1
- package/dist/generated/keys.d.ts +28 -0
- package/dist/generated/keys.js +4 -0
- package/dist/generated/notebooks.d.ts +8 -6
- package/dist/generated/notebooks.js +10 -6
- package/dist/generated/ports.d.ts +2 -0
- package/dist/generated/projects.d.ts +49 -7
- package/dist/generated/projects.js +72 -3
- package/dist/generated/roles.d.ts +43 -5
- package/dist/generated/roles.js +61 -0
- package/dist/generated/routes.js +1 -1
- package/dist/generated/runtime.d.ts +49 -3
- package/dist/generated/runtime.js +235 -26
- package/dist/generated/sandboxes.d.ts +33 -14
- package/dist/generated/sandboxes.js +10 -6
- package/dist/generated/sites.d.ts +8 -6
- package/dist/generated/sites.js +10 -6
- package/dist/generated/snapshots.d.ts +7 -2
- package/dist/generated/snapshots.js +6 -2
- package/dist/generated/usage.d.ts +9 -3
- package/dist/generated/volumes.d.ts +30 -11
- package/dist/generated/volumes.js +19 -6
- package/dist/generated/workspaces.d.ts +8 -6
- package/dist/generated/workspaces.js +10 -6
- package/dist/v2/cli.d.ts +29 -0
- package/dist/v2/cli.js +156 -7
- package/dist/v2/login.d.ts +4 -0
- package/dist/v2/login.js +1 -1
- package/dist/v2/mcp.d.ts +4 -2
- package/dist/v2/mcp.js +69 -12
- package/dist/v2/openapi.json +2656 -1375
- package/dist/v2/shims/base.d.ts +0 -3
- package/dist/v2/shims/base.js +2 -7
- package/dist/v2/shims/blaxel.js +2 -1
- package/dist/v2/shims/daytona.js +3 -2
- package/dist/v2/shims/morph.js +3 -1
- package/dist/v2/shims/vercel.js +2 -1
- package/package.json +3 -2
- package/dist/v2/shims/e2b.d.ts +0 -142
- package/dist/v2/shims/e2b.js +0 -238
package/README.md
CHANGED
|
@@ -15,8 +15,9 @@ Node.js 22.12 or later, or Bun. The package has no runtime dependencies.
|
|
|
15
15
|
|
|
16
16
|
## Authentication
|
|
17
17
|
|
|
18
|
-
The client reads your API key from `RUNTIME_API_KEY
|
|
19
|
-
|
|
18
|
+
The client reads your API key from `RUNTIME_API_KEY`, or else the key `npx withruntime login` saved on this computer
|
|
19
|
+
(it prints a link to approve in your browser, and no key is copied). On a server or in CI, create a key at
|
|
20
|
+
https://withruntime.com/account/keys and keep it in a secret manager, never in source code or a URL. A key pair's `rtsk_` secret also works: the client signs each
|
|
20
21
|
request with it and never sends it.
|
|
21
22
|
|
|
22
23
|
## Quickstart
|
|
@@ -65,6 +66,7 @@ const sbx = await runtime.sandboxes.create({ vcpu: 4, memoryGB: 8 });
|
|
|
65
66
|
| `Job` | `await Job.create()` | A command run in a fresh machine, once or on a cron schedule in a timezone. |
|
|
66
67
|
| `Image` | `await Image.create()` | What a machine boots: a root filesystem, its environment and its start. |
|
|
67
68
|
| `Volume` | `await Volume.create()` | A disk that outlives the machines it is attached to. |
|
|
69
|
+
| `Project` | `await Project.create()` | A project: where machines, storage, addresses and keys sit, each in one. |
|
|
68
70
|
| `Domain` | `await Domain.create()` | Your own hostname serving a machine's port, with HTTPS. |
|
|
69
71
|
|
|
70
72
|
Every machine (each class above with `files`) has `refresh`, `delete`, `pause`, `resume`, `exec`, `metrics`, `fork`, `snapshot`, `update`, `screenshot`, `act`, `runCode`, `spawn`, `files.read`, `files.write`, `files.remove`, `files.stat`, `files.list`, `files.downloadFolder`, `files.uploadFolder`, `files.beginFolderUpload`, `files.writeFolderUpload`, `files.commitFolderUpload`, `files.abortFolderUpload`, `files.mkdir`, `files.rename`, `files.link`, `files.revokeLinks`, `processes.output`, `processes.write`, `processes.signal`, `processes.resize`, `processes.list`, `network.get`, `network.set`.
|
|
@@ -72,6 +74,7 @@ Every machine (each class above with `files`) has `refresh`, `delete`, `pause`,
|
|
|
72
74
|
- `Sandbox` also has `execStream`, `previews.create`.
|
|
73
75
|
- `Job` also has `run`.
|
|
74
76
|
- `Image` also has `logs`.
|
|
77
|
+
- `Project` also has `limits`.
|
|
75
78
|
- `Domain` also has `verify`.
|
|
76
79
|
|
|
77
80
|
The API's other resources (keys, projects, roles, secrets, snapshots, webhooks, usage and more) are clients on the
|
|
@@ -185,7 +185,7 @@ export declare class AgentSessions {
|
|
|
185
185
|
beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
|
|
186
186
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
187
187
|
writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: AgentSessionWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
188
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
188
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
189
189
|
commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
190
190
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
191
191
|
abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -193,7 +193,7 @@ export declare class AgentSessions {
|
|
|
193
193
|
mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
|
|
194
194
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
195
195
|
rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
196
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its agent.session. A paused agent.session is woken for it unless wake is false. */
|
|
196
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its agent.session. A paused agent.session is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
197
197
|
link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
|
|
198
198
|
/** Ends every file link made for an agent session so far; links made after work. */
|
|
199
199
|
revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;
|
|
@@ -91,7 +91,7 @@ export class AgentSessions {
|
|
|
91
91
|
writeFolderUpload(id, upload, data, query = {}, options) {
|
|
92
92
|
return this.transport.request("PUT", `/v2/agent-sessions/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}`, { data: toBytes(data), query: { ...query }, options, idempotent: true });
|
|
93
93
|
}
|
|
94
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
94
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
95
95
|
commitFolderUpload(id, upload, options) {
|
|
96
96
|
return this.transport.request("POST", `/v2/agent-sessions/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}:commit`, { options, idempotent: true });
|
|
97
97
|
}
|
|
@@ -107,7 +107,7 @@ export class AgentSessions {
|
|
|
107
107
|
rename(id, input, options) {
|
|
108
108
|
return this.transport.request("POST", `/v2/agent-sessions/${encodeURIComponent(id)}/files:rename`, { body: input, options });
|
|
109
109
|
}
|
|
110
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its agent.session. A paused agent.session is woken for it unless wake is false. */
|
|
110
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its agent.session. A paused agent.session is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
111
111
|
link(id, input, options) {
|
|
112
112
|
return this.transport.request("POST", `/v2/agent-sessions/${encodeURIComponent(id)}/files:link`, { body: input, options });
|
|
113
113
|
}
|
|
@@ -35,7 +35,7 @@ export interface AgentSettings {
|
|
|
35
35
|
mcpServers?: McpServer[];
|
|
36
36
|
/** The other secrets each session may get, by name, at most 64: only those of them whose scope admits it; [] none. At most 64 items. */
|
|
37
37
|
secrets?: string[];
|
|
38
|
-
/** Each session's vCPUs. At least
|
|
38
|
+
/** Each session's vCPUs. At least 2. Default: 2. */
|
|
39
39
|
vcpu?: number;
|
|
40
40
|
/** Each session's memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). At least 1. Default: 4. */
|
|
41
41
|
memoryGB?: number;
|
|
@@ -131,7 +131,7 @@ export declare class Agent {
|
|
|
131
131
|
get mcpServers(): McpServer[] | undefined;
|
|
132
132
|
/** The other secrets each session may get, by name, at most 64: only those of them whose scope admits it; [] none. At most 64 items. */
|
|
133
133
|
get secrets(): string[] | undefined;
|
|
134
|
-
/** Each session's vCPUs. At least
|
|
134
|
+
/** Each session's vCPUs. At least 2. Default: 2. */
|
|
135
135
|
get vcpu(): number | undefined;
|
|
136
136
|
/** Each session's memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). At least 1. Default: 4. */
|
|
137
137
|
get memoryGB(): number | undefined;
|
package/dist/generated/agents.js
CHANGED
package/dist/generated/apps.d.ts
CHANGED
|
@@ -164,7 +164,7 @@ export declare class AppFiles {
|
|
|
164
164
|
beginFolderUpload(path: string, input?: Omit<FolderUploadBegin, "path">, options?: RequestOptions): Promise<FolderUpload>;
|
|
165
165
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
166
166
|
writeFolderUpload(upload: string, data: Uint8Array | string, query?: AppWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
167
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
167
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
168
168
|
commitFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
169
169
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
170
170
|
abortFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -172,7 +172,7 @@ export declare class AppFiles {
|
|
|
172
172
|
mkdir(path: string, input?: Omit<FileMkdir, "path">, options?: RequestOptions): Promise<FileMade>;
|
|
173
173
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
174
174
|
rename(input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
175
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. */
|
|
175
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
176
176
|
link(path: string, input?: Omit<FileLinkCreate, "path">, options?: RequestOptions): Promise<FileLink>;
|
|
177
177
|
/** Ends every file link made for an app so far; links made after work. */
|
|
178
178
|
revokeLinks(options?: RequestOptions): Promise<FileLinksRevoked>;
|
|
@@ -212,7 +212,7 @@ export declare class App {
|
|
|
212
212
|
constructor(client: Apps, info: SandboxInfo);
|
|
213
213
|
/** Its id. */
|
|
214
214
|
get id(): string;
|
|
215
|
-
/** Its vCPUs; its product's default when omitted. At least
|
|
215
|
+
/** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
|
|
216
216
|
get vcpu(): number | undefined;
|
|
217
217
|
/** Its memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). Its product's default when omitted. At least 1. */
|
|
218
218
|
get memoryGB(): number | undefined;
|
|
@@ -220,7 +220,7 @@ export declare class App {
|
|
|
220
220
|
get diskGB(): number | undefined;
|
|
221
221
|
/** The image it boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
|
|
222
222
|
get image(): string | undefined;
|
|
223
|
-
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created.
|
|
223
|
+
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
|
|
224
224
|
get secrets(): string[] | undefined;
|
|
225
225
|
/** The command it starts at every fresh boot and keeps running, as a service: a web server, a runner, a desktop. A wake with its memory kept does not start it again. Its image's when omitted. */
|
|
226
226
|
get start(): MachineStart | undefined;
|
|
@@ -254,6 +254,8 @@ export declare class App {
|
|
|
254
254
|
get pausedAt(): string | undefined;
|
|
255
255
|
/** A create's answer alone, for a start with a ready check: how its wait went. */
|
|
256
256
|
get ready(): MachineReady | undefined;
|
|
257
|
+
/** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
|
|
258
|
+
get url(): string | undefined;
|
|
257
259
|
/** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
|
|
258
260
|
get deleteAt(): string | undefined;
|
|
259
261
|
/** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
|
|
@@ -335,7 +337,7 @@ export declare class Apps {
|
|
|
335
337
|
beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
|
|
336
338
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
337
339
|
writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: AppWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
338
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
340
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
339
341
|
commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
340
342
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
341
343
|
abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -343,7 +345,7 @@ export declare class Apps {
|
|
|
343
345
|
mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
|
|
344
346
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
345
347
|
rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
346
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. */
|
|
348
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
347
349
|
link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
|
|
348
350
|
/** Ends every file link made for an app so far; links made after work. */
|
|
349
351
|
revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;
|
package/dist/generated/apps.js
CHANGED
|
@@ -45,7 +45,7 @@ export class AppFiles {
|
|
|
45
45
|
writeFolderUpload(upload, data, query = {}, options) {
|
|
46
46
|
return this.#c.writeFolderUpload(this.#id, upload, data, query, options);
|
|
47
47
|
}
|
|
48
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
48
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
49
49
|
commitFolderUpload(upload, options) {
|
|
50
50
|
return this.#c.commitFolderUpload(this.#id, upload, options);
|
|
51
51
|
}
|
|
@@ -61,7 +61,7 @@ export class AppFiles {
|
|
|
61
61
|
rename(input, options) {
|
|
62
62
|
return this.#c.rename(this.#id, input, options);
|
|
63
63
|
}
|
|
64
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. */
|
|
64
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
65
65
|
link(path, input = {}, options) {
|
|
66
66
|
return this.#c.link(this.#id, { ...input, path: path }, options);
|
|
67
67
|
}
|
|
@@ -135,7 +135,7 @@ export class App {
|
|
|
135
135
|
get id() {
|
|
136
136
|
return this.info.id;
|
|
137
137
|
}
|
|
138
|
-
/** Its vCPUs; its product's default when omitted. At least
|
|
138
|
+
/** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
|
|
139
139
|
get vcpu() {
|
|
140
140
|
return this.info.vcpu;
|
|
141
141
|
}
|
|
@@ -151,7 +151,7 @@ export class App {
|
|
|
151
151
|
get image() {
|
|
152
152
|
return this.info.image;
|
|
153
153
|
}
|
|
154
|
-
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created.
|
|
154
|
+
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
|
|
155
155
|
get secrets() {
|
|
156
156
|
return this.info.secrets;
|
|
157
157
|
}
|
|
@@ -219,6 +219,10 @@ export class App {
|
|
|
219
219
|
get ready() {
|
|
220
220
|
return this.info.ready;
|
|
221
221
|
}
|
|
222
|
+
/** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
|
|
223
|
+
get url() {
|
|
224
|
+
return this.info.url;
|
|
225
|
+
}
|
|
222
226
|
/** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
|
|
223
227
|
get deleteAt() {
|
|
224
228
|
return this.info.deleteAt;
|
|
@@ -382,7 +386,7 @@ export class Apps {
|
|
|
382
386
|
writeFolderUpload(id, upload, data, query = {}, options) {
|
|
383
387
|
return this.transport.request("PUT", `/v2/apps/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}`, { data: toBytes(data), query: { ...query }, options, idempotent: true });
|
|
384
388
|
}
|
|
385
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
389
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
386
390
|
commitFolderUpload(id, upload, options) {
|
|
387
391
|
return this.transport.request("POST", `/v2/apps/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}:commit`, { options, idempotent: true });
|
|
388
392
|
}
|
|
@@ -398,7 +402,7 @@ export class Apps {
|
|
|
398
402
|
rename(id, input, options) {
|
|
399
403
|
return this.transport.request("POST", `/v2/apps/${encodeURIComponent(id)}/files:rename`, { body: input, options });
|
|
400
404
|
}
|
|
401
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. */
|
|
405
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its app. A paused app is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
402
406
|
link(id, input, options) {
|
|
403
407
|
return this.transport.request("POST", `/v2/apps/${encodeURIComponent(id)}/files:link`, { body: input, options });
|
|
404
408
|
}
|
|
@@ -164,7 +164,7 @@ export declare class BrowserFiles {
|
|
|
164
164
|
beginFolderUpload(path: string, input?: Omit<FolderUploadBegin, "path">, options?: RequestOptions): Promise<FolderUpload>;
|
|
165
165
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
166
166
|
writeFolderUpload(upload: string, data: Uint8Array | string, query?: BrowserWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
167
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
167
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
168
168
|
commitFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
169
169
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
170
170
|
abortFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -172,7 +172,7 @@ export declare class BrowserFiles {
|
|
|
172
172
|
mkdir(path: string, input?: Omit<FileMkdir, "path">, options?: RequestOptions): Promise<FileMade>;
|
|
173
173
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
174
174
|
rename(input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
175
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. */
|
|
175
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
176
176
|
link(path: string, input?: Omit<FileLinkCreate, "path">, options?: RequestOptions): Promise<FileLink>;
|
|
177
177
|
/** Ends every file link made for a browser so far; links made after work. */
|
|
178
178
|
revokeLinks(options?: RequestOptions): Promise<FileLinksRevoked>;
|
|
@@ -212,7 +212,7 @@ export declare class Browser {
|
|
|
212
212
|
constructor(client: Browsers, info: SandboxInfo);
|
|
213
213
|
/** Its id. */
|
|
214
214
|
get id(): string;
|
|
215
|
-
/** Its vCPUs; its product's default when omitted. At least
|
|
215
|
+
/** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
|
|
216
216
|
get vcpu(): number | undefined;
|
|
217
217
|
/** Its memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). Its product's default when omitted. At least 1. */
|
|
218
218
|
get memoryGB(): number | undefined;
|
|
@@ -220,7 +220,7 @@ export declare class Browser {
|
|
|
220
220
|
get diskGB(): number | undefined;
|
|
221
221
|
/** The image it boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
|
|
222
222
|
get image(): string | undefined;
|
|
223
|
-
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created.
|
|
223
|
+
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
|
|
224
224
|
get secrets(): string[] | undefined;
|
|
225
225
|
/** The command it starts at every fresh boot and keeps running, as a service: a web server, a runner, a desktop. A wake with its memory kept does not start it again. Its image's when omitted. */
|
|
226
226
|
get start(): MachineStart | undefined;
|
|
@@ -254,6 +254,8 @@ export declare class Browser {
|
|
|
254
254
|
get pausedAt(): string | undefined;
|
|
255
255
|
/** A create's answer alone, for a start with a ready check: how its wait went. */
|
|
256
256
|
get ready(): MachineReady | undefined;
|
|
257
|
+
/** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
|
|
258
|
+
get url(): string | undefined;
|
|
257
259
|
/** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
|
|
258
260
|
get deleteAt(): string | undefined;
|
|
259
261
|
/** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
|
|
@@ -335,7 +337,7 @@ export declare class Browsers {
|
|
|
335
337
|
beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
|
|
336
338
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
337
339
|
writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: BrowserWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
338
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
340
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
339
341
|
commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
340
342
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
341
343
|
abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -343,7 +345,7 @@ export declare class Browsers {
|
|
|
343
345
|
mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
|
|
344
346
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
345
347
|
rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
346
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. */
|
|
348
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
347
349
|
link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
|
|
348
350
|
/** Ends every file link made for a browser so far; links made after work. */
|
|
349
351
|
revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;
|
|
@@ -45,7 +45,7 @@ export class BrowserFiles {
|
|
|
45
45
|
writeFolderUpload(upload, data, query = {}, options) {
|
|
46
46
|
return this.#c.writeFolderUpload(this.#id, upload, data, query, options);
|
|
47
47
|
}
|
|
48
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
48
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
49
49
|
commitFolderUpload(upload, options) {
|
|
50
50
|
return this.#c.commitFolderUpload(this.#id, upload, options);
|
|
51
51
|
}
|
|
@@ -61,7 +61,7 @@ export class BrowserFiles {
|
|
|
61
61
|
rename(input, options) {
|
|
62
62
|
return this.#c.rename(this.#id, input, options);
|
|
63
63
|
}
|
|
64
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. */
|
|
64
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
65
65
|
link(path, input = {}, options) {
|
|
66
66
|
return this.#c.link(this.#id, { ...input, path: path }, options);
|
|
67
67
|
}
|
|
@@ -135,7 +135,7 @@ export class Browser {
|
|
|
135
135
|
get id() {
|
|
136
136
|
return this.info.id;
|
|
137
137
|
}
|
|
138
|
-
/** Its vCPUs; its product's default when omitted. At least
|
|
138
|
+
/** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
|
|
139
139
|
get vcpu() {
|
|
140
140
|
return this.info.vcpu;
|
|
141
141
|
}
|
|
@@ -151,7 +151,7 @@ export class Browser {
|
|
|
151
151
|
get image() {
|
|
152
152
|
return this.info.image;
|
|
153
153
|
}
|
|
154
|
-
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created.
|
|
154
|
+
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
|
|
155
155
|
get secrets() {
|
|
156
156
|
return this.info.secrets;
|
|
157
157
|
}
|
|
@@ -219,6 +219,10 @@ export class Browser {
|
|
|
219
219
|
get ready() {
|
|
220
220
|
return this.info.ready;
|
|
221
221
|
}
|
|
222
|
+
/** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
|
|
223
|
+
get url() {
|
|
224
|
+
return this.info.url;
|
|
225
|
+
}
|
|
222
226
|
/** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
|
|
223
227
|
get deleteAt() {
|
|
224
228
|
return this.info.deleteAt;
|
|
@@ -382,7 +386,7 @@ export class Browsers {
|
|
|
382
386
|
writeFolderUpload(id, upload, data, query = {}, options) {
|
|
383
387
|
return this.transport.request("PUT", `/v2/browsers/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}`, { data: toBytes(data), query: { ...query }, options, idempotent: true });
|
|
384
388
|
}
|
|
385
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
389
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
386
390
|
commitFolderUpload(id, upload, options) {
|
|
387
391
|
return this.transport.request("POST", `/v2/browsers/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}:commit`, { options, idempotent: true });
|
|
388
392
|
}
|
|
@@ -398,7 +402,7 @@ export class Browsers {
|
|
|
398
402
|
rename(id, input, options) {
|
|
399
403
|
return this.transport.request("POST", `/v2/browsers/${encodeURIComponent(id)}/files:rename`, { body: input, options });
|
|
400
404
|
}
|
|
401
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. */
|
|
405
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its browser. A paused browser is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
402
406
|
link(id, input, options) {
|
|
403
407
|
return this.transport.request("POST", `/v2/browsers/${encodeURIComponent(id)}/files:link`, { body: input, options });
|
|
404
408
|
}
|
|
@@ -164,7 +164,7 @@ export declare class BuildFiles {
|
|
|
164
164
|
beginFolderUpload(path: string, input?: Omit<FolderUploadBegin, "path">, options?: RequestOptions): Promise<FolderUpload>;
|
|
165
165
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
166
166
|
writeFolderUpload(upload: string, data: Uint8Array | string, query?: BuildWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
167
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
167
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
168
168
|
commitFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
169
169
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
170
170
|
abortFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -172,7 +172,7 @@ export declare class BuildFiles {
|
|
|
172
172
|
mkdir(path: string, input?: Omit<FileMkdir, "path">, options?: RequestOptions): Promise<FileMade>;
|
|
173
173
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
174
174
|
rename(input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
175
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. */
|
|
175
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
176
176
|
link(path: string, input?: Omit<FileLinkCreate, "path">, options?: RequestOptions): Promise<FileLink>;
|
|
177
177
|
/** Ends every file link made for a build so far; links made after work. */
|
|
178
178
|
revokeLinks(options?: RequestOptions): Promise<FileLinksRevoked>;
|
|
@@ -212,7 +212,7 @@ export declare class Build {
|
|
|
212
212
|
constructor(client: Builds, info: SandboxInfo);
|
|
213
213
|
/** Its id. */
|
|
214
214
|
get id(): string;
|
|
215
|
-
/** Its vCPUs; its product's default when omitted. At least
|
|
215
|
+
/** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
|
|
216
216
|
get vcpu(): number | undefined;
|
|
217
217
|
/** Its memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). Its product's default when omitted. At least 1. */
|
|
218
218
|
get memoryGB(): number | undefined;
|
|
@@ -220,7 +220,7 @@ export declare class Build {
|
|
|
220
220
|
get diskGB(): number | undefined;
|
|
221
221
|
/** The image it boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
|
|
222
222
|
get image(): string | undefined;
|
|
223
|
-
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created.
|
|
223
|
+
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
|
|
224
224
|
get secrets(): string[] | undefined;
|
|
225
225
|
/** The command it starts at every fresh boot and keeps running, as a service: a web server, a runner, a desktop. A wake with its memory kept does not start it again. Its image's when omitted. */
|
|
226
226
|
get start(): MachineStart | undefined;
|
|
@@ -254,6 +254,8 @@ export declare class Build {
|
|
|
254
254
|
get pausedAt(): string | undefined;
|
|
255
255
|
/** A create's answer alone, for a start with a ready check: how its wait went. */
|
|
256
256
|
get ready(): MachineReady | undefined;
|
|
257
|
+
/** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
|
|
258
|
+
get url(): string | undefined;
|
|
257
259
|
/** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
|
|
258
260
|
get deleteAt(): string | undefined;
|
|
259
261
|
/** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
|
|
@@ -335,7 +337,7 @@ export declare class Builds {
|
|
|
335
337
|
beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
|
|
336
338
|
/** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
|
|
337
339
|
writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: BuildWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
|
|
338
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
340
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
339
341
|
commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
|
|
340
342
|
/** Stops a folder upload's tar; what it unpacked so far stays. */
|
|
341
343
|
abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
|
|
@@ -343,7 +345,7 @@ export declare class Builds {
|
|
|
343
345
|
mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
|
|
344
346
|
/** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
|
|
345
347
|
rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
|
|
346
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. */
|
|
348
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
347
349
|
link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
|
|
348
350
|
/** Ends every file link made for a build so far; links made after work. */
|
|
349
351
|
revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;
|
package/dist/generated/builds.js
CHANGED
|
@@ -45,7 +45,7 @@ export class BuildFiles {
|
|
|
45
45
|
writeFolderUpload(upload, data, query = {}, options) {
|
|
46
46
|
return this.#c.writeFolderUpload(this.#id, upload, data, query, options);
|
|
47
47
|
}
|
|
48
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
48
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
49
49
|
commitFolderUpload(upload, options) {
|
|
50
50
|
return this.#c.commitFolderUpload(this.#id, upload, options);
|
|
51
51
|
}
|
|
@@ -61,7 +61,7 @@ export class BuildFiles {
|
|
|
61
61
|
rename(input, options) {
|
|
62
62
|
return this.#c.rename(this.#id, input, options);
|
|
63
63
|
}
|
|
64
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. */
|
|
64
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
65
65
|
link(path, input = {}, options) {
|
|
66
66
|
return this.#c.link(this.#id, { ...input, path: path }, options);
|
|
67
67
|
}
|
|
@@ -135,7 +135,7 @@ export class Build {
|
|
|
135
135
|
get id() {
|
|
136
136
|
return this.info.id;
|
|
137
137
|
}
|
|
138
|
-
/** Its vCPUs; its product's default when omitted. At least
|
|
138
|
+
/** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
|
|
139
139
|
get vcpu() {
|
|
140
140
|
return this.info.vcpu;
|
|
141
141
|
}
|
|
@@ -151,7 +151,7 @@ export class Build {
|
|
|
151
151
|
get image() {
|
|
152
152
|
return this.info.image;
|
|
153
153
|
}
|
|
154
|
-
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created.
|
|
154
|
+
/** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
|
|
155
155
|
get secrets() {
|
|
156
156
|
return this.info.secrets;
|
|
157
157
|
}
|
|
@@ -219,6 +219,10 @@ export class Build {
|
|
|
219
219
|
get ready() {
|
|
220
220
|
return this.info.ready;
|
|
221
221
|
}
|
|
222
|
+
/** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
|
|
223
|
+
get url() {
|
|
224
|
+
return this.info.url;
|
|
225
|
+
}
|
|
222
226
|
/** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
|
|
223
227
|
get deleteAt() {
|
|
224
228
|
return this.info.deleteAt;
|
|
@@ -382,7 +386,7 @@ export class Builds {
|
|
|
382
386
|
writeFolderUpload(id, upload, data, query = {}, options) {
|
|
383
387
|
return this.transport.request("PUT", `/v2/builds/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}`, { data: toBytes(data), query: { ...query }, options, idempotent: true });
|
|
384
388
|
}
|
|
385
|
-
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said.
|
|
389
|
+
/** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
|
|
386
390
|
commitFolderUpload(id, upload, options) {
|
|
387
391
|
return this.transport.request("POST", `/v2/builds/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}:commit`, { options, idempotent: true });
|
|
388
392
|
}
|
|
@@ -398,7 +402,7 @@ export class Builds {
|
|
|
398
402
|
rename(id, input, options) {
|
|
399
403
|
return this.transport.request("POST", `/v2/builds/${encodeURIComponent(id)}/files:rename`, { body: input, options });
|
|
400
404
|
}
|
|
401
|
-
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. */
|
|
405
|
+
/** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its build. A paused build is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
|
|
402
406
|
link(id, input, options) {
|
|
403
407
|
return this.transport.request("POST", `/v2/builds/${encodeURIComponent(id)}/files:link`, { body: input, options });
|
|
404
408
|
}
|