@odla-ai/cli 0.38.0 → 0.38.2

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/dist/bin.js CHANGED
@@ -174,7 +174,7 @@ function absoluteEntryPath(entryPath) {
174
174
 
175
175
  // src/bin.ts
176
176
  var argv = process.argv.slice(2);
177
- requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-DZKEPGBZ.js")).runCli()).catch((err) => {
177
+ requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-LGYDXY5R.js")).runCli()).catch((err) => {
178
178
  console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
179
179
  process.exitCode = exitCodeFor(err);
180
180
  });
@@ -1771,7 +1771,11 @@ async function resolveOperatorContext(parsed, options = {}) {
1771
1771
  const appEnvironment = clean2(process11.env.ODLA_APP_ID);
1772
1772
  const appValue = appFlag ?? appEnvironment ?? profile.value?.app ?? loaded?.app.id ?? null;
1773
1773
  const appSource = appFlag ? "flag" : appEnvironment ? "environment" : profile.value?.app ? "profile" : loaded ? "config" : "unresolved";
1774
- if (appValue) assertOperatorName(appValue, "app");
1774
+ if (appValue) {
1775
+ for (const id2 of options.allowAppList ? appValue.split(",") : [appValue]) {
1776
+ assertOperatorName(id2.trim(), "app");
1777
+ }
1778
+ }
1775
1779
  if (options.requireApp && !appValue) {
1776
1780
  throw new Error(
1777
1781
  "app context is unresolved; pass --app <id>, set ODLA_APP_ID, select --context <name>, or run inside a project with odla.config.mjs"
@@ -13610,7 +13614,11 @@ async function revoke(parsed, deps, cfg, doFetch, out, json) {
13610
13614
  if (json) out.log(JSON.stringify({ deviceId, revoked: true }, null, 2));
13611
13615
  }
13612
13616
  async function scopedToken2(parsed, deps, cfg, doFetch, out, label, scope = "app:device:enroll") {
13613
- const { credentials } = await resolveOperatorContext(parsed, { allowMissingConfig: true });
13617
+ const { credentials } = await resolveOperatorContext(parsed, {
13618
+ allowMissingConfig: true,
13619
+ // A device is granted the apps named in ONE approval, so --app is a list here.
13620
+ allowAppList: true
13621
+ });
13614
13622
  const scopedTokenFile = credentials.scopedTokenFile;
13615
13623
  return getScopedPlatformToken({
13616
13624
  platform: cfg.platformUrl,
@@ -15400,4 +15408,4 @@ export {
15400
15408
  isTerminalHostedSecurityStatus,
15401
15409
  runCli
15402
15410
  };
15403
- //# sourceMappingURL=chunk-DKOJBWRJ.js.map
15411
+ //# sourceMappingURL=chunk-HETCZVFB.js.map