@theholocron/vercel-client 1.58.0-alpha.4 → 1.58.0-alpha.41

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/dist/index.d.mts CHANGED
@@ -33,12 +33,36 @@ interface VercelDeployment {
33
33
  readyState: VercelDeploymentState;
34
34
  /** The environment the deployment was built for; absent or `null` for a preview. */
35
35
  target?: VercelDeploymentTarget | null;
36
- /** Git metadata Vercel attaches to the deployment. */
37
- meta?: {
38
- /** The branch or ref the deployment was built from. */
39
- githubCommitRef?: string;
36
+ /**
37
+ * Metadata on the deployment: what Vercel attaches for a Git deployment (`githubCommitRef`, the branch or ref it was
38
+ * built from) and whatever the creator set through `deployments.create()`'s `meta`.
39
+ */
40
+ meta?: Record<string, string | undefined>;
41
+ /** When the deployment was created, in milliseconds since the epoch (the list endpoint returns it). */
42
+ createdAt?: number;
43
+ }
44
+ /** Input for `deployments.list()`. */
45
+ interface VercelListDeploymentsInput {
46
+ /** Only this project's deployments (its id or name). */
47
+ projectId: string;
48
+ /** Page size; Vercel's own maximum is 100. */
49
+ limit?: number;
50
+ /** Only deployments created before this timestamp (the previous page's `pagination.next`). */
51
+ until?: number;
52
+ }
53
+ /** One page of `deployments.list()`. */
54
+ interface VercelDeploymentPage {
55
+ deployments: VercelDeployment[];
56
+ /** Where the next page starts (pass it as `until`); `null` or absent on the last page. */
57
+ pagination?: {
58
+ next?: number | null;
40
59
  };
41
60
  }
61
+ /** What `deployments.remove()` answers with. */
62
+ interface VercelDeletedDeployment {
63
+ uid: string;
64
+ state: string;
65
+ }
42
66
  /** Input for `deployments.trigger()`: deploy a branch of a linked GitHub repository. */
43
67
  interface VercelTriggerDeploymentInput {
44
68
  /** The Vercel project to deploy. */
@@ -70,8 +94,16 @@ interface VercelCreateDeploymentInput {
70
94
  * later deployments inherit it unless overridden here again.
71
95
  */
72
96
  framework?: string | null;
97
+ /**
98
+ * `projectSettings.installCommand`. Sent explicitly because a deployment made from uploaded
99
+ * files takes its install command from the project's settings, not from an uploaded
100
+ * `vercel.json`; omitted, the project's own setting applies.
101
+ */
102
+ installCommand?: string;
73
103
  /** The environment to deploy to; omitted, Vercel decides. */
74
104
  target?: VercelDeploymentTarget;
105
+ /** Key-value metadata stored on the deployment: a creator's own tags, read back through `deployments.list()`. */
106
+ meta?: Record<string, string>;
75
107
  }
76
108
  /** A domain attached to a Vercel project. */
77
109
  interface VercelDomain {
@@ -229,6 +261,8 @@ export declare function createVercelClient(opts: VercelClientOptions): {
229
261
  deployments: {
230
262
  trigger: (input: VercelTriggerDeploymentInput) => Promise<VercelDeployment>;
231
263
  create: (input: VercelCreateDeploymentInput) => Promise<VercelDeployment>;
264
+ list: (input: VercelListDeploymentsInput) => Promise<VercelDeploymentPage>;
265
+ remove: (deploymentId: string) => Promise<VercelDeletedDeployment>;
232
266
  get: (deploymentId: string) => Promise<VercelDeployment>;
233
267
  };
234
268
  domains: {
package/dist/index.mjs CHANGED
@@ -29,10 +29,22 @@ function deployments(rest) {
29
29
  data: Buffer.from(f.content, "utf8").toString("base64"),
30
30
  encoding: "base64"
31
31
  })),
32
- projectSettings: { framework: input.framework ?? null },
33
- ...input.target ? { target: input.target } : {}
32
+ projectSettings: {
33
+ framework: input.framework ?? null,
34
+ ...input.installCommand ? { installCommand: input.installCommand } : {}
35
+ },
36
+ ...input.target ? { target: input.target } : {},
37
+ ...input.meta && Object.keys(input.meta).length > 0 ? { meta: input.meta } : {}
34
38
  }
35
39
  }),
40
+ /** One page of a project's deployments, newest first, each with its `meta`. */
41
+ list: (input) => rest.request("/v6/deployments", { query: {
42
+ projectId: input.projectId,
43
+ limit: String(input.limit ?? 100),
44
+ ...input.until !== void 0 ? { until: String(input.until) } : {}
45
+ } }),
46
+ /** Deletes a deployment. One that is already gone is a `ProviderApiError` with status 404. */
47
+ remove: (deploymentId) => rest.request(`/v13/deployments/${encodeURIComponent(deploymentId)}`, { method: "DELETE" }),
36
48
  get: (deploymentId) => rest.request(`/v13/deployments/${encodeURIComponent(deploymentId)}`)
37
49
  };
38
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/vercel-client",
3
- "version": "1.58.0-alpha.4",
3
+ "version": "1.58.0-alpha.41",
4
4
  "description": "A TypeScript client for the Vercel API",
5
5
  "keywords": [
6
6
  "vercel",
@@ -32,23 +32,23 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.58.0-alpha.4",
36
- "@theholocron/observability": "^0.6.1-alpha.1"
35
+ "@theholocron/http-client": "^1.58.0-alpha.41",
36
+ "@theholocron/observability": "^0.7.0-alpha.5"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26",
40
- "@vitest/coverage-v8": "^5.0.5",
41
- "@vitest/eslint-plugin": "^1.6.27",
42
- "eslint": "^10.8.1",
43
- "eslint-plugin-n": "^18.3.0",
44
- "globals": "^17.11.0",
45
- "tsdown": "^0.23.3",
40
+ "@vitest/coverage-v8": "^5.1.0",
41
+ "@vitest/eslint-plugin": "^1.6.28",
42
+ "eslint": "^10.14.0",
43
+ "eslint-plugin-n": "^18.5.0",
44
+ "globals": "^17.14.0",
45
+ "tsdown": "^0.23.7",
46
46
  "typescript": "^5.9.3",
47
- "vitest": "^5.0.5",
48
- "@theholocron/eslint-config": "^8.9.0-alpha.5",
49
- "@theholocron/tsconfig": "^8.9.0-alpha.5",
50
- "@theholocron/tsdown-config": "^8.9.0-alpha.5",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.5"
47
+ "vitest": "^5.1.0",
48
+ "@theholocron/tsconfig": "^8.9.0-alpha.21",
49
+ "@theholocron/tsdown-config": "^8.9.0-alpha.21",
50
+ "@theholocron/vitest-config": "^8.9.0-alpha.21",
51
+ "@theholocron/eslint-config": "^8.9.0-alpha.21"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"
@@ -57,10 +57,10 @@
57
57
  "access": "public"
58
58
  },
59
59
  "scripts": {
60
- "delivery.build": "tsdown && node ../scripts/check-bundle-size.mjs",
61
- "sourceQuality.staticAnalysis": "eslint .",
60
+ "build": "tsdown && node ../scripts/check-bundle-size.mjs",
61
+ "lint:code": "eslint .",
62
+ "test:unit": "vitest run --coverage",
62
63
  "test:watch": "vitest",
63
- "verification.typeSafety": "tsc --noEmit",
64
- "verification.unitTests": "vitest run"
64
+ "typecheck": "tsc --noEmit"
65
65
  }
66
66
  }