@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.cjs CHANGED
@@ -2118,7 +2118,11 @@ async function resolveOperatorContext(parsed, options = {}) {
2118
2118
  const appEnvironment = clean2(import_node_process10.default.env.ODLA_APP_ID);
2119
2119
  const appValue = appFlag ?? appEnvironment ?? profile.value?.app ?? loaded?.app.id ?? null;
2120
2120
  const appSource = appFlag ? "flag" : appEnvironment ? "environment" : profile.value?.app ? "profile" : loaded ? "config" : "unresolved";
2121
- if (appValue) assertOperatorName(appValue, "app");
2121
+ if (appValue) {
2122
+ for (const id2 of options.allowAppList ? appValue.split(",") : [appValue]) {
2123
+ assertOperatorName(id2.trim(), "app");
2124
+ }
2125
+ }
2122
2126
  if (options.requireApp && !appValue) {
2123
2127
  throw new Error(
2124
2128
  "app context is unresolved; pass --app <id>, set ODLA_APP_ID, select --context <name>, or run inside a project with odla.config.mjs"
@@ -14792,7 +14796,11 @@ async function revoke(parsed, deps, cfg, doFetch, out, json) {
14792
14796
  if (json) out.log(JSON.stringify({ deviceId, revoked: true }, null, 2));
14793
14797
  }
14794
14798
  async function scopedToken2(parsed, deps, cfg, doFetch, out, label, scope = "app:device:enroll") {
14795
- const { credentials } = await resolveOperatorContext(parsed, { allowMissingConfig: true });
14799
+ const { credentials } = await resolveOperatorContext(parsed, {
14800
+ allowMissingConfig: true,
14801
+ // A device is granted the apps named in ONE approval, so --app is a list here.
14802
+ allowAppList: true
14803
+ });
14796
14804
  const scopedTokenFile = credentials.scopedTokenFile;
14797
14805
  return getScopedPlatformToken({
14798
14806
  platform: cfg.platformUrl,