@kumori/aurora-backend-handler 1.1.61 → 1.1.63
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.
|
@@ -587,9 +587,9 @@ const deleteResourceBase = async (
|
|
|
587
587
|
body,
|
|
588
588
|
30000,
|
|
589
589
|
"DELETE",
|
|
590
|
-
resource.name
|
|
590
|
+
resource.name,
|
|
591
|
+
"resource"
|
|
591
592
|
);
|
|
592
|
-
|
|
593
593
|
//eventHelper.resource.publish.deleted(resource);
|
|
594
594
|
const resourceNotification: Notification = {
|
|
595
595
|
type: "success",
|
|
@@ -190,20 +190,28 @@ export const updateTenant = async (tenant: Tenant, security: string) => {
|
|
|
190
190
|
|
|
191
191
|
const hasNpmRegistry =
|
|
192
192
|
tenant.npmRegistry !== undefined && tenant.npmRegistry !== null;
|
|
193
|
+
const isNpmRegistryEmpty =
|
|
194
|
+
hasNpmRegistry &&
|
|
195
|
+
tenant.npmRegistry!.endpoint === "" &&
|
|
196
|
+
tenant.npmRegistry!.domain === "" &&
|
|
197
|
+
tenant.npmRegistry!.credentials === "" &&
|
|
198
|
+
tenant.npmRegistry!.public === false;
|
|
193
199
|
const hasPlan = tenant.plan?.name;
|
|
194
200
|
|
|
195
201
|
const updateBody: Record<string, any> = {
|
|
196
202
|
tenant: tenant.name,
|
|
197
203
|
spec: {
|
|
198
|
-
registry: hasNpmRegistry
|
|
199
|
-
?
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
registry: !hasNpmRegistry
|
|
205
|
+
? undefined
|
|
206
|
+
: isNpmRegistryEmpty
|
|
207
|
+
? null
|
|
208
|
+
: {
|
|
209
|
+
kind: "git",
|
|
210
|
+
endpoint: tenant.npmRegistry!.endpoint,
|
|
211
|
+
domain: tenant.npmRegistry!.domain,
|
|
212
|
+
credentials: tenant.npmRegistry!.credentials,
|
|
213
|
+
public: tenant.npmRegistry!.public,
|
|
214
|
+
},
|
|
207
215
|
},
|
|
208
216
|
};
|
|
209
217
|
|
|
@@ -376,6 +376,22 @@ export const handleVolumeEvent = (
|
|
|
376
376
|
hasRequestingServices: false
|
|
377
377
|
});
|
|
378
378
|
};
|
|
379
|
+
export const setResourceDeleting = (
|
|
380
|
+
tenantsMap: Map<string, any>,
|
|
381
|
+
tenantName: string,
|
|
382
|
+
resourceName: string,
|
|
383
|
+
resourceType: string,
|
|
384
|
+
) => {
|
|
385
|
+
const tenant = tenantsMap.get(tenantName);
|
|
386
|
+
if (!tenant) return;
|
|
387
|
+
const index = tenant.resources.findIndex(
|
|
388
|
+
(res: Resource) => res.name === resourceName && res.type === resourceType,
|
|
389
|
+
);
|
|
390
|
+
if (index === -1) return;
|
|
391
|
+
tenant.resources[index] = { ...tenant.resources[index], deleting: true };
|
|
392
|
+
tenantsMap.set(tenantName, tenant);
|
|
393
|
+
};
|
|
394
|
+
|
|
379
395
|
export const processResourceResult = (
|
|
380
396
|
result: any,
|
|
381
397
|
tenantsMap: Map<string, any>,
|
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.63",
|
|
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.16",
|
|
15
15
|
"@kumori/kumori-dsl-generator": "1.0.6",
|
|
16
16
|
"@kumori/kumori-module-generator": "^1.1.6",
|
|
17
17
|
"ts-node": "^10.9.2",
|
package/websocket-manager.ts
CHANGED
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
handleSecretEvent,
|
|
62
62
|
handleVolumeEvent,
|
|
63
63
|
processResourceResult,
|
|
64
|
+
setResourceDeleting,
|
|
64
65
|
} from "./helpers/resource-helper";
|
|
65
66
|
import {
|
|
66
67
|
handlePlanInstanceEvent,
|
|
@@ -1475,6 +1476,16 @@ const handleOperationSuccess = (operation: PendingOperation, response: any) => {
|
|
|
1475
1476
|
user = new User(userData);
|
|
1476
1477
|
}
|
|
1477
1478
|
break;
|
|
1479
|
+
case "resource":
|
|
1480
|
+
if (action === "DELETE") {
|
|
1481
|
+
const tenant = originalData?.payload?.tenant;
|
|
1482
|
+
const resourceName = originalData?.payload?.resource;
|
|
1483
|
+
const resourceType = originalData?.payload?.kind;
|
|
1484
|
+
if (tenant && resourceName && resourceType) {
|
|
1485
|
+
setResourceDeleting(tenantsMap, tenant, resourceName, resourceType);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
break;
|
|
1478
1489
|
}
|
|
1479
1490
|
|
|
1480
1491
|
setTimeout(async () => {
|
|
@@ -2114,3 +2125,4 @@ export const fetchAndStoreMarketplaceSchema = async (
|
|
|
2114
2125
|
rebuildHierarchy();
|
|
2115
2126
|
await updateUserWithPlatformInfo();
|
|
2116
2127
|
};
|
|
2128
|
+
|