impel-cli 0.7.3 → 0.9.0

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/src/config.js CHANGED
@@ -6,6 +6,7 @@
6
6
  // "gatewayUrl": "https://gateway.useimpel.com",
7
7
  // "appUrl": "https://www.useimpel.com",
8
8
  // "tenantId": "impel",
9
+ // "tenantName": "Impel",
9
10
  // "experimental": { "crossAppModels": true },
10
11
  // "updatedAt": "2026-07-08T00:00:00.000Z"
11
12
  // }
package/src/tenants.js CHANGED
@@ -148,6 +148,12 @@ export async function ensureTenantSelection(config, { refresh = false } = {}) {
148
148
  return {
149
149
  config,
150
150
  tenantId,
151
+ tenantName: config.tenantName || tenantId,
152
+ tenant: {
153
+ id: tenantId,
154
+ slug: tenantId,
155
+ name: config.tenantName || tenantId,
156
+ },
151
157
  tenants: null,
152
158
  defaultTenantId: null,
153
159
  productAccess: normalizeProductAccess(config.productAccess, { allowMissing: true }),
@@ -159,7 +165,9 @@ export async function ensureTenantSelection(config, { refresh = false } = {}) {
159
165
  const current = config.tenantId && listing.tenants.some((tenant) => tenant.id === config.tenantId)
160
166
  ? config.tenantId
161
167
  : listing.defaultTenantId;
168
+ const tenant = listing.tenants.find((candidate) => candidate.id === current);
162
169
  config.tenantId = current;
170
+ config.tenantName = tenant.name;
163
171
  if (listing.productAccess) config.productAccess = listing.productAccess;
164
172
  else delete config.productAccess;
165
173
  if (listing.scopes) config.scopes = listing.scopes;
@@ -169,6 +177,8 @@ export async function ensureTenantSelection(config, { refresh = false } = {}) {
169
177
  return {
170
178
  config,
171
179
  tenantId: current,
180
+ tenantName: tenant.name,
181
+ tenant,
172
182
  tenants: listing.tenants,
173
183
  defaultTenantId: listing.defaultTenantId,
174
184
  productAccess: listing.productAccess,
@@ -184,6 +194,7 @@ export async function selectTenant(config, tenantId) {
184
194
  throw new Error(`tenant "${selected}" is not available to this user`);
185
195
  }
186
196
  config.tenantId = tenant.id;
197
+ config.tenantName = tenant.name;
187
198
  if (listing.productAccess) config.productAccess = listing.productAccess;
188
199
  else delete config.productAccess;
189
200
  if (listing.scopes) config.scopes = listing.scopes;
package/src/updates.js CHANGED
@@ -164,8 +164,13 @@ export function spawnDetachedCacheRefresh() {
164
164
  }
165
165
 
166
166
  /** Background config/catalog/skills convergence; no-ops inside the TTL. */
167
- export function spawnDetachedAppRefresh() {
168
- spawnDetached(["app", "refresh", "--stale-only"]);
167
+ export function spawnDetachedAppRefresh(tenantId = null) {
168
+ spawnDetached([
169
+ "app",
170
+ "refresh",
171
+ "--stale-only",
172
+ ...(tenantId ? ["--tenant", tenantId] : []),
173
+ ]);
169
174
  }
170
175
 
171
176
  function spawnDetached(args) {