@theholocron/vercel-client 1.58.0-alpha.36 → 1.58.0-alpha.38

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. */
@@ -78,6 +102,8 @@ interface VercelCreateDeploymentInput {
78
102
  installCommand?: string;
79
103
  /** The environment to deploy to; omitted, Vercel decides. */
80
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>;
81
107
  }
82
108
  /** A domain attached to a Vercel project. */
83
109
  interface VercelDomain {
@@ -235,6 +261,8 @@ export declare function createVercelClient(opts: VercelClientOptions): {
235
261
  deployments: {
236
262
  trigger: (input: VercelTriggerDeploymentInput) => Promise<VercelDeployment>;
237
263
  create: (input: VercelCreateDeploymentInput) => Promise<VercelDeployment>;
264
+ list: (input: VercelListDeploymentsInput) => Promise<VercelDeploymentPage>;
265
+ remove: (deploymentId: string) => Promise<VercelDeletedDeployment>;
238
266
  get: (deploymentId: string) => Promise<VercelDeployment>;
239
267
  };
240
268
  domains: {
package/dist/index.mjs CHANGED
@@ -33,9 +33,18 @@ function deployments(rest) {
33
33
  framework: input.framework ?? null,
34
34
  ...input.installCommand ? { installCommand: input.installCommand } : {}
35
35
  },
36
- ...input.target ? { target: input.target } : {}
36
+ ...input.target ? { target: input.target } : {},
37
+ ...input.meta && Object.keys(input.meta).length > 0 ? { meta: input.meta } : {}
37
38
  }
38
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" }),
39
48
  get: (deploymentId) => rest.request(`/v13/deployments/${encodeURIComponent(deploymentId)}`)
40
49
  };
41
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/vercel-client",
3
- "version": "1.58.0-alpha.36",
3
+ "version": "1.58.0-alpha.38",
4
4
  "description": "A TypeScript client for the Vercel API",
5
5
  "keywords": [
6
6
  "vercel",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.58.0-alpha.36",
35
+ "@theholocron/http-client": "^1.58.0-alpha.38",
36
36
  "@theholocron/observability": "^0.7.0-alpha.4"
37
37
  },
38
38
  "devDependencies": {
@@ -47,8 +47,8 @@
47
47
  "vitest": "^5.1.0",
48
48
  "@theholocron/eslint-config": "^8.9.0-alpha.18",
49
49
  "@theholocron/tsconfig": "^8.9.0-alpha.18",
50
- "@theholocron/tsdown-config": "^8.9.0-alpha.18",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.18"
50
+ "@theholocron/vitest-config": "^8.9.0-alpha.18",
51
+ "@theholocron/tsdown-config": "^8.9.0-alpha.18"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"