@kumori/aurora-backend-handler 1.1.12 → 1.1.13
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,10 +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(
|
|
440
|
-
"DEBUG - transformServiceToForm (channels)",
|
|
441
|
-
service.serverChannels,
|
|
442
|
-
);
|
|
443
439
|
return {
|
|
444
440
|
tenantId: service.tenant,
|
|
445
441
|
accountId: service.account,
|
|
@@ -14,7 +14,6 @@ let pendingLinks = new Map<string, Link[]>();
|
|
|
14
14
|
* @param data Service object with the data of the service
|
|
15
15
|
*/
|
|
16
16
|
export const deployService = async (data: Service, token: string) => {
|
|
17
|
-
console.log("DEBUG - deployService", data);
|
|
18
17
|
try {
|
|
19
18
|
const url = new URL(
|
|
20
19
|
`${environment.apiServer.baseUrl}/api/${environment.apiServer.apiVersion}/tenant/${data.tenant}/service/${data.name}`,
|
|
@@ -458,6 +458,7 @@ export const handleServiceOperationError = ({
|
|
|
458
458
|
export const mapChannelsFromApiData = (
|
|
459
459
|
apiData: any,
|
|
460
460
|
entityId: string,
|
|
461
|
+
existingChannels?: { serverChannels: Channel[]; clientChannels: Channel[]; duplexChannels: Channel[] },
|
|
461
462
|
): {
|
|
462
463
|
serverChannels: Channel[];
|
|
463
464
|
clientChannels: Channel[];
|
|
@@ -467,7 +468,6 @@ export const mapChannelsFromApiData = (
|
|
|
467
468
|
const clientChannels: Channel[] = [];
|
|
468
469
|
const duplexChannels: Channel[] = [];
|
|
469
470
|
const inboundSuffix = "_inbound.inbound";
|
|
470
|
-
|
|
471
471
|
const publicChannelNames = new Set<string>();
|
|
472
472
|
|
|
473
473
|
const collectPublic = (section: any) => {
|
|
@@ -486,11 +486,12 @@ export const mapChannelsFromApiData = (
|
|
|
486
486
|
collectPublic(apiData.client);
|
|
487
487
|
collectPublic(apiData.duplex);
|
|
488
488
|
|
|
489
|
-
const mapChannels = (section: any, target: Channel[]) => {
|
|
489
|
+
const mapChannels = (section: any, target: Channel[], existing: Channel[] = []) => {
|
|
490
490
|
if (!section) return;
|
|
491
491
|
Object.entries(section).forEach(
|
|
492
492
|
([channelName, channelData]: [string, any]) => {
|
|
493
493
|
if (channelName.endsWith(inboundSuffix)) return;
|
|
494
|
+
const existingChannel = existing.find((ch) => ch.name === channelName);
|
|
494
495
|
target.push({
|
|
495
496
|
name: channelName,
|
|
496
497
|
from: entityId,
|
|
@@ -498,15 +499,15 @@ export const mapChannelsFromApiData = (
|
|
|
498
499
|
protocol: channelData.protocol as "http" | "tcp" | "https",
|
|
499
500
|
port: channelData.port,
|
|
500
501
|
portNum: channelData.port,
|
|
501
|
-
isPublic: publicChannelNames.has(channelName),
|
|
502
|
+
isPublic: publicChannelNames.has(channelName) || existingChannel?.isPublic || false,
|
|
502
503
|
});
|
|
503
504
|
},
|
|
504
505
|
);
|
|
505
506
|
};
|
|
506
507
|
|
|
507
|
-
mapChannels(apiData.server, serverChannels);
|
|
508
|
-
mapChannels(apiData.client, clientChannels);
|
|
509
|
-
mapChannels(apiData.duplex, duplexChannels);
|
|
508
|
+
mapChannels(apiData.server, serverChannels, existingChannels?.serverChannels);
|
|
509
|
+
mapChannels(apiData.client, clientChannels, existingChannels?.clientChannels);
|
|
510
|
+
mapChannels(apiData.duplex, duplexChannels, existingChannels?.duplexChannels);
|
|
510
511
|
|
|
511
512
|
return { serverChannels, clientChannels, duplexChannels };
|
|
512
|
-
};
|
|
513
|
+
};
|
package/package.json
CHANGED
package/websocket-manager.ts
CHANGED
|
@@ -1274,6 +1274,11 @@ const handleOperationSuccess = (operation: PendingOperation, response: any) => {
|
|
|
1274
1274
|
const channelsInfo = mapChannelsFromApiData(
|
|
1275
1275
|
response.payload.data,
|
|
1276
1276
|
serviceName,
|
|
1277
|
+
{
|
|
1278
|
+
serverChannels: service.serverChannels,
|
|
1279
|
+
clientChannels: service.clientChannels,
|
|
1280
|
+
duplexChannels: service.duplexChannels
|
|
1281
|
+
}
|
|
1277
1282
|
);
|
|
1278
1283
|
service.serverChannels = channelsInfo.serverChannels;
|
|
1279
1284
|
service.clientChannels = channelsInfo.clientChannels;
|