@kumori/aurora-backend-handler 1.0.99 → 1.0.111
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/.gitlab-ci.yml +21 -21
- package/CHANGELOG.md +10 -0
- package/api/account-api-service.ts +31 -23
- package/api/deploy-service-helper.ts +84 -68
- package/api/environment-api-service.ts +15 -10
- package/api/marketplace-api-service.ts +31 -80
- package/api/resources-api-service.ts +20 -20
- package/api/service-api-service.ts +18 -14
- package/api/tenant-api-service.ts +130 -242
- package/api/user-api-service.ts +24 -9
- package/backend-handler.ts +374 -348
- package/developer.md +998 -0
- package/event-helper.ts +13 -3
- package/event-names.ts +3 -0
- package/helpers/account-helper.ts +12 -13
- package/helpers/environment-helper.ts +25 -29
- package/helpers/marketplace-helper.ts +109 -0
- package/helpers/resource-helper.ts +19 -1
- package/helpers/revision-helper.ts +68 -18
- package/helpers/service-helper.ts +49 -33
- package/helpers/tenant-helper.ts +0 -5
- package/helpers/token-helper.ts +74 -2
- package/helpers/user-helper.ts +72 -32
- package/jest.config.ts +1 -0
- package/package.json +3 -3
- package/test/backend-handler.test.ts +992 -730
- package/test/deploy-service-helper.test.ts +707 -273
- package/test/event-helper.test.ts +489 -104
- package/test/event-names.test.ts +186 -0
- package/websocket-manager.ts +394 -69
package/api/user-api-service.ts
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
Account,
|
|
9
9
|
Container,
|
|
10
10
|
Environment,
|
|
11
|
+
errors,
|
|
11
12
|
Instance,
|
|
12
13
|
MarketplaceItem,
|
|
13
|
-
Notification,
|
|
14
14
|
Organization,
|
|
15
15
|
Platform,
|
|
16
16
|
Registry,
|
|
@@ -94,6 +94,7 @@ export const loadUserData = async () => {
|
|
|
94
94
|
|
|
95
95
|
const userData: UserData = {
|
|
96
96
|
id: userResponse.userRecord.id.name,
|
|
97
|
+
created: userResponse.userRecord.meta.created,
|
|
97
98
|
name: userResponse.userRecord.spec.userinfo.name,
|
|
98
99
|
surname: userResponse.userRecord.spec.userinfo.surname,
|
|
99
100
|
provider: [{ name: provider, email: email || "", password: "" }],
|
|
@@ -170,10 +171,6 @@ export const loadUserData = async () => {
|
|
|
170
171
|
if (tenantData?.domains && Object.keys(tenantData.domains)[0])
|
|
171
172
|
registry.name = Object.keys(tenantData.domains)[0];
|
|
172
173
|
tenant.registry.push(registry);
|
|
173
|
-
} else {
|
|
174
|
-
console.warn(
|
|
175
|
-
`No se encontró información de registry para el tenant ${tenant.name}`,
|
|
176
|
-
);
|
|
177
174
|
}
|
|
178
175
|
|
|
179
176
|
const tenantAccounts: Account[] = [];
|
|
@@ -1067,7 +1064,7 @@ export const updateUser = async (user: User) => {
|
|
|
1067
1064
|
eventHelper.user.publish.updated(user);
|
|
1068
1065
|
eventHelper.notification.publish.creation({
|
|
1069
1066
|
type: "success",
|
|
1070
|
-
subtype:
|
|
1067
|
+
subtype: errors.user.updated.subtype,
|
|
1071
1068
|
date: Date.now().toString(),
|
|
1072
1069
|
status: "unread",
|
|
1073
1070
|
callToAction: false,
|
|
@@ -1082,7 +1079,7 @@ export const updateUser = async (user: User) => {
|
|
|
1082
1079
|
eventHelper.user.publish.updateError(user);
|
|
1083
1080
|
eventHelper.notification.publish.creation({
|
|
1084
1081
|
type: "error",
|
|
1085
|
-
subtype:
|
|
1082
|
+
subtype: errors.user.updateError.subtype,
|
|
1086
1083
|
date: Date.now().toString(),
|
|
1087
1084
|
status: "unread",
|
|
1088
1085
|
callToAction: false,
|
|
@@ -1110,7 +1107,7 @@ export const deleteUSer = async (user: User, security: string) => {
|
|
|
1110
1107
|
);
|
|
1111
1108
|
eventHelper.notification.publish.creation({
|
|
1112
1109
|
type: "success",
|
|
1113
|
-
subtype:
|
|
1110
|
+
subtype: errors.user.deleted.subtype,
|
|
1114
1111
|
date: Date.now().toString(),
|
|
1115
1112
|
status: "unread",
|
|
1116
1113
|
callToAction: false,
|
|
@@ -1121,7 +1118,7 @@ export const deleteUSer = async (user: User, security: string) => {
|
|
|
1121
1118
|
console.error("Error deleting user:", error);
|
|
1122
1119
|
eventHelper.notification.publish.creation({
|
|
1123
1120
|
type: "error",
|
|
1124
|
-
subtype:
|
|
1121
|
+
subtype: errors.user.deleteError.subtype,
|
|
1125
1122
|
date: Date.now().toString(),
|
|
1126
1123
|
status: "unread",
|
|
1127
1124
|
callToAction: false,
|
|
@@ -1135,3 +1132,21 @@ export const deleteUSer = async (user: User, security: string) => {
|
|
|
1135
1132
|
throw error;
|
|
1136
1133
|
}
|
|
1137
1134
|
};
|
|
1135
|
+
export const getUserHTTP = async () => {
|
|
1136
|
+
try {
|
|
1137
|
+
const url = new URL(
|
|
1138
|
+
`${environment.apiServer.baseUrl}/api/${environment.apiServer.apiVersion}/user/info`,
|
|
1139
|
+
);
|
|
1140
|
+
const response = await fetch(url.toString(), {
|
|
1141
|
+
method: "GET",
|
|
1142
|
+
headers: {
|
|
1143
|
+
},
|
|
1144
|
+
credentials: "include",
|
|
1145
|
+
});
|
|
1146
|
+
const userData = await response.json();
|
|
1147
|
+
return userData;
|
|
1148
|
+
} catch (error) {
|
|
1149
|
+
console.error("Error fetching user data:", error);
|
|
1150
|
+
throw error;
|
|
1151
|
+
}
|
|
1152
|
+
};
|