@theholocron/vercel-client 1.58.0-alpha.46 → 1.58.0-alpha.48
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 +33 -2
- package/dist/index.mjs +15 -2
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -256,7 +256,34 @@ interface VercelUserResponse {
|
|
|
256
256
|
/** The authenticated user. */
|
|
257
257
|
user?: VercelUser;
|
|
258
258
|
}
|
|
259
|
-
/**
|
|
259
|
+
/** A webhook as Vercel lists it. The list carries no signing secret. */
|
|
260
|
+
interface VercelWebhook {
|
|
261
|
+
/** The webhook id (`account_hook_...`). */
|
|
262
|
+
id: string;
|
|
263
|
+
/** Where Vercel posts. */
|
|
264
|
+
url: string;
|
|
265
|
+
/** The event names it subscribes to. */
|
|
266
|
+
events: string[];
|
|
267
|
+
/** The projects it is limited to; empty or absent for every project. */
|
|
268
|
+
projectIds?: string[];
|
|
269
|
+
/** The team that owns it. */
|
|
270
|
+
ownerId?: string;
|
|
271
|
+
}
|
|
272
|
+
/** The response of `webhooks.create()`: the only time Vercel returns the signing `secret`. */
|
|
273
|
+
interface VercelCreatedWebhook extends VercelWebhook {
|
|
274
|
+
/** The secret Vercel signs payloads with (`x-vercel-signature`, HMAC-SHA1). Never returned again. A credential. */
|
|
275
|
+
secret: string;
|
|
276
|
+
}
|
|
277
|
+
/** The body of `webhooks.create()`. */
|
|
278
|
+
interface VercelCreateWebhookInput {
|
|
279
|
+
/** An `http(s)` URL. */
|
|
280
|
+
url: string;
|
|
281
|
+
/** Event names, at least one (`deployment.error`). */
|
|
282
|
+
events: string[];
|
|
283
|
+
/** Limit the webhook to these projects. */
|
|
284
|
+
projectIds?: string[];
|
|
285
|
+
}
|
|
286
|
+
/** Create a Vercel client with `deployments`, `domains`, `env`, `projects`, `user` and `webhooks` groups, all sharing one REST client built from `opts`. */
|
|
260
287
|
export declare function createVercelClient(opts: VercelClientOptions): {
|
|
261
288
|
deployments: {
|
|
262
289
|
trigger: (input: VercelTriggerDeploymentInput) => Promise<VercelDeployment>;
|
|
@@ -283,7 +310,11 @@ export declare function createVercelClient(opts: VercelClientOptions): {
|
|
|
283
310
|
user: {
|
|
284
311
|
get: () => Promise<VercelUserResponse>;
|
|
285
312
|
};
|
|
313
|
+
webhooks: {
|
|
314
|
+
list: () => Promise<VercelWebhook[]>;
|
|
315
|
+
create: (input: VercelCreateWebhookInput) => Promise<VercelCreatedWebhook>;
|
|
316
|
+
};
|
|
286
317
|
};
|
|
287
318
|
/** The client `createVercelClient()` returns. */
|
|
288
319
|
export type VercelClient = ReturnType<typeof createVercelClient>;
|
|
289
|
-
export type { VercelAddDomainResult, VercelClientOptions, VercelCreateDeploymentInput, VercelCreateProjectInput, VercelDeployFile, VercelDeployment, VercelDeploymentState, VercelDeploymentTarget, VercelDomain, VercelDomainConfig, VercelDomainConfigRecommendation, VercelDomainVerification, VercelDomainsResponse, VercelEnvTarget, VercelEnvVar, VercelEnvVarsResponse, VercelProject, VercelProjectLink, VercelProjectsResponse, VercelTriggerDeploymentInput, VercelUpdateProjectInput, VercelUser, VercelUserResponse };
|
|
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -129,8 +129,20 @@ function createVercelRestClient(opts) {
|
|
|
129
129
|
errors: opts.errors
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
// src/webhooks/webhooks.ts
|
|
133
|
+
function webhooks(rest) {
|
|
134
|
+
return {
|
|
135
|
+
/** `GET /v1/webhooks`: the team's webhooks (a bare array, no secrets). */
|
|
136
|
+
list: () => rest.request("/v1/webhooks"),
|
|
137
|
+
/** `POST /v1/webhooks`: makes a webhook and returns its secret, once. */
|
|
138
|
+
create: (input) => rest.request("/v1/webhooks", {
|
|
139
|
+
method: "POST",
|
|
140
|
+
body: input
|
|
141
|
+
})
|
|
142
|
+
};
|
|
143
|
+
}
|
|
132
144
|
// src/index.ts
|
|
133
|
-
/** Create a Vercel client with `deployments`, `domains`, `env`, `projects` and `
|
|
145
|
+
/** Create a Vercel client with `deployments`, `domains`, `env`, `projects`, `user` and `webhooks` groups, all sharing one REST client built from `opts`. */
|
|
134
146
|
function createVercelClient(opts) {
|
|
135
147
|
const rest = createVercelRestClient(opts);
|
|
136
148
|
return {
|
|
@@ -138,7 +150,8 @@ function createVercelClient(opts) {
|
|
|
138
150
|
domains: domains(rest),
|
|
139
151
|
env: env(rest),
|
|
140
152
|
projects: projects(rest),
|
|
141
|
-
user: user(rest)
|
|
153
|
+
user: user(rest),
|
|
154
|
+
webhooks: webhooks(rest)
|
|
142
155
|
};
|
|
143
156
|
}
|
|
144
157
|
export { createVercelClient };
|
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.48",
|
|
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.
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.48",
|
|
36
36
|
"@theholocron/observability": "^0.7.0-alpha.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"tsdown": "^0.23.7",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^5.1.0",
|
|
48
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.21",
|
|
49
48
|
"@theholocron/eslint-config": "^8.9.0-alpha.21",
|
|
50
|
-
"@theholocron/
|
|
51
|
-
"@theholocron/
|
|
49
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.21",
|
|
50
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.21",
|
|
51
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.21"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.0.0"
|