@pelican.ts/sdk 0.3.3-next.5 → 0.3.3-next.6
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.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/api/application/users.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -1551,16 +1551,16 @@ var Users = class {
|
|
|
1551
1551
|
};
|
|
1552
1552
|
apiKeys = {
|
|
1553
1553
|
list: async (id) => {
|
|
1554
|
-
const { data } = await this.r.get(`/users/${id}/
|
|
1554
|
+
const { data } = await this.r.get(`/users/${id}/api-keys`);
|
|
1555
1555
|
return data.data.map((k) => k.attributes);
|
|
1556
1556
|
},
|
|
1557
1557
|
create: async (id, description, allowed_ips) => {
|
|
1558
1558
|
allowed_ips = import_zod7.default.array(import_zod7.default.ipv4()).optional().parse(allowed_ips);
|
|
1559
|
-
const { data } = await this.r.post(`/users/${id}/
|
|
1559
|
+
const { data } = await this.r.post(`/users/${id}/api-keys`, { description, allowed_ips });
|
|
1560
1560
|
return { ...data.attributes, secret_token: data.meta.secret_token };
|
|
1561
1561
|
},
|
|
1562
1562
|
delete: async (id, identifier) => {
|
|
1563
|
-
await this.r.delete(`/users/${id}/
|
|
1563
|
+
await this.r.delete(`/users/${id}/api-keys/${identifier}`);
|
|
1564
1564
|
}
|
|
1565
1565
|
};
|
|
1566
1566
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1514,16 +1514,16 @@ var Users = class {
|
|
|
1514
1514
|
};
|
|
1515
1515
|
apiKeys = {
|
|
1516
1516
|
list: async (id) => {
|
|
1517
|
-
const { data } = await this.r.get(`/users/${id}/
|
|
1517
|
+
const { data } = await this.r.get(`/users/${id}/api-keys`);
|
|
1518
1518
|
return data.data.map((k) => k.attributes);
|
|
1519
1519
|
},
|
|
1520
1520
|
create: async (id, description, allowed_ips) => {
|
|
1521
1521
|
allowed_ips = z7.array(z7.ipv4()).optional().parse(allowed_ips);
|
|
1522
|
-
const { data } = await this.r.post(`/users/${id}/
|
|
1522
|
+
const { data } = await this.r.post(`/users/${id}/api-keys`, { description, allowed_ips });
|
|
1523
1523
|
return { ...data.attributes, secret_token: data.meta.secret_token };
|
|
1524
1524
|
},
|
|
1525
1525
|
delete: async (id, identifier) => {
|
|
1526
|
-
await this.r.delete(`/users/${id}/
|
|
1526
|
+
await this.r.delete(`/users/${id}/api-keys/${identifier}`);
|
|
1527
1527
|
}
|
|
1528
1528
|
};
|
|
1529
1529
|
};
|
package/package.json
CHANGED
|
@@ -96,7 +96,7 @@ export class Users {
|
|
|
96
96
|
list: async (id: number): Promise<ApplicationUserApiKey[]> => {
|
|
97
97
|
const {data} = await this.r.get<
|
|
98
98
|
GenericListResponse<GenericResponse<ApplicationUserApiKey, "api_key">>
|
|
99
|
-
>(`/users/${id}/
|
|
99
|
+
>(`/users/${id}/api-keys`)
|
|
100
100
|
return data.data.map(k => k.attributes)
|
|
101
101
|
},
|
|
102
102
|
|
|
@@ -104,12 +104,12 @@ export class Users {
|
|
|
104
104
|
allowed_ips = z.array(z.ipv4()).optional().parse(allowed_ips)
|
|
105
105
|
const {data} = await this.r.post<
|
|
106
106
|
GenericResponse<ApplicationUserApiKey, "api_key", { secret_token: string }>
|
|
107
|
-
>(`/users/${id}/
|
|
107
|
+
>(`/users/${id}/api-keys`, {description, allowed_ips})
|
|
108
108
|
return {...data.attributes, secret_token: data.meta!.secret_token}
|
|
109
109
|
},
|
|
110
110
|
|
|
111
111
|
delete: async (id: number, identifier: string): Promise<void> => {
|
|
112
|
-
await this.r.delete(`/users/${id}/
|
|
112
|
+
await this.r.delete(`/users/${id}/api-keys/${identifier}`)
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|