@theholocron/vercel-client 1.58.0-alpha.59 → 1.58.0-alpha.61
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 +49 -3
- package/dist/index.mjs +11 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -223,8 +223,8 @@ interface VercelProjectsResponse {
|
|
|
223
223
|
interface VercelCreateProjectInput {
|
|
224
224
|
/** The project name. */
|
|
225
225
|
name: string;
|
|
226
|
-
/** The framework preset; omitted, none is sent. */
|
|
227
|
-
framework?: string;
|
|
226
|
+
/** The framework preset; omitted, none is sent, and `null` asks for no preset ("Other"), which a bare function needs. */
|
|
227
|
+
framework?: string | null;
|
|
228
228
|
/** A GitHub repository (`owner/name`) to link the project to. */
|
|
229
229
|
repo?: string;
|
|
230
230
|
/** The directory in the repository the project builds from. */
|
|
@@ -232,6 +232,8 @@ interface VercelCreateProjectInput {
|
|
|
232
232
|
}
|
|
233
233
|
/** Input for `projects.update()`; only the fields given are sent. */
|
|
234
234
|
interface VercelUpdateProjectInput {
|
|
235
|
+
/** The framework preset; `null` removes it ("Other"). Omitted, it is left as it is. */
|
|
236
|
+
framework?: string | null;
|
|
235
237
|
/** Turn preview deployments off (`true`) or on (`false`). */
|
|
236
238
|
previewDeploymentsDisabled?: boolean;
|
|
237
239
|
/** Git integration settings for the project. */
|
|
@@ -256,6 +258,48 @@ interface VercelUserResponse {
|
|
|
256
258
|
/** The authenticated user. */
|
|
257
259
|
user?: VercelUser;
|
|
258
260
|
}
|
|
261
|
+
/** One API token as Vercel describes it. Times are milliseconds since the epoch. */
|
|
262
|
+
interface VercelToken {
|
|
263
|
+
/** The token's id (not its value). */
|
|
264
|
+
id?: string;
|
|
265
|
+
/** The name the token was made with. */
|
|
266
|
+
name?: string;
|
|
267
|
+
/** What kind of token it is (`oauth2-token`, `personal-access-token`, ...). */
|
|
268
|
+
type?: string;
|
|
269
|
+
/** The teams the token reaches, when it is limited to some. */
|
|
270
|
+
scopes?: {
|
|
271
|
+
type?: string;
|
|
272
|
+
teamId?: string;
|
|
273
|
+
origin?: string;
|
|
274
|
+
expiresAt?: number;
|
|
275
|
+
createdAt?: number;
|
|
276
|
+
}[];
|
|
277
|
+
/** When the token stops working, absent when it never does. */
|
|
278
|
+
expiresAt?: number;
|
|
279
|
+
/** When the token was made. */
|
|
280
|
+
createdAt?: number;
|
|
281
|
+
/** When the token was last used. */
|
|
282
|
+
activeAt?: number;
|
|
283
|
+
}
|
|
284
|
+
/** The response of `user.currentToken()`. */
|
|
285
|
+
interface VercelTokenResponse {
|
|
286
|
+
/** The token the request was made with. */
|
|
287
|
+
token?: VercelToken;
|
|
288
|
+
}
|
|
289
|
+
/** What `user.createToken()` sends. */
|
|
290
|
+
interface VercelCreateTokenInput {
|
|
291
|
+
/** The name the token is shown under. */
|
|
292
|
+
name: string;
|
|
293
|
+
/** When the token stops working, in milliseconds since the epoch. Left out: it never does. */
|
|
294
|
+
expiresAt?: number;
|
|
295
|
+
}
|
|
296
|
+
/** The response of `user.createToken()`: the token's description and its value, which Vercel gives once. */
|
|
297
|
+
interface VercelCreatedToken {
|
|
298
|
+
/** The token's description. */
|
|
299
|
+
token?: VercelToken;
|
|
300
|
+
/** The token's value. Shown only in this response; never log it. */
|
|
301
|
+
bearerToken?: string;
|
|
302
|
+
}
|
|
259
303
|
/** A webhook as Vercel lists it. The list carries no signing secret. */
|
|
260
304
|
interface VercelWebhook {
|
|
261
305
|
/** The webhook id (`account_hook_...`). */
|
|
@@ -309,6 +353,8 @@ export declare function createVercelClient(opts: VercelClientOptions): {
|
|
|
309
353
|
};
|
|
310
354
|
user: {
|
|
311
355
|
get: () => Promise<VercelUserResponse>;
|
|
356
|
+
currentToken: () => Promise<VercelTokenResponse>;
|
|
357
|
+
createToken: (input: VercelCreateTokenInput) => Promise<VercelCreatedToken>;
|
|
312
358
|
};
|
|
313
359
|
webhooks: {
|
|
314
360
|
list: () => Promise<VercelWebhook[]>;
|
|
@@ -317,4 +363,4 @@ export declare function createVercelClient(opts: VercelClientOptions): {
|
|
|
317
363
|
};
|
|
318
364
|
/** The client `createVercelClient()` returns. */
|
|
319
365
|
export type VercelClient = ReturnType<typeof createVercelClient>;
|
|
320
|
-
export type { VercelAddDomainResult, VercelClientOptions, VercelCreateDeploymentInput, VercelCreateProjectInput, VercelCreateWebhookInput, VercelCreatedWebhook, VercelDeployFile, VercelDeployment, VercelDeploymentState, VercelDeploymentTarget, VercelDomain, VercelDomainConfig, VercelDomainConfigRecommendation, VercelDomainVerification, VercelDomainsResponse, VercelEnvTarget, VercelEnvVar, VercelEnvVarsResponse, VercelProject, VercelProjectLink, VercelProjectsResponse, VercelTriggerDeploymentInput, VercelUpdateProjectInput, VercelUser, VercelUserResponse, VercelWebhook };
|
|
366
|
+
export type { VercelAddDomainResult, VercelClientOptions, VercelCreateDeploymentInput, VercelCreateProjectInput, VercelCreateTokenInput, VercelCreateWebhookInput, VercelCreatedToken, VercelCreatedWebhook, VercelDeployFile, VercelDeployment, VercelDeploymentState, VercelDeploymentTarget, VercelDomain, VercelDomainConfig, VercelDomainConfigRecommendation, VercelDomainVerification, VercelDomainsResponse, VercelEnvTarget, VercelEnvVar, VercelEnvVarsResponse, VercelProject, VercelProjectLink, VercelProjectsResponse, VercelToken, VercelTokenResponse, VercelTriggerDeploymentInput, VercelUpdateProjectInput, VercelUser, VercelUserResponse, VercelWebhook };
|
package/dist/index.mjs
CHANGED
|
@@ -104,6 +104,7 @@ function projects(rest) {
|
|
|
104
104
|
},
|
|
105
105
|
update: (projectId, input) => {
|
|
106
106
|
const body = {};
|
|
107
|
+
if (input.framework !== void 0) body.framework = input.framework;
|
|
107
108
|
if (input.previewDeploymentsDisabled !== void 0) body.previewDeploymentsDisabled = input.previewDeploymentsDisabled;
|
|
108
109
|
if (input.gitProviderOptions !== void 0) body.gitProviderOptions = input.gitProviderOptions;
|
|
109
110
|
return rest.request(`/v9/projects/${encodeURIComponent(projectId)}`, {
|
|
@@ -115,7 +116,16 @@ function projects(rest) {
|
|
|
115
116
|
}
|
|
116
117
|
// src/user/user.ts
|
|
117
118
|
function user(rest) {
|
|
118
|
-
return {
|
|
119
|
+
return {
|
|
120
|
+
get: () => rest.request("/v2/user"),
|
|
121
|
+
/** Describes the token this client was made with: its name, kind, when it was made and when it expires. Never returns the token's value. */
|
|
122
|
+
currentToken: () => rest.request("/v5/user/tokens/current"),
|
|
123
|
+
/** `POST /v3/user/tokens`: makes an account token and returns its value (`bearerToken`), once. */
|
|
124
|
+
createToken: (input) => rest.request("/v3/user/tokens", {
|
|
125
|
+
method: "POST",
|
|
126
|
+
body: input
|
|
127
|
+
})
|
|
128
|
+
};
|
|
119
129
|
}
|
|
120
130
|
// src/utils.ts
|
|
121
131
|
function createVercelRestClient(opts) {
|
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.61",
|
|
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/http-client": "^1.58.0-alpha.
|
|
36
|
-
"@theholocron/observability": "^0.7.0-alpha.
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.61",
|
|
36
|
+
"@theholocron/observability": "^0.7.0-alpha.8"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"tsdown": "^0.23.7",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "^5.1.1",
|
|
48
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.
|
|
49
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.
|
|
50
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.
|
|
51
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.
|
|
48
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.24",
|
|
49
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.24",
|
|
50
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.24",
|
|
51
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.24"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.0.0"
|