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/README.md +87 -21
- package/package.json +1 -1
- package/src/apps.js +109 -34
- package/src/cli.js +16 -7
- package/src/commands/apps.js +127 -32
- package/src/commands/auth.js +4 -0
- package/src/commands/pat.js +331 -0
- package/src/commands/setup.js +1 -0
- package/src/commands/update.js +5 -1
- package/src/config.js +1 -0
- package/src/tenants.js +11 -0
- package/src/updates.js +7 -2
package/src/config.js
CHANGED
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([
|
|
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) {
|