@ysgroup/core 0.1.8 → 0.1.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/rest.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ysgroup/core",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/rest.ts CHANGED
@@ -213,9 +213,10 @@ export class YsRest {
213
213
  getUserApps(id: string) {
214
214
  return this.request<{ app_id: string; admin: boolean }[]>("GET", `/api/users/${id}/apps`);
215
215
  }
216
- setUserApps(id: string, grants: { app_id: string; admin: boolean }[]) {
216
+ setUserApps(id: string, grants: { app_id: string; admin: boolean }[], reason = "") {
217
217
  return this.request<{ grants: { app_id: string; admin: boolean }[] }>("PUT", `/api/users/${id}/apps`, {
218
218
  grants,
219
+ reason,
219
220
  });
220
221
  }
221
222
  uploadOpenAccountConfirmation(ownerId: string, file: File) {
@@ -237,8 +238,8 @@ export class YsRest {
237
238
  getRelations(entity: "owners" | "accounts", id: string, relation: "apps" | "strategies") {
238
239
  return this.request<{ ids: string[] }>("GET", `/api/${entity}/${id}/relations/${relation}`);
239
240
  }
240
- setRelations(entity: "owners" | "accounts", id: string, relation: "apps" | "strategies", ids: string[]) {
241
- return this.request<{ ids: string[] }>("PUT", `/api/${entity}/${id}/relations/${relation}`, { ids });
241
+ setRelations(entity: "owners" | "accounts", id: string, relation: "apps" | "strategies", ids: string[], reason = "") {
242
+ return this.request<{ ids: string[] }>("PUT", `/api/${entity}/${id}/relations/${relation}`, { ids, reason });
242
243
  }
243
244
  listOwnerFiles(ownerId: string) {
244
245
  return this.request<Record<string, unknown>[]>("GET", `/api/owners/${ownerId}/files`);