@geolonia/geonicdb-cli 0.6.2 → 0.6.4

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 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,21 @@ 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
+ ];
950
+ var API_KEY_SCOPES_HELP_NOTES = [
951
+ "Valid scopes:",
952
+ " read:entities, write:entities, read:subscriptions, write:subscriptions,",
953
+ " read:registrations, write:registrations"
954
+ ];
927
955
  function resolveOptions(cmd) {
928
956
  const opts = cmd.optsWithGlobals();
929
957
  const config = loadConfig(opts.profile);
@@ -1348,6 +1376,7 @@ function addMeOAuthClientsSubcommand(me) {
1348
1376
  printSuccess("OAuth client created.");
1349
1377
  })
1350
1378
  );
1379
+ addNotes(create, SCOPES_HELP_NOTES);
1351
1380
  addExamples(create, [
1352
1381
  {
1353
1382
  description: "Create an OAuth client with flags",
@@ -1465,6 +1494,7 @@ function addMeApiKeysSubcommand(me) {
1465
1494
  console.error("API key created.");
1466
1495
  })
1467
1496
  );
1497
+ addNotes(create, API_KEY_SCOPES_HELP_NOTES);
1468
1498
  addExamples(create, [
1469
1499
  {
1470
1500
  description: "Create an API key with flags",
@@ -3731,10 +3761,11 @@ function registerApiKeysCommand(parent) {
3731
3761
  console.error("API key created.");
3732
3762
  })
3733
3763
  );
3764
+ addNotes(create, API_KEY_SCOPES_HELP_NOTES);
3734
3765
  addExamples(create, [
3735
3766
  {
3736
3767
  description: "Create an API key with flags",
3737
- command: "geonic admin api-keys create --name my-key --scopes entities:read,entities:write --origins '*'"
3768
+ command: "geonic admin api-keys create --name my-key --scopes read:entities,write:entities --origins '*'"
3738
3769
  },
3739
3770
  {
3740
3771
  description: "Create an API key with DPoP required",
@@ -3771,6 +3802,7 @@ function registerApiKeysCommand(parent) {
3771
3802
  }
3772
3803
  )
3773
3804
  );
3805
+ addNotes(update, API_KEY_SCOPES_HELP_NOTES);
3774
3806
  addExamples(update, [
3775
3807
  {
3776
3808
  description: "Update an API key name",