@devpad/api 2.2.0 → 2.2.1

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.ts CHANGED
@@ -98,7 +98,10 @@ declare class ApiClient {
98
98
  }>>;
99
99
  keys: {
100
100
  list: () => Promise<ApiResult<ApiKey[]>>;
101
- create: (name?: string) => Promise<ApiResult<{
101
+ create: (input?: string | {
102
+ name?: string;
103
+ scope?: "devpad" | "blog" | "media" | "pulse" | "all";
104
+ }) => Promise<ApiResult<{
102
105
  message: string;
103
106
  key: {
104
107
  key: ApiKey;
package/dist/index.js CHANGED
@@ -421,11 +421,12 @@ var ApiClient2 = class {
421
421
  ),
422
422
  keys: {
423
423
  list: () => wrap(() => this.clients.auth.get("/keys")),
424
- create: (name) => wrap(
425
- () => this.clients.auth.post("/keys", {
426
- body: name ? { name } : {}
427
- })
428
- ),
424
+ create: (input) => {
425
+ const body = typeof input === "string" ? { name: input } : input ?? {};
426
+ return wrap(
427
+ () => this.clients.auth.post("/keys", { body })
428
+ );
429
+ },
429
430
  revoke: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`)),
430
431
  remove: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`))
431
432
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devpad/api",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "author": {
5
5
  "name": "f0rbit",
6
6
  "url": "https://github.com/f0rbit"
@@ -27,7 +27,7 @@
27
27
  "zod": "^3.22.4"
28
28
  },
29
29
  "devDependencies": {
30
- "@devpad/schema": "^2.2.0",
30
+ "@devpad/schema": "^2.2.1",
31
31
  "@types/node": "^20.11.24",
32
32
  "bun-types": "latest",
33
33
  "eslint": "^8.57.0",