@kumori/aurora-backend-handler 1.0.99 → 1.0.100

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.
@@ -436,7 +436,6 @@ export function handleParametersToGenerateData(
436
436
  * @returns A ServiceSpecForm object with the data of the service.
437
437
  */
438
438
  export function transformServiceToForm(service: Service): ServiceSpecForm {
439
- console.log('--- TRANSFORM SERVICE TO FORM ---', service.name);
440
439
  return {
441
440
  tenantId: service.tenant,
442
441
  accountId: service.account,
@@ -513,15 +512,12 @@ export async function generateServiceSpec(
513
512
  resources: componentResources,
514
513
  } = handleParametersToGenerateData(formParams, formResources);
515
514
 
516
- console.log('--- GENERATE SERVICE SPEC ---', form.serviceId);
517
- console.log('Channels from Form:', JSON.stringify(form.channels));
518
-
519
515
  const serverConfigDomainResources: ArtifactConfigResource[] = form.channels
520
516
  .filter((channel) => channel.protocol === "HTTPS" && channel.isPublic)
521
517
  .map((channel) => ({ domain: { name: `${channel.channelName}_domain` } }));
522
518
 
523
519
  const hasDefaultCertChannel = form.channels.some(
524
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
520
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource,
525
521
  );
526
522
  if (hasDefaultCertChannel) {
527
523
  serverConfigDomainResources.push({
@@ -531,23 +527,17 @@ export async function generateServiceSpec(
531
527
 
532
528
  const customCertResources: ArtifactConfigResource[] = form.channels
533
529
  .filter(
534
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
530
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource,
535
531
  )
536
532
  .map((ch) => ({ certificate: { name: `${ch.channelName}_cert` } }));
537
533
 
538
534
  const customCaResources: ArtifactConfigResource[] = form.channels
539
535
  .filter(
540
536
  (ch) =>
541
- ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
537
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource,
542
538
  )
543
539
  .map((ch) => ({ ca: { name: `${ch.channelName}_ca` } }));
544
540
 
545
- console.log('Generated Resources Spec:', {
546
- serverConfigDomainResources,
547
- customCertResources,
548
- customCaResources
549
- });
550
-
551
541
  const serviceConfigPortResources: ArtifactConfigResource[] = form.channels
552
542
  .filter((channel) => channel.protocol === "TCP" && channel.isPublic)
553
543
  .map((channel) => ({ port: { name: `${channel.channelName}_port` } }));
@@ -891,7 +881,7 @@ export async function generateServiceSpec(
891
881
  }));
892
882
 
893
883
  const hasDefaultCertChannelDeployment = form.channels.some(
894
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
884
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource,
895
885
  );
896
886
  if (hasDefaultCertChannelDeployment) {
897
887
  deploymentConfigDomain.push({
@@ -904,7 +894,7 @@ export async function generateServiceSpec(
904
894
 
905
895
  const customCertDeploymentResources: DeploymentResource[] = form.channels
906
896
  .filter(
907
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
897
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource,
908
898
  )
909
899
  .map((ch) => ({
910
900
  certificate: {
@@ -916,7 +906,7 @@ export async function generateServiceSpec(
916
906
  const customCaDeploymentResources: DeploymentResource[] = form.channels
917
907
  .filter(
918
908
  (ch) =>
919
- ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
909
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource,
920
910
  )
921
911
  .map((ch) => ({
922
912
  ca: {
@@ -1145,7 +1135,7 @@ async function generateServiceSpecDSL(
1145
1135
  .map((channel) => ({ domain: { name: `${channel.channelName}_domain` } }));
1146
1136
 
1147
1137
  const hasDefaultCertChannel = form.channels.some(
1148
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
1138
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource,
1149
1139
  );
1150
1140
  if (hasDefaultCertChannel) {
1151
1141
  serverConfigDomainResources.push({
@@ -1155,23 +1145,17 @@ async function generateServiceSpecDSL(
1155
1145
 
1156
1146
  const customCertResources: ArtifactConfigResource[] = form.channels
1157
1147
  .filter(
1158
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
1148
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource,
1159
1149
  )
1160
1150
  .map((ch) => ({ certificate: { name: `${ch.channelName}_cert` } }));
1161
1151
 
1162
1152
  const customCaResources: ArtifactConfigResource[] = form.channels
1163
1153
  .filter(
1164
1154
  (ch) =>
1165
- ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
1155
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource,
1166
1156
  )
1167
1157
  .map((ch) => ({ ca: { name: `${ch.channelName}_ca` } }));
1168
1158
 
1169
- console.log('Generated Resources Config:', {
1170
- serverConfigDomainResources,
1171
- customCertResources,
1172
- customCaResources
1173
- });
1174
-
1175
1159
  const serviceConfigPortResources: ArtifactConfigResource[] = form.channels
1176
1160
  .filter((channel) => channel.protocol === "TCP" && channel.isPublic)
1177
1161
  .map((channel) => ({ port: { name: `${channel.channelName}_port` } }));
@@ -1458,7 +1442,7 @@ async function generateServiceSpecDSL(
1458
1442
  }));
1459
1443
 
1460
1444
  const hasDefaultCertChannelDeployment = form.channels.some(
1461
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
1445
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource,
1462
1446
  );
1463
1447
  if (hasDefaultCertChannelDeployment) {
1464
1448
  deploymentConfigDomain.push({
@@ -1471,7 +1455,7 @@ async function generateServiceSpecDSL(
1471
1455
 
1472
1456
  const customCertDeploymentResources: DeploymentResource[] = form.channels
1473
1457
  .filter(
1474
- (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
1458
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource,
1475
1459
  )
1476
1460
  .map((ch) => ({
1477
1461
  certificate: {
@@ -1483,7 +1467,7 @@ async function generateServiceSpecDSL(
1483
1467
  const customCaDeploymentResources: DeploymentResource[] = form.channels
1484
1468
  .filter(
1485
1469
  (ch) =>
1486
- ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
1470
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource,
1487
1471
  )
1488
1472
  .map((ch) => ({
1489
1473
  ca: {
@@ -1492,12 +1476,6 @@ async function generateServiceSpecDSL(
1492
1476
  },
1493
1477
  }));
1494
1478
 
1495
- console.log('Generated Deployment Resources:', {
1496
- deploymentConfigDomain,
1497
- customCertDeploymentResources,
1498
- customCaDeploymentResources
1499
- });
1500
-
1501
1479
  const deploymentConfigPort: DeploymentResource[] = form.channels
1502
1480
  .filter((channel) => channel.protocol === "TCP" && channel.isPublic)
1503
1481
  .map((channel) => ({
@@ -1718,7 +1696,6 @@ export async function deployServiceHelper(
1718
1696
  serviceForm,
1719
1697
  marketplaceItem,
1720
1698
  );
1721
- console.log('Final generated ServiceSpecDSL:', JSON.stringify(serviceSpecDSL, null, 2));
1722
1699
  CUEBundle = buildServiceDeploymentModule(serviceSpecDSL);
1723
1700
 
1724
1701
  // if (marketplaceItem?.package) {
@@ -38,10 +38,9 @@ export const handleUserEvent = ({
38
38
  if (!userTenants.includes(key)) {
39
39
  const tenantToDelete = tenantsMap.get(key);
40
40
  if (tenantToDelete) {
41
- eventHelper.tenant.publish.deleted(tenantToDelete);
42
- const tenantDeletedNotification: Notification = {
43
- type: "success",
44
- subtype: "tenant-deleted",
41
+ const userRemovedNotification: Notification = {
42
+ type: "info",
43
+ subtype: "user-removed-from-tenant",
45
44
  date: Date.now().toString(),
46
45
  callToAction: false,
47
46
  status: "unread",
@@ -49,7 +48,7 @@ export const handleUserEvent = ({
49
48
  tenant: tenantToDelete.name,
50
49
  },
51
50
  };
52
- eventHelper.notification.publish.creation(tenantDeletedNotification);
51
+ eventHelper.notification.publish.creation(userRemovedNotification);
53
52
  deletedTenantKeys.push(key);
54
53
  }
55
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.0.99",
3
+ "version": "1.0.100",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -804,6 +804,27 @@ const handleEvent = async (message: WSMessage) => {
804
804
  eventData,
805
805
  userData,
806
806
  );
807
+
808
+ if (
809
+ existingTenant &&
810
+ existingTenant.role &&
811
+ newTenant.role &&
812
+ existingTenant.role !== newTenant.role
813
+ ) {
814
+ const roleNotification: Notification = {
815
+ type: "info",
816
+ subtype: "tenant-role-changed",
817
+ date: Date.now().toString(),
818
+ status: "unread",
819
+ callToAction: false,
820
+ data: {
821
+ tenant: newTenant.name,
822
+ oldRole: existingTenant.role,
823
+ newRole: newTenant.role,
824
+ },
825
+ };
826
+ eventHelper.notification.publish.creation(roleNotification);
827
+ }
807
828
  if (existingTenant) {
808
829
  if (
809
830
  !newTenant.resources?.length &&