@kumori/aurora-backend-handler 1.1.59 → 1.1.61

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.
@@ -189,7 +189,7 @@ export const updateTenant = async (tenant: Tenant, security: string) => {
189
189
  await initializeGlobalWebSocketClient(security);
190
190
 
191
191
  const hasNpmRegistry =
192
- tenant.npmRegistry && tenant.npmRegistry.endpoint !== "";
192
+ tenant.npmRegistry !== undefined && tenant.npmRegistry !== null;
193
193
  const hasPlan = tenant.plan?.name;
194
194
 
195
195
  const updateBody: Record<string, any> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -569,7 +569,7 @@ const rebuildHierarchy = () => {
569
569
  tenantsMap.forEach((tenant) => {
570
570
  tenant.accounts = Array.from(accountsMap.values()).filter((account) => {
571
571
  account.environments = Array.from(environmentsMap.values())
572
- .filter((env) => env.account === account.id)
572
+ .filter((env) => env.account === account.id && env.tenant === account.tenant)
573
573
  .map((env) => env.name);
574
574
  return account.tenant === tenant.id;
575
575
  });
@@ -815,7 +815,7 @@ const handleEvent = async (message: WSMessage) => {
815
815
  if (!message.payload.deleted) {
816
816
  const accountKey = parentParts.tenant ? `${parentParts.tenant}/${entityId}` : entityId;
817
817
  accountsMap.set(accountKey, accountResult.account);
818
- updateEnvironmentsCloudProvider(entityId, eventData.spec.api);
818
+ updateEnvironmentsCloudProvider(entityId, eventData.spec.api, parentParts.tenant);
819
819
  }
820
820
  break;
821
821
 
@@ -1897,9 +1897,10 @@ const getChannelsInfo = async (
1897
1897
  const updateEnvironmentsCloudProvider = (
1898
1898
  accountId: string,
1899
1899
  cloudProviderName: string,
1900
+ tenantId?: string,
1900
1901
  ) => {
1901
1902
  environmentsMap.forEach((environment, envId) => {
1902
- if (environment.account === accountId) {
1903
+ if (environment.account === accountId && (!tenantId || environment.tenant === tenantId)) {
1903
1904
  environment.cloudProvider = cloudProviderName;
1904
1905
  environmentsMap.set(envId, environment);
1905
1906
  }