@kumori/aurora-backend-handler 1.1.89 → 1.1.91
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.
|
@@ -100,6 +100,7 @@ export interface ServiceSpecForm {
|
|
|
100
100
|
certificateResource?: string;
|
|
101
101
|
withMtls?: boolean;
|
|
102
102
|
caResource?: string;
|
|
103
|
+
gatewayName?: string;
|
|
103
104
|
}>;
|
|
104
105
|
clientChannelsExtra?: Array<{ name: string }>;
|
|
105
106
|
defaultExecutable: { cmd?: string; entryPoint?: string };
|
|
@@ -183,7 +184,8 @@ interface ArtifactConfigParameterDto {
|
|
|
183
184
|
type ParameterTypeDto = "string" | "number" | "bool";
|
|
184
185
|
type ComponentEnvironmentDto =
|
|
185
186
|
| ComponentEnvironmentParamDto
|
|
186
|
-
| ComponentEnvironmentSecretDto
|
|
187
|
+
| ComponentEnvironmentSecretDto
|
|
188
|
+
| ComponentEnvironmentValueDto;
|
|
187
189
|
interface ComponentEnvironmentParamDto {
|
|
188
190
|
varName: string;
|
|
189
191
|
param: string;
|
|
@@ -192,6 +194,10 @@ interface ComponentEnvironmentSecretDto {
|
|
|
192
194
|
varName: string;
|
|
193
195
|
secret: string;
|
|
194
196
|
}
|
|
197
|
+
interface ComponentEnvironmentValueDto {
|
|
198
|
+
varName: string;
|
|
199
|
+
value: string;
|
|
200
|
+
}
|
|
195
201
|
type ArtifactConfigResource =
|
|
196
202
|
| CA<ArtifactConfigResourceSpec>
|
|
197
203
|
| Secret<ArtifactConfigResourceSpec>
|
|
@@ -381,6 +387,13 @@ export function handleParametersToGenerateData(
|
|
|
381
387
|
});
|
|
382
388
|
break;
|
|
383
389
|
|
|
390
|
+
case "clientChannel":
|
|
391
|
+
environmentResult.push({
|
|
392
|
+
varName: parameter.name,
|
|
393
|
+
value: `0.${parameter.value}`,
|
|
394
|
+
});
|
|
395
|
+
break;
|
|
396
|
+
|
|
384
397
|
default:
|
|
385
398
|
console.warn(`Unknown parameter type: ${parameter.type}`);
|
|
386
399
|
parametersResult.push({
|
|
@@ -465,6 +478,7 @@ export function transformServiceToForm(service: Service): ServiceSpecForm {
|
|
|
465
478
|
certificateResource: ch.certificateResource,
|
|
466
479
|
withMtls: ch.withMtls,
|
|
467
480
|
caResource: ch.caResource,
|
|
481
|
+
gatewayName: ch.gatewayName,
|
|
468
482
|
})),
|
|
469
483
|
clientChannelsExtra: service.duplexChannels.map((ch) => ({
|
|
470
484
|
name: ch.name,
|
|
@@ -631,7 +645,7 @@ export async function generateServiceSpec(
|
|
|
631
645
|
.map((channel) => {
|
|
632
646
|
if (channel.protocol === "HTTPS") {
|
|
633
647
|
return {
|
|
634
|
-
name: `${channel.channelName}_inbound`,
|
|
648
|
+
name: channel.gatewayName || `${channel.channelName}_inbound`,
|
|
635
649
|
artifact: {
|
|
636
650
|
artifactKind: "service",
|
|
637
651
|
moduleDomain: "kumori.systems",
|
|
@@ -674,7 +688,7 @@ export async function generateServiceSpec(
|
|
|
674
688
|
};
|
|
675
689
|
}
|
|
676
690
|
return {
|
|
677
|
-
name: `${channel.channelName}_inbound`,
|
|
691
|
+
name: channel.gatewayName || `${channel.channelName}_inbound`,
|
|
678
692
|
artifact: {
|
|
679
693
|
artifactKind: "service",
|
|
680
694
|
moduleDomain: " ",
|
|
@@ -708,7 +722,7 @@ export async function generateServiceSpec(
|
|
|
708
722
|
];
|
|
709
723
|
if (channel.isPublic) {
|
|
710
724
|
result.push({
|
|
711
|
-
clientRole: `${channel.channelName}_inbound`,
|
|
725
|
+
clientRole: channel.gatewayName || `${channel.channelName}_inbound`,
|
|
712
726
|
clientChannel: "inbound",
|
|
713
727
|
serverRole: withDefaultValue(form.serviceId, ""),
|
|
714
728
|
serverChannel: channel.channelName,
|
|
@@ -1245,7 +1259,7 @@ async function generateServiceSpecDSL(
|
|
|
1245
1259
|
.map((channel) => {
|
|
1246
1260
|
if (channel.protocol === "HTTPS") {
|
|
1247
1261
|
return {
|
|
1248
|
-
name: `${channel.channelName}_inbound`,
|
|
1262
|
+
name: channel.gatewayName || `${channel.channelName}_inbound`,
|
|
1249
1263
|
artifact: {
|
|
1250
1264
|
artifactKind: "service" as const,
|
|
1251
1265
|
moduleDomain: "kumori",
|
|
@@ -1288,7 +1302,7 @@ async function generateServiceSpecDSL(
|
|
|
1288
1302
|
};
|
|
1289
1303
|
}
|
|
1290
1304
|
return {
|
|
1291
|
-
name: `${channel.channelName}_inbound`,
|
|
1305
|
+
name: channel.gatewayName || `${channel.channelName}_inbound`,
|
|
1292
1306
|
artifact: {
|
|
1293
1307
|
artifactKind: "service" as const,
|
|
1294
1308
|
moduleDomain: "kumori",
|
|
@@ -1323,7 +1337,7 @@ async function generateServiceSpecDSL(
|
|
|
1323
1337
|
];
|
|
1324
1338
|
if (channel.isPublic) {
|
|
1325
1339
|
result.push({
|
|
1326
|
-
clientRole: `${channel.channelName}_inbound`,
|
|
1340
|
+
clientRole: channel.gatewayName || `${channel.channelName}_inbound`,
|
|
1327
1341
|
clientChannel: "inbound",
|
|
1328
1342
|
serverRole: withDefaultValue(form.serviceId, ""),
|
|
1329
1343
|
serverChannel: channel.channelName,
|
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.91",
|
|
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.
|
|
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",
|
|
@@ -97,6 +97,19 @@ describe("handleParametersToGenerateData", () => {
|
|
|
97
97
|
expect(result.parameters).toHaveLength(0);
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
+
it("maneja tipo clientChannel", () => {
|
|
101
|
+
const result = handleParametersToGenerateData(
|
|
102
|
+
[{ name: "test", value: "ClientChannel1aaa", type: "clientChannel" }],
|
|
103
|
+
[],
|
|
104
|
+
);
|
|
105
|
+
expect(result.environment).toContainEqual({
|
|
106
|
+
varName: "test",
|
|
107
|
+
value: "0.ClientChannel1aaa",
|
|
108
|
+
});
|
|
109
|
+
expect(result.parameters).toHaveLength(0);
|
|
110
|
+
expect(result.resources).toHaveLength(0);
|
|
111
|
+
});
|
|
112
|
+
|
|
100
113
|
it("maneja tipo file", () => {
|
|
101
114
|
const result = handleParametersToGenerateData(
|
|
102
115
|
[{ name: "myconfig", value: "/path/to/file", type: "file" }],
|
|
@@ -840,6 +853,14 @@ describe("deployServiceHelper", () => {
|
|
|
840
853
|
expect(formData.get("bundle")).toBeTruthy();
|
|
841
854
|
});
|
|
842
855
|
|
|
856
|
+
it("maneja parámetros de tipo clientChannel en generateServiceSpecDSL", async () => {
|
|
857
|
+
const service = createMockService({
|
|
858
|
+
parameters: [{ name: "test", value: "ClientChannel1aaa", type: "clientChannel" }],
|
|
859
|
+
});
|
|
860
|
+
const formData = await deployService(service);
|
|
861
|
+
expect(formData.get("bundle")).toBeTruthy();
|
|
862
|
+
});
|
|
863
|
+
|
|
843
864
|
it("maneja resources de tipo volume sin size en generateServiceSpecDSL", async () => {
|
|
844
865
|
const service = createMockService({
|
|
845
866
|
resources: [{ name: "vol1", type: "volume", value: "existing-vol" }],
|