@kumori/aurora-backend-handler 1.1.32 → 1.1.35
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/api/tenant-api-service.ts +0 -8
- package/api/user-api-service.ts +18 -0
- package/backend-handler.ts +11 -11
- package/package.json +1 -1
|
@@ -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 = () => {
|
|
528
|
-
const url = new URL(
|
|
529
|
-
`${environment.apiServer.baseUrl}/api/${environment.apiServer.apiVersion}/tenant`
|
|
530
|
-
);
|
|
531
|
-
const response = fetch(url.toString(), {
|
|
532
|
-
method: "GET",
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
527
|
|
|
536
528
|
export const createRegistry = async (
|
|
537
529
|
tenant: Tenant,
|
package/api/user-api-service.ts
CHANGED
|
@@ -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
|
+
};
|
package/backend-handler.ts
CHANGED
|
@@ -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,18 +99,18 @@ export class BackendHandler {
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
eventHelper = new EventHelper(globalEventHandler);
|
|
102
|
-
eventHelper.user.subscribe.load((data: UserData) => {
|
|
103
|
-
listTenantsHTTP();
|
|
104
|
-
initializeGlobalWebSocketClient(token, "", "", data);
|
|
105
|
-
});
|
|
106
|
-
const loadedCb = (data: UserData) => {
|
|
107
|
-
updateUserComplete(data);
|
|
108
|
-
};
|
|
109
|
-
eventHelper.user.subscribe.loaded(loadedCb);
|
|
110
|
-
|
|
111
|
-
this.changeRoute(route);
|
|
112
102
|
environment.apiServer.baseUrl = baseUrl;
|
|
113
103
|
environment.apiServer.apiVersion = apiVersion;
|
|
104
|
+
getUserHTTP().then(() => {
|
|
105
|
+
eventHelper.user.subscribe.load((data: UserData) => {
|
|
106
|
+
initializeGlobalWebSocketClient(token, "", "", data);
|
|
107
|
+
});
|
|
108
|
+
const loadedCb = (data: UserData) => {
|
|
109
|
+
updateUserComplete(data);
|
|
110
|
+
};
|
|
111
|
+
eventHelper.user.subscribe.loaded(loadedCb);
|
|
112
|
+
this.changeRoute(route);
|
|
113
|
+
})
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|