@rockcarver/frodo-cli 0.18.0 → 0.18.2-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +3 -2
  3. package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +1 -1
  4. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +5 -4
  5. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
  6. package/esm/cli/admin/admin-get-access-token.js +3 -2
  7. package/esm/cli/admin/admin-get-access-token.js.map +1 -1
  8. package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +3 -2
  9. package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
  10. package/esm/cli/admin/admin-hide-generic-extension-attributes.js +3 -2
  11. package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +1 -1
  12. package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +3 -2
  13. package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +1 -1
  14. package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +3 -2
  15. package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +1 -1
  16. package/esm/cli/admin/admin-list-static-user-mappings.js +3 -2
  17. package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
  18. package/esm/cli/admin/admin-remove-static-user-mapping.js +3 -2
  19. package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
  20. package/esm/cli/admin/admin-repair-org-model.js +3 -2
  21. package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
  22. package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +3 -2
  23. package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
  24. package/esm/cli/admin/admin-show-generic-extension-attributes.js +3 -2
  25. package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
  26. package/esm/cli/app/app-export.js +5 -4
  27. package/esm/cli/app/app-export.js.map +1 -1
  28. package/esm/cli/app/app-import.js +2 -1
  29. package/esm/cli/app/app-import.js.map +1 -1
  30. package/esm/cli/app/app-list.js +2 -1
  31. package/esm/cli/app/app-list.js.map +1 -1
  32. package/esm/cli/cmd_common.js +4 -4
  33. package/esm/cli/cmd_common.js.map +1 -1
  34. package/esm/cli/email/email-template-export.js +5 -4
  35. package/esm/cli/email/email-template-export.js.map +1 -1
  36. package/esm/cli/email/email-template-import.js +6 -5
  37. package/esm/cli/email/email-template-import.js.map +1 -1
  38. package/esm/cli/email/email-template-list.js +2 -1
  39. package/esm/cli/email/email-template-list.js.map +1 -1
  40. package/esm/cli/esv/esv-secret-create.js +2 -1
  41. package/esm/cli/esv/esv-secret-create.js.map +1 -1
  42. package/esm/cli/esv/esv-secret-delete.js +4 -3
  43. package/esm/cli/esv/esv-secret-delete.js.map +1 -1
  44. package/esm/cli/esv/esv-secret-describe.js +2 -1
  45. package/esm/cli/esv/esv-secret-describe.js.map +1 -1
  46. package/esm/cli/esv/esv-secret-list.js +2 -1
  47. package/esm/cli/esv/esv-secret-list.js.map +1 -1
  48. package/esm/cli/esv/esv-secret-set.js +2 -1
  49. package/esm/cli/esv/esv-secret-set.js.map +1 -1
  50. package/esm/cli/esv/esv-secret-version-activate.js +3 -2
  51. package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
  52. package/esm/cli/esv/esv-secret-version-create.js +2 -1
  53. package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
  54. package/esm/cli/esv/esv-secret-version-deactivate.js +3 -2
  55. package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
  56. package/esm/cli/esv/esv-secret-version-delete.js +4 -3
  57. package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
  58. package/esm/cli/esv/esv-secret-version-list.js +2 -1
  59. package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
  60. package/esm/cli/esv/esv-variable-create.js +2 -1
  61. package/esm/cli/esv/esv-variable-create.js.map +1 -1
  62. package/esm/cli/esv/esv-variable-delete.js +4 -3
  63. package/esm/cli/esv/esv-variable-delete.js.map +1 -1
  64. package/esm/cli/esv/esv-variable-describe.js +2 -1
  65. package/esm/cli/esv/esv-variable-describe.js.map +1 -1
  66. package/esm/cli/esv/esv-variable-list.js +2 -1
  67. package/esm/cli/esv/esv-variable-list.js.map +1 -1
  68. package/esm/cli/esv/esv-variable-set.js +4 -3
  69. package/esm/cli/esv/esv-variable-set.js.map +1 -1
  70. package/esm/cli/idm/idm-count.js +2 -1
  71. package/esm/cli/idm/idm-count.js.map +1 -1
  72. package/esm/cli/idm/idm-export.js +5 -4
  73. package/esm/cli/idm/idm-export.js.map +1 -1
  74. package/esm/cli/idm/idm-list.js +3 -2
  75. package/esm/cli/idm/idm-list.js.map +1 -1
  76. package/esm/cli/idp/idp-export.js +6 -5
  77. package/esm/cli/idp/idp-export.js.map +1 -1
  78. package/esm/cli/idp/idp-import.js +7 -6
  79. package/esm/cli/idp/idp-import.js.map +1 -1
  80. package/esm/cli/idp/idp-list.js +3 -2
  81. package/esm/cli/idp/idp-list.js.map +1 -1
  82. package/esm/cli/info/info.js +7 -6
  83. package/esm/cli/info/info.js.map +1 -1
  84. package/esm/cli/journey/journey-delete.e2e.test_.js.map +1 -1
  85. package/esm/cli/journey/journey-delete.js +5 -4
  86. package/esm/cli/journey/journey-delete.js.map +1 -1
  87. package/esm/cli/journey/journey-describe.js.map +1 -1
  88. package/esm/cli/journey/journey-disable.js +3 -3
  89. package/esm/cli/journey/journey-disable.js.map +1 -1
  90. package/esm/cli/journey/journey-enable.js +3 -3
  91. package/esm/cli/journey/journey-enable.js.map +1 -1
  92. package/esm/cli/journey/journey-export.js +15 -18
  93. package/esm/cli/journey/journey-export.js.map +1 -1
  94. package/esm/cli/journey/journey-import.js +16 -22
  95. package/esm/cli/journey/journey-import.js.map +1 -1
  96. package/esm/cli/journey/journey-list.e2e.test_.js.map +1 -1
  97. package/esm/cli/journey/journey-list.js +5 -6
  98. package/esm/cli/journey/journey-list.js.map +1 -1
  99. package/esm/cli/journey/journey-prune.js +4 -3
  100. package/esm/cli/journey/journey-prune.js.map +1 -1
  101. package/esm/cli/journey/journey.js.map +1 -1
  102. package/esm/cli/logging/logs-fetch.js +5 -5
  103. package/esm/cli/logging/logs-fetch.js.map +1 -1
  104. package/esm/cli/logging/logs-list.js +10 -9
  105. package/esm/cli/logging/logs-list.js.map +1 -1
  106. package/esm/cli/logging/logs-tail.js +5 -4
  107. package/esm/cli/logging/logs-tail.js.map +1 -1
  108. package/esm/cli/logging/logs.js.map +1 -1
  109. package/esm/cli/realm/realm-add-custom-domain.js +3 -2
  110. package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
  111. package/esm/cli/realm/realm-describe.js +3 -2
  112. package/esm/cli/realm/realm-describe.js.map +1 -1
  113. package/esm/cli/realm/realm-list.js +3 -2
  114. package/esm/cli/realm/realm-list.js.map +1 -1
  115. package/esm/cli/realm/realm-remove-custom-domain.js +3 -2
  116. package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
  117. package/esm/cli/saml/saml-cot-export.js +6 -5
  118. package/esm/cli/saml/saml-cot-export.js.map +1 -1
  119. package/esm/cli/saml/saml-cot-import.js +7 -6
  120. package/esm/cli/saml/saml-cot-import.js.map +1 -1
  121. package/esm/cli/saml/saml-cot-list.js +3 -2
  122. package/esm/cli/saml/saml-cot-list.js.map +1 -1
  123. package/esm/cli/saml/saml-describe.js +3 -2
  124. package/esm/cli/saml/saml-describe.js.map +1 -1
  125. package/esm/cli/saml/saml-export.js +6 -5
  126. package/esm/cli/saml/saml-export.js.map +1 -1
  127. package/esm/cli/saml/saml-import.js +7 -6
  128. package/esm/cli/saml/saml-import.js.map +1 -1
  129. package/esm/cli/saml/saml-list.js +3 -2
  130. package/esm/cli/saml/saml-list.js.map +1 -1
  131. package/esm/cli/saml/saml-metadata-export.js +5 -4
  132. package/esm/cli/saml/saml-metadata-export.js.map +1 -1
  133. package/esm/cli/script/script-delete.js +1 -1
  134. package/esm/cli/script/script-delete.js.map +1 -1
  135. package/esm/cli/script/script-describe.js +1 -1
  136. package/esm/cli/script/script-describe.js.map +1 -1
  137. package/esm/cli/script/script-export.js +6 -5
  138. package/esm/cli/script/script-export.js.map +1 -1
  139. package/esm/cli/script/script-import.js +3 -2
  140. package/esm/cli/script/script-import.js.map +1 -1
  141. package/esm/cli/script/script-list.js +3 -2
  142. package/esm/cli/script/script-list.js.map +1 -1
  143. package/esm/cli/theme/theme-delete.e2e.test_.js.map +1 -1
  144. package/esm/cli/theme/theme-delete.js +6 -5
  145. package/esm/cli/theme/theme-delete.js.map +1 -1
  146. package/esm/cli/theme/theme-export.js +7 -6
  147. package/esm/cli/theme/theme-export.js.map +1 -1
  148. package/esm/cli/theme/theme-import.js +8 -7
  149. package/esm/cli/theme/theme-import.js.map +1 -1
  150. package/esm/cli/theme/theme-list.e2e.test_.js.map +1 -1
  151. package/esm/cli/theme/theme-list.js +3 -2
  152. package/esm/cli/theme/theme-list.js.map +1 -1
  153. package/esm/ops/JourneyOps.js +325 -2
  154. package/esm/ops/JourneyOps.js.map +1 -1
  155. package/esm/ops/NodeOps.js.map +1 -1
  156. package/esm/ops/Saml2Ops.js.map +1 -1
  157. package/esm/ops/ScriptOps.js.map +1 -1
  158. package/esm/utils/Config.js.map +1 -1
  159. package/esm/utils/Console.js +1 -0
  160. package/esm/utils/Console.js.map +1 -1
  161. package/esm/utils/Version.js +1 -1
  162. package/esm/utils/Version.js.map +1 -1
  163. package/package.json +9 -3
@@ -1 +1 @@
1
- {"version":3,"file":"script-list.js","names":["Command","Option","Authenticate","Script","state","common","getTokens","listScripts","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","console","log","getRealm","long","parse"],"sources":["cli/script/script-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Script, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\nconst { listScripts } = Script;\n\nconst program = new Command('frodo script list');\n\nprogram\n .description('List scripts.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\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) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n console.log(\n `Listing scripts in realm \"${state.default.session.getRealm()}\"...`\n );\n await listScripts(options.long);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,MAAvB,EAA+BC,KAA/B,QAA4C,uBAA5C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBJ,YAAtB;AACA,MAAM;EAAEK;AAAF,IAAkBJ,MAAxB;AAEA,MAAMK,OAAO,GAAG,IAAIR,OAAJ,CAAY,mBAAZ,CAAhB;AAEAQ,OAAO,CACJC,WADH,CACe,eADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeP,MAAM,CAACQ,aAJtB,EAKGD,WALH,CAKeP,MAAM,CAACS,aALtB,EAMGF,WANH,CAMeP,MAAM,CAACU,YANtB,EAOGH,WAPH,CAOeP,MAAM,CAACW,gBAPtB,EAQGC,SARH,CAQaZ,MAAM,CAACa,gBARpB,EASGD,SATH,CASaZ,MAAM,CAACc,cATpB,EAUGF,SAVH,CAWI,IAAIhB,MAAJ,CAAW,YAAX,EAAyB,uBAAzB,EAAkDmB,OAAlD,CAA0D,KAA1D,EAAiE,OAAjE,CAXJ,EAaGC,MAbH,EAcI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CtB,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACAlB,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACAnB,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACApB,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACArB,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACA7B,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM7B,SAAS,EAAnB,EAAuB;IACrB8B,OAAO,CAACC,GAAR,CACG,6BAA4BjC,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBW,QAAtB,EAAiC,MADhE;IAGA,MAAM/B,WAAW,CAACmB,OAAO,CAACa,IAAT,CAAjB;EACD;AACF,CA5BL,CA6BI;AA7BJ;AAgCA/B,OAAO,CAACgC,KAAR"}
1
+ {"version":3,"file":"script-list.js","names":["Command","Option","Authenticate","Script","state","common","printMessage","getTokens","listScripts","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","getRealm","long","parse"],"sources":["cli/script/script-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Script, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { listScripts } = Script;\n\nconst program = new Command('frodo script list');\n\nprogram\n .description('List scripts.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\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) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(\n `Listing scripts in realm \"${state.default.session.getRealm()}\"...`\n );\n await listScripts(options.long);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,MAAvB,EAA+BC,KAA/B,QAA4C,uBAA5C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EAAEM;AAAF,IAAkBL,MAAxB;AAEA,MAAMM,OAAO,GAAG,IAAIT,OAAJ,CAAY,mBAAZ,CAAhB;AAEAS,OAAO,CACJC,WADH,CACe,eADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeR,MAAM,CAACS,aAJtB,EAKGD,WALH,CAKeR,MAAM,CAACU,aALtB,EAMGF,WANH,CAMeR,MAAM,CAACW,YANtB,EAOGH,WAPH,CAOeR,MAAM,CAACY,gBAPtB,EAQGC,SARH,CAQab,MAAM,CAACc,gBARpB,EASGD,SATH,CASab,MAAM,CAACe,cATpB,EAUGF,SAVH,CAWI,IAAIjB,MAAJ,CAAW,YAAX,EAAyB,uBAAzB,EAAkDoB,OAAlD,CAA0D,KAA1D,EAAiE,OAAjE,CAXJ,EAaGC,MAbH,EAcI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CvB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACAnB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACApB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACArB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAtB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACA9B,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM7B,SAAS,EAAnB,EAAuB;IACrBD,YAAY,CACT,6BAA4BF,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBS,QAAtB,EAAiC,MADpD,CAAZ;IAGA,MAAM7B,WAAW,CAACmB,OAAO,CAACW,IAAT,CAAjB;EACD;AACF,CA5BL,CA6BI;AA7BJ;AAgCA7B,OAAO,CAAC8B,KAAR"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme-delete.e2e.test_.js","names":["spawn","spawnSync","ansiEscapeCodes","beforeAll","beforeEach","deleteThemesCmd","status","console","error","stderr","toString","log","stdout","importTestThemesCmd","cwd","describe","it","done","deleteThemeCmd","expected","join","chunks","on","chunk","push","output","Buffer","concat","replace","expect","toContain"],"sources":["cli/theme/theme-delete.e2e.test_.ts"],"sourcesContent":["// import { jest } from '@jest/globals';\nimport { spawn, spawnSync } from 'child_process';\n\nconst ansiEscapeCodes =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\n/**\n * Run once before running the suites in this file\n */\nbeforeAll(async () => {});\n\n/**\n * Run before every test in every suite in this file\n */\nbeforeEach(async () => {\n // delete all themes\n const deleteThemesCmd = spawnSync('frodo', [\n 'theme',\n 'delete',\n '--all',\n 'frodo-dev',\n ]);\n if (deleteThemesCmd.status > 0) {\n console.error(deleteThemesCmd.stderr.toString());\n console.log(deleteThemesCmd.stdout.toString());\n }\n\n // import test themes\n const importTestThemesCmd = spawnSync(\n 'frodo',\n ['theme', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/theme/baseline`,\n }\n );\n if (importTestThemesCmd.status > 0) {\n console.error(importTestThemesCmd.stderr.toString());\n console.log(importTestThemesCmd.stdout.toString());\n }\n});\n\ndescribe('frodo theme delete', () => {\n it('\"frodo theme delete -n Zardoz\": should delete the Zardoz theme', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-n',\n 'Zardoz',\n 'frodo-dev',\n ]);\n const expected = ['✔ Deleted Zardoz.', ''].join('\\n');\n const chunks = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -n DoesNotExist\": should report an error that the theme does not exist', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-n',\n 'DoesNotExist',\n 'frodo-dev',\n ]);\n const expected = ['✖ Error: DoesNotExist not found', ''].join('\\n');\n const chunks = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -i 4ded6d91-ceea-400a-ae3f-42209f1b0e06\": should delete the 4ded6d91-ceea-400a-ae3f-42209f1b0e06 (Zardoz) theme', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-i',\n '4ded6d91-ceea-400a-ae3f-42209f1b0e06',\n 'frodo-dev',\n ]);\n const expected = [\n '✔ Deleted 4ded6d91-ceea-400a-ae3f-42209f1b0e06.',\n '',\n ].join('\\n');\n const chunks = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -i 4ded6d91-ceea-400a-ae3f-42209f1b0e07\": should report an error that the theme does not exist', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-i',\n '4ded6d91-ceea-400a-ae3f-42209f1b0e07',\n 'frodo-dev',\n ]);\n const expected = [\n '✖ Error: 4ded6d91-ceea-400a-ae3f-42209f1b0e07 not found',\n '',\n ].join('\\n');\n const chunks = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -a\": should delete all themes', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-a',\n 'frodo-dev',\n ]);\n const expected = ['✔ Deleted all realm themes.', ''].join('\\n');\n const chunks = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n});\n"],"mappings":"AAAA;AACA,SAASA,KAAT,EAAgBC,SAAhB,QAAiC,eAAjC;AAEA,MAAMC,eAAe,GACnB;AACA,6EAFF;AAIA;AACA;AACA;;AACAC,SAAS,CAAC,YAAY,CAAE,CAAf,CAAT;AAEA;AACA;AACA;;AACAC,UAAU,CAAC,YAAY;EACrB;EACA,MAAMC,eAAe,GAAGJ,SAAS,CAAC,OAAD,EAAU,CACzC,OADyC,EAEzC,QAFyC,EAGzC,OAHyC,EAIzC,WAJyC,CAAV,CAAjC;;EAMA,IAAII,eAAe,CAACC,MAAhB,GAAyB,CAA7B,EAAgC;IAC9BC,OAAO,CAACC,KAAR,CAAcH,eAAe,CAACI,MAAhB,CAAuBC,QAAvB,EAAd;IACAH,OAAO,CAACI,GAAR,CAAYN,eAAe,CAACO,MAAhB,CAAuBF,QAAvB,EAAZ;EACD,CAXoB,CAarB;;;EACA,MAAMG,mBAAmB,GAAGZ,SAAS,CACnC,OADmC,EAEnC,CAAC,OAAD,EAAU,QAAV,EAAoB,gBAApB,EAAsC,WAAtC,CAFmC,EAGnC;IACEa,GAAG,EAAG;EADR,CAHmC,CAArC;;EAOA,IAAID,mBAAmB,CAACP,MAApB,GAA6B,CAAjC,EAAoC;IAClCC,OAAO,CAACC,KAAR,CAAcK,mBAAmB,CAACJ,MAApB,CAA2BC,QAA3B,EAAd;IACAH,OAAO,CAACI,GAAR,CAAYE,mBAAmB,CAACD,MAApB,CAA2BF,QAA3B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FD;IAGAL,cAAc,CAACT,MAAf,CAAsBa,EAAtB,CAAyB,KAAzB,EAAgC,MAAM;MACpC,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAP,CAAcN,MAAd,EACZX,QADY,GAEZkB,OAFY,CAEJ1B,eAFI,EAEa,EAFb,CAAf;;MAGA,IAAI;QACF2B,MAAM,CAACJ,MAAD,CAAN,CAAeK,SAAf,CAAyBX,QAAzB;QACAF,IAAI;MACL,CAHD,CAGE,OAAOT,KAAP,EAAc;QACdS,IAAI,CAACT,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CAvBC,CAAF;AAwBD,CAvIO,CAAR"}
1
+ {"version":3,"file":"theme-delete.e2e.test_.js","names":["spawn","spawnSync","ansiEscapeCodes","beforeAll","beforeEach","deleteThemesCmd","status","console","error","stderr","toString","log","stdout","importTestThemesCmd","cwd","describe","it","done","deleteThemeCmd","expected","join","chunks","on","chunk","push","output","Buffer","concat","replace","expect","toContain"],"sources":["cli/theme/theme-delete.e2e.test_.ts"],"sourcesContent":["/* eslint-disable no-console */\n// import { jest } from '@jest/globals';\nimport { spawn, spawnSync } from 'child_process';\n\nconst ansiEscapeCodes =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\n/**\n * Run once before running the suites in this file\n */\nbeforeAll(async () => {\n //\n});\n\n/**\n * Run before every test in every suite in this file\n */\nbeforeEach(async () => {\n // delete all themes\n const deleteThemesCmd = spawnSync('frodo', [\n 'theme',\n 'delete',\n '--all',\n 'frodo-dev',\n ]);\n if (deleteThemesCmd.status && deleteThemesCmd.status > 0) {\n console.error(deleteThemesCmd.stderr.toString());\n console.log(deleteThemesCmd.stdout.toString());\n }\n\n // import test themes\n const importTestThemesCmd = spawnSync(\n 'frodo',\n ['theme', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/theme/baseline`,\n }\n );\n if (importTestThemesCmd.status && importTestThemesCmd.status > 0) {\n console.error(importTestThemesCmd.stderr.toString());\n console.log(importTestThemesCmd.stdout.toString());\n }\n});\n\ndescribe('frodo theme delete', () => {\n it('\"frodo theme delete -n Zardoz\": should delete the Zardoz theme', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-n',\n 'Zardoz',\n 'frodo-dev',\n ]);\n const expected = ['✔ Deleted Zardoz.', ''].join('\\n');\n const chunks: Uint8Array[] = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -n DoesNotExist\": should report an error that the theme does not exist', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-n',\n 'DoesNotExist',\n 'frodo-dev',\n ]);\n const expected = ['✖ Error: DoesNotExist not found', ''].join('\\n');\n const chunks: Uint8Array[] = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -i 4ded6d91-ceea-400a-ae3f-42209f1b0e06\": should delete the 4ded6d91-ceea-400a-ae3f-42209f1b0e06 (Zardoz) theme', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-i',\n '4ded6d91-ceea-400a-ae3f-42209f1b0e06',\n 'frodo-dev',\n ]);\n const expected = [\n '✔ Deleted 4ded6d91-ceea-400a-ae3f-42209f1b0e06.',\n '',\n ].join('\\n');\n const chunks: Uint8Array[] = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -i 4ded6d91-ceea-400a-ae3f-42209f1b0e07\": should report an error that the theme does not exist', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-i',\n '4ded6d91-ceea-400a-ae3f-42209f1b0e07',\n 'frodo-dev',\n ]);\n const expected = [\n '✖ Error: 4ded6d91-ceea-400a-ae3f-42209f1b0e07 not found',\n '',\n ].join('\\n');\n const chunks: Uint8Array[] = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme delete -a\": should delete all themes', (done) => {\n const deleteThemeCmd = spawn('frodo', [\n 'theme',\n 'delete',\n '-a',\n 'frodo-dev',\n ]);\n const expected = ['✔ Deleted all realm themes.', ''].join('\\n');\n const chunks: Uint8Array[] = [];\n deleteThemeCmd.stderr.on('data', (chunk) => {\n chunks.push(chunk);\n });\n deleteThemeCmd.stderr.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toContain(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA,SAASA,KAAT,EAAgBC,SAAhB,QAAiC,eAAjC;AAEA,MAAMC,eAAe,GACnB;AACA,6EAFF;AAIA;AACA;AACA;;AACAC,SAAS,CAAC,YAAY,CACpB;AACD,CAFQ,CAAT;AAIA;AACA;AACA;;AACAC,UAAU,CAAC,YAAY;EACrB;EACA,MAAMC,eAAe,GAAGJ,SAAS,CAAC,OAAD,EAAU,CACzC,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AAM,GAAGC,MAAM,CAACC,MAAP,CAAcN,MAAd,EACZX,QADY,GAEZkB,OAFY,CAEJ1B,eAFI,EAEa,EAFb,CAAf;;MAGA,IAAI;QACF2B,MAAM,CAACJ,MAAD,CAAN,CAAeK,SAAf,CAAyBX,QAAzB;QACAF,IAAI;MACL,CAHD,CAGE,OAAOT,KAAP,EAAc;QACdS,IAAI,CAACT,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CA3BC,CAAF;EA6BAQ,EAAE,CAAC,mDAAD,EAAuDC,IAAD,IAAU;IAChE,MAAMC,cAAc,GAAGlB,KAAK,CAAC,OAAD,EAAU,CACpC,OADoC,EAEpC,QAFoC,EAGpC,IAHoC,EAIpC,WAJoC,CAAV,CAA5B;IAMA,MAAMmB,QAAQ,GAAG,CAAC,6BAAD,EAAgC,EAAhC,EAAoCC,IAApC,CAAyC,IAAzC,CAAjB;IACA,MAAMC,MAAoB,GAAG,EAA7B;IACAH,cAAc,CAACT,MAAf,CAAsBa,EAAtB,CAAyB,MAAzB,EAAkCC,KAAD,IAAW;MAC1CF,MAAM,CAACG,IAAP,CAAYD,KAAZ;IACD,CAFD;IAGAL,cAAc,CAACT,MAAf,CAAsBa,EAAtB,CAAyB,KAAzB,EAAgC,MAAM;MACpC,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAP,CAAcN,MAAd,EACZX,QADY,GAEZkB,OAFY,CAEJ1B,eAFI,EAEa,EAFb,CAAf;;MAGA,IAAI;QACF2B,MAAM,CAACJ,MAAD,CAAN,CAAeK,SAAf,CAAyBX,QAAzB;QACAF,IAAI;MACL,CAHD,CAGE,OAAOT,KAAP,EAAc;QACdS,IAAI,CAACT,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CAvBC,CAAF;AAwBD,CAvIO,CAAR"}
@@ -1,6 +1,7 @@
1
1
  import { Command, Option } from 'commander';
2
2
  import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
3
+ import * as common from '../cmd_common';
4
+ import { printMessage } from '../../utils/Console';
4
5
  const {
5
6
  getTokens
6
7
  } = Authenticate;
@@ -22,19 +23,19 @@ async (host, realm, user, password, options) => {
22
23
  if (await getTokens()) {
23
24
  // delete by name
24
25
  if (options.themeName) {
25
- console.log(`Deleting theme with name "${options.themeName}" from realm "${state.default.session.getRealm()}"...`);
26
+ printMessage(`Deleting theme with name "${options.themeName}" from realm "${state.default.session.getRealm()}"...`);
26
27
  deleteThemeByNameCmd(options.themeName);
27
28
  } // delete by id
28
29
  else if (options.themeId) {
29
- console.log(`Deleting theme with id "${options.themeId}" from realm "${state.default.session.getRealm()}"...`);
30
+ printMessage(`Deleting theme with id "${options.themeId}" from realm "${state.default.session.getRealm()}"...`);
30
31
  deleteThemeCmd(options.themeId);
31
32
  } // --all -a
32
33
  else if (options.all) {
33
- console.log(`Deleting all themes from realm "${state.default.session.getRealm()}"...`);
34
+ printMessage(`Deleting all themes from realm "${state.default.session.getRealm()}"...`);
34
35
  deleteThemesCmd();
35
36
  } // unrecognized combination of options or no options
36
37
  else {
37
- console.log('Unrecognized combination of options or no options...');
38
+ printMessage('Unrecognized combination of options or no options...');
38
39
  program.help();
39
40
  }
40
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theme-delete.js","names":["Command","Option","Authenticate","Theme","state","common","getTokens","deleteThemeByNameCmd","deleteThemeCmd","deleteThemesCmd","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","themeName","console","log","getRealm","themeId","all","help","parse"],"sources":["cli/theme/theme-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\nconst { deleteThemeByNameCmd, deleteThemeCmd, deleteThemesCmd } = Theme;\n\nconst program = new Command('frodo theme delete');\n\nprogram\n .description('Delete themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the themes in the realm. Ignored with -n and -i.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // delete by name\n if (options.themeName) {\n console.log(\n `Deleting theme with name \"${\n options.themeName\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemeByNameCmd(options.themeName);\n }\n // delete by id\n else if (options.themeId) {\n console.log(\n `Deleting theme with id \"${\n options.themeId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemeCmd(options.themeId);\n }\n // --all -a\n else if (options.all) {\n console.log(\n `Deleting all themes from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemesCmd();\n }\n // unrecognized combination of options or no options\n else {\n console.log('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBJ,YAAtB;A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AAM/B,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACW,SAAZ,EAAuB;MACrBC,OAAO,CAACC,GAAR,CACG,6BACCb,OAAO,CAACW,SACT,iBAAgBlC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBY,QAAtB,EAAiC,MAHpD;MAKAlC,oBAAoB,CAACoB,OAAO,CAACW,SAAT,CAApB;IACD,CAPD,CAQA;IARA,KASK,IAAIX,OAAO,CAACe,OAAZ,EAAqB;MACxBH,OAAO,CAACC,GAAR,CACG,2BACCb,OAAO,CAACe,OACT,iBAAgBtC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBY,QAAtB,EAAiC,MAHpD;MAKAjC,cAAc,CAACmB,OAAO,CAACe,OAAT,CAAd;IACD,CAPI,CAQL;IARK,KASA,IAAIf,OAAO,CAACgB,GAAZ,EAAiB;MACpBJ,OAAO,CAACC,GAAR,CACG,mCAAkCpC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBY,QAAtB,EAAiC,MADtE;MAGAhC,eAAe;IAChB,CALI,CAML;IANK,KAOA;MACH8B,OAAO,CAACC,GAAR,CAAY,sDAAZ;MACA9B,OAAO,CAACkC,IAAR;IACD;EACF;AACF,CArEL,CAsEI;AAtEJ;AAyEAlC,OAAO,CAACmC,KAAR"}
1
+ {"version":3,"file":"theme-delete.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","deleteThemeByNameCmd","deleteThemeCmd","deleteThemesCmd","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","themeName","getRealm","themeId","all","help","parse"],"sources":["cli/theme/theme-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { deleteThemeByNameCmd, deleteThemeCmd, deleteThemesCmd } = Theme;\n\nconst program = new Command('frodo theme delete');\n\nprogram\n .description('Delete themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the themes in the realm. Ignored with -n and -i.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // delete by name\n if (options.themeName) {\n printMessage(\n `Deleting theme with name \"${\n options.themeName\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemeByNameCmd(options.themeName);\n }\n // delete by id\n else if (options.themeId) {\n printMessage(\n `Deleting theme with id \"${\n options.themeId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemeCmd(options.themeId);\n }\n // --all -a\n else if (options.all) {\n printMessage(\n `Deleting all themes from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemesCmd();\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,u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wCP,OAAO,CAACQ,IAAhD;EACAhC,KAAK,CAACyB,OAAN,CAAcC,OAAd,CAAsBO,0BAAtB,CAAiDT,OAAO,CAACU,QAAzD;;EACA,IAAI,MAAM/B,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACW,SAAZ,EAAuB;MACrBjC,YAAY,CACT,6BACCsB,OAAO,CAACW,SACT,iBAAgBnC,KAAK,CAACyB,OAAN,CAAcC,OAAd,CAAsBU,QAAtB,EAAiC,MAHxC,CAAZ;MAKAhC,oBAAoB,CAACoB,OAAO,CAACW,SAAT,CAApB;IACD,CAPD,CAQA;IARA,KASK,IAAIX,OAAO,CAACa,OAAZ,EAAqB;MACxBnC,YAAY,CACT,2BACCsB,OAAO,CAACa,OACT,iBAAgBrC,KAAK,CAACyB,OAAN,CAAcC,OAAd,CAAsBU,QAAtB,EAAiC,MAHxC,CAAZ;MAKA/B,cAAc,CAACmB,OAAO,CAACa,OAAT,CAAd;IACD,CAPI,CAQL;IARK,KASA,IAAIb,OAAO,CAACc,GAAZ,EAAiB;MACpBpC,YAAY,CACT,mCAAkCF,KAAK,CAACyB,OAAN,CAAcC,OAAd,CAAsBU,QAAtB,EAAiC,MAD1D,CAAZ;MAGA9B,eAAe;IAChB,CALI,CAML;IANK,KAOA;MACHJ,YAAY,CAAC,sDAAD,CAAZ;MACAK,OAAO,CAACgC,IAAR;IACD;EACF;AACF,CArEL,CAsEI;AAtEJ;AAyEAhC,OAAO,CAACiC,KAAR"}
@@ -1,6 +1,7 @@
1
1
  import { Command, Option } from 'commander';
2
2
  import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
3
+ import * as common from '../cmd_common';
4
+ import { printMessage } from '../../utils/Console';
4
5
  const {
5
6
  getTokens
6
7
  } = Authenticate;
@@ -23,23 +24,23 @@ async (host, realm, user, password, options) => {
23
24
  if (await getTokens()) {
24
25
  // export by name
25
26
  if (options.themeName) {
26
- console.log(`Exporting theme "${options.themeName}" from realm "${state.default.session.getRealm()}"...`);
27
+ printMessage(`Exporting theme "${options.themeName}" from realm "${state.default.session.getRealm()}"...`);
27
28
  exportThemeByName(options.themeName, options.file);
28
29
  } // export by id
29
30
  else if (options.themeId) {
30
- console.log(`Exporting theme "${options.themeId}" from realm "${state.default.session.getRealm()}"...`);
31
+ printMessage(`Exporting theme "${options.themeId}" from realm "${state.default.session.getRealm()}"...`);
31
32
  exportThemeById(options.themeId, options.file);
32
33
  } // --all -a
33
34
  else if (options.all) {
34
- console.log('Exporting all themes to a single file...');
35
+ printMessage('Exporting all themes to a single file...');
35
36
  exportThemesToFile(options.file);
36
37
  } // --all-separate -A
37
38
  else if (options.allSeparate) {
38
- console.log('Exporting all themes to separate files...');
39
+ printMessage('Exporting all themes to separate files...');
39
40
  exportThemesToFiles();
40
41
  } // unrecognized combination of options or no options
41
42
  else {
42
- console.log('Unrecognized combination of options or no options...', 'error');
43
+ printMessage('Unrecognized combination of options or no options...', 'error');
43
44
  program.help();
44
45
  }
45
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theme-export.js","names":["Command","Option","Authenticate","Theme","state","common","getTokens","exportThemeById","exportThemeByName","exportThemesToFile","exportThemesToFiles","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","themeName","console","log","getRealm","file","themeId","all","allSeparate","help","parse"],"sources":["cli/theme/theme-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst {\n exportThemeById,\n exportThemeByName,\n exportThemesToFile,\n exportThemesToFiles,\n} = Theme;\n\nconst program = new Command('frodo theme export');\n\nprogram\n .description('Export themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. 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 theme(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the themes in a realm to a single file. Ignored with -n and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the themes in a realm as separate files <theme name>.theme.json. Ignored with -n, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // export by name\n if (options.themeName) {\n console.log(\n `Exporting theme \"${\n options.themeName\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportThemeByName(options.themeName, options.file);\n }\n // export by id\n else if (options.themeId) {\n console.log(\n `Exporting theme \"${\n options.themeId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportThemeById(options.themeId, options.file);\n }\n // --all -a\n else if (options.all) {\n console.log('Exporting all themes to a single file...');\n exportThemesToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n console.log('Exporting all themes to separate files...');\n exportThemesToFiles();\n }\n // unrecognized combination of options or no options\n else {\n console.log(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAAS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AwFI;AAxFJ;AA2FApC,OAAO,CAACqC,KAAR"}
1
+ {"version":3,"file":"theme-export.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","exportThemeById","exportThemeByName","exportThemesToFile","exportThemesToFiles","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","themeName","getRealm","file","themeId","all","allSeparate","help","parse"],"sources":["cli/theme/theme-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst {\n exportThemeById,\n exportThemeByName,\n exportThemesToFile,\n exportThemesToFiles,\n} = Theme;\n\nconst program = new Command('frodo theme export');\n\nprogram\n .description('Export themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. 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 theme(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the themes in a realm to a single file. Ignored with -n and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the themes in a realm as separate files <theme name>.theme.json. Ignored with -n, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // export by name\n if (options.themeName) {\n printMessage(\n `Exporting theme \"${\n options.themeName\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportThemeByName(options.themeName, options.file);\n }\n // export by id\n else if (options.themeId) {\n printMessage(\n `Exporting theme \"${\n options.themeId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportThemeById(options.themeId, options.file);\n }\n // --all -a\n else if (options.all) {\n printMessage('Exporting all themes to a single file...');\n exportThemesToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n printMessage('Exporting all themes to separate files...');\n exportThemesToFiles();\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 }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AAEA,MAAM;EACJM,eADI;EAEJC,iBAFI;EAGJC,kBAHI;EAIJC;AAJI,IAKFR,KALJ;AAOA,MAAMS,OAAO,GAAG,IAAIZ,OAAJ,CAAY,oBAAZ,CAAhB;AAEAY,OAAO,CACJC,WADH,CACe,gBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,aAJtB,EAKGD,WALH,CAKeX,MAAM,CAACa,aALtB,EAMGF,WANH,CAMeX,MAAM,CAACc,YANtB,EAOGH,WAPH,CAOeX,MAAM,CAACe,gBAPtB,EAQGC,SARH,CAQahB,MAAM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AoBX,OAAO,CAACa,IAA5B,CAAjB;IACD,CAPD,CAQA;IARA,KASK,IAAIb,OAAO,CAACc,OAAZ,EAAqB;MACxBrC,YAAY,CACT,oBACCuB,OAAO,CAACc,OACT,iBAAgBvC,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBU,QAAtB,EAAiC,MAHxC,CAAZ;MAKAjC,eAAe,CAACqB,OAAO,CAACc,OAAT,EAAkBd,OAAO,CAACa,IAA1B,CAAf;IACD,CAPI,CAQL;IARK,KASA,IAAIb,OAAO,CAACe,GAAZ,EAAiB;MACpBtC,YAAY,CAAC,0CAAD,CAAZ;MACAI,kBAAkB,CAACmB,OAAO,CAACa,IAAT,CAAlB;IACD,CAHI,CAIL;IAJK,KAKA,IAAIb,OAAO,CAACgB,WAAZ,EAAyB;MAC5BvC,YAAY,CAAC,2CAAD,CAAZ;MACAK,mBAAmB;IACpB,CAHI,CAIL;IAJK,KAKA;MACHL,YAAY,CACV,sDADU,EAEV,OAFU,CAAZ;MAIAM,OAAO,CAACkC,IAAR;IACD;EACF;AACF,CAvFL,CAwFI;AAxFJ;AA2FAlC,OAAO,CAACmC,KAAR"}
@@ -1,6 +1,7 @@
1
1
  import { Command, Option } from 'commander';
2
2
  import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
3
+ import * as common from '../cmd_common';
4
+ import { printMessage } from '../../utils/Console';
4
5
  const {
5
6
  getTokens
6
7
  } = Authenticate;
@@ -26,27 +27,27 @@ async (host, realm, user, password, options) => {
26
27
  if (await getTokens()) {
27
28
  // import by name
28
29
  if (options.file && options.themeName) {
29
- console.log(`Importing theme with name "${options.themeName}" into realm "${state.default.session.getRealm()}"...`);
30
+ printMessage(`Importing theme with name "${options.themeName}" into realm "${state.default.session.getRealm()}"...`);
30
31
  importThemeByName(options.themeName, options.file);
31
32
  } // import by id
32
33
  else if (options.file && options.themeId) {
33
- console.log(`Importing theme with id "${options.themeId}" into realm "${state.default.session.getRealm()}"...`);
34
+ printMessage(`Importing theme with id "${options.themeId}" into realm "${state.default.session.getRealm()}"...`);
34
35
  importThemeById(options.themeId, options.file);
35
36
  } // --all -a
36
37
  else if (options.all && options.file) {
37
- console.log(`Importing all themes from a single file (${options.file})...`);
38
+ printMessage(`Importing all themes from a single file (${options.file})...`);
38
39
  importThemesFromFile(options.file);
39
40
  } // --all-separate -A
40
41
  else if (options.allSeparate && !options.file) {
41
- console.log('Importing all themes from separate files in current directory...');
42
+ printMessage('Importing all themes from separate files in current directory...');
42
43
  importThemesFromFiles();
43
44
  } // import single theme from file
44
45
  else if (options.file) {
45
- console.log(`Importing first theme from file "${options.file}" into realm "${state.default.session.getRealm()}"...`);
46
+ printMessage(`Importing first theme from file "${options.file}" into realm "${state.default.session.getRealm()}"...`);
46
47
  importFirstThemeFromFile(options.file);
47
48
  } // unrecognized combination of options or no options
48
49
  else {
49
- console.log('Unrecognized combination of options or no options...');
50
+ printMessage('Unrecognized combination of options or no options...');
50
51
  program.help();
51
52
  }
52
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theme-import.js","names":["Command","Option","Authenticate","Theme","state","common","getTokens","importFirstThemeFromFile","importThemeById","importThemeByName","importThemesFromFile","importThemesFromFiles","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","file","themeName","console","log","getRealm","themeId","all","allSeparate","help","parse"],"sources":["cli/theme/theme-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst {\n importFirstThemeFromFile,\n importThemeById,\n importThemeByName,\n importThemesFromFile,\n importThemesFromFiles,\n} = Theme;\n\nconst program = new Command('frodo theme import');\n\nprogram\n .description('Import themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. 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 theme(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the themes from single file. Ignored with -n or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the themes from separate files (*.json) in the current directory. Ignored with -n or -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n if (await getTokens()) {\n // import by name\n if (options.file && options.themeName) {\n console.log(\n `Importing theme with name \"${\n options.themeName\n }\" into realm \"${state.default.session.getRealm()}\"...`\n );\n importThemeByName(options.themeName, options.file);\n }\n // import by id\n else if (options.file && options.themeId) {\n console.log(\n `Importing theme with id \"${\n options.themeId\n }\" into realm \"${state.default.session.getRealm()}\"...`\n );\n importThemeById(options.themeId, options.file);\n }\n // --all -a\n else if (options.all && options.file) {\n console.log(\n `Importing all themes from a single file (${options.file})...`\n );\n importThemesFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file) {\n console.log(\n 'Importing all themes from separate files in current directory...'\n );\n importThemesFromFiles();\n }\n // import single theme from file\n else if (options.file) {\n console.log(\n `Importing first theme from file \"${\n options.file\n }\" into realm \"${state.default.session.getRealm()}\"...`\n );\n importFirstThemeFromFile(options.file);\n }\n // unrecognized combination of options or no options\n else {\n console.log('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBJ,YAAtB;AAEA,MAAM;EACJK,wBADI;EAEJC,eAFI;EAGJC,iBAHI;EAIJC,oBAJI;EAKJC;AALI,IAMFR,KANJ;AAQA,MAAMS,OAAO,GAAG,IAAIZ,OAAJ,CAAY,oBAAZ,CAAhB;AAEAY,OAAO,CACJC,WADH,CACe,gBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,aAJtB,EAKGD,WALH,CAKeX,MAAM,CAACa,aALtB,EAMGF,WANH,CAMeX,MAAM,CAACc,YANtB,EAOGH,WAPH,CAOeX,MAAM,CAACe,gBAPtB,EAQGC,SARH,CAQahB,MAAM,CAACiB,gBARpB,EASGD,SATH,CASahB,MAAM,CAACkB,cATpB,EAUGF,SAVH,CAUahB,MAAM,CAACmB,aAVpB,EAWGH,SAXH,CAWahB,MAAM,CAACoB,WAXpB,EAYGJ,SAZH,CAaI,IAAIpB,MAAJ,CACE,yBADF,EAEE,yDAFF,CAbJ,EAkBGoB,SAlBH,CAmBI,IAAIpB,MAAJ,CACE,uBADF,EAEE,yDAFF,CAnBJ,EAwBGoB,SAxBH,CAyBI,IAAIpB,MAAJ,CACE,mBADF,EAEE,+CAFF,CAzBJ,EA8BGoB,SA9BH,CA+BI,IAAIpB,MAAJ,CACE,WADF,EAEE,gEAFF,CA/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,OAAO,CAACC,GAAR,CACG,4BACClB,OAAO,CAACoB,OACT,iBAAgB/C,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBiB,QAAtB,EAAiC,MAHpD;MAKA1C,eAAe,CAACuB,OAAO,CAACoB,OAAT,EAAkBpB,OAAO,CAACe,IAA1B,CAAf;IACD,CAPI,CAQL;IARK,KASA,IAAIf,OAAO,CAACqB,GAAR,IAAerB,OAAO,CAACe,IAA3B,EAAiC;MACpCE,OAAO,CAACC,GAAR,CACG,4CAA2ClB,OAAO,CAACe,IAAK,MAD3D;MAGApC,oBAAoB,CAACqB,OAAO,CAACe,IAAT,CAApB;IACD,CALI,CAML;IANK,KAOA,IAAIf,OAAO,CAACsB,WAAR,IAAuB,CAACtB,OAAO,CAACe,IAApC,EAA0C;MAC7CE,OAAO,CAACC,GAAR,CACE,kEADF;MAGAtC,qBAAqB;IACtB,CALI,CAML;IANK,KAOA,IAAIoB,OAAO,CAACe,IAAZ,EAAkB;MACrBE,OAAO,CAACC,GAAR,CACG,oCACClB,OAAO,CAACe,IACT,iBAAgB1C,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBiB,QAAtB,EAAiC,MAHpD;MAKA3C,wBAAwB,CAACwB,OAAO,CAACe,IAAT,CAAxB;IACD,CAPI,CAQL;IARK,KASA;MACHE,OAAO,CAACC,GAAR,CAAY,sDAAZ;MACArC,OAAO,CAAC0C,IAAR;IACD;EACF;AACF,CArGL,CAsGI;AAtGJ;AAyGA1C,OAAO,CAAC2C,KAAR"}
1
+ {"version":3,"file":"theme-import.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","importFirstThemeFromFile","importThemeById","importThemeByName","importThemesFromFile","importThemesFromFiles","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","file","themeName","getRealm","themeId","all","allSeparate","help","parse"],"sources":["cli/theme/theme-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst {\n importFirstThemeFromFile,\n importThemeById,\n importThemeByName,\n importThemesFromFile,\n importThemesFromFiles,\n} = Theme;\n\nconst program = new Command('frodo theme import');\n\nprogram\n .description('Import themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. 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 theme(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the themes from single file. Ignored with -n or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the themes from separate files (*.json) in the current directory. Ignored with -n or -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n if (await getTokens()) {\n // import by name\n if (options.file && options.themeName) {\n printMessage(\n `Importing theme with name \"${\n options.themeName\n }\" into realm \"${state.default.session.getRealm()}\"...`\n );\n importThemeByName(options.themeName, options.file);\n }\n // import by id\n else if (options.file && options.themeId) {\n printMessage(\n `Importing theme with id \"${\n options.themeId\n }\" into realm \"${state.default.session.getRealm()}\"...`\n );\n importThemeById(options.themeId, options.file);\n }\n // --all -a\n else if (options.all && options.file) {\n printMessage(\n `Importing all themes from a single file (${options.file})...`\n );\n importThemesFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file) {\n printMessage(\n 'Importing all themes from separate files in current directory...'\n );\n importThemesFromFiles();\n }\n // import single theme from file\n else if (options.file) {\n printMessage(\n `Importing first theme from file \"${\n options.file\n }\" into realm \"${state.default.session.getRealm()}\"...`\n );\n importFirstThemeFromFile(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 }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AAEA,MAAM;EACJM,wBADI;EAEJC,eAFI;EAGJC,iBAHI;EAIJC,oBAJI;EAKJC;AALI,IAMFT,KANJ;AAQA,MAAMU,OAAO,GAAG,IAAIb,OAAJ,CAAY,oBAAZ,CAAhB;AAEAa,OAAO,CACJC,WADH,CACe,gBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeZ,MAAM,CAACa,aAJtB,EAKGD,WALH,CAKeZ,MAAM,CAACc,aALtB,EAMGF,WANH,CAMeZ,MAAM,CAACe,YANtB,EAOGH,WAPH,CAOeZ,MAAM,CAACgB,gBAPtB,EAQGC,SARH,CAQajB,MAAM,CAACkB,gBARpB,EASGD,SATH,CASajB,MAAM,CAACmB,cAT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ArGL,CAsGI;AAtGJ;AAyGAxC,OAAO,CAACyC,KAAR"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme-list.e2e.test_.js","names":["spawn","spawnSync","ansiEscapeCodes","beforeAll","deleteThemesCmd","status","console","error","stderr","toString","log","stdout","importBaselineThemesCmd","cwd","describe","it","done","themeList","expected","join","chunks","on","chunk","push","output","Buffer","concat","replace","expect","toBe","expectedLong"],"sources":["cli/theme/theme-list.e2e.test_.ts"],"sourcesContent":["// import { jest } from '@jest/globals';\nimport { spawn, spawnSync } from 'child_process';\n\nconst ansiEscapeCodes =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\n/**\n * delete all themes and import baseline and additional test themes\n */\nbeforeAll(async () => {\n // delete all themes\n const deleteThemesCmd = spawnSync('frodo', [\n 'theme',\n 'delete',\n '--all',\n 'frodo-dev',\n ]);\n if (deleteThemesCmd.status > 0) {\n console.error(deleteThemesCmd.stderr.toString());\n console.log(deleteThemesCmd.stdout.toString());\n }\n\n // import baseline themes\n const importBaselineThemesCmd = spawnSync(\n 'frodo',\n ['theme', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/theme/baseline`,\n }\n );\n if (importBaselineThemesCmd.status > 0) {\n console.error(importBaselineThemesCmd.stderr.toString());\n console.log(importBaselineThemesCmd.stdout.toString());\n }\n});\n\ndescribe('frodo theme list', () => {\n it('\"frodo theme list\": should list the names of the default themes', (done) => {\n const themeList = spawn('frodo', ['theme', 'list', 'frodo-dev']);\n const expected = [\n 'Contrast',\n 'Highlander',\n 'Robroy',\n 'Starter Theme',\n 'Zardoz',\n '',\n ].join('\\n');\n\n const chunks = [];\n themeList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n themeList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n const expectedLong = [\n 'Name │Id │Default',\n 'Contrast │cd6c93e2-52e2-4340-9770-66a588343841│ ',\n 'Highlander │00203891-dde0-4114-b27a-219ae0b43a61│ ',\n 'Robroy │b82755e8-fe9a-4d27-b66b-45e37ae12345│ ',\n 'Starter Theme│86ce2f64-586d-44fe-8593-b12a85aac68d│Yes ',\n 'Zardoz │4ded6d91-ceea-400a-ae3f-42209f1b0e06│ ',\n '',\n ].join('\\n');\n\n it('\"frodo theme list -l\": should list the names, ids, and default flag of the baseline themes', (done) => {\n const themeList = spawn('frodo', ['theme', 'list', '-l', 'frodo-dev']);\n\n const chunks = [];\n themeList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n themeList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme list --long\": should list the names, status, and default flag of the baseline themes', (done) => {\n const themeList = spawn('frodo', ['theme', 'list', '--long', 'frodo-dev']);\n\n const chunks = [];\n themeList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n themeList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n});\n"],"mappings":"AAAA;AACA,SAASA,KAAT,EAAgBC,SAAhB,QAAiC,eAAjC;AAEA,MAAMC,eAAe,GACnB;AACA,6EAFF;AAIA;AACA;AACA;;AACAC,SAAS,CAAC,YAAY;EACpB;EACA,MAAMC,eAAe,GAAGH,SAAS,CAAC,OAAD,EAAU,CACzC,OADyC,EAEzC,QAFyC,EAGzC,OAHyC,EAIzC,WAJyC,CAAV,CAAjC;;EAMA,IAAIG,eAAe,CAACC,MAAhB,GAAyB,CAA7B,EAAgC;IAC9BC,OAAO,CAACC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CAAiBU,EAAjB,CAAoB,MAApB,EAA6BC,KAAD,IAAW;MACrCF,MAAM,CAACG,IAAP,CAAYD,KAAZ;IACD,CAFD;IAIAL,SAAS,CAACN,MAAV,CAAiBU,EAAjB,CAAoB,KAApB,EAA2B,MAAM;MAC/B,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAP,CAAcN,MAAd,EACZX,QADY,GAEZkB,OAFY,CAEJzB,eAFI,EAEa,EAFb,CAAf;;MAGA,IAAI;QACF0B,MAAM,CAACJ,MAAD,CAAN,CAAeK,IAAf,CAAoBC,YAApB;QACAd,IAAI;MACL,CAHD,CAGE,OAAOT,KAAP,EAAc;QACdS,IAAI,CAACT,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CAnBC,CAAF;AAoBD,CAjFO,CAAR"}
1
+ {"version":3,"file":"theme-list.e2e.test_.js","names":["spawn","spawnSync","ansiEscapeCodes","beforeAll","deleteThemesCmd","status","console","error","stderr","toString","log","stdout","importBaselineThemesCmd","cwd","describe","it","done","themeList","expected","join","chunks","on","chunk","push","output","Buffer","concat","replace","expect","toBe","expectedLong"],"sources":["cli/theme/theme-list.e2e.test_.ts"],"sourcesContent":["/* eslint-disable no-console */\n// import { jest } from '@jest/globals';\nimport { spawn, spawnSync } from 'child_process';\n\nconst ansiEscapeCodes =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\n/**\n * delete all themes and import baseline and additional test themes\n */\nbeforeAll(async () => {\n // delete all themes\n const deleteThemesCmd = spawnSync('frodo', [\n 'theme',\n 'delete',\n '--all',\n 'frodo-dev',\n ]);\n if (deleteThemesCmd.status && deleteThemesCmd.status > 0) {\n console.error(deleteThemesCmd.stderr.toString());\n console.log(deleteThemesCmd.stdout.toString());\n }\n\n // import baseline themes\n const importBaselineThemesCmd = spawnSync(\n 'frodo',\n ['theme', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/theme/baseline`,\n }\n );\n if (importBaselineThemesCmd.status && importBaselineThemesCmd.status > 0) {\n console.error(importBaselineThemesCmd.stderr.toString());\n console.log(importBaselineThemesCmd.stdout.toString());\n }\n});\n\ndescribe('frodo theme list', () => {\n it('\"frodo theme list\": should list the names of the default themes', (done) => {\n const themeList = spawn('frodo', ['theme', 'list', 'frodo-dev']);\n const expected = [\n 'Contrast',\n 'Highlander',\n 'Robroy',\n 'Starter Theme',\n 'Zardoz',\n '',\n ].join('\\n');\n\n const chunks: Uint8Array[] = [];\n themeList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n themeList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n const expectedLong = [\n 'Name │Id │Default',\n 'Contrast │cd6c93e2-52e2-4340-9770-66a588343841│ ',\n 'Highlander │00203891-dde0-4114-b27a-219ae0b43a61│ ',\n 'Robroy │b82755e8-fe9a-4d27-b66b-45e37ae12345│ ',\n 'Starter Theme│86ce2f64-586d-44fe-8593-b12a85aac68d│Yes ',\n 'Zardoz │4ded6d91-ceea-400a-ae3f-42209f1b0e06│ ',\n '',\n ].join('\\n');\n\n it('\"frodo theme list -l\": should list the names, ids, and default flag of the baseline themes', (done) => {\n const themeList = spawn('frodo', ['theme', 'list', '-l', 'frodo-dev']);\n\n const chunks: Uint8Array[] = [];\n themeList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n themeList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo theme list --long\": should list the names, status, and default flag of the baseline themes', (done) => {\n const themeList = spawn('frodo', ['theme', 'list', '--long', 'frodo-dev']);\n\n const chunks: Uint8Array[] = [];\n themeList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n themeList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA,SAASA,KAAT,EAAgBC,SAAhB,QAAiC,eAAjC;AAEA,MAAMC,eAAe,GACnB;AACA,6EAFF;AAIA;AACA;AACA;;AACAC,SAAS,CAAC,YAAY;EACpB;EACA,MAAMC,eAAe,GAAGH,SAAS,CAAC,OAAD,EAAU,CACzC,OADyC,EAEzC,QAFyC,EAGzC,OAHyC,EAIzC,WAJyC,CAAV,CAAjC;;EAMA,IAAIG,eAAe,CAACC,MAAhB,IAA0BD,eAAe,CAACC,MAAhB,GAAyB,CAAvD,EAA0D;IACxDC,OAAO,CAACC,KAAR,CAAcH,eAAe,CAACI,MAAhB,CAAuBC,QAAvB,EAAd;IACAH,OAAO,CAACI,GAAR,CAAYN,eAAe,CAACO,MAAhB,CAAuBF,QAAvB,EAAZ;EACD,CAXmB,CAapB;;;EACA,MAAMG,uBAAuB,GAAGX,SAAS,CACvC,OADuC,EAEvC,CAAC,OAAD,EAAU,QAAV,EAAoB,gBAApB,EAAsC,WAAtC,CAFuC,EAGvC;IACEY,GAAG,EAAG;EADR,CAHuC,CAAzC;;EAOA,IAAID,uBAAuB,CAACP,MAAxB,IAAkCO,uBAAuB,CAACP,MAAxB,GAAiC,CAAvE,EAA0E;IACxEC,OAAO,CAACC,KAAR,CAAcK,uBAAuB,CAACJ,MAAxB,CAA+BC,QAA/B,EAAd;IACAH,OAAO,CAACI,GAAR,CAAYE,uBAAuB,CAACD,MAAxB,CAA+BF,QAA/B,EAAZ;EACD;AACF,CAzBQ,CAAT;AA2BAK,QAAQ,CAAC,kBAAD,EAAqB,MAAM;EACjCC,EAAE,CAAC,iEAAD,EAAqEC,IAAD,IAAU;IAC9E,MAAMC,SAAS,GAAGjB,KA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,MAAV,CAAiBU,EAAjB,CAAoB,KAApB,EAA2B,MAAM;MAC/B,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAP,CAAcN,MAAd,EACZX,QADY,GAEZkB,OAFY,CAEJzB,eAFI,EAEa,EAFb,CAAf;;MAGA,IAAI;QACF0B,MAAM,CAACJ,MAAD,CAAN,CAAeK,IAAf,CAAoBC,YAApB;QACAd,IAAI;MACL,CAHD,CAGE,OAAOT,KAAP,EAAc;QACdS,IAAI,CAACT,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CAnBC,CAAF;EAqBAQ,EAAE,CAAC,mGAAD,EAAuGC,IAAD,IAAU;IAChH,MAAMC,SAAS,GAAGjB,KAAK,CAAC,OAAD,EAAU,CAAC,OAAD,EAAU,MAAV,EAAkB,QAAlB,EAA4B,WAA5B,CAAV,CAAvB;IAEA,MAAMoB,MAAoB,GAAG,EAA7B;IACAH,SAAS,CAACN,MAAV,CAAiBU,EAAjB,CAAoB,MAApB,EAA6BC,KAAD,IAAW;MACrCF,MAAM,CAACG,IAAP,CAAYD,KAAZ;IACD,CAFD;IAIAL,SAAS,CAACN,MAAV,CAAiBU,EAAjB,CAAoB,KAApB,EAA2B,MAAM;MAC/B,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAP,CAAcN,MAAd,EACZX,QADY,GAEZkB,OAFY,CAEJzB,eAFI,EAEa,EAFb,CAAf;;MAGA,IAAI;QACF0B,MAAM,CAACJ,MAAD,CAAN,CAAeK,IAAf,CAAoBC,YAApB;QACAd,IAAI;MACL,CAHD,CAGE,OAAOT,KAAP,EAAc;QACdS,IAAI,CAACT,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CAnBC,CAAF;AAoBD,CAjFO,CAAR"}
@@ -1,6 +1,7 @@
1
1
  import { Command, Option } from 'commander';
2
2
  import { Authenticate, Theme, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
3
+ import * as common from '../cmd_common';
4
+ import { printMessage } from '../../utils/Console';
4
5
  const {
5
6
  getTokens
6
7
  } = Authenticate;
@@ -18,7 +19,7 @@ async (host, realm, user, password, options) => {
18
19
  state.default.session.setAllowInsecureConnection(options.insecure);
19
20
 
20
21
  if (await getTokens()) {
21
- console.log(`Listing themes in realm "${state.default.session.getRealm()}"...`);
22
+ printMessage(`Listing themes in realm "${state.default.session.getRealm()}"...`);
22
23
  listThemes(options.long);
23
24
  }
24
25
  } // end command logic inside action handler
@@ -1 +1 @@
1
- {"version":3,"file":"theme-list.js","names":["Command","Option","Authenticate","Theme","state","common","getTokens","listThemes","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","console","log","getRealm","long","parse"],"sources":["cli/theme/theme-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\nconst { listThemes } = Theme;\n\nconst program = new Command('frodo theme list');\n\nprogram\n .description('List themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\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) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n console.log(\n `Listing themes in realm \"${state.default.session.getRealm()}\"...`\n );\n listThemes(options.long);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,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CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM7B,SAAS,EAAnB,EAAuB;IACrB8B,OAAO,CAACC,GAAR,CACG,4BAA2BjC,KAAK,CAACgB,OAAN,CAAcO,OAAd,CAAsBW,QAAtB,EAAiC,MAD/D;IAGA/B,UAAU,CAACmB,OAAO,CAACa,IAAT,CAAV;EACD;AACF,CA5BL,CA6BI;AA7BJ;AAgCA/B,OAAO,CAACgC,KAAR"}
1
+ {"version":3,"file":"theme-list.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","listThemes","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","getRealm","long","parse"],"sources":["cli/theme/theme-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { listThemes } = Theme;\n\nconst program = new Command('frodo theme list');\n\nprogram\n .description('List themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\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) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(\n `Listing themes in realm \"${state.default.session.getRealm()}\"...`\n );\n listThemes(options.long);\n }\n }\n // end command logic inside action handler\n );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