@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.
- package/README.md +48 -1
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/api-client/api-client.cjs +445 -0
- package/dist/api-client/api-client.cjs.map +1 -0
- package/dist/api-client/api-client.d.cts +6235 -0
- package/dist/api-client/api-client.d.ts +6229 -706
- package/dist/api-client/api-client.js +436 -472
- package/dist/api-client/api-client.js.map +1 -1
- package/dist/api-client/api-error.cjs +32 -0
- package/dist/api-client/api-error.cjs.map +1 -0
- package/dist/api-client/api-error.d.cts +29 -0
- package/dist/api-client/api-error.d.ts +21 -16
- package/dist/api-client/api-error.js +28 -32
- package/dist/api-client/api-error.js.map +1 -1
- package/dist/api-client/base-client.cjs +126 -0
- package/dist/api-client/base-client.cjs.map +1 -0
- package/dist/api-client/base-client.d.cts +38 -0
- package/dist/api-client/base-client.d.ts +31 -36
- package/dist/api-client/base-client.js +114 -118
- package/dist/api-client/base-client.js.map +1 -1
- package/dist/api-client/file-writer.cjs +62 -0
- package/dist/api-client/file-writer.cjs.map +1 -0
- package/dist/api-client/file-writer.d.cts +66 -0
- package/dist/api-client/file-writer.d.ts +56 -42
- package/dist/api-client/file-writer.js +57 -61
- package/dist/api-client/file-writer.js.map +1 -1
- package/dist/api-client/index.cjs +2 -0
- package/dist/api-client/index.d.ts +2 -2
- package/dist/api-client/index.js +4 -21
- package/dist/api-client/validators.cjs +229 -0
- package/dist/api-client/validators.cjs.map +1 -0
- package/dist/api-client/validators.d.cts +26885 -0
- package/dist/api-client/validators.d.ts +26732 -3706
- package/dist/api-client/validators.js +198 -191
- package/dist/api-client/validators.js.map +1 -1
- package/dist/api-client/with-retry.cjs +89 -0
- package/dist/api-client/with-retry.cjs.map +1 -0
- package/dist/api-client/with-retry.d.cts +10 -0
- package/dist/api-client/with-retry.d.ts +9 -13
- package/dist/api-client/with-retry.js +81 -102
- package/dist/api-client/with-retry.js.map +1 -1
- package/dist/auth/api.cjs +29 -0
- package/dist/auth/api.cjs.map +1 -0
- package/dist/auth/api.js +26 -25
- package/dist/auth/api.js.map +1 -1
- package/dist/auth/error.cjs +13 -0
- package/dist/auth/error.cjs.map +1 -0
- package/dist/auth/error.js +11 -11
- package/dist/auth/error.js.map +1 -1
- package/dist/auth/file.cjs +64 -0
- package/dist/auth/file.cjs.map +1 -0
- package/dist/auth/file.d.cts +26 -0
- package/dist/auth/file.d.ts +19 -15
- package/dist/auth/file.js +49 -64
- package/dist/auth/file.js.map +1 -1
- package/dist/auth/index.cjs +11 -0
- package/dist/auth/index.d.cts +5 -0
- package/dist/auth/index.d.ts +5 -6
- package/dist/auth/index.js +6 -27
- package/dist/auth/linked-project.cjs +38 -0
- package/dist/auth/linked-project.cjs.map +1 -0
- package/dist/auth/linked-project.js +30 -64
- package/dist/auth/linked-project.js.map +1 -1
- package/dist/auth/oauth.cjs +205 -0
- package/dist/auth/oauth.cjs.map +1 -0
- package/dist/auth/oauth.d.cts +135 -0
- package/dist/auth/oauth.d.ts +113 -109
- package/dist/auth/oauth.js +185 -252
- package/dist/auth/oauth.js.map +1 -1
- package/dist/auth/poll-for-token.cjs +82 -0
- package/dist/auth/poll-for-token.cjs.map +1 -0
- package/dist/auth/poll-for-token.d.cts +28 -0
- package/dist/auth/poll-for-token.d.ts +23 -15
- package/dist/auth/poll-for-token.js +79 -64
- package/dist/auth/poll-for-token.js.map +1 -1
- package/dist/auth/project.cjs +178 -0
- package/dist/auth/project.cjs.map +1 -0
- package/dist/auth/project.d.cts +40 -0
- package/dist/auth/project.d.ts +19 -19
- package/dist/auth/project.js +169 -72
- package/dist/auth/project.js.map +1 -1
- package/dist/auth/zod.cjs +22 -0
- package/dist/auth/zod.cjs.map +1 -0
- package/dist/auth/zod.js +18 -17
- package/dist/auth/zod.js.map +1 -1
- package/dist/command.cjs +328 -0
- package/dist/command.cjs.map +1 -0
- package/dist/command.d.cts +289 -0
- package/dist/command.d.ts +265 -171
- package/dist/command.js +323 -226
- package/dist/command.js.map +1 -1
- package/dist/constants.d.cts +5 -0
- package/dist/constants.d.ts +5 -1
- package/dist/filesystem.cjs +499 -0
- package/dist/filesystem.cjs.map +1 -0
- package/dist/filesystem.d.cts +258 -0
- package/dist/filesystem.d.ts +258 -0
- package/dist/filesystem.js +497 -0
- package/dist/filesystem.js.map +1 -0
- package/dist/index.cjs +15 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +8 -17
- package/dist/network-policy.d.cts +156 -0
- package/dist/network-policy.d.ts +88 -28
- package/dist/sandbox.cjs +816 -0
- package/dist/sandbox.cjs.map +1 -0
- package/dist/sandbox.d.cts +2847 -0
- package/dist/sandbox.d.ts +2834 -628
- package/dist/sandbox.js +808 -557
- package/dist/sandbox.js.map +1 -1
- package/dist/session.cjs +527 -0
- package/dist/session.cjs.map +1 -0
- package/dist/session.d.cts +410 -0
- package/dist/session.d.ts +403 -368
- package/dist/session.js +524 -489
- package/dist/session.js.map +1 -1
- package/dist/snapshot.cjs +204 -0
- package/dist/snapshot.cjs.map +1 -0
- package/dist/snapshot.d.cts +161 -0
- package/dist/snapshot.d.ts +152 -92
- package/dist/snapshot.js +201 -114
- package/dist/snapshot.js.map +1 -1
- package/dist/utils/array.cjs +17 -0
- package/dist/utils/array.cjs.map +1 -0
- package/dist/utils/array.js +12 -15
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/consume-readable.cjs +18 -0
- package/dist/utils/consume-readable.cjs.map +1 -0
- package/dist/utils/consume-readable.js +13 -12
- package/dist/utils/consume-readable.js.map +1 -1
- package/dist/utils/decode-base64-url.cjs +15 -0
- package/dist/utils/decode-base64-url.cjs.map +1 -0
- package/dist/utils/decode-base64-url.js +10 -9
- package/dist/utils/decode-base64-url.js.map +1 -1
- package/dist/utils/dev-credentials.cjs +142 -0
- package/dist/utils/dev-credentials.cjs.map +1 -0
- package/dist/utils/dev-credentials.js +126 -184
- package/dist/utils/dev-credentials.js.map +1 -1
- package/dist/utils/get-credentials.cjs +123 -0
- package/dist/utils/get-credentials.cjs.map +1 -0
- package/dist/utils/get-credentials.d.cts +21 -0
- package/dist/utils/get-credentials.d.ts +19 -61
- package/dist/utils/get-credentials.js +106 -140
- package/dist/utils/get-credentials.js.map +1 -1
- package/dist/utils/log.cjs +25 -0
- package/dist/utils/log.cjs.map +1 -0
- package/dist/utils/log.js +15 -17
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/network-policy.cjs +49 -0
- package/dist/utils/network-policy.cjs.map +1 -0
- package/dist/utils/network-policy.js +42 -77
- package/dist/utils/network-policy.js.map +1 -1
- package/dist/utils/normalizePath.cjs +27 -0
- package/dist/utils/normalizePath.cjs.map +1 -0
- package/dist/utils/normalizePath.js +21 -28
- package/dist/utils/normalizePath.js.map +1 -1
- package/dist/utils/paginator.cjs +41 -0
- package/dist/utils/paginator.cjs.map +1 -0
- package/dist/utils/paginator.d.cts +16 -0
- package/dist/utils/paginator.d.ts +16 -0
- package/dist/utils/paginator.js +40 -0
- package/dist/utils/paginator.js.map +1 -0
- package/dist/utils/resolveSignal.cjs +20 -0
- package/dist/utils/resolveSignal.cjs.map +1 -0
- package/dist/utils/resolveSignal.d.cts +15 -0
- package/dist/utils/resolveSignal.d.ts +12 -10
- package/dist/utils/resolveSignal.js +14 -17
- package/dist/utils/resolveSignal.js.map +1 -1
- package/dist/utils/sandbox-snapshot.cjs +14 -0
- package/dist/utils/sandbox-snapshot.cjs.map +1 -0
- package/dist/utils/sandbox-snapshot.d.cts +10 -0
- package/dist/utils/sandbox-snapshot.d.ts +11 -0
- package/dist/utils/sandbox-snapshot.js +14 -0
- package/dist/utils/sandbox-snapshot.js.map +1 -0
- package/dist/utils/types.cjs +13 -0
- package/dist/utils/types.cjs.map +1 -0
- package/dist/utils/types.d.cts +11 -0
- package/dist/utils/types.d.ts +5 -7
- package/dist/utils/types.js +8 -8
- package/dist/utils/types.js.map +1 -1
- package/dist/version.cjs +7 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.js +5 -5
- package/dist/version.js.map +1 -1
- package/package.json +23 -3
- package/dist/api-client/index.js.map +0 -1
- package/dist/auth/api.d.ts +0 -6
- package/dist/auth/error.d.ts +0 -11
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/linked-project.d.ts +0 -10
- package/dist/auth/zod.d.ts +0 -5
- package/dist/constants.js +0 -3
- package/dist/constants.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/network-policy.js +0 -3
- package/dist/network-policy.js.map +0 -1
- package/dist/utils/array.d.ts +0 -9
- package/dist/utils/consume-readable.d.ts +0 -5
- package/dist/utils/convert-sandbox.d.ts +0 -6
- package/dist/utils/convert-sandbox.js +0 -14
- package/dist/utils/convert-sandbox.js.map +0 -1
- package/dist/utils/decode-base64-url.d.ts +0 -7
- package/dist/utils/dev-credentials.d.ts +0 -37
- package/dist/utils/log.d.ts +0 -2
- package/dist/utils/network-policy.d.ts +0 -7
- package/dist/utils/normalizePath.d.ts +0 -17
- package/dist/version.d.ts +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let path = require("path");
|
|
3
|
+
path = require_rolldown_runtime.__toESM(path);
|
|
4
|
+
|
|
5
|
+
//#region src/utils/normalizePath.ts
|
|
6
|
+
/**
|
|
7
|
+
* Normalize a path and make it relative to `params.extractDir` for inclusion
|
|
8
|
+
* in our tar archives.
|
|
9
|
+
*
|
|
10
|
+
* Relative paths are first resolved to `params.cwd`.
|
|
11
|
+
* Absolute paths are normalized and resolved relative to `params.extractDir`.
|
|
12
|
+
*
|
|
13
|
+
* In addition, paths are normalized so consecutive slashes are removed and
|
|
14
|
+
* stuff like `../..` is resolved appropriately.
|
|
15
|
+
*
|
|
16
|
+
* This function always returns a path relative to `params.extractDir`.
|
|
17
|
+
*/
|
|
18
|
+
function normalizePath(params) {
|
|
19
|
+
if (!path.default.posix.isAbsolute(params.cwd)) throw new Error("cwd dir must be absolute");
|
|
20
|
+
if (!path.default.posix.isAbsolute(params.extractDir)) throw new Error("extractDir must be absolute");
|
|
21
|
+
const basePath = path.default.posix.isAbsolute(params.filePath) ? path.default.posix.normalize(params.filePath) : path.default.posix.join(params.cwd, params.filePath);
|
|
22
|
+
return path.default.posix.relative(params.extractDir, basePath);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.normalizePath = normalizePath;
|
|
27
|
+
//# sourceMappingURL=normalizePath.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizePath.cjs","names":[],"sources":["../../src/utils/normalizePath.ts"],"sourcesContent":["import path from \"path\";\n\n/**\n * Normalize a path and make it relative to `params.extractDir` for inclusion\n * in our tar archives.\n *\n * Relative paths are first resolved to `params.cwd`.\n * Absolute paths are normalized and resolved relative to `params.extractDir`.\n *\n * In addition, paths are normalized so consecutive slashes are removed and\n * stuff like `../..` is resolved appropriately.\n *\n * This function always returns a path relative to `params.extractDir`.\n */\nexport function normalizePath(params: {\n filePath: string;\n cwd: string;\n extractDir: string;\n}) {\n if (!path.posix.isAbsolute(params.cwd)) {\n throw new Error(\"cwd dir must be absolute\");\n }\n\n if (!path.posix.isAbsolute(params.extractDir)) {\n throw new Error(\"extractDir must be absolute\");\n }\n\n const basePath = path.posix.isAbsolute(params.filePath)\n ? path.posix.normalize(params.filePath)\n : path.posix.join(params.cwd, params.filePath);\n\n return path.posix.relative(params.extractDir, basePath);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,SAAgB,cAAc,QAI3B;AACD,KAAI,CAAC,aAAK,MAAM,WAAW,OAAO,IAAI,CACpC,OAAM,IAAI,MAAM,2BAA2B;AAG7C,KAAI,CAAC,aAAK,MAAM,WAAW,OAAO,WAAW,CAC3C,OAAM,IAAI,MAAM,8BAA8B;CAGhD,MAAM,WAAW,aAAK,MAAM,WAAW,OAAO,SAAS,GACnD,aAAK,MAAM,UAAU,OAAO,SAAS,GACrC,aAAK,MAAM,KAAK,OAAO,KAAK,OAAO,SAAS;AAEhD,QAAO,aAAK,MAAM,SAAS,OAAO,YAAY,SAAS"}
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.normalizePath = normalizePath;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/normalizePath.ts
|
|
8
4
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
* Normalize a path and make it relative to `params.extractDir` for inclusion
|
|
6
|
+
* in our tar archives.
|
|
7
|
+
*
|
|
8
|
+
* Relative paths are first resolved to `params.cwd`.
|
|
9
|
+
* Absolute paths are normalized and resolved relative to `params.extractDir`.
|
|
10
|
+
*
|
|
11
|
+
* In addition, paths are normalized so consecutive slashes are removed and
|
|
12
|
+
* stuff like `../..` is resolved appropriately.
|
|
13
|
+
*
|
|
14
|
+
* This function always returns a path relative to `params.extractDir`.
|
|
15
|
+
*/
|
|
20
16
|
function normalizePath(params) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
throw new Error("extractDir must be absolute");
|
|
26
|
-
}
|
|
27
|
-
const basePath = path_1.default.posix.isAbsolute(params.filePath)
|
|
28
|
-
? path_1.default.posix.normalize(params.filePath)
|
|
29
|
-
: path_1.default.posix.join(params.cwd, params.filePath);
|
|
30
|
-
return path_1.default.posix.relative(params.extractDir, basePath);
|
|
17
|
+
if (!path.posix.isAbsolute(params.cwd)) throw new Error("cwd dir must be absolute");
|
|
18
|
+
if (!path.posix.isAbsolute(params.extractDir)) throw new Error("extractDir must be absolute");
|
|
19
|
+
const basePath = path.posix.isAbsolute(params.filePath) ? path.posix.normalize(params.filePath) : path.posix.join(params.cwd, params.filePath);
|
|
20
|
+
return path.posix.relative(params.extractDir, basePath);
|
|
31
21
|
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { normalizePath };
|
|
32
25
|
//# sourceMappingURL=normalizePath.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePath.js","
|
|
1
|
+
{"version":3,"file":"normalizePath.js","names":[],"sources":["../../src/utils/normalizePath.ts"],"sourcesContent":["import path from \"path\";\n\n/**\n * Normalize a path and make it relative to `params.extractDir` for inclusion\n * in our tar archives.\n *\n * Relative paths are first resolved to `params.cwd`.\n * Absolute paths are normalized and resolved relative to `params.extractDir`.\n *\n * In addition, paths are normalized so consecutive slashes are removed and\n * stuff like `../..` is resolved appropriately.\n *\n * This function always returns a path relative to `params.extractDir`.\n */\nexport function normalizePath(params: {\n filePath: string;\n cwd: string;\n extractDir: string;\n}) {\n if (!path.posix.isAbsolute(params.cwd)) {\n throw new Error(\"cwd dir must be absolute\");\n }\n\n if (!path.posix.isAbsolute(params.extractDir)) {\n throw new Error(\"extractDir must be absolute\");\n }\n\n const basePath = path.posix.isAbsolute(params.filePath)\n ? path.posix.normalize(params.filePath)\n : path.posix.join(params.cwd, params.filePath);\n\n return path.posix.relative(params.extractDir, basePath);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,cAAc,QAI3B;AACD,KAAI,CAAC,KAAK,MAAM,WAAW,OAAO,IAAI,CACpC,OAAM,IAAI,MAAM,2BAA2B;AAG7C,KAAI,CAAC,KAAK,MAAM,WAAW,OAAO,WAAW,CAC3C,OAAM,IAAI,MAAM,8BAA8B;CAGhD,MAAM,WAAW,KAAK,MAAM,WAAW,OAAO,SAAS,GACnD,KAAK,MAAM,UAAU,OAAO,SAAS,GACrC,KAAK,MAAM,KAAK,OAAO,KAAK,OAAO,SAAS;AAEhD,QAAO,KAAK,MAAM,SAAS,OAAO,YAAY,SAAS"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/paginator.ts
|
|
3
|
+
function attachPaginator(firstPage, options) {
|
|
4
|
+
const { itemsKey, fetchNext, signal } = options;
|
|
5
|
+
async function* iteratePages() {
|
|
6
|
+
throwIfAborted(signal);
|
|
7
|
+
let page = firstPage;
|
|
8
|
+
yield page;
|
|
9
|
+
while (page.pagination.next !== null) {
|
|
10
|
+
throwIfAborted(signal);
|
|
11
|
+
page = await fetchNext(page.pagination.next);
|
|
12
|
+
yield page;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
async function* iterateItems() {
|
|
16
|
+
for await (const page of iteratePages()) {
|
|
17
|
+
const items = page[itemsKey];
|
|
18
|
+
for (const item of items) {
|
|
19
|
+
throwIfAborted(signal);
|
|
20
|
+
yield item;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...firstPage,
|
|
26
|
+
[Symbol.asyncIterator]: iterateItems,
|
|
27
|
+
pages: iteratePages,
|
|
28
|
+
toArray: async () => {
|
|
29
|
+
const all = [];
|
|
30
|
+
for await (const item of iterateItems()) all.push(item);
|
|
31
|
+
return all;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function throwIfAborted(signal) {
|
|
36
|
+
if (signal?.aborted) throw signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
exports.attachPaginator = attachPaginator;
|
|
41
|
+
//# sourceMappingURL=paginator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginator.cjs","names":["all: ItemOf<Page, Key>[]"],"sources":["../../src/utils/paginator.ts"],"sourcesContent":["type CursorPaginationMeta = {\n count: number;\n next: string | null;\n};\n\ntype HasPagination = { pagination: CursorPaginationMeta };\n\ntype ItemOf<Page, Key extends keyof Page> = Page[Key] extends Array<infer Item>\n ? Item\n : never;\n\nexport type Paginator<Page extends HasPagination, Key extends keyof Page> =\n Page &\n AsyncIterable<ItemOf<Page, Key>> & {\n pages(): AsyncIterable<Page>;\n toArray(): Promise<ItemOf<Page, Key>[]>;\n };\n\ntype AttachPaginatorOptions<Page extends HasPagination, Key extends keyof Page> = {\n itemsKey: Key;\n fetchNext: (cursor: string) => Promise<Page>;\n signal?: AbortSignal;\n};\n\nexport function attachPaginator<\n Page extends HasPagination,\n Key extends keyof Page,\n>(\n firstPage: Page,\n options: AttachPaginatorOptions<Page, Key>,\n): Paginator<Page, Key> {\n const { itemsKey, fetchNext, signal } = options;\n\n async function* iteratePages(): AsyncGenerator<Page> {\n throwIfAborted(signal);\n let page = firstPage;\n yield page;\n while (page.pagination.next !== null) {\n throwIfAborted(signal);\n page = await fetchNext(page.pagination.next);\n yield page;\n }\n }\n\n async function* iterateItems(): AsyncGenerator<ItemOf<Page, Key>> {\n for await (const page of iteratePages()) {\n const items = page[itemsKey] as unknown as ItemOf<Page, Key>[];\n for (const item of items) {\n throwIfAborted(signal);\n yield item;\n }\n }\n }\n\n return {\n ...firstPage,\n [Symbol.asyncIterator]: iterateItems,\n pages: iteratePages,\n toArray: async () => {\n const all: ItemOf<Page, Key>[] = [];\n for await (const item of iterateItems()) {\n all.push(item);\n }\n return all;\n },\n };\n}\n\nfunction throwIfAborted(signal?: AbortSignal): void {\n if (signal?.aborted) {\n throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n }\n}\n"],"mappings":";;AAwBA,SAAgB,gBAId,WACA,SACsB;CACtB,MAAM,EAAE,UAAU,WAAW,WAAW;CAExC,gBAAgB,eAAqC;AACnD,iBAAe,OAAO;EACtB,IAAI,OAAO;AACX,QAAM;AACN,SAAO,KAAK,WAAW,SAAS,MAAM;AACpC,kBAAe,OAAO;AACtB,UAAO,MAAM,UAAU,KAAK,WAAW,KAAK;AAC5C,SAAM;;;CAIV,gBAAgB,eAAkD;AAChE,aAAW,MAAM,QAAQ,cAAc,EAAE;GACvC,MAAM,QAAQ,KAAK;AACnB,QAAK,MAAM,QAAQ,OAAO;AACxB,mBAAe,OAAO;AACtB,UAAM;;;;AAKZ,QAAO;EACL,GAAG;GACF,OAAO,gBAAgB;EACxB,OAAO;EACP,SAAS,YAAY;GACnB,MAAMA,MAA2B,EAAE;AACnC,cAAW,MAAM,QAAQ,cAAc,CACrC,KAAI,KAAK,KAAK;AAEhB,UAAO;;EAEV;;AAGH,SAAS,eAAe,QAA4B;AAClD,KAAI,QAAQ,QACV,OAAM,OAAO,UAAU,IAAI,aAAa,WAAW,aAAa"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/utils/paginator.d.ts
|
|
2
|
+
type CursorPaginationMeta = {
|
|
3
|
+
count: number;
|
|
4
|
+
next: string | null;
|
|
5
|
+
};
|
|
6
|
+
type HasPagination = {
|
|
7
|
+
pagination: CursorPaginationMeta;
|
|
8
|
+
};
|
|
9
|
+
type ItemOf<Page, Key extends keyof Page> = Page[Key] extends Array<infer Item> ? Item : never;
|
|
10
|
+
type Paginator<Page extends HasPagination, Key extends keyof Page> = Page & AsyncIterable<ItemOf<Page, Key>> & {
|
|
11
|
+
pages(): AsyncIterable<Page>;
|
|
12
|
+
toArray(): Promise<ItemOf<Page, Key>[]>;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Paginator };
|
|
16
|
+
//# sourceMappingURL=paginator.d.cts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/utils/paginator.d.ts
|
|
2
|
+
type CursorPaginationMeta = {
|
|
3
|
+
count: number;
|
|
4
|
+
next: string | null;
|
|
5
|
+
};
|
|
6
|
+
type HasPagination = {
|
|
7
|
+
pagination: CursorPaginationMeta;
|
|
8
|
+
};
|
|
9
|
+
type ItemOf<Page, Key extends keyof Page> = Page[Key] extends Array<infer Item> ? Item : never;
|
|
10
|
+
type Paginator<Page extends HasPagination, Key extends keyof Page> = Page & AsyncIterable<ItemOf<Page, Key>> & {
|
|
11
|
+
pages(): AsyncIterable<Page>;
|
|
12
|
+
toArray(): Promise<ItemOf<Page, Key>[]>;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Paginator };
|
|
16
|
+
//# sourceMappingURL=paginator.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/utils/paginator.ts
|
|
2
|
+
function attachPaginator(firstPage, options) {
|
|
3
|
+
const { itemsKey, fetchNext, signal } = options;
|
|
4
|
+
async function* iteratePages() {
|
|
5
|
+
throwIfAborted(signal);
|
|
6
|
+
let page = firstPage;
|
|
7
|
+
yield page;
|
|
8
|
+
while (page.pagination.next !== null) {
|
|
9
|
+
throwIfAborted(signal);
|
|
10
|
+
page = await fetchNext(page.pagination.next);
|
|
11
|
+
yield page;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function* iterateItems() {
|
|
15
|
+
for await (const page of iteratePages()) {
|
|
16
|
+
const items = page[itemsKey];
|
|
17
|
+
for (const item of items) {
|
|
18
|
+
throwIfAborted(signal);
|
|
19
|
+
yield item;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
...firstPage,
|
|
25
|
+
[Symbol.asyncIterator]: iterateItems,
|
|
26
|
+
pages: iteratePages,
|
|
27
|
+
toArray: async () => {
|
|
28
|
+
const all = [];
|
|
29
|
+
for await (const item of iterateItems()) all.push(item);
|
|
30
|
+
return all;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function throwIfAborted(signal) {
|
|
35
|
+
if (signal?.aborted) throw signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { attachPaginator };
|
|
40
|
+
//# sourceMappingURL=paginator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginator.js","names":["all: ItemOf<Page, Key>[]"],"sources":["../../src/utils/paginator.ts"],"sourcesContent":["type CursorPaginationMeta = {\n count: number;\n next: string | null;\n};\n\ntype HasPagination = { pagination: CursorPaginationMeta };\n\ntype ItemOf<Page, Key extends keyof Page> = Page[Key] extends Array<infer Item>\n ? Item\n : never;\n\nexport type Paginator<Page extends HasPagination, Key extends keyof Page> =\n Page &\n AsyncIterable<ItemOf<Page, Key>> & {\n pages(): AsyncIterable<Page>;\n toArray(): Promise<ItemOf<Page, Key>[]>;\n };\n\ntype AttachPaginatorOptions<Page extends HasPagination, Key extends keyof Page> = {\n itemsKey: Key;\n fetchNext: (cursor: string) => Promise<Page>;\n signal?: AbortSignal;\n};\n\nexport function attachPaginator<\n Page extends HasPagination,\n Key extends keyof Page,\n>(\n firstPage: Page,\n options: AttachPaginatorOptions<Page, Key>,\n): Paginator<Page, Key> {\n const { itemsKey, fetchNext, signal } = options;\n\n async function* iteratePages(): AsyncGenerator<Page> {\n throwIfAborted(signal);\n let page = firstPage;\n yield page;\n while (page.pagination.next !== null) {\n throwIfAborted(signal);\n page = await fetchNext(page.pagination.next);\n yield page;\n }\n }\n\n async function* iterateItems(): AsyncGenerator<ItemOf<Page, Key>> {\n for await (const page of iteratePages()) {\n const items = page[itemsKey] as unknown as ItemOf<Page, Key>[];\n for (const item of items) {\n throwIfAborted(signal);\n yield item;\n }\n }\n }\n\n return {\n ...firstPage,\n [Symbol.asyncIterator]: iterateItems,\n pages: iteratePages,\n toArray: async () => {\n const all: ItemOf<Page, Key>[] = [];\n for await (const item of iterateItems()) {\n all.push(item);\n }\n return all;\n },\n };\n}\n\nfunction throwIfAborted(signal?: AbortSignal): void {\n if (signal?.aborted) {\n throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n }\n}\n"],"mappings":";AAwBA,SAAgB,gBAId,WACA,SACsB;CACtB,MAAM,EAAE,UAAU,WAAW,WAAW;CAExC,gBAAgB,eAAqC;AACnD,iBAAe,OAAO;EACtB,IAAI,OAAO;AACX,QAAM;AACN,SAAO,KAAK,WAAW,SAAS,MAAM;AACpC,kBAAe,OAAO;AACtB,UAAO,MAAM,UAAU,KAAK,WAAW,KAAK;AAC5C,SAAM;;;CAIV,gBAAgB,eAAkD;AAChE,aAAW,MAAM,QAAQ,cAAc,EAAE;GACvC,MAAM,QAAQ,KAAK;AACnB,QAAK,MAAM,QAAQ,OAAO;AACxB,mBAAe,OAAO;AACtB,UAAM;;;;AAKZ,QAAO;EACL,GAAG;GACF,OAAO,gBAAgB;EACxB,OAAO;EACP,SAAS,YAAY;GACnB,MAAMA,MAA2B,EAAE;AACnC,cAAW,MAAM,QAAQ,cAAc,CACrC,KAAI,KAAK,KAAK;AAEhB,UAAO;;EAEV;;AAGH,SAAS,eAAe,QAA4B;AAClD,KAAI,QAAQ,QACV,OAAM,OAAO,UAAU,IAAI,aAAa,WAAW,aAAa"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/resolveSignal.ts
|
|
3
|
+
const linuxSignalMapping = {
|
|
4
|
+
SIGHUP: 1,
|
|
5
|
+
SIGINT: 2,
|
|
6
|
+
SIGQUIT: 3,
|
|
7
|
+
SIGKILL: 9,
|
|
8
|
+
SIGTERM: 15,
|
|
9
|
+
SIGCONT: 18,
|
|
10
|
+
SIGSTOP: 19
|
|
11
|
+
};
|
|
12
|
+
function resolveSignal(signal) {
|
|
13
|
+
if (typeof signal === "number") return signal;
|
|
14
|
+
if (signal in linuxSignalMapping) return linuxSignalMapping[signal];
|
|
15
|
+
throw new Error(`Unknown signal name: ${String(signal)}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.resolveSignal = resolveSignal;
|
|
20
|
+
//# sourceMappingURL=resolveSignal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSignal.cjs","names":[],"sources":["../../src/utils/resolveSignal.ts"],"sourcesContent":["const linuxSignalMapping = {\n SIGHUP: 1,\n SIGINT: 2,\n SIGQUIT: 3,\n SIGKILL: 9,\n SIGTERM: 15,\n SIGCONT: 18,\n SIGSTOP: 19,\n} as const;\n\ntype CommonLinuxSignals = keyof typeof linuxSignalMapping;\n\nexport type Signal = CommonLinuxSignals | number;\n\nexport function resolveSignal(signal: Signal): number {\n if (typeof signal === \"number\") {\n return signal;\n }\n\n if (signal in linuxSignalMapping) {\n return linuxSignalMapping[signal];\n }\n throw new Error(`Unknown signal name: ${String(signal)}`);\n}\n"],"mappings":";;AAAA,MAAM,qBAAqB;CACzB,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACV;AAMD,SAAgB,cAAc,QAAwB;AACpD,KAAI,OAAO,WAAW,SACpB,QAAO;AAGT,KAAI,UAAU,mBACZ,QAAO,mBAAmB;AAE5B,OAAM,IAAI,MAAM,wBAAwB,OAAO,OAAO,GAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/utils/resolveSignal.d.ts
|
|
2
|
+
declare const linuxSignalMapping: {
|
|
3
|
+
readonly SIGHUP: 1;
|
|
4
|
+
readonly SIGINT: 2;
|
|
5
|
+
readonly SIGQUIT: 3;
|
|
6
|
+
readonly SIGKILL: 9;
|
|
7
|
+
readonly SIGTERM: 15;
|
|
8
|
+
readonly SIGCONT: 18;
|
|
9
|
+
readonly SIGSTOP: 19;
|
|
10
|
+
};
|
|
11
|
+
type CommonLinuxSignals = keyof typeof linuxSignalMapping;
|
|
12
|
+
type Signal = CommonLinuxSignals | number;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Signal };
|
|
15
|
+
//# sourceMappingURL=resolveSignal.d.cts.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
//#region src/utils/resolveSignal.d.ts
|
|
1
2
|
declare const linuxSignalMapping: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
readonly SIGHUP: 1;
|
|
4
|
+
readonly SIGINT: 2;
|
|
5
|
+
readonly SIGQUIT: 3;
|
|
6
|
+
readonly SIGKILL: 9;
|
|
7
|
+
readonly SIGTERM: 15;
|
|
8
|
+
readonly SIGCONT: 18;
|
|
9
|
+
readonly SIGSTOP: 19;
|
|
9
10
|
};
|
|
10
11
|
type CommonLinuxSignals = keyof typeof linuxSignalMapping;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {};
|
|
12
|
+
type Signal = CommonLinuxSignals | number;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Signal };
|
|
15
|
+
//# sourceMappingURL=resolveSignal.d.ts.map
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveSignal = resolveSignal;
|
|
1
|
+
//#region src/utils/resolveSignal.ts
|
|
4
2
|
const linuxSignalMapping = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
SIGHUP: 1,
|
|
4
|
+
SIGINT: 2,
|
|
5
|
+
SIGQUIT: 3,
|
|
6
|
+
SIGKILL: 9,
|
|
7
|
+
SIGTERM: 15,
|
|
8
|
+
SIGCONT: 18,
|
|
9
|
+
SIGSTOP: 19
|
|
12
10
|
};
|
|
13
11
|
function resolveSignal(signal) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (signal in linuxSignalMapping) {
|
|
18
|
-
return linuxSignalMapping[signal];
|
|
19
|
-
}
|
|
20
|
-
throw new Error(`Unknown signal name: ${String(signal)}`);
|
|
12
|
+
if (typeof signal === "number") return signal;
|
|
13
|
+
if (signal in linuxSignalMapping) return linuxSignalMapping[signal];
|
|
14
|
+
throw new Error(`Unknown signal name: ${String(signal)}`);
|
|
21
15
|
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { resolveSignal };
|
|
22
19
|
//# sourceMappingURL=resolveSignal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSignal.js","
|
|
1
|
+
{"version":3,"file":"resolveSignal.js","names":[],"sources":["../../src/utils/resolveSignal.ts"],"sourcesContent":["const linuxSignalMapping = {\n SIGHUP: 1,\n SIGINT: 2,\n SIGQUIT: 3,\n SIGKILL: 9,\n SIGTERM: 15,\n SIGCONT: 18,\n SIGSTOP: 19,\n} as const;\n\ntype CommonLinuxSignals = keyof typeof linuxSignalMapping;\n\nexport type Signal = CommonLinuxSignals | number;\n\nexport function resolveSignal(signal: Signal): number {\n if (typeof signal === \"number\") {\n return signal;\n }\n\n if (signal in linuxSignalMapping) {\n return linuxSignalMapping[signal];\n }\n throw new Error(`Unknown signal name: ${String(signal)}`);\n}\n"],"mappings":";AAAA,MAAM,qBAAqB;CACzB,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACV;AAMD,SAAgB,cAAc,QAAwB;AACpD,KAAI,OAAO,WAAW,SACpB,QAAO;AAGT,KAAI,UAAU,mBACZ,QAAO,mBAAmB;AAE5B,OAAM,IAAI,MAAM,wBAAwB,OAAO,OAAO,GAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const require_network_policy = require('./network-policy.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/utils/sandbox-snapshot.ts
|
|
4
|
+
function toSandboxSnapshot(sandbox) {
|
|
5
|
+
const { networkPolicy, ...rest } = sandbox;
|
|
6
|
+
return {
|
|
7
|
+
...rest,
|
|
8
|
+
networkPolicy: networkPolicy ? require_network_policy.fromAPINetworkPolicy(networkPolicy) : void 0
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.toSandboxSnapshot = toSandboxSnapshot;
|
|
14
|
+
//# sourceMappingURL=sandbox-snapshot.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-snapshot.cjs","names":["fromAPINetworkPolicy"],"sources":["../../src/utils/sandbox-snapshot.ts"],"sourcesContent":["import type { SessionMetaData } from \"../api-client/index.js\";\nimport type { NetworkPolicy } from \"../network-policy.js\";\nimport { fromAPINetworkPolicy } from \"./network-policy.js\";\n\nexport type SandboxSnapshot = Omit<SessionMetaData, \"networkPolicy\"> & {\n networkPolicy?: NetworkPolicy;\n};\n\nexport function toSandboxSnapshot(sandbox: SessionMetaData): SandboxSnapshot {\n const { networkPolicy, ...rest } = sandbox;\n return {\n ...rest,\n networkPolicy: networkPolicy\n ? fromAPINetworkPolicy(networkPolicy)\n : undefined,\n };\n}\n"],"mappings":";;;AAQA,SAAgB,kBAAkB,SAA2C;CAC3E,MAAM,EAAE,eAAe,GAAG,SAAS;AACnC,QAAO;EACL,GAAG;EACH,eAAe,gBACXA,4CAAqB,cAAc,GACnC;EACL"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SessionMetaData } from "../api-client/validators.cjs";
|
|
2
|
+
import { NetworkPolicy } from "../network-policy.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/sandbox-snapshot.d.ts
|
|
5
|
+
type SandboxSnapshot = Omit<SessionMetaData, "networkPolicy"> & {
|
|
6
|
+
networkPolicy?: NetworkPolicy;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SandboxSnapshot };
|
|
10
|
+
//# sourceMappingURL=sandbox-snapshot.d.cts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SessionMetaData } from "../api-client/validators.js";
|
|
2
|
+
import { NetworkPolicy } from "../network-policy.js";
|
|
3
|
+
import "../api-client/index.js";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/sandbox-snapshot.d.ts
|
|
6
|
+
type SandboxSnapshot = Omit<SessionMetaData, "networkPolicy"> & {
|
|
7
|
+
networkPolicy?: NetworkPolicy;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SandboxSnapshot };
|
|
11
|
+
//# sourceMappingURL=sandbox-snapshot.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fromAPINetworkPolicy } from "./network-policy.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/sandbox-snapshot.ts
|
|
4
|
+
function toSandboxSnapshot(sandbox) {
|
|
5
|
+
const { networkPolicy, ...rest } = sandbox;
|
|
6
|
+
return {
|
|
7
|
+
...rest,
|
|
8
|
+
networkPolicy: networkPolicy ? fromAPINetworkPolicy(networkPolicy) : void 0
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { toSandboxSnapshot };
|
|
14
|
+
//# sourceMappingURL=sandbox-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-snapshot.js","names":[],"sources":["../../src/utils/sandbox-snapshot.ts"],"sourcesContent":["import type { SessionMetaData } from \"../api-client/index.js\";\nimport type { NetworkPolicy } from \"../network-policy.js\";\nimport { fromAPINetworkPolicy } from \"./network-policy.js\";\n\nexport type SandboxSnapshot = Omit<SessionMetaData, \"networkPolicy\"> & {\n networkPolicy?: NetworkPolicy;\n};\n\nexport function toSandboxSnapshot(sandbox: SessionMetaData): SandboxSnapshot {\n const { networkPolicy, ...rest } = sandbox;\n return {\n ...rest,\n networkPolicy: networkPolicy\n ? fromAPINetworkPolicy(networkPolicy)\n : undefined,\n };\n}\n"],"mappings":";;;AAQA,SAAgB,kBAAkB,SAA2C;CAC3E,MAAM,EAAE,eAAe,GAAG,SAAS;AACnC,QAAO;EACL,GAAG;EACH,eAAe,gBACX,qBAAqB,cAAc,GACnC;EACL"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Extract private parameters out of an object.
|
|
5
|
+
*/
|
|
6
|
+
const getPrivateParams = (params) => {
|
|
7
|
+
const privateEntries = Object.entries(params ?? {}).filter(([k]) => k.startsWith("__"));
|
|
8
|
+
return Object.fromEntries(privateEntries);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.getPrivateParams = getPrivateParams;
|
|
13
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/utils/types.ts"],"sourcesContent":["/**\n * Utility type that extends a type to accept private parameters.\n *\n * The private parameters can then be extracted out of the object using\n * `getPrivateParams`.\n */\nexport type WithPrivate<T> = T & {\n [K in `__${string}`]?: unknown;\n};\n\n/**\n * Extract private parameters out of an object.\n */\nexport const getPrivateParams = (params?: object) => {\n const privateEntries = Object.entries(params ?? {}).filter(([k]) =>\n k.startsWith(\"__\"),\n );\n return Object.fromEntries(privateEntries) as {\n [K in keyof typeof params as K extends `__${string}`\n ? K\n : never]: (typeof params)[K];\n };\n};\n"],"mappings":";;;;;AAaA,MAAa,oBAAoB,WAAoB;CACnD,MAAM,iBAAiB,OAAO,QAAQ,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,OAC3D,EAAE,WAAW,KAAK,CACnB;AACD,QAAO,OAAO,YAAY,eAAe"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/utils/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Utility type that extends a type to accept private parameters.
|
|
4
|
+
*
|
|
5
|
+
* The private parameters can then be extracted out of the object using
|
|
6
|
+
* `getPrivateParams`.
|
|
7
|
+
*/
|
|
8
|
+
type WithPrivate<T> = T & { [K in `__${string}`]?: unknown };
|
|
9
|
+
//#endregion
|
|
10
|
+
export { WithPrivate };
|
|
11
|
+
//# sourceMappingURL=types.d.cts.map
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
//#region src/utils/types.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Utility type that extends a type to accept private parameters.
|
|
3
4
|
*
|
|
4
5
|
* The private parameters can then be extracted out of the object using
|
|
5
6
|
* `getPrivateParams`.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
* Extract private parameters out of an object.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getPrivateParams: (params?: object) => { [K in keyof typeof params as K extends `__${string}` ? K : never]: (typeof params)[K]; };
|
|
8
|
+
type WithPrivate<T> = T & { [K in `__${string}`]?: unknown };
|
|
9
|
+
//#endregion
|
|
10
|
+
export { WithPrivate };
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/utils/types.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPrivateParams = void 0;
|
|
1
|
+
//#region src/utils/types.ts
|
|
4
2
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
* Extract private parameters out of an object.
|
|
4
|
+
*/
|
|
7
5
|
const getPrivateParams = (params) => {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const privateEntries = Object.entries(params ?? {}).filter(([k]) => k.startsWith("__"));
|
|
7
|
+
return Object.fromEntries(privateEntries);
|
|
10
8
|
};
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getPrivateParams };
|
|
12
12
|
//# sourceMappingURL=types.js.map
|
package/dist/utils/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/utils/types.ts"],"sourcesContent":["/**\n * Utility type that extends a type to accept private parameters.\n *\n * The private parameters can then be extracted out of the object using\n * `getPrivateParams`.\n */\nexport type WithPrivate<T> = T & {\n [K in `__${string}`]?: unknown;\n};\n\n/**\n * Extract private parameters out of an object.\n */\nexport const getPrivateParams = (params?: object) => {\n const privateEntries = Object.entries(params ?? {}).filter(([k]) =>\n k.startsWith(\"__\"),\n );\n return Object.fromEntries(privateEntries) as {\n [K in keyof typeof params as K extends `__${string}`\n ? K\n : never]: (typeof params)[K];\n };\n};\n"],"mappings":";;;;AAaA,MAAa,oBAAoB,WAAoB;CACnD,MAAM,iBAAiB,OAAO,QAAQ,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,OAC3D,EAAE,WAAW,KAAK,CACnB;AACD,QAAO,OAAO,YAAY,eAAe"}
|
package/dist/version.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.cjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Autogenerated by inject-version.ts\nexport const VERSION = \"2.0.0-beta.20\";\n"],"mappings":";;AACA,MAAa,UAAU"}
|
package/dist/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/version.ts
|
|
2
|
+
const VERSION = "2.0.0-beta.20";
|
|
3
|
+
|
|
4
|
+
//#endregion
|
|
5
|
+
export { VERSION };
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Autogenerated by inject-version.ts\nexport const VERSION = \"2.0.0-beta.20\";\n"],"mappings":";AACA,MAAa,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/sandbox",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.20",
|
|
4
4
|
"description": "Software Development Kit for Vercel Sandbox",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
6
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs",
|
|
14
|
+
"default": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./dist/auth/index.js": {
|
|
17
|
+
"types": "./dist/auth/index.d.ts",
|
|
18
|
+
"import": "./dist/auth/index.js",
|
|
19
|
+
"require": "./dist/auth/index.cjs",
|
|
20
|
+
"default": "./dist/auth/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
7
24
|
"files": [
|
|
8
25
|
"dist",
|
|
9
26
|
"README.md",
|
|
@@ -23,6 +40,7 @@
|
|
|
23
40
|
"license": "Apache-2.0",
|
|
24
41
|
"dependencies": {
|
|
25
42
|
"@vercel/oidc": "3.2.0",
|
|
43
|
+
"@workflow/serde": "4.1.0-beta.2",
|
|
26
44
|
"async-retry": "1.3.3",
|
|
27
45
|
"jsonlines": "0.1.1",
|
|
28
46
|
"ms": "2.1.3",
|
|
@@ -38,15 +56,17 @@
|
|
|
38
56
|
"@types/ms": "2.1.0",
|
|
39
57
|
"@types/node": "22.15.12",
|
|
40
58
|
"@types/tar-stream": "3.1.4",
|
|
59
|
+
"@workflow/core": "4.2.0-beta.73",
|
|
41
60
|
"dotenv": "16.5.0",
|
|
42
61
|
"factoree": "^0.1.2",
|
|
62
|
+
"tsdown": "0.16.6",
|
|
43
63
|
"typedoc": "0.28.5",
|
|
44
64
|
"typescript": "5.8.3",
|
|
45
65
|
"vitest": "3.2.1"
|
|
46
66
|
},
|
|
47
67
|
"scripts": {
|
|
48
68
|
"clean": "rm -rf node_modules dist",
|
|
49
|
-
"build": "
|
|
69
|
+
"build": "tsdown",
|
|
50
70
|
"test": "vitest run",
|
|
51
71
|
"typedoc": "typedoc",
|
|
52
72
|
"typecheck": "tsc --noEmit",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api-client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,+CAA6B"}
|
package/dist/auth/api.d.ts
DELETED
package/dist/auth/error.d.ts
DELETED
package/dist/auth/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";AAAA,2FAA2F;AAC3F,kFAAkF;;;;;;;;;;;;;;;;;AAElF,yCAAuB;AAEvB,0CAAwB;AAExB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,qCAAmD;AAA1C,qGAAA,UAAU,OAAA;AAAE,qGAAA,UAAU,OAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reads the linked project configuration from `.vercel/project.json`.
|
|
3
|
-
*
|
|
4
|
-
* @param cwd - The directory to search for `.vercel/project.json`.
|
|
5
|
-
* @returns The linked project's `projectId` and `teamId`, or `null` if not found.
|
|
6
|
-
*/
|
|
7
|
-
export declare function readLinkedProject(cwd: string): Promise<{
|
|
8
|
-
projectId: string;
|
|
9
|
-
teamId: string;
|
|
10
|
-
} | null>;
|
package/dist/auth/zod.d.ts
DELETED
package/dist/constants.js
DELETED