@theholocron/vercel-client 1.58.0-alpha.64 → 1.58.0-alpha.65

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
@@ -300,6 +300,11 @@ interface VercelCreatedToken {
300
300
  /** The token's value. Shown only in this response; never log it. */
301
301
  bearerToken?: string;
302
302
  }
303
+ /** The response of `user.deleteToken()`. */
304
+ interface VercelDeletedToken {
305
+ /** The id of the token Vercel deleted. */
306
+ tokenId?: string;
307
+ }
303
308
  /** A webhook as Vercel lists it. The list carries no signing secret. */
304
309
  interface VercelWebhook {
305
310
  /** The webhook id (`account_hook_...`). */
@@ -355,6 +360,7 @@ export declare function createVercelClient(opts: VercelClientOptions): {
355
360
  get: () => Promise<VercelUserResponse>;
356
361
  currentToken: () => Promise<VercelTokenResponse>;
357
362
  createToken: (input: VercelCreateTokenInput) => Promise<VercelCreatedToken>;
363
+ deleteToken: (tokenId: string) => Promise<VercelDeletedToken>;
358
364
  };
359
365
  webhooks: {
360
366
  list: () => Promise<VercelWebhook[]>;
package/dist/index.mjs CHANGED
@@ -124,7 +124,13 @@ function user(rest) {
124
124
  createToken: (input) => rest.request("/v3/user/tokens", {
125
125
  method: "POST",
126
126
  body: input
127
- })
127
+ }),
128
+ /**
129
+ * `DELETE /v3/user/tokens/{tokenId}`: invalidates a token. The id goes in the path through `encodeURIComponent`.
130
+ * Vercel reads the special id `current` as the token making the request, so a caller that must not delete its own
131
+ * token has to refuse that word itself. A token Vercel does not have is a 404 `ProviderApiError`.
132
+ */
133
+ deleteToken: (tokenId) => rest.request(`/v3/user/tokens/${encodeURIComponent(tokenId)}`, { method: "DELETE" })
128
134
  };
129
135
  }
130
136
  // src/utils.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/vercel-client",
3
- "version": "1.58.0-alpha.64",
3
+ "version": "1.58.0-alpha.65",
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.64",
35
+ "@theholocron/http-client": "^1.58.0-alpha.65",
36
36
  "@theholocron/observability": "^0.7.0-alpha.8"
37
37
  },
38
38
  "devDependencies": {