@rockcarver/frodo-cli 2.0.0-32 → 2.0.0-33

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 (120) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/esm/cli/FrodoCommand.js +8 -1
  3. package/esm/cli/FrodoCommand.js.map +1 -1
  4. package/esm/cli/admin/admin-export-full-cloud-config.js +44 -0
  5. package/esm/cli/admin/admin-export-full-cloud-config.js.map +1 -0
  6. package/esm/cli/admin/admin.js +1 -0
  7. package/esm/cli/admin/admin.js.map +1 -1
  8. package/esm/cli/authz/authz-policy-export.js +1 -1
  9. package/esm/cli/authz/authz-policy-export.js.map +1 -1
  10. package/esm/cli/authz/authz-policy-import.js +1 -1
  11. package/esm/cli/authz/authz-policy-import.js.map +1 -1
  12. package/esm/cli/authz/authz-policy-list.js +2 -2
  13. package/esm/cli/authz/authz-policy-list.js.map +1 -1
  14. package/esm/cli/authz/authz-set-delete.js +2 -2
  15. package/esm/cli/authz/authz-set-delete.js.map +1 -1
  16. package/esm/cli/authz/authz-set-export.js +1 -1
  17. package/esm/cli/authz/authz-set-export.js.map +1 -1
  18. package/esm/cli/authz/authz-set-import.js +1 -1
  19. package/esm/cli/authz/authz-set-import.js.map +1 -1
  20. package/esm/cli/authz/authz-set-list.js +1 -1
  21. package/esm/cli/authz/authz-set-list.js.map +1 -1
  22. package/esm/cli/authz/authz-type-delete.js +3 -3
  23. package/esm/cli/authz/authz-type-delete.js.map +1 -1
  24. package/esm/cli/authz/authz-type-export.js +2 -2
  25. package/esm/cli/authz/authz-type-export.js.map +1 -1
  26. package/esm/cli/authz/authz-type-import.js +2 -2
  27. package/esm/cli/authz/authz-type-import.js.map +1 -1
  28. package/esm/cli/authz/authz-type-list.js +1 -1
  29. package/esm/cli/authz/authz-type-list.js.map +1 -1
  30. package/esm/cli/email/email-template-export.js +3 -3
  31. package/esm/cli/email/email-template-export.js.map +1 -1
  32. package/esm/cli/email/email-template-import.js +4 -4
  33. package/esm/cli/email/email-template-import.js.map +1 -1
  34. package/esm/cli/email/email-template-list.js +1 -1
  35. package/esm/cli/email/email-template-list.js.map +1 -1
  36. package/esm/cli/idm/idm-count.js +1 -1
  37. package/esm/cli/idm/idm-count.js.map +1 -1
  38. package/esm/cli/idm/idm-export.js +3 -3
  39. package/esm/cli/idm/idm-export.js.map +1 -1
  40. package/esm/cli/idm/idm-list.js +2 -2
  41. package/esm/cli/idm/idm-list.js.map +1 -1
  42. package/esm/cli/idp/idp-export.js +3 -3
  43. package/esm/cli/idp/idp-export.js.map +1 -1
  44. package/esm/cli/idp/idp-import.js +4 -4
  45. package/esm/cli/idp/idp-import.js.map +1 -1
  46. package/esm/cli/idp/idp-list.js +1 -1
  47. package/esm/cli/idp/idp-list.js.map +1 -1
  48. package/esm/cli/journey/journey-delete.js +6 -2
  49. package/esm/cli/journey/journey-delete.js.map +1 -1
  50. package/esm/cli/journey/journey-disable.js +4 -10
  51. package/esm/cli/journey/journey-disable.js.map +1 -1
  52. package/esm/cli/journey/journey-enable.js +4 -10
  53. package/esm/cli/journey/journey-enable.js.map +1 -1
  54. package/esm/cli/journey/journey-import.js +4 -4
  55. package/esm/cli/journey/journey-import.js.map +1 -1
  56. package/esm/cli/journey/journey-list.js +1 -1
  57. package/esm/cli/journey/journey-list.js.map +1 -1
  58. package/esm/cli/saml/saml-cot-export.js +3 -3
  59. package/esm/cli/saml/saml-cot-export.js.map +1 -1
  60. package/esm/cli/saml/saml-cot-list.js +1 -1
  61. package/esm/cli/saml/saml-cot-list.js.map +1 -1
  62. package/esm/cli/saml/saml-describe.js +1 -1
  63. package/esm/cli/saml/saml-describe.js.map +1 -1
  64. package/esm/cli/saml/saml-import.js +4 -4
  65. package/esm/cli/saml/saml-import.js.map +1 -1
  66. package/esm/cli/saml/saml-list.js +1 -1
  67. package/esm/cli/saml/saml-list.js.map +1 -1
  68. package/esm/cli/saml/saml-metadata-export.js +1 -1
  69. package/esm/cli/saml/saml-metadata-export.js.map +1 -1
  70. package/esm/cli/script/script-export.js +2 -6
  71. package/esm/cli/script/script-export.js.map +1 -1
  72. package/esm/cli/theme/theme-delete.js +3 -3
  73. package/esm/cli/theme/theme-delete.js.map +1 -1
  74. package/esm/cli/theme/theme-export.js +4 -4
  75. package/esm/cli/theme/theme-export.js.map +1 -1
  76. package/esm/cli/theme/theme-import.js +4 -4
  77. package/esm/cli/theme/theme-import.js.map +1 -1
  78. package/esm/cli/theme/theme-list.js +1 -1
  79. package/esm/cli/theme/theme-list.js.map +1 -1
  80. package/esm/ops/AdminFederationOps.js +28 -26
  81. package/esm/ops/AdminFederationOps.js.map +1 -1
  82. package/esm/ops/AdminOps.js +112 -0
  83. package/esm/ops/AdminOps.js.map +1 -0
  84. package/esm/ops/AgentOps.js +59 -51
  85. package/esm/ops/AgentOps.js.map +1 -1
  86. package/esm/ops/ApplicationOps.js +19 -13
  87. package/esm/ops/ApplicationOps.js.map +1 -1
  88. package/esm/ops/CirclesOfTrustOps.js +28 -26
  89. package/esm/ops/CirclesOfTrustOps.js.map +1 -1
  90. package/esm/ops/EmailTemplateOps.js +78 -94
  91. package/esm/ops/EmailTemplateOps.js.map +1 -1
  92. package/esm/ops/IdmOps.js +8 -31
  93. package/esm/ops/IdmOps.js.map +1 -1
  94. package/esm/ops/IdpOps.js +49 -54
  95. package/esm/ops/IdpOps.js.map +1 -1
  96. package/esm/ops/JourneyOps.js +91 -70
  97. package/esm/ops/JourneyOps.js.map +1 -1
  98. package/esm/ops/OAuth2ClientOps.js +13 -11
  99. package/esm/ops/OAuth2ClientOps.js.map +1 -1
  100. package/esm/ops/PolicyOps.js +31 -26
  101. package/esm/ops/PolicyOps.js.map +1 -1
  102. package/esm/ops/PolicySetOps.js +42 -39
  103. package/esm/ops/PolicySetOps.js.map +1 -1
  104. package/esm/ops/ResourceTypeOps.js +19 -16
  105. package/esm/ops/ResourceTypeOps.js.map +1 -1
  106. package/esm/ops/Saml2Ops.js +49 -45
  107. package/esm/ops/Saml2Ops.js.map +1 -1
  108. package/esm/ops/ScriptOps.js +36 -55
  109. package/esm/ops/ScriptOps.js.map +1 -1
  110. package/esm/ops/SecretsOps.js +13 -11
  111. package/esm/ops/SecretsOps.js.map +1 -1
  112. package/esm/ops/ThemeOps.js +111 -130
  113. package/esm/ops/ThemeOps.js.map +1 -1
  114. package/esm/ops/VariablesOps.js +14 -12
  115. package/esm/ops/VariablesOps.js.map +1 -1
  116. package/esm/utils/Console.js +68 -30
  117. package/esm/utils/Console.js.map +1 -1
  118. package/esm/utils/ExportImportUtils.js +4 -12
  119. package/esm/utils/ExportImportUtils.js.map +1 -1
  120. package/package.json +2 -2
@@ -14,13 +14,13 @@ async (host, realm, user, password, options, command) => {
14
14
  // export by uuid
15
15
  if (options.typeId && (await getTokens())) {
16
16
  verboseMessage('Exporting authorization resource type to file...');
17
- const outcome = exportResourceTypeToFile(options.typeId, options.file);
17
+ const outcome = await exportResourceTypeToFile(options.typeId, options.file);
18
18
  if (!outcome) process.exitCode = 1;
19
19
  }
20
20
  // export by name
21
21
  else if (options.typeName && (await getTokens())) {
22
22
  verboseMessage('Exporting authorization resource type to file...');
23
- const outcome = exportResourceTypeByNameToFile(options.typeName, options.file);
23
+ const outcome = await exportResourceTypeByNameToFile(options.typeName, options.file);
24
24
  if (!outcome) process.exitCode = 1;
25
25
  }
26
26
  // -a/--all
@@ -1 +1 @@
1
- {"version":3,"file":"authz-type-export.js","names":["frodo","Option","exportResourceTypeByNameToFile","exportResourceTypesToFile","exportResourceTypesToFiles","exportResourceTypeToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","typeId","outcome","file","process","exitCode","typeName","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-type-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportResourceTypeByNameToFile,\n exportResourceTypesToFile,\n exportResourceTypesToFiles,\n exportResourceTypeToFile,\n} from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type export');\n\nprogram\n .description('Export authorization resource types.')\n .addOption(\n new Option(\n '-i, --type-id <type-uuid>',\n 'Resource type uuid. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-n, --type-name <type-name>',\n 'Resource type name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all resource types to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by uuid\n if (options.typeId && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = exportResourceTypeToFile(options.typeId, options.file);\n if (!outcome) process.exitCode = 1;\n }\n // export by name\n else if (options.typeName && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = exportResourceTypeByNameToFile(\n options.typeName,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization resource types to file...');\n const outcome = await exportResourceTypesToFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Exporting all authorization resource types to separate files...'\n );\n const outcome = await exportResourceTypesToFiles();\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],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IAAIP,OAAO,CAACQ,QAAQ,KAAK,MAAMlB,SAAS,CAAC,CAAC,CAAC,EAAE;IAChDF,cAAc,CAAC,kDAAkD,CAAC;IAClE,MAAMgB,OAAO,GAAGpB,8BAA8B,CAC5CgB,OAAO,CAACQ,QAAQ,EAChBR,OAAO,CAACK,IACV,CAAC;IACD,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACS,GAAG,KAAK,MAAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,uDAAuD,CAAC;IACvE,MAAMgB,OAAO,GAAG,MAAMnB,yBAAyB,CAACe,OAAO,CAACK,IAAI,CAAC;IAC7D,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACU,WAAW,KAAK,MAAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACZ,iEACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMlB,0BAA0B,CAAC,CAAC;IAClD,IAAI,CAACkB,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHnB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdL,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACoB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"authz-type-export.js","names":["frodo","Option","exportResourceTypeByNameToFile","exportResourceTypesToFile","exportResourceTypesToFiles","exportResourceTypeToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","typeId","outcome","file","process","exitCode","typeName","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-type-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportResourceTypeByNameToFile,\n exportResourceTypesToFile,\n exportResourceTypesToFiles,\n exportResourceTypeToFile,\n} from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type export');\n\nprogram\n .description('Export authorization resource types.')\n .addOption(\n new Option(\n '-i, --type-id <type-uuid>',\n 'Resource type uuid. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-n, --type-name <type-name>',\n 'Resource type name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all resource types to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by uuid\n if (options.typeId && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = await exportResourceTypeToFile(\n options.typeId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // export by name\n else if (options.typeName && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = await exportResourceTypeByNameToFile(\n options.typeName,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization resource types to file...');\n const outcome = await exportResourceTypesToFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Exporting all authorization resource types to separate files...'\n );\n const outcome = await exportResourceTypesToFiles();\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,8BAA8B,EAC9BC,yBAAyB,EACzBC,0BAA0B,EAC1BC,wBAAwB,QACnB,2BAA2B;AAClC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,sCAAsC,CAAC,CACnDC,SAAS,CACR,IAAIX,MAAM,CACR,2BAA2B,EAC3B,0DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,6BAA6B,EAC7B,0DACF,CACF,CAAC,CACAW,SAAS,CAAC,IAAIX,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,8DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,+HACF,CACF,CAAC,CACAY,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,MAAM,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IACzCF,cAAc,CAAC,kDAAkD,CAAC;IAClE,MAAMgB,OAAO,GAAG,MAAMjB,wBAAwB,CAC5Ca,OAAO,CAACG,MAAM,EACdH,OAAO,CAACK,IACV,CAAC;IACD,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACQ,QAAQ,KAAK,MAAMlB,SAAS,CAAC,CAAC,CAAC,EAAE;IAChDF,cAAc,CAAC,kDAAkD,CAAC;IAClE,MAAMgB,OAAO,GAAG,MAAMpB,8BAA8B,CAClDgB,OAAO,CAACQ,QAAQ,EAChBR,OAAO,CAACK,IACV,CAAC;IACD,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACS,GAAG,KAAK,MAAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,uDAAuD,CAAC;IACvE,MAAMgB,OAAO,GAAG,MAAMnB,yBAAyB,CAACe,OAAO,CAACK,IAAI,CAAC;IAC7D,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACU,WAAW,KAAK,MAAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACZ,iEACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMlB,0BAA0B,CAAC,CAAC;IAClD,IAAI,CAACkB,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHnB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdL,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACoB,KAAK,CAAC,CAAC"}
@@ -14,13 +14,13 @@ async (host, realm, user, password, options, command) => {
14
14
  // import by uuid
15
15
  if (options.typeId && (await getTokens())) {
16
16
  verboseMessage('Importing authorization resource type by uuid from file...');
17
- const outcome = importResourceTypeFromFile(options.typeId, options.file);
17
+ const outcome = await importResourceTypeFromFile(options.typeId, options.file);
18
18
  if (!outcome) process.exitCode = 1;
19
19
  }
20
20
  // import by name
21
21
  else if (options.typeName && (await getTokens())) {
22
22
  verboseMessage('Importing authorization resource type by name from file...');
23
- const outcome = importResourceTypeByNameFromFile(options.typeName, options.file);
23
+ const outcome = await importResourceTypeByNameFromFile(options.typeName, options.file);
24
24
  if (!outcome) process.exitCode = 1;
25
25
  }
26
26
  // -a/--all
@@ -1 +1 @@
1
- {"version":3,"file":"authz-type-import.js","names":["frodo","Option","importFirstResourceTypeFromFile","importResourceTypeByNameFromFile","importResourceTypeFromFile","importResourceTypesFromFile","importResourceTypesFromFiles","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","typeId","outcome","file","process","exitCode","typeName","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-type-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importFirstResourceTypeFromFile,\n importResourceTypeByNameFromFile,\n importResourceTypeFromFile,\n importResourceTypesFromFile,\n importResourceTypesFromFiles,\n} from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type import');\n\nprogram\n .description('Import authorization resource types.')\n .addOption(\n new Option(\n '-i, --type-id <type-uuid>',\n 'Resource type uuid. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-n, --type-name <type-name>',\n 'Resource type name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all resource types from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all resource types from separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by uuid\n if (options.typeId && (await getTokens())) {\n verboseMessage(\n 'Importing authorization resource type by uuid from file...'\n );\n const outcome = importResourceTypeFromFile(\n options.typeId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // import by name\n else if (options.typeName && (await getTokens())) {\n verboseMessage(\n 'Importing authorization resource type by name from file...'\n );\n const outcome = importResourceTypeByNameFromFile(\n options.typeName,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage(\n 'Importing all authorization resource types from file...'\n );\n const outcome = await importResourceTypesFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Importing all authorization resource types from separate files...'\n );\n const outcome = await importResourceTypesFromFiles();\n if (!outcome) process.exitCode = 1;\n }\n // import first\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first authorization resource type from file \"${options.file}\"...`\n );\n const outcome = await importFirstResourceTypeFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,+BAA+B,EAC/BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,4BAA4B,QACvB,2BAA2B;AAClC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH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AAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CACZ,yDACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMlB,2BAA2B,CAACc,OAAO,CAACK,IAAI,CAAC;IAC/D,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACU,WAAW,KAAK,MAAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACZ,mEACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMjB,4BAA4B,CAAC,CAAC;IACpD,IAAI,CAACiB,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIP,OAAO,CAACK,IAAI,KAAK,MAAMf,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CF,cAAc,CACX,0DAAyDY,OAAO,CAACK,IAAK,MACzE,CAAC;IACD,MAAMD,OAAO,GAAG,MAAMrB,+BAA+B,CAACiB,OAAO,CAACK,IAAI,CAAC;IACnE,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHnB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdL,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACoB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"authz-type-import.js","names":["frodo","Option","importFirstResourceTypeFromFile","importResourceTypeByNameFromFile","importResourceTypeFromFile","importResourceTypesFromFile","importResourceTypesFromFiles","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","typeId","outcome","file","process","exitCode","typeName","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-type-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importFirstResourceTypeFromFile,\n importResourceTypeByNameFromFile,\n importResourceTypeFromFile,\n importResourceTypesFromFile,\n importResourceTypesFromFiles,\n} from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type import');\n\nprogram\n .description('Import authorization resource types.')\n .addOption(\n new Option(\n '-i, --type-id <type-uuid>',\n 'Resource type uuid. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-n, --type-name <type-name>',\n 'Resource type name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all resource types from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all resource types from separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by uuid\n if (options.typeId && (await getTokens())) {\n verboseMessage(\n 'Importing authorization resource type by uuid from file...'\n );\n const outcome = await importResourceTypeFromFile(\n options.typeId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // import by name\n else if (options.typeName && (await getTokens())) {\n verboseMessage(\n 'Importing authorization resource type by name from file...'\n );\n const outcome = await importResourceTypeByNameFromFile(\n options.typeName,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage(\n 'Importing all authorization resource types from file...'\n );\n const outcome = await importResourceTypesFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Importing all authorization resource types from separate files...'\n );\n const outcome = await importResourceTypesFromFiles();\n if (!outcome) process.exitCode = 1;\n }\n // import first\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first authorization resource type from file \"${options.file}\"...`\n );\n const outcome = await importFirstResourceTypeFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,+BAA+B,EAC/BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,4BAA4B,QACvB,2BAA2B;AAClC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,sCAAsC,CAAC,CACnDC,SAAS,CACR,IAAIZ,MAAM,CACR,2BAA2B,EAC3B,0DACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,6BAA6B,EAC7B,0DACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAC,CACzEY,SAAS,CACR,IAAIZ,MAAM,CACR,WAAW,EACX,8DACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,oBAAoB,EACpB,iIACF,CACF,CAAC,CACAa,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EAC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OAAO,GAAG,MAAMrB,+BAA+B,CAACiB,OAAO,CAACK,IAAI,CAAC;IACnE,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHnB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdL,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACoB,KAAK,CAAC,CAAC"}
@@ -13,7 +13,7 @@ async (host, realm, user, password, options, command) => {
13
13
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
14
14
  if (await getTokens()) {
15
15
  verboseMessage('Listing resource types...');
16
- const outcome = listResourceTypes(options.long);
16
+ const outcome = await listResourceTypes(options.long);
17
17
  if (!outcome) process.exitCode = 1;
18
18
  } else {
19
19
  process.exitCode = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"authz-type-list.js","names":["frodo","Option","listResourceTypes","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/authz/authz-type-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listResourceTypes } from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type list');\n\nprogram\n .description('List authorization resource types.')\n .addOption(\n new Option('-l, --long', 'Long with more fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing resource types...');\n const outcome = listResourceTypes(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,oCAAoC,CAAC,CACjDC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC3E,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,2BAA2B,CAAC;IAC3C,MAAMgB,OAAO,GAAGjB,iBAAiB,CAACc,OAAO,CAACI,IAAI,CAAC;IAC/C,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACgB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"authz-type-list.js","names":["frodo","Option","listResourceTypes","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/authz/authz-type-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listResourceTypes } from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type list');\n\nprogram\n .description('List authorization resource types.')\n .addOption(\n new Option('-l, --long', 'Long with more fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing resource types...');\n const outcome = await listResourceTypes(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,oCAAoC,CAAC,CACjDC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC3E,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,2BAA2B,CAAC;IAC3C,MAAMgB,OAAO,GAAG,MAAMjB,iBAAiB,CAACc,OAAO,CAACI,IAAI,CAAC;IACrD,IAAI,CAACD,OAAO,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACgB,KAAK,CAAC,CAAC"}
@@ -14,17 +14,17 @@ async (host, realm, user, password, options, command) => {
14
14
  // export by id/name
15
15
  if (options.templateId && (await getTokens())) {
16
16
  verboseMessage(`Exporting email template "${options.templateId}" from realm "${state.getRealm()}"...`);
17
- exportEmailTemplateToFile(options.templateId, options.file);
17
+ await exportEmailTemplateToFile(options.templateId, options.file);
18
18
  }
19
19
  // --all -a
20
20
  else if (options.all && (await getTokens())) {
21
21
  verboseMessage('Exporting all email templates to a single file...');
22
- exportEmailTemplatesToFile(options.file);
22
+ await exportEmailTemplatesToFile(options.file);
23
23
  }
24
24
  // --all-separate -A
25
25
  else if (options.allSeparate && (await getTokens())) {
26
26
  verboseMessage('Exporting all email templates to separate files...');
27
- exportEmailTemplatesToFiles();
27
+ await exportEmailTemplatesToFiles();
28
28
  }
29
29
  // unrecognized combination of options or no options
30
30
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-export.js","names":["frodo","state","Option","exportEmailTemplatesToFile","exportEmailTemplatesToFiles","exportEmailTemplateToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","templateId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEmailTemplatesToFile,\n exportEmailTemplatesToFiles,\n exportEmailTemplateToFile,\n} from '../../ops/EmailTemplateOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template export');\n\nprogram\n .description('Export email templates.')\n .addOption(\n new Option(\n '-i, --template-id <template-id>',\n 'Email template id/name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the export file. Ignored with -A. Defaults to <template-id>.template.email.json.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all email templates to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all email templates as separate files <template-id>.template.email.json. Ignored with -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by id/name\n if (options.templateId && (await getTokens())) {\n verboseMessage(\n `Exporting email template \"${\n options.templateId\n }\" from realm \"${state.getRealm()}\"...`\n );\n exportEmailTemplateToFile(options.templateId, options.file);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all email templates to a single file...');\n exportEmailTemplatesToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all email templates to separate files...');\n exportEmailTemplatesToFiles();\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,yBAAyB,QACpB,4BAA4B;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,wBAAwB;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KA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OACF,CAAC;IACDK,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"email-template-export.js","names":["frodo","state","Option","exportEmailTemplatesToFile","exportEmailTemplatesToFiles","exportEmailTemplateToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","templateId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEmailTemplatesToFile,\n exportEmailTemplatesToFiles,\n exportEmailTemplateToFile,\n} from '../../ops/EmailTemplateOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template export');\n\nprogram\n .description('Export email templates.')\n .addOption(\n new Option(\n '-i, --template-id <template-id>',\n 'Email template id/name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the export file. Ignored with -A. Defaults to <template-id>.template.email.json.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all email templates to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all email templates as separate files <template-id>.template.email.json. Ignored with -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by id/name\n if (options.templateId && (await getTokens())) {\n verboseMessage(\n `Exporting email template \"${\n options.templateId\n }\" from realm \"${state.getRealm()}\"...`\n );\n await exportEmailTemplateToFile(options.templateId, options.file);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all email templates to a single file...');\n await exportEmailTemplatesToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all email templates to separate files...');\n await exportEmailTemplatesToFiles();\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,yBAAyB,QACpB,4BAA4B;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,wBAAwB;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,6BAA6B,CAAC;AAE/DG,OAAO,CACJC,WAAW,CAAC,yBAAyB,CAAC,CACtCC,SAAS,CACR,IAAIX,MAAM,CACR,iCAAiC,EACjC,8DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,0FACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,+DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,0GACF,CACF,CAAC,CACAY,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,UAAU,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC7CF,cAAc,CACX,6BACCY,OAAO,CAACG,UACT,iBAAgBrB,KAAK,CAACsB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACD,MAAMlB,yBAAyB,CAACc,OAAO,CAACG,UAAU,EAAEH,OAAO,CAACK,IAAI,CAAC;EACnE;EACA;EAAA,KACK,IAAIL,OAAO,CAACM,GAAG,KAAK,MAAMhB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,mDAAmD,CAAC;IACnE,MAAMJ,0BAA0B,CAACgB,OAAO,CAACK,IAAI,CAAC;EAChD;EACA;EAAA,KACK,IAAIL,OAAO,CAACO,WAAW,KAAK,MAAMjB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CAAC,oDAAoD,CAAC;IACpE,MAAMH,2BAA2B,CAAC,CAAC;EACrC;EACA;EAAA,KACK;IACHE,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
@@ -14,22 +14,22 @@ async (host, realm, user, password, options, command) => {
14
14
  // import by id
15
15
  if (options.file && options.templateId && (await getTokens())) {
16
16
  verboseMessage(`Importing email template "${options.templateId}"...`);
17
- importEmailTemplateFromFile(options.templateId, options.file, options.raw);
17
+ await importEmailTemplateFromFile(options.templateId, options.file, options.raw);
18
18
  }
19
19
  // --all -a
20
20
  else if (options.all && options.file && (await getTokens())) {
21
21
  verboseMessage(`Importing all email templates from a single file (${options.file})...`);
22
- importEmailTemplatesFromFile(options.file);
22
+ await importEmailTemplatesFromFile(options.file);
23
23
  }
24
24
  // --all-separate -A
25
25
  else if (options.allSeparate && !options.file && (await getTokens())) {
26
26
  verboseMessage('Importing all email templates from separate files (*.template.email.json) in current directory...');
27
- importEmailTemplatesFromFiles(options.raw);
27
+ await importEmailTemplatesFromFiles(options.raw);
28
28
  }
29
29
  // import first template from file
30
30
  else if (options.file && (await getTokens())) {
31
31
  verboseMessage(`Importing first email template from file "${options.file}"...`);
32
- importFirstEmailTemplateFromFile(options.file, options.raw);
32
+ await importFirstEmailTemplateFromFile(options.file, options.raw);
33
33
  }
34
34
  // unrecognized combination of options or no options
35
35
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-import.js","names":["frodo","Option","importEmailTemplateFromFile","importEmailTemplatesFromFile","importEmailTemplatesFromFiles","importFirstEmailTemplateFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","templateId","raw","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importEmailTemplateFromFile,\n importEmailTemplatesFromFile,\n importEmailTemplatesFromFiles,\n importFirstEmailTemplateFromFile,\n} from '../../ops/EmailTemplateOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template import');\n\nprogram\n .description('Import email templates.')\n .addOption(\n new Option(\n '-i, --template-id <template-id>',\n 'Email template id/name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the import file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all email templates from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all email templates from separate files (*.template.email.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--raw',\n \"Import raw email template files. Raw templates do not contain the id/name, therefore when using -A or -f without -i, the email template id/name is parsed from the file name; Make sure your template files are named 'emailTemplate-<id/name>.json' or use -f with -i. Ignored with -a.\"\n )\n )\n .action(\n // implement program logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.templateId && (await getTokens())) {\n verboseMessage(`Importing email template \"${options.templateId}\"...`);\n importEmailTemplateFromFile(\n options.templateId,\n options.file,\n options.raw\n );\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all email templates from a single file (${options.file})...`\n );\n importEmailTemplatesFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all email templates from separate files (*.template.email.json) in current directory...'\n );\n importEmailTemplatesFromFiles(options.raw);\n }\n // import first template from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first email template from file \"${options.file}\"...`\n );\n importFirstEmailTemplateFromFile(options.file, options.raw);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end program logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,gCAAgC,QAC3B,4BAA4B;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,wBAAwB;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,6BAA6B,CAAC;AAE/DG,OAAO,CACJC,WAAW,CAAC,yBAAyB,CAAC,CACtCC,SAAS,CACR,IAAIZ,MAAM,CACR,iCAAiC,EACjC,8DACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEY,SAAS,CACR,IAAIZ,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AACc,OAAO,CAACG,IAAI,EAAEH,OAAO,CAACK,GAAG,CAAC;EAC7D;EACA;EAAA,KACK;IACHlB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"email-template-import.js","names":["frodo","Option","importEmailTemplateFromFile","importEmailTemplatesFromFile","importEmailTemplatesFromFiles","importFirstEmailTemplateFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","templateId","raw","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importEmailTemplateFromFile,\n importEmailTemplatesFromFile,\n importEmailTemplatesFromFiles,\n importFirstEmailTemplateFromFile,\n} from '../../ops/EmailTemplateOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template import');\n\nprogram\n .description('Import email templates.')\n .addOption(\n new Option(\n '-i, --template-id <template-id>',\n 'Email template id/name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the import file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all email templates from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all email templates from separate files (*.template.email.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--raw',\n \"Import raw email template files. Raw templates do not contain the id/name, therefore when using -A or -f without -i, the email template id/name is parsed from the file name; Make sure your template files are named 'emailTemplate-<id/name>.json' or use -f with -i. Ignored with -a.\"\n )\n )\n .action(\n // implement program logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.templateId && (await getTokens())) {\n verboseMessage(`Importing email template \"${options.templateId}\"...`);\n await importEmailTemplateFromFile(\n options.templateId,\n options.file,\n options.raw\n );\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all email templates from a single file (${options.file})...`\n );\n await importEmailTemplatesFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all email templates from separate files (*.template.email.json) in current directory...'\n );\n await importEmailTemplatesFromFiles(options.raw);\n }\n // import first template from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first email template from file \"${options.file}\"...`\n );\n await importFirstEmailTemplateFromFile(options.file, options.raw);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end program logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,gCAAgC,QAC3B,4BAA4B;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,wBAAwB;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,6BAA6B,CAAC;AAE/DG,OAAO,CACJC,WAAW,CAAC,yBAAyB,CAAC,CACtCC,SAAS,CACR,IAAIZ,MAAM,CACR,iCAAiC,EACjC,8DACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,C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,OAAO,CAACG,IAAK,MAC5D,CAAC;IACD,MAAMjB,gCAAgC,CAACc,OAAO,CAACG,IAAI,EAAEH,OAAO,CAACK,GAAG,CAAC;EACnE;EACA;EAAA,KACK;IACHlB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
@@ -13,7 +13,7 @@ async (host, realm, user, password, options, command) => {
13
13
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
14
14
  if (await getTokens()) {
15
15
  verboseMessage(`Listing email templates ...`);
16
- listEmailTemplates(options.long);
16
+ await listEmailTemplates(options.long);
17
17
  } else {
18
18
  process.exitCode = 1;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-list.js","names":["frodo","Option","listEmailTemplates","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","long","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listEmailTemplates } from '../../ops/EmailTemplateOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template list');\n\nprogram\n .description('List email templates.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing email templates ...`);\n listEmailTemplates(options.long);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,2BAA2B,CAAC;AAE7DG,OAAO,CACJC,WAAW,CAAC,uBAAuB,CAAC,CACpCC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1E,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,6BAA4B,CAAC;IAC7CD,kBAAkB,CAACc,OAAO,CAACG,IAAI,CAAC;EAClC,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"email-template-list.js","names":["frodo","Option","listEmailTemplates","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","long","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listEmailTemplates } from '../../ops/EmailTemplateOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template list');\n\nprogram\n .description('List email templates.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing email templates ...`);\n await listEmailTemplates(options.long);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,2BAA2B,CAAC;AAE7DG,OAAO,CACJC,WAAW,CAAC,uBAAuB,CAAC,CACpCC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1E,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,6BAA4B,CAAC;IAC7C,MAAMD,kBAAkB,CAACc,OAAO,CAACG,IAAI,CAAC;EACxC,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
@@ -13,7 +13,7 @@ async (host, realm, user, password, options, command) => {
13
13
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
14
14
  if (await getTokens()) {
15
15
  verboseMessage(`Counting managed ${options.managedObject} objects...`);
16
- countManagedObjects(options.managedObject);
16
+ await countManagedObjects(options.managedObject);
17
17
  } else {
18
18
  process.exitCode = 1;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"idm-count.js","names":["frodo","Option","countManagedObjects","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","managedObject","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-count.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { countManagedObjects } from '../../ops/IdmOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm count');\n\nprogram\n .description('Count managed objects.')\n .addOption(\n new Option(\n '-o, --managed-object <type>',\n 'Type of managed object to count. E.g. \"alpha_user\", \"alpha_role\", \"user\", \"role\".'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Counting managed ${options.managedObject} objects...`);\n countManagedObjects(options.managedObject);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,iBAAiB,CAAC;AAEnDG,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIR,MAAM,CACR,6BAA6B,EAC7B,mFACF,CACF,CAAC,CACAS,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,oBAAmBY,OAAO,CAACG,aAAc,aAAY,CAAC;IACtEhB,mBAAmB,CAACa,OAAO,CAACG,aAAa,CAAC;EAC5C,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHb,OAAO,CAACc,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idm-count.js","names":["frodo","Option","countManagedObjects","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","managedObject","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-count.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { countManagedObjects } from '../../ops/IdmOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm count');\n\nprogram\n .description('Count managed objects.')\n .addOption(\n new Option(\n '-o, --managed-object <type>',\n 'Type of managed object to count. E.g. \"alpha_user\", \"alpha_role\", \"user\", \"role\".'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Counting managed ${options.managedObject} objects...`);\n await countManagedObjects(options.managedObject);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,iBAAiB,CAAC;AAEnDG,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIR,MAAM,CACR,6BAA6B,EAC7B,mFACF,CACF,CAAC,CACAS,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,oBAAmBY,OAAO,CAACG,aAAc,aAAY,CAAC;IACtE,MAAMhB,mBAAmB,CAACa,OAAO,CAACG,aAAa,CAAC;EAClD,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHb,OAAO,CAACc,KAAK,CAAC,CAAC"}
@@ -14,7 +14,7 @@ async (host, realm, user, password, options, command) => {
14
14
  // export by id/name
15
15
  if (options.name && (await getTokens())) {
16
16
  verboseMessage(`Exporting object "${options.name}"...`);
17
- exportConfigEntity(options.name, options.file);
17
+ await exportConfigEntity(options.name, options.file);
18
18
  }
19
19
  // require --directory -D for all-separate functions
20
20
  else if (options.allSeparate && !state.getDirectory()) {
@@ -26,13 +26,13 @@ async (host, realm, user, password, options, command) => {
26
26
  else if (options.allSeparate && options.entitiesFile && options.envFile && (await getTokens())) {
27
27
  verboseMessage(`Exporting IDM configuration objects specified in ${options.entitiesFile} into separate files in ${state.getDirectory()} using ${options.envFile} for variable replacement...`);
28
28
  exportAllConfigEntities(options.entitiesFile, options.envFile);
29
- warnAboutOfflineConnectorServers();
29
+ await warnAboutOfflineConnectorServers();
30
30
  }
31
31
  // --all-separate -A without variable replacement
32
32
  else if (options.allSeparate && (await getTokens())) {
33
33
  verboseMessage(`Exporting all IDM configuration objects into separate files in ${state.getDirectory()}...`);
34
34
  exportAllRawConfigEntities();
35
- warnAboutOfflineConnectorServers();
35
+ await warnAboutOfflineConnectorServers();
36
36
  }
37
37
  // unrecognized combination of options or no options
38
38
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"idm-export.js","names":["frodo","state","Option","exportAllConfigEntities","exportAllRawConfigEntities","exportConfigEntity","warnAboutOfflineConnectorServers","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","name","file","allSeparate","getDirectory","help","process","exitCode","entitiesFile","envFile","parse"],"sources":["../../../src/cli/idm/idm-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportAllConfigEntities,\n exportAllRawConfigEntities,\n exportConfigEntity,\n warnAboutOfflineConnectorServers,\n} from '../../ops/IdmOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm export');\n\nprogram\n .description('Export IDM configuration objects.')\n .addOption(\n new Option(\n '-N, --name <name>',\n 'Config entity name. E.g. \"managed\", \"sync\", \"provisioner-<connector-name>\", etc.'\n )\n )\n .addOption(new Option('-f, --file [file]', 'Export file. Ignored with -A.'))\n .addOption(\n new Option(\n '-E, --entities-file [entities-file]',\n 'Name of the entity file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-e, --env-file [envfile]',\n 'Name of the env file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all IDM configuration objects into a single file in directory -D. Ignored with -N.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all IDM configuration objects into separate JSON files in directory -D. Ignored with -N, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by id/name\n if (options.name && (await getTokens())) {\n verboseMessage(`Exporting object \"${options.name}\"...`);\n exportConfigEntity(options.name, options.file);\n }\n // require --directory -D for all-separate functions\n else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n options.entitiesFile &&\n options.envFile &&\n (await getTokens())\n ) {\n verboseMessage(\n `Exporting IDM configuration objects specified in ${\n options.entitiesFile\n } into separate files in ${state.getDirectory()} using ${\n options.envFile\n } for variable replacement...`\n );\n exportAllConfigEntities(options.entitiesFile, options.envFile);\n warnAboutOfflineConnectorServers();\n }\n // --all-separate -A without variable replacement\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n `Exporting all IDM configuration objects into separate files in ${state.getDirectory()}...`\n );\n exportAllRawConfigEntities();\n warnAboutOfflineConnectorServers();\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,uBAAuB,EACvBC,0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AE;IACrDnB,YAAY,CACV,4DAA4D,EAC5D,OACF,CAAC;IACDK,OAAO,CAACe,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;EACA;EAAA,KACK,IACHT,OAAO,CAACK,WAAW,IACnBL,OAAO,CAACU,YAAY,IACpBV,OAAO,CAACW,OAAO,KACd,MAAMrB,SAAS,CAAC,CAAC,CAAC,EACnB;IACAF,cAAc,CACX,oDACCY,OAAO,CAACU,YACT,2BAA0B7B,KAAK,CAACyB,YAAY,CAAC,CAAE,UAC9CN,OAAO,CAACW,OACT,8BACH,CAAC;IACD5B,uBAAuB,CAACiB,OAAO,CAACU,YAAY,EAAEV,OAAO,CAACW,OAAO,CAAC;IAC9DzB,gCAAgC,CAAC,CAAC;EACpC;EACA;EAAA,KACK,IAAIc,OAAO,CAACK,WAAW,KAAK,MAAMf,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACX,kEAAiEP,KAAK,CAACyB,YAAY,CAAC,CAAE,KACzF,CAAC;IACDtB,0BAA0B,CAAC,CAAC;IAC5BE,gCAAgC,CAAC,CAAC;EACpC;EACA;EAAA,KACK;IACHC,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACe,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHjB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idm-export.js","names":["frodo","state","Option","exportAllConfigEntities","exportAllRawConfigEntities","exportConfigEntity","warnAboutOfflineConnectorServers","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","name","file","allSeparate","getDirectory","help","process","exitCode","entitiesFile","envFile","parse"],"sources":["../../../src/cli/idm/idm-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportAllConfigEntities,\n exportAllRawConfigEntities,\n exportConfigEntity,\n warnAboutOfflineConnectorServers,\n} from '../../ops/IdmOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm export');\n\nprogram\n .description('Export IDM configuration objects.')\n .addOption(\n new Option(\n '-N, --name <name>',\n 'Config entity name. E.g. \"managed\", \"sync\", \"provisioner-<connector-name>\", etc.'\n )\n )\n .addOption(new Option('-f, --file [file]', 'Export file. Ignored with -A.'))\n .addOption(\n new Option(\n '-E, --entities-file [entities-file]',\n 'Name of the entity file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-e, --env-file [envfile]',\n 'Name of the env file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all IDM configuration objects into a single file in directory -D. Ignored with -N.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all IDM configuration objects into separate JSON files in directory -D. Ignored with -N, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by id/name\n if (options.name && (await getTokens())) {\n verboseMessage(`Exporting object \"${options.name}\"...`);\n await exportConfigEntity(options.name, options.file);\n }\n // require --directory -D for all-separate functions\n else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n options.entitiesFile &&\n options.envFile &&\n (await getTokens())\n ) {\n verboseMessage(\n `Exporting IDM configuration objects specified in ${\n options.entitiesFile\n } into separate files in ${state.getDirectory()} using ${\n options.envFile\n } for variable replacement...`\n );\n exportAllConfigEntities(options.entitiesFile, options.envFile);\n await warnAboutOfflineConnectorServers();\n }\n // --all-separate -A without variable replacement\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n `Exporting all IDM configuration objects into separate files in ${state.getDirectory()}...`\n );\n exportAllRawConfigEntities();\n await warnAboutOfflineConnectorServers();\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,kBAAkB,EAClBC,gCAAgC,QAC3B,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGV,KAAK,CAACW,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAEpDG,OAAO,CACJC,WAAW,CAAC,mCAAmC,CAAC,CAChDC,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,kFACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC,mBAAmB,EAAE,+BAA+B,CAAC,CAAC,CAC3EY,SAAS,CACR,IAAIZ,MAAM,CACR,qCAAqC,EACrC,2CACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,0BAA0B,EAC1B,wCACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,WAAW,EACX,2FACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,oBAAoB,EACpB,yGACF,CACF,CAAC,CACAa,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,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AACF,CAAC;;AAEHjB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
@@ -16,8 +16,8 @@ async (host, realm, user, password, options, command) => {
16
16
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
17
17
  if (await getTokens()) {
18
18
  verboseMessage('Listing all IDM configuration objects...');
19
- listAllConfigEntities();
20
- warnAboutOfflineConnectorServers();
19
+ await listAllConfigEntities();
20
+ await warnAboutOfflineConnectorServers();
21
21
  } else {
22
22
  process.exitCode = 1;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"idm-list.js","names":["frodo","listAllConfigEntities","warnAboutOfflineConnectorServers","verboseMessage","FrodoCommand","getTokens","login","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\n\nimport {\n listAllConfigEntities,\n warnAboutOfflineConnectorServers,\n} from '../../ops/IdmOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm list');\n\nprogram\n .description('List IDM configuration objects.')\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing all IDM configuration objects...');\n listAllConfigEntities();\n warnAboutOfflineConnectorServers();\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,SACEC,qBAAqB,EACrBC,gCAAgC,QAC3B,kBAAkB;AACzB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,gBAAgB,CAAC;AAElDG,OAAO,CACJC,WAAW,CAAC,iCAAiC;AAC9C;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMV,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,0CAA0C,CAAC;IAC1DF,qBAAqB,CAAC,CAAC;IACvBC,gCAAgC,CAAC,CAAC;EACpC,CAAC,MAAM;IACLe,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHX,OAAO,CAACY,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idm-list.js","names":["frodo","listAllConfigEntities","warnAboutOfflineConnectorServers","verboseMessage","FrodoCommand","getTokens","login","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\n\nimport {\n listAllConfigEntities,\n warnAboutOfflineConnectorServers,\n} from '../../ops/IdmOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm list');\n\nprogram\n .description('List IDM configuration objects.')\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing all IDM configuration objects...');\n await listAllConfigEntities();\n await warnAboutOfflineConnectorServers();\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,SACEC,qBAAqB,EACrBC,gCAAgC,QAC3B,kBAAkB;AACzB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,gBAAgB,CAAC;AAElDG,OAAO,CACJC,WAAW,CAAC,iCAAiC;AAC9C;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMV,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,0CAA0C,CAAC;IAC1D,MAAMF,qBAAqB,CAAC,CAAC;IAC7B,MAAMC,gCAAgC,CAAC,CAAC;EAC1C,CAAC,MAAM;IACLe,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHX,OAAO,CAACY,KAAK,CAAC,CAAC"}
@@ -15,17 +15,17 @@ async (host, realm, user, password, options, command) => {
15
15
  // export by id/name
16
16
  if (options.idpId) {
17
17
  verboseMessage(`Exporting provider "${options.idpId}" from realm "${state.getRealm()}"...`);
18
- exportSocialIdentityProviderToFile(options.idpId, options.file);
18
+ await exportSocialIdentityProviderToFile(options.idpId, options.file);
19
19
  }
20
20
  // --all -a
21
21
  else if (options.all) {
22
22
  verboseMessage('Exporting all providers to a single file...');
23
- exportSocialIdentityProvidersToFile(options.file);
23
+ await exportSocialIdentityProvidersToFile(options.file);
24
24
  }
25
25
  // --all-separate -A
26
26
  else if (options.allSeparate) {
27
27
  verboseMessage('Exporting all providers to separate files...');
28
- exportSocialIdentityProvidersToFiles();
28
+ await exportSocialIdentityProvidersToFiles();
29
29
  }
30
30
  // unrecognized combination of options or no options
31
31
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"idp-export.js","names":["frodo","state","Option","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","exportSocialIdentityProviderToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportSocialIdentityProvidersToFile,\n exportSocialIdentityProvidersToFiles,\n exportSocialIdentityProviderToFile,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp export');\n\nprogram\n .description('Export (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers in a realm to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(\n `Exporting provider \"${\n options.idpId\n }\" from realm \"${state.getRealm()}\"...`\n );\n exportSocialIdentityProviderToFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n exportSocialIdentityProvidersToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n exportSocialIdentityProvidersToFiles();\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,kCAAkC,QAC7B,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAEpDG,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,CAClDC,SAAS,CACR,IAAIX,MAAM,CACR,uBAAuB,EACvB,6DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,yEACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,+EACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,8GACF,CACF,CAAC,CACAY,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrB;IACA,IAAIU,OAAO,CAACG,KAAK,EAAE;MACjBf,cAAc,CACX,uBACCY,OAAO,CAACG,KACT,iBAAgBrB,KAAK,CAACsB,QAAQ,CAAC,CAAE,MACpC,CAAC;MACDlB,kCAAkC,CAACc,OAAO,CAACG,KAAK,EAAEH,OAAO,CAACK,IAAI,CAAC;IACjE;IACA;IAAA,KACK,IAAIL,OAAO,CAACM,GAAG,EAAE;MACpBlB,cAAc,CAAC,6CAA6C,CAAC;MAC7DJ,mCAAmC,CAACgB,OAAO,CAACK,IAAI,CAAC;IACnD;IACA;IAAA,KACK,IAAIL,OAAO,CAACO,WAAW,EAAE;MAC5BnB,cAAc,CAAC,8CAA8C,CAAC;MAC9DH,oCAAoC,CAAC,CAAC;IACxC;IACA;IAAA,KACK;MACHE,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;MACDK,OAAO,CAACgB,IAAI,CAAC,CAAC;MACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idp-export.js","names":["frodo","state","Option","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","exportSocialIdentityProviderToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportSocialIdentityProvidersToFile,\n exportSocialIdentityProvidersToFiles,\n exportSocialIdentityProviderToFile,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp export');\n\nprogram\n .description('Export (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers in a realm to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(\n `Exporting provider \"${\n options.idpId\n }\" from realm \"${state.getRealm()}\"...`\n );\n await exportSocialIdentityProviderToFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n await exportSocialIdentityProvidersToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n await exportSocialIdentityProvidersToFiles();\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,kCAAkC,QAC7B,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,k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AC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
@@ -14,22 +14,22 @@ async (host, realm, user, password, options, command) => {
14
14
  // import by id
15
15
  if (options.file && options.idpId && (await getTokens())) {
16
16
  verboseMessage(`Importing provider "${options.idpId}" into realm "${state.getRealm()}"...`);
17
- importSocialIdentityProviderFromFile(options.idpId, options.file);
17
+ await importSocialIdentityProviderFromFile(options.idpId, options.file);
18
18
  }
19
19
  // --all -a
20
20
  else if (options.all && options.file && (await getTokens())) {
21
21
  verboseMessage(`Importing all providers from a single file (${options.file})...`);
22
- importSocialIdentityProvidersFromFile(options.file);
22
+ await importSocialIdentityProvidersFromFile(options.file);
23
23
  }
24
24
  // --all-separate -A
25
25
  else if (options.allSeparate && !options.file && (await getTokens())) {
26
26
  verboseMessage('Importing all providers from separate files in current directory...');
27
- importSocialIdentityProvidersFromFiles();
27
+ await importSocialIdentityProvidersFromFiles();
28
28
  }
29
29
  // import first provider from file
30
30
  else if (options.file && (await getTokens())) {
31
31
  verboseMessage(`Importing first provider from file "${options.file}" into realm "${state.getRealm()}"...`);
32
- importFirstSocialIdentityProviderFromFile(options.file);
32
+ await importFirstSocialIdentityProviderFromFile(options.file);
33
33
  }
34
34
  // unrecognized combination of options or no options
35
35
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"idp-import.js","names":["frodo","state","Option","importFirstSocialIdentityProviderFromFile","importSocialIdentityProviderFromFile","importSocialIdentityProvidersFromFile","importSocialIdentityProvidersFromFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-import.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importFirstSocialIdentityProviderFromFile,\n importSocialIdentityProviderFromFile,\n importSocialIdentityProvidersFromFile,\n importSocialIdentityProvidersFromFiles,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp import');\n\nprogram\n .description('Import (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <id>',\n 'Provider id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the provider(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the providers from single file. Ignored with -t or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the providers from separate files (*.json) in the current directory. Ignored with -t or -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.idpId && (await getTokens())) {\n verboseMessage(\n `Importing provider \"${\n options.idpId\n }\" into realm \"${state.getRealm()}\"...`\n );\n importSocialIdentityProviderFromFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all providers from a single file (${options.file})...`\n );\n importSocialIdentityProvidersFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all providers from separate files in current directory...'\n );\n importSocialIdentityProvidersFromFiles();\n }\n // import first provider from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first provider from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n importFirstSocialIdentityProviderFromFile(options.file);\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,y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,MAC9D,CAAC;IACDlB,qCAAqC,CAACe,OAAO,CAACG,IAAI,CAAC;EACrD;EACA;EAAA,KACK,IAAIH,OAAO,CAACO,WAAW,IAAI,CAACP,OAAO,CAACG,IAAI,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IACpEF,cAAc,CACZ,qEACF,CAAC;IACDF,sCAAsC,CAAC,CAAC;EAC1C;EACA;EAAA,KACK,IAAIc,OAAO,CAACG,IAAI,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CF,cAAc,CACX,uCACCY,OAAO,CAACG,IACT,iBAAgBtB,KAAK,CAACwB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACDtB,yCAAyC,CAACiB,OAAO,CAACG,IAAI,CAAC;EACzD;EACA;EAAA,KACK;IACHhB,YAAY,CAAC,sDAAsD,CAAC;IACpEK,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idp-import.js","names":["frodo","state","Option","importFirstSocialIdentityProviderFromFile","importSocialIdentityProviderFromFile","importSocialIdentityProvidersFromFile","importSocialIdentityProvidersFromFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-import.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importFirstSocialIdentityProviderFromFile,\n importSocialIdentityProviderFromFile,\n importSocialIdentityProvidersFromFile,\n importSocialIdentityProvidersFromFiles,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp import');\n\nprogram\n .description('Import (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <id>',\n 'Provider id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the provider(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the providers from single file. Ignored with -t or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the providers from separate files (*.json) in the current directory. Ignored with -t or -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.idpId && (await getTokens())) {\n verboseMessage(\n `Importing provider \"${\n options.idpId\n }\" into realm \"${state.getRealm()}\"...`\n );\n await importSocialIdentityProviderFromFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all providers from a single file (${options.file})...`\n );\n await importSocialIdentityProvidersFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all providers from separate files in current directory...'\n );\n await importSocialIdentityProvidersFromFiles();\n }\n // import first provider from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first provider from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n await importFirstSocialIdentityProviderFromFile(options.file);\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,yCAAyC,EACzCC,oCAAoC,EACpCC,qCAAqC,EACrCC,sCAAsC,QACjC,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;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AAW,IAAI,CAACP,OAAO,CAACG,IAAI,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IACpEF,cAAc,CACZ,qEACF,CAAC;IACD,MAAMF,sCAAsC,CAAC,CAAC;EAChD;EACA;EAAA,KACK,IAAIc,OAAO,CAACG,IAAI,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CF,cAAc,CACX,uCACCY,OAAO,CAACG,IACT,iBAAgBtB,KAAK,CAACwB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACD,MAAMtB,yCAAyC,CAACiB,OAAO,CAACG,IAAI,CAAC;EAC/D;EACA;EAAA,KACK;IACHhB,YAAY,CAAC,sDAAsD,CAAC;IACpEK,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
@@ -16,7 +16,7 @@ async (host, realm, user, password, options, command) => {
16
16
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
17
17
  if (await getTokens()) {
18
18
  verboseMessage(`Listing providers in realm "${state.getRealm()}"...`);
19
- listSocialProviders();
19
+ await listSocialProviders();
20
20
  } else {
21
21
  process.exitCode = 1;
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"idp-list.js","names":["frodo","state","listSocialProviders","verboseMessage","FrodoCommand","getTokens","login","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-list.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\n\nimport { listSocialProviders } from '../../ops/IdpOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp list');\n\nprogram\n .description('List (social) identity providers.')\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing providers in realm \"${state.getRealm()}\"...`);\n listSocialProviders();\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,gBAAgB,CAAC;AAElDG,OAAO,CACJC,WAAW,CAAC,mCAAmC;AAChD;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMV,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,+BAA8BF,KAAK,CAACgB,QAAQ,CAAC,CAAE,MAAK,CAAC;IACrEf,mBAAmB,CAAC,CAAC;EACvB,CAAC,MAAM;IACLgB,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idp-list.js","names":["frodo","state","listSocialProviders","verboseMessage","FrodoCommand","getTokens","login","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-list.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\n\nimport { listSocialProviders } from '../../ops/IdpOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp list');\n\nprogram\n .description('List (social) identity providers.')\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing providers in realm \"${state.getRealm()}\"...`);\n await listSocialProviders();\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,gBAAgB,CAAC;AAElDG,OAAO,CACJC,WAAW,CAAC,mCAAmC;AAChD;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMV,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,+BAA8BF,KAAK,CAACgB,QAAQ,CAAC,CAAE,MAAK,CAAC;IACrE,MAAMf,mBAAmB,CAAC,CAAC;EAC7B,CAAC,MAAM;IACLgB,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
@@ -5,6 +5,10 @@ import { FrodoCommand } from '../FrodoCommand';
5
5
  const {
6
6
  getTokens
7
7
  } = frodo.login;
8
+ const {
9
+ deleteJourney,
10
+ deleteJourneys
11
+ } = frodo.authn.journey;
8
12
  const program = new FrodoCommand('frodo journey delete');
9
13
  program.description('Delete journeys/trees.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a is ignored.')).addOption(new Option('-a, --all', 'Delete all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('--no-deep', 'No deep delete. This leaves orphaned configuration artifacts behind.')).addOption(new Option('--verbose', 'Verbose output during command execution. If specified, may or may not produce additional output.').default(false, 'off')).action(
10
14
  // implement command logic inside action handler
@@ -13,12 +17,12 @@ async (host, realm, user, password, options, command) => {
13
17
  // delete by id
14
18
  if (options.journeyId && (await getTokens())) {
15
19
  verboseMessage(`Deleting journey ${options.journeyId} in realm "${state.getRealm()}"...`);
16
- frodo.authn.journey.deleteJourney(options.journeyId, options);
20
+ await deleteJourney(options.journeyId, options);
17
21
  }
18
22
  // --all -a
19
23
  else if (options.all && (await getTokens())) {
20
24
  verboseMessage('Deleting all journeys...');
21
- frodo.authn.journey.deleteJourneys(options);
25
+ await deleteJourneys(options);
22
26
  }
23
27
  // unrecognized combination of options or no options
24
28
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"journey-delete.js","names":["frodo","state","Option","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","getRealm","authn","journey","deleteJourney","all","deleteJourneys","help","process","exitCode","parse"],"sources":["../../../src/cli/journey/journey-delete.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo journey delete');\n\nprogram\n .description('Delete journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a is ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // delete by id\n if (options.journeyId && (await getTokens())) {\n verboseMessage(\n `Deleting journey ${\n options.journeyId\n } in realm \"${state.getRealm()}\"...`\n );\n frodo.authn.journey.deleteJourney(options.journeyId, options);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all journeys...');\n frodo.authn.journey.deleteJourneys(options);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGN,KAAK,CAACO,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,sBAAsB,CAAC;AAExDG,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIR,MAAM,CACR,4BAA4B,EAC5B,sDACF,CACF,CAAC,CACAQ,SAAS,CACR,IAAIR,MAAM,CACR,WAAW,EACX,4DACF,CACF,CAAC,CACAQ,SAAS,CACR,IAAIR,MAAM,CACR,WAAW,EACX,sEACF,CACF,CAAC,CACAQ,SAAS,CACR,IAAIR,MAAM,CACR,WAAW,EACX,kGACF,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,KAAK,CACxB,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,SAAS,KAAK,MAAMd,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CF,cAAc,CACX,oBACCa,OAAO,CAACG,SACT,cAAanB,KAAK,CAACoB,QAAQ,CAAC,CAAE,MACjC,CAAC;IACDrB,KAAK,CAACsB,KAAK,CAACC,OAAO,CAACC,aAAa,CAACP,OAAO,CAACG,SAAS,EAAEH,OAAO,CAAC;EAC/D;EACA;EAAA,KACK,IAAIA,OAAO,CAACQ,GAAG,KAAK,MAAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,0BAA0B,CAAC;IAC1CJ,KAAK,CAACsB,KAAK,CAACC,OAAO,CAACG,cAAc,CAACT,OAAO,CAAC;EAC7C;EACA;EAAA,KACK;IACHd,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHrB,OAAO,CAACsB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"journey-delete.js","names":["frodo","state","Option","printMessage","verboseMessage","FrodoCommand","getTokens","login","deleteJourney","deleteJourneys","authn","journey","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","getRealm","all","help","process","exitCode","parse"],"sources":["../../../src/cli/journey/journey-delete.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\nconst { deleteJourney, deleteJourneys } = frodo.authn.journey;\n\nconst program = new FrodoCommand('frodo journey delete');\n\nprogram\n .description('Delete journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a is ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // delete by id\n if (options.journeyId && (await getTokens())) {\n verboseMessage(\n `Deleting journey ${\n options.journeyId\n } in realm \"${state.getRealm()}\"...`\n );\n await deleteJourney(options.journeyId, options);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all journeys...');\n await deleteJourneys(options);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGN,KA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