@nevermined-io/cli 1.10.0 → 1.11.1

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.
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ /**
3
+ * Onboard a **white-label customer** into the organization (#2418). Provisions a Nevermined account for `email` under the caller's organization without consuming a member seat, and returns a usable, scoped NVM API key the org can use to transparently act on the customer's behalf (purchase plans / redeem credits). The customer is recorded in the org's Customers list. If the email already belongs to an account the org does NOT own, no key is issued: an email challenge is sent to the owner and the result carries `consentRequired: true`. Call again once the owner has consented to complete onboarding.
4
+ */
5
+ export default class OnboardCustomer extends BaseCommand {
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ email: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
+ profile: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
+ format: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
+ verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=onboard-customer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboard-customer.d.ts","sourceRoot":"","sources":["../../../src/commands/organizations/onboard-customer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,OAAgB,WAAW,SAA8lB;IAEznB,OAAgB,QAAQ,WAEvB;IAED,OAAgB,KAAK;;;;;MAGpB;IAIY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAalC"}
@@ -0,0 +1,27 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ /**
4
+ * Onboard a **white-label customer** into the organization (#2418). Provisions a Nevermined account for `email` under the caller's organization without consuming a member seat, and returns a usable, scoped NVM API key the org can use to transparently act on the customer's behalf (purchase plans / redeem credits). The customer is recorded in the org's Customers list. If the email already belongs to an account the org does NOT own, no key is issued: an email challenge is sent to the owner and the result carries `consentRequired: true`. Call again once the owner has consented to complete onboarding.
5
+ */
6
+ export default class OnboardCustomer extends BaseCommand {
7
+ static description = "Onboard a **white-label customer** into the organization (#2418). Provisions a Nevermined account for `email` under the caller's organization without consuming a member seat, and returns a usable, scoped NVM API key the org can use to transparently act on the customer's behalf (purchase plans / redeem credits). The customer is recorded in the org's Customers list. If the email already belongs to an account the org does NOT own, no key is issued: an email challenge is sent to the owner and the result carries `consentRequired: true`. Call again once the owner has consented to complete onboarding.";
8
+ static examples = [
9
+ '$ nevermined organizations onboard-customer'
10
+ ];
11
+ static flags = {
12
+ ...BaseCommand.baseFlags,
13
+ 'email': Flags.string({ required: true }),
14
+ };
15
+ async run() {
16
+ const { flags } = await this.parse(this.constructor);
17
+ const payments = await this.initPayments();
18
+ try {
19
+ const result = await payments.organizations.onboardCustomer(flags['email']);
20
+ this.formatter.output(result);
21
+ }
22
+ catch (error) {
23
+ this.handleError(error);
24
+ }
25
+ }
26
+ }
27
+ //# sourceMappingURL=onboard-customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboard-customer.js","sourceRoot":"","sources":["../../../src/commands/organizations/onboard-customer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,MAAM,CAAU,WAAW,GAAG,2lBAA2lB,CAAA;IAEznB,MAAM,CAAU,QAAQ,GAAG;QACzB,6CAA6C;KAC9C,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW,CAAC,SAAS;QACxB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC1C,CAAA;IAIM,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAkB,CAAC,CAAA;QAE3D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QAE1C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;YAE3E,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC;IACH,CAAC"}
@@ -993,13 +993,13 @@
993
993
  "setup.js"
994
994
  ]
995
995
  },
996
- "config:init": {
996
+ "delegation:list-payment-methods": {
997
997
  "aliases": [],
998
998
  "args": {},
999
- "description": "Initialize CLI configuration",
999
+ "description": "List enrolled credit/debit cards available for card-delegation (fiat) payments.",
1000
1000
  "examples": [
1001
- "<%= config.bin %> <%= command.id %>",
1002
- "<%= config.bin %> <%= command.id %> --profile production"
1001
+ "$ nevermined delegation list-payment-methods",
1002
+ "$ nevermined delegation list-payment-methods --format json"
1003
1003
  ],
1004
1004
  "flags": {
1005
1005
  "profile": {
@@ -1031,40 +1031,11 @@
1031
1031
  "name": "verbose",
1032
1032
  "allowNo": false,
1033
1033
  "type": "boolean"
1034
- },
1035
- "api-key": {
1036
- "description": "Nevermined API key",
1037
- "name": "api-key",
1038
- "required": false,
1039
- "hasDynamicHelp": false,
1040
- "multiple": false,
1041
- "type": "option"
1042
- },
1043
- "environment": {
1044
- "description": "Environment to use",
1045
- "name": "environment",
1046
- "required": false,
1047
- "hasDynamicHelp": false,
1048
- "multiple": false,
1049
- "options": [
1050
- "sandbox",
1051
- "live",
1052
- "staging_sandbox",
1053
- "staging_live"
1054
- ],
1055
- "type": "option"
1056
- },
1057
- "interactive": {
1058
- "char": "i",
1059
- "description": "Interactive mode",
1060
- "name": "interactive",
1061
- "allowNo": false,
1062
- "type": "boolean"
1063
1034
  }
1064
1035
  },
1065
1036
  "hasDynamicHelp": false,
1066
1037
  "hiddenAliases": [],
1067
- "id": "config:init",
1038
+ "id": "delegation:list-payment-methods",
1068
1039
  "pluginAlias": "@nevermined-io/cli",
1069
1040
  "pluginName": "@nevermined-io/cli",
1070
1041
  "pluginType": "core",
@@ -1074,33 +1045,16 @@
1074
1045
  "relativePath": [
1075
1046
  "dist",
1076
1047
  "commands",
1077
- "config",
1078
- "init.js"
1048
+ "delegation",
1049
+ "list-payment-methods.js"
1079
1050
  ]
1080
1051
  },
1081
- "config:set": {
1052
+ "facilitator:settle-permissions": {
1082
1053
  "aliases": [],
1083
- "args": {
1084
- "key": {
1085
- "description": "Configuration key (nvmApiKey, environment)",
1086
- "name": "key",
1087
- "options": [
1088
- "nvmApiKey",
1089
- "environment"
1090
- ],
1091
- "required": true
1092
- },
1093
- "value": {
1094
- "description": "Configuration value",
1095
- "name": "value",
1096
- "required": true
1097
- }
1098
- },
1099
- "description": "Set a configuration value",
1054
+ "args": {},
1055
+ "description": "Settle (burn) credits from a subscriber's payment plan. This method executes the actual credit consumption, burning the specified number of credits from the subscriber's balance. If the subscriber doesn't have enough credits, it will attempt to order more before settling. The planId and subscriberAddress are extracted from the x402AccessToken.",
1100
1056
  "examples": [
1101
- "<%= config.bin %> <%= command.id %> nvmApiKey sandbox:eyJxxxxaaaabbbbbbbb",
1102
- "<%= config.bin %> <%= command.id %> environment sandbox",
1103
- "<%= config.bin %> <%= command.id %> nvmApiKey nvm-yyy --profile production"
1057
+ "$ nevermined facilitator settle-permissions"
1104
1058
  ],
1105
1059
  "flags": {
1106
1060
  "profile": {
@@ -1132,11 +1086,19 @@
1132
1086
  "name": "verbose",
1133
1087
  "allowNo": false,
1134
1088
  "type": "boolean"
1089
+ },
1090
+ "params": {
1091
+ "description": "params as JSON string",
1092
+ "name": "params",
1093
+ "required": true,
1094
+ "hasDynamicHelp": false,
1095
+ "multiple": false,
1096
+ "type": "option"
1135
1097
  }
1136
1098
  },
1137
1099
  "hasDynamicHelp": false,
1138
1100
  "hiddenAliases": [],
1139
- "id": "config:set",
1101
+ "id": "facilitator:settle-permissions",
1140
1102
  "pluginAlias": "@nevermined-io/cli",
1141
1103
  "pluginName": "@nevermined-io/cli",
1142
1104
  "pluginType": "core",
@@ -1146,18 +1108,16 @@
1146
1108
  "relativePath": [
1147
1109
  "dist",
1148
1110
  "commands",
1149
- "config",
1150
- "set.js"
1111
+ "facilitator",
1112
+ "settle-permissions.js"
1151
1113
  ]
1152
1114
  },
1153
- "config:show": {
1115
+ "facilitator:verify-permissions": {
1154
1116
  "aliases": [],
1155
1117
  "args": {},
1156
- "description": "Display current configuration",
1118
+ "description": "Verify if a subscriber has permission to use credits from a payment plan. This method simulates the credit usage without actually burning credits, checking if the subscriber has sufficient balance and permissions. The planId and subscriberAddress are extracted from the x402AccessToken.",
1157
1119
  "examples": [
1158
- "<%= config.bin %> <%= command.id %>",
1159
- "<%= config.bin %> <%= command.id %> --profile production",
1160
- "<%= config.bin %> <%= command.id %> --all"
1120
+ "$ nevermined facilitator verify-permissions"
1161
1121
  ],
1162
1122
  "flags": {
1163
1123
  "profile": {
@@ -1190,17 +1150,18 @@
1190
1150
  "allowNo": false,
1191
1151
  "type": "boolean"
1192
1152
  },
1193
- "all": {
1194
- "char": "a",
1195
- "description": "Show all profiles",
1196
- "name": "all",
1197
- "allowNo": false,
1198
- "type": "boolean"
1153
+ "params": {
1154
+ "description": "params as JSON string",
1155
+ "name": "params",
1156
+ "required": true,
1157
+ "hasDynamicHelp": false,
1158
+ "multiple": false,
1159
+ "type": "option"
1199
1160
  }
1200
1161
  },
1201
1162
  "hasDynamicHelp": false,
1202
1163
  "hiddenAliases": [],
1203
- "id": "config:show",
1164
+ "id": "facilitator:verify-permissions",
1204
1165
  "pluginAlias": "@nevermined-io/cli",
1205
1166
  "pluginName": "@nevermined-io/cli",
1206
1167
  "pluginType": "core",
@@ -1210,17 +1171,17 @@
1210
1171
  "relativePath": [
1211
1172
  "dist",
1212
1173
  "commands",
1213
- "config",
1214
- "show.js"
1174
+ "facilitator",
1175
+ "verify-permissions.js"
1215
1176
  ]
1216
1177
  },
1217
- "delegation:list-payment-methods": {
1178
+ "config:init": {
1218
1179
  "aliases": [],
1219
1180
  "args": {},
1220
- "description": "List enrolled credit/debit cards available for card-delegation (fiat) payments.",
1181
+ "description": "Initialize CLI configuration",
1221
1182
  "examples": [
1222
- "$ nevermined delegation list-payment-methods",
1223
- "$ nevermined delegation list-payment-methods --format json"
1183
+ "<%= config.bin %> <%= command.id %>",
1184
+ "<%= config.bin %> <%= command.id %> --profile production"
1224
1185
  ],
1225
1186
  "flags": {
1226
1187
  "profile": {
@@ -1252,11 +1213,40 @@
1252
1213
  "name": "verbose",
1253
1214
  "allowNo": false,
1254
1215
  "type": "boolean"
1216
+ },
1217
+ "api-key": {
1218
+ "description": "Nevermined API key",
1219
+ "name": "api-key",
1220
+ "required": false,
1221
+ "hasDynamicHelp": false,
1222
+ "multiple": false,
1223
+ "type": "option"
1224
+ },
1225
+ "environment": {
1226
+ "description": "Environment to use",
1227
+ "name": "environment",
1228
+ "required": false,
1229
+ "hasDynamicHelp": false,
1230
+ "multiple": false,
1231
+ "options": [
1232
+ "sandbox",
1233
+ "live",
1234
+ "staging_sandbox",
1235
+ "staging_live"
1236
+ ],
1237
+ "type": "option"
1238
+ },
1239
+ "interactive": {
1240
+ "char": "i",
1241
+ "description": "Interactive mode",
1242
+ "name": "interactive",
1243
+ "allowNo": false,
1244
+ "type": "boolean"
1255
1245
  }
1256
1246
  },
1257
1247
  "hasDynamicHelp": false,
1258
1248
  "hiddenAliases": [],
1259
- "id": "delegation:list-payment-methods",
1249
+ "id": "config:init",
1260
1250
  "pluginAlias": "@nevermined-io/cli",
1261
1251
  "pluginName": "@nevermined-io/cli",
1262
1252
  "pluginType": "core",
@@ -1266,16 +1256,33 @@
1266
1256
  "relativePath": [
1267
1257
  "dist",
1268
1258
  "commands",
1269
- "delegation",
1270
- "list-payment-methods.js"
1259
+ "config",
1260
+ "init.js"
1271
1261
  ]
1272
1262
  },
1273
- "facilitator:settle-permissions": {
1263
+ "config:set": {
1274
1264
  "aliases": [],
1275
- "args": {},
1276
- "description": "Settle (burn) credits from a subscriber's payment plan. This method executes the actual credit consumption, burning the specified number of credits from the subscriber's balance. If the subscriber doesn't have enough credits, it will attempt to order more before settling. The planId and subscriberAddress are extracted from the x402AccessToken.",
1265
+ "args": {
1266
+ "key": {
1267
+ "description": "Configuration key (nvmApiKey, environment)",
1268
+ "name": "key",
1269
+ "options": [
1270
+ "nvmApiKey",
1271
+ "environment"
1272
+ ],
1273
+ "required": true
1274
+ },
1275
+ "value": {
1276
+ "description": "Configuration value",
1277
+ "name": "value",
1278
+ "required": true
1279
+ }
1280
+ },
1281
+ "description": "Set a configuration value",
1277
1282
  "examples": [
1278
- "$ nevermined facilitator settle-permissions"
1283
+ "<%= config.bin %> <%= command.id %> nvmApiKey sandbox:eyJxxxxaaaabbbbbbbb",
1284
+ "<%= config.bin %> <%= command.id %> environment sandbox",
1285
+ "<%= config.bin %> <%= command.id %> nvmApiKey nvm-yyy --profile production"
1279
1286
  ],
1280
1287
  "flags": {
1281
1288
  "profile": {
@@ -1307,19 +1314,11 @@
1307
1314
  "name": "verbose",
1308
1315
  "allowNo": false,
1309
1316
  "type": "boolean"
1310
- },
1311
- "params": {
1312
- "description": "params as JSON string",
1313
- "name": "params",
1314
- "required": true,
1315
- "hasDynamicHelp": false,
1316
- "multiple": false,
1317
- "type": "option"
1318
1317
  }
1319
1318
  },
1320
1319
  "hasDynamicHelp": false,
1321
1320
  "hiddenAliases": [],
1322
- "id": "facilitator:settle-permissions",
1321
+ "id": "config:set",
1323
1322
  "pluginAlias": "@nevermined-io/cli",
1324
1323
  "pluginName": "@nevermined-io/cli",
1325
1324
  "pluginType": "core",
@@ -1329,16 +1328,18 @@
1329
1328
  "relativePath": [
1330
1329
  "dist",
1331
1330
  "commands",
1332
- "facilitator",
1333
- "settle-permissions.js"
1331
+ "config",
1332
+ "set.js"
1334
1333
  ]
1335
1334
  },
1336
- "facilitator:verify-permissions": {
1335
+ "config:show": {
1337
1336
  "aliases": [],
1338
1337
  "args": {},
1339
- "description": "Verify if a subscriber has permission to use credits from a payment plan. This method simulates the credit usage without actually burning credits, checking if the subscriber has sufficient balance and permissions. The planId and subscriberAddress are extracted from the x402AccessToken.",
1338
+ "description": "Display current configuration",
1340
1339
  "examples": [
1341
- "$ nevermined facilitator verify-permissions"
1340
+ "<%= config.bin %> <%= command.id %>",
1341
+ "<%= config.bin %> <%= command.id %> --profile production",
1342
+ "<%= config.bin %> <%= command.id %> --all"
1342
1343
  ],
1343
1344
  "flags": {
1344
1345
  "profile": {
@@ -1371,18 +1372,17 @@
1371
1372
  "allowNo": false,
1372
1373
  "type": "boolean"
1373
1374
  },
1374
- "params": {
1375
- "description": "params as JSON string",
1376
- "name": "params",
1377
- "required": true,
1378
- "hasDynamicHelp": false,
1379
- "multiple": false,
1380
- "type": "option"
1375
+ "all": {
1376
+ "char": "a",
1377
+ "description": "Show all profiles",
1378
+ "name": "all",
1379
+ "allowNo": false,
1380
+ "type": "boolean"
1381
1381
  }
1382
1382
  },
1383
1383
  "hasDynamicHelp": false,
1384
1384
  "hiddenAliases": [],
1385
- "id": "facilitator:verify-permissions",
1385
+ "id": "config:show",
1386
1386
  "pluginAlias": "@nevermined-io/cli",
1387
1387
  "pluginName": "@nevermined-io/cli",
1388
1388
  "pluginType": "core",
@@ -1392,8 +1392,8 @@
1392
1392
  "relativePath": [
1393
1393
  "dist",
1394
1394
  "commands",
1395
- "facilitator",
1396
- "verify-permissions.js"
1395
+ "config",
1396
+ "show.js"
1397
1397
  ]
1398
1398
  },
1399
1399
  "organizations:connect-stripe-account": {
@@ -1746,6 +1746,68 @@
1746
1746
  "get-organization-activity.js"
1747
1747
  ]
1748
1748
  },
1749
+ "organizations:onboard-customer": {
1750
+ "aliases": [],
1751
+ "args": {},
1752
+ "description": "Onboard a **white-label customer** into the organization (#2418). Provisions a Nevermined account for `email` under the caller's organization without consuming a member seat, and returns a usable, scoped NVM API key the org can use to transparently act on the customer's behalf (purchase plans / redeem credits). The customer is recorded in the org's Customers list. If the email already belongs to an account the org does NOT own, no key is issued: an email challenge is sent to the owner and the result carries `consentRequired: true`. Call again once the owner has consented to complete onboarding.",
1753
+ "examples": [
1754
+ "$ nevermined organizations onboard-customer"
1755
+ ],
1756
+ "flags": {
1757
+ "profile": {
1758
+ "char": "p",
1759
+ "description": "Configuration profile to use",
1760
+ "name": "profile",
1761
+ "required": false,
1762
+ "hasDynamicHelp": false,
1763
+ "multiple": false,
1764
+ "type": "option"
1765
+ },
1766
+ "format": {
1767
+ "char": "f",
1768
+ "description": "Output format",
1769
+ "name": "format",
1770
+ "default": "table",
1771
+ "hasDynamicHelp": false,
1772
+ "multiple": false,
1773
+ "options": [
1774
+ "table",
1775
+ "json",
1776
+ "quiet"
1777
+ ],
1778
+ "type": "option"
1779
+ },
1780
+ "verbose": {
1781
+ "char": "v",
1782
+ "description": "Verbose output",
1783
+ "name": "verbose",
1784
+ "allowNo": false,
1785
+ "type": "boolean"
1786
+ },
1787
+ "email": {
1788
+ "name": "email",
1789
+ "required": true,
1790
+ "hasDynamicHelp": false,
1791
+ "multiple": false,
1792
+ "type": "option"
1793
+ }
1794
+ },
1795
+ "hasDynamicHelp": false,
1796
+ "hiddenAliases": [],
1797
+ "id": "organizations:onboard-customer",
1798
+ "pluginAlias": "@nevermined-io/cli",
1799
+ "pluginName": "@nevermined-io/cli",
1800
+ "pluginType": "core",
1801
+ "strict": true,
1802
+ "enableJsonFlag": false,
1803
+ "isESM": true,
1804
+ "relativePath": [
1805
+ "dist",
1806
+ "commands",
1807
+ "organizations",
1808
+ "onboard-customer.js"
1809
+ ]
1810
+ },
1749
1811
  "x402token:get-x402-access-token": {
1750
1812
  "aliases": [],
1751
1813
  "args": {
@@ -3793,5 +3855,5 @@
3793
3855
  ]
3794
3856
  }
3795
3857
  },
3796
- "version": "1.10.0"
3858
+ "version": "1.11.1"
3797
3859
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevermined-io/cli",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "CLI for Nevermined Payments SDK",
5
5
  "author": "Nevermined AG",
6
6
  "license": "Apache-2.0",