@vercel/sandbox 0.0.1 → 0.0.2
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +6 -0
- package/dist/package.json +31 -0
- package/dist/scripts/inject-version.d.ts +1 -0
- package/dist/scripts/inject-version.js +14 -0
- package/dist/{client → src/client}/client.js +3 -0
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +5 -0
- package/package.json +3 -2
- package/scripts/inject-version.ts +11 -0
- package/src/client/client.ts +3 -0
- package/src/version.ts +2 -0
- package/tsconfig.json +4 -7
- /package/dist/{client → src/client}/api-error.d.ts +0 -0
- /package/dist/{client → src/client}/api-error.js +0 -0
- /package/dist/{client → src/client}/base-client.d.ts +0 -0
- /package/dist/{client → src/client}/base-client.js +0 -0
- /package/dist/{client → src/client}/client.d.ts +0 -0
- /package/dist/{client → src/client}/validators.d.ts +0 -0
- /package/dist/{client → src/client}/validators.js +0 -0
- /package/dist/{client → src/client}/with-retry.d.ts +0 -0
- /package/dist/{client → src/client}/with-retry.js +0 -0
- /package/dist/{create-sandbox.d.ts → src/create-sandbox.d.ts} +0 -0
- /package/dist/{create-sandbox.js → src/create-sandbox.js} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{utils → src/utils}/array.d.ts +0 -0
- /package/dist/{utils → src/utils}/array.js +0 -0
- /package/dist/{utils → src/utils}/deferred-generator.d.ts +0 -0
- /package/dist/{utils → src/utils}/deferred-generator.js +0 -0
- /package/dist/{utils → src/utils}/deferred.d.ts +0 -0
- /package/dist/{utils → src/utils}/deferred.js +0 -0
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vercel/sandbox",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"typedoc": "typedoc",
|
|
10
|
+
"typecheck": "tsc --noEmit",
|
|
11
|
+
"inject-version": "ts-node scripts/inject-version.ts"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"async-retry": "1.3.3",
|
|
18
|
+
"form-data": "3.0.0",
|
|
19
|
+
"jsonlines": "0.1.1",
|
|
20
|
+
"node-fetch": "2.6.11",
|
|
21
|
+
"zod": "3.24.4"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/async-retry": "1.4.9",
|
|
25
|
+
"@types/jsonlines": "0.1.5",
|
|
26
|
+
"@types/node": "22.15.12",
|
|
27
|
+
"@types/node-fetch": "2.6.12",
|
|
28
|
+
"typedoc": "^0.28.4",
|
|
29
|
+
"typescript": "5.8.3"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const package_json_1 = require("../package.json");
|
|
7
|
+
const promises_1 = require("fs/promises");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
async function main() {
|
|
10
|
+
const outPath = path_1.default.resolve(__dirname, "../src/version.ts");
|
|
11
|
+
const content = `// Autogenerated by inject-version.ts\nexport const VERSION = "${package_json_1.version}";\n`;
|
|
12
|
+
await (0, promises_1.writeFile)(outPath, content);
|
|
13
|
+
}
|
|
14
|
+
main().catch(console.error);
|
|
@@ -9,7 +9,9 @@ const base_client_1 = require("./base-client");
|
|
|
9
9
|
const validators_1 = require("./validators");
|
|
10
10
|
const api_error_1 = require("./api-error");
|
|
11
11
|
const deferred_generator_1 = require("../utils/deferred-generator");
|
|
12
|
+
const version_1 = require("../version");
|
|
12
13
|
const jsonlines_1 = __importDefault(require("jsonlines"));
|
|
14
|
+
const os_1 = __importDefault(require("os"));
|
|
13
15
|
class SandboxClient extends base_client_1.APIClient {
|
|
14
16
|
constructor(params) {
|
|
15
17
|
super({
|
|
@@ -25,6 +27,7 @@ class SandboxClient extends base_client_1.APIClient {
|
|
|
25
27
|
query: { teamId: this.teamId, ...params?.query },
|
|
26
28
|
headers: {
|
|
27
29
|
"content-type": "application/json",
|
|
30
|
+
"user-agent": `vercel/sandbox/${version_1.VERSION} (Node.js/${process.version}; ${os_1.default.platform()}/${os_1.default.arch()})`,
|
|
28
31
|
...params?.headers,
|
|
29
32
|
},
|
|
30
33
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "0.0.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/sandbox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc",
|
|
27
27
|
"typedoc": "typedoc",
|
|
28
|
-
"typecheck": "tsc --noEmit"
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"inject-version": "ts-node scripts/inject-version.ts"
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { version } from "../package.json";
|
|
2
|
+
import { writeFile } from "fs/promises";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
async function main() {
|
|
6
|
+
const outPath = path.resolve(__dirname, "../src/version.ts");
|
|
7
|
+
const content = `// Autogenerated by inject-version.ts\nexport const VERSION = "${version}";\n`;
|
|
8
|
+
await writeFile(outPath, content);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
main().catch(console.error);
|
package/src/client/client.ts
CHANGED
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
import { Readable } from "stream";
|
|
11
11
|
import { APIError } from "./api-error";
|
|
12
12
|
import { createDeferredGenerator } from "../utils/deferred-generator";
|
|
13
|
+
import { VERSION } from "../version";
|
|
13
14
|
import { z } from "zod";
|
|
14
15
|
import jsonlines from "jsonlines";
|
|
16
|
+
import os from "os";
|
|
15
17
|
|
|
16
18
|
export class SandboxClient extends APIClient {
|
|
17
19
|
private teamId: string;
|
|
@@ -32,6 +34,7 @@ export class SandboxClient extends APIClient {
|
|
|
32
34
|
query: { teamId: this.teamId, ...params?.query },
|
|
33
35
|
headers: {
|
|
34
36
|
"content-type": "application/json",
|
|
37
|
+
"user-agent": `vercel/sandbox/${VERSION} (Node.js/${process.version}; ${os.platform()}/${os.arch()})`,
|
|
35
38
|
...params?.headers,
|
|
36
39
|
},
|
|
37
40
|
});
|
package/src/version.ts
ADDED
package/tsconfig.json
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"outDir": "./dist",
|
|
4
4
|
"esModuleInterop": true,
|
|
5
|
-
"lib": [
|
|
6
|
-
"ESNext"
|
|
7
|
-
],
|
|
5
|
+
"lib": ["ESNext"],
|
|
8
6
|
"strict": true,
|
|
9
7
|
"target": "ES2020",
|
|
10
8
|
"declaration": true,
|
|
11
|
-
"module": "commonjs"
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"resolveJsonModule": true
|
|
12
11
|
},
|
|
13
|
-
"include": [
|
|
14
|
-
"src/**/*"
|
|
15
|
-
]
|
|
12
|
+
"include": ["scripts/**/*", "src/**/*"]
|
|
16
13
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|