@kumori/aurora-backend-handler 1.1.96 → 1.1.98

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.
@@ -644,7 +644,7 @@ export const createAccount = async (account: Account, security: Security) => {
644
644
  },
645
645
  date: Date.now().toString(),
646
646
  status: "unread",
647
- notificationType: "regular",
647
+ callToAction: false,
648
648
  data: {
649
649
  account: account.name,
650
650
  tenant: account.tenant,
@@ -739,7 +739,7 @@ export const deleteAccount = async (account: Account, security: Security) => {
739
739
  subtype: errors.account.deleting.subtype,
740
740
  date: Date.now().toString(),
741
741
  status: "unread",
742
- notificationType: "regular",
742
+ callToAction: false,
743
743
  data: {
744
744
  account: account.name,
745
745
  tenant: account.tenant,
@@ -761,7 +761,7 @@ export const deleteAccount = async (account: Account, security: Security) => {
761
761
  message,
762
762
  },
763
763
  status: "unread",
764
- notificationType: "regular",
764
+ callToAction: false,
765
765
  data: {
766
766
  account: account.name,
767
767
  tenant: account.tenant,
@@ -800,7 +800,7 @@ export const clearAccount = async (account: Account, security: Security) => {
800
800
  subtype: errors.account.cleaned.subtype,
801
801
  date: Date.now().toString(),
802
802
  status: "unread",
803
- notificationType: "regular",
803
+ callToAction: false,
804
804
  data: {
805
805
  account: account.name,
806
806
  tenant: account.tenant,
@@ -822,7 +822,7 @@ export const clearAccount = async (account: Account, security: Security) => {
822
822
  message,
823
823
  },
824
824
  status: "unread",
825
- notificationType: "regular",
825
+ callToAction: false,
826
826
  data: {
827
827
  account: account.name,
828
828
  tenant: account.tenant,
@@ -1440,7 +1440,7 @@ export const updateAccount = async (account: Account, security: Security) => {
1440
1440
  message,
1441
1441
  },
1442
1442
  status: "unread",
1443
- notificationType: "regular",
1443
+ callToAction: false,
1444
1444
  data: {
1445
1445
  account: account.name,
1446
1446
  tenant: account.tenant,
@@ -227,13 +227,21 @@ interface Port<VARIANT> {
227
227
  interface Certificate<VARIANT> {
228
228
  certificate: VARIANT;
229
229
  }
230
- type ComponentFilesystemDto = FilesystemVolumeDto | FilesystemFileDto;
230
+ type ComponentFilesystemDto =
231
+ | FilesystemVolumeDto
232
+ | FilesystemSecretDto
233
+ | FilesystemFileDto;
231
234
 
232
235
  interface FilesystemVolumeDto {
233
236
  path: string;
234
237
  resourceVolume: string;
235
238
  }
236
239
 
240
+ interface FilesystemSecretDto {
241
+ path: string;
242
+ resourceSecret: string;
243
+ }
244
+
237
245
  interface FilesystemFileDto {
238
246
  path: string;
239
247
  param?: string;
@@ -412,10 +420,17 @@ export function handleParametersToGenerateData(
412
420
  switch (resource.type) {
413
421
  case "secret":
414
422
  resourcesResult.push({ secret: { name: resource.name } });
415
- environmentResult.push({
416
- varName: resource.name,
417
- secret: resource.name as string,
418
- });
423
+ if (resource.key) {
424
+ fileSystemResult.push({
425
+ path: resource.key,
426
+ resourceSecret: resource.name,
427
+ });
428
+ } else {
429
+ environmentResult.push({
430
+ varName: resource.name,
431
+ secret: resource.name as string,
432
+ });
433
+ }
419
434
  break;
420
435
  case "volume":
421
436
  resourcesResult.push({ volume: { name: resource.name } });
@@ -503,12 +518,20 @@ export function transformServiceToForm(service: Service): ServiceSpecForm {
503
518
  })),
504
519
  },
505
520
  environment: [service.environment],
506
- fileSystem: service.resources
507
- .filter((resource) => resource.type === "volume")
508
- .map((resource) => ({
509
- path: resource.key,
510
- resourceVolume: resource.name,
511
- })),
521
+ fileSystem: [
522
+ ...service.resources
523
+ .filter((resource) => resource.type === "volume")
524
+ .map((resource) => ({
525
+ path: resource.key,
526
+ resourceVolume: resource.name,
527
+ })),
528
+ ...service.resources
529
+ .filter((resource) => resource.type === "secret" && resource.key)
530
+ .map((resource) => ({
531
+ path: resource.key,
532
+ resourceSecret: resource.name,
533
+ })),
534
+ ],
512
535
  scaling: service.role[0].scalling,
513
536
  hsize: service.role[0].hsize
514
537
  };
@@ -139,7 +139,7 @@ export const createEnvironment = async (
139
139
  },
140
140
  date: Date.now().toString(),
141
141
  status: "unread",
142
- notificationType: "regular",
142
+ callToAction: false,
143
143
  data: {
144
144
  environment: env.name,
145
145
  account: env.account,
@@ -185,7 +185,7 @@ export const deleteEnvironment = async (
185
185
  subtype: errors.environment.deleting.subtype,
186
186
  date: Date.now().toString(),
187
187
  status: "unread",
188
- notificationType: "regular",
188
+ callToAction: false,
189
189
  data: {
190
190
  environment: env.name,
191
191
  account: env.account,
@@ -229,7 +229,7 @@ export const deleteEnvironment = async (
229
229
  },
230
230
  date: Date.now().toString(),
231
231
  status: "unread",
232
- notificationType: "regular",
232
+ callToAction: false,
233
233
  data: {
234
234
  environment: env.name,
235
235
  account: env.account,
@@ -252,7 +252,7 @@ export const clearEnvironment = async (
252
252
  subtype: errors.environment.purging.subtype,
253
253
  date: Date.now().toString(),
254
254
  status: "unread",
255
- notificationType: "regular",
255
+ callToAction: false,
256
256
  data: {
257
257
  environment: env.name,
258
258
  account: env.account,
@@ -321,7 +321,7 @@ export const clearEnvironment = async (
321
321
  },
322
322
  date: Date.now().toString(),
323
323
  status: "unread",
324
- notificationType: "regular",
324
+ callToAction: false,
325
325
  data: {
326
326
  environment: env.name,
327
327
  account: env.account,
@@ -415,7 +415,7 @@ export const updateEnvironment = async (
415
415
  subtype: errors.environment.updated.subtype,
416
416
  date: Date.now().toString(),
417
417
  status: "unread",
418
- notificationType: "regular",
418
+ callToAction: false,
419
419
  data: {
420
420
  environment: env.name,
421
421
  account: env.account,
@@ -459,7 +459,7 @@ export const updateEnvironment = async (
459
459
  },
460
460
  date: Date.now().toString(),
461
461
  status: "unread",
462
- notificationType: "regular",
462
+ callToAction: false,
463
463
  data: {
464
464
  environment: env.name,
465
465
  account: env.account,
@@ -500,7 +500,7 @@ export const scaleEnvironment = async (
500
500
  subtype: errors.environment.scaled.subtype,
501
501
  date: Date.now().toString(),
502
502
  status: "unread",
503
- notificationType: "regular",
503
+ callToAction: false,
504
504
  data: {
505
505
  environment: env.name,
506
506
  account: env.account,
@@ -538,7 +538,7 @@ export const scaleEnvironment = async (
538
538
  },
539
539
  date: Date.now().toString(),
540
540
  status: "unread",
541
- notificationType: "regular",
541
+ callToAction: false,
542
542
  data: {
543
543
  environment: env.name,
544
544
  account: env.account,
@@ -942,7 +942,7 @@ const linkPendingServices = async (service: Service, token: string) => {
942
942
  subtype: errors.service.linked.subtype,
943
943
  date: Date.now().toString(),
944
944
  status: "unread",
945
- notificationType: "regular",
945
+ callToAction: false,
946
946
  data: {
947
947
  service: service.name,
948
948
  tenant: service.tenant,
@@ -961,7 +961,7 @@ const linkPendingServices = async (service: Service, token: string) => {
961
961
  message: (linkErr as any).error.content,
962
962
  },
963
963
  status: "unread",
964
- notificationType: "regular",
964
+ callToAction: false,
965
965
  data: {
966
966
  service: service.name,
967
967
  tenant: service.tenant,
@@ -53,7 +53,7 @@ export const createDomain = async (
53
53
  subtype: errors.resource.created.subtype,
54
54
  date: Date.now().toString(),
55
55
  status: "unread",
56
- notificationType: "regular",
56
+ callToAction: false,
57
57
  data: {
58
58
  resource: domain.name,
59
59
  tenant: tenant
@@ -94,7 +94,7 @@ export const createDomain = async (
94
94
  },
95
95
  date: Date.now().toString(),
96
96
  status: "unread",
97
- notificationType: "regular",
97
+ callToAction: false,
98
98
  data: {
99
99
  resource: domain.name,
100
100
  tenant: tenant
@@ -133,7 +133,7 @@ export const createPort = async (
133
133
  subtype: errors.resource.created.subtype,
134
134
  date: Date.now().toString(),
135
135
  status: "unread",
136
- notificationType: "regular",
136
+ callToAction: false,
137
137
  data: {
138
138
  resource: port.name,
139
139
  tenant: tenant
@@ -174,7 +174,7 @@ export const createPort = async (
174
174
  },
175
175
  date: Date.now().toString(),
176
176
  status: "unread",
177
- notificationType: "regular",
177
+ callToAction: false,
178
178
  data: {
179
179
  resource: port.name,
180
180
  tenant: tenant
@@ -213,7 +213,7 @@ export const createCA = async (
213
213
  subtype: errors.resource.created.subtype,
214
214
  date: Date.now().toString(),
215
215
  status: "unread",
216
- notificationType: "regular",
216
+ callToAction: false,
217
217
  data: {
218
218
  resource: ca.name,
219
219
  tenant: tenant
@@ -254,7 +254,7 @@ export const createCA = async (
254
254
  },
255
255
  date: Date.now().toString(),
256
256
  status: "unread",
257
- notificationType: "regular",
257
+ callToAction: false,
258
258
  data: {
259
259
  resource: ca.name,
260
260
  tenant: tenant
@@ -306,7 +306,7 @@ export const createCertificate = async (
306
306
  subtype: errors.resource.created.subtype,
307
307
  date: Date.now().toString(),
308
308
  status: "unread",
309
- notificationType: "regular",
309
+ callToAction: false,
310
310
  data: {
311
311
  resource: certificate.name,
312
312
  tenant: tenant
@@ -347,7 +347,7 @@ export const createCertificate = async (
347
347
  },
348
348
  date: Date.now().toString(),
349
349
  status: "unread",
350
- notificationType: "regular",
350
+ callToAction: false,
351
351
  data: {
352
352
  resource: certificate.name,
353
353
  tenant: tenant
@@ -386,7 +386,7 @@ export const createSecret = async (
386
386
  subtype: errors.resource.created.subtype,
387
387
  date: Date.now().toString(),
388
388
  status: "unread",
389
- notificationType: "regular",
389
+ callToAction: false,
390
390
  data: {
391
391
  resource: secret.name,
392
392
  tenant: tenant
@@ -427,7 +427,7 @@ export const createSecret = async (
427
427
  },
428
428
  date: Date.now().toString(),
429
429
  status: "unread",
430
- notificationType: "regular",
430
+ callToAction: false,
431
431
  data: {
432
432
  resource: secret.name,
433
433
  tenant: tenant
@@ -486,7 +486,7 @@ export const createVolume = async (
486
486
  subtype: errors.resource.created.subtype,
487
487
  date: Date.now().toString(),
488
488
  status: "unread",
489
- notificationType: "regular",
489
+ callToAction: false,
490
490
  data: {
491
491
  resource: volume.name,
492
492
  tenant: tenant
@@ -527,7 +527,7 @@ export const createVolume = async (
527
527
  },
528
528
  date: Date.now().toString(),
529
529
  status: "unread",
530
- notificationType: "regular",
530
+ callToAction: false,
531
531
  data: {
532
532
  resource: volume.name,
533
533
  tenant: tenant
@@ -596,7 +596,7 @@ const deleteResourceBase = async (
596
596
  subtype: errors.resource.deleting.subtype,
597
597
  date: Date.now().toString(),
598
598
  status: "unread",
599
- notificationType: "regular",
599
+ callToAction: false,
600
600
  data: {
601
601
  resource: resource.name,
602
602
  type: resource.type,
@@ -633,7 +633,7 @@ const deleteResourceBase = async (
633
633
  },
634
634
  date: Date.now().toString(),
635
635
  status: "unread",
636
- notificationType: "regular",
636
+ callToAction: false,
637
637
  data: {
638
638
  resource: resource.name,
639
639
  type: resource.type,
@@ -691,7 +691,7 @@ const updateResourceBase = async (
691
691
  subtype: errors.resource.updated.subtype,
692
692
  date: Date.now().toString(),
693
693
  status: "unread",
694
- notificationType: "regular",
694
+ callToAction: false,
695
695
  data: {
696
696
  resource: resource.name,
697
697
  type: resource.type,
@@ -728,7 +728,7 @@ const updateResourceBase = async (
728
728
  },
729
729
  date: Date.now().toString(),
730
730
  status: "unread",
731
- notificationType: "regular",
731
+ callToAction: false,
732
732
  data: {
733
733
  resource: resource.name,
734
734
  type: resource.type,
@@ -352,7 +352,7 @@ export const linkPendingServices = async (service: Service, token: string) => {
352
352
  subtype: errors.service.linked.subtype,
353
353
  date: Date.now().toString(),
354
354
  status: "unread",
355
- notificationType: "regular",
355
+ callToAction: false,
356
356
  data: {
357
357
  service: service.name,
358
358
  tenant: service.tenant,
@@ -371,7 +371,7 @@ export const linkPendingServices = async (service: Service, token: string) => {
371
371
  message: (linkErr as any).error.content,
372
372
  },
373
373
  status: "unread",
374
- notificationType: "regular",
374
+ callToAction: false,
375
375
  data: {
376
376
  service: service.name,
377
377
  tenant: service.tenant,
@@ -615,7 +615,7 @@ export const updateService = async (
615
615
  subtype: errors.service.updated.subtype,
616
616
  date: Date.now().toString(),
617
617
  status: "unread",
618
- notificationType: "regular",
618
+ callToAction: false,
619
619
  data: {
620
620
  service: data.name,
621
621
  tenant: data.tenant,
@@ -636,7 +636,7 @@ export const updateService = async (
636
636
  message: (err as any).error.content,
637
637
  },
638
638
  status: "unread",
639
- notificationType: "regular",
639
+ callToAction: false,
640
640
  data: {
641
641
  service: data.name,
642
642
  tenant: data.tenant,
@@ -673,7 +673,7 @@ export const unlinkServices = async (service: Service, token: string) => {
673
673
  subtype: errors.service.unlinking.subtype,
674
674
  date: Date.now().toString(),
675
675
  status: "unread",
676
- notificationType: "regular",
676
+ callToAction: false,
677
677
  data: {
678
678
  service: service.name,
679
679
  tenant: service.tenant,
@@ -693,7 +693,7 @@ export const unlinkServices = async (service: Service, token: string) => {
693
693
  message: (unlinkErr as any).error.content,
694
694
  },
695
695
  status: "unread",
696
- notificationType: "regular",
696
+ callToAction: false,
697
697
  data: {
698
698
  service: service.name,
699
699
  tenant: service.tenant,
@@ -735,7 +735,7 @@ export const updateServiceLinks = async (link: Link, token: string) => {
735
735
  // subtype: "service-unlinked",
736
736
  // date: Date.now().toString(),
737
737
  // status: "unread",
738
- // notificationType: "regular",
738
+ // callToAction: false,
739
739
  // data: {
740
740
  // service: link.origin,
741
741
  // tenant: link.tenant,
@@ -755,7 +755,7 @@ export const updateServiceLinks = async (link: Link, token: string) => {
755
755
  message: (unlinkErr as any).error.content,
756
756
  },
757
757
  status: "unread",
758
- notificationType: "regular",
758
+ callToAction: false,
759
759
  data: {
760
760
  service: link.origin,
761
761
  tenant: link.tenant,
@@ -782,7 +782,7 @@ export const updateServiceLinks = async (link: Link, token: string) => {
782
782
  subtype: errors.service.linked.subtype,
783
783
  date: Date.now().toString(),
784
784
  status: "unread",
785
- notificationType: "regular",
785
+ callToAction: false,
786
786
  data: {
787
787
  service: link.origin,
788
788
  tenant: link.tenant,
@@ -801,7 +801,7 @@ export const updateServiceLinks = async (link: Link, token: string) => {
801
801
  message: (linkErr as any).error.content,
802
802
  },
803
803
  status: "unread",
804
- notificationType: "regular",
804
+ callToAction: false,
805
805
  data: {
806
806
  service: link.origin,
807
807
  tenant: link.tenant,
@@ -838,7 +838,7 @@ export const changeRevision = async (data: Service, token: string) => {
838
838
  subtype: errors.deployment.revisionUpdated.subtype,
839
839
  date: Date.now().toString(),
840
840
  status: "unread",
841
- notificationType: "regular",
841
+ callToAction: false,
842
842
  data: {
843
843
  service: data,
844
844
  },
@@ -855,7 +855,7 @@ export const changeRevision = async (data: Service, token: string) => {
855
855
  message: (error as any).error.content,
856
856
  },
857
857
  status: "unread",
858
- notificationType: "regular",
858
+ callToAction: false,
859
859
  data: {
860
860
  service: data,
861
861
  },
@@ -897,7 +897,7 @@ export async function restartInstance(
897
897
  subtype: errors.deployment.instanceRestarted.subtype,
898
898
  date: Date.now().toString(),
899
899
  status: "unread",
900
- notificationType: "regular",
900
+ callToAction: false,
901
901
  data: {
902
902
  service: service,
903
903
  },
@@ -914,7 +914,7 @@ export async function restartInstance(
914
914
  message: (error as any).error.content,
915
915
  },
916
916
  status: "unread",
917
- notificationType: "regular",
917
+ callToAction: false,
918
918
  data: {
919
919
  service: service,
920
920
  },
@@ -94,7 +94,7 @@ export const createTenant = async (tenant: Tenant, security: Security) => {
94
94
  subtype: errors.tenant.created.subtype,
95
95
  date: Date.now().toString(),
96
96
  status: "unread",
97
- notificationType: "regular",
97
+ callToAction: false,
98
98
  data: {
99
99
  tenant: tenant.name,
100
100
  },
@@ -119,7 +119,7 @@ export const createTenant = async (tenant: Tenant, security: Security) => {
119
119
  },
120
120
  date: Date.now().toString(),
121
121
  status: "unread",
122
- notificationType: "regular",
122
+ callToAction: false,
123
123
  data: {
124
124
  tenant: tenant.name,
125
125
  },
@@ -154,7 +154,7 @@ export const deleteTenant = async (tenant: Tenant, security: string) => {
154
154
  // subtype: "tenant-deleted",
155
155
  // date: Date.now().toString(),
156
156
  // status: "unread",
157
- // notificationType: "regular",
157
+ // callToAction: false,
158
158
  // };
159
159
  // eventHelper.notification.publish.creation(tenantDeletedNotification);
160
160
  return response;
@@ -171,7 +171,7 @@ export const deleteTenant = async (tenant: Tenant, security: string) => {
171
171
  },
172
172
  date: Date.now().toString(),
173
173
  status: "unread",
174
- notificationType: "regular",
174
+ callToAction: false,
175
175
  data: {
176
176
  tenant: tenant.name,
177
177
  },
@@ -230,7 +230,7 @@ export const updateTenant = async (tenant: Tenant, security: string) => {
230
230
  subtype: errors.tenant.updated.subtype,
231
231
  date: Date.now().toString(),
232
232
  status: "unread",
233
- notificationType: "regular",
233
+ callToAction: false,
234
234
  data: {
235
235
  tenant: tenant.name,
236
236
  },
@@ -252,7 +252,7 @@ export const updateTenant = async (tenant: Tenant, security: string) => {
252
252
  },
253
253
  date: Date.now().toString(),
254
254
  status: "unread",
255
- notificationType: "regular",
255
+ callToAction: false,
256
256
  data: {
257
257
  tenant: tenant.name,
258
258
  },
@@ -316,7 +316,7 @@ export const createTenantHTTP = async (tenant: Tenant) => {
316
316
  subtype: errors.tenant.created.subtype,
317
317
  date: Date.now().toString(),
318
318
  status: "unread",
319
- notificationType: "regular",
319
+ callToAction: false,
320
320
  data: {
321
321
  tenant: tenant.name,
322
322
  },
@@ -352,7 +352,7 @@ export const createTenantHTTP = async (tenant: Tenant) => {
352
352
  },
353
353
  date: Date.now().toString(),
354
354
  status: "unread",
355
- notificationType: "regular",
355
+ callToAction: false,
356
356
  data: {
357
357
  tenant: tenant.name,
358
358
  },
@@ -379,7 +379,7 @@ export const deleteTenantHTTP = async (tenant: Tenant) => {
379
379
  subtype: errors.tenant.deleting.subtype,
380
380
  date: Date.now().toString(),
381
381
  status: "unread",
382
- notificationType: "regular",
382
+ callToAction: false,
383
383
  data: {
384
384
  tenant: tenant.name,
385
385
  },
@@ -412,7 +412,7 @@ export const deleteTenantHTTP = async (tenant: Tenant) => {
412
412
  },
413
413
  date: Date.now().toString(),
414
414
  status: "unread",
415
- notificationType: "regular",
415
+ callToAction: false,
416
416
  data: {
417
417
  tenant: tenant.name,
418
418
  },
@@ -468,7 +468,7 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
468
468
  subtype: errors.tenant.updated.subtype,
469
469
  date: Date.now().toString(),
470
470
  status: "unread",
471
- notificationType: "regular",
471
+ callToAction: false,
472
472
  data: {
473
473
  tenant: tenant.name,
474
474
  },
@@ -503,7 +503,7 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
503
503
  },
504
504
  date: Date.now().toString(),
505
505
  status: "unread",
506
- notificationType: "regular",
506
+ callToAction: false,
507
507
  data: {
508
508
  tenant: tenant.name,
509
509
  },
@@ -549,7 +549,7 @@ export const createRegistry = async (
549
549
  subtype: errors.registry.created.subtype,
550
550
  date: Date.now().toString(),
551
551
  status: "unread",
552
- notificationType: "regular",
552
+ callToAction: false,
553
553
  data: {
554
554
  registry: registry.name,
555
555
  tenant: tenant.name,
@@ -578,7 +578,7 @@ export const createRegistry = async (
578
578
  },
579
579
  date: Date.now().toString(),
580
580
  status: "unread",
581
- notificationType: "regular",
581
+ callToAction: false,
582
582
  data: {
583
583
  tenant: tenant.name,
584
584
  },
@@ -635,7 +635,7 @@ export const updateRegistry = async (
635
635
  subtype: errors.registry.updated.subtype,
636
636
  date: Date.now().toString(),
637
637
  status: "unread",
638
- notificationType: "regular",
638
+ callToAction: false,
639
639
  data: {
640
640
  registry: registry.name,
641
641
  tenant: tenant.name,
@@ -666,7 +666,7 @@ export const updateRegistry = async (
666
666
  },
667
667
  date: Date.now().toString(),
668
668
  status: "unread",
669
- notificationType: "regular",
669
+ callToAction: false,
670
670
  data: {
671
671
  tenant: tenant.name,
672
672
  },
@@ -705,7 +705,7 @@ export const deleteRegistry = async (
705
705
  subtype: errors.registry.deleted.subtype,
706
706
  date: Date.now().toString(),
707
707
  status: "unread",
708
- notificationType: "regular",
708
+ callToAction: false,
709
709
  data: {
710
710
  registry: registry.name,
711
711
  tenant: tenant.name,
@@ -735,7 +735,7 @@ export const deleteRegistry = async (
735
735
  },
736
736
  date: Date.now().toString(),
737
737
  status: "unread",
738
- notificationType: "regular",
738
+ callToAction: false,
739
739
  data: {
740
740
  tenant: tenant.name,
741
741
  },
@@ -775,7 +775,7 @@ export const inviteUser = async (
775
775
  subtype: errors.tenant.userInvited.subtype,
776
776
  date: Date.now().toString(),
777
777
  status: "unread",
778
- notificationType: "regular",
778
+ callToAction: false,
779
779
  data: {
780
780
  tenant: tenant,
781
781
  email: email,
@@ -805,7 +805,7 @@ export const inviteUser = async (
805
805
  },
806
806
  date: Date.now().toString(),
807
807
  status: "unread",
808
- notificationType: "regular",
808
+ callToAction: false,
809
809
  data: {
810
810
  tenant: tenant,
811
811
  email: email,
@@ -842,7 +842,7 @@ export const removeUser = async (
842
842
  subtype: errors.tenant.userRemoved.subtype,
843
843
  date: Date.now().toString(),
844
844
  status: "unread",
845
- notificationType: "regular",
845
+ callToAction: false,
846
846
  data: {
847
847
  tenant: tenant,
848
848
  user: userId,
@@ -869,7 +869,7 @@ export const removeUser = async (
869
869
  },
870
870
  date: Date.now().toString(),
871
871
  status: "unread",
872
- notificationType: "regular",
872
+ callToAction: false,
873
873
  data: {
874
874
  tenant: tenant,
875
875
  user: userId,
@@ -908,7 +908,7 @@ export const updateUserRole = async (
908
908
  subtype: errors.tenant.roleUpdated.subtype,
909
909
  date: Date.now().toString(),
910
910
  status: "unread",
911
- notificationType: "regular",
911
+ callToAction: false,
912
912
  data: {
913
913
  tenant: tenant,
914
914
  user: userId,
@@ -937,7 +937,7 @@ export const updateUserRole = async (
937
937
  },
938
938
  date: Date.now().toString(),
939
939
  status: "unread",
940
- notificationType: "regular",
940
+ callToAction: false,
941
941
  data: {
942
942
  tenant: tenant,
943
943
  user: userId,
@@ -968,7 +968,7 @@ export const acceptInvite = async (tenant: string, security: string) => {
968
968
  subtype: errors.tenant.inviteAccepted.subtype,
969
969
  date: Date.now().toString(),
970
970
  status: "unread",
971
- notificationType: "regular",
971
+ callToAction: false,
972
972
  data: {
973
973
  tenant: tenant,
974
974
  },
@@ -993,7 +993,7 @@ export const acceptInvite = async (tenant: string, security: string) => {
993
993
  },
994
994
  date: Date.now().toString(),
995
995
  status: "unread",
996
- notificationType: "regular",
996
+ callToAction: false,
997
997
  data: {
998
998
  tenant: tenant,
999
999
  },
@@ -1023,7 +1023,7 @@ export const rejectInvite = async (tenant: string, security: string, leave: bool
1023
1023
  subtype: errors.tenant.leave.subtype,
1024
1024
  date: Date.now().toString(),
1025
1025
  status: "unread",
1026
- notificationType: "regular",
1026
+ callToAction: false,
1027
1027
  data: {
1028
1028
  tenant: tenant,
1029
1029
  },
@@ -1036,7 +1036,7 @@ export const rejectInvite = async (tenant: string, security: string, leave: bool
1036
1036
  subtype: errors.tenant.inviteRejected.subtype,
1037
1037
  date: Date.now().toString(),
1038
1038
  status: "unread",
1039
- notificationType: "regular",
1039
+ callToAction: false,
1040
1040
  data: {
1041
1041
  tenant: tenant,
1042
1042
  },
@@ -1063,7 +1063,7 @@ export const rejectInvite = async (tenant: string, security: string, leave: bool
1063
1063
  },
1064
1064
  date: Date.now().toString(),
1065
1065
  status: "unread",
1066
- notificationType: "regular",
1066
+ callToAction: false,
1067
1067
  data: {
1068
1068
  tenant: tenant,
1069
1069
  },
@@ -1112,7 +1112,7 @@ export const createToken = async (
1112
1112
  subtype: errors.user.tokenCreated.subtype,
1113
1113
  date: Date.now().toString(),
1114
1114
  status: "unread",
1115
- notificationType: "regular",
1115
+ callToAction: false,
1116
1116
  data: {
1117
1117
  tenant: tenantName,
1118
1118
  tokenName: tokenDescription,
@@ -1066,7 +1066,7 @@ export const updateUser = async (user: User) => {
1066
1066
  subtype: errors.user.updated.subtype,
1067
1067
  date: Date.now().toString(),
1068
1068
  status: "unread",
1069
- notificationType: "regular",
1069
+ callToAction: false,
1070
1070
  data: { user: user.name },
1071
1071
  });
1072
1072
  } catch (error) {
@@ -1081,7 +1081,7 @@ export const updateUser = async (user: User) => {
1081
1081
  subtype: errors.user.updateError.subtype,
1082
1082
  date: Date.now().toString(),
1083
1083
  status: "unread",
1084
- notificationType: "regular",
1084
+ callToAction: false,
1085
1085
  info_content: {
1086
1086
  code: (error as any).error.code,
1087
1087
  message: (error as any).error.content,
@@ -1109,7 +1109,7 @@ export const deleteUSer = async (user: User, security: string) => {
1109
1109
  subtype: errors.user.deleted.subtype,
1110
1110
  date: Date.now().toString(),
1111
1111
  status: "unread",
1112
- notificationType: "regular",
1112
+ callToAction: false,
1113
1113
  data: { user: user.name },
1114
1114
  });
1115
1115
  return response;
@@ -1120,7 +1120,7 @@ export const deleteUSer = async (user: User, security: string) => {
1120
1120
  subtype: errors.user.deleteError.subtype,
1121
1121
  date: Date.now().toString(),
1122
1122
  status: "unread",
1123
- notificationType: "regular",
1123
+ callToAction: false,
1124
1124
  info_content: {
1125
1125
  code: (error as any).error.code,
1126
1126
  message: (error as any).error.content,
@@ -615,7 +615,7 @@ export class BackendHandler {
615
615
  subtype: errors.user.planUpgraded.subtype,
616
616
  date: Date.now().toString(),
617
617
  status: "unread",
618
- notificationType: "regular",
618
+ callToAction: false,
619
619
  data: {
620
620
  plan: data,
621
621
  },
@@ -645,7 +645,7 @@ export class BackendHandler {
645
645
  subtype: errors.user.planDowngraded.subtype,
646
646
  date: Date.now().toString(),
647
647
  status: "unread",
648
- notificationType: "regular",
648
+ callToAction: false,
649
649
  data: {
650
650
  plan: data,
651
651
  },
@@ -681,7 +681,7 @@ export class BackendHandler {
681
681
  subtype: errors.environment.created.subtype,
682
682
  date: Date.now().toString(),
683
683
  status: "unread",
684
- notificationType: "regular",
684
+ callToAction: false,
685
685
  data: {
686
686
  environment: data.name,
687
687
  account: data.account,
@@ -765,7 +765,7 @@ export class BackendHandler {
765
765
  subtype: errors.deployment.success.subtype,
766
766
  date: Date.now().toString(),
767
767
  status: "unread",
768
- notificationType: "regular",
768
+ callToAction: false,
769
769
  data: {
770
770
  service: data.name,
771
771
  tenant: data.tenant,
@@ -785,7 +785,7 @@ export class BackendHandler {
785
785
  message: data.error?.message || "",
786
786
  timestamp: data.error?.timestamp || "",
787
787
  },
788
- notificationType: "regular",
788
+ callToAction: false,
789
789
  data: {
790
790
  service: data.name,
791
791
  tenant: data.tenant,
@@ -801,7 +801,7 @@ export class BackendHandler {
801
801
  subtype: errors.deployment.inProgress.subtype,
802
802
  date: Date.now().toString(),
803
803
  status: "unread",
804
- notificationType: "regular",
804
+ callToAction: false,
805
805
  data: {
806
806
  service: data.name,
807
807
  tenant: data.tenant,
@@ -832,7 +832,7 @@ export class BackendHandler {
832
832
  subtype: errors.deployment.updated.subtype,
833
833
  date: Date.now().toString(),
834
834
  status: "unread",
835
- notificationType: "regular",
835
+ callToAction: false,
836
836
  data: {
837
837
  service: data.name,
838
838
  tenant: data.tenant,
@@ -857,7 +857,7 @@ export class BackendHandler {
857
857
  subtype: errors.deployment.deleting.subtype,
858
858
  date: Date.now().toString(),
859
859
  status: "unread",
860
- notificationType: "regular",
860
+ callToAction: false,
861
861
  data: {
862
862
  service: data.name,
863
863
  tenant: data.tenant,
@@ -877,7 +877,7 @@ export class BackendHandler {
877
877
  subtype: errors.deployment.deleted.subtype,
878
878
  date: Date.now().toString(),
879
879
  status: "unread",
880
- notificationType: "regular",
880
+ callToAction: false,
881
881
  data: {
882
882
  service: data.name,
883
883
  tenant: data.tenant,
@@ -1093,7 +1093,7 @@ export class BackendHandler {
1093
1093
  subtype: errors.resource.deleted.subtype,
1094
1094
  date: Date.now().toString(),
1095
1095
  status: "unread",
1096
- notificationType: "regular",
1096
+ callToAction: false,
1097
1097
  data: {
1098
1098
  resource: data.name,
1099
1099
  type: data.type,
@@ -292,7 +292,7 @@ export const handleAccountOperationSuccess = ({
292
292
  subtype: errors.account.deleted.subtype,
293
293
  date: Date.now().toString(),
294
294
  status: "unread",
295
- notificationType: "regular",
295
+ callToAction: false,
296
296
  data: { account: originalData.name, tenant: originalData.tenant },
297
297
  },
298
298
  eventType: "deleted",
@@ -311,7 +311,7 @@ export const handleAccountOperationSuccess = ({
311
311
  subtype: isCreate ? errors.account.created.subtype : errors.account.updated.subtype,
312
312
  date: Date.now().toString(),
313
313
  status: "unread",
314
- notificationType: "regular",
314
+ callToAction: false,
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
- notificationType: "regular",
329
+ callToAction: false,
330
330
  data: {},
331
331
  },
332
332
  eventType: null,
@@ -369,7 +369,7 @@ export const handleAccountOperationError = ({
369
369
  error?.error?.content ?? error?.error?.message ?? "Unknown error",
370
370
  timestamp: error?.error?.timestamp ?? Date.now().toString(),
371
371
  },
372
- notificationType: "regular",
372
+ callToAction: false,
373
373
  data: {
374
374
  account:
375
375
  entityName || originalData?.name || originalData?.account || "unknown",
@@ -187,7 +187,7 @@ export const handleEnvironmentOperationSuccess = ({
187
187
  subtype: errors.environment.purged.subtype,
188
188
  date: Date.now().toString(),
189
189
  status: "unread",
190
- notificationType: "regular",
190
+ callToAction: false,
191
191
  data: {
192
192
  environment: envData.name,
193
193
  account: envData.account,
@@ -260,7 +260,7 @@ export const handleEnvironmentOperationError = ({
260
260
  message: error?.error?.content || error?.error?.message || "Unknown error",
261
261
  timestamp: error?.error?.timestamp || "",
262
262
  },
263
- notificationType: "regular",
263
+ callToAction: false,
264
264
  data: {
265
265
  environment: originalData.name,
266
266
  account: originalData.account,
@@ -164,7 +164,7 @@ export const handleTokenDeletion = ({
164
164
  subtype: errors.user.tokenDeleted.subtype,
165
165
  date: Date.now().toString(),
166
166
  status: "unread",
167
- notificationType: "regular",
167
+ callToAction: false,
168
168
  data: {
169
169
  tokenName: deletedToken.name,
170
170
  tenant: deletedToken.tenant,
@@ -64,7 +64,7 @@ export const handleUserEvent = ({
64
64
  type: "success",
65
65
  subtype: errors.tenant.deleted.subtype,
66
66
  date: Date.now().toString(),
67
- notificationType: "regular",
67
+ callToAction: false,
68
68
  status: "unread",
69
69
  data: {
70
70
  tenant: tenantToDelete.name,
@@ -78,7 +78,7 @@ export const handleUserEvent = ({
78
78
  type: "info",
79
79
  subtype: errors.tenant.accessRevoked.subtype,
80
80
  date: Date.now().toString(),
81
- notificationType: "regular",
81
+ callToAction: false,
82
82
  status: "unread",
83
83
  data: {
84
84
  tenant: tenantToDelete.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.1.96",
3
+ "version": "1.1.98",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "glob": "^11.0.0"
12
12
  },
13
13
  "dependencies": {
14
- "@kumori/aurora-interfaces": "^1.0.24",
14
+ "@kumori/aurora-interfaces": "^1.0.21",
15
15
  "@kumori/kumori-dsl-generator": "1.0.7",
16
16
  "@kumori/kumori-module-generator": "^1.1.6",
17
17
  "ts-node": "^10.9.2",
@@ -196,6 +196,15 @@ 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
+
199
208
  it("maneja formResources de tipo volume", () => {
200
209
  const result = handleParametersToGenerateData([], [
201
210
  { name: "vol1", type: "volume", key: "/mnt/data" },
@@ -197,6 +197,18 @@ const REPORTING_INTERVAL = 1000;
197
197
  let hasLoadedReportingOnce = false;
198
198
  let recentlyUpdatedServices = new Map<string, Service>();
199
199
  let pendingTenantStatus = new Map<string, string>();
200
+ let reconnectAttempts = 0;
201
+ let reconnectTimer: ReturnType<typeof setTimeout> | null = null;
202
+ let isManualClose = false;
203
+ let lastConnectionParams: {
204
+ token: string;
205
+ type?: string;
206
+ name?: string;
207
+ previousData?: UserData;
208
+ } | null = null;
209
+ const MAX_RECONNECT_ATTEMPTS = 5;
210
+ const RECONNECT_BASE_DELAY = 1000;
211
+ const RECONNECT_MAX_DELAY = 30000;
200
212
  /**
201
213
  * Helper function to safely stringify error objects
202
214
  */
@@ -239,6 +251,7 @@ export const initializeGlobalWebSocketClient = async (
239
251
  ): Promise<WebSocket> => {
240
252
  userData.notifications = previousData?.notifications;
241
253
  globalEntityName = name || null;
254
+ lastConnectionParams = { token, type, name, previousData };
242
255
  if (
243
256
  wsConnection &&
244
257
  wsConnection.readyState === WebSocket.OPEN &&
@@ -281,6 +294,11 @@ export const initializeGlobalWebSocketClient = async (
281
294
  wsConnection?.addEventListener("open", async () => {
282
295
  currentToken = token;
283
296
  connectionPromise = null;
297
+ reconnectAttempts = 0;
298
+ if (reconnectTimer) {
299
+ clearTimeout(reconnectTimer);
300
+ reconnectTimer = null;
301
+ }
284
302
 
285
303
  resolve(wsConnection!);
286
304
  });
@@ -374,13 +392,17 @@ export const initializeGlobalWebSocketClient = async (
374
392
  pending.reject(new Error("WebSocket connection closed"));
375
393
  pendingRequests.delete(messageId);
376
394
  });
395
+
396
+ if (isManualClose) {
397
+ isManualClose = false;
398
+ return;
399
+ }
400
+
401
+ scheduleReconnect();
377
402
  });
378
403
 
379
404
  wsConnection?.addEventListener("error", (error) => {
380
405
  console.error("Global WebSocket error:", error);
381
- userData.status = UserStatus.NOT_LOGGED;
382
- user = new User(userData);
383
- eventHelper.user.publish.loaded(user);
384
406
  connectionPromise = null;
385
407
  reject(error);
386
408
  });
@@ -393,6 +415,38 @@ export const initializeGlobalWebSocketClient = async (
393
415
  return connectionPromise;
394
416
  };
395
417
 
418
+ /**
419
+ * Schedule a reconnection attempt after an unexpected connection drop
420
+ * (e.g. a transient network blip while the tab was backgrounded).
421
+ * Uses exponential backoff and gives up after MAX_RECONNECT_ATTEMPTS.
422
+ */
423
+ const scheduleReconnect = () => {
424
+ if (reconnectTimer || !lastConnectionParams) {
425
+ return;
426
+ }
427
+
428
+ if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
429
+ console.error("WebSocket reconnection attempts exhausted");
430
+ return;
431
+ }
432
+
433
+ const delay = Math.min(
434
+ RECONNECT_BASE_DELAY * Math.pow(2, reconnectAttempts),
435
+ RECONNECT_MAX_DELAY,
436
+ );
437
+ reconnectAttempts++;
438
+
439
+ reconnectTimer = setTimeout(() => {
440
+ reconnectTimer = null;
441
+ const { token, type, name, previousData } = lastConnectionParams!;
442
+ initializeGlobalWebSocketClient(token, type, name, previousData).catch(
443
+ (error) => {
444
+ console.error("WebSocket reconnect attempt failed:", error);
445
+ },
446
+ );
447
+ }, delay);
448
+ };
449
+
396
450
  /**
397
451
  * Function to make WebSocket requests using the global connection
398
452
  * @param topic Request topic (group:method)
@@ -583,6 +637,14 @@ export const getWebSocketStatus = () => {
583
637
  * Close the global WebSocket connection
584
638
  */
585
639
  export const closeGlobalWebSocketConnection = () => {
640
+ isManualClose = true;
641
+ lastConnectionParams = null;
642
+ reconnectAttempts = 0;
643
+ if (reconnectTimer) {
644
+ clearTimeout(reconnectTimer);
645
+ reconnectTimer = null;
646
+ }
647
+
586
648
  if (wsConnection) {
587
649
  wsConnection.close();
588
650
  wsConnection = null;