@kumori/aurora-backend-handler 1.1.86 → 1.1.88
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 +14 -20
- 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: {
|
|
202
|
-
registry: !hasNpmRegistry
|
|
203
|
-
? undefined
|
|
204
|
-
: isNpmRegistryEmpty
|
|
205
|
-
? null
|
|
206
|
-
: {
|
|
207
|
-
kind: "git",
|
|
208
|
-
endpoint: tenant.npmRegistry!.endpoint,
|
|
209
|
-
domain: tenant.npmRegistry!.domain,
|
|
210
|
-
credentials: tenant.npmRegistry!.credentials,
|
|
211
|
-
public: tenant.npmRegistry!.public,
|
|
212
|
-
},
|
|
213
|
-
},
|
|
201
|
+
spec: {},
|
|
214
202
|
};
|
|
215
|
-
|
|
216
203
|
if (hasPlan) {
|
|
217
204
|
updateBody.provider = tenant.plan!.provider || "";
|
|
218
205
|
updateBody.plan = tenant.plan!.name;
|
|
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(
|
|
@@ -434,12 +431,11 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
|
|
|
434
431
|
tenant.plan?.provider || ""
|
|
435
432
|
);
|
|
436
433
|
}
|
|
434
|
+
const hasPlan = tenant.plan && tenant.plan?.name !== "" && tenant.plan?.provider !== "";
|
|
437
435
|
const tenantBody =
|
|
438
|
-
tenant.npmRegistry && tenant.npmRegistry.endpoint !== ""
|
|
436
|
+
!hasPlan && tenant.npmRegistry && tenant.npmRegistry.endpoint !== ""
|
|
439
437
|
? {
|
|
440
438
|
tenant: tenant.name,
|
|
441
|
-
provider: tenant.plan?.provider || "",
|
|
442
|
-
plan: tenant.plan?.name || "",
|
|
443
439
|
spec: {
|
|
444
440
|
registry: {
|
|
445
441
|
kind: "git",
|
|
@@ -452,9 +448,7 @@ export const updateTenantHTTP = async (tenant: Tenant) => {
|
|
|
452
448
|
}
|
|
453
449
|
: {
|
|
454
450
|
tenant: tenant.name,
|
|
455
|
-
spec: {
|
|
456
|
-
registry: undefined,
|
|
457
|
-
},
|
|
451
|
+
spec: {},
|
|
458
452
|
};
|
|
459
453
|
const response = await fetch(updateTenantUrl, {
|
|
460
454
|
method: "PATCH",
|