@devpad/api 2.2.0 → 2.2.3
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 +4 -1
- package/dist/index.js +7 -6
- package/package.json +2 -2
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: (
|
|
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: (
|
|
425
|
-
|
|
426
|
-
|
|
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
|
}
|
|
@@ -1096,7 +1097,7 @@ var ApiClient2 = class {
|
|
|
1096
1097
|
tags: new ApiClient({ ...clientOptions, category: "tags" }),
|
|
1097
1098
|
blog: new ApiClient({ ...clientOptions, category: "blog" }),
|
|
1098
1099
|
media: new ApiClient({ ...clientOptions, category: "media" }),
|
|
1099
|
-
pulse: new ApiClient({ ...clientOptions, category: "pulse" })
|
|
1100
|
+
pulse: new ApiClient({ ...clientOptions, base_url: `${base_url}/pulse`, category: "pulse" })
|
|
1100
1101
|
};
|
|
1101
1102
|
}
|
|
1102
1103
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devpad/api",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
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.
|
|
30
|
+
"@devpad/schema": "^2.2.3",
|
|
31
31
|
"@types/node": "^20.11.24",
|
|
32
32
|
"bun-types": "latest",
|
|
33
33
|
"eslint": "^8.57.0",
|