@kumori/aurora-backend-handler 1.1.14 → 1.1.16

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.
@@ -262,7 +262,7 @@ const updateEnvironmentConsumption = (
262
262
 
263
263
  servicesMap.forEach((service, svcId) => {
264
264
  if (service.environment === serviceEnvironmentId) {
265
- const currentRevisionKey = `${svcId}-${service.currentRevision}`;
265
+ const currentRevisionKey = `${svcId}_${service.currentRevision}`;
266
266
  const currentRevision = revisionsMap.get(currentRevisionKey);
267
267
  if (currentRevision) {
268
268
  totalEnvCpu += currentRevision.usage.limit.cpu.max || 0;
@@ -300,7 +300,7 @@ const updateAccountConsumption = (
300
300
 
301
301
  servicesMap.forEach((service, svcId) => {
302
302
  if (service.account === serviceAccountId) {
303
- const currentRevisionKey = `${svcId}-${service.currentRevision}`;
303
+ const currentRevisionKey = `${svcId}_${service.currentRevision}`;
304
304
  const currentRevision = revisionsMap.get(currentRevisionKey);
305
305
  if (currentRevision) {
306
306
  totalAccountCpu += currentRevision.usage.limit.cpu.max || 0;
@@ -338,7 +338,7 @@ export const handleRevisionEvent = ({
338
338
  accountsMap,
339
339
  }: HandleRevisionEventParams): HandleRevisionEventResult => {
340
340
  const serviceId = `${parentParts.tenant}/${parentParts.service}`;
341
- const revisionKey = `${serviceId}-${entityId}`;
341
+ const revisionKey = `${serviceId}_${entityId}`;
342
342
  const { roles, instances, usedCpu, usedMemory } = processRolesAndInstances(
343
343
  eventData,
344
344
  serviceId,
@@ -180,7 +180,7 @@ export const handleServiceEvent = ({
180
180
  }: HandleServiceEventParams): HandleServiceEventResult => {
181
181
  const serviceFullKey = `${parentParts.tenant}/${entityId}`;
182
182
  const serviceTenantId = parentParts.tenant;
183
- const currentRevisionKey = `${serviceFullKey}-${eventData.status.revision}`;
183
+ const currentRevisionKey = `${serviceFullKey}_${eventData.status.revision}`;
184
184
  const currentRevision = revisionsMap.get(currentRevisionKey);
185
185
 
186
186
  const projectLabel = eventData.meta?.labels?.project;
@@ -189,7 +189,7 @@ export const handleServiceEvent = ({
189
189
 
190
190
  const serviceRevisions: Revision[] = [];
191
191
  revisionsMap.forEach((revision, key) => {
192
- if (key.startsWith(`${serviceFullKey}-`)) {
192
+ if (key.startsWith(`${serviceFullKey}_`)) {
193
193
  serviceRevisions.push(revision);
194
194
  }
195
195
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -1291,7 +1291,7 @@ const handleOperationSuccess = (operation: PendingOperation, response: any) => {
1291
1291
  svcSuccessResult.revisionData
1292
1292
  ) {
1293
1293
  try {
1294
- const updatedService = processRevisionData(
1294
+ let updatedService = processRevisionData(
1295
1295
  svcSuccessResult.updatedService!,
1296
1296
  svcSuccessResult.revisionData,
1297
1297
  revisionsMap,
@@ -1311,6 +1311,28 @@ const handleOperationSuccess = (operation: PendingOperation, response: any) => {
1311
1311
  };
1312
1312
  }
1313
1313
 
1314
+ const resources = updatedService.resources || [];
1315
+ if (resources.length > 0) {
1316
+ const applyIsPublic = (channels: Channel[]): Channel[] =>
1317
+ channels.map((ch) => ({
1318
+ ...ch,
1319
+ isPublic:
1320
+ ch.isPublic ||
1321
+ resources.some(
1322
+ (r) =>
1323
+ (r.type === "port" || r.type === "domain") &&
1324
+ (r.name === `${ch.name}_port` || r.name === `${ch.name}_domain`),
1325
+ ),
1326
+ }));
1327
+
1328
+ updatedService = {
1329
+ ...updatedService,
1330
+ serverChannels: applyIsPublic(updatedService.serverChannels || []),
1331
+ clientChannels: applyIsPublic(updatedService.clientChannels || []),
1332
+ duplexChannels: applyIsPublic(updatedService.duplexChannels || []),
1333
+ };
1334
+ }
1335
+
1314
1336
  servicesMap.set(svcSuccessResult.serviceId, updatedService);
1315
1337
 
1316
1338
  if (updatedService.role && updatedService.role.length > 0) {
@@ -1974,7 +1996,7 @@ const resolveServiceStatus = (service: Service): Service => {
1974
1996
  return service;
1975
1997
  }
1976
1998
 
1977
- const revisionKey = `${service.tenant}/${service.name}-${service.currentRevision}`;
1999
+ const revisionKey = `${service.tenant}/${service.name}_${service.currentRevision}`;
1978
2000
  const currentRevision = revisionsMap.get(revisionKey);
1979
2001
 
1980
2002
  if (!currentRevision) {