@ysgroup/core 0.1.4 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ysgroup/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -16,4 +16,4 @@
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  }
19
- }
19
+ }
package/src/rest.ts CHANGED
@@ -211,11 +211,11 @@ export class YsRest {
211
211
  return this.request("DELETE", `/api/users/${id}`);
212
212
  }
213
213
  getUserApps(id: string) {
214
- return this.request<string[]>("GET", `/api/users/${id}/apps`);
214
+ return this.request<{ app_id: string; admin: boolean }[]>("GET", `/api/users/${id}/apps`);
215
215
  }
216
- setUserApps(id: string, appIds: string[]) {
217
- return this.request<{ app_ids: string[] }>("PUT", `/api/users/${id}/apps`, {
218
- app_ids: appIds,
216
+ setUserApps(id: string, grants: { app_id: string; admin: boolean }[]) {
217
+ return this.request<{ grants: { app_id: string; admin: boolean }[] }>("PUT", `/api/users/${id}/apps`, {
218
+ grants,
219
219
  });
220
220
  }
221
221
  uploadOpenAccountConfirmation(ownerId: string, file: File) {
package/src/store.ts CHANGED
@@ -181,8 +181,11 @@ export const useYsStore = defineStore("ys", () => {
181
181
  localStorage.setItem(LS_ACCESS, result.access_token);
182
182
  localStorage.setItem(LS_REFRESH, result.refresh_token);
183
183
  scheduleRenew(result.access_expires_in);
184
- } catch {
184
+ } catch (error) {
185
185
  clearSession();
186
+ sessionMessage.value = String(error)
187
+ .replace(/^Error:\s*/, "")
188
+ .replace(/^\[\d+\]\s*/, "");
186
189
  }
187
190
  }
188
191