@kumori/aurora-backend-handler 1.1.87 → 1.1.89
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.
- package/api/tenant-api-service.ts +20 -23
- package/package.json +1 -1
|
@@ -198,24 +198,21 @@ export const updateTenant = async (tenant: Tenant, security: string) => {
|
|
|
198
198
|
|
|
199
199
|
const updateBody: Record<string, any> = {
|
|
200
200
|
tenant: tenant.name,
|
|
201
|
+
spec: {},
|
|
201
202
|
};
|
|
202
203
|
if (hasPlan) {
|
|
203
204
|
updateBody.provider = tenant.plan!.provider || "";
|
|
204
205
|
updateBody.plan = tenant.plan!.name;
|
|
205
|
-
} else {
|
|
206
|
-
updateBody.spec =
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
credentials: tenant.npmRegistry!.credentials,
|
|
216
|
-
public: tenant.npmRegistry!.public,
|
|
217
|
-
},
|
|
218
|
-
};
|
|
206
|
+
} else if (hasNpmRegistry) {
|
|
207
|
+
updateBody.spec.registry = isNpmRegistryEmpty
|
|
208
|
+
? null
|
|
209
|
+
: {
|
|
210
|
+
kind: "git",
|
|
211
|
+
endpoint: tenant.npmRegistry!.endpoint,
|
|
212
|
+
domain: tenant.npmRegistry!.domain,
|
|
213
|
+
credentials: tenant.npmRegistry!.credentials,
|
|
214
|
+
public: tenant.npmRegistry!.public,
|
|
215
|
+
};
|
|
219
216
|
}
|
|
220
217
|
|
|
221
218
|
const response = await makeGlobalWebSocketRequest(
|
|
@@ -244,6 +241,8 @@ export const updateTenant = async (tenant: Tenant, security: string) => {
|
|
|
244
241
|
console.error("Error in tenant update WebSocket request:", err);
|
|
245
242
|
const { code: contentMessage, content: errorContent } =
|
|
246
243
|
extractWsErrorInfo(err);
|
|
244
|
+
const { plan, ...tenantWithoutPlan } = tenant;
|
|
245
|
+
eventHelper.tenant.publish.updateError(tenantWithoutPlan as Tenant);
|
|
247
246
|
const tenantUpdateErrorNotification: Notification = {
|
|
248
247
|
type: "error",
|
|
249
248
|
subtype: errors.tenant.updateError.subtype,
|
|
@@ -449,14 +448,10 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
|
|
|
449
448
|
},
|
|
450
449
|
},
|
|
451
450
|
}
|
|
452
|
-
:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
spec: {
|
|
457
|
-
registry: undefined,
|
|
458
|
-
},
|
|
459
|
-
};
|
|
451
|
+
: {
|
|
452
|
+
tenant: tenant.name,
|
|
453
|
+
spec: {},
|
|
454
|
+
};
|
|
460
455
|
const response = await fetch(updateTenantUrl, {
|
|
461
456
|
method: "PATCH",
|
|
462
457
|
headers: {
|
|
@@ -480,7 +475,9 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
|
|
|
480
475
|
};
|
|
481
476
|
eventHelper.notification.publish.creation(tenantCreatedNotification);
|
|
482
477
|
} else {
|
|
483
|
-
|
|
478
|
+
// The request failed, so the plan change must not be reflected as applied.
|
|
479
|
+
const { plan, ...tenantWithoutPlan } = tenant;
|
|
480
|
+
eventHelper.tenant.publish.updateError(tenantWithoutPlan as Tenant);
|
|
484
481
|
|
|
485
482
|
let errorCode = "Unknown error";
|
|
486
483
|
let errorMessage = "Unknown error";
|