@kumori/aurora-backend-handler 1.1.104 → 1.1.106
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/account-api-service.ts +13 -13
- package/api/deploy-service-helper.ts +11 -34
- package/api/environment-api-service.ts +19 -19
- package/api/marketplace-api-service.ts +5 -5
- package/api/resources-api-service.ts +33 -33
- package/api/service-api-service.ts +28 -28
- package/api/tenant-api-service.ts +60 -60
- package/api/user-api-service.ts +10 -10
- package/backend-handler.ts +20 -21
- package/helpers/account-helper.ts +10 -9
- package/helpers/environment-helper.ts +7 -6
- package/helpers/token-helper.ts +3 -3
- package/helpers/user-helper.ts +4 -5
- package/package.json +3 -3
- package/test/deploy-service-helper.test.ts +0 -9
- package/websocket-manager.ts +5 -20
package/api/user-api-service.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Account,
|
|
9
9
|
Container,
|
|
10
10
|
Environment,
|
|
11
|
-
|
|
11
|
+
getWuiErrorCode,
|
|
12
12
|
Instance,
|
|
13
13
|
MarketplaceItem,
|
|
14
14
|
Organization,
|
|
@@ -1048,7 +1048,7 @@ export const updateUser = async (user: User) => {
|
|
|
1048
1048
|
spec: {
|
|
1049
1049
|
name: user.name,
|
|
1050
1050
|
surname: user.surname,
|
|
1051
|
-
discoveryMethod:
|
|
1051
|
+
discoveryMethod: user.discoveryMethod,
|
|
1052
1052
|
companyName: user.companyName,
|
|
1053
1053
|
companyRole: user.rol,
|
|
1054
1054
|
},
|
|
@@ -1063,10 +1063,10 @@ export const updateUser = async (user: User) => {
|
|
|
1063
1063
|
eventHelper.user.publish.updated(user);
|
|
1064
1064
|
eventHelper.notification.publish.creation({
|
|
1065
1065
|
type: "success",
|
|
1066
|
-
subtype:
|
|
1066
|
+
subtype: "user-updated",
|
|
1067
1067
|
date: Date.now().toString(),
|
|
1068
1068
|
status: "unread",
|
|
1069
|
-
|
|
1069
|
+
notificationType: "regular",
|
|
1070
1070
|
data: { user: user.name },
|
|
1071
1071
|
});
|
|
1072
1072
|
} catch (error) {
|
|
@@ -1078,10 +1078,10 @@ export const updateUser = async (user: User) => {
|
|
|
1078
1078
|
eventHelper.user.publish.updateError(user);
|
|
1079
1079
|
eventHelper.notification.publish.creation({
|
|
1080
1080
|
type: "error",
|
|
1081
|
-
subtype:
|
|
1081
|
+
subtype: getWuiErrorCode("user", "modifyUserInfo", (error as any).error.code) ?? "user-update-error",
|
|
1082
1082
|
date: Date.now().toString(),
|
|
1083
1083
|
status: "unread",
|
|
1084
|
-
|
|
1084
|
+
notificationType: "regular",
|
|
1085
1085
|
info_content: {
|
|
1086
1086
|
code: (error as any).error.code,
|
|
1087
1087
|
message: (error as any).error.content,
|
|
@@ -1106,10 +1106,10 @@ export const deleteUSer = async (user: User, security: string) => {
|
|
|
1106
1106
|
);
|
|
1107
1107
|
eventHelper.notification.publish.creation({
|
|
1108
1108
|
type: "success",
|
|
1109
|
-
subtype:
|
|
1109
|
+
subtype: "user-deleted",
|
|
1110
1110
|
date: Date.now().toString(),
|
|
1111
1111
|
status: "unread",
|
|
1112
|
-
|
|
1112
|
+
notificationType: "regular",
|
|
1113
1113
|
data: { user: user.name },
|
|
1114
1114
|
});
|
|
1115
1115
|
return response;
|
|
@@ -1117,10 +1117,10 @@ export const deleteUSer = async (user: User, security: string) => {
|
|
|
1117
1117
|
console.error("Error deleting user:", error);
|
|
1118
1118
|
eventHelper.notification.publish.creation({
|
|
1119
1119
|
type: "error",
|
|
1120
|
-
subtype:
|
|
1120
|
+
subtype: getWuiErrorCode("user", "deleteUser", (error as any).error.code) ?? "user-delete-error",
|
|
1121
1121
|
date: Date.now().toString(),
|
|
1122
1122
|
status: "unread",
|
|
1123
|
-
|
|
1123
|
+
notificationType: "regular",
|
|
1124
1124
|
info_content: {
|
|
1125
1125
|
code: (error as any).error.code,
|
|
1126
1126
|
message: (error as any).error.content,
|
package/backend-handler.ts
CHANGED
|
@@ -68,7 +68,6 @@ import { getPlanProviders } from "./api/planProvider-api-service";
|
|
|
68
68
|
import {
|
|
69
69
|
Account,
|
|
70
70
|
Environment,
|
|
71
|
-
errors,
|
|
72
71
|
Link,
|
|
73
72
|
MarketplaceItem,
|
|
74
73
|
MarketplaceService,
|
|
@@ -612,10 +611,10 @@ export class BackendHandler {
|
|
|
612
611
|
const updatedCb = (data: string) => {
|
|
613
612
|
const upgradeNotification: Notification = {
|
|
614
613
|
type: "success",
|
|
615
|
-
subtype:
|
|
614
|
+
subtype: "plan-upgrade",
|
|
616
615
|
date: Date.now().toString(),
|
|
617
616
|
status: "unread",
|
|
618
|
-
|
|
617
|
+
notificationType: "regular",
|
|
619
618
|
data: {
|
|
620
619
|
plan: data,
|
|
621
620
|
},
|
|
@@ -642,10 +641,10 @@ export class BackendHandler {
|
|
|
642
641
|
const downgradedCb = (data: string) => {
|
|
643
642
|
const downgradeNotification: Notification = {
|
|
644
643
|
type: "success",
|
|
645
|
-
subtype:
|
|
644
|
+
subtype: "plan-downgrade",
|
|
646
645
|
date: Date.now().toString(),
|
|
647
646
|
status: "unread",
|
|
648
|
-
|
|
647
|
+
notificationType: "regular",
|
|
649
648
|
data: {
|
|
650
649
|
plan: data,
|
|
651
650
|
},
|
|
@@ -678,10 +677,10 @@ export class BackendHandler {
|
|
|
678
677
|
const createdCb = (data: Environment) => {
|
|
679
678
|
const envNotification: Notification = {
|
|
680
679
|
type: "success",
|
|
681
|
-
subtype:
|
|
680
|
+
subtype: "environment-created",
|
|
682
681
|
date: Date.now().toString(),
|
|
683
682
|
status: "unread",
|
|
684
|
-
|
|
683
|
+
notificationType: "regular",
|
|
685
684
|
data: {
|
|
686
685
|
environment: data.name,
|
|
687
686
|
account: data.account,
|
|
@@ -762,10 +761,10 @@ export class BackendHandler {
|
|
|
762
761
|
const deployedCb = (data: Service) => {
|
|
763
762
|
const deploymentSuccessNotification: Notification = {
|
|
764
763
|
type: "success",
|
|
765
|
-
subtype:
|
|
764
|
+
subtype: "deployment-success",
|
|
766
765
|
date: Date.now().toString(),
|
|
767
766
|
status: "unread",
|
|
768
|
-
|
|
767
|
+
notificationType: "regular",
|
|
769
768
|
data: {
|
|
770
769
|
service: data.name,
|
|
771
770
|
tenant: data.tenant,
|
|
@@ -777,7 +776,7 @@ export class BackendHandler {
|
|
|
777
776
|
const deploymentErrorCb = (data: Service) => {
|
|
778
777
|
const deploymentErrorNotification: Notification = {
|
|
779
778
|
type: "error",
|
|
780
|
-
subtype:
|
|
779
|
+
subtype: "deployment-error",
|
|
781
780
|
date: Date.now().toString(),
|
|
782
781
|
status: "unread",
|
|
783
782
|
info_content: {
|
|
@@ -785,7 +784,7 @@ export class BackendHandler {
|
|
|
785
784
|
message: data.error?.message || "",
|
|
786
785
|
timestamp: data.error?.timestamp || "",
|
|
787
786
|
},
|
|
788
|
-
|
|
787
|
+
notificationType: "regular",
|
|
789
788
|
data: {
|
|
790
789
|
service: data.name,
|
|
791
790
|
tenant: data.tenant,
|
|
@@ -798,10 +797,10 @@ export class BackendHandler {
|
|
|
798
797
|
deployService(data, token);
|
|
799
798
|
const deploymentSuccessNotification: Notification = {
|
|
800
799
|
type: "info",
|
|
801
|
-
subtype:
|
|
800
|
+
subtype: "deployment-in-progress",
|
|
802
801
|
date: Date.now().toString(),
|
|
803
802
|
status: "unread",
|
|
804
|
-
|
|
803
|
+
notificationType: "regular",
|
|
805
804
|
data: {
|
|
806
805
|
service: data.name,
|
|
807
806
|
tenant: data.tenant,
|
|
@@ -829,10 +828,10 @@ export class BackendHandler {
|
|
|
829
828
|
const updatedCb = (data: Service) => {
|
|
830
829
|
const deploymentNotification: Notification = {
|
|
831
830
|
type: "success",
|
|
832
|
-
subtype:
|
|
831
|
+
subtype: "deployment-updated",
|
|
833
832
|
date: Date.now().toString(),
|
|
834
833
|
status: "unread",
|
|
835
|
-
|
|
834
|
+
notificationType: "regular",
|
|
836
835
|
data: {
|
|
837
836
|
service: data.name,
|
|
838
837
|
tenant: data.tenant,
|
|
@@ -854,10 +853,10 @@ export class BackendHandler {
|
|
|
854
853
|
const deleteCb = (data: Service) => {
|
|
855
854
|
const deploymentNotification: Notification = {
|
|
856
855
|
type: "info",
|
|
857
|
-
subtype:
|
|
856
|
+
subtype: "deployment-deleting",
|
|
858
857
|
date: Date.now().toString(),
|
|
859
858
|
status: "unread",
|
|
860
|
-
|
|
859
|
+
notificationType: "regular",
|
|
861
860
|
data: {
|
|
862
861
|
service: data.name,
|
|
863
862
|
tenant: data.tenant,
|
|
@@ -874,10 +873,10 @@ export class BackendHandler {
|
|
|
874
873
|
const deletedCb = (data: Service) => {
|
|
875
874
|
const deploymentNotification: Notification = {
|
|
876
875
|
type: "success",
|
|
877
|
-
subtype:
|
|
876
|
+
subtype: "deployment-deleted",
|
|
878
877
|
date: Date.now().toString(),
|
|
879
878
|
status: "unread",
|
|
880
|
-
|
|
879
|
+
notificationType: "regular",
|
|
881
880
|
data: {
|
|
882
881
|
service: data.name,
|
|
883
882
|
tenant: data.tenant,
|
|
@@ -1090,10 +1089,10 @@ export class BackendHandler {
|
|
|
1090
1089
|
const deletedCb = (data: Resource) => {
|
|
1091
1090
|
const resourceNotification: Notification = {
|
|
1092
1091
|
type: "success",
|
|
1093
|
-
subtype:
|
|
1092
|
+
subtype: "resource-deleted",
|
|
1094
1093
|
date: Date.now().toString(),
|
|
1095
1094
|
status: "unread",
|
|
1096
|
-
|
|
1095
|
+
notificationType: "regular",
|
|
1097
1096
|
data: {
|
|
1098
1097
|
resource: data.name,
|
|
1099
1098
|
type: data.type,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account,
|
|
1
|
+
import { Account, getWuiErrorCode, Notification } from "@kumori/aurora-interfaces";
|
|
2
2
|
const CREDENTIAL_ERROR_CODES = new Set([
|
|
3
3
|
"_error_retrieving_credentials_",
|
|
4
4
|
"_invalid_account_credentials_",
|
|
@@ -289,10 +289,10 @@ export const handleAccountOperationSuccess = ({
|
|
|
289
289
|
shouldDelete: true,
|
|
290
290
|
notification: {
|
|
291
291
|
type: "success",
|
|
292
|
-
subtype:
|
|
292
|
+
subtype: "account-deleted",
|
|
293
293
|
date: Date.now().toString(),
|
|
294
294
|
status: "unread",
|
|
295
|
-
|
|
295
|
+
notificationType: "regular",
|
|
296
296
|
data: { account: originalData.name, tenant: originalData.tenant },
|
|
297
297
|
},
|
|
298
298
|
eventType: "deleted",
|
|
@@ -308,10 +308,10 @@ export const handleAccountOperationSuccess = ({
|
|
|
308
308
|
shouldDelete: false,
|
|
309
309
|
notification: {
|
|
310
310
|
type: "success",
|
|
311
|
-
subtype: isCreate ?
|
|
311
|
+
subtype: isCreate ? "account-created" : "account-updated",
|
|
312
312
|
date: Date.now().toString(),
|
|
313
313
|
status: "unread",
|
|
314
|
-
|
|
314
|
+
notificationType: "regular",
|
|
315
315
|
data: { account: updatedAccount.name, tenant: updatedAccount.tenant },
|
|
316
316
|
},
|
|
317
317
|
eventType: isCreate ? "created" : "updated",
|
|
@@ -326,7 +326,7 @@ export const handleAccountOperationSuccess = ({
|
|
|
326
326
|
subtype: "account-unknown",
|
|
327
327
|
date: Date.now().toString(),
|
|
328
328
|
status: "unread",
|
|
329
|
-
|
|
329
|
+
notificationType: "regular",
|
|
330
330
|
data: {},
|
|
331
331
|
},
|
|
332
332
|
eventType: null,
|
|
@@ -357,10 +357,11 @@ export const handleAccountOperationError = ({
|
|
|
357
357
|
const errorCode: string = error?.error?.code ?? error?.code ?? "";
|
|
358
358
|
const errorStatus = resolveErrorStatus(errorCode);
|
|
359
359
|
|
|
360
|
-
const
|
|
360
|
+
const errSubtype = isCreate ? "account-creation-error" : isUpdate ? "account-update-error" : "account-deletion-error";
|
|
361
|
+
const errMethod = isCreate ? "createAccount" : isUpdate ? "updateAccount" : "deleteAccount";
|
|
361
362
|
const notification: Notification = {
|
|
362
363
|
type: "error",
|
|
363
|
-
subtype:
|
|
364
|
+
subtype: getWuiErrorCode("account", errMethod, errorCode) ?? errSubtype,
|
|
364
365
|
date: Date.now().toString(),
|
|
365
366
|
status: "unread",
|
|
366
367
|
info_content: {
|
|
@@ -369,7 +370,7 @@ export const handleAccountOperationError = ({
|
|
|
369
370
|
error?.error?.content ?? error?.error?.message ?? "Unknown error",
|
|
370
371
|
timestamp: error?.error?.timestamp ?? Date.now().toString(),
|
|
371
372
|
},
|
|
372
|
-
|
|
373
|
+
notificationType: "regular",
|
|
373
374
|
data: {
|
|
374
375
|
account:
|
|
375
376
|
entityName || originalData?.name || originalData?.account || "unknown",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Environment,
|
|
1
|
+
import { Account, Environment, getWuiErrorCode, Notification } from "@kumori/aurora-interfaces";
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -184,10 +184,10 @@ export const handleEnvironmentOperationSuccess = ({
|
|
|
184
184
|
|
|
185
185
|
const envNotification: Notification = {
|
|
186
186
|
type: "success",
|
|
187
|
-
subtype:
|
|
187
|
+
subtype: "environment-cleaned",
|
|
188
188
|
date: Date.now().toString(),
|
|
189
189
|
status: "unread",
|
|
190
|
-
|
|
190
|
+
notificationType: "regular",
|
|
191
191
|
data: {
|
|
192
192
|
environment: envData.name,
|
|
193
193
|
account: envData.account,
|
|
@@ -249,10 +249,11 @@ export const handleEnvironmentOperationError = ({
|
|
|
249
249
|
? "updateError"
|
|
250
250
|
: "deletionError";
|
|
251
251
|
|
|
252
|
-
const
|
|
252
|
+
const envErrSubtype = action === "CREATE" ? "environment-creation-error" : action === "UPDATE" ? "environment-update-error" : "environment-deletion-error";
|
|
253
|
+
const envErrMethod = action === "CREATE" ? "createEnvironment" : action === "UPDATE" ? "updateEnvironment" : "deleteEnvironment";
|
|
253
254
|
const envErrorNotification: Notification = {
|
|
254
255
|
type: "error",
|
|
255
|
-
subtype:
|
|
256
|
+
subtype: getWuiErrorCode("environment", envErrMethod, error?.error?.code || "UNKNOWN_ERROR") ?? envErrSubtype,
|
|
256
257
|
date: Date.now().toString(),
|
|
257
258
|
status: "unread",
|
|
258
259
|
info_content: {
|
|
@@ -260,7 +261,7 @@ export const handleEnvironmentOperationError = ({
|
|
|
260
261
|
message: error?.error?.content || error?.error?.message || "Unknown error",
|
|
261
262
|
timestamp: error?.error?.timestamp || "",
|
|
262
263
|
},
|
|
263
|
-
|
|
264
|
+
notificationType: "regular",
|
|
264
265
|
data: {
|
|
265
266
|
environment: originalData.name,
|
|
266
267
|
account: originalData.account,
|
package/helpers/token-helper.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClusterToken,
|
|
1
|
+
import { ClusterToken, Notification, Token, UserData } from "@kumori/aurora-interfaces";
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
interface HandleTokenEventParams {
|
|
@@ -161,10 +161,10 @@ export const handleTokenDeletion = ({
|
|
|
161
161
|
|
|
162
162
|
const notification: Notification = {
|
|
163
163
|
type: "success",
|
|
164
|
-
subtype:
|
|
164
|
+
subtype: "token-deleted",
|
|
165
165
|
date: Date.now().toString(),
|
|
166
166
|
status: "unread",
|
|
167
|
-
|
|
167
|
+
notificationType: "regular",
|
|
168
168
|
data: {
|
|
169
169
|
tokenName: deletedToken.name,
|
|
170
170
|
tenant: deletedToken.tenant,
|
package/helpers/user-helper.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
errors,
|
|
3
2
|
Notification,
|
|
4
3
|
Plan,
|
|
5
4
|
Tenant,
|
|
@@ -62,9 +61,9 @@ export const handleUserEvent = ({
|
|
|
62
61
|
eventHelper.tenant.publish.deleted(tenantToDelete);
|
|
63
62
|
const tenantDeletedNotification: Notification = {
|
|
64
63
|
type: "success",
|
|
65
|
-
subtype:
|
|
64
|
+
subtype: "tenant-deleted",
|
|
66
65
|
date: Date.now().toString(),
|
|
67
|
-
|
|
66
|
+
notificationType: "regular",
|
|
68
67
|
status: "unread",
|
|
69
68
|
data: {
|
|
70
69
|
tenant: tenantToDelete.name,
|
|
@@ -76,9 +75,9 @@ export const handleUserEvent = ({
|
|
|
76
75
|
} else {
|
|
77
76
|
const userRemovedNotification: Notification = {
|
|
78
77
|
type: "info",
|
|
79
|
-
subtype:
|
|
78
|
+
subtype: "user-removed-from-tenant",
|
|
80
79
|
date: Date.now().toString(),
|
|
81
|
-
|
|
80
|
+
notificationType: "regular",
|
|
82
81
|
status: "unread",
|
|
83
82
|
data: {
|
|
84
83
|
tenant: tenantToDelete.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumori/aurora-backend-handler",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.106",
|
|
4
4
|
"description": "backend handler",
|
|
5
5
|
"main": "backend-handler.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"glob": "^11.0.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@kumori/aurora-interfaces": "^1.0.
|
|
15
|
-
"@kumori/kumori-dsl-generator": "1.0.
|
|
14
|
+
"@kumori/aurora-interfaces": "^1.0.31",
|
|
15
|
+
"@kumori/kumori-dsl-generator": "1.0.7",
|
|
16
16
|
"@kumori/kumori-module-generator": "^1.1.6",
|
|
17
17
|
"ts-node": "^10.9.2",
|
|
18
18
|
"uuid": "^11.1.0",
|
|
@@ -196,15 +196,6 @@ describe("handleParametersToGenerateData", () => {
|
|
|
196
196
|
expect(result.environment).toContainEqual({ varName: "res1", secret: "res1" });
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
-
it("maneja formResources de tipo secret con key (montado en path)", () => {
|
|
200
|
-
const result = handleParametersToGenerateData([], [
|
|
201
|
-
{ name: "mySuperSecretSecret", type: "secret", key: "/mysecret" },
|
|
202
|
-
]);
|
|
203
|
-
expect(result.resources).toContainEqual({ secret: { name: "mySuperSecretSecret" } });
|
|
204
|
-
expect(result.fileSystem).toContainEqual({ path: "/mysecret", resourceSecret: "mySuperSecretSecret" });
|
|
205
|
-
expect(result.environment).not.toContainEqual({ varName: "mySuperSecretSecret", secret: "mySuperSecretSecret" });
|
|
206
|
-
});
|
|
207
|
-
|
|
208
199
|
it("maneja formResources de tipo volume", () => {
|
|
209
200
|
const result = handleParametersToGenerateData([], [
|
|
210
201
|
{ name: "vol1", type: "volume", key: "/mnt/data" },
|
package/websocket-manager.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { v7 as uuidv7 } from "uuid";
|
|
2
2
|
import { environment } from "./environment";
|
|
3
|
-
import { AccountStatus } from "@kumori/aurora-interfaces/enums/accountStatusEnum";
|
|
4
3
|
import {
|
|
5
4
|
Account,
|
|
6
5
|
Channel,
|
|
7
6
|
ClusterToken,
|
|
8
7
|
Environment,
|
|
9
|
-
errors,
|
|
10
8
|
Instance,
|
|
11
9
|
MarketplaceItem,
|
|
12
10
|
Notification,
|
|
@@ -663,17 +661,6 @@ export const closeGlobalWebSocketConnection = () => {
|
|
|
663
661
|
});
|
|
664
662
|
};
|
|
665
663
|
|
|
666
|
-
const computePromotionInfo = (
|
|
667
|
-
tenants: Tenant[],
|
|
668
|
-
): { completedSteps: number; remainingDays: number } => {
|
|
669
|
-
const hasValidCredentialsAccount = tenants.some((tenant) =>
|
|
670
|
-
tenant.accounts?.some((account) => account.status === AccountStatus.ACTIVE),
|
|
671
|
-
);
|
|
672
|
-
const hasDeployedService = tenants.some((tenant) => tenant.services?.length > 0);
|
|
673
|
-
const completedSteps = (hasValidCredentialsAccount ? 1 : 0) + (hasDeployedService ? 1 : 0);
|
|
674
|
-
return { completedSteps, remainingDays: 7 };
|
|
675
|
-
};
|
|
676
|
-
|
|
677
664
|
const rebuildHierarchy = () => {
|
|
678
665
|
const preservedUserData = { ...userData };
|
|
679
666
|
|
|
@@ -728,7 +715,6 @@ const rebuildHierarchy = () => {
|
|
|
728
715
|
notifications: preservedUserData.notifications || [],
|
|
729
716
|
plans: preservedUserData.plans || [],
|
|
730
717
|
discoveryMethod: preservedUserData.discoveryMethod,
|
|
731
|
-
promotionInfo: computePromotionInfo(Array.from(tenantsMap.values())),
|
|
732
718
|
};
|
|
733
719
|
};
|
|
734
720
|
const handleEvent = async (message: WSMessage) => {
|
|
@@ -961,7 +947,7 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
961
947
|
) {
|
|
962
948
|
const roleNotification: Notification = {
|
|
963
949
|
type: "info",
|
|
964
|
-
subtype:
|
|
950
|
+
subtype: "tenant-role-changed",
|
|
965
951
|
date: Date.now().toString(),
|
|
966
952
|
status: "unread",
|
|
967
953
|
notificationType: "regular",
|
|
@@ -1763,7 +1749,7 @@ const handleDeleteEvent = async (message: WSMessage) => {
|
|
|
1763
1749
|
eventHelper.environment.publish.deleted(deletedEnv);
|
|
1764
1750
|
const envNotification: Notification = {
|
|
1765
1751
|
type: "success",
|
|
1766
|
-
subtype:
|
|
1752
|
+
subtype: "environment-deleted",
|
|
1767
1753
|
date: Date.now().toString(),
|
|
1768
1754
|
notificationType: "regular",
|
|
1769
1755
|
status: "unread",
|
|
@@ -1783,7 +1769,7 @@ const handleDeleteEvent = async (message: WSMessage) => {
|
|
|
1783
1769
|
eventHelper.account.publish.deleted(deletedAccount);
|
|
1784
1770
|
const accountNotification: Notification = {
|
|
1785
1771
|
type: "success",
|
|
1786
|
-
subtype:
|
|
1772
|
+
subtype: "account-deleted",
|
|
1787
1773
|
date: Date.now().toString(),
|
|
1788
1774
|
notificationType: "regular",
|
|
1789
1775
|
status: "unread",
|
|
@@ -1921,7 +1907,7 @@ const handleDeleteEvent = async (message: WSMessage) => {
|
|
|
1921
1907
|
tenantsMap.set(tenantName, registryTenant);
|
|
1922
1908
|
const registryNotification: Notification = {
|
|
1923
1909
|
type: "success",
|
|
1924
|
-
subtype:
|
|
1910
|
+
subtype: "registry-deleted",
|
|
1925
1911
|
date: Date.now().toString(),
|
|
1926
1912
|
status: "unread",
|
|
1927
1913
|
notificationType: "regular",
|
|
@@ -1977,7 +1963,7 @@ const handleDeleteEvent = async (message: WSMessage) => {
|
|
|
1977
1963
|
if (deletedLinkInfo) {
|
|
1978
1964
|
const unlinkNotification: Notification = {
|
|
1979
1965
|
type: "success",
|
|
1980
|
-
subtype:
|
|
1966
|
+
subtype: "service-unlinked",
|
|
1981
1967
|
date: Date.now().toString(),
|
|
1982
1968
|
status: "unread",
|
|
1983
1969
|
notificationType: "regular",
|
|
@@ -2164,7 +2150,6 @@ export const updateUserComplete = (updatedUserData: UserData): User => {
|
|
|
2164
2150
|
status: updatedUserData.status,
|
|
2165
2151
|
discoveryMethod:
|
|
2166
2152
|
updatedUserData.discoveryMethod || userData.discoveryMethod,
|
|
2167
|
-
promotionInfo: computePromotionInfo(updatedUserData.tenants || userData.tenants || []),
|
|
2168
2153
|
};
|
|
2169
2154
|
user = new User(
|
|
2170
2155
|
userData,
|