@geolonia/geonicdb-cli 0.6.2 → 0.6.3
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/README.md +5 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -564,7 +564,11 @@ When both a Bearer token and an API key are configured, both headers are sent (t
|
|
|
564
564
|
|
|
565
565
|
### Valid Scopes
|
|
566
566
|
|
|
567
|
-
`read:entities`, `write:entities`, `read:subscriptions`, `write:subscriptions`, `read:registrations`, `write:registrations`
|
|
567
|
+
`read:entities`, `write:entities`, `read:subscriptions`, `write:subscriptions`, `read:registrations`, `write:registrations`, `read:rules`, `write:rules`, `read:custom-data-models`, `write:custom-data-models`, `admin:users`, `admin:tenants`, `admin:policies`, `admin:oauth-clients`, `admin:api-keys`, `admin:metrics`
|
|
568
|
+
|
|
569
|
+
`write:X` implies `read:X`. `admin:X` implies both `read:X` and `write:X`.
|
|
570
|
+
|
|
571
|
+
Special scopes: `permanent` (no token expiry), `jwt` (JWT format token).
|
|
568
572
|
|
|
569
573
|
### Entity Type Restrictions
|
|
570
574
|
|
package/dist/index.js
CHANGED
|
@@ -303,9 +303,13 @@ function entityToFeature(entity) {
|
|
|
303
303
|
// src/commands/help.ts
|
|
304
304
|
import chalk2 from "chalk";
|
|
305
305
|
var examplesMap = /* @__PURE__ */ new WeakMap();
|
|
306
|
+
var notesMap = /* @__PURE__ */ new WeakMap();
|
|
306
307
|
function addExamples(cmd, examples) {
|
|
307
308
|
examplesMap.set(cmd, examples);
|
|
308
309
|
}
|
|
310
|
+
function addNotes(cmd, notes) {
|
|
311
|
+
notesMap.set(cmd, notes);
|
|
312
|
+
}
|
|
309
313
|
function header(title) {
|
|
310
314
|
return chalk2.yellow.bold(title);
|
|
311
315
|
}
|
|
@@ -451,6 +455,15 @@ function formatCommandDetails(program2, cmd, path) {
|
|
|
451
455
|
lines.push("");
|
|
452
456
|
}
|
|
453
457
|
}
|
|
458
|
+
const notes = notesMap.get(cmd);
|
|
459
|
+
if (notes && notes.length > 0) {
|
|
460
|
+
lines.push("");
|
|
461
|
+
lines.push(header("NOTES"));
|
|
462
|
+
lines.push("");
|
|
463
|
+
for (const note of notes) {
|
|
464
|
+
lines.push(` ${note}`);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
454
467
|
lines.push("");
|
|
455
468
|
lines.push(formatGlobalParameters(program2));
|
|
456
469
|
return lines.join("\n");
|
|
@@ -924,6 +937,16 @@ var GdbClientError = class extends Error {
|
|
|
924
937
|
};
|
|
925
938
|
|
|
926
939
|
// src/helpers.ts
|
|
940
|
+
var SCOPES_HELP_NOTES = [
|
|
941
|
+
"Valid scopes:",
|
|
942
|
+
" read:entities, write:entities, read:subscriptions, write:subscriptions,",
|
|
943
|
+
" read:registrations, write:registrations, read:rules, write:rules,",
|
|
944
|
+
" read:custom-data-models, write:custom-data-models,",
|
|
945
|
+
" admin:users, admin:tenants, admin:policies, admin:oauth-clients,",
|
|
946
|
+
" admin:api-keys, admin:metrics",
|
|
947
|
+
"",
|
|
948
|
+
"write:X implies read:X. admin:X implies both read:X and write:X."
|
|
949
|
+
];
|
|
927
950
|
function resolveOptions(cmd) {
|
|
928
951
|
const opts = cmd.optsWithGlobals();
|
|
929
952
|
const config = loadConfig(opts.profile);
|
|
@@ -1348,6 +1371,7 @@ function addMeOAuthClientsSubcommand(me) {
|
|
|
1348
1371
|
printSuccess("OAuth client created.");
|
|
1349
1372
|
})
|
|
1350
1373
|
);
|
|
1374
|
+
addNotes(create, SCOPES_HELP_NOTES);
|
|
1351
1375
|
addExamples(create, [
|
|
1352
1376
|
{
|
|
1353
1377
|
description: "Create an OAuth client with flags",
|
|
@@ -1465,6 +1489,7 @@ function addMeApiKeysSubcommand(me) {
|
|
|
1465
1489
|
console.error("API key created.");
|
|
1466
1490
|
})
|
|
1467
1491
|
);
|
|
1492
|
+
addNotes(create, SCOPES_HELP_NOTES);
|
|
1468
1493
|
addExamples(create, [
|
|
1469
1494
|
{
|
|
1470
1495
|
description: "Create an API key with flags",
|
|
@@ -3731,10 +3756,11 @@ function registerApiKeysCommand(parent) {
|
|
|
3731
3756
|
console.error("API key created.");
|
|
3732
3757
|
})
|
|
3733
3758
|
);
|
|
3759
|
+
addNotes(create, SCOPES_HELP_NOTES);
|
|
3734
3760
|
addExamples(create, [
|
|
3735
3761
|
{
|
|
3736
3762
|
description: "Create an API key with flags",
|
|
3737
|
-
command: "geonic admin api-keys create --name my-key --scopes entities:
|
|
3763
|
+
command: "geonic admin api-keys create --name my-key --scopes read:entities,write:entities --origins '*'"
|
|
3738
3764
|
},
|
|
3739
3765
|
{
|
|
3740
3766
|
description: "Create an API key with DPoP required",
|
|
@@ -3771,6 +3797,7 @@ function registerApiKeysCommand(parent) {
|
|
|
3771
3797
|
}
|
|
3772
3798
|
)
|
|
3773
3799
|
);
|
|
3800
|
+
addNotes(update, SCOPES_HELP_NOTES);
|
|
3774
3801
|
addExamples(update, [
|
|
3775
3802
|
{
|
|
3776
3803
|
description: "Update an API key name",
|