@kumori/aurora-backend-handler 1.0.10 → 1.0.12
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.
|
@@ -25,10 +25,6 @@ interface HandleResourceEventResult {
|
|
|
25
25
|
secretsToStore: Array<{ key: string; value: any }>;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// ============================================
|
|
29
|
-
// RESOURCE BUILDERS
|
|
30
|
-
// ============================================
|
|
31
|
-
|
|
32
28
|
/**
|
|
33
29
|
* Build a domain resource
|
|
34
30
|
*/
|
|
@@ -402,11 +402,6 @@ const updateAccountConsumption = (
|
|
|
402
402
|
|
|
403
403
|
return account;
|
|
404
404
|
};
|
|
405
|
-
|
|
406
|
-
// ============================================
|
|
407
|
-
// MAIN HANDLER FUNCTION
|
|
408
|
-
// ============================================
|
|
409
|
-
|
|
410
405
|
/**
|
|
411
406
|
* Handles the "revision" event from WebSocket messages
|
|
412
407
|
* Processes revision data, updates services, environments, and accounts
|
|
@@ -423,15 +418,11 @@ export const handleRevisionEvent = ({
|
|
|
423
418
|
}: HandleRevisionEventParams): HandleRevisionEventResult => {
|
|
424
419
|
const serviceId = `${parentParts.tenant}/${parentParts.service}`;
|
|
425
420
|
const revisionKey = `${serviceId}-${entityId}`;
|
|
426
|
-
|
|
427
|
-
// Process roles and instances
|
|
428
421
|
const { roles, instances, usedCpu, usedMemory } = processRolesAndInstances(
|
|
429
422
|
eventData,
|
|
430
423
|
serviceId,
|
|
431
424
|
roleMap,
|
|
432
425
|
);
|
|
433
|
-
|
|
434
|
-
// Create new revision
|
|
435
426
|
const newRevision = createRevision(
|
|
436
427
|
entityId,
|
|
437
428
|
parentParts,
|
|
@@ -439,8 +430,6 @@ export const handleRevisionEvent = ({
|
|
|
439
430
|
usedCpu,
|
|
440
431
|
usedMemory,
|
|
441
432
|
);
|
|
442
|
-
|
|
443
|
-
// Initialize result
|
|
444
433
|
let updatedService: Service | null = null;
|
|
445
434
|
let updatedEnvironment: Environment | null = null;
|
|
446
435
|
let updatedAccount: Account | null = null;
|
|
@@ -745,9 +734,14 @@ export const extractResourcesFromFilesystem = (
|
|
|
745
734
|
);
|
|
746
735
|
resources.push({
|
|
747
736
|
type: "volume",
|
|
748
|
-
name:
|
|
737
|
+
name: existingResource?.name || value.volume,
|
|
749
738
|
value: existingResource?.value || value.volume,
|
|
750
|
-
|
|
739
|
+
key: value.path,
|
|
740
|
+
kind:
|
|
741
|
+
(existingResource?.kind as
|
|
742
|
+
| "persistent"
|
|
743
|
+
| "volatile"
|
|
744
|
+
| "nonReplicated") || "storage",
|
|
751
745
|
status: existingResource?.status || "available",
|
|
752
746
|
tenant: "",
|
|
753
747
|
});
|
package/package.json
CHANGED
package/websocket-manager.ts
CHANGED
|
@@ -346,7 +346,6 @@ export const initializeGlobalWebSocketClient = async (
|
|
|
346
346
|
platformInfo = null;
|
|
347
347
|
isPlatformInfoLoaded = false;
|
|
348
348
|
isPlatformInfoLoading = false;
|
|
349
|
-
|
|
350
349
|
pendingRequests.forEach((pending, messageId) => {
|
|
351
350
|
pending.reject(new Error("WebSocket connection closed"));
|
|
352
351
|
pendingRequests.delete(messageId);
|
|
@@ -355,6 +354,9 @@ export const initializeGlobalWebSocketClient = async (
|
|
|
355
354
|
|
|
356
355
|
wsConnection?.addEventListener("error", (error) => {
|
|
357
356
|
console.error("Global WebSocket error:", error);
|
|
357
|
+
userData.status = "unknown";
|
|
358
|
+
user = new User(userData);
|
|
359
|
+
eventHelper.user.publish.loaded(user);
|
|
358
360
|
connectionPromise = null;
|
|
359
361
|
reject(error);
|
|
360
362
|
});
|