@theholocron/vercel-client 1.58.0-alpha.37 → 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 +32 -4
- package/dist/index.mjs +10 -1
- package/package.json +3 -3
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
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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.
|
|
3
|
+
"version": "1.58.0-alpha.38",
|
|
4
4
|
"description": "A TypeScript client for the Vercel API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vercel",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@theholocron/
|
|
36
|
-
"@theholocron/
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.38",
|
|
36
|
+
"@theholocron/observability": "^0.7.0-alpha.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26",
|