@kumori/aurora-backend-handler 1.1.33 → 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 +5 -5
- 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 = 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,
|
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,7 +99,9 @@ export class BackendHandler {
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
eventHelper = new EventHelper(globalEventHandler);
|
|
102
|
-
|
|
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
|
});
|
|
@@ -108,9 +110,7 @@ export class BackendHandler {
|
|
|
108
110
|
};
|
|
109
111
|
eventHelper.user.subscribe.loaded(loadedCb);
|
|
110
112
|
this.changeRoute(route);
|
|
111
|
-
|
|
112
|
-
environment.apiServer.apiVersion = apiVersion;
|
|
113
|
-
});
|
|
113
|
+
})
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|