@kumori/aurora-backend-handler 1.0.97 → 1.0.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.
@@ -1,6 +1,4 @@
1
- import {
2
- ComponentSpec,
3
- } from "@kumori/kumori-module-generator";
1
+ import { ComponentSpec } from "@kumori/kumori-module-generator";
4
2
  import { Parameter } from "@kumori/kumori-module-generator/dist/types";
5
3
  import { getReferenceDomain } from "../websocket-manager";
6
4
 
@@ -10,14 +8,19 @@ import {
10
8
  ComponentSpec as ComponentSpecDSL,
11
9
  ServiceSpec as ServiceSpecDSL,
12
10
  } from "@kumori/kumori-dsl-generator";
13
- import { MarketplaceService, Resource, Service } from "@kumori/aurora-interfaces";
11
+ import {
12
+ MarketplaceService,
13
+ Resource,
14
+ Service,
15
+ } from "@kumori/aurora-interfaces";
14
16
 
15
17
  export type ResourceBundle =
16
18
  | { secret: { name: string; configResource: string } }
17
19
  | { volume: { name: string; configResource: string } }
18
20
  | { certificate: { name: string; configResource: string } }
19
21
  | { domain: { name: string; configResource: string } }
20
- | { port: { name: string; configResource: string } };
22
+ | { port: { name: string; configResource: string } }
23
+ | { ca: { name: string; configResource: string } };
21
24
 
22
25
  export interface Role {
23
26
  name: string;
@@ -90,6 +93,11 @@ export interface ServiceSpecForm {
90
93
  protocol: "HTTPS" | "TCP";
91
94
  publicPort?: string;
92
95
  domain?: string;
96
+ certificate?: string;
97
+ ca?: string;
98
+ certificateResource?: string;
99
+ withMtls?: boolean;
100
+ caResource?: string;
93
101
  }>;
94
102
  clientChannelsExtra?: Array<{ name: string }>;
95
103
  defaultExecutable: { cmd?: string; entryPoint?: string };
@@ -236,7 +244,7 @@ interface ServiceSpecDSLWithLocalComponent extends ServiceSpecDSL {
236
244
  */
237
245
  export function withDefaultValue<T>(
238
246
  value: T | null | undefined,
239
- defaultValue: T
247
+ defaultValue: T,
240
248
  ): T {
241
249
  return value != null ? value : defaultValue;
242
250
  }
@@ -261,7 +269,7 @@ export function handleParametersToGenerateData(
261
269
  content?: string;
262
270
  kind?: string;
263
271
  key?: string;
264
- }>
272
+ }>,
265
273
  ): {
266
274
  parameters: any[];
267
275
  environment: any[];
@@ -285,25 +293,25 @@ export function handleParametersToGenerateData(
285
293
 
286
294
  case "file":
287
295
  parametersResult.push({
288
- name: 'CONFIG_FILE_'+index,
296
+ name: "CONFIG_FILE_" + index,
289
297
  type: "string",
290
298
  defaultValue: (parameter.value as string) || "",
291
299
  });
292
300
  fileSystemResult.push({
293
301
  path: `${parameter.name}`,
294
- param: 'CONFIG_FILE_'+index,
302
+ param: "CONFIG_FILE_" + index,
295
303
  });
296
304
  break;
297
305
 
298
306
  case "fileContent":
299
307
  parametersResult.push({
300
- name: 'CONFIG_FILE_'+index,
308
+ name: "CONFIG_FILE_" + index,
301
309
  type: "string",
302
310
  defaultValue: parameter.content || (parameter.value as string) || "",
303
311
  });
304
312
  fileSystemResult.push({
305
313
  path: (parameter.value as string) || `${parameter.name}`,
306
- param: 'CONFIG_FILE_'+index,
314
+ param: "CONFIG_FILE_" + index,
307
315
  });
308
316
  break;
309
317
 
@@ -396,9 +404,9 @@ export function handleParametersToGenerateData(
396
404
  case "volume":
397
405
  resourcesResult.push({ volume: { name: resource.name } });
398
406
  fileSystemResult.push({
399
- path: resource.key || '',
400
- resourceVolume: resource.name,
401
- });
407
+ path: resource.key || "",
408
+ resourceVolume: resource.name,
409
+ });
402
410
  break;
403
411
  // case "certificate":
404
412
  // resourcesResult.push({ certificate: { name: resource.name } });
@@ -428,6 +436,7 @@ export function handleParametersToGenerateData(
428
436
  * @returns A ServiceSpecForm object with the data of the service.
429
437
  */
430
438
  export function transformServiceToForm(service: Service): ServiceSpecForm {
439
+ console.log('--- TRANSFORM SERVICE TO FORM ---', service.name);
431
440
  return {
432
441
  tenantId: service.tenant,
433
442
  accountId: service.account,
@@ -446,10 +455,13 @@ export function transformServiceToForm(service: Service): ServiceSpecForm {
446
455
  ch.protocol === "http"
447
456
  ? "HTTPS"
448
457
  : ch.protocol === "tcp"
449
- ? "TCP"
450
- : "TCP",
458
+ ? "TCP"
459
+ : "TCP",
451
460
  publicPort: ch.portNum?.toString() || "",
452
461
  domain: ch.portNum?.toString() || "",
462
+ certificateResource: ch.certificateResource,
463
+ withMtls: ch.withMtls,
464
+ caResource: ch.caResource,
453
465
  })),
454
466
  clientChannelsExtra: service.duplexChannels.map((ch) => ({
455
467
  name: ch.name,
@@ -490,7 +502,7 @@ export function transformServiceToForm(service: Service): ServiceSpecForm {
490
502
  */
491
503
  export async function generateServiceSpec(
492
504
  form: ServiceSpecForm,
493
- marketplaceItem?: MarketplaceService
505
+ marketplaceItem?: MarketplaceService,
494
506
  ): Promise<ServiceWithLocalComponentSpec> {
495
507
  const formParams = form.config.parameters;
496
508
  const formResources = form.config.resources;
@@ -500,22 +512,49 @@ export async function generateServiceSpec(
500
512
  fileSystem,
501
513
  resources: componentResources,
502
514
  } = handleParametersToGenerateData(formParams, formResources);
515
+
516
+ console.log('--- GENERATE SERVICE SPEC ---', form.serviceId);
517
+ console.log('Channels from Form:', JSON.stringify(form.channels));
518
+
503
519
  const serverConfigDomainResources: ArtifactConfigResource[] = form.channels
504
520
  .filter((channel) => channel.protocol === "HTTPS" && channel.isPublic)
505
521
  .map((channel) => ({ domain: { name: `${channel.channelName}_domain` } }));
506
- if (serverConfigDomainResources.length) {
522
+
523
+ const hasDefaultCertChannel = form.channels.some(
524
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
525
+ );
526
+ if (hasDefaultCertChannel) {
507
527
  serverConfigDomainResources.push({
508
528
  certificate: { name: "main_inbound_servercert" },
509
529
  });
510
530
  }
511
531
 
532
+ const customCertResources: ArtifactConfigResource[] = form.channels
533
+ .filter(
534
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
535
+ )
536
+ .map((ch) => ({ certificate: { name: `${ch.channelName}_cert` } }));
537
+
538
+ const customCaResources: ArtifactConfigResource[] = form.channels
539
+ .filter(
540
+ (ch) =>
541
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
542
+ )
543
+ .map((ch) => ({ ca: { name: `${ch.channelName}_ca` } }));
544
+
545
+ console.log('Generated Resources Spec:', {
546
+ serverConfigDomainResources,
547
+ customCertResources,
548
+ customCaResources
549
+ });
550
+
512
551
  const serviceConfigPortResources: ArtifactConfigResource[] = form.channels
513
552
  .filter((channel) => channel.protocol === "TCP" && channel.isPublic)
514
553
  .map((channel) => ({ port: { name: `${channel.channelName}_port` } }));
515
554
 
516
555
  const serviceConfigResources: ArtifactConfigResource[] = form.config.resources
517
556
  .filter(
518
- (resource) => resource.type === "volume" || resource.type === "secret"
557
+ (resource) => resource.type === "volume" || resource.type === "secret",
519
558
  )
520
559
  .map((resource) => {
521
560
  if (resource.type === "secret") {
@@ -543,7 +582,7 @@ export async function generateServiceSpec(
543
582
  resource.type === "string" ||
544
583
  resource.type === "boolean" ||
545
584
  resource.type === "number" ||
546
- resource.type === "fileContent"
585
+ resource.type === "fileContent",
547
586
  )
548
587
  .map((resource) => {
549
588
  if (resource.type === "string" || resource.type === "fileContent") {
@@ -576,7 +615,7 @@ export async function generateServiceSpec(
576
615
 
577
616
  const rolesResources: ResourceBundle[] = form.config.resources
578
617
  .filter(
579
- (resource) => resource.type === "volume" || resource.type === "secret"
618
+ (resource) => resource.type === "volume" || resource.type === "secret",
580
619
  )
581
620
  .map((resource) => {
582
621
  if (resource.type === "secret") {
@@ -607,13 +646,18 @@ export async function generateServiceSpec(
607
646
  config: {
608
647
  parameters: [
609
648
  { name: "type", value: "https", type: "string" },
649
+ ...(channel.withMtls && channel.caResource
650
+ ? [{ name: "mtls", value: "true", type: "bool" as const }]
651
+ : []),
610
652
  // { name: "websocket", value: "true", type: "bool", configParam: "websocket" },
611
653
  ],
612
654
  resources: [
613
655
  {
614
656
  certificate: {
615
657
  name: "servercert",
616
- configResource: "main_inbound_servercert",
658
+ configResource: channel.certificateResource
659
+ ? `${channel.channelName}_cert`
660
+ : "main_inbound_servercert",
617
661
  },
618
662
  },
619
663
  {
@@ -622,6 +666,16 @@ export async function generateServiceSpec(
622
666
  configResource: `${channel.channelName}_domain`,
623
667
  },
624
668
  },
669
+ ...(channel.withMtls && channel.caResource
670
+ ? [
671
+ {
672
+ ca: {
673
+ name: "clientca",
674
+ configResource: `${channel.channelName}_ca`,
675
+ },
676
+ },
677
+ ]
678
+ : []),
625
679
  ],
626
680
  },
627
681
  },
@@ -669,7 +723,7 @@ export async function generateServiceSpec(
669
723
  });
670
724
  }
671
725
  return result;
672
- }
726
+ },
673
727
  );
674
728
  const topologyClientsChannels: Connector[] = (form.clientChannels || []).map(
675
729
  (channel) => ({
@@ -677,7 +731,7 @@ export async function generateServiceSpec(
677
731
  clientChannel: channel.name,
678
732
  serverRole: "self",
679
733
  serverChannel: channel.name,
680
- })
734
+ }),
681
735
  );
682
736
  const topology: Connector[] = [
683
737
  ...topologyServerChannels,
@@ -691,7 +745,7 @@ export async function generateServiceSpec(
691
745
  resource.type === "string" ||
692
746
  resource.type === "number" ||
693
747
  resource.type === "boolean" ||
694
- resource.type === "fileContent"
748
+ resource.type === "fileContent",
695
749
  )
696
750
  .map((resource) => {
697
751
  if (resource.type === "string") {
@@ -723,7 +777,7 @@ export async function generateServiceSpec(
723
777
  (resource) =>
724
778
  resource.type === "volume" &&
725
779
  resource.kind === "volatile" &&
726
- resource.size
780
+ resource.size,
727
781
  );
728
782
 
729
783
  for (const resource of volatileResources) {
@@ -741,7 +795,7 @@ export async function generateServiceSpec(
741
795
  } catch (error) {
742
796
  console.error(
743
797
  `Error creating volatile volume for ${resource.name}:`,
744
- error
798
+ error,
745
799
  );
746
800
  throw error;
747
801
  }
@@ -750,7 +804,7 @@ export async function generateServiceSpec(
750
804
 
751
805
  const deploymentConfigResources: DeploymentResource[] = form.config.resources
752
806
  .filter(
753
- (resource) => resource.type === "secret" || resource.type === "volume"
807
+ (resource) => resource.type === "secret" || resource.type === "volume",
754
808
  )
755
809
  .map((resource) => {
756
810
  if (resource.type === "secret") {
@@ -897,7 +951,7 @@ export async function generateServiceSpec(
897
951
  cmd: withDefaultValue(form.defaultExecutable.cmd, undefined),
898
952
  entrypoint: withDefaultValue(
899
953
  form.defaultExecutable.entryPoint,
900
- undefined
954
+ undefined,
901
955
  ),
902
956
  },
903
957
  };
@@ -957,6 +1011,8 @@ export async function generateServiceSpec(
957
1011
  parameters,
958
1012
  resources: [
959
1013
  ...serverConfigDomainResources,
1014
+ ...customCertResources,
1015
+ ...customCaResources,
960
1016
  ...serviceConfigPortResources,
961
1017
  ...serviceConfigResources,
962
1018
  ...volatileVolumeResources,
@@ -987,7 +1043,7 @@ export async function generateServiceSpec(
987
1043
  ...acc,
988
1044
  [withDefaultValue(role, "")]: 1,
989
1045
  }),
990
- {}
1046
+ {},
991
1047
  ),
992
1048
  },
993
1049
  }),
@@ -1047,7 +1103,7 @@ export async function generateServiceSpec(
1047
1103
  */
1048
1104
  async function generateServiceSpecDSL(
1049
1105
  form: ServiceSpecForm,
1050
- marketplaceItem?: MarketplaceService
1106
+ marketplaceItem?: MarketplaceService,
1051
1107
  ): Promise<ServiceSpecDSLWithLocalComponent> {
1052
1108
  const formParams = form.config.parameters;
1053
1109
  const formResources = form.config.resources;
@@ -1061,19 +1117,42 @@ async function generateServiceSpecDSL(
1061
1117
  const serverConfigDomainResources: ArtifactConfigResource[] = form.channels
1062
1118
  .filter((channel) => channel.protocol === "HTTPS" && channel.isPublic)
1063
1119
  .map((channel) => ({ domain: { name: `${channel.channelName}_domain` } }));
1064
- if (serverConfigDomainResources.length) {
1120
+
1121
+ const hasDefaultCertChannel = form.channels.some(
1122
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
1123
+ );
1124
+ if (hasDefaultCertChannel) {
1065
1125
  serverConfigDomainResources.push({
1066
1126
  certificate: { name: "main_inbound_servercert" },
1067
1127
  });
1068
1128
  }
1069
1129
 
1130
+ const customCertResources: ArtifactConfigResource[] = form.channels
1131
+ .filter(
1132
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
1133
+ )
1134
+ .map((ch) => ({ certificate: { name: `${ch.channelName}_cert` } }));
1135
+
1136
+ const customCaResources: ArtifactConfigResource[] = form.channels
1137
+ .filter(
1138
+ (ch) =>
1139
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
1140
+ )
1141
+ .map((ch) => ({ ca: { name: `${ch.channelName}_ca` } }));
1142
+
1143
+ console.log('Generated Resources Config:', {
1144
+ serverConfigDomainResources,
1145
+ customCertResources,
1146
+ customCaResources
1147
+ });
1148
+
1070
1149
  const serviceConfigPortResources: ArtifactConfigResource[] = form.channels
1071
1150
  .filter((channel) => channel.protocol === "TCP" && channel.isPublic)
1072
1151
  .map((channel) => ({ port: { name: `${channel.channelName}_port` } }));
1073
1152
 
1074
1153
  const serviceConfigResources: ArtifactConfigResource[] = form.config.resources
1075
1154
  .filter(
1076
- (resource) => resource.type === "volume" || resource.type === "secret"
1155
+ (resource) => resource.type === "volume" || resource.type === "secret",
1077
1156
  )
1078
1157
  .map((resource) => {
1079
1158
  if (resource.type === "secret") {
@@ -1090,29 +1169,27 @@ async function generateServiceSpecDSL(
1090
1169
  .filter((param) => param.type === "volume" && param.size)
1091
1170
  .map((param) => ({ volume: { name: param.name } }));
1092
1171
 
1093
-
1094
-
1095
1172
  const rolesParameters: Parameter[] = form.config.parameters
1096
1173
  .filter(
1097
1174
  (resource) =>
1098
1175
  resource.type === "string" ||
1099
1176
  resource.type === "boolean" ||
1100
1177
  resource.type === "number" ||
1101
- resource.type === "file"
1178
+ resource.type === "file",
1102
1179
  )
1103
1180
  .map((resource, index) => {
1104
- if (resource.type === "string" ) {
1181
+ if (resource.type === "string") {
1105
1182
  return {
1106
1183
  name: resource.name,
1107
1184
  type: "string",
1108
1185
  configParam: resource.name,
1109
1186
  };
1110
1187
  }
1111
- if(resource.type === "file") {
1188
+ if (resource.type === "file") {
1112
1189
  return {
1113
- name: "CONFIG_FILE_"+index,
1190
+ name: "CONFIG_FILE_" + index,
1114
1191
  type: "string",
1115
- configParam: "CONFIG_FILE_"+index,
1192
+ configParam: "CONFIG_FILE_" + index,
1116
1193
  };
1117
1194
  }
1118
1195
  if (resource.type === "boolean" || resource.type === "bool") {
@@ -1138,12 +1215,12 @@ async function generateServiceSpecDSL(
1138
1215
 
1139
1216
  const rolesResources: ResourceBundle[] = form.config.resources
1140
1217
  .filter(
1141
- (resource) => resource.type === "volume" || resource.type === "secret"
1218
+ (resource) => resource.type === "volume" || resource.type === "secret",
1142
1219
  )
1143
1220
  .map((resource) => {
1144
1221
  if (resource.type === "secret") {
1145
1222
  return {
1146
- secret: { name: resource.name, configResource: resource.name || '' },
1223
+ secret: { name: resource.name, configResource: resource.name || "" },
1147
1224
  };
1148
1225
  }
1149
1226
  return { volume: { name: resource.name, configResource: resource.name } };
@@ -1164,12 +1241,17 @@ async function generateServiceSpecDSL(
1164
1241
  config: {
1165
1242
  parameters: [
1166
1243
  { name: "type", value: "https", type: "string" as const },
1244
+ ...(channel.withMtls && channel.caResource
1245
+ ? [{ name: "mtls", value: "true", type: "bool" as const }]
1246
+ : []),
1167
1247
  ],
1168
1248
  resources: [
1169
1249
  {
1170
1250
  certificate: {
1171
1251
  name: "servercert",
1172
- configResource: "main_inbound_servercert",
1252
+ configResource: channel.certificateResource
1253
+ ? `${channel.channelName}_cert`
1254
+ : "main_inbound_servercert",
1173
1255
  },
1174
1256
  },
1175
1257
  {
@@ -1178,6 +1260,16 @@ async function generateServiceSpecDSL(
1178
1260
  configResource: `${channel.channelName}_domain`,
1179
1261
  },
1180
1262
  },
1263
+ ...(channel.withMtls && channel.caResource
1264
+ ? [
1265
+ {
1266
+ ca: {
1267
+ name: "clientca",
1268
+ configResource: `${channel.channelName}_ca`,
1269
+ },
1270
+ },
1271
+ ]
1272
+ : []),
1181
1273
  ],
1182
1274
  },
1183
1275
  },
@@ -1186,14 +1278,16 @@ async function generateServiceSpecDSL(
1186
1278
  return {
1187
1279
  name: `${channel.channelName}_inbound`,
1188
1280
  artifact: {
1189
- artifactKind: "service" as const,
1281
+ artifactKind: "service" as const,
1190
1282
  moduleDomain: "kumori",
1191
1283
  moduleName: "builtin",
1192
- moduleVersion: [1, 3, 0] as [number, number, number],
1284
+ moduleVersion: [1, 3, 0] as [number, number, number],
1193
1285
  artifactName: "TCPInbound",
1194
1286
  packageLocation: "",
1195
1287
  config: {
1196
- parameters: [{ name: "type", value: "tcp", type: "string" as const }],
1288
+ parameters: [
1289
+ { name: "type", value: "tcp", type: "string" as const },
1290
+ ],
1197
1291
  resources: [
1198
1292
  {
1199
1293
  port: {
@@ -1232,7 +1326,7 @@ async function generateServiceSpecDSL(
1232
1326
  clientChannel: channel.name,
1233
1327
  serverRole: "self",
1234
1328
  serverChannel: channel.name,
1235
- })
1329
+ }),
1236
1330
  );
1237
1331
 
1238
1332
  const topology = [...topologyServerChannels, ...topologyClientsChannels];
@@ -1245,7 +1339,7 @@ async function generateServiceSpecDSL(
1245
1339
  resource.type === "number" ||
1246
1340
  resource.type === "boolean" ||
1247
1341
  resource.type === "bool" ||
1248
- resource.type === "file"
1342
+ resource.type === "file",
1249
1343
  )
1250
1344
  .map((resource, index) => {
1251
1345
  if (resource.type === "string") {
@@ -1271,12 +1365,9 @@ async function generateServiceSpecDSL(
1271
1365
  return { name: resource.name, value: resource.value, type: "string" };
1272
1366
  });
1273
1367
 
1274
-
1275
-
1276
-
1277
1368
  const deploymentConfigResources: DeploymentResource[] = form.config.resources
1278
1369
  .filter(
1279
- (resource) => resource.type === "secret" || resource.type === "volume"
1370
+ (resource) => resource.type === "secret" || resource.type === "volume",
1280
1371
  )
1281
1372
  .map((resource) => {
1282
1373
  if (resource.type === "secret") {
@@ -1342,7 +1433,11 @@ async function generateServiceSpecDSL(
1342
1433
  resource: withDefaultValue(channel.domain, ""),
1343
1434
  },
1344
1435
  }));
1345
- if (deploymentConfigDomain.length) {
1436
+
1437
+ const hasDefaultCertChannelDeployment = form.channels.some(
1438
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && !ch.certificateResource
1439
+ );
1440
+ if (hasDefaultCertChannelDeployment) {
1346
1441
  deploymentConfigDomain.push({
1347
1442
  certificate: {
1348
1443
  name: "main_inbound_servercert",
@@ -1351,6 +1446,35 @@ async function generateServiceSpecDSL(
1351
1446
  });
1352
1447
  }
1353
1448
 
1449
+ const customCertDeploymentResources: DeploymentResource[] = form.channels
1450
+ .filter(
1451
+ (ch) => ch.protocol === "HTTPS" && ch.isPublic && ch.certificateResource
1452
+ )
1453
+ .map((ch) => ({
1454
+ certificate: {
1455
+ name: `${ch.channelName}_cert`,
1456
+ resource: ch.certificateResource!,
1457
+ },
1458
+ }));
1459
+
1460
+ const customCaDeploymentResources: DeploymentResource[] = form.channels
1461
+ .filter(
1462
+ (ch) =>
1463
+ ch.protocol === "HTTPS" && ch.isPublic && ch.withMtls && ch.caResource
1464
+ )
1465
+ .map((ch) => ({
1466
+ ca: {
1467
+ name: `${ch.channelName}_ca`,
1468
+ resource: ch.caResource!,
1469
+ },
1470
+ }));
1471
+
1472
+ console.log('Generated Deployment Resources:', {
1473
+ deploymentConfigDomain,
1474
+ customCertDeploymentResources,
1475
+ customCaDeploymentResources
1476
+ });
1477
+
1354
1478
  const deploymentConfigPort: DeploymentResource[] = form.channels
1355
1479
  .filter((channel) => channel.protocol === "TCP" && channel.isPublic)
1356
1480
  .map((channel) => ({
@@ -1396,7 +1520,7 @@ async function generateServiceSpecDSL(
1396
1520
  packageLocation: "deployment",
1397
1521
  artifactName: withDefaultValue(
1398
1522
  marketplaceItem?.artifact || form.serviceId + "_service",
1399
- ""
1523
+ "",
1400
1524
  ),
1401
1525
  tenantId: withDefaultValue(form.tenantId, ""),
1402
1526
  accountId: withDefaultValue(form.accountId, ""),
@@ -1424,6 +1548,8 @@ async function generateServiceSpecDSL(
1424
1548
  parameters,
1425
1549
  resources: [
1426
1550
  ...serverConfigDomainResources,
1551
+ ...customCertResources,
1552
+ ...customCaResources,
1427
1553
  ...serviceConfigPortResources,
1428
1554
  ...serviceConfigResources,
1429
1555
  ...volatileVolumeResources,
@@ -1433,7 +1559,7 @@ async function generateServiceSpecDSL(
1433
1559
  {
1434
1560
  name: withDefaultValue(
1435
1561
  marketplaceItem?.deploymentData?.name || form.serviceId,
1436
- ""
1562
+ "",
1437
1563
  ),
1438
1564
  artifact: {
1439
1565
  artifactKind:
@@ -1445,18 +1571,18 @@ async function generateServiceSpecDSL(
1445
1571
  : "mod.local",
1446
1572
  moduleName: withDefaultValue(
1447
1573
  marketplaceItem?.module || form.serviceId,
1448
- ""
1574
+ "",
1449
1575
  ),
1450
1576
  moduleVersion: marketplaceItem?.version
1451
1577
  ? (marketplaceItem.version.split(".").map(Number) as [
1452
1578
  number,
1453
1579
  number,
1454
- number
1580
+ number,
1455
1581
  ])
1456
1582
  : ([0, 0, 1] as [number, number, number]),
1457
1583
  artifactName: withDefaultValue(
1458
1584
  marketplaceItem?.artifact || form.serviceId + "_component",
1459
- ""
1585
+ "",
1460
1586
  ),
1461
1587
  packageLocation: hasMarketplacePackage
1462
1588
  ? marketplaceItem?.package || ""
@@ -1539,7 +1665,7 @@ async function generateServiceSpecDSL(
1539
1665
  cmd: withDefaultValue(form.defaultExecutable.cmd, undefined),
1540
1666
  entrypoint: withDefaultValue(
1541
1667
  form.defaultExecutable.entryPoint,
1542
- undefined
1668
+ undefined,
1543
1669
  ),
1544
1670
  },
1545
1671
  };
@@ -1558,15 +1684,16 @@ async function generateServiceSpecDSL(
1558
1684
  */
1559
1685
  export async function deployServiceHelper(
1560
1686
  service: Service,
1561
- marketplaceItem?: MarketplaceService
1687
+ marketplaceItem?: MarketplaceService,
1562
1688
  ): Promise<FormData> {
1563
1689
  const serviceForm: ServiceSpecForm = transformServiceToForm(service);
1564
1690
 
1565
1691
  let CUEBundle;
1566
1692
  const serviceSpecDSL = await generateServiceSpecDSL(
1567
1693
  serviceForm,
1568
- marketplaceItem
1694
+ marketplaceItem,
1569
1695
  );
1696
+ console.log('Final generated ServiceSpecDSL:', JSON.stringify(serviceSpecDSL, null, 2));
1570
1697
  CUEBundle = buildServiceDeploymentModule(serviceSpecDSL);
1571
1698
 
1572
1699
  // if (marketplaceItem?.package) {
@@ -1589,11 +1716,11 @@ export async function deployServiceHelper(
1589
1716
  JSON.stringify({
1590
1717
  targetAccount: withDefaultValue(serviceForm.accountId, ""),
1591
1718
  targetEnvironment: withDefaultValue(serviceForm.environmentId, ""),
1592
- })
1719
+ }),
1593
1720
  );
1594
1721
  formData.append(
1595
1722
  "labels",
1596
- JSON.stringify({ project: withDefaultValue(service.project, "") })
1723
+ JSON.stringify({ project: withDefaultValue(service.project, "") }),
1597
1724
  );
1598
1725
  formData.append("comment", " ");
1599
1726
  return formData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.0.97",
3
+ "version": "1.0.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.11",
14
+ "@kumori/aurora-interfaces": "^1.0.12",
15
15
  "@kumori/kumori-dsl-generator": "^1.0.4",
16
16
  "@kumori/kumori-module-generator": "^1.1.6",
17
17
  "ts-node": "^10.9.2",