@kumori/aurora-backend-handler 1.1.66 → 1.1.67

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.
@@ -5,6 +5,7 @@ import {
5
5
  initializeGlobalWebSocketClient,
6
6
  getWebSocketStatus,
7
7
  makeGlobalWebSocketRequest,
8
+ markEnvironmentAsPurging,
8
9
  } from "../websocket-manager";
9
10
 
10
11
  type Security = string;
@@ -259,6 +260,10 @@ export const clearEnvironment = async (
259
260
  }
260
261
  };
261
262
  eventHelper.notification.publish.creation(envNotification);
263
+ const purgeKey = env.tenant && env.account
264
+ ? `${env.tenant}/${env.account}/${env.name}`
265
+ : env.name;
266
+ markEnvironmentAsPurging(purgeKey);
262
267
  await initializeGlobalWebSocketClient(security, "environment", env.name);
263
268
  const status = getWebSocketStatus();
264
269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.1.66",
3
+ "version": "1.1.67",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -545,6 +545,23 @@ export const makeGlobalWebSocketRequestWithRetry = async (
545
545
  );
546
546
  };
547
547
 
548
+ export const markEnvironmentAsPurging = (envKey: string) => {
549
+ purgingEnvironments.add(envKey);
550
+ const env = environmentsMap.get(envKey);
551
+ if (env) {
552
+ const updatedEnv: Environment = {
553
+ ...env,
554
+ status: {
555
+ code: "PURGING",
556
+ message: `Environment ${env.name} is being purged.`,
557
+ timestamp: new Date().toISOString(),
558
+ },
559
+ };
560
+ environmentsMap.set(envKey, updatedEnv);
561
+ eventHelper.environment.publish.updated(updatedEnv);
562
+ }
563
+ };
564
+
548
565
  /**
549
566
  * Get the current WebSocket connection status
550
567
  * @returns Connection status and token info