@kumori/aurora-backend-handler 1.1.33 → 1.1.36

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.
@@ -524,14 +524,6 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
524
524
  eventHelper.notification.publish.creation(tenantUpdateErrorNotification);
525
525
  }
526
526
  };
527
- export const listTenantsHTTP = async () => {
528
- const url = new URL(
529
- `${environment.apiServer.baseUrl}/api/${environment.apiServer.apiVersion}/tenant`
530
- );
531
- const response = await fetch(url.toString(), {
532
- method: "GET",
533
- });
534
- }
535
527
 
536
528
  export const createRegistry = async (
537
529
  tenant: Tenant,
@@ -1131,3 +1131,21 @@ export const deleteUSer = async (user: User, security: string) => {
1131
1131
  throw error;
1132
1132
  }
1133
1133
  };
1134
+ export const getUserHTTP = async () => {
1135
+ try {
1136
+ const url = new URL(
1137
+ `${environment.apiServer.baseUrl}/api/${environment.apiServer.apiVersion}/user/info`,
1138
+ );
1139
+ const response = await fetch(url.toString(), {
1140
+ method: "GET",
1141
+ headers: {
1142
+ },
1143
+ credentials: "include",
1144
+ });
1145
+ const userData = await response.json();
1146
+ return userData;
1147
+ } catch (error) {
1148
+ console.error("Error fetching user data:", error);
1149
+ throw error;
1150
+ }
1151
+ };
@@ -4,6 +4,7 @@ import {
4
4
  isUserLogged,
5
5
  updateUser,
6
6
  deleteUSer,
7
+ getUserHTTP,
7
8
  } from "./api/user-api-service";
8
9
  import {
9
10
  changeRevision,
@@ -37,7 +38,6 @@ import {
37
38
  deleteTenant,
38
39
  deleteToken,
39
40
  inviteUser,
40
- listTenantsHTTP,
41
41
  rejectInvite,
42
42
  removeUser,
43
43
  updateRegistry,
@@ -99,7 +99,9 @@ export class BackendHandler {
99
99
  );
100
100
  }
101
101
  eventHelper = new EventHelper(globalEventHandler);
102
- listTenantsHTTP().then(() => {
102
+ environment.apiServer.baseUrl = baseUrl;
103
+ environment.apiServer.apiVersion = apiVersion;
104
+ getUserHTTP().then(() => {
103
105
  eventHelper.user.subscribe.load((data: UserData) => {
104
106
  initializeGlobalWebSocketClient(token, "", "", data);
105
107
  });
@@ -107,10 +109,8 @@ export class BackendHandler {
107
109
  updateUserComplete(data);
108
110
  };
109
111
  eventHelper.user.subscribe.loaded(loadedCb);
110
- this.changeRoute(route);
111
- environment.apiServer.baseUrl = baseUrl;
112
- environment.apiServer.apiVersion = apiVersion;
113
- });
112
+ })
113
+ this.changeRoute(route);
114
114
  }
115
115
 
116
116
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.1.33",
3
+ "version": "1.1.36",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {