@aiam/ciba 0.9.7 → 0.9.8

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.
Files changed (3) hide show
  1. package/ciba.mjs +4 -4
  2. package/package.json +1 -1
  3. package/token.mjs +1 -1
package/ciba.mjs CHANGED
@@ -290,7 +290,7 @@ async function runCodeFlow(serverUrl, code, opts) {
290
290
  log('→ Exchanging code...');
291
291
 
292
292
  // Wait for the default destination token to land via resources map.
293
- const defaultResource = `urn:sap:destination:${process.env.CIBA_DEFAULT_DESTINATION || 'WEBAGENTS_BACKEND'}`;
293
+ const defaultResource = process.env.CIBA_DEFAULT_RESOURCE || 'webagents';
294
294
  const resourcesMap = deviceDoc.getMap('resources');
295
295
 
296
296
  const tokenMapName = await firstInYMap(resourcesMap, () => true, TIMEOUT)
@@ -438,7 +438,7 @@ function startDaemon(provider, deviceDoc, privateKey, serverUrl) {
438
438
  dlog(`${req.command} cmd attrs=${JSON.stringify(req.attrs)}`);
439
439
  const requests = deviceDoc.getMap('requests');
440
440
  const resourcesMap = deviceDoc.getMap('resources');
441
- const defaultResource = `urn:sap:destination:${process.env.CIBA_DEFAULT_DESTINATION || 'WEBAGENTS_BACKEND'}`;
441
+ const defaultResource = process.env.CIBA_DEFAULT_RESOURCE || 'webagents';
442
442
  const attrs = { ...(req.attrs || {}) };
443
443
  const requestedResource = attrs.resource ?? defaultResource;
444
444
 
@@ -652,7 +652,7 @@ const loginCmd = defineCommand({
652
652
  const tokenCmd = defineCommand({
653
653
  meta: { description: 'Return token (cache-first, no daemon needed)' },
654
654
  args: {
655
- resource: { type: 'string', description: 'Resource URN (default: urn:sap:destination:WEBAGENTS_BACKEND)' },
655
+ resource: { type: 'string', description: 'Resource name (default: webagents)' },
656
656
  ...outputArgs,
657
657
  },
658
658
  async run({ args }) {
@@ -671,7 +671,7 @@ const tokenCmd = defineCommand({
671
671
  const refreshCmd = defineCommand({
672
672
  meta: { description: 'Force a fresh token exchange (no re-approval needed)' },
673
673
  args: {
674
- resource: { type: 'string', description: 'Resource URN to refresh (default: WEBAGENTS_BACKEND destination)' },
674
+ resource: { type: 'string', description: 'Resource name to refresh (default: webagents)' },
675
675
  ...outputArgs,
676
676
  },
677
677
  async run({ args }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiam/ciba",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "OAuth 2.0 Device Authorization Grant CLI with cross-device push approval (Yjs sync, ECDH-encrypted token delivery, persistent device id)",
5
5
  "type": "module",
6
6
  "bin": {
package/token.mjs CHANGED
@@ -30,7 +30,7 @@ const args = process.argv.slice(2);
30
30
  const get = (flag) => { const i = args.indexOf(flag); return i !== -1 ? args[i + 1] : undefined; };
31
31
  const has = (flag) => args.includes(flag);
32
32
 
33
- const resource = get('--resource') ?? `urn:sap:destination:${process.env.CIBA_DEFAULT_DESTINATION || 'WEBAGENTS_BACKEND'}`;
33
+ const resource = get('--resource') ?? process.env.CIBA_DEFAULT_RESOURCE ?? 'webagents';
34
34
  const jsonOut = has('--json');
35
35
  const envOut = has('--env');
36
36
  const isRefresh = has('--refresh');