@nevermined-io/cli 1.4.1 → 1.5.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/dist/commands/cards/delegate.d.ts +2 -1
- package/dist/commands/cards/delegate.d.ts.map +1 -1
- package/dist/commands/cards/delegate.js +6 -4
- package/dist/commands/cards/delegate.js.map +1 -1
- package/dist/commands/cards/enroll.d.ts +2 -1
- package/dist/commands/cards/enroll.d.ts.map +1 -1
- package/dist/commands/cards/enroll.js +6 -4
- package/dist/commands/cards/enroll.js.map +1 -1
- package/dist/commands/cards/setup.d.ts +2 -1
- package/dist/commands/cards/setup.d.ts.map +1 -1
- package/dist/commands/cards/setup.js +6 -4
- package/dist/commands/cards/setup.js.map +1 -1
- package/dist/utils/widget-redirect-flow.d.ts +41 -6
- package/dist/utils/widget-redirect-flow.d.ts.map +1 -1
- package/dist/utils/widget-redirect-flow.js +41 -4
- package/dist/utils/widget-redirect-flow.js.map +1 -1
- package/oclif.manifest.json +175 -175
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
2
|
/**
|
|
3
3
|
* Single-purpose delegation creation. Opens the chromeless
|
|
4
|
-
* `/
|
|
4
|
+
* `/cards/delegate?paymentMethodId=<id>` page of the standalone embed
|
|
5
|
+
* app (`embed.<tier>`) where the user
|
|
5
6
|
* fills in spending limit / duration / max-transactions and submits;
|
|
6
7
|
* the resulting `delegationId` is redirected back to a localhost
|
|
7
8
|
* callback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/commands/cards/delegate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/commands/cards/delegate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAQnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IACpD,OAAgB,WAAW,SACuD;IAElF,OAAgB,QAAQ,WAIvB;IAED,OAAgB,KAAK;;;;;;;MAepB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqDlC"}
|
|
@@ -2,10 +2,11 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { Environments } from '@nevermined-io/payments';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import { resolveOrgIdInteractive } from '../../utils/orgs.js';
|
|
5
|
-
import { mintSelfWidgetSession, runWidgetRedirectFlow, } from '../../utils/widget-redirect-flow.js';
|
|
5
|
+
import { mintSelfWidgetSession, resolveEmbedNetwork, runWidgetRedirectFlow, } from '../../utils/widget-redirect-flow.js';
|
|
6
6
|
/**
|
|
7
7
|
* Single-purpose delegation creation. Opens the chromeless
|
|
8
|
-
* `/
|
|
8
|
+
* `/cards/delegate?paymentMethodId=<id>` page of the standalone embed
|
|
9
|
+
* app (`embed.<tier>`) where the user
|
|
9
10
|
* fills in spending limit / duration / max-transactions and submits;
|
|
10
11
|
* the resulting `delegationId` is redirected back to a localhost
|
|
11
12
|
* callback.
|
|
@@ -52,8 +53,9 @@ export default class CardsDelegate extends BaseCommand {
|
|
|
52
53
|
this.error(`Unknown environment: ${String(environment)}`, { exit: 1 });
|
|
53
54
|
}
|
|
54
55
|
const result = await runWidgetRedirectFlow({
|
|
55
|
-
|
|
56
|
-
embedPath: '/
|
|
56
|
+
embedUrl: env.embed,
|
|
57
|
+
embedPath: '/cards/delegate',
|
|
58
|
+
network: resolveEmbedNetwork(environment),
|
|
57
59
|
mintSession: async ({ returnUrl }) => {
|
|
58
60
|
const session = await mintSelfWidgetSession({
|
|
59
61
|
backendUrl: env.backend,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../../src/commands/cards/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,qCAAqC,CAAA;AAE5C
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../../src/commands/cards/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,qCAAqC,CAAA;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IACpD,MAAM,CAAU,WAAW,GACzB,gFAAgF,CAAA;IAElF,MAAM,CAAU,QAAQ,GAAG;QACzB,iDAAiD;QACjD,mEAAmE;QACnE,8DAA8D;KAC/D,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,SAAS;QACxB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,gEAAgE;YAC7E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,WAAW,EACT,mJAAmJ;YACrJ,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC;YAC1B,WAAW,EAAE,0DAA0D;YACvE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,CAAA;oBACH,CAAC;oBACD,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAA;gBAC/C,CAAC;gBACD,iBAAiB,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC,IAAc,EAAE;gBAC5D,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;gBAC9B,GAAG,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBACnC,gBAAgB,EAAE,oBAAoB;gBACtC,cAAc,EAAE,kEAAkE;aACnF,CAAC,CAAA;YAEF,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAA;YAC9C,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,IAAI,CAAC,KAAK,CAAC,+CAA+C,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC1E,CAAC;YACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,qCAAqC,YAAY,EAAE,CAAC,CAAA;YAC3E,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;QAC7E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC;IACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
2
|
/**
|
|
3
3
|
* Single-purpose card enrolment. Opens the chromeless
|
|
4
|
-
* `/
|
|
4
|
+
* `/cards/enroll` page of the standalone embed app (`embed.<tier>`)
|
|
5
|
+
* in the browser, completes the
|
|
5
6
|
* tokenization step against the chosen provider, and redirects the
|
|
6
7
|
* resulting `paymentMethodId` back to a localhost callback.
|
|
7
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enroll.d.ts","sourceRoot":"","sources":["../../../src/commands/cards/enroll.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"enroll.d.ts","sourceRoot":"","sources":["../../../src/commands/cards/enroll.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAQnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,OAAgB,WAAW,SACyF;IAEpH,OAAgB,QAAQ,WAKvB;IAED,OAAgB,KAAK;;;;;;;MAgBpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqDlC"}
|
|
@@ -2,10 +2,11 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { Environments } from '@nevermined-io/payments';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import { resolveOrgIdInteractive } from '../../utils/orgs.js';
|
|
5
|
-
import { mintSelfWidgetSession, runWidgetRedirectFlow, } from '../../utils/widget-redirect-flow.js';
|
|
5
|
+
import { mintSelfWidgetSession, resolveEmbedNetwork, runWidgetRedirectFlow, } from '../../utils/widget-redirect-flow.js';
|
|
6
6
|
/**
|
|
7
7
|
* Single-purpose card enrolment. Opens the chromeless
|
|
8
|
-
* `/
|
|
8
|
+
* `/cards/enroll` page of the standalone embed app (`embed.<tier>`)
|
|
9
|
+
* in the browser, completes the
|
|
9
10
|
* tokenization step against the chosen provider, and redirects the
|
|
10
11
|
* resulting `paymentMethodId` back to a localhost callback.
|
|
11
12
|
*
|
|
@@ -53,8 +54,9 @@ export default class CardsEnroll extends BaseCommand {
|
|
|
53
54
|
this.error(`Unknown environment: ${String(environment)}`, { exit: 1 });
|
|
54
55
|
}
|
|
55
56
|
const result = await runWidgetRedirectFlow({
|
|
56
|
-
|
|
57
|
-
embedPath: '/
|
|
57
|
+
embedUrl: env.embed,
|
|
58
|
+
embedPath: '/cards/enroll',
|
|
59
|
+
network: resolveEmbedNetwork(environment),
|
|
58
60
|
mintSession: async ({ returnUrl }) => {
|
|
59
61
|
const session = await mintSelfWidgetSession({
|
|
60
62
|
backendUrl: env.backend,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enroll.js","sourceRoot":"","sources":["../../../src/commands/cards/enroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,qCAAqC,CAAA;AAE5C
|
|
1
|
+
{"version":3,"file":"enroll.js","sourceRoot":"","sources":["../../../src/commands/cards/enroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,qCAAqC,CAAA;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,MAAM,CAAU,WAAW,GACzB,kHAAkH,CAAA;IAEpH,MAAM,CAAU,QAAQ,GAAG;QACzB,gCAAgC;QAChC,kDAAkD;QAClD,qDAAqD;QACrD,6CAA6C;KAC9C,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,SAAS;QACxB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,WAAW,EACT,mJAAmJ;Y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
|
4
|
-
* browser at the chromeless `/
|
|
4
|
+
* browser at the chromeless `/cards/setup` page of the standalone embed
|
|
5
|
+
* app (`embed.<tier>`), where they
|
|
5
6
|
* enrol a card and create a spending delegation in one session, and
|
|
6
7
|
* receives `paymentMethodId` + `delegationId` back at a localhost
|
|
7
8
|
* callback the CLI starts for the duration of the flow.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/commands/cards/setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/commands/cards/setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAQnD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,OAAgB,WAAW,SAC0F;IAErH,OAAgB,QAAQ,WAIvB;IAED,OAAgB,KAAK;;;;;;;MAgBpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiFlC"}
|
|
@@ -2,10 +2,11 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { Environments } from '@nevermined-io/payments';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
4
|
import { resolveOrgIdInteractive } from '../../utils/orgs.js';
|
|
5
|
-
import { mintSelfWidgetSession, runWidgetRedirectFlow, } from '../../utils/widget-redirect-flow.js';
|
|
5
|
+
import { mintSelfWidgetSession, resolveEmbedNetwork, runWidgetRedirectFlow, } from '../../utils/widget-redirect-flow.js';
|
|
6
6
|
/**
|
|
7
7
|
* Combined "set up a card for agent spend" flow. Opens the user's
|
|
8
|
-
* browser at the chromeless `/
|
|
8
|
+
* browser at the chromeless `/cards/setup` page of the standalone embed
|
|
9
|
+
* app (`embed.<tier>`), where they
|
|
9
10
|
* enrol a card and create a spending delegation in one session, and
|
|
10
11
|
* receives `paymentMethodId` + `delegationId` back at a localhost
|
|
11
12
|
* callback the CLI starts for the duration of the flow.
|
|
@@ -69,8 +70,9 @@ export default class CardsSetup extends BaseCommand {
|
|
|
69
70
|
this.error(`Unknown environment: ${String(environment)}`, { exit: 1 });
|
|
70
71
|
}
|
|
71
72
|
const result = await runWidgetRedirectFlow({
|
|
72
|
-
|
|
73
|
-
embedPath: '/
|
|
73
|
+
embedUrl: env.embed,
|
|
74
|
+
embedPath: '/cards/setup',
|
|
75
|
+
network: resolveEmbedNetwork(environment),
|
|
74
76
|
// Mint AFTER the local server binds — `runWidgetRedirectFlow`
|
|
75
77
|
// gives us the actual returnUrl so the backend can validate it
|
|
76
78
|
// at session-creation time (per the documented `isReturnUrlAllowed`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/commands/cards/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,qCAAqC,CAAA;AAE5C
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/commands/cards/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,qCAAqC,CAAA;AAE5C;;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C,YAAY,CAAC;gBAC9B,GAAG,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBACnC,gBAAgB,EAAE,qBAAqB;gBACvC,cAAc,EAAE,yDAAyD;aAC1E,CAAC,CAAA;YAEF,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,eAAe,CAAA;YACpD,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAA;YAC9C,IAAI,CAAC,eAAe,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtC,IAAI,CAAC,KAAK,CACR,mEAAmE,eAAe,IAAI,SAAS,kBAAkB,YAAY,IAAI,SAAS,IAAI,EAC9I,EAAE,IAAI,EAAE,CAAC,EAAE,CACZ,CAAA;YACH,CAAC;YAED,IAAI,CAAC,SAAS,CAAC,OAAO,CACpB,wBAAwB;gBACtB,sBAAsB,eAAe,IAAI;gBACzC,sBAAsB,YAAY,IAAI;gBACtC,sBAAsB,KAAK,EAAE,CAChC,CAAA;YACD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAA;QACjE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC;IACH,CAAC"}
|
|
@@ -1,11 +1,45 @@
|
|
|
1
|
+
import type { EnvironmentName } from '@nevermined-io/payments';
|
|
2
|
+
/**
|
|
3
|
+
* The network the embed app resolves its active backend from. The embed
|
|
4
|
+
* app reads `?network=` on mount and defaults to `sandbox` when absent
|
|
5
|
+
* (it never decodes the session token to infer it), so a CLI flow that
|
|
6
|
+
* omits this lands a live-minted session on the sandbox backend and
|
|
7
|
+
* fails. We always forward it explicitly. See issue #362.
|
|
8
|
+
*/
|
|
9
|
+
export type EmbedNetwork = 'sandbox' | 'live';
|
|
10
|
+
/**
|
|
11
|
+
* Map a CLI environment name to the embed app's `network` value. The
|
|
12
|
+
* `embed` origin is shared across the sandbox/live pair within a tier
|
|
13
|
+
* (`embed.nevermined.app` for both `sandbox` and `live`), differentiated
|
|
14
|
+
* only by the backend the session is validated against — so the embed
|
|
15
|
+
* app cannot infer the network from the origin and we must pass it.
|
|
16
|
+
*
|
|
17
|
+
* `custom` has no fixed tier, so we sniff `NVM_BACKEND_URL`: a backend
|
|
18
|
+
* host containing `live` selects `live`, otherwise we fall back to
|
|
19
|
+
* `sandbox` (matching the embed app's own default).
|
|
20
|
+
*
|
|
21
|
+
* NOTE: `live` is only matched as a dot/slash-bounded segment (the
|
|
22
|
+
* `api.live.<host>` convention), so a hyphenated host like
|
|
23
|
+
* `https://api-live.example.com` would fall through to `sandbox`. That's
|
|
24
|
+
* intentional given the naming convention; a `custom` deployment that
|
|
25
|
+
* doesn't follow it should set `NVM_BACKEND_URL` to a conforming host.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveEmbedNetwork(environment: EnvironmentName): EmbedNetwork;
|
|
1
28
|
export interface WidgetRedirectFlowOptions {
|
|
2
|
-
/**
|
|
3
|
-
|
|
29
|
+
/** Embed app base URL — e.g. `Environments[env].embed` (`embed.<tier>`). */
|
|
30
|
+
embedUrl: string;
|
|
4
31
|
/**
|
|
5
|
-
* Relative embed
|
|
6
|
-
* `/
|
|
32
|
+
* Relative path on the embed app the CLI wants to open, e.g.
|
|
33
|
+
* `/cards/setup` or `/cards/enroll`.
|
|
7
34
|
*/
|
|
8
35
|
embedPath: string;
|
|
36
|
+
/**
|
|
37
|
+
* Embed-app network (`sandbox` / `live`). Forwarded as `?network=` so
|
|
38
|
+
* the embed app validates the session against the matching backend —
|
|
39
|
+
* derive it from the active environment via `resolveEmbedNetwork`.
|
|
40
|
+
* Required: omitting it lets live flows silently hit sandbox (#362).
|
|
41
|
+
*/
|
|
42
|
+
network: EmbedNetwork;
|
|
9
43
|
/**
|
|
10
44
|
* Called once the local callback server is listening, with the bound
|
|
11
45
|
* `returnUrl`. The caller mints a widget session against that URL and
|
|
@@ -38,7 +72,8 @@ export interface WidgetRedirectFlowResult {
|
|
|
38
72
|
}
|
|
39
73
|
/**
|
|
40
74
|
* Shared redirect-mode handshake for any CLI command that hands the user
|
|
41
|
-
* off to
|
|
75
|
+
* off to a `/cards/*` page on the standalone embed app (`embed.<tier>`)
|
|
76
|
+
* and waits for a localhost callback.
|
|
42
77
|
*
|
|
43
78
|
* Flow:
|
|
44
79
|
* 1. Bind a one-shot HTTP server on `127.0.0.1:0` (the OS picks a free port).
|
|
@@ -50,7 +85,7 @@ export interface WidgetRedirectFlowResult {
|
|
|
50
85
|
* `127.0.0.1` and Node 17+ resolves `localhost` to `::1` first on
|
|
51
86
|
* modern hosts — the browser would stall on the IPv6 attempt before
|
|
52
87
|
* falling back to IPv4.
|
|
53
|
-
* 3. Open the browser at `{
|
|
88
|
+
* 3. Open the browser at `{embed}/<path>?sessionToken=…&returnUrl=…&state=<rand>`.
|
|
54
89
|
* 4. Resolve when the embed page redirects to `/callback?…&state=<echo>`.
|
|
55
90
|
* `state` is compared in constant time.
|
|
56
91
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-redirect-flow.d.ts","sourceRoot":"","sources":["../../src/utils/widget-redirect-flow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"widget-redirect-flow.d.ts","sourceRoot":"","sources":["../../src/utils/widget-redirect-flow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAI9D;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,CAAA;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,eAAe,GAAG,YAAY,CAa9E;AA6BD,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,SAAS,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M,CAAA;CACnB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAyDnC"}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { createServer } from 'http';
|
|
2
2
|
import { randomBytes, timingSafeEqual } from 'crypto';
|
|
3
3
|
import { openBrowser } from './browser.js';
|
|
4
|
+
/**
|
|
5
|
+
* Map a CLI environment name to the embed app's `network` value. The
|
|
6
|
+
* `embed` origin is shared across the sandbox/live pair within a tier
|
|
7
|
+
* (`embed.nevermined.app` for both `sandbox` and `live`), differentiated
|
|
8
|
+
* only by the backend the session is validated against — so the embed
|
|
9
|
+
* app cannot infer the network from the origin and we must pass it.
|
|
10
|
+
*
|
|
11
|
+
* `custom` has no fixed tier, so we sniff `NVM_BACKEND_URL`: a backend
|
|
12
|
+
* host containing `live` selects `live`, otherwise we fall back to
|
|
13
|
+
* `sandbox` (matching the embed app's own default).
|
|
14
|
+
*
|
|
15
|
+
* NOTE: `live` is only matched as a dot/slash-bounded segment (the
|
|
16
|
+
* `api.live.<host>` convention), so a hyphenated host like
|
|
17
|
+
* `https://api-live.example.com` would fall through to `sandbox`. That's
|
|
18
|
+
* intentional given the naming convention; a `custom` deployment that
|
|
19
|
+
* doesn't follow it should set `NVM_BACKEND_URL` to a conforming host.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveEmbedNetwork(environment) {
|
|
22
|
+
switch (environment) {
|
|
23
|
+
case 'live':
|
|
24
|
+
case 'staging_live':
|
|
25
|
+
return 'live';
|
|
26
|
+
case 'sandbox':
|
|
27
|
+
case 'staging_sandbox':
|
|
28
|
+
return 'sandbox';
|
|
29
|
+
case 'custom':
|
|
30
|
+
return /(^|[.\/])live([.\/]|$)/.test((process.env.NVM_BACKEND_URL || '').toLowerCase())
|
|
31
|
+
? 'live'
|
|
32
|
+
: 'sandbox';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
4
35
|
const SELF_MINT_FETCH_TIMEOUT_MS = 15_000;
|
|
5
36
|
/**
|
|
6
37
|
* Default timeout for a redirect-mode CLI flow. Mirrors the existing
|
|
@@ -28,7 +59,8 @@ function safeEqualHexState(received, expected) {
|
|
|
28
59
|
}
|
|
29
60
|
/**
|
|
30
61
|
* Shared redirect-mode handshake for any CLI command that hands the user
|
|
31
|
-
* off to
|
|
62
|
+
* off to a `/cards/*` page on the standalone embed app (`embed.<tier>`)
|
|
63
|
+
* and waits for a localhost callback.
|
|
32
64
|
*
|
|
33
65
|
* Flow:
|
|
34
66
|
* 1. Bind a one-shot HTTP server on `127.0.0.1:0` (the OS picks a free port).
|
|
@@ -40,7 +72,7 @@ function safeEqualHexState(received, expected) {
|
|
|
40
72
|
* `127.0.0.1` and Node 17+ resolves `localhost` to `::1` first on
|
|
41
73
|
* modern hosts — the browser would stall on the IPv6 attempt before
|
|
42
74
|
* falling back to IPv4.
|
|
43
|
-
* 3. Open the browser at `{
|
|
75
|
+
* 3. Open the browser at `{embed}/<path>?sessionToken=…&returnUrl=…&state=<rand>`.
|
|
44
76
|
* 4. Resolve when the embed page redirects to `/callback?…&state=<echo>`.
|
|
45
77
|
* `state` is compared in constant time.
|
|
46
78
|
*
|
|
@@ -124,11 +156,12 @@ export async function runWidgetRedirectFlow(opts) {
|
|
|
124
156
|
return;
|
|
125
157
|
}
|
|
126
158
|
const browserUrl = buildEmbedUrl({
|
|
127
|
-
|
|
159
|
+
embedUrl: opts.embedUrl,
|
|
128
160
|
embedPath: opts.embedPath,
|
|
129
161
|
sessionToken,
|
|
130
162
|
returnUrl,
|
|
131
163
|
state,
|
|
164
|
+
network: opts.network,
|
|
132
165
|
extra: opts.extraSearchParams,
|
|
133
166
|
});
|
|
134
167
|
if (opts.noBrowser) {
|
|
@@ -152,7 +185,7 @@ export async function runWidgetRedirectFlow(opts) {
|
|
|
152
185
|
});
|
|
153
186
|
}
|
|
154
187
|
function buildEmbedUrl(opts) {
|
|
155
|
-
const url = new URL(opts.embedPath, opts.
|
|
188
|
+
const url = new URL(opts.embedPath, opts.embedUrl);
|
|
156
189
|
url.searchParams.set('sessionToken', opts.sessionToken);
|
|
157
190
|
url.searchParams.set('returnUrl', opts.returnUrl);
|
|
158
191
|
url.searchParams.set('state', opts.state);
|
|
@@ -161,6 +194,10 @@ function buildEmbedUrl(opts) {
|
|
|
161
194
|
url.searchParams.set(k, v);
|
|
162
195
|
}
|
|
163
196
|
}
|
|
197
|
+
// Set AFTER `extra` so a caller can never accidentally clobber the
|
|
198
|
+
// network the embed app keys its backend selection off of —
|
|
199
|
+
// `URLSearchParams.set` overwrites, so writing it last makes it win.
|
|
200
|
+
url.searchParams.set('network', opts.network);
|
|
164
201
|
return url.toString();
|
|
165
202
|
}
|
|
166
203
|
function successHtml(title, message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-redirect-flow.js","sourceRoot":"","sources":["../../src/utils/widget-redirect-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmC,MAAM,MAAM,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"widget-redirect-flow.js","sourceRoot":"","sources":["../../src/utils/widget-redirect-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmC,MAAM,MAAM,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAW1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAA4B;IAC9D,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC;QACZ,KAAK,cAAc;YACjB,OAAO,MAAM,CAAA;QACf,KAAK,SAAS,CAAC;QACf,KAAK,iBAAiB;YACpB,OAAO,SAAS,CAAA;QAClB,KAAK,QAAQ;YACX,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IA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906
|
-
"delegation:list-payment-methods": {
|
|
907
|
-
"aliases": [],
|
|
908
|
-
"args": {},
|
|
909
|
-
"description": "List enrolled credit/debit cards available for card-delegation (fiat) payments.",
|
|
910
|
-
"examples": [
|
|
911
|
-
"$ nvm delegation list-payment-methods",
|
|
912
|
-
"$ nvm delegation list-payment-methods --format json"
|
|
913
|
-
],
|
|
914
|
-
"flags": {
|
|
915
|
-
"profile": {
|
|
916
|
-
"char": "p",
|
|
917
|
-
"description": "Configuration profile to use",
|
|
918
|
-
"name": "profile",
|
|
919
|
-
"required": false,
|
|
920
|
-
"hasDynamicHelp": false,
|
|
921
|
-
"multiple": false,
|
|
922
|
-
"type": "option"
|
|
923
|
-
},
|
|
924
|
-
"format": {
|
|
925
|
-
"char": "f",
|
|
926
|
-
"description": "Output format",
|
|
927
|
-
"name": "format",
|
|
928
|
-
"default": "table",
|
|
929
|
-
"hasDynamicHelp": false,
|
|
930
|
-
"multiple": false,
|
|
931
|
-
"options": [
|
|
932
|
-
"table",
|
|
933
|
-
"json",
|
|
934
|
-
"quiet"
|
|
935
|
-
],
|
|
936
|
-
"type": "option"
|
|
937
|
-
},
|
|
938
|
-
"verbose": {
|
|
939
|
-
"char": "v",
|
|
940
|
-
"description": "Verbose output",
|
|
941
|
-
"name": "verbose",
|
|
942
|
-
"allowNo": false,
|
|
943
|
-
"type": "boolean"
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
"hasDynamicHelp": false,
|
|
947
|
-
"hiddenAliases": [],
|
|
948
|
-
"id": "delegation:list-payment-methods",
|
|
949
|
-
"pluginAlias": "@nevermined-io/cli",
|
|
950
|
-
"pluginName": "@nevermined-io/cli",
|
|
951
|
-
"pluginType": "core",
|
|
952
|
-
"strict": true,
|
|
953
|
-
"enableJsonFlag": false,
|
|
954
|
-
"isESM": true,
|
|
955
|
-
"relativePath": [
|
|
956
|
-
"dist",
|
|
957
|
-
"commands",
|
|
958
|
-
"delegation",
|
|
959
|
-
"list-payment-methods.js"
|
|
960
|
-
]
|
|
961
|
-
},
|
|
962
906
|
"config:init": {
|
|
963
907
|
"aliases": [],
|
|
964
908
|
"args": {},
|
|
@@ -1180,6 +1124,62 @@
|
|
|
1180
1124
|
"show.js"
|
|
1181
1125
|
]
|
|
1182
1126
|
},
|
|
1127
|
+
"delegation:list-payment-methods": {
|
|
1128
|
+
"aliases": [],
|
|
1129
|
+
"args": {},
|
|
1130
|
+
"description": "List enrolled credit/debit cards available for card-delegation (fiat) payments.",
|
|
1131
|
+
"examples": [
|
|
1132
|
+
"$ nvm delegation list-payment-methods",
|
|
1133
|
+
"$ nvm delegation list-payment-methods --format json"
|
|
1134
|
+
],
|
|
1135
|
+
"flags": {
|
|
1136
|
+
"profile": {
|
|
1137
|
+
"char": "p",
|
|
1138
|
+
"description": "Configuration profile to use",
|
|
1139
|
+
"name": "profile",
|
|
1140
|
+
"required": false,
|
|
1141
|
+
"hasDynamicHelp": false,
|
|
1142
|
+
"multiple": false,
|
|
1143
|
+
"type": "option"
|
|
1144
|
+
},
|
|
1145
|
+
"format": {
|
|
1146
|
+
"char": "f",
|
|
1147
|
+
"description": "Output format",
|
|
1148
|
+
"name": "format",
|
|
1149
|
+
"default": "table",
|
|
1150
|
+
"hasDynamicHelp": false,
|
|
1151
|
+
"multiple": false,
|
|
1152
|
+
"options": [
|
|
1153
|
+
"table",
|
|
1154
|
+
"json",
|
|
1155
|
+
"quiet"
|
|
1156
|
+
],
|
|
1157
|
+
"type": "option"
|
|
1158
|
+
},
|
|
1159
|
+
"verbose": {
|
|
1160
|
+
"char": "v",
|
|
1161
|
+
"description": "Verbose output",
|
|
1162
|
+
"name": "verbose",
|
|
1163
|
+
"allowNo": false,
|
|
1164
|
+
"type": "boolean"
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
"hasDynamicHelp": false,
|
|
1168
|
+
"hiddenAliases": [],
|
|
1169
|
+
"id": "delegation:list-payment-methods",
|
|
1170
|
+
"pluginAlias": "@nevermined-io/cli",
|
|
1171
|
+
"pluginName": "@nevermined-io/cli",
|
|
1172
|
+
"pluginType": "core",
|
|
1173
|
+
"strict": true,
|
|
1174
|
+
"enableJsonFlag": false,
|
|
1175
|
+
"isESM": true,
|
|
1176
|
+
"relativePath": [
|
|
1177
|
+
"dist",
|
|
1178
|
+
"commands",
|
|
1179
|
+
"delegation",
|
|
1180
|
+
"list-payment-methods.js"
|
|
1181
|
+
]
|
|
1182
|
+
},
|
|
1183
1183
|
"facilitator:settle-permissions": {
|
|
1184
1184
|
"aliases": [],
|
|
1185
1185
|
"args": {},
|
|
@@ -1306,6 +1306,124 @@
|
|
|
1306
1306
|
"verify-permissions.js"
|
|
1307
1307
|
]
|
|
1308
1308
|
},
|
|
1309
|
+
"x402token:get-x402-access-token": {
|
|
1310
|
+
"aliases": [],
|
|
1311
|
+
"args": {
|
|
1312
|
+
"plan": {
|
|
1313
|
+
"description": "plan identifier",
|
|
1314
|
+
"name": "plan",
|
|
1315
|
+
"required": true
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
"description": "Create a delegation and get an X402 access token for the given plan. Supports both crypto (erc4337) and fiat (card-delegation) payment schemes.",
|
|
1319
|
+
"examples": [
|
|
1320
|
+
"$ nvm x402token get-x402-access-token <planId>",
|
|
1321
|
+
"$ nvm x402token get-x402-access-token <planId> --payment-type fiat",
|
|
1322
|
+
"$ nvm x402token get-x402-access-token <planId> --payment-type fiat --payment-method-id pm_1AbCdEfGhIjKlM --spending-limit-cents 5000",
|
|
1323
|
+
"$ nvm x402token get-x402-access-token <planId> --spending-limit-cents 100000 --delegation-duration-secs 604800",
|
|
1324
|
+
"$ nvm x402token get-x402-access-token <planId> --auto-resolve-scheme"
|
|
1325
|
+
],
|
|
1326
|
+
"flags": {
|
|
1327
|
+
"profile": {
|
|
1328
|
+
"char": "p",
|
|
1329
|
+
"description": "Configuration profile to use",
|
|
1330
|
+
"name": "profile",
|
|
1331
|
+
"required": false,
|
|
1332
|
+
"hasDynamicHelp": false,
|
|
1333
|
+
"multiple": false,
|
|
1334
|
+
"type": "option"
|
|
1335
|
+
},
|
|
1336
|
+
"format": {
|
|
1337
|
+
"char": "f",
|
|
1338
|
+
"description": "Output format",
|
|
1339
|
+
"name": "format",
|
|
1340
|
+
"default": "table",
|
|
1341
|
+
"hasDynamicHelp": false,
|
|
1342
|
+
"multiple": false,
|
|
1343
|
+
"options": [
|
|
1344
|
+
"table",
|
|
1345
|
+
"json",
|
|
1346
|
+
"quiet"
|
|
1347
|
+
],
|
|
1348
|
+
"type": "option"
|
|
1349
|
+
},
|
|
1350
|
+
"verbose": {
|
|
1351
|
+
"char": "v",
|
|
1352
|
+
"description": "Verbose output",
|
|
1353
|
+
"name": "verbose",
|
|
1354
|
+
"allowNo": false,
|
|
1355
|
+
"type": "boolean"
|
|
1356
|
+
},
|
|
1357
|
+
"agent-id": {
|
|
1358
|
+
"name": "agent-id",
|
|
1359
|
+
"required": false,
|
|
1360
|
+
"hasDynamicHelp": false,
|
|
1361
|
+
"multiple": false,
|
|
1362
|
+
"type": "option"
|
|
1363
|
+
},
|
|
1364
|
+
"payment-type": {
|
|
1365
|
+
"description": "Payment type: \"crypto\" (default) or \"fiat\" (card-delegation)",
|
|
1366
|
+
"name": "payment-type",
|
|
1367
|
+
"required": false,
|
|
1368
|
+
"default": "crypto",
|
|
1369
|
+
"hasDynamicHelp": false,
|
|
1370
|
+
"multiple": false,
|
|
1371
|
+
"options": [
|
|
1372
|
+
"crypto",
|
|
1373
|
+
"fiat"
|
|
1374
|
+
],
|
|
1375
|
+
"type": "option"
|
|
1376
|
+
},
|
|
1377
|
+
"payment-method-id": {
|
|
1378
|
+
"description": "Stripe payment method ID (pm_...). Only for fiat. If omitted, auto-selects first enrolled card.",
|
|
1379
|
+
"name": "payment-method-id",
|
|
1380
|
+
"required": false,
|
|
1381
|
+
"hasDynamicHelp": false,
|
|
1382
|
+
"multiple": false,
|
|
1383
|
+
"type": "option"
|
|
1384
|
+
},
|
|
1385
|
+
"spending-limit-cents": {
|
|
1386
|
+
"description": "Max spending limit in cents (default: 1000)",
|
|
1387
|
+
"name": "spending-limit-cents",
|
|
1388
|
+
"required": false,
|
|
1389
|
+
"default": 1000,
|
|
1390
|
+
"hasDynamicHelp": false,
|
|
1391
|
+
"multiple": false,
|
|
1392
|
+
"type": "option"
|
|
1393
|
+
},
|
|
1394
|
+
"delegation-duration-secs": {
|
|
1395
|
+
"description": "Delegation duration in seconds (default: 3600)",
|
|
1396
|
+
"name": "delegation-duration-secs",
|
|
1397
|
+
"required": false,
|
|
1398
|
+
"default": 3600,
|
|
1399
|
+
"hasDynamicHelp": false,
|
|
1400
|
+
"multiple": false,
|
|
1401
|
+
"type": "option"
|
|
1402
|
+
},
|
|
1403
|
+
"auto-resolve-scheme": {
|
|
1404
|
+
"description": "Auto-detect crypto vs fiat from plan metadata (overrides --payment-type)",
|
|
1405
|
+
"name": "auto-resolve-scheme",
|
|
1406
|
+
"required": false,
|
|
1407
|
+
"allowNo": false,
|
|
1408
|
+
"type": "boolean"
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
"hasDynamicHelp": false,
|
|
1412
|
+
"hiddenAliases": [],
|
|
1413
|
+
"id": "x402token:get-x402-access-token",
|
|
1414
|
+
"pluginAlias": "@nevermined-io/cli",
|
|
1415
|
+
"pluginName": "@nevermined-io/cli",
|
|
1416
|
+
"pluginType": "core",
|
|
1417
|
+
"strict": true,
|
|
1418
|
+
"enableJsonFlag": false,
|
|
1419
|
+
"isESM": true,
|
|
1420
|
+
"relativePath": [
|
|
1421
|
+
"dist",
|
|
1422
|
+
"commands",
|
|
1423
|
+
"x402token",
|
|
1424
|
+
"get-x402-access-token.js"
|
|
1425
|
+
]
|
|
1426
|
+
},
|
|
1309
1427
|
"organizations:connect-stripe-account": {
|
|
1310
1428
|
"aliases": [],
|
|
1311
1429
|
"args": {},
|
|
@@ -1656,124 +1774,6 @@
|
|
|
1656
1774
|
"get-organization-activity.js"
|
|
1657
1775
|
]
|
|
1658
1776
|
},
|
|
1659
|
-
"x402token:get-x402-access-token": {
|
|
1660
|
-
"aliases": [],
|
|
1661
|
-
"args": {
|
|
1662
|
-
"plan": {
|
|
1663
|
-
"description": "plan identifier",
|
|
1664
|
-
"name": "plan",
|
|
1665
|
-
"required": true
|
|
1666
|
-
}
|
|
1667
|
-
},
|
|
1668
|
-
"description": "Create a delegation and get an X402 access token for the given plan. Supports both crypto (erc4337) and fiat (card-delegation) payment schemes.",
|
|
1669
|
-
"examples": [
|
|
1670
|
-
"$ nvm x402token get-x402-access-token <planId>",
|
|
1671
|
-
"$ nvm x402token get-x402-access-token <planId> --payment-type fiat",
|
|
1672
|
-
"$ nvm x402token get-x402-access-token <planId> --payment-type fiat --payment-method-id pm_1AbCdEfGhIjKlM --spending-limit-cents 5000",
|
|
1673
|
-
"$ nvm x402token get-x402-access-token <planId> --spending-limit-cents 100000 --delegation-duration-secs 604800",
|
|
1674
|
-
"$ nvm x402token get-x402-access-token <planId> --auto-resolve-scheme"
|
|
1675
|
-
],
|
|
1676
|
-
"flags": {
|
|
1677
|
-
"profile": {
|
|
1678
|
-
"char": "p",
|
|
1679
|
-
"description": "Configuration profile to use",
|
|
1680
|
-
"name": "profile",
|
|
1681
|
-
"required": false,
|
|
1682
|
-
"hasDynamicHelp": false,
|
|
1683
|
-
"multiple": false,
|
|
1684
|
-
"type": "option"
|
|
1685
|
-
},
|
|
1686
|
-
"format": {
|
|
1687
|
-
"char": "f",
|
|
1688
|
-
"description": "Output format",
|
|
1689
|
-
"name": "format",
|
|
1690
|
-
"default": "table",
|
|
1691
|
-
"hasDynamicHelp": false,
|
|
1692
|
-
"multiple": false,
|
|
1693
|
-
"options": [
|
|
1694
|
-
"table",
|
|
1695
|
-
"json",
|
|
1696
|
-
"quiet"
|
|
1697
|
-
],
|
|
1698
|
-
"type": "option"
|
|
1699
|
-
},
|
|
1700
|
-
"verbose": {
|
|
1701
|
-
"char": "v",
|
|
1702
|
-
"description": "Verbose output",
|
|
1703
|
-
"name": "verbose",
|
|
1704
|
-
"allowNo": false,
|
|
1705
|
-
"type": "boolean"
|
|
1706
|
-
},
|
|
1707
|
-
"agent-id": {
|
|
1708
|
-
"name": "agent-id",
|
|
1709
|
-
"required": false,
|
|
1710
|
-
"hasDynamicHelp": false,
|
|
1711
|
-
"multiple": false,
|
|
1712
|
-
"type": "option"
|
|
1713
|
-
},
|
|
1714
|
-
"payment-type": {
|
|
1715
|
-
"description": "Payment type: \"crypto\" (default) or \"fiat\" (card-delegation)",
|
|
1716
|
-
"name": "payment-type",
|
|
1717
|
-
"required": false,
|
|
1718
|
-
"default": "crypto",
|
|
1719
|
-
"hasDynamicHelp": false,
|
|
1720
|
-
"multiple": false,
|
|
1721
|
-
"options": [
|
|
1722
|
-
"crypto",
|
|
1723
|
-
"fiat"
|
|
1724
|
-
],
|
|
1725
|
-
"type": "option"
|
|
1726
|
-
},
|
|
1727
|
-
"payment-method-id": {
|
|
1728
|
-
"description": "Stripe payment method ID (pm_...). Only for fiat. If omitted, auto-selects first enrolled card.",
|
|
1729
|
-
"name": "payment-method-id",
|
|
1730
|
-
"required": false,
|
|
1731
|
-
"hasDynamicHelp": false,
|
|
1732
|
-
"multiple": false,
|
|
1733
|
-
"type": "option"
|
|
1734
|
-
},
|
|
1735
|
-
"spending-limit-cents": {
|
|
1736
|
-
"description": "Max spending limit in cents (default: 1000)",
|
|
1737
|
-
"name": "spending-limit-cents",
|
|
1738
|
-
"required": false,
|
|
1739
|
-
"default": 1000,
|
|
1740
|
-
"hasDynamicHelp": false,
|
|
1741
|
-
"multiple": false,
|
|
1742
|
-
"type": "option"
|
|
1743
|
-
},
|
|
1744
|
-
"delegation-duration-secs": {
|
|
1745
|
-
"description": "Delegation duration in seconds (default: 3600)",
|
|
1746
|
-
"name": "delegation-duration-secs",
|
|
1747
|
-
"required": false,
|
|
1748
|
-
"default": 3600,
|
|
1749
|
-
"hasDynamicHelp": false,
|
|
1750
|
-
"multiple": false,
|
|
1751
|
-
"type": "option"
|
|
1752
|
-
},
|
|
1753
|
-
"auto-resolve-scheme": {
|
|
1754
|
-
"description": "Auto-detect crypto vs fiat from plan metadata (overrides --payment-type)",
|
|
1755
|
-
"name": "auto-resolve-scheme",
|
|
1756
|
-
"required": false,
|
|
1757
|
-
"allowNo": false,
|
|
1758
|
-
"type": "boolean"
|
|
1759
|
-
}
|
|
1760
|
-
},
|
|
1761
|
-
"hasDynamicHelp": false,
|
|
1762
|
-
"hiddenAliases": [],
|
|
1763
|
-
"id": "x402token:get-x402-access-token",
|
|
1764
|
-
"pluginAlias": "@nevermined-io/cli",
|
|
1765
|
-
"pluginName": "@nevermined-io/cli",
|
|
1766
|
-
"pluginType": "core",
|
|
1767
|
-
"strict": true,
|
|
1768
|
-
"enableJsonFlag": false,
|
|
1769
|
-
"isESM": true,
|
|
1770
|
-
"relativePath": [
|
|
1771
|
-
"dist",
|
|
1772
|
-
"commands",
|
|
1773
|
-
"x402token",
|
|
1774
|
-
"get-x402-access-token.js"
|
|
1775
|
-
]
|
|
1776
|
-
},
|
|
1777
1777
|
"plans:get-agents-associated-to-a-plan": {
|
|
1778
1778
|
"aliases": [],
|
|
1779
1779
|
"args": {
|
|
@@ -3696,5 +3696,5 @@
|
|
|
3696
3696
|
]
|
|
3697
3697
|
}
|
|
3698
3698
|
},
|
|
3699
|
-
"version": "1.
|
|
3699
|
+
"version": "1.5.0"
|
|
3700
3700
|
}
|