@vercel/sandbox 2.0.0-beta.2 → 2.0.0-beta.20

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.
Files changed (208) hide show
  1. package/README.md +48 -1
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  3. package/dist/api-client/api-client.cjs +445 -0
  4. package/dist/api-client/api-client.cjs.map +1 -0
  5. package/dist/api-client/api-client.d.cts +6235 -0
  6. package/dist/api-client/api-client.d.ts +6229 -706
  7. package/dist/api-client/api-client.js +436 -472
  8. package/dist/api-client/api-client.js.map +1 -1
  9. package/dist/api-client/api-error.cjs +32 -0
  10. package/dist/api-client/api-error.cjs.map +1 -0
  11. package/dist/api-client/api-error.d.cts +29 -0
  12. package/dist/api-client/api-error.d.ts +21 -16
  13. package/dist/api-client/api-error.js +28 -32
  14. package/dist/api-client/api-error.js.map +1 -1
  15. package/dist/api-client/base-client.cjs +126 -0
  16. package/dist/api-client/base-client.cjs.map +1 -0
  17. package/dist/api-client/base-client.d.cts +38 -0
  18. package/dist/api-client/base-client.d.ts +31 -36
  19. package/dist/api-client/base-client.js +114 -118
  20. package/dist/api-client/base-client.js.map +1 -1
  21. package/dist/api-client/file-writer.cjs +62 -0
  22. package/dist/api-client/file-writer.cjs.map +1 -0
  23. package/dist/api-client/file-writer.d.cts +66 -0
  24. package/dist/api-client/file-writer.d.ts +56 -42
  25. package/dist/api-client/file-writer.js +57 -61
  26. package/dist/api-client/file-writer.js.map +1 -1
  27. package/dist/api-client/index.cjs +2 -0
  28. package/dist/api-client/index.d.ts +2 -2
  29. package/dist/api-client/index.js +4 -21
  30. package/dist/api-client/validators.cjs +229 -0
  31. package/dist/api-client/validators.cjs.map +1 -0
  32. package/dist/api-client/validators.d.cts +26885 -0
  33. package/dist/api-client/validators.d.ts +26732 -3706
  34. package/dist/api-client/validators.js +198 -191
  35. package/dist/api-client/validators.js.map +1 -1
  36. package/dist/api-client/with-retry.cjs +89 -0
  37. package/dist/api-client/with-retry.cjs.map +1 -0
  38. package/dist/api-client/with-retry.d.cts +10 -0
  39. package/dist/api-client/with-retry.d.ts +9 -13
  40. package/dist/api-client/with-retry.js +81 -102
  41. package/dist/api-client/with-retry.js.map +1 -1
  42. package/dist/auth/api.cjs +29 -0
  43. package/dist/auth/api.cjs.map +1 -0
  44. package/dist/auth/api.js +26 -25
  45. package/dist/auth/api.js.map +1 -1
  46. package/dist/auth/error.cjs +13 -0
  47. package/dist/auth/error.cjs.map +1 -0
  48. package/dist/auth/error.js +11 -11
  49. package/dist/auth/error.js.map +1 -1
  50. package/dist/auth/file.cjs +64 -0
  51. package/dist/auth/file.cjs.map +1 -0
  52. package/dist/auth/file.d.cts +26 -0
  53. package/dist/auth/file.d.ts +19 -15
  54. package/dist/auth/file.js +49 -64
  55. package/dist/auth/file.js.map +1 -1
  56. package/dist/auth/index.cjs +11 -0
  57. package/dist/auth/index.d.cts +5 -0
  58. package/dist/auth/index.d.ts +5 -6
  59. package/dist/auth/index.js +6 -27
  60. package/dist/auth/linked-project.cjs +38 -0
  61. package/dist/auth/linked-project.cjs.map +1 -0
  62. package/dist/auth/linked-project.js +30 -64
  63. package/dist/auth/linked-project.js.map +1 -1
  64. package/dist/auth/oauth.cjs +205 -0
  65. package/dist/auth/oauth.cjs.map +1 -0
  66. package/dist/auth/oauth.d.cts +135 -0
  67. package/dist/auth/oauth.d.ts +113 -109
  68. package/dist/auth/oauth.js +185 -252
  69. package/dist/auth/oauth.js.map +1 -1
  70. package/dist/auth/poll-for-token.cjs +82 -0
  71. package/dist/auth/poll-for-token.cjs.map +1 -0
  72. package/dist/auth/poll-for-token.d.cts +28 -0
  73. package/dist/auth/poll-for-token.d.ts +23 -15
  74. package/dist/auth/poll-for-token.js +79 -64
  75. package/dist/auth/poll-for-token.js.map +1 -1
  76. package/dist/auth/project.cjs +178 -0
  77. package/dist/auth/project.cjs.map +1 -0
  78. package/dist/auth/project.d.cts +40 -0
  79. package/dist/auth/project.d.ts +19 -19
  80. package/dist/auth/project.js +169 -72
  81. package/dist/auth/project.js.map +1 -1
  82. package/dist/auth/zod.cjs +22 -0
  83. package/dist/auth/zod.cjs.map +1 -0
  84. package/dist/auth/zod.js +18 -17
  85. package/dist/auth/zod.js.map +1 -1
  86. package/dist/command.cjs +328 -0
  87. package/dist/command.cjs.map +1 -0
  88. package/dist/command.d.cts +289 -0
  89. package/dist/command.d.ts +265 -171
  90. package/dist/command.js +323 -226
  91. package/dist/command.js.map +1 -1
  92. package/dist/constants.d.cts +5 -0
  93. package/dist/constants.d.ts +5 -1
  94. package/dist/filesystem.cjs +499 -0
  95. package/dist/filesystem.cjs.map +1 -0
  96. package/dist/filesystem.d.cts +258 -0
  97. package/dist/filesystem.d.ts +258 -0
  98. package/dist/filesystem.js +497 -0
  99. package/dist/filesystem.js.map +1 -0
  100. package/dist/index.cjs +15 -0
  101. package/dist/index.d.cts +8 -0
  102. package/dist/index.d.ts +8 -6
  103. package/dist/index.js +8 -17
  104. package/dist/network-policy.d.cts +156 -0
  105. package/dist/network-policy.d.ts +88 -28
  106. package/dist/sandbox.cjs +816 -0
  107. package/dist/sandbox.cjs.map +1 -0
  108. package/dist/sandbox.d.cts +2847 -0
  109. package/dist/sandbox.d.ts +2834 -628
  110. package/dist/sandbox.js +808 -557
  111. package/dist/sandbox.js.map +1 -1
  112. package/dist/session.cjs +527 -0
  113. package/dist/session.cjs.map +1 -0
  114. package/dist/session.d.cts +410 -0
  115. package/dist/session.d.ts +403 -368
  116. package/dist/session.js +524 -489
  117. package/dist/session.js.map +1 -1
  118. package/dist/snapshot.cjs +204 -0
  119. package/dist/snapshot.cjs.map +1 -0
  120. package/dist/snapshot.d.cts +161 -0
  121. package/dist/snapshot.d.ts +152 -92
  122. package/dist/snapshot.js +201 -114
  123. package/dist/snapshot.js.map +1 -1
  124. package/dist/utils/array.cjs +17 -0
  125. package/dist/utils/array.cjs.map +1 -0
  126. package/dist/utils/array.js +12 -15
  127. package/dist/utils/array.js.map +1 -1
  128. package/dist/utils/consume-readable.cjs +18 -0
  129. package/dist/utils/consume-readable.cjs.map +1 -0
  130. package/dist/utils/consume-readable.js +13 -12
  131. package/dist/utils/consume-readable.js.map +1 -1
  132. package/dist/utils/decode-base64-url.cjs +15 -0
  133. package/dist/utils/decode-base64-url.cjs.map +1 -0
  134. package/dist/utils/decode-base64-url.js +10 -9
  135. package/dist/utils/decode-base64-url.js.map +1 -1
  136. package/dist/utils/dev-credentials.cjs +142 -0
  137. package/dist/utils/dev-credentials.cjs.map +1 -0
  138. package/dist/utils/dev-credentials.js +126 -184
  139. package/dist/utils/dev-credentials.js.map +1 -1
  140. package/dist/utils/get-credentials.cjs +123 -0
  141. package/dist/utils/get-credentials.cjs.map +1 -0
  142. package/dist/utils/get-credentials.d.cts +21 -0
  143. package/dist/utils/get-credentials.d.ts +19 -61
  144. package/dist/utils/get-credentials.js +106 -140
  145. package/dist/utils/get-credentials.js.map +1 -1
  146. package/dist/utils/log.cjs +25 -0
  147. package/dist/utils/log.cjs.map +1 -0
  148. package/dist/utils/log.js +15 -17
  149. package/dist/utils/log.js.map +1 -1
  150. package/dist/utils/network-policy.cjs +49 -0
  151. package/dist/utils/network-policy.cjs.map +1 -0
  152. package/dist/utils/network-policy.js +42 -77
  153. package/dist/utils/network-policy.js.map +1 -1
  154. package/dist/utils/normalizePath.cjs +27 -0
  155. package/dist/utils/normalizePath.cjs.map +1 -0
  156. package/dist/utils/normalizePath.js +21 -28
  157. package/dist/utils/normalizePath.js.map +1 -1
  158. package/dist/utils/paginator.cjs +41 -0
  159. package/dist/utils/paginator.cjs.map +1 -0
  160. package/dist/utils/paginator.d.cts +16 -0
  161. package/dist/utils/paginator.d.ts +16 -0
  162. package/dist/utils/paginator.js +40 -0
  163. package/dist/utils/paginator.js.map +1 -0
  164. package/dist/utils/resolveSignal.cjs +20 -0
  165. package/dist/utils/resolveSignal.cjs.map +1 -0
  166. package/dist/utils/resolveSignal.d.cts +15 -0
  167. package/dist/utils/resolveSignal.d.ts +12 -10
  168. package/dist/utils/resolveSignal.js +14 -17
  169. package/dist/utils/resolveSignal.js.map +1 -1
  170. package/dist/utils/sandbox-snapshot.cjs +14 -0
  171. package/dist/utils/sandbox-snapshot.cjs.map +1 -0
  172. package/dist/utils/sandbox-snapshot.d.cts +10 -0
  173. package/dist/utils/sandbox-snapshot.d.ts +11 -0
  174. package/dist/utils/sandbox-snapshot.js +14 -0
  175. package/dist/utils/sandbox-snapshot.js.map +1 -0
  176. package/dist/utils/types.cjs +13 -0
  177. package/dist/utils/types.cjs.map +1 -0
  178. package/dist/utils/types.d.cts +11 -0
  179. package/dist/utils/types.d.ts +5 -7
  180. package/dist/utils/types.js +8 -8
  181. package/dist/utils/types.js.map +1 -1
  182. package/dist/version.cjs +7 -0
  183. package/dist/version.cjs.map +1 -0
  184. package/dist/version.js +5 -5
  185. package/dist/version.js.map +1 -1
  186. package/package.json +23 -3
  187. package/dist/api-client/index.js.map +0 -1
  188. package/dist/auth/api.d.ts +0 -6
  189. package/dist/auth/error.d.ts +0 -11
  190. package/dist/auth/index.js.map +0 -1
  191. package/dist/auth/linked-project.d.ts +0 -10
  192. package/dist/auth/zod.d.ts +0 -5
  193. package/dist/constants.js +0 -3
  194. package/dist/constants.js.map +0 -1
  195. package/dist/index.js.map +0 -1
  196. package/dist/network-policy.js +0 -3
  197. package/dist/network-policy.js.map +0 -1
  198. package/dist/utils/array.d.ts +0 -9
  199. package/dist/utils/consume-readable.d.ts +0 -5
  200. package/dist/utils/convert-sandbox.d.ts +0 -6
  201. package/dist/utils/convert-sandbox.js +0 -14
  202. package/dist/utils/convert-sandbox.js.map +0 -1
  203. package/dist/utils/decode-base64-url.d.ts +0 -7
  204. package/dist/utils/dev-credentials.d.ts +0 -37
  205. package/dist/utils/log.d.ts +0 -2
  206. package/dist/utils/network-policy.d.ts +0 -7
  207. package/dist/utils/normalizePath.d.ts +0 -17
  208. package/dist/version.d.ts +0 -1
package/dist/sandbox.d.ts CHANGED
@@ -1,642 +1,2848 @@
1
- import type { SandboxMetaData, SandboxRouteData, NamedSandboxMetaData } from "./api-client";
2
- import { APIClient } from "./api-client";
3
- import { type Credentials } from "./utils/get-credentials";
4
- import { type WithPrivate } from "./utils/types";
5
- import type { WithFetchOptions } from "./api-client/api-client";
6
- import type { RUNTIMES } from "./constants";
7
- import { Session, type RunCommandParams } from "./session";
8
- import type { Command, CommandFinished } from "./command";
9
- import type { Snapshot } from "./snapshot";
10
- import type { ConvertedSandbox } from "./utils/convert-sandbox";
11
- import type { NetworkPolicy } from "./network-policy";
12
- export type { NetworkPolicy };
1
+ import { Paginator } from "./utils/paginator.js";
2
+ import { SandboxMetaData, SandboxRouteData, SessionMetaData, SnapshotMetadata } from "./api-client/validators.js";
3
+ import { NetworkPolicy, NetworkPolicyKeyValueMatcher, NetworkPolicyMatch, NetworkPolicyMatcher } from "./network-policy.js";
4
+ import { WithPrivate } from "./utils/types.js";
5
+ import { RUNTIMES } from "./constants.js";
6
+ import { APIClient, WithFetchOptions } from "./api-client/api-client.js";
7
+ import "./api-client/index.js";
8
+ import { Credentials } from "./utils/get-credentials.js";
9
+ import { Command, CommandFinished } from "./command.js";
10
+ import { Snapshot } from "./snapshot.js";
11
+ import { SandboxSnapshot } from "./utils/sandbox-snapshot.js";
12
+ import { RunCommandParams, Session } from "./session.js";
13
+ import { FileSystem } from "./filesystem.js";
14
+ import { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@workflow/serde";
15
+ import * as zod0 from "zod";
16
+
17
+ //#region src/sandbox.d.ts
13
18
  /** @inline */
14
- export interface BaseCreateSandboxParams {
15
- /**
16
- * The name of the sandbox. If omitted, a random name will be generated.
17
- */
18
- name?: string;
19
- /**
20
- * The source of the sandbox.
21
- *
22
- * Omit this parameter start a sandbox without a source.
23
- *
24
- * For git sources:
25
- * - `depth`: Creates shallow clones with limited commit history (minimum: 1)
26
- * - `revision`: Clones and checks out a specific commit, branch, or tag
27
- */
28
- source?: {
29
- type: "git";
30
- url: string;
31
- depth?: number;
32
- revision?: string;
33
- } | {
34
- type: "git";
35
- url: string;
36
- username: string;
37
- password: string;
38
- depth?: number;
39
- revision?: string;
40
- } | {
41
- type: "tarball";
42
- url: string;
43
- };
44
- /**
45
- * Array of port numbers to expose from the sandbox. Sandboxes can
46
- * expose up to 4 ports.
47
- */
48
- ports?: number[];
49
- /**
50
- * Timeout in milliseconds before the sandbox auto-terminates.
51
- */
52
- timeout?: number;
53
- /**
54
- * Resources to allocate to the sandbox.
55
- *
56
- * Your sandbox will get the amount of vCPUs you specify here and
57
- * 2048 MB of memory per vCPU.
58
- */
59
- resources?: {
60
- vcpus: number;
61
- };
62
- /**
63
- * The runtime of the sandbox, currently only `node24`, `node22` and `python3.13` are supported.
64
- * If not specified, the default runtime `node24` will be used.
65
- */
66
- runtime?: RUNTIMES | (string & {});
67
- /**
68
- * Network policy to define network restrictions for the sandbox.
69
- * Defaults to full internet access if not specified.
70
- */
71
- networkPolicy?: NetworkPolicy;
72
- /**
73
- * Default environment variables for the sandbox.
74
- * These are inherited by all commands unless overridden with
75
- * the `env` option in `runCommand`.
76
- *
77
- * @example
78
- * const sandbox = await Sandbox.create({
79
- * env: { NODE_ENV: "production", API_KEY: "secret" },
80
- * });
81
- * // All commands will have NODE_ENV and API_KEY set
82
- * await sandbox.runCommand("node", ["app.js"]);
83
- */
84
- env?: Record<string, string>;
85
- /**
86
- * An AbortSignal to cancel sandbox creation.
87
- */
88
- signal?: AbortSignal;
89
- /**
90
- * Whether to enable snapshots on shutdown. Defaults to true.
91
- */
92
- persistent?: boolean;
19
+ interface BaseCreateSandboxParams {
20
+ /**
21
+ * The name of the sandbox. If omitted, a random name will be generated.
22
+ */
23
+ name?: string;
24
+ /**
25
+ * The source of the sandbox.
26
+ *
27
+ * Omit this parameter start a sandbox without a source.
28
+ *
29
+ * For git sources:
30
+ * - `depth`: Creates shallow clones with limited commit history (minimum: 1)
31
+ * - `revision`: Clones and checks out a specific commit, branch, or tag
32
+ */
33
+ source?: {
34
+ type: "git";
35
+ url: string;
36
+ depth?: number;
37
+ revision?: string;
38
+ } | {
39
+ type: "git";
40
+ url: string;
41
+ username: string;
42
+ password: string;
43
+ depth?: number;
44
+ revision?: string;
45
+ } | {
46
+ type: "tarball";
47
+ url: string;
48
+ };
49
+ /**
50
+ * Array of port numbers to expose from the sandbox. Sandboxes can
51
+ * expose up to 4 ports.
52
+ */
53
+ ports?: number[];
54
+ /**
55
+ * Timeout in milliseconds before the sandbox auto-terminates.
56
+ */
57
+ timeout?: number;
58
+ /**
59
+ * Resources to allocate to the sandbox.
60
+ *
61
+ * Your sandbox will get the amount of vCPUs you specify here and
62
+ * 2048 MB of memory per vCPU.
63
+ */
64
+ resources?: {
65
+ vcpus: number;
66
+ };
67
+ /**
68
+ * The runtime of the sandbox, currently only `node24`, `node22`, `node26` and `python3.13` are supported.
69
+ * If not specified, the default runtime `node24` will be used.
70
+ */
71
+ runtime?: RUNTIMES | (string & {});
72
+ /**
73
+ * Network policy to define network restrictions for the sandbox.
74
+ * Defaults to full internet access if not specified.
75
+ */
76
+ networkPolicy?: NetworkPolicy;
77
+ /**
78
+ * Default environment variables for the sandbox.
79
+ * These are inherited by all commands unless overridden with
80
+ * the `env` option in `runCommand`.
81
+ *
82
+ * @example
83
+ * const sandbox = await Sandbox.create({
84
+ * env: { NODE_ENV: "production", API_KEY: "secret" },
85
+ * });
86
+ * // All commands will have NODE_ENV and API_KEY set
87
+ * await sandbox.runCommand("node", ["app.js"]);
88
+ */
89
+ env?: Record<string, string>;
90
+ /**
91
+ * Key-value tags to associate with the sandbox. Maximum 5 tags.
92
+ * @example { env: "staging", team: "infra" }
93
+ */
94
+ tags?: Record<string, string>;
95
+ /**
96
+ * An AbortSignal to cancel sandbox creation.
97
+ */
98
+ signal?: AbortSignal;
99
+ /**
100
+ * Enable or disable automatic restore of the filesystem between sessions.
101
+ */
102
+ persistent?: boolean;
103
+ /**
104
+ * Default snapshot expiration in milliseconds.
105
+ * When set, snapshots created for this sandbox will expire after this duration.
106
+ * Use `0` for no expiration.
107
+ */
108
+ snapshotExpiration?: number;
109
+ /**
110
+ * Called when the sandbox session is resumed (e.g., after a snapshot restore).
111
+ * Use this to re-warm caches, restore transient state, or run other setup logic.
112
+ */
113
+ onResume?: (sandbox: Sandbox) => Promise<void>;
93
114
  }
94
- export type CreateSandboxParams = BaseCreateSandboxParams | (Omit<BaseCreateSandboxParams, "runtime" | "source"> & {
95
- source: {
96
- type: "snapshot";
97
- snapshotId: string;
98
- };
115
+ type CreateSandboxParams = BaseCreateSandboxParams | (Omit<BaseCreateSandboxParams, "runtime" | "source"> & {
116
+ source: {
117
+ type: "snapshot";
118
+ snapshotId: string;
119
+ };
99
120
  });
100
121
  /** @inline */
101
122
  interface GetSandboxParams {
102
- /**
103
- * The name of the sandbox.
104
- */
105
- name: string;
106
- /**
107
- * Whether to resume an existing session. Defaults to true.
108
- */
109
- resume?: boolean;
110
- /**
111
- * An AbortSignal to cancel the operation.
112
- */
113
- signal?: AbortSignal;
123
+ /**
124
+ * The name of the sandbox.
125
+ */
126
+ name: string;
127
+ /**
128
+ * Whether to resume an existing session. Defaults to true.
129
+ */
130
+ resume?: boolean;
131
+ /**
132
+ * An AbortSignal to cancel the operation.
133
+ */
134
+ signal?: AbortSignal;
135
+ /**
136
+ * Called when the sandbox session is resumed (e.g., after a snapshot restore).
137
+ * Use this to re-warm caches, restore transient state, or run other setup logic.
138
+ */
139
+ onResume?: (sandbox: Sandbox) => Promise<void>;
140
+ }
141
+ /**
142
+ * Extends both {@link BaseCreateSandboxParams} and {@link GetSandboxParams}
143
+ * (minus `name`, which is required on get but optional here) so that any
144
+ * new parameter added to either flow is picked up automatically. The
145
+ * structural overlap on `signal` / `onResume` is intentional — both
146
+ * interfaces declare them with identical optional types.
147
+ * @inline
148
+ */
149
+ interface GetOrCreateSandboxParams extends BaseCreateSandboxParams, Omit<GetSandboxParams, "name"> {
150
+ /**
151
+ * Called once after a sandbox is freshly created (not when an existing
152
+ * sandbox is retrieved). Use this for one-time setup such as seeding
153
+ * files or warming caches. The returned promise is awaited before
154
+ * {@link Sandbox.getOrCreate} resolves.
155
+ */
156
+ onCreate?: (sandbox: Sandbox) => Promise<void>;
157
+ }
158
+ /**
159
+ * Serialized representation of a Sandbox for @workflow/serde.
160
+ * Fields `metadata` and `routes` are the original wire format from main.
161
+ * Fields `sandboxMetadata` and `projectId` are added for named-sandboxes.
162
+ */
163
+ interface SerializedSandbox {
164
+ metadata: SandboxSnapshot;
165
+ routes: SandboxRouteData[];
166
+ sandboxMetadata?: SandboxMetaData;
167
+ projectId?: string;
114
168
  }
115
169
  /**
116
170
  * A Sandbox is a persistent, isolated Linux MicroVMs to run commands in.
117
171
  * Use {@link Sandbox.create} or {@link Sandbox.get} to construct.
118
172
  * @hideconstructor
119
173
  */
120
- export declare class Sandbox {
121
- private readonly client;
122
- private readonly projectId;
123
- /**
124
- * Internal Session instance for the current VM.
125
- */
126
- private session;
127
- /**
128
- * Internal metadata about the named sandbox.
129
- */
130
- private namedSandbox;
131
- /**
132
- * The name of this sandbox.
133
- */
134
- get name(): string;
135
- /**
136
- * Routes from ports to subdomains.
137
- * @hidden
138
- */
139
- get routes(): SandboxRouteData[];
140
- /**
141
- * Whether the sandbox persists the state.
142
- */
143
- get persistent(): boolean;
144
- /**
145
- * The region this sandbox runs in.
146
- */
147
- get region(): string;
148
- /**
149
- * Number of virtual CPUs allocated.
150
- */
151
- get vcpus(): number;
152
- /**
153
- * Memory allocated in MB.
154
- */
155
- get memory(): number;
156
- /** Runtime identifier (e.g. "node24", "python3.13"). */
157
- get runtime(): string;
158
- /**
159
- * Cumulative egress bytes across all sessions.
160
- */
161
- get totalEgressBytes(): number | undefined;
162
- /**
163
- * Cumulative ingress bytes across all sessions.
164
- */
165
- get totalIngressBytes(): number | undefined;
166
- /**
167
- * Cumulative active CPU duration in milliseconds across all sessions.
168
- */
169
- get totalActiveCpuDurationMs(): number | undefined;
170
- /**
171
- * Cumulative wall-clock duration in milliseconds across all sessions.
172
- */
173
- get totalDurationMs(): number | undefined;
174
- /**
175
- * When this sandbox was last updated.
176
- */
177
- get updatedAt(): Date;
178
- /**
179
- * When this sandbox was created.
180
- */
181
- get createdAt(): Date;
182
- /**
183
- * Interactive port.
184
- */
185
- get interactivePort(): number | undefined;
186
- /**
187
- * The status of the current session.
188
- */
189
- get status(): SandboxMetaData["status"];
190
- /**
191
- * The default timeout of this sandbox in milliseconds.
192
- */
193
- get timeout(): number;
194
- /**
195
- * The default network policy of this sandbox.
196
- */
197
- get networkPolicy(): NetworkPolicy | undefined;
198
- /**
199
- * If the session was created from a snapshot, the ID of that snapshot.
200
- */
201
- get sourceSnapshotId(): string | undefined;
202
- /**
203
- * The current snapshot ID of this sandbox, if any.
204
- */
205
- get currentSnapshotId(): string | undefined;
206
- /**
207
- * The amount of CPU used by the session. Only reported once the VM is stopped.
208
- */
209
- get activeCpuUsageMs(): number | undefined;
210
- /**
211
- * The amount of network data used by the session. Only reported once the VM is stopped.
212
- */
213
- get networkTransfer(): {
174
+ declare class Sandbox {
175
+ private _client;
176
+ private readonly projectId;
177
+ /**
178
+ * In-flight resume promise, used to deduplicate concurrent resume calls.
179
+ */
180
+ private resumePromise;
181
+ /**
182
+ * Internal Session instance for the current VM.
183
+ */
184
+ private session;
185
+ /**
186
+ * Internal metadata about the sandbox.
187
+ */
188
+ private sandbox;
189
+ /**
190
+ * Hook that will be executed when a new session is created during resume.
191
+ */
192
+ private readonly onResume?;
193
+ /**
194
+ * A `node:fs/promises`-compatible API for interacting with the sandbox filesystem.
195
+ *
196
+ * @example
197
+ * const content = await sandbox.fs.readFile('/etc/hostname', 'utf8');
198
+ * await sandbox.fs.writeFile('/tmp/hello.txt', 'Hello, world!');
199
+ * const files = await sandbox.fs.readdir('/tmp');
200
+ * const stats = await sandbox.fs.stat('/tmp/hello.txt');
201
+ */
202
+ readonly fs: FileSystem;
203
+ /**
204
+ * Lazily resolve credentials and construct an API client.
205
+ * @internal
206
+ */
207
+ private ensureClient;
208
+ /**
209
+ * The name of this sandbox.
210
+ */
211
+ get name(): string;
212
+ /**
213
+ * Routes from ports to subdomains.
214
+ * @hidden
215
+ */
216
+ get routes(): SandboxRouteData[];
217
+ /**
218
+ * Whether the sandbox persists the state.
219
+ */
220
+ get persistent(): boolean;
221
+ /**
222
+ * The region this sandbox runs in.
223
+ */
224
+ get region(): string | undefined;
225
+ /**
226
+ * Number of virtual CPUs allocated.
227
+ */
228
+ get vcpus(): number | undefined;
229
+ /**
230
+ * Memory allocated in MB.
231
+ */
232
+ get memory(): number | undefined;
233
+ /** Runtime identifier (e.g. "node24", "python3.13"). */
234
+ get runtime(): string | undefined;
235
+ /**
236
+ * Cumulative egress bytes across all sessions.
237
+ */
238
+ get totalEgressBytes(): number | undefined;
239
+ /**
240
+ * Cumulative ingress bytes across all sessions.
241
+ */
242
+ get totalIngressBytes(): number | undefined;
243
+ /**
244
+ * Cumulative active CPU duration in milliseconds across all sessions.
245
+ */
246
+ get totalActiveCpuDurationMs(): number | undefined;
247
+ /**
248
+ * Cumulative wall-clock duration in milliseconds across all sessions.
249
+ */
250
+ get totalDurationMs(): number | undefined;
251
+ /**
252
+ * When this sandbox was last updated.
253
+ */
254
+ get updatedAt(): Date;
255
+ /**
256
+ * When the sandbox status was last updated.
257
+ */
258
+ get statusUpdatedAt(): Date | undefined;
259
+ /**
260
+ * When this sandbox was created.
261
+ */
262
+ get createdAt(): Date;
263
+ /**
264
+ * Interactive port.
265
+ */
266
+ get interactivePort(): number | undefined;
267
+ /**
268
+ * The status of the current session.
269
+ */
270
+ get status(): SessionMetaData["status"];
271
+ /**
272
+ * The default timeout of this sandbox in milliseconds.
273
+ */
274
+ get timeout(): number | undefined;
275
+ /**
276
+ * Key-value tags attached to the sandbox.
277
+ */
278
+ get tags(): Record<string, string> | undefined;
279
+ /**
280
+ * The default network policy of this sandbox.
281
+ */
282
+ get networkPolicy(): NetworkPolicy | undefined;
283
+ /**
284
+ * If the session was created from a snapshot, the ID of that snapshot.
285
+ */
286
+ get sourceSnapshotId(): string | undefined;
287
+ /**
288
+ * The current snapshot ID of this sandbox, if any.
289
+ */
290
+ get currentSnapshotId(): string | undefined;
291
+ /**
292
+ * The default snapshot expiration in milliseconds, if set.
293
+ */
294
+ get snapshotExpiration(): number | undefined;
295
+ /**
296
+ * The amount of CPU used by the session. Only reported once the VM is stopped.
297
+ */
298
+ get activeCpuUsageMs(): number | undefined;
299
+ /**
300
+ * The amount of network data used by the session. Only reported once the VM is stopped.
301
+ */
302
+ get networkTransfer(): {
303
+ ingress: number;
304
+ egress: number;
305
+ } | undefined;
306
+ /**
307
+ * Allow to get a list of sandboxes for a team narrowed to the given params.
308
+ * It returns both the sandboxes and the pagination metadata to allow getting
309
+ * the next page of results.
310
+ *
311
+ * The returned object is async-iterable to auto-paginate through all pages:
312
+ *
313
+ * ```ts
314
+ * const result = await Sandbox.list({ namePrefix: "ci-" });
315
+ * for await (const sandbox of result) { ... }
316
+ * // or: await result.toArray();
317
+ * // or: for await (const page of result.pages()) { ... }
318
+ * ```
319
+ */
320
+ static list(params?: Partial<Parameters<APIClient["listSandboxes"]>[0]> & Partial<Credentials> & WithFetchOptions): Promise<Paginator<{
321
+ sandboxes: {
322
+ status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
323
+ name: string;
324
+ persistent: boolean;
325
+ createdAt: number;
326
+ updatedAt: number;
327
+ currentSessionId: string;
328
+ tags?: Record<string, string> | undefined;
329
+ region?: string | undefined;
330
+ vcpus?: number | undefined;
331
+ memory?: number | undefined;
332
+ runtime?: string | undefined;
333
+ timeout?: number | undefined;
334
+ networkPolicy?: zod0.objectInputType<{
335
+ mode: zod0.ZodLiteral<"allow-all">;
336
+ }, zod0.ZodTypeAny, "passthrough"> | zod0.objectInputType<{
337
+ mode: zod0.ZodLiteral<"deny-all">;
338
+ }, zod0.ZodTypeAny, "passthrough"> | zod0.objectInputType<{
339
+ mode: zod0.ZodLiteral<"custom">;
340
+ allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
341
+ allowedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
342
+ deniedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
343
+ injectionRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
344
+ domain: zod0.ZodString;
345
+ headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
346
+ headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
347
+ match: zod0.ZodOptional<zod0.ZodObject<{
348
+ path: zod0.ZodOptional<zod0.ZodObject<{
349
+ exact: zod0.ZodOptional<zod0.ZodString>;
350
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
351
+ regex: zod0.ZodOptional<zod0.ZodString>;
352
+ }, "strip", zod0.ZodTypeAny, {
353
+ exact?: string | undefined;
354
+ startsWith?: string | undefined;
355
+ regex?: string | undefined;
356
+ }, {
357
+ exact?: string | undefined;
358
+ startsWith?: string | undefined;
359
+ regex?: string | undefined;
360
+ }>>;
361
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
362
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
363
+ key: zod0.ZodOptional<zod0.ZodObject<{
364
+ exact: zod0.ZodOptional<zod0.ZodString>;
365
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
366
+ regex: zod0.ZodOptional<zod0.ZodString>;
367
+ }, "strip", zod0.ZodTypeAny, {
368
+ exact?: string | undefined;
369
+ startsWith?: string | undefined;
370
+ regex?: string | undefined;
371
+ }, {
372
+ exact?: string | undefined;
373
+ startsWith?: string | undefined;
374
+ regex?: string | undefined;
375
+ }>>;
376
+ value: zod0.ZodOptional<zod0.ZodObject<{
377
+ exact: zod0.ZodOptional<zod0.ZodString>;
378
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
379
+ regex: zod0.ZodOptional<zod0.ZodString>;
380
+ }, "strip", zod0.ZodTypeAny, {
381
+ exact?: string | undefined;
382
+ startsWith?: string | undefined;
383
+ regex?: string | undefined;
384
+ }, {
385
+ exact?: string | undefined;
386
+ startsWith?: string | undefined;
387
+ regex?: string | undefined;
388
+ }>>;
389
+ }, "strip", zod0.ZodTypeAny, {
390
+ value?: {
391
+ exact?: string | undefined;
392
+ startsWith?: string | undefined;
393
+ regex?: string | undefined;
394
+ } | undefined;
395
+ key?: {
396
+ exact?: string | undefined;
397
+ startsWith?: string | undefined;
398
+ regex?: string | undefined;
399
+ } | undefined;
400
+ }, {
401
+ value?: {
402
+ exact?: string | undefined;
403
+ startsWith?: string | undefined;
404
+ regex?: string | undefined;
405
+ } | undefined;
406
+ key?: {
407
+ exact?: string | undefined;
408
+ startsWith?: string | undefined;
409
+ regex?: string | undefined;
410
+ } | undefined;
411
+ }>, "many">>;
412
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
413
+ key: zod0.ZodOptional<zod0.ZodObject<{
414
+ exact: zod0.ZodOptional<zod0.ZodString>;
415
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
416
+ regex: zod0.ZodOptional<zod0.ZodString>;
417
+ }, "strip", zod0.ZodTypeAny, {
418
+ exact?: string | undefined;
419
+ startsWith?: string | undefined;
420
+ regex?: string | undefined;
421
+ }, {
422
+ exact?: string | undefined;
423
+ startsWith?: string | undefined;
424
+ regex?: string | undefined;
425
+ }>>;
426
+ value: zod0.ZodOptional<zod0.ZodObject<{
427
+ exact: zod0.ZodOptional<zod0.ZodString>;
428
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
429
+ regex: zod0.ZodOptional<zod0.ZodString>;
430
+ }, "strip", zod0.ZodTypeAny, {
431
+ exact?: string | undefined;
432
+ startsWith?: string | undefined;
433
+ regex?: string | undefined;
434
+ }, {
435
+ exact?: string | undefined;
436
+ startsWith?: string | undefined;
437
+ regex?: string | undefined;
438
+ }>>;
439
+ }, "strip", zod0.ZodTypeAny, {
440
+ value?: {
441
+ exact?: string | undefined;
442
+ startsWith?: string | undefined;
443
+ regex?: string | undefined;
444
+ } | undefined;
445
+ key?: {
446
+ exact?: string | undefined;
447
+ startsWith?: string | undefined;
448
+ regex?: string | undefined;
449
+ } | undefined;
450
+ }, {
451
+ value?: {
452
+ exact?: string | undefined;
453
+ startsWith?: string | undefined;
454
+ regex?: string | undefined;
455
+ } | undefined;
456
+ key?: {
457
+ exact?: string | undefined;
458
+ startsWith?: string | undefined;
459
+ regex?: string | undefined;
460
+ } | undefined;
461
+ }>, "many">>;
462
+ }, "strip", zod0.ZodTypeAny, {
463
+ path?: {
464
+ exact?: string | undefined;
465
+ startsWith?: string | undefined;
466
+ regex?: string | undefined;
467
+ } | undefined;
468
+ headers?: {
469
+ value?: {
470
+ exact?: string | undefined;
471
+ startsWith?: string | undefined;
472
+ regex?: string | undefined;
473
+ } | undefined;
474
+ key?: {
475
+ exact?: string | undefined;
476
+ startsWith?: string | undefined;
477
+ regex?: string | undefined;
478
+ } | undefined;
479
+ }[] | undefined;
480
+ method?: string[] | undefined;
481
+ queryString?: {
482
+ value?: {
483
+ exact?: string | undefined;
484
+ startsWith?: string | undefined;
485
+ regex?: string | undefined;
486
+ } | undefined;
487
+ key?: {
488
+ exact?: string | undefined;
489
+ startsWith?: string | undefined;
490
+ regex?: string | undefined;
491
+ } | undefined;
492
+ }[] | undefined;
493
+ }, {
494
+ path?: {
495
+ exact?: string | undefined;
496
+ startsWith?: string | undefined;
497
+ regex?: string | undefined;
498
+ } | undefined;
499
+ headers?: {
500
+ value?: {
501
+ exact?: string | undefined;
502
+ startsWith?: string | undefined;
503
+ regex?: string | undefined;
504
+ } | undefined;
505
+ key?: {
506
+ exact?: string | undefined;
507
+ startsWith?: string | undefined;
508
+ regex?: string | undefined;
509
+ } | undefined;
510
+ }[] | undefined;
511
+ method?: string[] | undefined;
512
+ queryString?: {
513
+ value?: {
514
+ exact?: string | undefined;
515
+ startsWith?: string | undefined;
516
+ regex?: string | undefined;
517
+ } | undefined;
518
+ key?: {
519
+ exact?: string | undefined;
520
+ startsWith?: string | undefined;
521
+ regex?: string | undefined;
522
+ } | undefined;
523
+ }[] | undefined;
524
+ }>>;
525
+ }, "strip", zod0.ZodTypeAny, {
526
+ domain: string;
527
+ match?: {
528
+ path?: {
529
+ exact?: string | undefined;
530
+ startsWith?: string | undefined;
531
+ regex?: string | undefined;
532
+ } | undefined;
533
+ headers?: {
534
+ value?: {
535
+ exact?: string | undefined;
536
+ startsWith?: string | undefined;
537
+ regex?: string | undefined;
538
+ } | undefined;
539
+ key?: {
540
+ exact?: string | undefined;
541
+ startsWith?: string | undefined;
542
+ regex?: string | undefined;
543
+ } | undefined;
544
+ }[] | undefined;
545
+ method?: string[] | undefined;
546
+ queryString?: {
547
+ value?: {
548
+ exact?: string | undefined;
549
+ startsWith?: string | undefined;
550
+ regex?: string | undefined;
551
+ } | undefined;
552
+ key?: {
553
+ exact?: string | undefined;
554
+ startsWith?: string | undefined;
555
+ regex?: string | undefined;
556
+ } | undefined;
557
+ }[] | undefined;
558
+ } | undefined;
559
+ headers?: Record<string, string> | undefined;
560
+ headerNames?: string[] | undefined;
561
+ }, {
562
+ domain: string;
563
+ match?: {
564
+ path?: {
565
+ exact?: string | undefined;
566
+ startsWith?: string | undefined;
567
+ regex?: string | undefined;
568
+ } | undefined;
569
+ headers?: {
570
+ value?: {
571
+ exact?: string | undefined;
572
+ startsWith?: string | undefined;
573
+ regex?: string | undefined;
574
+ } | undefined;
575
+ key?: {
576
+ exact?: string | undefined;
577
+ startsWith?: string | undefined;
578
+ regex?: string | undefined;
579
+ } | undefined;
580
+ }[] | undefined;
581
+ method?: string[] | undefined;
582
+ queryString?: {
583
+ value?: {
584
+ exact?: string | undefined;
585
+ startsWith?: string | undefined;
586
+ regex?: string | undefined;
587
+ } | undefined;
588
+ key?: {
589
+ exact?: string | undefined;
590
+ startsWith?: string | undefined;
591
+ regex?: string | undefined;
592
+ } | undefined;
593
+ }[] | undefined;
594
+ } | undefined;
595
+ headers?: Record<string, string> | undefined;
596
+ headerNames?: string[] | undefined;
597
+ }>, "many">>;
598
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
599
+ domain: zod0.ZodString;
600
+ forwardURL: zod0.ZodString;
601
+ match: zod0.ZodOptional<zod0.ZodObject<{
602
+ path: zod0.ZodOptional<zod0.ZodObject<{
603
+ exact: zod0.ZodOptional<zod0.ZodString>;
604
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
605
+ regex: zod0.ZodOptional<zod0.ZodString>;
606
+ }, "strip", zod0.ZodTypeAny, {
607
+ exact?: string | undefined;
608
+ startsWith?: string | undefined;
609
+ regex?: string | undefined;
610
+ }, {
611
+ exact?: string | undefined;
612
+ startsWith?: string | undefined;
613
+ regex?: string | undefined;
614
+ }>>;
615
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
616
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
617
+ key: zod0.ZodOptional<zod0.ZodObject<{
618
+ exact: zod0.ZodOptional<zod0.ZodString>;
619
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
620
+ regex: zod0.ZodOptional<zod0.ZodString>;
621
+ }, "strip", zod0.ZodTypeAny, {
622
+ exact?: string | undefined;
623
+ startsWith?: string | undefined;
624
+ regex?: string | undefined;
625
+ }, {
626
+ exact?: string | undefined;
627
+ startsWith?: string | undefined;
628
+ regex?: string | undefined;
629
+ }>>;
630
+ value: zod0.ZodOptional<zod0.ZodObject<{
631
+ exact: zod0.ZodOptional<zod0.ZodString>;
632
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
633
+ regex: zod0.ZodOptional<zod0.ZodString>;
634
+ }, "strip", zod0.ZodTypeAny, {
635
+ exact?: string | undefined;
636
+ startsWith?: string | undefined;
637
+ regex?: string | undefined;
638
+ }, {
639
+ exact?: string | undefined;
640
+ startsWith?: string | undefined;
641
+ regex?: string | undefined;
642
+ }>>;
643
+ }, "strip", zod0.ZodTypeAny, {
644
+ value?: {
645
+ exact?: string | undefined;
646
+ startsWith?: string | undefined;
647
+ regex?: string | undefined;
648
+ } | undefined;
649
+ key?: {
650
+ exact?: string | undefined;
651
+ startsWith?: string | undefined;
652
+ regex?: string | undefined;
653
+ } | undefined;
654
+ }, {
655
+ value?: {
656
+ exact?: string | undefined;
657
+ startsWith?: string | undefined;
658
+ regex?: string | undefined;
659
+ } | undefined;
660
+ key?: {
661
+ exact?: string | undefined;
662
+ startsWith?: string | undefined;
663
+ regex?: string | undefined;
664
+ } | undefined;
665
+ }>, "many">>;
666
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
667
+ key: zod0.ZodOptional<zod0.ZodObject<{
668
+ exact: zod0.ZodOptional<zod0.ZodString>;
669
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
670
+ regex: zod0.ZodOptional<zod0.ZodString>;
671
+ }, "strip", zod0.ZodTypeAny, {
672
+ exact?: string | undefined;
673
+ startsWith?: string | undefined;
674
+ regex?: string | undefined;
675
+ }, {
676
+ exact?: string | undefined;
677
+ startsWith?: string | undefined;
678
+ regex?: string | undefined;
679
+ }>>;
680
+ value: zod0.ZodOptional<zod0.ZodObject<{
681
+ exact: zod0.ZodOptional<zod0.ZodString>;
682
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
683
+ regex: zod0.ZodOptional<zod0.ZodString>;
684
+ }, "strip", zod0.ZodTypeAny, {
685
+ exact?: string | undefined;
686
+ startsWith?: string | undefined;
687
+ regex?: string | undefined;
688
+ }, {
689
+ exact?: string | undefined;
690
+ startsWith?: string | undefined;
691
+ regex?: string | undefined;
692
+ }>>;
693
+ }, "strip", zod0.ZodTypeAny, {
694
+ value?: {
695
+ exact?: string | undefined;
696
+ startsWith?: string | undefined;
697
+ regex?: string | undefined;
698
+ } | undefined;
699
+ key?: {
700
+ exact?: string | undefined;
701
+ startsWith?: string | undefined;
702
+ regex?: string | undefined;
703
+ } | undefined;
704
+ }, {
705
+ value?: {
706
+ exact?: string | undefined;
707
+ startsWith?: string | undefined;
708
+ regex?: string | undefined;
709
+ } | undefined;
710
+ key?: {
711
+ exact?: string | undefined;
712
+ startsWith?: string | undefined;
713
+ regex?: string | undefined;
714
+ } | undefined;
715
+ }>, "many">>;
716
+ }, "strip", zod0.ZodTypeAny, {
717
+ path?: {
718
+ exact?: string | undefined;
719
+ startsWith?: string | undefined;
720
+ regex?: string | undefined;
721
+ } | undefined;
722
+ headers?: {
723
+ value?: {
724
+ exact?: string | undefined;
725
+ startsWith?: string | undefined;
726
+ regex?: string | undefined;
727
+ } | undefined;
728
+ key?: {
729
+ exact?: string | undefined;
730
+ startsWith?: string | undefined;
731
+ regex?: string | undefined;
732
+ } | undefined;
733
+ }[] | undefined;
734
+ method?: string[] | undefined;
735
+ queryString?: {
736
+ value?: {
737
+ exact?: string | undefined;
738
+ startsWith?: string | undefined;
739
+ regex?: string | undefined;
740
+ } | undefined;
741
+ key?: {
742
+ exact?: string | undefined;
743
+ startsWith?: string | undefined;
744
+ regex?: string | undefined;
745
+ } | undefined;
746
+ }[] | undefined;
747
+ }, {
748
+ path?: {
749
+ exact?: string | undefined;
750
+ startsWith?: string | undefined;
751
+ regex?: string | undefined;
752
+ } | undefined;
753
+ headers?: {
754
+ value?: {
755
+ exact?: string | undefined;
756
+ startsWith?: string | undefined;
757
+ regex?: string | undefined;
758
+ } | undefined;
759
+ key?: {
760
+ exact?: string | undefined;
761
+ startsWith?: string | undefined;
762
+ regex?: string | undefined;
763
+ } | undefined;
764
+ }[] | undefined;
765
+ method?: string[] | undefined;
766
+ queryString?: {
767
+ value?: {
768
+ exact?: string | undefined;
769
+ startsWith?: string | undefined;
770
+ regex?: string | undefined;
771
+ } | undefined;
772
+ key?: {
773
+ exact?: string | undefined;
774
+ startsWith?: string | undefined;
775
+ regex?: string | undefined;
776
+ } | undefined;
777
+ }[] | undefined;
778
+ }>>;
779
+ }, "strip", zod0.ZodTypeAny, {
780
+ domain: string;
781
+ forwardURL: string;
782
+ match?: {
783
+ path?: {
784
+ exact?: string | undefined;
785
+ startsWith?: string | undefined;
786
+ regex?: string | undefined;
787
+ } | undefined;
788
+ headers?: {
789
+ value?: {
790
+ exact?: string | undefined;
791
+ startsWith?: string | undefined;
792
+ regex?: string | undefined;
793
+ } | undefined;
794
+ key?: {
795
+ exact?: string | undefined;
796
+ startsWith?: string | undefined;
797
+ regex?: string | undefined;
798
+ } | undefined;
799
+ }[] | undefined;
800
+ method?: string[] | undefined;
801
+ queryString?: {
802
+ value?: {
803
+ exact?: string | undefined;
804
+ startsWith?: string | undefined;
805
+ regex?: string | undefined;
806
+ } | undefined;
807
+ key?: {
808
+ exact?: string | undefined;
809
+ startsWith?: string | undefined;
810
+ regex?: string | undefined;
811
+ } | undefined;
812
+ }[] | undefined;
813
+ } | undefined;
814
+ }, {
815
+ domain: string;
816
+ forwardURL: string;
817
+ match?: {
818
+ path?: {
819
+ exact?: string | undefined;
820
+ startsWith?: string | undefined;
821
+ regex?: string | undefined;
822
+ } | undefined;
823
+ headers?: {
824
+ value?: {
825
+ exact?: string | undefined;
826
+ startsWith?: string | undefined;
827
+ regex?: string | undefined;
828
+ } | undefined;
829
+ key?: {
830
+ exact?: string | undefined;
831
+ startsWith?: string | undefined;
832
+ regex?: string | undefined;
833
+ } | undefined;
834
+ }[] | undefined;
835
+ method?: string[] | undefined;
836
+ queryString?: {
837
+ value?: {
838
+ exact?: string | undefined;
839
+ startsWith?: string | undefined;
840
+ regex?: string | undefined;
841
+ } | undefined;
842
+ key?: {
843
+ exact?: string | undefined;
844
+ startsWith?: string | undefined;
845
+ regex?: string | undefined;
846
+ } | undefined;
847
+ }[] | undefined;
848
+ } | undefined;
849
+ }>, "many">>;
850
+ }, zod0.ZodTypeAny, "passthrough"> | undefined;
851
+ totalEgressBytes?: number | undefined;
852
+ totalIngressBytes?: number | undefined;
853
+ totalActiveCpuDurationMs?: number | undefined;
854
+ totalDurationMs?: number | undefined;
855
+ currentSnapshotId?: string | undefined;
856
+ cwd?: string | undefined;
857
+ statusUpdatedAt?: number | undefined;
858
+ snapshotExpiration?: number | undefined;
859
+ }[];
860
+ pagination: {
861
+ count: number;
862
+ next: string | null;
863
+ };
864
+ }, "sandboxes">>;
865
+ /**
866
+ * Serialize a Sandbox instance to plain data for @workflow/serde.
867
+ *
868
+ * @param instance - The Sandbox instance to serialize
869
+ * @returns A plain object containing sandbox metadata and routes
870
+ */
871
+ static [WORKFLOW_SERIALIZE](instance: Sandbox): SerializedSandbox;
872
+ /**
873
+ * Deserialize a Sandbox from serialized snapshot data.
874
+ *
875
+ * The deserialized instance uses the serialized metadata synchronously and
876
+ * lazily creates an API client only when methods perform API requests.
877
+ *
878
+ * @param data - The serialized sandbox data
879
+ * @returns The reconstructed Sandbox instance
880
+ */
881
+ static [WORKFLOW_DESERIALIZE](data: SerializedSandbox): Sandbox;
882
+ /**
883
+ * Create a new sandbox.
884
+ *
885
+ * @param params - Creation parameters and optional credentials.
886
+ * @returns A promise resolving to the created {@link Sandbox}.
887
+ * @example
888
+ * <caption>Create a sandbox with default options</caption>
889
+ * const sandbox = await Sandbox.create();
890
+ *
891
+ * @example
892
+ * <caption>Create a sandbox and drop it in the end of the block</caption>
893
+ * async function fn() {
894
+ * await using const sandbox = await Sandbox.create();
895
+ * // Sandbox automatically stopped at the end of the lexical scope
896
+ * }
897
+ */
898
+ static create(params?: WithPrivate<CreateSandboxParams | (CreateSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox & AsyncDisposable>;
899
+ /**
900
+ * Retrieve an existing sandbox and resume its session.
901
+ *
902
+ * @param params - Get parameters and optional credentials.
903
+ * @returns A promise resolving to the {@link Sandbox}.
904
+ */
905
+ static get(params: WithPrivate<GetSandboxParams | (GetSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
906
+ /**
907
+ * Retrieve an existing named sandbox, or create a new one if none exists.
908
+ *
909
+ * If `name` is omitted, this always creates a new sandbox and fires
910
+ * `onCreate`. If `name` is provided, it first tries {@link Sandbox.get};
911
+ * on `not_found` it creates a new sandbox with that name; on
912
+ * `snapshot_not_found` it deletes the stale named sandbox and creates
913
+ * a fresh one with the same name.
914
+ *
915
+ * @param params - Get/create parameters plus an optional `onCreate` hook.
916
+ * @returns A promise resolving to the {@link Sandbox}.
917
+ *
918
+ * @example
919
+ * <caption>Idempotent named sandbox with one-time setup</caption>
920
+ * const sandbox = await Sandbox.getOrCreate({
921
+ * name: "my-workspace",
922
+ * onCreate: async (sbx) => {
923
+ * await sbx.writeFiles([
924
+ * { path: "README.md", content: Buffer.from("# Hello") },
925
+ * ]);
926
+ * },
927
+ * });
928
+ *
929
+ * @example
930
+ * <caption>Unnamed — always creates</caption>
931
+ * const sandbox = await Sandbox.getOrCreate({
932
+ * onCreate: async (sbx) => {
933
+ * await sbx.runCommand("npm", ["install"]);
934
+ * },
935
+ * });
936
+ */
937
+ static getOrCreate(params?: WithPrivate<GetOrCreateSandboxParams | (GetOrCreateSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
938
+ /**
939
+ * Create a new Sandbox instance.
940
+ *
941
+ * @param params.client - Optional API client. If not provided, will be lazily created using global credentials.
942
+ * @param params.routes - Port-to-subdomain mappings for exposed ports
943
+ * @param params.sandbox - Sandbox snapshot metadata
944
+ */
945
+ constructor({
946
+ client,
947
+ routes,
948
+ session,
949
+ sandbox,
950
+ projectId,
951
+ onResume
952
+ }: {
953
+ client?: APIClient;
954
+ routes: SandboxRouteData[];
955
+ session?: SessionMetaData;
956
+ sandbox: SandboxMetaData;
957
+ projectId?: string;
958
+ onResume?: (sandbox: Sandbox) => Promise<void>;
959
+ });
960
+ /**
961
+ * Get the current session (the running VM) for this sandbox.
962
+ *
963
+ * @returns The {@link Session} instance.
964
+ */
965
+ currentSession(): Session;
966
+ /**
967
+ * Resume this sandbox by creating a new session via `getSandbox`.
968
+ */
969
+ private resume;
970
+ private doResume;
971
+ /**
972
+ * Poll until the current session reaches a terminal state, then resume.
973
+ */
974
+ private waitForStopAndResume;
975
+ /**
976
+ * Execute `fn`, and if the session is stopped/stopping/snapshotting, resume and retry.
977
+ */
978
+ private withResume;
979
+ /**
980
+ * Start executing a command in this sandbox.
981
+ *
982
+ * @param command - The command to execute.
983
+ * @param args - Arguments to pass to the command.
984
+ * @param opts - Optional parameters.
985
+ * @param opts.signal - An AbortSignal to cancel the command execution.
986
+ * @returns A {@link CommandFinished} result once execution is done.
987
+ */
988
+ runCommand(command: string, args?: string[], opts?: {
989
+ signal?: AbortSignal;
990
+ }): Promise<CommandFinished>;
991
+ /**
992
+ * Start executing a command in detached mode.
993
+ *
994
+ * @param params - The command parameters.
995
+ * @returns A {@link Command} instance for the running command.
996
+ */
997
+ runCommand(params: RunCommandParams & {
998
+ detached: true;
999
+ }): Promise<Command>;
1000
+ /**
1001
+ * Start executing a command in this sandbox.
1002
+ *
1003
+ * @param params - The command parameters.
1004
+ * @returns A {@link CommandFinished} result once execution is done.
1005
+ */
1006
+ runCommand(params: RunCommandParams): Promise<CommandFinished>;
1007
+ /**
1008
+ * Internal helper to start a command in the sandbox.
1009
+ *
1010
+ * @param params - Command execution parameters.
1011
+ * @returns A {@link Command} or {@link CommandFinished}, depending on `detached`.
1012
+ * @internal
1013
+ */
1014
+ getCommand(cmdId: string, opts?: {
1015
+ signal?: AbortSignal;
1016
+ }): Promise<Command>;
1017
+ /**
1018
+ * Create a directory in the filesystem of this sandbox.
1019
+ *
1020
+ * @param path - Path of the directory to create
1021
+ * @param opts - Optional parameters.
1022
+ * @param opts.signal - An AbortSignal to cancel the operation.
1023
+ */
1024
+ mkDir(path: string, opts?: {
1025
+ signal?: AbortSignal;
1026
+ }): Promise<void>;
1027
+ /**
1028
+ * Read a file from the filesystem of this sandbox as a stream.
1029
+ *
1030
+ * @param file - File to read, with path and optional cwd
1031
+ * @param opts - Optional parameters.
1032
+ * @param opts.signal - An AbortSignal to cancel the operation.
1033
+ * @returns A promise that resolves to a ReadableStream containing the file contents, or null if file not found
1034
+ */
1035
+ readFile(file: {
1036
+ path: string;
1037
+ cwd?: string;
1038
+ }, opts?: {
1039
+ signal?: AbortSignal;
1040
+ }): Promise<NodeJS.ReadableStream | null>;
1041
+ /**
1042
+ * Read a file from the filesystem of this sandbox as a Buffer.
1043
+ *
1044
+ * @param file - File to read, with path and optional cwd
1045
+ * @param opts - Optional parameters.
1046
+ * @param opts.signal - An AbortSignal to cancel the operation.
1047
+ * @returns A promise that resolves to the file contents as a Buffer, or null if file not found
1048
+ */
1049
+ readFileToBuffer(file: {
1050
+ path: string;
1051
+ cwd?: string;
1052
+ }, opts?: {
1053
+ signal?: AbortSignal;
1054
+ }): Promise<Buffer | null>;
1055
+ /**
1056
+ * Download a file from the sandbox to the local filesystem.
1057
+ *
1058
+ * @param src - Source file on the sandbox, with path and optional cwd
1059
+ * @param dst - Destination file on the local machine, with path and optional cwd
1060
+ * @param opts - Optional parameters.
1061
+ * @param opts.mkdirRecursive - If true, create parent directories for the destination if they don't exist.
1062
+ * @param opts.signal - An AbortSignal to cancel the operation.
1063
+ * @returns The absolute path to the written file, or null if the source file was not found
1064
+ */
1065
+ downloadFile(src: {
1066
+ path: string;
1067
+ cwd?: string;
1068
+ }, dst: {
1069
+ path: string;
1070
+ cwd?: string;
1071
+ }, opts?: {
1072
+ mkdirRecursive?: boolean;
1073
+ signal?: AbortSignal;
1074
+ }): Promise<string | null>;
1075
+ /**
1076
+ * Write files to the filesystem of this sandbox.
1077
+ * Defaults to writing to /vercel/sandbox unless an absolute path is specified.
1078
+ * Writes files using the `vercel-sandbox` user.
1079
+ *
1080
+ * @param files - Array of files with path, content, and optional mode (permissions)
1081
+ * @param opts - Optional parameters.
1082
+ * @param opts.signal - An AbortSignal to cancel the operation.
1083
+ * @returns A promise that resolves when the files are written
1084
+ *
1085
+ * @example
1086
+ * // Write an executable script
1087
+ * await sandbox.writeFiles([
1088
+ * { path: "/usr/local/bin/myscript", content: "#!/bin/bash\necho hello", mode: 0o755 }
1089
+ * ]);
1090
+ */
1091
+ writeFiles(files: {
1092
+ path: string;
1093
+ content: string | Uint8Array;
1094
+ mode?: number;
1095
+ }[], opts?: {
1096
+ signal?: AbortSignal;
1097
+ }): Promise<void>;
1098
+ /**
1099
+ * Get the public domain of a port of this sandbox.
1100
+ *
1101
+ * @param p - Port number to resolve
1102
+ * @returns A full domain (e.g. `https://subdomain.vercel.run`)
1103
+ * @throws If the port has no associated route
1104
+ */
1105
+ domain(p: number): string;
1106
+ /**
1107
+ * Stop the sandbox.
1108
+ *
1109
+ * @param opts - Optional parameters.
1110
+ * @param opts.signal - An AbortSignal to cancel the operation.
1111
+ * @returns The final session state after stopping, with optional snapshot metadata.
1112
+ */
1113
+ stop(opts?: {
1114
+ signal?: AbortSignal;
1115
+ }): Promise<SandboxSnapshot & {
1116
+ snapshot?: SnapshotMetadata;
1117
+ }>;
1118
+ /**
1119
+ * Update the network policy for this sandbox.
1120
+ *
1121
+ * @deprecated Use {@link Sandbox.update} instead.
1122
+ *
1123
+ * @param networkPolicy - The new network policy to apply.
1124
+ * @param opts - Optional parameters.
1125
+ * @param opts.signal - An AbortSignal to cancel the operation.
1126
+ * @returns A promise that resolves when the network policy is updated.
1127
+ *
1128
+ * @example
1129
+ * // Restrict to specific domains
1130
+ * await sandbox.updateNetworkPolicy({
1131
+ * allow: ["*.npmjs.org", "github.com"],
1132
+ * });
1133
+ *
1134
+ * @example
1135
+ * // Inject credentials with per-domain transformers
1136
+ * await sandbox.updateNetworkPolicy({
1137
+ * allow: {
1138
+ * "ai-gateway.vercel.sh": [{
1139
+ * transform: [{
1140
+ * headers: { authorization: "Bearer ..." }
1141
+ * }]
1142
+ * }],
1143
+ * "*": []
1144
+ * }
1145
+ * });
1146
+ *
1147
+ * @example
1148
+ * // Deny all network access
1149
+ * await sandbox.updateNetworkPolicy("deny-all");
1150
+ */
1151
+ updateNetworkPolicy(networkPolicy: NetworkPolicy, opts?: {
1152
+ signal?: AbortSignal;
1153
+ }): Promise<NetworkPolicy>;
1154
+ /**
1155
+ * Extend the timeout of the sandbox by the specified duration.
1156
+ *
1157
+ * This allows you to extend the lifetime of a sandbox up until the maximum
1158
+ * execution timeout for your plan.
1159
+ *
1160
+ * @param duration - The duration in milliseconds to extend the timeout by
1161
+ * @param opts - Optional parameters.
1162
+ * @param opts.signal - An AbortSignal to cancel the operation.
1163
+ * @returns A promise that resolves when the timeout is extended
1164
+ *
1165
+ * @example
1166
+ * const sandbox = await Sandbox.create({ timeout: ms('10m') });
1167
+ * // Extends timeout by 5 minutes, to a total of 15 minutes.
1168
+ * await sandbox.extendTimeout(ms('5m'));
1169
+ */
1170
+ extendTimeout(duration: number, opts?: {
1171
+ signal?: AbortSignal;
1172
+ }): Promise<void>;
1173
+ /**
1174
+ * Create a snapshot from this currently running sandbox. New sandboxes can
1175
+ * then be created from this snapshot using {@link Sandbox.createFromSnapshot}.
1176
+ *
1177
+ * Note: this sandbox will be stopped as part of the snapshot creation process.
1178
+ *
1179
+ * @param opts - Optional parameters.
1180
+ * @param opts.expiration - Optional expiration time in milliseconds. Use 0 for no expiration at all.
1181
+ * @param opts.signal - An AbortSignal to cancel the operation.
1182
+ * @returns A promise that resolves to the Snapshot instance
1183
+ */
1184
+ snapshot(opts?: {
1185
+ expiration?: number;
1186
+ signal?: AbortSignal;
1187
+ }): Promise<Snapshot>;
1188
+ /**
1189
+ * Update the sandbox configuration.
1190
+ *
1191
+ * When `ports` is provided, it is treated as the full desired port list:
1192
+ * any currently exposed port omitted from the array will be deregistered.
1193
+ *
1194
+ * @param params - Fields to update.
1195
+ * @param opts - Optional abort signal.
1196
+ */
1197
+ update(params: {
1198
+ persistent?: boolean;
1199
+ resources?: {
1200
+ vcpus?: number;
1201
+ };
1202
+ timeout?: number;
1203
+ networkPolicy?: NetworkPolicy;
1204
+ tags?: Record<string, string>;
1205
+ ports?: number[];
1206
+ snapshotExpiration?: number;
1207
+ currentSnapshotId?: string;
1208
+ }, opts?: {
1209
+ signal?: AbortSignal;
1210
+ }): Promise<void>;
1211
+ /**
1212
+ * Delete this sandbox.
1213
+ *
1214
+ * After deletion the instance becomes inert — all further API calls will
1215
+ * throw immediately.
1216
+ */
1217
+ delete(opts?: {
1218
+ signal?: AbortSignal;
1219
+ }): Promise<void>;
1220
+ /**
1221
+ * List sessions (VMs) that have been created for this sandbox.
1222
+ *
1223
+ * @param params - Optional pagination parameters.
1224
+ * @returns The list of sessions and pagination metadata.
1225
+ */
1226
+ listSessions(params?: {
1227
+ limit?: number;
1228
+ cursor?: string;
1229
+ sortOrder?: "asc" | "desc";
1230
+ signal?: AbortSignal;
1231
+ }): Promise<Paginator<{
1232
+ pagination: {
1233
+ count: number;
1234
+ next: string | null;
1235
+ };
1236
+ sessions: zod0.objectInputType<{
1237
+ id: zod0.ZodString;
1238
+ memory: zod0.ZodNumber;
1239
+ vcpus: zod0.ZodNumber;
1240
+ region: zod0.ZodString;
1241
+ runtime: zod0.ZodString;
1242
+ timeout: zod0.ZodNumber;
1243
+ status: zod0.ZodEnum<["pending", "running", "stopping", "stopped", "failed", "aborted", "snapshotting"]>;
1244
+ requestedAt: zod0.ZodNumber;
1245
+ startedAt: zod0.ZodOptional<zod0.ZodNumber>;
1246
+ requestedStopAt: zod0.ZodOptional<zod0.ZodNumber>;
1247
+ stoppedAt: zod0.ZodOptional<zod0.ZodNumber>;
1248
+ abortedAt: zod0.ZodOptional<zod0.ZodNumber>;
1249
+ duration: zod0.ZodOptional<zod0.ZodNumber>;
1250
+ sourceSnapshotId: zod0.ZodOptional<zod0.ZodString>;
1251
+ snapshottedAt: zod0.ZodOptional<zod0.ZodNumber>;
1252
+ createdAt: zod0.ZodNumber;
1253
+ cwd: zod0.ZodString;
1254
+ updatedAt: zod0.ZodNumber;
1255
+ interactivePort: zod0.ZodOptional<zod0.ZodNumber>;
1256
+ networkPolicy: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodUnion<[zod0.ZodObject<{
1257
+ mode: zod0.ZodLiteral<"allow-all">;
1258
+ }, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
1259
+ mode: zod0.ZodLiteral<"allow-all">;
1260
+ }, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
1261
+ mode: zod0.ZodLiteral<"allow-all">;
1262
+ }, zod0.ZodTypeAny, "passthrough">>, zod0.ZodObject<{
1263
+ mode: zod0.ZodLiteral<"deny-all">;
1264
+ }, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
1265
+ mode: zod0.ZodLiteral<"deny-all">;
1266
+ }, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
1267
+ mode: zod0.ZodLiteral<"deny-all">;
1268
+ }, zod0.ZodTypeAny, "passthrough">>]>, zod0.ZodObject<{
1269
+ mode: zod0.ZodLiteral<"custom">;
1270
+ allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1271
+ allowedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1272
+ deniedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1273
+ injectionRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1274
+ domain: zod0.ZodString;
1275
+ headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
1276
+ headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1277
+ match: zod0.ZodOptional<zod0.ZodObject<{
1278
+ path: zod0.ZodOptional<zod0.ZodObject<{
1279
+ exact: zod0.ZodOptional<zod0.ZodString>;
1280
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1281
+ regex: zod0.ZodOptional<zod0.ZodString>;
1282
+ }, "strip", zod0.ZodTypeAny, {
1283
+ exact?: string | undefined;
1284
+ startsWith?: string | undefined;
1285
+ regex?: string | undefined;
1286
+ }, {
1287
+ exact?: string | undefined;
1288
+ startsWith?: string | undefined;
1289
+ regex?: string | undefined;
1290
+ }>>;
1291
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1292
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1293
+ key: zod0.ZodOptional<zod0.ZodObject<{
1294
+ exact: zod0.ZodOptional<zod0.ZodString>;
1295
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1296
+ regex: zod0.ZodOptional<zod0.ZodString>;
1297
+ }, "strip", zod0.ZodTypeAny, {
1298
+ exact?: string | undefined;
1299
+ startsWith?: string | undefined;
1300
+ regex?: string | undefined;
1301
+ }, {
1302
+ exact?: string | undefined;
1303
+ startsWith?: string | undefined;
1304
+ regex?: string | undefined;
1305
+ }>>;
1306
+ value: zod0.ZodOptional<zod0.ZodObject<{
1307
+ exact: zod0.ZodOptional<zod0.ZodString>;
1308
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1309
+ regex: zod0.ZodOptional<zod0.ZodString>;
1310
+ }, "strip", zod0.ZodTypeAny, {
1311
+ exact?: string | undefined;
1312
+ startsWith?: string | undefined;
1313
+ regex?: string | undefined;
1314
+ }, {
1315
+ exact?: string | undefined;
1316
+ startsWith?: string | undefined;
1317
+ regex?: string | undefined;
1318
+ }>>;
1319
+ }, "strip", zod0.ZodTypeAny, {
1320
+ value?: {
1321
+ exact?: string | undefined;
1322
+ startsWith?: string | undefined;
1323
+ regex?: string | undefined;
1324
+ } | undefined;
1325
+ key?: {
1326
+ exact?: string | undefined;
1327
+ startsWith?: string | undefined;
1328
+ regex?: string | undefined;
1329
+ } | undefined;
1330
+ }, {
1331
+ value?: {
1332
+ exact?: string | undefined;
1333
+ startsWith?: string | undefined;
1334
+ regex?: string | undefined;
1335
+ } | undefined;
1336
+ key?: {
1337
+ exact?: string | undefined;
1338
+ startsWith?: string | undefined;
1339
+ regex?: string | undefined;
1340
+ } | undefined;
1341
+ }>, "many">>;
1342
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1343
+ key: zod0.ZodOptional<zod0.ZodObject<{
1344
+ exact: zod0.ZodOptional<zod0.ZodString>;
1345
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1346
+ regex: zod0.ZodOptional<zod0.ZodString>;
1347
+ }, "strip", zod0.ZodTypeAny, {
1348
+ exact?: string | undefined;
1349
+ startsWith?: string | undefined;
1350
+ regex?: string | undefined;
1351
+ }, {
1352
+ exact?: string | undefined;
1353
+ startsWith?: string | undefined;
1354
+ regex?: string | undefined;
1355
+ }>>;
1356
+ value: zod0.ZodOptional<zod0.ZodObject<{
1357
+ exact: zod0.ZodOptional<zod0.ZodString>;
1358
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1359
+ regex: zod0.ZodOptional<zod0.ZodString>;
1360
+ }, "strip", zod0.ZodTypeAny, {
1361
+ exact?: string | undefined;
1362
+ startsWith?: string | undefined;
1363
+ regex?: string | undefined;
1364
+ }, {
1365
+ exact?: string | undefined;
1366
+ startsWith?: string | undefined;
1367
+ regex?: string | undefined;
1368
+ }>>;
1369
+ }, "strip", zod0.ZodTypeAny, {
1370
+ value?: {
1371
+ exact?: string | undefined;
1372
+ startsWith?: string | undefined;
1373
+ regex?: string | undefined;
1374
+ } | undefined;
1375
+ key?: {
1376
+ exact?: string | undefined;
1377
+ startsWith?: string | undefined;
1378
+ regex?: string | undefined;
1379
+ } | undefined;
1380
+ }, {
1381
+ value?: {
1382
+ exact?: string | undefined;
1383
+ startsWith?: string | undefined;
1384
+ regex?: string | undefined;
1385
+ } | undefined;
1386
+ key?: {
1387
+ exact?: string | undefined;
1388
+ startsWith?: string | undefined;
1389
+ regex?: string | undefined;
1390
+ } | undefined;
1391
+ }>, "many">>;
1392
+ }, "strip", zod0.ZodTypeAny, {
1393
+ path?: {
1394
+ exact?: string | undefined;
1395
+ startsWith?: string | undefined;
1396
+ regex?: string | undefined;
1397
+ } | undefined;
1398
+ headers?: {
1399
+ value?: {
1400
+ exact?: string | undefined;
1401
+ startsWith?: string | undefined;
1402
+ regex?: string | undefined;
1403
+ } | undefined;
1404
+ key?: {
1405
+ exact?: string | undefined;
1406
+ startsWith?: string | undefined;
1407
+ regex?: string | undefined;
1408
+ } | undefined;
1409
+ }[] | undefined;
1410
+ method?: string[] | undefined;
1411
+ queryString?: {
1412
+ value?: {
1413
+ exact?: string | undefined;
1414
+ startsWith?: string | undefined;
1415
+ regex?: string | undefined;
1416
+ } | undefined;
1417
+ key?: {
1418
+ exact?: string | undefined;
1419
+ startsWith?: string | undefined;
1420
+ regex?: string | undefined;
1421
+ } | undefined;
1422
+ }[] | undefined;
1423
+ }, {
1424
+ path?: {
1425
+ exact?: string | undefined;
1426
+ startsWith?: string | undefined;
1427
+ regex?: string | undefined;
1428
+ } | undefined;
1429
+ headers?: {
1430
+ value?: {
1431
+ exact?: string | undefined;
1432
+ startsWith?: string | undefined;
1433
+ regex?: string | undefined;
1434
+ } | undefined;
1435
+ key?: {
1436
+ exact?: string | undefined;
1437
+ startsWith?: string | undefined;
1438
+ regex?: string | undefined;
1439
+ } | undefined;
1440
+ }[] | undefined;
1441
+ method?: string[] | undefined;
1442
+ queryString?: {
1443
+ value?: {
1444
+ exact?: string | undefined;
1445
+ startsWith?: string | undefined;
1446
+ regex?: string | undefined;
1447
+ } | undefined;
1448
+ key?: {
1449
+ exact?: string | undefined;
1450
+ startsWith?: string | undefined;
1451
+ regex?: string | undefined;
1452
+ } | undefined;
1453
+ }[] | undefined;
1454
+ }>>;
1455
+ }, "strip", zod0.ZodTypeAny, {
1456
+ domain: string;
1457
+ match?: {
1458
+ path?: {
1459
+ exact?: string | undefined;
1460
+ startsWith?: string | undefined;
1461
+ regex?: string | undefined;
1462
+ } | undefined;
1463
+ headers?: {
1464
+ value?: {
1465
+ exact?: string | undefined;
1466
+ startsWith?: string | undefined;
1467
+ regex?: string | undefined;
1468
+ } | undefined;
1469
+ key?: {
1470
+ exact?: string | undefined;
1471
+ startsWith?: string | undefined;
1472
+ regex?: string | undefined;
1473
+ } | undefined;
1474
+ }[] | undefined;
1475
+ method?: string[] | undefined;
1476
+ queryString?: {
1477
+ value?: {
1478
+ exact?: string | undefined;
1479
+ startsWith?: string | undefined;
1480
+ regex?: string | undefined;
1481
+ } | undefined;
1482
+ key?: {
1483
+ exact?: string | undefined;
1484
+ startsWith?: string | undefined;
1485
+ regex?: string | undefined;
1486
+ } | undefined;
1487
+ }[] | undefined;
1488
+ } | undefined;
1489
+ headers?: Record<string, string> | undefined;
1490
+ headerNames?: string[] | undefined;
1491
+ }, {
1492
+ domain: string;
1493
+ match?: {
1494
+ path?: {
1495
+ exact?: string | undefined;
1496
+ startsWith?: string | undefined;
1497
+ regex?: string | undefined;
1498
+ } | undefined;
1499
+ headers?: {
1500
+ value?: {
1501
+ exact?: string | undefined;
1502
+ startsWith?: string | undefined;
1503
+ regex?: string | undefined;
1504
+ } | undefined;
1505
+ key?: {
1506
+ exact?: string | undefined;
1507
+ startsWith?: string | undefined;
1508
+ regex?: string | undefined;
1509
+ } | undefined;
1510
+ }[] | undefined;
1511
+ method?: string[] | undefined;
1512
+ queryString?: {
1513
+ value?: {
1514
+ exact?: string | undefined;
1515
+ startsWith?: string | undefined;
1516
+ regex?: string | undefined;
1517
+ } | undefined;
1518
+ key?: {
1519
+ exact?: string | undefined;
1520
+ startsWith?: string | undefined;
1521
+ regex?: string | undefined;
1522
+ } | undefined;
1523
+ }[] | undefined;
1524
+ } | undefined;
1525
+ headers?: Record<string, string> | undefined;
1526
+ headerNames?: string[] | undefined;
1527
+ }>, "many">>;
1528
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1529
+ domain: zod0.ZodString;
1530
+ forwardURL: zod0.ZodString;
1531
+ match: zod0.ZodOptional<zod0.ZodObject<{
1532
+ path: zod0.ZodOptional<zod0.ZodObject<{
1533
+ exact: zod0.ZodOptional<zod0.ZodString>;
1534
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1535
+ regex: zod0.ZodOptional<zod0.ZodString>;
1536
+ }, "strip", zod0.ZodTypeAny, {
1537
+ exact?: string | undefined;
1538
+ startsWith?: string | undefined;
1539
+ regex?: string | undefined;
1540
+ }, {
1541
+ exact?: string | undefined;
1542
+ startsWith?: string | undefined;
1543
+ regex?: string | undefined;
1544
+ }>>;
1545
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1546
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1547
+ key: zod0.ZodOptional<zod0.ZodObject<{
1548
+ exact: zod0.ZodOptional<zod0.ZodString>;
1549
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1550
+ regex: zod0.ZodOptional<zod0.ZodString>;
1551
+ }, "strip", zod0.ZodTypeAny, {
1552
+ exact?: string | undefined;
1553
+ startsWith?: string | undefined;
1554
+ regex?: string | undefined;
1555
+ }, {
1556
+ exact?: string | undefined;
1557
+ startsWith?: string | undefined;
1558
+ regex?: string | undefined;
1559
+ }>>;
1560
+ value: zod0.ZodOptional<zod0.ZodObject<{
1561
+ exact: zod0.ZodOptional<zod0.ZodString>;
1562
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1563
+ regex: zod0.ZodOptional<zod0.ZodString>;
1564
+ }, "strip", zod0.ZodTypeAny, {
1565
+ exact?: string | undefined;
1566
+ startsWith?: string | undefined;
1567
+ regex?: string | undefined;
1568
+ }, {
1569
+ exact?: string | undefined;
1570
+ startsWith?: string | undefined;
1571
+ regex?: string | undefined;
1572
+ }>>;
1573
+ }, "strip", zod0.ZodTypeAny, {
1574
+ value?: {
1575
+ exact?: string | undefined;
1576
+ startsWith?: string | undefined;
1577
+ regex?: string | undefined;
1578
+ } | undefined;
1579
+ key?: {
1580
+ exact?: string | undefined;
1581
+ startsWith?: string | undefined;
1582
+ regex?: string | undefined;
1583
+ } | undefined;
1584
+ }, {
1585
+ value?: {
1586
+ exact?: string | undefined;
1587
+ startsWith?: string | undefined;
1588
+ regex?: string | undefined;
1589
+ } | undefined;
1590
+ key?: {
1591
+ exact?: string | undefined;
1592
+ startsWith?: string | undefined;
1593
+ regex?: string | undefined;
1594
+ } | undefined;
1595
+ }>, "many">>;
1596
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1597
+ key: zod0.ZodOptional<zod0.ZodObject<{
1598
+ exact: zod0.ZodOptional<zod0.ZodString>;
1599
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1600
+ regex: zod0.ZodOptional<zod0.ZodString>;
1601
+ }, "strip", zod0.ZodTypeAny, {
1602
+ exact?: string | undefined;
1603
+ startsWith?: string | undefined;
1604
+ regex?: string | undefined;
1605
+ }, {
1606
+ exact?: string | undefined;
1607
+ startsWith?: string | undefined;
1608
+ regex?: string | undefined;
1609
+ }>>;
1610
+ value: zod0.ZodOptional<zod0.ZodObject<{
1611
+ exact: zod0.ZodOptional<zod0.ZodString>;
1612
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1613
+ regex: zod0.ZodOptional<zod0.ZodString>;
1614
+ }, "strip", zod0.ZodTypeAny, {
1615
+ exact?: string | undefined;
1616
+ startsWith?: string | undefined;
1617
+ regex?: string | undefined;
1618
+ }, {
1619
+ exact?: string | undefined;
1620
+ startsWith?: string | undefined;
1621
+ regex?: string | undefined;
1622
+ }>>;
1623
+ }, "strip", zod0.ZodTypeAny, {
1624
+ value?: {
1625
+ exact?: string | undefined;
1626
+ startsWith?: string | undefined;
1627
+ regex?: string | undefined;
1628
+ } | undefined;
1629
+ key?: {
1630
+ exact?: string | undefined;
1631
+ startsWith?: string | undefined;
1632
+ regex?: string | undefined;
1633
+ } | undefined;
1634
+ }, {
1635
+ value?: {
1636
+ exact?: string | undefined;
1637
+ startsWith?: string | undefined;
1638
+ regex?: string | undefined;
1639
+ } | undefined;
1640
+ key?: {
1641
+ exact?: string | undefined;
1642
+ startsWith?: string | undefined;
1643
+ regex?: string | undefined;
1644
+ } | undefined;
1645
+ }>, "many">>;
1646
+ }, "strip", zod0.ZodTypeAny, {
1647
+ path?: {
1648
+ exact?: string | undefined;
1649
+ startsWith?: string | undefined;
1650
+ regex?: string | undefined;
1651
+ } | undefined;
1652
+ headers?: {
1653
+ value?: {
1654
+ exact?: string | undefined;
1655
+ startsWith?: string | undefined;
1656
+ regex?: string | undefined;
1657
+ } | undefined;
1658
+ key?: {
1659
+ exact?: string | undefined;
1660
+ startsWith?: string | undefined;
1661
+ regex?: string | undefined;
1662
+ } | undefined;
1663
+ }[] | undefined;
1664
+ method?: string[] | undefined;
1665
+ queryString?: {
1666
+ value?: {
1667
+ exact?: string | undefined;
1668
+ startsWith?: string | undefined;
1669
+ regex?: string | undefined;
1670
+ } | undefined;
1671
+ key?: {
1672
+ exact?: string | undefined;
1673
+ startsWith?: string | undefined;
1674
+ regex?: string | undefined;
1675
+ } | undefined;
1676
+ }[] | undefined;
1677
+ }, {
1678
+ path?: {
1679
+ exact?: string | undefined;
1680
+ startsWith?: string | undefined;
1681
+ regex?: string | undefined;
1682
+ } | undefined;
1683
+ headers?: {
1684
+ value?: {
1685
+ exact?: string | undefined;
1686
+ startsWith?: string | undefined;
1687
+ regex?: string | undefined;
1688
+ } | undefined;
1689
+ key?: {
1690
+ exact?: string | undefined;
1691
+ startsWith?: string | undefined;
1692
+ regex?: string | undefined;
1693
+ } | undefined;
1694
+ }[] | undefined;
1695
+ method?: string[] | undefined;
1696
+ queryString?: {
1697
+ value?: {
1698
+ exact?: string | undefined;
1699
+ startsWith?: string | undefined;
1700
+ regex?: string | undefined;
1701
+ } | undefined;
1702
+ key?: {
1703
+ exact?: string | undefined;
1704
+ startsWith?: string | undefined;
1705
+ regex?: string | undefined;
1706
+ } | undefined;
1707
+ }[] | undefined;
1708
+ }>>;
1709
+ }, "strip", zod0.ZodTypeAny, {
1710
+ domain: string;
1711
+ forwardURL: string;
1712
+ match?: {
1713
+ path?: {
1714
+ exact?: string | undefined;
1715
+ startsWith?: string | undefined;
1716
+ regex?: string | undefined;
1717
+ } | undefined;
1718
+ headers?: {
1719
+ value?: {
1720
+ exact?: string | undefined;
1721
+ startsWith?: string | undefined;
1722
+ regex?: string | undefined;
1723
+ } | undefined;
1724
+ key?: {
1725
+ exact?: string | undefined;
1726
+ startsWith?: string | undefined;
1727
+ regex?: string | undefined;
1728
+ } | undefined;
1729
+ }[] | undefined;
1730
+ method?: string[] | undefined;
1731
+ queryString?: {
1732
+ value?: {
1733
+ exact?: string | undefined;
1734
+ startsWith?: string | undefined;
1735
+ regex?: string | undefined;
1736
+ } | undefined;
1737
+ key?: {
1738
+ exact?: string | undefined;
1739
+ startsWith?: string | undefined;
1740
+ regex?: string | undefined;
1741
+ } | undefined;
1742
+ }[] | undefined;
1743
+ } | undefined;
1744
+ }, {
1745
+ domain: string;
1746
+ forwardURL: string;
1747
+ match?: {
1748
+ path?: {
1749
+ exact?: string | undefined;
1750
+ startsWith?: string | undefined;
1751
+ regex?: string | undefined;
1752
+ } | undefined;
1753
+ headers?: {
1754
+ value?: {
1755
+ exact?: string | undefined;
1756
+ startsWith?: string | undefined;
1757
+ regex?: string | undefined;
1758
+ } | undefined;
1759
+ key?: {
1760
+ exact?: string | undefined;
1761
+ startsWith?: string | undefined;
1762
+ regex?: string | undefined;
1763
+ } | undefined;
1764
+ }[] | undefined;
1765
+ method?: string[] | undefined;
1766
+ queryString?: {
1767
+ value?: {
1768
+ exact?: string | undefined;
1769
+ startsWith?: string | undefined;
1770
+ regex?: string | undefined;
1771
+ } | undefined;
1772
+ key?: {
1773
+ exact?: string | undefined;
1774
+ startsWith?: string | undefined;
1775
+ regex?: string | undefined;
1776
+ } | undefined;
1777
+ }[] | undefined;
1778
+ } | undefined;
1779
+ }>, "many">>;
1780
+ }, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
1781
+ mode: zod0.ZodLiteral<"custom">;
1782
+ allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1783
+ allowedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1784
+ deniedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1785
+ injectionRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1786
+ domain: zod0.ZodString;
1787
+ headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
1788
+ headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1789
+ match: zod0.ZodOptional<zod0.ZodObject<{
1790
+ path: zod0.ZodOptional<zod0.ZodObject<{
1791
+ exact: zod0.ZodOptional<zod0.ZodString>;
1792
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1793
+ regex: zod0.ZodOptional<zod0.ZodString>;
1794
+ }, "strip", zod0.ZodTypeAny, {
1795
+ exact?: string | undefined;
1796
+ startsWith?: string | undefined;
1797
+ regex?: string | undefined;
1798
+ }, {
1799
+ exact?: string | undefined;
1800
+ startsWith?: string | undefined;
1801
+ regex?: string | undefined;
1802
+ }>>;
1803
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1804
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1805
+ key: zod0.ZodOptional<zod0.ZodObject<{
1806
+ exact: zod0.ZodOptional<zod0.ZodString>;
1807
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1808
+ regex: zod0.ZodOptional<zod0.ZodString>;
1809
+ }, "strip", zod0.ZodTypeAny, {
1810
+ exact?: string | undefined;
1811
+ startsWith?: string | undefined;
1812
+ regex?: string | undefined;
1813
+ }, {
1814
+ exact?: string | undefined;
1815
+ startsWith?: string | undefined;
1816
+ regex?: string | undefined;
1817
+ }>>;
1818
+ value: zod0.ZodOptional<zod0.ZodObject<{
1819
+ exact: zod0.ZodOptional<zod0.ZodString>;
1820
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1821
+ regex: zod0.ZodOptional<zod0.ZodString>;
1822
+ }, "strip", zod0.ZodTypeAny, {
1823
+ exact?: string | undefined;
1824
+ startsWith?: string | undefined;
1825
+ regex?: string | undefined;
1826
+ }, {
1827
+ exact?: string | undefined;
1828
+ startsWith?: string | undefined;
1829
+ regex?: string | undefined;
1830
+ }>>;
1831
+ }, "strip", zod0.ZodTypeAny, {
1832
+ value?: {
1833
+ exact?: string | undefined;
1834
+ startsWith?: string | undefined;
1835
+ regex?: string | undefined;
1836
+ } | undefined;
1837
+ key?: {
1838
+ exact?: string | undefined;
1839
+ startsWith?: string | undefined;
1840
+ regex?: string | undefined;
1841
+ } | undefined;
1842
+ }, {
1843
+ value?: {
1844
+ exact?: string | undefined;
1845
+ startsWith?: string | undefined;
1846
+ regex?: string | undefined;
1847
+ } | undefined;
1848
+ key?: {
1849
+ exact?: string | undefined;
1850
+ startsWith?: string | undefined;
1851
+ regex?: string | undefined;
1852
+ } | undefined;
1853
+ }>, "many">>;
1854
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1855
+ key: zod0.ZodOptional<zod0.ZodObject<{
1856
+ exact: zod0.ZodOptional<zod0.ZodString>;
1857
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1858
+ regex: zod0.ZodOptional<zod0.ZodString>;
1859
+ }, "strip", zod0.ZodTypeAny, {
1860
+ exact?: string | undefined;
1861
+ startsWith?: string | undefined;
1862
+ regex?: string | undefined;
1863
+ }, {
1864
+ exact?: string | undefined;
1865
+ startsWith?: string | undefined;
1866
+ regex?: string | undefined;
1867
+ }>>;
1868
+ value: zod0.ZodOptional<zod0.ZodObject<{
1869
+ exact: zod0.ZodOptional<zod0.ZodString>;
1870
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1871
+ regex: zod0.ZodOptional<zod0.ZodString>;
1872
+ }, "strip", zod0.ZodTypeAny, {
1873
+ exact?: string | undefined;
1874
+ startsWith?: string | undefined;
1875
+ regex?: string | undefined;
1876
+ }, {
1877
+ exact?: string | undefined;
1878
+ startsWith?: string | undefined;
1879
+ regex?: string | undefined;
1880
+ }>>;
1881
+ }, "strip", zod0.ZodTypeAny, {
1882
+ value?: {
1883
+ exact?: string | undefined;
1884
+ startsWith?: string | undefined;
1885
+ regex?: string | undefined;
1886
+ } | undefined;
1887
+ key?: {
1888
+ exact?: string | undefined;
1889
+ startsWith?: string | undefined;
1890
+ regex?: string | undefined;
1891
+ } | undefined;
1892
+ }, {
1893
+ value?: {
1894
+ exact?: string | undefined;
1895
+ startsWith?: string | undefined;
1896
+ regex?: string | undefined;
1897
+ } | undefined;
1898
+ key?: {
1899
+ exact?: string | undefined;
1900
+ startsWith?: string | undefined;
1901
+ regex?: string | undefined;
1902
+ } | undefined;
1903
+ }>, "many">>;
1904
+ }, "strip", zod0.ZodTypeAny, {
1905
+ path?: {
1906
+ exact?: string | undefined;
1907
+ startsWith?: string | undefined;
1908
+ regex?: string | undefined;
1909
+ } | undefined;
1910
+ headers?: {
1911
+ value?: {
1912
+ exact?: string | undefined;
1913
+ startsWith?: string | undefined;
1914
+ regex?: string | undefined;
1915
+ } | undefined;
1916
+ key?: {
1917
+ exact?: string | undefined;
1918
+ startsWith?: string | undefined;
1919
+ regex?: string | undefined;
1920
+ } | undefined;
1921
+ }[] | undefined;
1922
+ method?: string[] | undefined;
1923
+ queryString?: {
1924
+ value?: {
1925
+ exact?: string | undefined;
1926
+ startsWith?: string | undefined;
1927
+ regex?: string | undefined;
1928
+ } | undefined;
1929
+ key?: {
1930
+ exact?: string | undefined;
1931
+ startsWith?: string | undefined;
1932
+ regex?: string | undefined;
1933
+ } | undefined;
1934
+ }[] | undefined;
1935
+ }, {
1936
+ path?: {
1937
+ exact?: string | undefined;
1938
+ startsWith?: string | undefined;
1939
+ regex?: string | undefined;
1940
+ } | undefined;
1941
+ headers?: {
1942
+ value?: {
1943
+ exact?: string | undefined;
1944
+ startsWith?: string | undefined;
1945
+ regex?: string | undefined;
1946
+ } | undefined;
1947
+ key?: {
1948
+ exact?: string | undefined;
1949
+ startsWith?: string | undefined;
1950
+ regex?: string | undefined;
1951
+ } | undefined;
1952
+ }[] | undefined;
1953
+ method?: string[] | undefined;
1954
+ queryString?: {
1955
+ value?: {
1956
+ exact?: string | undefined;
1957
+ startsWith?: string | undefined;
1958
+ regex?: string | undefined;
1959
+ } | undefined;
1960
+ key?: {
1961
+ exact?: string | undefined;
1962
+ startsWith?: string | undefined;
1963
+ regex?: string | undefined;
1964
+ } | undefined;
1965
+ }[] | undefined;
1966
+ }>>;
1967
+ }, "strip", zod0.ZodTypeAny, {
1968
+ domain: string;
1969
+ match?: {
1970
+ path?: {
1971
+ exact?: string | undefined;
1972
+ startsWith?: string | undefined;
1973
+ regex?: string | undefined;
1974
+ } | undefined;
1975
+ headers?: {
1976
+ value?: {
1977
+ exact?: string | undefined;
1978
+ startsWith?: string | undefined;
1979
+ regex?: string | undefined;
1980
+ } | undefined;
1981
+ key?: {
1982
+ exact?: string | undefined;
1983
+ startsWith?: string | undefined;
1984
+ regex?: string | undefined;
1985
+ } | undefined;
1986
+ }[] | undefined;
1987
+ method?: string[] | undefined;
1988
+ queryString?: {
1989
+ value?: {
1990
+ exact?: string | undefined;
1991
+ startsWith?: string | undefined;
1992
+ regex?: string | undefined;
1993
+ } | undefined;
1994
+ key?: {
1995
+ exact?: string | undefined;
1996
+ startsWith?: string | undefined;
1997
+ regex?: string | undefined;
1998
+ } | undefined;
1999
+ }[] | undefined;
2000
+ } | undefined;
2001
+ headers?: Record<string, string> | undefined;
2002
+ headerNames?: string[] | undefined;
2003
+ }, {
2004
+ domain: string;
2005
+ match?: {
2006
+ path?: {
2007
+ exact?: string | undefined;
2008
+ startsWith?: string | undefined;
2009
+ regex?: string | undefined;
2010
+ } | undefined;
2011
+ headers?: {
2012
+ value?: {
2013
+ exact?: string | undefined;
2014
+ startsWith?: string | undefined;
2015
+ regex?: string | undefined;
2016
+ } | undefined;
2017
+ key?: {
2018
+ exact?: string | undefined;
2019
+ startsWith?: string | undefined;
2020
+ regex?: string | undefined;
2021
+ } | undefined;
2022
+ }[] | undefined;
2023
+ method?: string[] | undefined;
2024
+ queryString?: {
2025
+ value?: {
2026
+ exact?: string | undefined;
2027
+ startsWith?: string | undefined;
2028
+ regex?: string | undefined;
2029
+ } | undefined;
2030
+ key?: {
2031
+ exact?: string | undefined;
2032
+ startsWith?: string | undefined;
2033
+ regex?: string | undefined;
2034
+ } | undefined;
2035
+ }[] | undefined;
2036
+ } | undefined;
2037
+ headers?: Record<string, string> | undefined;
2038
+ headerNames?: string[] | undefined;
2039
+ }>, "many">>;
2040
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2041
+ domain: zod0.ZodString;
2042
+ forwardURL: zod0.ZodString;
2043
+ match: zod0.ZodOptional<zod0.ZodObject<{
2044
+ path: zod0.ZodOptional<zod0.ZodObject<{
2045
+ exact: zod0.ZodOptional<zod0.ZodString>;
2046
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2047
+ regex: zod0.ZodOptional<zod0.ZodString>;
2048
+ }, "strip", zod0.ZodTypeAny, {
2049
+ exact?: string | undefined;
2050
+ startsWith?: string | undefined;
2051
+ regex?: string | undefined;
2052
+ }, {
2053
+ exact?: string | undefined;
2054
+ startsWith?: string | undefined;
2055
+ regex?: string | undefined;
2056
+ }>>;
2057
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2058
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2059
+ key: zod0.ZodOptional<zod0.ZodObject<{
2060
+ exact: zod0.ZodOptional<zod0.ZodString>;
2061
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2062
+ regex: zod0.ZodOptional<zod0.ZodString>;
2063
+ }, "strip", zod0.ZodTypeAny, {
2064
+ exact?: string | undefined;
2065
+ startsWith?: string | undefined;
2066
+ regex?: string | undefined;
2067
+ }, {
2068
+ exact?: string | undefined;
2069
+ startsWith?: string | undefined;
2070
+ regex?: string | undefined;
2071
+ }>>;
2072
+ value: zod0.ZodOptional<zod0.ZodObject<{
2073
+ exact: zod0.ZodOptional<zod0.ZodString>;
2074
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2075
+ regex: zod0.ZodOptional<zod0.ZodString>;
2076
+ }, "strip", zod0.ZodTypeAny, {
2077
+ exact?: string | undefined;
2078
+ startsWith?: string | undefined;
2079
+ regex?: string | undefined;
2080
+ }, {
2081
+ exact?: string | undefined;
2082
+ startsWith?: string | undefined;
2083
+ regex?: string | undefined;
2084
+ }>>;
2085
+ }, "strip", zod0.ZodTypeAny, {
2086
+ value?: {
2087
+ exact?: string | undefined;
2088
+ startsWith?: string | undefined;
2089
+ regex?: string | undefined;
2090
+ } | undefined;
2091
+ key?: {
2092
+ exact?: string | undefined;
2093
+ startsWith?: string | undefined;
2094
+ regex?: string | undefined;
2095
+ } | undefined;
2096
+ }, {
2097
+ value?: {
2098
+ exact?: string | undefined;
2099
+ startsWith?: string | undefined;
2100
+ regex?: string | undefined;
2101
+ } | undefined;
2102
+ key?: {
2103
+ exact?: string | undefined;
2104
+ startsWith?: string | undefined;
2105
+ regex?: string | undefined;
2106
+ } | undefined;
2107
+ }>, "many">>;
2108
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2109
+ key: zod0.ZodOptional<zod0.ZodObject<{
2110
+ exact: zod0.ZodOptional<zod0.ZodString>;
2111
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2112
+ regex: zod0.ZodOptional<zod0.ZodString>;
2113
+ }, "strip", zod0.ZodTypeAny, {
2114
+ exact?: string | undefined;
2115
+ startsWith?: string | undefined;
2116
+ regex?: string | undefined;
2117
+ }, {
2118
+ exact?: string | undefined;
2119
+ startsWith?: string | undefined;
2120
+ regex?: string | undefined;
2121
+ }>>;
2122
+ value: zod0.ZodOptional<zod0.ZodObject<{
2123
+ exact: zod0.ZodOptional<zod0.ZodString>;
2124
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2125
+ regex: zod0.ZodOptional<zod0.ZodString>;
2126
+ }, "strip", zod0.ZodTypeAny, {
2127
+ exact?: string | undefined;
2128
+ startsWith?: string | undefined;
2129
+ regex?: string | undefined;
2130
+ }, {
2131
+ exact?: string | undefined;
2132
+ startsWith?: string | undefined;
2133
+ regex?: string | undefined;
2134
+ }>>;
2135
+ }, "strip", zod0.ZodTypeAny, {
2136
+ value?: {
2137
+ exact?: string | undefined;
2138
+ startsWith?: string | undefined;
2139
+ regex?: string | undefined;
2140
+ } | undefined;
2141
+ key?: {
2142
+ exact?: string | undefined;
2143
+ startsWith?: string | undefined;
2144
+ regex?: string | undefined;
2145
+ } | undefined;
2146
+ }, {
2147
+ value?: {
2148
+ exact?: string | undefined;
2149
+ startsWith?: string | undefined;
2150
+ regex?: string | undefined;
2151
+ } | undefined;
2152
+ key?: {
2153
+ exact?: string | undefined;
2154
+ startsWith?: string | undefined;
2155
+ regex?: string | undefined;
2156
+ } | undefined;
2157
+ }>, "many">>;
2158
+ }, "strip", zod0.ZodTypeAny, {
2159
+ path?: {
2160
+ exact?: string | undefined;
2161
+ startsWith?: string | undefined;
2162
+ regex?: string | undefined;
2163
+ } | undefined;
2164
+ headers?: {
2165
+ value?: {
2166
+ exact?: string | undefined;
2167
+ startsWith?: string | undefined;
2168
+ regex?: string | undefined;
2169
+ } | undefined;
2170
+ key?: {
2171
+ exact?: string | undefined;
2172
+ startsWith?: string | undefined;
2173
+ regex?: string | undefined;
2174
+ } | undefined;
2175
+ }[] | undefined;
2176
+ method?: string[] | undefined;
2177
+ queryString?: {
2178
+ value?: {
2179
+ exact?: string | undefined;
2180
+ startsWith?: string | undefined;
2181
+ regex?: string | undefined;
2182
+ } | undefined;
2183
+ key?: {
2184
+ exact?: string | undefined;
2185
+ startsWith?: string | undefined;
2186
+ regex?: string | undefined;
2187
+ } | undefined;
2188
+ }[] | undefined;
2189
+ }, {
2190
+ path?: {
2191
+ exact?: string | undefined;
2192
+ startsWith?: string | undefined;
2193
+ regex?: string | undefined;
2194
+ } | undefined;
2195
+ headers?: {
2196
+ value?: {
2197
+ exact?: string | undefined;
2198
+ startsWith?: string | undefined;
2199
+ regex?: string | undefined;
2200
+ } | undefined;
2201
+ key?: {
2202
+ exact?: string | undefined;
2203
+ startsWith?: string | undefined;
2204
+ regex?: string | undefined;
2205
+ } | undefined;
2206
+ }[] | undefined;
2207
+ method?: string[] | undefined;
2208
+ queryString?: {
2209
+ value?: {
2210
+ exact?: string | undefined;
2211
+ startsWith?: string | undefined;
2212
+ regex?: string | undefined;
2213
+ } | undefined;
2214
+ key?: {
2215
+ exact?: string | undefined;
2216
+ startsWith?: string | undefined;
2217
+ regex?: string | undefined;
2218
+ } | undefined;
2219
+ }[] | undefined;
2220
+ }>>;
2221
+ }, "strip", zod0.ZodTypeAny, {
2222
+ domain: string;
2223
+ forwardURL: string;
2224
+ match?: {
2225
+ path?: {
2226
+ exact?: string | undefined;
2227
+ startsWith?: string | undefined;
2228
+ regex?: string | undefined;
2229
+ } | undefined;
2230
+ headers?: {
2231
+ value?: {
2232
+ exact?: string | undefined;
2233
+ startsWith?: string | undefined;
2234
+ regex?: string | undefined;
2235
+ } | undefined;
2236
+ key?: {
2237
+ exact?: string | undefined;
2238
+ startsWith?: string | undefined;
2239
+ regex?: string | undefined;
2240
+ } | undefined;
2241
+ }[] | undefined;
2242
+ method?: string[] | undefined;
2243
+ queryString?: {
2244
+ value?: {
2245
+ exact?: string | undefined;
2246
+ startsWith?: string | undefined;
2247
+ regex?: string | undefined;
2248
+ } | undefined;
2249
+ key?: {
2250
+ exact?: string | undefined;
2251
+ startsWith?: string | undefined;
2252
+ regex?: string | undefined;
2253
+ } | undefined;
2254
+ }[] | undefined;
2255
+ } | undefined;
2256
+ }, {
2257
+ domain: string;
2258
+ forwardURL: string;
2259
+ match?: {
2260
+ path?: {
2261
+ exact?: string | undefined;
2262
+ startsWith?: string | undefined;
2263
+ regex?: string | undefined;
2264
+ } | undefined;
2265
+ headers?: {
2266
+ value?: {
2267
+ exact?: string | undefined;
2268
+ startsWith?: string | undefined;
2269
+ regex?: string | undefined;
2270
+ } | undefined;
2271
+ key?: {
2272
+ exact?: string | undefined;
2273
+ startsWith?: string | undefined;
2274
+ regex?: string | undefined;
2275
+ } | undefined;
2276
+ }[] | undefined;
2277
+ method?: string[] | undefined;
2278
+ queryString?: {
2279
+ value?: {
2280
+ exact?: string | undefined;
2281
+ startsWith?: string | undefined;
2282
+ regex?: string | undefined;
2283
+ } | undefined;
2284
+ key?: {
2285
+ exact?: string | undefined;
2286
+ startsWith?: string | undefined;
2287
+ regex?: string | undefined;
2288
+ } | undefined;
2289
+ }[] | undefined;
2290
+ } | undefined;
2291
+ }>, "many">>;
2292
+ }, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
2293
+ mode: zod0.ZodLiteral<"custom">;
2294
+ allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2295
+ allowedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2296
+ deniedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2297
+ injectionRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2298
+ domain: zod0.ZodString;
2299
+ headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
2300
+ headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2301
+ match: zod0.ZodOptional<zod0.ZodObject<{
2302
+ path: zod0.ZodOptional<zod0.ZodObject<{
2303
+ exact: zod0.ZodOptional<zod0.ZodString>;
2304
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2305
+ regex: zod0.ZodOptional<zod0.ZodString>;
2306
+ }, "strip", zod0.ZodTypeAny, {
2307
+ exact?: string | undefined;
2308
+ startsWith?: string | undefined;
2309
+ regex?: string | undefined;
2310
+ }, {
2311
+ exact?: string | undefined;
2312
+ startsWith?: string | undefined;
2313
+ regex?: string | undefined;
2314
+ }>>;
2315
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2316
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2317
+ key: zod0.ZodOptional<zod0.ZodObject<{
2318
+ exact: zod0.ZodOptional<zod0.ZodString>;
2319
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2320
+ regex: zod0.ZodOptional<zod0.ZodString>;
2321
+ }, "strip", zod0.ZodTypeAny, {
2322
+ exact?: string | undefined;
2323
+ startsWith?: string | undefined;
2324
+ regex?: string | undefined;
2325
+ }, {
2326
+ exact?: string | undefined;
2327
+ startsWith?: string | undefined;
2328
+ regex?: string | undefined;
2329
+ }>>;
2330
+ value: zod0.ZodOptional<zod0.ZodObject<{
2331
+ exact: zod0.ZodOptional<zod0.ZodString>;
2332
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2333
+ regex: zod0.ZodOptional<zod0.ZodString>;
2334
+ }, "strip", zod0.ZodTypeAny, {
2335
+ exact?: string | undefined;
2336
+ startsWith?: string | undefined;
2337
+ regex?: string | undefined;
2338
+ }, {
2339
+ exact?: string | undefined;
2340
+ startsWith?: string | undefined;
2341
+ regex?: string | undefined;
2342
+ }>>;
2343
+ }, "strip", zod0.ZodTypeAny, {
2344
+ value?: {
2345
+ exact?: string | undefined;
2346
+ startsWith?: string | undefined;
2347
+ regex?: string | undefined;
2348
+ } | undefined;
2349
+ key?: {
2350
+ exact?: string | undefined;
2351
+ startsWith?: string | undefined;
2352
+ regex?: string | undefined;
2353
+ } | undefined;
2354
+ }, {
2355
+ value?: {
2356
+ exact?: string | undefined;
2357
+ startsWith?: string | undefined;
2358
+ regex?: string | undefined;
2359
+ } | undefined;
2360
+ key?: {
2361
+ exact?: string | undefined;
2362
+ startsWith?: string | undefined;
2363
+ regex?: string | undefined;
2364
+ } | undefined;
2365
+ }>, "many">>;
2366
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2367
+ key: zod0.ZodOptional<zod0.ZodObject<{
2368
+ exact: zod0.ZodOptional<zod0.ZodString>;
2369
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2370
+ regex: zod0.ZodOptional<zod0.ZodString>;
2371
+ }, "strip", zod0.ZodTypeAny, {
2372
+ exact?: string | undefined;
2373
+ startsWith?: string | undefined;
2374
+ regex?: string | undefined;
2375
+ }, {
2376
+ exact?: string | undefined;
2377
+ startsWith?: string | undefined;
2378
+ regex?: string | undefined;
2379
+ }>>;
2380
+ value: zod0.ZodOptional<zod0.ZodObject<{
2381
+ exact: zod0.ZodOptional<zod0.ZodString>;
2382
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2383
+ regex: zod0.ZodOptional<zod0.ZodString>;
2384
+ }, "strip", zod0.ZodTypeAny, {
2385
+ exact?: string | undefined;
2386
+ startsWith?: string | undefined;
2387
+ regex?: string | undefined;
2388
+ }, {
2389
+ exact?: string | undefined;
2390
+ startsWith?: string | undefined;
2391
+ regex?: string | undefined;
2392
+ }>>;
2393
+ }, "strip", zod0.ZodTypeAny, {
2394
+ value?: {
2395
+ exact?: string | undefined;
2396
+ startsWith?: string | undefined;
2397
+ regex?: string | undefined;
2398
+ } | undefined;
2399
+ key?: {
2400
+ exact?: string | undefined;
2401
+ startsWith?: string | undefined;
2402
+ regex?: string | undefined;
2403
+ } | undefined;
2404
+ }, {
2405
+ value?: {
2406
+ exact?: string | undefined;
2407
+ startsWith?: string | undefined;
2408
+ regex?: string | undefined;
2409
+ } | undefined;
2410
+ key?: {
2411
+ exact?: string | undefined;
2412
+ startsWith?: string | undefined;
2413
+ regex?: string | undefined;
2414
+ } | undefined;
2415
+ }>, "many">>;
2416
+ }, "strip", zod0.ZodTypeAny, {
2417
+ path?: {
2418
+ exact?: string | undefined;
2419
+ startsWith?: string | undefined;
2420
+ regex?: string | undefined;
2421
+ } | undefined;
2422
+ headers?: {
2423
+ value?: {
2424
+ exact?: string | undefined;
2425
+ startsWith?: string | undefined;
2426
+ regex?: string | undefined;
2427
+ } | undefined;
2428
+ key?: {
2429
+ exact?: string | undefined;
2430
+ startsWith?: string | undefined;
2431
+ regex?: string | undefined;
2432
+ } | undefined;
2433
+ }[] | undefined;
2434
+ method?: string[] | undefined;
2435
+ queryString?: {
2436
+ value?: {
2437
+ exact?: string | undefined;
2438
+ startsWith?: string | undefined;
2439
+ regex?: string | undefined;
2440
+ } | undefined;
2441
+ key?: {
2442
+ exact?: string | undefined;
2443
+ startsWith?: string | undefined;
2444
+ regex?: string | undefined;
2445
+ } | undefined;
2446
+ }[] | undefined;
2447
+ }, {
2448
+ path?: {
2449
+ exact?: string | undefined;
2450
+ startsWith?: string | undefined;
2451
+ regex?: string | undefined;
2452
+ } | undefined;
2453
+ headers?: {
2454
+ value?: {
2455
+ exact?: string | undefined;
2456
+ startsWith?: string | undefined;
2457
+ regex?: string | undefined;
2458
+ } | undefined;
2459
+ key?: {
2460
+ exact?: string | undefined;
2461
+ startsWith?: string | undefined;
2462
+ regex?: string | undefined;
2463
+ } | undefined;
2464
+ }[] | undefined;
2465
+ method?: string[] | undefined;
2466
+ queryString?: {
2467
+ value?: {
2468
+ exact?: string | undefined;
2469
+ startsWith?: string | undefined;
2470
+ regex?: string | undefined;
2471
+ } | undefined;
2472
+ key?: {
2473
+ exact?: string | undefined;
2474
+ startsWith?: string | undefined;
2475
+ regex?: string | undefined;
2476
+ } | undefined;
2477
+ }[] | undefined;
2478
+ }>>;
2479
+ }, "strip", zod0.ZodTypeAny, {
2480
+ domain: string;
2481
+ match?: {
2482
+ path?: {
2483
+ exact?: string | undefined;
2484
+ startsWith?: string | undefined;
2485
+ regex?: string | undefined;
2486
+ } | undefined;
2487
+ headers?: {
2488
+ value?: {
2489
+ exact?: string | undefined;
2490
+ startsWith?: string | undefined;
2491
+ regex?: string | undefined;
2492
+ } | undefined;
2493
+ key?: {
2494
+ exact?: string | undefined;
2495
+ startsWith?: string | undefined;
2496
+ regex?: string | undefined;
2497
+ } | undefined;
2498
+ }[] | undefined;
2499
+ method?: string[] | undefined;
2500
+ queryString?: {
2501
+ value?: {
2502
+ exact?: string | undefined;
2503
+ startsWith?: string | undefined;
2504
+ regex?: string | undefined;
2505
+ } | undefined;
2506
+ key?: {
2507
+ exact?: string | undefined;
2508
+ startsWith?: string | undefined;
2509
+ regex?: string | undefined;
2510
+ } | undefined;
2511
+ }[] | undefined;
2512
+ } | undefined;
2513
+ headers?: Record<string, string> | undefined;
2514
+ headerNames?: string[] | undefined;
2515
+ }, {
2516
+ domain: string;
2517
+ match?: {
2518
+ path?: {
2519
+ exact?: string | undefined;
2520
+ startsWith?: string | undefined;
2521
+ regex?: string | undefined;
2522
+ } | undefined;
2523
+ headers?: {
2524
+ value?: {
2525
+ exact?: string | undefined;
2526
+ startsWith?: string | undefined;
2527
+ regex?: string | undefined;
2528
+ } | undefined;
2529
+ key?: {
2530
+ exact?: string | undefined;
2531
+ startsWith?: string | undefined;
2532
+ regex?: string | undefined;
2533
+ } | undefined;
2534
+ }[] | undefined;
2535
+ method?: string[] | undefined;
2536
+ queryString?: {
2537
+ value?: {
2538
+ exact?: string | undefined;
2539
+ startsWith?: string | undefined;
2540
+ regex?: string | undefined;
2541
+ } | undefined;
2542
+ key?: {
2543
+ exact?: string | undefined;
2544
+ startsWith?: string | undefined;
2545
+ regex?: string | undefined;
2546
+ } | undefined;
2547
+ }[] | undefined;
2548
+ } | undefined;
2549
+ headers?: Record<string, string> | undefined;
2550
+ headerNames?: string[] | undefined;
2551
+ }>, "many">>;
2552
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2553
+ domain: zod0.ZodString;
2554
+ forwardURL: zod0.ZodString;
2555
+ match: zod0.ZodOptional<zod0.ZodObject<{
2556
+ path: zod0.ZodOptional<zod0.ZodObject<{
2557
+ exact: zod0.ZodOptional<zod0.ZodString>;
2558
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2559
+ regex: zod0.ZodOptional<zod0.ZodString>;
2560
+ }, "strip", zod0.ZodTypeAny, {
2561
+ exact?: string | undefined;
2562
+ startsWith?: string | undefined;
2563
+ regex?: string | undefined;
2564
+ }, {
2565
+ exact?: string | undefined;
2566
+ startsWith?: string | undefined;
2567
+ regex?: string | undefined;
2568
+ }>>;
2569
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2570
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2571
+ key: zod0.ZodOptional<zod0.ZodObject<{
2572
+ exact: zod0.ZodOptional<zod0.ZodString>;
2573
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2574
+ regex: zod0.ZodOptional<zod0.ZodString>;
2575
+ }, "strip", zod0.ZodTypeAny, {
2576
+ exact?: string | undefined;
2577
+ startsWith?: string | undefined;
2578
+ regex?: string | undefined;
2579
+ }, {
2580
+ exact?: string | undefined;
2581
+ startsWith?: string | undefined;
2582
+ regex?: string | undefined;
2583
+ }>>;
2584
+ value: zod0.ZodOptional<zod0.ZodObject<{
2585
+ exact: zod0.ZodOptional<zod0.ZodString>;
2586
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2587
+ regex: zod0.ZodOptional<zod0.ZodString>;
2588
+ }, "strip", zod0.ZodTypeAny, {
2589
+ exact?: string | undefined;
2590
+ startsWith?: string | undefined;
2591
+ regex?: string | undefined;
2592
+ }, {
2593
+ exact?: string | undefined;
2594
+ startsWith?: string | undefined;
2595
+ regex?: string | undefined;
2596
+ }>>;
2597
+ }, "strip", zod0.ZodTypeAny, {
2598
+ value?: {
2599
+ exact?: string | undefined;
2600
+ startsWith?: string | undefined;
2601
+ regex?: string | undefined;
2602
+ } | undefined;
2603
+ key?: {
2604
+ exact?: string | undefined;
2605
+ startsWith?: string | undefined;
2606
+ regex?: string | undefined;
2607
+ } | undefined;
2608
+ }, {
2609
+ value?: {
2610
+ exact?: string | undefined;
2611
+ startsWith?: string | undefined;
2612
+ regex?: string | undefined;
2613
+ } | undefined;
2614
+ key?: {
2615
+ exact?: string | undefined;
2616
+ startsWith?: string | undefined;
2617
+ regex?: string | undefined;
2618
+ } | undefined;
2619
+ }>, "many">>;
2620
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2621
+ key: zod0.ZodOptional<zod0.ZodObject<{
2622
+ exact: zod0.ZodOptional<zod0.ZodString>;
2623
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2624
+ regex: zod0.ZodOptional<zod0.ZodString>;
2625
+ }, "strip", zod0.ZodTypeAny, {
2626
+ exact?: string | undefined;
2627
+ startsWith?: string | undefined;
2628
+ regex?: string | undefined;
2629
+ }, {
2630
+ exact?: string | undefined;
2631
+ startsWith?: string | undefined;
2632
+ regex?: string | undefined;
2633
+ }>>;
2634
+ value: zod0.ZodOptional<zod0.ZodObject<{
2635
+ exact: zod0.ZodOptional<zod0.ZodString>;
2636
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2637
+ regex: zod0.ZodOptional<zod0.ZodString>;
2638
+ }, "strip", zod0.ZodTypeAny, {
2639
+ exact?: string | undefined;
2640
+ startsWith?: string | undefined;
2641
+ regex?: string | undefined;
2642
+ }, {
2643
+ exact?: string | undefined;
2644
+ startsWith?: string | undefined;
2645
+ regex?: string | undefined;
2646
+ }>>;
2647
+ }, "strip", zod0.ZodTypeAny, {
2648
+ value?: {
2649
+ exact?: string | undefined;
2650
+ startsWith?: string | undefined;
2651
+ regex?: string | undefined;
2652
+ } | undefined;
2653
+ key?: {
2654
+ exact?: string | undefined;
2655
+ startsWith?: string | undefined;
2656
+ regex?: string | undefined;
2657
+ } | undefined;
2658
+ }, {
2659
+ value?: {
2660
+ exact?: string | undefined;
2661
+ startsWith?: string | undefined;
2662
+ regex?: string | undefined;
2663
+ } | undefined;
2664
+ key?: {
2665
+ exact?: string | undefined;
2666
+ startsWith?: string | undefined;
2667
+ regex?: string | undefined;
2668
+ } | undefined;
2669
+ }>, "many">>;
2670
+ }, "strip", zod0.ZodTypeAny, {
2671
+ path?: {
2672
+ exact?: string | undefined;
2673
+ startsWith?: string | undefined;
2674
+ regex?: string | undefined;
2675
+ } | undefined;
2676
+ headers?: {
2677
+ value?: {
2678
+ exact?: string | undefined;
2679
+ startsWith?: string | undefined;
2680
+ regex?: string | undefined;
2681
+ } | undefined;
2682
+ key?: {
2683
+ exact?: string | undefined;
2684
+ startsWith?: string | undefined;
2685
+ regex?: string | undefined;
2686
+ } | undefined;
2687
+ }[] | undefined;
2688
+ method?: string[] | undefined;
2689
+ queryString?: {
2690
+ value?: {
2691
+ exact?: string | undefined;
2692
+ startsWith?: string | undefined;
2693
+ regex?: string | undefined;
2694
+ } | undefined;
2695
+ key?: {
2696
+ exact?: string | undefined;
2697
+ startsWith?: string | undefined;
2698
+ regex?: string | undefined;
2699
+ } | undefined;
2700
+ }[] | undefined;
2701
+ }, {
2702
+ path?: {
2703
+ exact?: string | undefined;
2704
+ startsWith?: string | undefined;
2705
+ regex?: string | undefined;
2706
+ } | undefined;
2707
+ headers?: {
2708
+ value?: {
2709
+ exact?: string | undefined;
2710
+ startsWith?: string | undefined;
2711
+ regex?: string | undefined;
2712
+ } | undefined;
2713
+ key?: {
2714
+ exact?: string | undefined;
2715
+ startsWith?: string | undefined;
2716
+ regex?: string | undefined;
2717
+ } | undefined;
2718
+ }[] | undefined;
2719
+ method?: string[] | undefined;
2720
+ queryString?: {
2721
+ value?: {
2722
+ exact?: string | undefined;
2723
+ startsWith?: string | undefined;
2724
+ regex?: string | undefined;
2725
+ } | undefined;
2726
+ key?: {
2727
+ exact?: string | undefined;
2728
+ startsWith?: string | undefined;
2729
+ regex?: string | undefined;
2730
+ } | undefined;
2731
+ }[] | undefined;
2732
+ }>>;
2733
+ }, "strip", zod0.ZodTypeAny, {
2734
+ domain: string;
2735
+ forwardURL: string;
2736
+ match?: {
2737
+ path?: {
2738
+ exact?: string | undefined;
2739
+ startsWith?: string | undefined;
2740
+ regex?: string | undefined;
2741
+ } | undefined;
2742
+ headers?: {
2743
+ value?: {
2744
+ exact?: string | undefined;
2745
+ startsWith?: string | undefined;
2746
+ regex?: string | undefined;
2747
+ } | undefined;
2748
+ key?: {
2749
+ exact?: string | undefined;
2750
+ startsWith?: string | undefined;
2751
+ regex?: string | undefined;
2752
+ } | undefined;
2753
+ }[] | undefined;
2754
+ method?: string[] | undefined;
2755
+ queryString?: {
2756
+ value?: {
2757
+ exact?: string | undefined;
2758
+ startsWith?: string | undefined;
2759
+ regex?: string | undefined;
2760
+ } | undefined;
2761
+ key?: {
2762
+ exact?: string | undefined;
2763
+ startsWith?: string | undefined;
2764
+ regex?: string | undefined;
2765
+ } | undefined;
2766
+ }[] | undefined;
2767
+ } | undefined;
2768
+ }, {
2769
+ domain: string;
2770
+ forwardURL: string;
2771
+ match?: {
2772
+ path?: {
2773
+ exact?: string | undefined;
2774
+ startsWith?: string | undefined;
2775
+ regex?: string | undefined;
2776
+ } | undefined;
2777
+ headers?: {
2778
+ value?: {
2779
+ exact?: string | undefined;
2780
+ startsWith?: string | undefined;
2781
+ regex?: string | undefined;
2782
+ } | undefined;
2783
+ key?: {
2784
+ exact?: string | undefined;
2785
+ startsWith?: string | undefined;
2786
+ regex?: string | undefined;
2787
+ } | undefined;
2788
+ }[] | undefined;
2789
+ method?: string[] | undefined;
2790
+ queryString?: {
2791
+ value?: {
2792
+ exact?: string | undefined;
2793
+ startsWith?: string | undefined;
2794
+ regex?: string | undefined;
2795
+ } | undefined;
2796
+ key?: {
2797
+ exact?: string | undefined;
2798
+ startsWith?: string | undefined;
2799
+ regex?: string | undefined;
2800
+ } | undefined;
2801
+ }[] | undefined;
2802
+ } | undefined;
2803
+ }>, "many">>;
2804
+ }, zod0.ZodTypeAny, "passthrough">>]>>;
2805
+ activeCpuDurationMs: zod0.ZodOptional<zod0.ZodNumber>;
2806
+ networkTransfer: zod0.ZodOptional<zod0.ZodObject<{
2807
+ ingress: zod0.ZodNumber;
2808
+ egress: zod0.ZodNumber;
2809
+ }, "strip", zod0.ZodTypeAny, {
214
2810
  ingress: number;
215
2811
  egress: number;
216
- } | undefined;
217
- /**
218
- * Allow to get a list of sandboxes for a team narrowed to the given params.
219
- * It returns both the sandboxes and the pagination metadata to allow getting
220
- * the next page of results.
221
- */
222
- static list(params?: Partial<Parameters<APIClient["listNamedSandboxes"]>[0]> & Partial<Credentials> & WithFetchOptions): Promise<{
223
- json: {
224
- sandboxes: {
225
- memory: number;
226
- vcpus: number;
227
- region: string;
228
- runtime: string;
229
- timeout: number;
230
- status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
231
- createdAt: number;
232
- updatedAt: number;
233
- name: string;
234
- persistent: boolean;
235
- currentSandboxId: string;
236
- networkPolicy?: import("zod").objectInputType<{
237
- mode: import("zod").ZodLiteral<"allow-all">;
238
- }, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectInputType<{
239
- mode: import("zod").ZodLiteral<"deny-all">;
240
- }, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectInputType<{
241
- mode: import("zod").ZodLiteral<"custom">;
242
- allowedDomains: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
243
- allowedCIDRs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
244
- deniedCIDRs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
245
- injectionRules: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
246
- domain: import("zod").ZodString;
247
- headers: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
248
- headerNames: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
249
- }, "strip", import("zod").ZodTypeAny, {
250
- domain: string;
251
- headers?: Record<string, string> | undefined;
252
- headerNames?: string[] | undefined;
253
- }, {
254
- domain: string;
255
- headers?: Record<string, string> | undefined;
256
- headerNames?: string[] | undefined;
257
- }>, "many">>;
258
- }, import("zod").ZodTypeAny, "passthrough"> | undefined;
259
- totalEgressBytes?: number | undefined;
260
- totalIngressBytes?: number | undefined;
261
- totalActiveCpuDurationMs?: number | undefined;
262
- totalDurationMs?: number | undefined;
263
- currentSnapshotId?: string | undefined;
264
- }[];
265
- pagination: {
266
- count: number;
267
- next: string | null;
268
- total: number;
269
- };
270
- };
271
- response: Response;
272
- text: string;
273
- }>;
274
- /**
275
- * Create a new sandbox.
276
- *
277
- * @param params - Creation parameters and optional credentials.
278
- * @returns A promise resolving to the created {@link Sandbox}.
279
- * @example
280
- * <caption>Create a sandbox and drop it in the end of the block</caption>
281
- * async function fn() {
282
- * await using const sandbox = await Sandbox.create();
283
- * // Sandbox automatically stopped at the end of the lexical scope
284
- * }
285
- */
286
- static create(params?: WithPrivate<CreateSandboxParams | (CreateSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox & AsyncDisposable>;
287
- /**
288
- * Retrieve an existing sandbox and resume its session.
289
- *
290
- * @param params - Get parameters and optional credentials.
291
- * @returns A promise resolving to the {@link Sandbox}.
292
- */
293
- static get(params: WithPrivate<GetSandboxParams | (GetSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
294
- constructor({ client, routes, session, namedSandbox, projectId, }: {
295
- client: APIClient;
296
- routes: SandboxRouteData[];
297
- session: SandboxMetaData;
298
- namedSandbox: NamedSandboxMetaData;
299
- projectId: string;
300
- });
301
- /**
302
- * Get the current session (the running VM) for this sandbox.
303
- *
304
- * @returns The {@link Session} instance.
305
- */
306
- currentSession(): Session;
307
- /**
308
- * Resume this sandbox by creating a new session via `getNamedSandbox`.
309
- */
310
- private resume;
311
- /**
312
- * Poll until the current session reaches a terminal state, then resume.
313
- */
314
- private waitForStopAndResume;
315
- /**
316
- * Execute `fn`, and if the session is stopped/stopping, resume and retry.
317
- */
318
- private withResume;
319
- /**
320
- * Start executing a command in this sandbox.
321
- *
322
- * @param command - The command to execute.
323
- * @param args - Arguments to pass to the command.
324
- * @param opts - Optional parameters.
325
- * @param opts.signal - An AbortSignal to cancel the command execution.
326
- * @returns A {@link CommandFinished} result once execution is done.
327
- */
328
- runCommand(command: string, args?: string[], opts?: {
329
- signal?: AbortSignal;
330
- }): Promise<CommandFinished>;
331
- /**
332
- * Start executing a command in detached mode.
333
- *
334
- * @param params - The command parameters.
335
- * @returns A {@link Command} instance for the running command.
336
- */
337
- runCommand(params: RunCommandParams & {
338
- detached: true;
339
- }): Promise<Command>;
340
- /**
341
- * Start executing a command in this sandbox.
342
- *
343
- * @param params - The command parameters.
344
- * @returns A {@link CommandFinished} result once execution is done.
345
- */
346
- runCommand(params: RunCommandParams): Promise<CommandFinished>;
347
- /**
348
- * Internal helper to start a command in the sandbox.
349
- *
350
- * @param params - Command execution parameters.
351
- * @returns A {@link Command} or {@link CommandFinished}, depending on `detached`.
352
- * @internal
353
- */
354
- getCommand(cmdId: string, opts?: {
355
- signal?: AbortSignal;
356
- }): Promise<Command>;
357
- /**
358
- * Create a directory in the filesystem of this sandbox.
359
- *
360
- * @param path - Path of the directory to create
361
- * @param opts - Optional parameters.
362
- * @param opts.signal - An AbortSignal to cancel the operation.
363
- */
364
- mkDir(path: string, opts?: {
365
- signal?: AbortSignal;
366
- }): Promise<void>;
367
- /**
368
- * Read a file from the filesystem of this sandbox as a stream.
369
- *
370
- * @param file - File to read, with path and optional cwd
371
- * @param opts - Optional parameters.
372
- * @param opts.signal - An AbortSignal to cancel the operation.
373
- * @returns A promise that resolves to a ReadableStream containing the file contents, or null if file not found
374
- */
375
- readFile(file: {
376
- path: string;
377
- cwd?: string;
378
- }, opts?: {
379
- signal?: AbortSignal;
380
- }): Promise<NodeJS.ReadableStream | null>;
381
- /**
382
- * Read a file from the filesystem of this sandbox as a Buffer.
383
- *
384
- * @param file - File to read, with path and optional cwd
385
- * @param opts - Optional parameters.
386
- * @param opts.signal - An AbortSignal to cancel the operation.
387
- * @returns A promise that resolves to the file contents as a Buffer, or null if file not found
388
- */
389
- readFileToBuffer(file: {
390
- path: string;
391
- cwd?: string;
392
- }, opts?: {
393
- signal?: AbortSignal;
394
- }): Promise<Buffer | null>;
395
- /**
396
- * Download a file from the sandbox to the local filesystem.
397
- *
398
- * @param src - Source file on the sandbox, with path and optional cwd
399
- * @param dst - Destination file on the local machine, with path and optional cwd
400
- * @param opts - Optional parameters.
401
- * @param opts.mkdirRecursive - If true, create parent directories for the destination if they don't exist.
402
- * @param opts.signal - An AbortSignal to cancel the operation.
403
- * @returns The absolute path to the written file, or null if the source file was not found
404
- */
405
- downloadFile(src: {
406
- path: string;
407
- cwd?: string;
408
- }, dst: {
409
- path: string;
410
- cwd?: string;
411
- }, opts?: {
412
- mkdirRecursive?: boolean;
413
- signal?: AbortSignal;
414
- }): Promise<string | null>;
415
- /**
416
- * Write files to the filesystem of this sandbox.
417
- * Defaults to writing to /vercel/sandbox unless an absolute path is specified.
418
- * Writes files using the `vercel-sandbox` user.
419
- *
420
- * @param files - Array of files with path and stream/buffer contents
421
- * @param opts - Optional parameters.
422
- * @param opts.signal - An AbortSignal to cancel the operation.
423
- * @returns A promise that resolves when the files are written
424
- */
425
- writeFiles(files: {
426
- path: string;
427
- content: Buffer;
428
- }[], opts?: {
429
- signal?: AbortSignal;
430
- }): Promise<void>;
431
- /**
432
- * Get the public domain of a port of this sandbox.
433
- *
434
- * @param p - Port number to resolve
435
- * @returns A full domain (e.g. `https://subdomain.vercel.run`)
436
- * @throws If the port has no associated route
437
- */
438
- domain(p: number): string;
439
- /**
440
- * Stop the sandbox.
441
- *
442
- * @param opts - Optional parameters.
443
- * @param opts.signal - An AbortSignal to cancel the operation.
444
- * @param opts.blocking - If true, poll until the sandbox has fully stopped and return the final state.
445
- * @returns The sandbox metadata at the time the stop was acknowledged, or after fully stopped if `blocking` is true.
446
- */
447
- stop(opts?: {
448
- signal?: AbortSignal;
449
- blocking?: boolean;
450
- }): Promise<ConvertedSandbox>;
451
- /**
452
- * Update the network policy for this sandbox.
453
- *
454
- * @deprecated Use {@link Sandbox.update} instead.
455
- *
456
- * @param networkPolicy - The new network policy to apply.
457
- * @param opts - Optional parameters.
458
- * @param opts.signal - An AbortSignal to cancel the operation.
459
- * @returns A promise that resolves when the network policy is updated.
460
- *
461
- * @example
462
- * // Restrict to specific domains
463
- * await sandbox.updateNetworkPolicy({
464
- * allow: ["*.npmjs.org", "github.com"],
465
- * });
466
- *
467
- * @example
468
- * // Inject credentials with per-domain transformers
469
- * await sandbox.updateNetworkPolicy({
470
- * allow: {
471
- * "ai-gateway.vercel.sh": [{
472
- * transform: [{
473
- * headers: { authorization: "Bearer ..." }
474
- * }]
475
- * }],
476
- * "*": []
477
- * }
478
- * });
479
- *
480
- * @example
481
- * // Deny all network access
482
- * await sandbox.updateNetworkPolicy("deny-all");
483
- */
484
- updateNetworkPolicy(networkPolicy: NetworkPolicy, opts?: {
485
- signal?: AbortSignal;
486
- }): Promise<NetworkPolicy>;
487
- /**
488
- * Extend the timeout of the sandbox by the specified duration.
489
- *
490
- * This allows you to extend the lifetime of a sandbox up until the maximum
491
- * execution timeout for your plan.
492
- *
493
- * @param duration - The duration in milliseconds to extend the timeout by
494
- * @param opts - Optional parameters.
495
- * @param opts.signal - An AbortSignal to cancel the operation.
496
- * @returns A promise that resolves when the timeout is extended
497
- *
498
- * @example
499
- * const sandbox = await Sandbox.create({ timeout: ms('10m') });
500
- * // Extends timeout by 5 minutes, to a total of 15 minutes.
501
- * await sandbox.extendTimeout(ms('5m'));
502
- */
503
- extendTimeout(duration: number, opts?: {
504
- signal?: AbortSignal;
505
- }): Promise<void>;
506
- /**
507
- * Create a snapshot from this currently running sandbox. New sandboxes can
508
- * then be created from this snapshot using {@link Sandbox.createFromSnapshot}.
509
- *
510
- * Note: this sandbox will be stopped as part of the snapshot creation process.
511
- *
512
- * @param opts - Optional parameters.
513
- * @param opts.expiration - Optional expiration time in milliseconds. Use 0 for no expiration at all.
514
- * @param opts.signal - An AbortSignal to cancel the operation.
515
- * @returns A promise that resolves to the Snapshot instance
516
- */
517
- snapshot(opts?: {
518
- expiration?: number;
519
- signal?: AbortSignal;
520
- }): Promise<Snapshot>;
521
- /**
522
- * Update the named sandbox configuration.
523
- *
524
- * @param params - Fields to update.
525
- * @param opts - Optional abort signal.
526
- */
527
- update(params: {
528
- persistent?: boolean;
529
- resources?: {
530
- vcpus?: number;
531
- };
532
- timeout?: number;
533
- networkPolicy?: NetworkPolicy;
534
- }, opts?: {
535
- signal?: AbortSignal;
536
- }): Promise<void>;
537
- /**
538
- * Delete this named sandbox.
539
- *
540
- * After deletion the instance becomes inert — all further API calls will
541
- * throw immediately.
542
- */
543
- delete(opts?: {
544
- preserveSnapshots?: boolean;
545
- signal?: AbortSignal;
546
- }): Promise<void>;
547
- /**
548
- * List sessions (VMs) that have been created for this named sandbox.
549
- *
550
- * @param params - Optional pagination parameters.
551
- * @returns The list of sessions and pagination metadata.
552
- */
553
- listSessions(params?: {
554
- limit?: number;
555
- since?: number | Date;
556
- until?: number | Date;
557
- signal?: AbortSignal;
558
- }): Promise<import("./api-client/base-client").Parsed<{
559
- sandboxes: {
560
- id: string;
561
- memory: number;
562
- vcpus: number;
563
- region: string;
564
- runtime: string;
565
- timeout: number;
566
- status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
567
- requestedAt: number;
568
- createdAt: number;
569
- cwd: string;
570
- updatedAt: number;
571
- startedAt?: number | undefined;
572
- requestedStopAt?: number | undefined;
573
- stoppedAt?: number | undefined;
574
- abortedAt?: number | undefined;
575
- duration?: number | undefined;
576
- sourceSnapshotId?: string | undefined;
577
- snapshottedAt?: number | undefined;
578
- interactivePort?: number | undefined;
579
- networkPolicy?: import("zod").objectInputType<{
580
- mode: import("zod").ZodLiteral<"allow-all">;
581
- }, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectInputType<{
582
- mode: import("zod").ZodLiteral<"deny-all">;
583
- }, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectInputType<{
584
- mode: import("zod").ZodLiteral<"custom">;
585
- allowedDomains: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
586
- allowedCIDRs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
587
- deniedCIDRs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
588
- injectionRules: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
589
- domain: import("zod").ZodString;
590
- headers: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
591
- headerNames: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
592
- }, "strip", import("zod").ZodTypeAny, {
593
- domain: string;
594
- headers?: Record<string, string> | undefined;
595
- headerNames?: string[] | undefined;
596
- }, {
597
- domain: string;
598
- headers?: Record<string, string> | undefined;
599
- headerNames?: string[] | undefined;
600
- }>, "many">>;
601
- }, import("zod").ZodTypeAny, "passthrough"> | undefined;
602
- activeCpuDurationMs?: number | undefined;
603
- networkTransfer?: {
604
- ingress: number;
605
- egress: number;
606
- } | undefined;
607
- }[];
608
- pagination: {
609
- count: number;
610
- next: number | null;
611
- prev: number | null;
612
- };
613
- }>>;
614
- /**
615
- * List snapshots that belong to this named sandbox.
616
- *
617
- * @param params - Optional pagination parameters.
618
- * @returns The list of snapshots and pagination metadata.
619
- */
620
- listSnapshots(params?: {
621
- limit?: number;
622
- since?: number | Date;
623
- until?: number | Date;
624
- signal?: AbortSignal;
625
- }): Promise<import("./api-client/base-client").Parsed<{
626
- pagination: {
627
- count: number;
628
- next: number | null;
629
- prev: number | null;
630
- };
631
- snapshots: {
632
- id: string;
633
- region: string;
634
- status: "failed" | "created" | "deleted";
635
- createdAt: number;
636
- updatedAt: number;
637
- sourceSandboxId: string;
638
- sizeBytes: number;
639
- expiresAt?: number | undefined;
640
- }[];
641
- }>>;
2812
+ }, {
2813
+ ingress: number;
2814
+ egress: number;
2815
+ }>>;
2816
+ }, zod0.ZodTypeAny, "passthrough">[];
2817
+ }, "sessions">>;
2818
+ /**
2819
+ * List snapshots that belong to this sandbox.
2820
+ *
2821
+ * @param params - Optional pagination parameters.
2822
+ * @returns The list of snapshots and pagination metadata.
2823
+ */
2824
+ listSnapshots(params?: {
2825
+ limit?: number;
2826
+ cursor?: string;
2827
+ sortOrder?: "asc" | "desc";
2828
+ signal?: AbortSignal;
2829
+ }): Promise<Paginator<{
2830
+ pagination: {
2831
+ count: number;
2832
+ next: string | null;
2833
+ };
2834
+ snapshots: {
2835
+ status: "failed" | "created" | "deleted";
2836
+ region: string;
2837
+ createdAt: number;
2838
+ updatedAt: number;
2839
+ id: string;
2840
+ sourceSessionId: string;
2841
+ sizeBytes: number;
2842
+ expiresAt?: number | undefined;
2843
+ }[];
2844
+ }, "snapshots">>;
642
2845
  }
2846
+ //#endregion
2847
+ export { Sandbox, SerializedSandbox };
2848
+ //# sourceMappingURL=sandbox.d.ts.map