@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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-DKOJBWRJ.js";
4
+ } from "./chunk-HETCZVFB.js";
5
5
  import {
6
6
  exitCodeFor
7
7
  } from "./chunk-UKLSRQ5J.js";
@@ -9,4 +9,4 @@ export {
9
9
  exitCodeFor,
10
10
  runCli
11
11
  };
12
- //# sourceMappingURL=cli-DZKEPGBZ.js.map
12
+ //# sourceMappingURL=cli-LGYDXY5R.js.map
package/dist/index.cjs CHANGED
@@ -1858,7 +1858,11 @@ async function resolveOperatorContext(parsed, options = {}) {
1858
1858
  const appEnvironment = clean2(import_node_process10.default.env.ODLA_APP_ID);
1859
1859
  const appValue = appFlag ?? appEnvironment ?? profile.value?.app ?? loaded?.app.id ?? null;
1860
1860
  const appSource = appFlag ? "flag" : appEnvironment ? "environment" : profile.value?.app ? "profile" : loaded ? "config" : "unresolved";
1861
- if (appValue) assertOperatorName(appValue, "app");
1861
+ if (appValue) {
1862
+ for (const id2 of options.allowAppList ? appValue.split(",") : [appValue]) {
1863
+ assertOperatorName(id2.trim(), "app");
1864
+ }
1865
+ }
1862
1866
  if (options.requireApp && !appValue) {
1863
1867
  throw new Error(
1864
1868
  "app context is unresolved; pass --app <id>, set ODLA_APP_ID, select --context <name>, or run inside a project with odla.config.mjs"
@@ -13737,7 +13741,11 @@ async function revoke(parsed, deps, cfg, doFetch, out, json) {
13737
13741
  if (json) out.log(JSON.stringify({ deviceId, revoked: true }, null, 2));
13738
13742
  }
13739
13743
  async function scopedToken2(parsed, deps, cfg, doFetch, out, label, scope = "app:device:enroll") {
13740
- const { credentials } = await resolveOperatorContext(parsed, { allowMissingConfig: true });
13744
+ const { credentials } = await resolveOperatorContext(parsed, {
13745
+ allowMissingConfig: true,
13746
+ // A device is granted the apps named in ONE approval, so --app is a list here.
13747
+ allowAppList: true
13748
+ });
13741
13749
  const scopedTokenFile = credentials.scopedTokenFile;
13742
13750
  return getScopedPlatformToken({
13743
13751
  platform: cfg.platformUrl,