@rockcarver/frodo-cli 0.23.1-8 → 0.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -1
- package/esm/app.js.map +1 -1
- package/esm/cli/FrodoCommand.js.map +1 -1
- package/esm/cli/_template/something-delete.js.map +1 -1
- package/esm/cli/_template/something-describe.js.map +1 -1
- package/esm/cli/_template/something-else-delete.js.map +1 -1
- package/esm/cli/_template/something-else-describe.js.map +1 -1
- package/esm/cli/_template/something-else-export.js.map +1 -1
- package/esm/cli/_template/something-else-import.js.map +1 -1
- package/esm/cli/_template/something-else-list.js.map +1 -1
- package/esm/cli/_template/something-else.js.map +1 -1
- package/esm/cli/_template/something-export.js.map +1 -1
- package/esm/cli/_template/something-import.js.map +1 -1
- package/esm/cli/_template/something-list.js.map +1 -1
- package/esm/cli/_template/something-other-delete.js.map +1 -1
- package/esm/cli/_template/something-other-describe.js.map +1 -1
- package/esm/cli/_template/something-other-export.js.map +1 -1
- package/esm/cli/_template/something-other-import.js.map +1 -1
- package/esm/cli/_template/something-other-list.js.map +1 -1
- package/esm/cli/_template/something-other.js.map +1 -1
- package/esm/cli/_template/something.js.map +1 -1
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-get-access-token.js.map +1 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +1 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +1 -1
- package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
- package/esm/cli/admin/admin.js.map +1 -1
- package/esm/cli/agent/agent-delete.js.map +1 -1
- package/esm/cli/agent/agent-describe.js.map +1 -1
- package/esm/cli/agent/agent-export.js.map +1 -1
- package/esm/cli/agent/agent-gateway-delete.js.map +1 -1
- package/esm/cli/agent/agent-gateway-describe.js.map +1 -1
- package/esm/cli/agent/agent-gateway-export.js.map +1 -1
- package/esm/cli/agent/agent-gateway-import.js.map +1 -1
- package/esm/cli/agent/agent-gateway-list.js.map +1 -1
- package/esm/cli/agent/agent-gateway.js.map +1 -1
- package/esm/cli/agent/agent-import.js.map +1 -1
- package/esm/cli/agent/agent-java-delete.js.map +1 -1
- package/esm/cli/agent/agent-java-describe.js.map +1 -1
- package/esm/cli/agent/agent-java-export.js.map +1 -1
- package/esm/cli/agent/agent-java-import.js.map +1 -1
- package/esm/cli/agent/agent-java-list.js.map +1 -1
- package/esm/cli/agent/agent-java.js.map +1 -1
- package/esm/cli/agent/agent-list.js.map +1 -1
- package/esm/cli/agent/agent-web-delete.js.map +1 -1
- package/esm/cli/agent/agent-web-describe.js.map +1 -1
- package/esm/cli/agent/agent-web-export.js.map +1 -1
- package/esm/cli/agent/agent-web-import.js.map +1 -1
- package/esm/cli/agent/agent-web-list.js.map +1 -1
- package/esm/cli/agent/agent-web.js.map +1 -1
- package/esm/cli/agent/agent.js.map +1 -1
- package/esm/cli/app/app-delete.js.map +1 -1
- package/esm/cli/app/app-describe.js.map +1 -1
- package/esm/cli/app/app-export.js.map +1 -1
- package/esm/cli/app/app-import.js.map +1 -1
- package/esm/cli/app/app-list.js.map +1 -1
- package/esm/cli/app/app.js.map +1 -1
- package/esm/cli/authz/authz-policy-delete.js.map +1 -1
- package/esm/cli/authz/authz-policy-describe.js.map +1 -1
- package/esm/cli/authz/authz-policy-export.js +16 -11
- package/esm/cli/authz/authz-policy-export.js.map +1 -1
- package/esm/cli/authz/authz-policy-import.js +13 -13
- package/esm/cli/authz/authz-policy-import.js.map +1 -1
- package/esm/cli/authz/authz-policy-list.js.map +1 -1
- package/esm/cli/authz/authz-policy.js.map +1 -1
- package/esm/cli/authz/authz-set-delete.js.map +1 -1
- package/esm/cli/authz/authz-set-describe.js.map +1 -1
- package/esm/cli/authz/authz-set-export.js +7 -4
- package/esm/cli/authz/authz-set-export.js.map +1 -1
- package/esm/cli/authz/authz-set-import.js +9 -5
- package/esm/cli/authz/authz-set-import.js.map +1 -1
- package/esm/cli/authz/authz-set-list.js.map +1 -1
- package/esm/cli/authz/authz-set.js.map +1 -1
- package/esm/cli/authz/authz-type-delete.js.map +1 -1
- package/esm/cli/authz/authz-type-describe.js.map +1 -1
- package/esm/cli/authz/authz-type-export.js.map +1 -1
- package/esm/cli/authz/authz-type-import.js.map +1 -1
- package/esm/cli/authz/authz-type-list.js.map +1 -1
- package/esm/cli/authz/authz-type.js.map +1 -1
- package/esm/cli/authz/authz.js.map +1 -1
- package/esm/cli/conn/conn-delete.js.map +1 -1
- package/esm/cli/conn/conn-describe.js.map +1 -1
- package/esm/cli/conn/conn-list.js.map +1 -1
- package/esm/cli/conn/conn-save.js.map +1 -1
- package/esm/cli/conn/conn.js.map +1 -1
- package/esm/cli/email/email-template-export.js.map +1 -1
- package/esm/cli/email/email-template-import.js.map +1 -1
- package/esm/cli/email/email-template-list.js.map +1 -1
- package/esm/cli/email/email-template.js.map +1 -1
- package/esm/cli/email/email.js.map +1 -1
- package/esm/cli/esv/esv-apply.js.map +1 -1
- package/esm/cli/esv/esv-secret-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-describe.js.map +1 -1
- package/esm/cli/esv/esv-secret-export.js.map +1 -1
- package/esm/cli/esv/esv-secret-import.js.map +1 -1
- package/esm/cli/esv/esv-secret-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-set.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-version.js.map +1 -1
- package/esm/cli/esv/esv-secret.js.map +1 -1
- package/esm/cli/esv/esv-variable-create.js.map +1 -1
- package/esm/cli/esv/esv-variable-delete.js.map +1 -1
- package/esm/cli/esv/esv-variable-describe.js.map +1 -1
- package/esm/cli/esv/esv-variable-export.js.map +1 -1
- package/esm/cli/esv/esv-variable-import.js.map +1 -1
- package/esm/cli/esv/esv-variable-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-set.js.map +1 -1
- package/esm/cli/esv/esv-variable.js.map +1 -1
- package/esm/cli/esv/esv.js.map +1 -1
- package/esm/cli/idm/idm-count.js.map +1 -1
- package/esm/cli/idm/idm-export.js.map +1 -1
- package/esm/cli/idm/idm-import.js.map +1 -1
- package/esm/cli/idm/idm-list.js.map +1 -1
- package/esm/cli/idm/idm.js.map +1 -1
- package/esm/cli/idp/idp-export.js.map +1 -1
- package/esm/cli/idp/idp-import.js.map +1 -1
- package/esm/cli/idp/idp-list.js.map +1 -1
- package/esm/cli/idp/idp.js.map +1 -1
- package/esm/cli/info/info.js.map +1 -1
- package/esm/cli/journey/journey-delete.js.map +1 -1
- package/esm/cli/journey/journey-describe.js.map +1 -1
- package/esm/cli/journey/journey-disable.js.map +1 -1
- package/esm/cli/journey/journey-enable.js.map +1 -1
- package/esm/cli/journey/journey-export.js.map +1 -1
- package/esm/cli/journey/journey-import.js.map +1 -1
- package/esm/cli/journey/journey-list.js.map +1 -1
- package/esm/cli/journey/journey-prune.js.map +1 -1
- package/esm/cli/journey/journey.js.map +1 -1
- package/esm/cli/logging/logs-fetch.js.map +1 -1
- package/esm/cli/logging/logs-list.js.map +1 -1
- package/esm/cli/logging/logs-tail.js.map +1 -1
- package/esm/cli/logging/logs.js.map +1 -1
- package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
- package/esm/cli/realm/realm-describe.js.map +1 -1
- package/esm/cli/realm/realm-list.js.map +1 -1
- package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
- package/esm/cli/realm/realm.js.map +1 -1
- package/esm/cli/saml/saml-cot-export.js.map +1 -1
- package/esm/cli/saml/saml-cot-import.js.map +1 -1
- package/esm/cli/saml/saml-cot-list.js.map +1 -1
- package/esm/cli/saml/saml-cot.js.map +1 -1
- package/esm/cli/saml/saml-delete.js.map +1 -1
- package/esm/cli/saml/saml-describe.js.map +1 -1
- package/esm/cli/saml/saml-export.js.map +1 -1
- package/esm/cli/saml/saml-import.js.map +1 -1
- package/esm/cli/saml/saml-list.js.map +1 -1
- package/esm/cli/saml/saml-metadata-export.js.map +1 -1
- package/esm/cli/saml/saml-metadata.js.map +1 -1
- package/esm/cli/saml/saml.js.map +1 -1
- package/esm/cli/script/script-delete.js.map +1 -1
- package/esm/cli/script/script-describe.js.map +1 -1
- package/esm/cli/script/script-export.js.map +1 -1
- package/esm/cli/script/script-import.js.map +1 -1
- package/esm/cli/script/script-list.js.map +1 -1
- package/esm/cli/script/script.js.map +1 -1
- package/esm/cli/service/service-delete.js.map +1 -1
- package/esm/cli/service/service-export.js.map +1 -1
- package/esm/cli/service/service-import.js.map +1 -1
- package/esm/cli/service/service-list.js.map +1 -1
- package/esm/cli/service/service.js.map +1 -1
- package/esm/cli/theme/theme-delete.e2e.test_.js.map +1 -1
- package/esm/cli/theme/theme-delete.js.map +1 -1
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/cli/theme/theme-import.js.map +1 -1
- package/esm/cli/theme/theme-list.e2e.test_.js.map +1 -1
- package/esm/cli/theme/theme-list.js.map +1 -1
- package/esm/cli/theme/theme.js.map +1 -1
- package/esm/loader.js.map +1 -1
- package/esm/ops/AgentOps.js.map +1 -1
- package/esm/ops/CirclesOfTrustOps.js.map +1 -1
- package/esm/ops/ConnectionProfileOps.js.map +1 -1
- package/esm/ops/EmailTemplateOps.js.map +1 -1
- package/esm/ops/IdmOps.js.map +1 -1
- package/esm/ops/IdpOps.js.map +1 -1
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/NodeOps.js.map +1 -1
- package/esm/ops/OAuth2ClientOps.js.map +1 -1
- package/esm/ops/PolicyOps.js +26 -17
- package/esm/ops/PolicyOps.js.map +1 -1
- package/esm/ops/PolicySetOps.js +17 -10
- package/esm/ops/PolicySetOps.js.map +1 -1
- package/esm/ops/ResourceTypeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/Saml2Ops.test_.js.map +1 -1
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/ops/ServiceOps.js.map +1 -1
- package/esm/ops/ThemeOps.js.map +1 -1
- package/esm/ops/utils/OpsUtils.js.map +1 -1
- package/esm/ops/utils/Wordwrap.js.map +1 -1
- package/esm/utils/Config.js.map +1 -1
- package/esm/utils/Console.js.map +1 -1
- package/esm/utils/ExportImportUtils.js.map +1 -1
- package/esm/utils/Version.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idp-export.js","names":["FrodoCommand","Option","Authenticate","state","printMessage","verboseMessage","exportSocialProvidersToFile","exportSocialProvidersToFiles","exportSocialProviderToFile","getTokens","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/idp/idp-export.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n exportSocialProvidersToFile,\n exportSocialProvidersToFiles,\n exportSocialProviderToFile,\n} from '../../ops/IdpOps';\n\nconst { getTokens } = Authenticate;\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 exportSocialProviderToFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n exportSocialProvidersToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n exportSocialProvidersToFiles();\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,0BAA0B,QACrB,kBAAkB;AAEzB,MAAM;EAAEC;AAAU,CAAC,GAAGP,YAAY;AAElC,MAAMQ,OAAO,GAAG,IAAIV,YAAY,CAAC,kBAAkB,CAAC;AAEpDU,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,CAClDC,SAAS,CACR,IAAIX,MAAM,CACR,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"idp-export.js","names":["FrodoCommand","Option","Authenticate","state","printMessage","verboseMessage","exportSocialProvidersToFile","exportSocialProvidersToFiles","exportSocialProviderToFile","getTokens","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/idp/idp-export.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n exportSocialProvidersToFile,\n exportSocialProvidersToFiles,\n exportSocialProviderToFile,\n} from '../../ops/IdpOps';\n\nconst { getTokens } = Authenticate;\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 exportSocialProviderToFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n exportSocialProvidersToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n exportSocialProvidersToFiles();\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,0BAA0B,QACrB,kBAAkB;AAEzB,MAAM;EAAEC;AAAU,CAAC,GAAGP,YAAY;AAElC,MAAMQ,OAAO,GAAG,IAAIV,YAAY,CAAC,kBAAkB,CAAC;AAEpDU,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,MAAMV,SAAS,CAAC,CAAC,EAAE;IACrB;IACA,IAAIS,OAAO,CAACG,KAAK,EAAE;MACjBhB,cAAc,CACX,uBACCa,OAAO,CAACG,KACT,iBAAgBlB,KAAK,CAACmB,QAAQ,CAAC,CAAE,MACpC,CAAC;MACDd,0BAA0B,CAACU,OAAO,CAACG,KAAK,EAAEH,OAAO,CAACK,IAAI,CAAC;IACzD;IACA;IAAA,KACK,IAAIL,OAAO,CAACM,GAAG,EAAE;MACpBnB,cAAc,CAAC,6CAA6C,CAAC;MAC7DC,2BAA2B,CAACY,OAAO,CAACK,IAAI,CAAC;IAC3C;IACA;IAAA,KACK,IAAIL,OAAO,CAACO,WAAW,EAAE;MAC5BpB,cAAc,CAAC,8CAA8C,CAAC;MAC9DE,4BAA4B,CAAC,CAAC;IAChC;IACA;IAAA,KACK;MACHH,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;MACDM,OAAO,CAACgB,IAAI,CAAC,CAAC;MACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idp-import.js","names":["FrodoCommand","Option","Authenticate","state","printMessage","verboseMessage","importFirstSocialProviderFromFile","importSocialProviderFromFile","importSocialProvidersFromFile","importSocialProvidersFromFiles","getTokens","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/idp/idp-import.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n importFirstSocialProviderFromFile,\n importSocialProviderFromFile,\n importSocialProvidersFromFile,\n importSocialProvidersFromFiles,\n} from '../../ops/IdpOps';\n\nconst { getTokens } = Authenticate;\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 importSocialProviderFromFile(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 importSocialProvidersFromFile(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 importSocialProvidersFromFiles();\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 importFirstSocialProviderFromFile(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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SACEC,iCAAiC,EACjCC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,8BAA8B,QACzB,kBAAkB;AAEzB,MAAM;EAAEC;AAAU,CAAC,GAAGR,YAAY;AAElC,MAAMS,OAAO,GAAG,IAAIX,YAAY,CAAC,kBAAkB,CAAC;AAEpDW,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,CAClDC,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"idp-import.js","names":["FrodoCommand","Option","Authenticate","state","printMessage","verboseMessage","importFirstSocialProviderFromFile","importSocialProviderFromFile","importSocialProvidersFromFile","importSocialProvidersFromFiles","getTokens","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/idp/idp-import.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n importFirstSocialProviderFromFile,\n importSocialProviderFromFile,\n importSocialProvidersFromFile,\n importSocialProvidersFromFiles,\n} from '../../ops/IdpOps';\n\nconst { getTokens } = Authenticate;\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 importSocialProviderFromFile(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 importSocialProvidersFromFile(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 importSocialProvidersFromFiles();\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 importFirstSocialProviderFromFile(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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SACEC,iCAAiC,EACjCC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,8BAA8B,QACzB,kBAAkB;AAEzB,MAAM;EAAEC;AAAU,CAAC,GAAGR,YAAY;AAElC,MAAMS,OAAO,GAAG,IAAIX,YAAY,CAAC,kBAAkB,CAAC;AAEpDW,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,CAClDC,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,mDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,kDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,WAAW,EACX,mEACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,oBAAoB,EACpB,8GACF,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,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,IAAI,IAAIH,OAAO,CAACI,KAAK,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IACxDL,cAAc,CACX,uBACCc,OAAO,CAACI,KACT,iBAAgBpB,KAAK,CAACqB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACDjB,4BAA4B,CAACY,OAAO,CAACI,KAAK,EAAEJ,OAAO,CAACG,IAAI,CAAC;EAC3D;EACA;EAAA,KACK,IAAIH,OAAO,CAACM,GAAG,IAAIN,OAAO,CAACG,IAAI,KAAK,MAAMZ,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3DL,cAAc,CACX,+CAA8Cc,OAAO,CAACG,IAAK,MAC9D,CAAC;IACDd,6BAA6B,CAACW,OAAO,CAACG,IAAI,CAAC;EAC7C;EACA;EAAA,KACK,IAAIH,OAAO,CAACO,WAAW,IAAI,CAACP,OAAO,CAACG,IAAI,KAAK,MAAMZ,SAAS,CAAC,CAAC,CAAC,EAAE;IACpEL,cAAc,CACZ,qEACF,CAAC;IACDI,8BAA8B,CAAC,CAAC;EAClC;EACA;EAAA,KACK,IAAIU,OAAO,CAACG,IAAI,KAAK,MAAMZ,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CL,cAAc,CACX,uCACCc,OAAO,CAACG,IACT,iBAAgBnB,KAAK,CAACqB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACDlB,iCAAiC,CAACa,OAAO,CAACG,IAAI,CAAC;EACjD;EACA;EAAA,KACK;IACHlB,YAAY,CAAC,sDAAsD,CAAC;IACpEO,OAAO,CAACgB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idp-list.js","names":["FrodoCommand","Authenticate","state","verboseMessage","listSocialProviders","getTokens","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","process","exitCode","parse"],"sources":["cli/idp/idp-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\nimport { listSocialProviders } from '../../ops/IdpOps';\n\nconst { getTokens } = Authenticate;\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,MAAM;EAAEC;AAAU,CAAC,GAAGJ,YAAY;AAElC,MAAMK,OAAO,GAAG,IAAIN,YAAY,CAAC,gBAAgB,CAAC;AAElDM,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,
|
|
1
|
+
{"version":3,"file":"idp-list.js","names":["FrodoCommand","Authenticate","state","verboseMessage","listSocialProviders","getTokens","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","process","exitCode","parse"],"sources":["cli/idp/idp-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\nimport { listSocialProviders } from '../../ops/IdpOps';\n\nconst { getTokens } = Authenticate;\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,MAAM;EAAEC;AAAU,CAAC,GAAGJ,YAAY;AAElC,MAAMK,OAAO,GAAG,IAAIN,YAAY,CAAC,gBAAgB,CAAC;AAElDM,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,MAAMT,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,+BAA8BD,KAAK,CAACc,QAAQ,CAAC,CAAE,MAAK,CAAC;IACrEZ,mBAAmB,CAAC,CAAC;EACvB,CAAC,MAAM;IACLa,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
|
package/esm/cli/idp/idp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idp.js","names":["FrodoStubCommand","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["cli/idp/idp.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('idp')\n .description('Manage (social) identity providers.')\n .executableDir(__dirname);\n\n program.command('list', 'List identity providers.');\n\n program.command('export', 'Export identity providers.');\n\n program.command('import', 'Import identity providers.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,
|
|
1
|
+
{"version":3,"file":"idp.js","names":["FrodoStubCommand","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["cli/idp/idp.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('idp')\n .description('Manage (social) identity providers.')\n .executableDir(__dirname);\n\n program.command('list', 'List identity providers.');\n\n program.command('export', 'Export identity providers.');\n\n program.command('import', 'Import identity providers.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIT,gBAAgB,CAAC,KAAK,CAAC,CACxCU,WAAW,CAAC,qCAAqC,CAAC,CAClDC,aAAa,CAACR,SAAS,CAAC;EAE3BM,OAAO,CAACG,OAAO,CAAC,MAAM,EAAE,0BAA0B,CAAC;EAEnDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;EAEvDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;EAEvD,OAAOH,OAAO;AAChB"}
|
package/esm/cli/info/info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","names":["FrodoCommand","Option","Authenticate","Info","state","createObjectTable","printMessage","verboseMessage","getTokens","getInfo","setup","info","description","addOption","default","action","host","user","password","options","command","handleDefaultArgsAndOpts","scriptFriendly","sessionToken","bearerToken","labels","amVersion","authenticatedSubject","config_promotion_done","cookieName","deploymentType","immutable","locked","placeholder_management","region","tier","table","toString","getCookieValue","getBearerToken","JSON","stringify","process","exitCode","showHelpAfterError"],"sources":["cli/info/info.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Info, state } from '@rockcarver/frodo-lib';\nimport {\n createObjectTable,\n printMessage,\n verboseMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { getInfo } = Info;\n\nexport default function setup() {\n const info = new FrodoCommand('info', ['realm']);\n info\n .description('Print versions and tokens.')\n .addOption(\n new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other commands. User messages/warnings are output to STDERR, and are not piped. For example, to only get bearer token: \\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n ).default(false, 'Output as plain text')\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n if (await getTokens()) {\n const info = await getInfo();\n if (!options.scriptFriendly) {\n verboseMessage('Printing info, versions, and tokens...');\n delete info.sessionToken;\n delete info.bearerToken;\n const labels = {\n amVersion: 'AM Version',\n authenticatedSubject: 'Subject (Type)',\n config_promotion_done: 'Promotion Done',\n cookieName: 'Cookie Name',\n deploymentType: 'Deployment Type',\n host: 'Host URL',\n immutable: 'Immutable',\n locked: 'Locked',\n placeholder_management: 'Placeholder Management',\n region: 'Region',\n tier: 'Tier',\n };\n const table = createObjectTable(info, labels);\n printMessage(`\\n${table.toString()}`);\n if (state.getCookieValue()) {\n printMessage(`\\nSession token:`, 'info');\n printMessage(`${state.getCookieValue()}`);\n }\n if (state.getBearerToken()) {\n printMessage(`\\nBearer token:`, 'info');\n printMessage(`${state.getBearerToken()}`);\n }\n } else {\n printMessage(JSON.stringify(info, null, 2), 'data');\n }\n } else {\n process.exitCode = 1;\n }\n });\n info.showHelpAfterError();\n return info;\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,IAAI,EAAEC,KAAK,QAAQ,uBAAuB;AACjE,SACEC,iBAAiB,EACjBC,YAAY,EACZC,cAAc,QACT,qBAAqB;AAE5B,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAQ,CAAC,GAAGN,IAAI;AAExB,eAAe,SAASO,
|
|
1
|
+
{"version":3,"file":"info.js","names":["FrodoCommand","Option","Authenticate","Info","state","createObjectTable","printMessage","verboseMessage","getTokens","getInfo","setup","info","description","addOption","default","action","host","user","password","options","command","handleDefaultArgsAndOpts","scriptFriendly","sessionToken","bearerToken","labels","amVersion","authenticatedSubject","config_promotion_done","cookieName","deploymentType","immutable","locked","placeholder_management","region","tier","table","toString","getCookieValue","getBearerToken","JSON","stringify","process","exitCode","showHelpAfterError"],"sources":["cli/info/info.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Info, state } from '@rockcarver/frodo-lib';\nimport {\n createObjectTable,\n printMessage,\n verboseMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { getInfo } = Info;\n\nexport default function setup() {\n const info = new FrodoCommand('info', ['realm']);\n info\n .description('Print versions and tokens.')\n .addOption(\n new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other commands. User messages/warnings are output to STDERR, and are not piped. For example, to only get bearer token: \\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n ).default(false, 'Output as plain text')\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n if (await getTokens()) {\n const info = await getInfo();\n if (!options.scriptFriendly) {\n verboseMessage('Printing info, versions, and tokens...');\n delete info.sessionToken;\n delete info.bearerToken;\n const labels = {\n amVersion: 'AM Version',\n authenticatedSubject: 'Subject (Type)',\n config_promotion_done: 'Promotion Done',\n cookieName: 'Cookie Name',\n deploymentType: 'Deployment Type',\n host: 'Host URL',\n immutable: 'Immutable',\n locked: 'Locked',\n placeholder_management: 'Placeholder Management',\n region: 'Region',\n tier: 'Tier',\n };\n const table = createObjectTable(info, labels);\n printMessage(`\\n${table.toString()}`);\n if (state.getCookieValue()) {\n printMessage(`\\nSession token:`, 'info');\n printMessage(`${state.getCookieValue()}`);\n }\n if (state.getBearerToken()) {\n printMessage(`\\nBearer token:`, 'info');\n printMessage(`${state.getBearerToken()}`);\n }\n } else {\n printMessage(JSON.stringify(info, null, 2), 'data');\n }\n } else {\n process.exitCode = 1;\n }\n });\n info.showHelpAfterError();\n return info;\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC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Q;UAChBC,IAAI,EAAE;QACR,CAAC;QACD,MAAMC,KAAK,GAAG/B,iBAAiB,CAACM,IAAI,EAAEc,MAAM,CAAC;QAC7CnB,YAAY,CAAE,KAAI8B,KAAK,CAACC,QAAQ,CAAC,CAAE,EAAC,CAAC;QACrC,IAAIjC,KAAK,CAACkC,cAAc,CAAC,CAAC,EAAE;UAC1BhC,YAAY,CAAE,kBAAiB,EAAE,MAAM,CAAC;UACxCA,YAAY,CAAE,GAAEF,KAAK,CAACkC,cAAc,CAAC,CAAE,EAAC,CAAC;QAC3C;QACA,IAAIlC,KAAK,CAACmC,cAAc,CAAC,CAAC,EAAE;UAC1BjC,YAAY,CAAE,iBAAgB,EAAE,MAAM,CAAC;UACvCA,YAAY,CAAE,GAAEF,KAAK,CAACmC,cAAc,CAAC,CAAE,EAAC,CAAC;QAC3C;MACF,CAAC,MAAM;QACLjC,YAAY,CAACkC,IAAI,CAACC,SAAS,CAAC9B,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;MACrD;IACF,CAAC,MAAM;MACL+B,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF,CAAC,CAAC;EACJhC,IAAI,CAACiC,kBAAkB,CAAC,CAAC;EACzB,OAAOjC,IAAI;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-delete.js","names":["FrodoCommand","Option","Authenticate","Journey","state","printMessage","verboseMessage","getTokens","deleteJourney","deleteJourneys","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","getRealm","all","help","process","exitCode","parse"],"sources":["cli/journey/journey-delete.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { deleteJourney, deleteJourneys } = 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 deleteJourney(options.journeyId, options);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all journeys...');\n 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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,EAAEC,KAAK,QAAQ,uBAAuB;AACpE,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAElE,MAAM;EAAEC;AAAU,CAAC,GAAGL,YAAY;AAClC,MAAM;EAAEM,aAAa;EAAEC;AAAe,CAAC,GAAGN,OAAO;AAEjD,MAAMO,OAAO,GAAG,IAAIV,YAAY,CAAC,sBAAsB,CAAC;AAExDU,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIX,MAAM,CACR,4BAA4B,EAC5B,
|
|
1
|
+
{"version":3,"file":"journey-delete.js","names":["FrodoCommand","Option","Authenticate","Journey","state","printMessage","verboseMessage","getTokens","deleteJourney","deleteJourneys","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","getRealm","all","help","process","exitCode","parse"],"sources":["cli/journey/journey-delete.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { deleteJourney, deleteJourneys } = 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 deleteJourney(options.journeyId, options);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all journeys...');\n 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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,EAAEC,KAAK,QAAQ,uBAAu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AAO,CAACe,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHjB,OAAO,CAACkB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-describe.js","names":["fs","FrodoCommand","Option","Authenticate","Journey","state","describeJourney","describeJourneyMd","printMessage","verboseMessage","saveTextToFile","getTokens","getJourneys","exportJourney","createFileParamTreeExportResolver","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outputFile","setOutputFile","file","process","exitCode","overrideVersion","setAmVersion","fileData","JSON","parse","readFileSync","journeyData","journeyId","trees","Object","values","tree","_id","Error","markdown","error","message","getRealm","journeys","journey","treeData"],"sources":["cli/journey/journey-describe.ts"],"sourcesContent":["import fs from 'fs';\nimport { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport { describeJourney, describeJourneyMd } from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { saveTextToFile } from '../../utils/ExportImportUtils';\n\nconst { getTokens } = Authenticate;\nconst { getJourneys, exportJourney, createFileParamTreeExportResolver } =\n Journey;\n\nconst program = new FrodoCommand('frodo journey describe');\n\nprogram\n .description(\n 'If -h is supplied, describe the journey/tree indicated by -i, or all journeys/trees in the realm if no -i is supplied, otherwise describe the journey/tree export file indicated by -f.'\n )\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the journey export file to describe. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-F, --output-file <file>',\n 'Name of the file to write the output to.'\n )\n )\n .addOption(new Option('--markdown', 'Output in markdown.'))\n .addOption(\n new Option(\n '-o, --override-version <version>',\n \"Override version. Notation: '<major>.<minor>.<patch>' e.g. '7.2.0'. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.\"\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 (options.outputFile) state.setOutputFile(options.outputFile);\n // TODO: review checks for arguments\n if (typeof host === 'undefined' || typeof options.file !== 'undefined') {\n if (\n typeof host === 'undefined' &&\n typeof options.file === 'undefined'\n ) {\n printMessage('Need either [host] or -f.', 'error');\n process.exitCode = 1;\n return;\n }\n verboseMessage(`Describing local journey file ${options.file}...`);\n try {\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.setAmVersion(options.overrideVersion);\n }\n const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));\n let journeyData;\n // single or multi tree export?\n // multi - by id\n if (\n typeof options.journeyId !== 'undefined' &&\n fileData.trees &&\n fileData.trees[options.journeyId]\n ) {\n journeyData = fileData.trees[options.journeyId];\n }\n // multi - first\n else if (typeof options.journeyId === 'undefined' && fileData.trees) {\n [journeyData] = Object.values(fileData.trees);\n }\n // single - by id\n else if (\n typeof options.journeyId !== 'undefined' &&\n options.journeyId === fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // single\n else if (\n typeof options.journeyId === 'undefined' &&\n fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // no journey/tree found\n else {\n throw new Error(\n typeof options.journeyId === 'undefined'\n ? `No journey found in ${options.file}`\n : `Journey '${options.journeyId}' not found in ${options.file}`\n );\n }\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n } else if (await getTokens()) {\n verboseMessage(\n `Describing journey(s) in realm \"${state.getRealm()}\"...`\n );\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.setAmVersion(options.overrideVersion);\n }\n if (typeof options.journeyId === 'undefined') {\n let journeys = [];\n journeys = await getJourneys();\n for (const journey of journeys) {\n try {\n // eslint-disable-next-line no-await-in-loop, dot-notation\n const treeData = await exportJourney(journey['_id']);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n } else {\n try {\n const treeData = await exportJourney(options.journeyId);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,EAAEC,KAAK,QAAQ,uBAAuB;AACpE,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,sBAAsB;AACzE,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,cAAc,QAAQ,+BAA+B;AAE9D,MAAM;EAAEC;AAAU,CAAC,GAAGR,YAAY;AAClC,MAAM;EAAES,WAAW;EAAEC,aAAa;EAAEC;AAAkC,CAAC,GACrEV,OAAO;AAET,MAAMW,OAAO,GAAG,IAAId,YAAY,CAAC,wBAAwB,CAAC;AAE1Dc,OAAO,CACJC,WAAW,CACV,yLAAyL,CAC1L,CACAC,SAAS,CACR,IAAIf,MAAM,CACR,4BAA4B,EAC5B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MAAMvC,eAAe,CAAC6C,QAAQ,CAAC;QACjC;QACA;QAAA,KACK;UACH;UACA,IAAI5B,OAAO,CAACG,UAAU,EAAEhB,cAAc,CAAC,EAAE,EAAEa,OAAO,CAACG,UAAU,CAAC;UAC9D,MAAMnB,iBAAiB,CAAC4C,QAAQ,CAAC;QACnC;MACF,CAAC,CAAC,OAAOL,KAAK,EAAE;QACdtC,YAAY,CAACsC,KAAK,CAACC,OAAO,EAAE,OAAO,CAAC;QACpClB,OAAO,CAACC,QAAQ,GAAG,CAAC;MACtB;IACF;EACF;AACF;AACA;AAAA,CACD;;AAEHf,OAAO,CAACoB,KAAK,EAAE"}
|
|
1
|
+
{"version":3,"file":"journey-describe.js","names":["fs","FrodoCommand","Option","Authenticate","Journey","state","describeJourney","describeJourneyMd","printMessage","verboseMessage","saveTextToFile","getTokens","getJourneys","exportJourney","createFileParamTreeExportResolver","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outputFile","setOutputFile","file","process","exitCode","_fileData$tree","_fileData$tree2","overrideVersion","setAmVersion","fileData","JSON","parse","readFileSync","journeyData","journeyId","trees","Object","values","tree","_id","Error","markdown","error","message","getRealm","journeys","journey","treeData"],"sources":["cli/journey/journey-describe.ts"],"sourcesContent":["import fs from 'fs';\nimport { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport { describeJourney, describeJourneyMd } from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { saveTextToFile } from '../../utils/ExportImportUtils';\n\nconst { getTokens } = Authenticate;\nconst { getJourneys, exportJourney, createFileParamTreeExportResolver } =\n Journey;\n\nconst program = new FrodoCommand('frodo journey describe');\n\nprogram\n .description(\n 'If -h is supplied, describe the journey/tree indicated by -i, or all journeys/trees in the realm if no -i is supplied, otherwise describe the journey/tree export file indicated by -f.'\n )\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the journey export file to describe. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-F, --output-file <file>',\n 'Name of the file to write the output to.'\n )\n )\n .addOption(new Option('--markdown', 'Output in markdown.'))\n .addOption(\n new Option(\n '-o, --override-version <version>',\n \"Override version. Notation: '<major>.<minor>.<patch>' e.g. '7.2.0'. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.\"\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 (options.outputFile) state.setOutputFile(options.outputFile);\n // TODO: review checks for arguments\n if (typeof host === 'undefined' || typeof options.file !== 'undefined') {\n if (\n typeof host === 'undefined' &&\n typeof options.file === 'undefined'\n ) {\n printMessage('Need either [host] or -f.', 'error');\n process.exitCode = 1;\n return;\n }\n verboseMessage(`Describing local journey file ${options.file}...`);\n try {\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.setAmVersion(options.overrideVersion);\n }\n const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));\n let journeyData;\n // single or multi tree export?\n // multi - by id\n if (\n typeof options.journeyId !== 'undefined' &&\n fileData.trees &&\n fileData.trees[options.journeyId]\n ) {\n journeyData = fileData.trees[options.journeyId];\n }\n // multi - first\n else if (typeof options.journeyId === 'undefined' && fileData.trees) {\n [journeyData] = Object.values(fileData.trees);\n }\n // single - by id\n else if (\n typeof options.journeyId !== 'undefined' &&\n options.journeyId === fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // single\n else if (\n typeof options.journeyId === 'undefined' &&\n fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // no journey/tree found\n else {\n throw new Error(\n typeof options.journeyId === 'undefined'\n ? `No journey found in ${options.file}`\n : `Journey '${options.journeyId}' not found in ${options.file}`\n );\n }\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n } else if (await getTokens()) {\n verboseMessage(\n `Describing journey(s) in realm \"${state.getRealm()}\"...`\n );\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.setAmVersion(options.overrideVersion);\n }\n if (typeof options.journeyId === 'undefined') {\n let journeys = [];\n journeys = await getJourneys();\n for (const journey of journeys) {\n try {\n // eslint-disable-next-line no-await-in-loop, dot-notation\n const treeData = await exportJourney(journey['_id']);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n } else {\n try {\n const treeData = await exportJourney(options.journeyId);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,EAAEC,KAAK,QAAQ,uBAAuB;AACpE,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,sBAAsB;AACzE,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,cAAc,QAAQ,+BAA+B;A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a,OAAO,CAACG,UAAU,CAAC;YAC9D,MAAMnB,iBAAiB,CAAC8C,QAAQ,CAAC;UACnC;QACF,CAAC,CAAC,OAAOL,KAAK,EAAE;UACdxC,YAAY,CAACwC,KAAK,CAACC,OAAO,EAAE,OAAO,CAAC;UACpCpB,OAAO,CAACC,QAAQ,GAAG,CAAC;QACtB;MACF;IACF,CAAC,MAAM;MACL,IAAI;QACF,MAAMuB,QAAQ,GAAG,MAAMxC,aAAa,CAACU,OAAO,CAACiB,SAAS,CAAC;QACvD;QACA,IAAI,CAACjB,OAAO,CAACwB,QAAQ,EAAE;UACrB,MAAMzC,eAAe,CAAC+C,QAAQ,CAAC;QACjC;QACA;QAAA,KACK;UACH;UACA,IAAI9B,OAAO,CAACG,UAAU,EAAEhB,cAAc,CAAC,EAAE,EAAEa,OAAO,CAACG,UAAU,CAAC;UAC9D,MAAMnB,iBAAiB,CAAC8C,QAAQ,CAAC;QACnC;MACF,CAAC,CAAC,OAAOL,KAAK,EAAE;QACdxC,YAAY,CAACwC,KAAK,CAACC,OAAO,EAAE,OAAO,CAAC;QACpCpB,OAAO,CAACC,QAAQ,GAAG,CAAC;MACtB;IACF;EACF;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACsB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-disable.js","names":["FrodoCommand","Option","Authenticate","Journey","showSpinner","failSpinner","succeedSpinner","printMessage","getTokens","disableJourney","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","help","process","exitCode","parse"],"sources":["cli/journey/journey-disable.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey } from '@rockcarver/frodo-lib';\nimport {\n showSpinner,\n failSpinner,\n succeedSpinner,\n printMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { disableJourney } = Journey;\n\nconst program = new FrodoCommand('frodo journey disable');\n\nprogram\n .description('Disable journeys/trees.')\n .addOption(\n new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')\n )\n // .addOption(\n // new Option(\n // '-a, --all',\n // 'Disable all the journeys/trees in a realm. Ignored with -i.'\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 // disable\n if (options.journeyId && (await getTokens())) {\n showSpinner(`Disabling journey ${options.journeyId}...`);\n if (await disableJourney(options.journeyId)) {\n succeedSpinner(`Disabled journey ${options.journeyId}.`);\n } else {\n failSpinner(`Disabling journey ${options.journeyId} failed.`);\n }\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,QAAQ,uBAAuB;AAC7D,SACEC,WAAW,EACXC,WAAW,EACXC,cAAc,EACdC,YAAY,QACP,qBAAqB;AAE5B,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAe,CAAC,GAAGN,OAAO;AAElC,MAAMO,OAAO,GAAG,IAAIV,YAAY,CAAC,uBAAuB,CAAC;AAEzDU,OAAO,CACJC,WAAW,CAAC,yBAAyB,CAAC,CACtCC,SAAS,CACR,IAAIX,MAAM,CAAC,4BAA4B,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"journey-disable.js","names":["FrodoCommand","Option","Authenticate","Journey","showSpinner","failSpinner","succeedSpinner","printMessage","getTokens","disableJourney","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","help","process","exitCode","parse"],"sources":["cli/journey/journey-disable.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey } from '@rockcarver/frodo-lib';\nimport {\n showSpinner,\n failSpinner,\n succeedSpinner,\n printMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { disableJourney } = Journey;\n\nconst program = new FrodoCommand('frodo journey disable');\n\nprogram\n .description('Disable journeys/trees.')\n .addOption(\n new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')\n )\n // .addOption(\n // new Option(\n // '-a, --all',\n // 'Disable all the journeys/trees in a realm. Ignored with -i.'\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 // disable\n if (options.journeyId && (await getTokens())) {\n showSpinner(`Disabling journey ${options.journeyId}...`);\n if (await disableJourney(options.journeyId)) {\n succeedSpinner(`Disabled journey ${options.journeyId}.`);\n } else {\n failSpinner(`Disabling journey ${options.journeyId} failed.`);\n }\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,QAAQ,uBAAuB;AAC7D,SACEC,WAAW,EACXC,WAAW,EACXC,cAAc,EACdC,YAAY,QACP,qBAAqB;AAE5B,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAe,CAAC,GAAGN,OAAO;AAElC,MAAMO,OAAO,GAAG,IAAIV,YAAY,CAAC,uBAAuB,CAAC;AAEzDU,OAAO,CACJC,WAAW,CAAC,yBAAyB,CAAC,CACtCC,SAAS,CACR,IAAIX,MAAM,CAAC,4BAA4B,EAAE,yBAAyB,CACpE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,CACCY,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,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CJ,WAAW,CAAE,qBAAoBc,OAAO,CAACG,SAAU,KAAI,CAAC;IACxD,IAAI,MAAMZ,cAAc,CAACS,OAAO,CAACG,SAAS,CAAC,EAAE;MAC3Cf,cAAc,CAAE,oBAAmBY,OAAO,CAACG,SAAU,GAAE,CAAC;IAC1D,CAAC,MAAM;MACLhB,WAAW,CAAE,qBAAoBa,OAAO,CAACG,SAAU,UAAS,CAAC;IAC/D;EACF;EACA;EAAA,KACK;IACHd,YAAY,CAAC,sDAAsD,CAAC;IACpEG,OAAO,CAACY,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-enable.js","names":["FrodoCommand","Option","Authenticate","Journey","showSpinner","failSpinner","succeedSpinner","printMessage","getTokens","enableJourney","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","help","process","exitCode","parse"],"sources":["cli/journey/journey-enable.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey } from '@rockcarver/frodo-lib';\nimport {\n showSpinner,\n failSpinner,\n succeedSpinner,\n printMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { enableJourney } = Journey;\n\nconst program = new FrodoCommand('frodo journey enable');\n\nprogram\n .description('Enable journeys/trees.')\n .addOption(\n new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')\n )\n // .addOption(\n // new Option(\n // '-a, --all',\n // 'Enable all the journeys/trees in a realm. Ignored with -i.'\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 // enable\n if (options.journeyId && (await getTokens())) {\n showSpinner(`Enabling journey ${options.journeyId}...`);\n if (await enableJourney(options.journeyId)) {\n succeedSpinner(`Enabled journey ${options.journeyId}.`);\n } else {\n failSpinner(`Enabling journey ${options.journeyId} failed.`);\n }\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,QAAQ,uBAAuB;AAC7D,SACEC,WAAW,EACXC,WAAW,EACXC,cAAc,EACdC,YAAY,QACP,qBAAqB;AAE5B,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAc,CAAC,GAAGN,OAAO;AAEjC,MAAMO,OAAO,GAAG,IAAIV,YAAY,CAAC,sBAAsB,CAAC;AAExDU,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIX,MAAM,CAAC,4BAA4B,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"journey-enable.js","names":["FrodoCommand","Option","Authenticate","Journey","showSpinner","failSpinner","succeedSpinner","printMessage","getTokens","enableJourney","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","help","process","exitCode","parse"],"sources":["cli/journey/journey-enable.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Journey } from '@rockcarver/frodo-lib';\nimport {\n showSpinner,\n failSpinner,\n succeedSpinner,\n printMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { enableJourney } = Journey;\n\nconst program = new FrodoCommand('frodo journey enable');\n\nprogram\n .description('Enable journeys/trees.')\n .addOption(\n new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')\n )\n // .addOption(\n // new Option(\n // '-a, --all',\n // 'Enable all the journeys/trees in a realm. Ignored with -i.'\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 // enable\n if (options.journeyId && (await getTokens())) {\n showSpinner(`Enabling journey ${options.journeyId}...`);\n if (await enableJourney(options.journeyId)) {\n succeedSpinner(`Enabled journey ${options.journeyId}.`);\n } else {\n failSpinner(`Enabling journey ${options.journeyId} failed.`);\n }\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,OAAO,QAAQ,uBAAuB;AAC7D,SACEC,WAAW,EACXC,WAAW,EACXC,cAAc,EACdC,YAAY,QACP,qBAAqB;AAE5B,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAc,CAAC,GAAGN,OAAO;AAEjC,MAAMO,OAAO,GAAG,IAAIV,YAAY,CAAC,sBAAsB,CAAC;AAExDU,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIX,MAAM,CAAC,4BAA4B,EAAE,yBAAyB,CACpE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,CACCY,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,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CJ,WAAW,CAAE,oBAAmBc,OAAO,CAACG,SAAU,KAAI,CAAC;IACvD,IAAI,MAAMZ,aAAa,CAACS,OAAO,CAACG,SAAS,CAAC,EAAE;MAC1Cf,cAAc,CAAE,mBAAkBY,OAAO,CAACG,SAAU,GAAE,CAAC;IACzD,CAAC,MAAM;MACLhB,WAAW,CAAE,oBAAmBa,OAAO,CAACG,SAAU,UAAS,CAAC;IAC9D;EACF;EACA;EAAA,KACK;IACHd,YAAY,CAAC,sDAAsD,CAAC;IACpEG,OAAO,CAACY,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-export.js","names":["FrodoCommand","Option","Authenticate","state","exportJourneyToFile","exportJourneysToFile","exportJourneysToFiles","printMessage","verboseMessage","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","directory","setDirectory","journeyId","file","useStringArrays","deps","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/journey/journey-export.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport {\n exportJourneyToFile,\n exportJourneysToFile,\n exportJourneysToFiles,\n} from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo journey export');\n\nprogram\n .description('Export journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. 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 journey(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\n )\n )\n .addOption(\n new Option('-D, --directory <directory>', 'Destination directory.')\n )\n .addOption(\n new Option(\n '-O, --organize <method>',\n 'Organize exports into folders using the indicated method. Valid values for method:\\n' +\n 'id: folders named by id of exported object\\n' +\n 'type: folders named by type (e.g. script, journey, idp)\\n' +\n 'type/id: folders named by type with sub-folders named by id'\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 (options.directory) state.setDirectory(options.directory);\n // export\n if (options.journeyId && (await getTokens())) {\n verboseMessage('Exporting journey...');\n await exportJourneyToFile(options.journeyId, options.file, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all journeys to a single file...');\n await exportJourneysToFile(options.file, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all journeys to separate files...');\n await exportJourneysToFiles({\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SACEC,mBAAmB,EACnBC,oBAAoB,EACpBC,qBAAqB,QAChB,sBAAsB;AAC7B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAElE,MAAM;EAAEC;AAAU,CAAC,GAAGP,YAAY;AAElC,MAAMQ,OAAO,GAAG,IAAIV,YAAY,CAAC,sBAAsB,CAAC;AAExDU,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIX,MAAM,CACR,4BAA4B,EAC5B,
|
|
1
|
+
{"version":3,"file":"journey-export.js","names":["FrodoCommand","Option","Authenticate","state","exportJourneyToFile","exportJourneysToFile","exportJourneysToFiles","printMessage","verboseMessage","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","directory","setDirectory","journeyId","file","useStringArrays","deps","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/journey/journey-export.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport {\n exportJourneyToFile,\n exportJourneysToFile,\n exportJourneysToFiles,\n} from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo journey export');\n\nprogram\n .description('Export journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. 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 journey(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\n )\n )\n .addOption(\n new Option('-D, --directory <directory>', 'Destination directory.')\n )\n .addOption(\n new Option(\n '-O, --organize <method>',\n 'Organize exports into folders using the indicated method. Valid values for method:\\n' +\n 'id: folders named by id of exported object\\n' +\n 'type: folders named by type (e.g. script, journey, idp)\\n' +\n 'type/id: folders named by type with sub-folders named by id'\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 (options.directory) state.setDirectory(options.directory);\n // export\n if (options.journeyId && (await getTokens())) {\n verboseMessage('Exporting journey...');\n await exportJourneyToFile(options.journeyId, options.file, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all journeys to a single file...');\n await exportJourneysToFile(options.file, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all journeys to separate files...');\n await exportJourneysToFiles({\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SACEC,mBAAmB,EACnBC,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AC,EAAE;IAC5CD,cAAc,CAAC,sBAAsB,CAAC;IACtC,MAAMJ,mBAAmB,CAACe,OAAO,CAACK,SAAS,EAAEL,OAAO,CAACM,IAAI,EAAE;MACzDC,eAAe,EAAEP,OAAO,CAACO,eAAe;MACxCC,IAAI,EAAER,OAAO,CAACQ;IAChB,CAAC,CAAC;EACJ;EACA;EAAA,KACK,IAAIR,OAAO,CAACS,GAAG,KAAK,MAAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CD,cAAc,CAAC,4CAA4C,CAAC;IAC5D,MAAMH,oBAAoB,CAACc,OAAO,CAACM,IAAI,EAAE;MACvCC,eAAe,EAAEP,OAAO,CAACO,eAAe;MACxCC,IAAI,EAAER,OAAO,CAACQ;IAChB,CAAC,CAAC;EACJ;EACA;EAAA,KACK,IAAIR,OAAO,CAACU,WAAW,KAAK,MAAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDD,cAAc,CAAC,6CAA6C,CAAC;IAC7D,MAAMF,qBAAqB,CAAC;MAC1BoB,eAAe,EAAEP,OAAO,CAACO,eAAe;MACxCC,IAAI,EAAER,OAAO,CAACQ;IAChB,CAAC,CAAC;EACJ;EACA;EAAA,KACK;IACHpB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDG,OAAO,CAACoB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHtB,OAAO,CAACuB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-import.js","names":["FrodoCommand","Option","Authenticate","importJourneyFromFile","importJourneysFromFile","importJourneysFromFiles","importFirstJourneyFromFile","printMessage","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","file","reUuid","deps","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/journey/journey-import.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate } from '@rockcarver/frodo-lib';\nimport {\n importJourneyFromFile,\n importJourneysFromFile,\n importJourneysFromFiles,\n importFirstJourneyFromFile,\n} from '../../ops/JourneyOps';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo journey import');\n\nprogram\n .description('Import journey/tree.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. 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 journey(s) from. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the journeys/trees from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the journeys/trees from separate files (*.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--re-uuid',\n 'Generate new UUIDs for all nodes during import.'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\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\n if (options.journeyId && (await getTokens())) {\n printMessage(`Importing journey ${options.journeyId}...`);\n importJourneyFromFile(options.journeyId, options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n printMessage(\n `Importing all journeys from a single file (${options.file})...`\n );\n importJourneysFromFile(options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n printMessage(\n 'Importing all journeys from separate files in current directory...'\n );\n importJourneysFromFiles({\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // import first journey in file\n else if (options.file && (await getTokens())) {\n printMessage('Importing first journey in file...');\n importFirstJourneyFromFile(options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,uBAAuB,EACvBC,0BAA0B,QACrB,sBAAsB;AAC7B,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAElC,MAAMO,OAAO,GAAG,IAAIT,YAAY,CAAC,sBAAsB,CAAC;AAExDS,OAAO,CACJC,WAAW,CAAC,sBAAsB,CAAC,CACnCC,SAAS,CACR,IAAIV,MAAM,CACR,4BAA4B,EAC5B,
|
|
1
|
+
{"version":3,"file":"journey-import.js","names":["FrodoCommand","Option","Authenticate","importJourneyFromFile","importJourneysFromFile","importJourneysFromFiles","importFirstJourneyFromFile","printMessage","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","file","reUuid","deps","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/journey/journey-import.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate } from '@rockcarver/frodo-lib';\nimport {\n importJourneyFromFile,\n importJourneysFromFile,\n importJourneysFromFiles,\n importFirstJourneyFromFile,\n} from '../../ops/JourneyOps';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo journey import');\n\nprogram\n .description('Import journey/tree.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. 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 journey(s) from. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the journeys/trees from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the journeys/trees from separate files (*.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--re-uuid',\n 'Generate new UUIDs for all nodes during import.'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\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\n if (options.journeyId && (await getTokens())) {\n printMessage(`Importing journey ${options.journeyId}...`);\n importJourneyFromFile(options.journeyId, options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n printMessage(\n `Importing all journeys from a single file (${options.file})...`\n );\n importJourneysFromFile(options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n printMessage(\n 'Importing all journeys from separate files in current directory...'\n );\n importJourneysFromFiles({\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // import first journey in file\n else if (options.file && (await getTokens())) {\n printMessage('Importing first journey in file...');\n importFirstJourneyFromFile(options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,uBAAuB,EACvBC,0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AAMd,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3DD,YAAY,CACT,8CAA6CW,OAAO,CAACI,IAAK,MAC7D,CAAC;IACDlB,sBAAsB,CAACc,OAAO,CAACI,IAAI,EAAE;MACnCC,MAAM,EAAEL,OAAO,CAACK,MAAM;MACtBC,IAAI,EAAEN,OAAO,CAACM;IAChB,CAAC,CAAC;EACJ;EACA;EAAA,KACK,IAAIN,OAAO,CAACQ,WAAW,IAAI,CAACR,OAAO,CAACI,IAAI,KAAK,MAAMd,SAAS,CAAC,CAAC,CAAC,EAAE;IACpED,YAAY,CACV,oEACF,CAAC;IACDF,uBAAuB,CAAC;MACtBkB,MAAM,EAAEL,OAAO,CAACK,MAAM;MACtBC,IAAI,EAAEN,OAAO,CAACM;IAChB,CAAC,CAAC;EACJ;EACA;EAAA,KACK,IAAIN,OAAO,CAACI,IAAI,KAAK,MAAMd,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CD,YAAY,CAAC,oCAAoC,CAAC;IAClDD,0BAA0B,CAACY,OAAO,CAACI,IAAI,EAAE;MACvCC,MAAM,EAAEL,OAAO,CAACK,MAAM;MACtBC,IAAI,EAAEN,OAAO,CAACM;IAChB,CAAC,CAAC;EACJ;EACA;EAAA,KACK;IACHjB,YAAY,CAAC,sDAAsD,CAAC;IACpEE,OAAO,CAACkB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHpB,OAAO,CAACqB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-list.js","names":["FrodoCommand","Option","Authenticate","state","listJourneys","verboseMessage","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","long","analyze","process","exitCode","parse"],"sources":["cli/journey/journey-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { listJourneys } from '../../ops/JourneyOps';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo journey list');\n\nprogram\n .description('List journeys/trees.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .addOption(new Option('-a, --analyze', 'Analyze journeys for custom nodes.'))\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 journeys in realm \"${state.getRealm()}\"...`);\n listJourneys(options.long, options.analyze);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAU,CAAC,GAAGJ,YAAY;AAElC,MAAMK,OAAO,GAAG,IAAIP,YAAY,CAAC,oBAAoB,CAAC;AAEtDO,OAAO,CACJC,WAAW,CAAC,sBAAsB,CAAC,CACnCC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"journey-list.js","names":["FrodoCommand","Option","Authenticate","state","listJourneys","verboseMessage","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","long","analyze","process","exitCode","parse"],"sources":["cli/journey/journey-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { listJourneys } from '../../ops/JourneyOps';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo journey list');\n\nprogram\n .description('List journeys/trees.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .addOption(new Option('-a, --analyze', 'Analyze journeys for custom nodes.'))\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 journeys in realm \"${state.getRealm()}\"...`);\n listJourneys(options.long, options.analyze);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAU,CAAC,GAAGJ,YAAY;AAElC,MAAMK,OAAO,GAAG,IAAIP,YAAY,CAAC,oBAAoB,CAAC;AAEtDO,OAAO,CACJC,WAAW,CAAC,sBAAsB,CAAC,CACnCC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1E,CAAC,CACAD,SAAS,CAAC,IAAIR,MAAM,CAAC,eAAe,EAAE,oCAAoC,CAAC,CAAC,CAC5EU,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;IACrBD,cAAc,CAAE,8BAA6BF,KAAK,CAACgB,QAAQ,CAAC,CAAE,MAAK,CAAC;IACpEf,YAAY,CAACY,OAAO,CAACI,IAAI,EAAEJ,OAAO,CAACK,OAAO,CAAC;EAC7C,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHhB,OAAO,CAACiB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-prune.js","names":["FrodoCommand","Authenticate","Journey","state","yesno","printMessage","verboseMessage","getTokens","findOrphanedNodes","removeOrphanedNodes","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","orphanedNodes","length","ok","question","process","exitCode","parse"],"sources":["cli/journey/journey-prune.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport yesno from 'yesno';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { findOrphanedNodes, removeOrphanedNodes } = Journey;\n\nconst program = new FrodoCommand('frodo journey prune');\n\nprogram\n .description(\n 'Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before any destructive operations are performed.'\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(\n `Pruning orphaned configuration artifacts in realm \"${state.getRealm()}\"...`\n );\n const orphanedNodes = await findOrphanedNodes();\n if (orphanedNodes.length > 0) {\n const ok = await yesno({\n question: 'Prune (permanently delete) orphaned nodes? (y|n):',\n });\n if (ok) {\n await removeOrphanedNodes(orphanedNodes);\n }\n } else {\n printMessage('No orphaned nodes found.');\n }\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,YAAY,EAAEC,OAAO,EAAEC,KAAK,QAAQ,uBAAuB;AACpE,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAElE,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO,iBAAiB;EAAEC;AAAoB,CAAC,GAAGP,OAAO;AAE1D,MAAMQ,OAAO,GAAG,IAAIV,YAAY,CAAC,qBAAqB,CAAC;AAEvDU,OAAO,CACJC,WAAW,CACV,+
|
|
1
|
+
{"version":3,"file":"journey-prune.js","names":["FrodoCommand","Authenticate","Journey","state","yesno","printMessage","verboseMessage","getTokens","findOrphanedNodes","removeOrphanedNodes","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","orphanedNodes","length","ok","question","process","exitCode","parse"],"sources":["cli/journey/journey-prune.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport yesno from 'yesno';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { findOrphanedNodes, removeOrphanedNodes } = Journey;\n\nconst program = new FrodoCommand('frodo journey prune');\n\nprogram\n .description(\n 'Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before any destructive operations are performed.'\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(\n `Pruning orphaned configuration artifacts in realm \"${state.getRealm()}\"...`\n );\n const orphanedNodes = await findOrphanedNodes();\n if (orphanedNodes.length > 0) {\n const ok = await yesno({\n question: 'Prune (permanently delete) orphaned nodes? (y|n):',\n });\n if (ok) {\n await removeOrphanedNodes(orphanedNodes);\n }\n } else {\n printMessage('No orphaned nodes found.');\n }\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action hand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ey.js","names":["FrodoStubCommand","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["cli/journey/journey.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('journey')\n .description('Manage journeys/trees.')\n .executableDir(__dirname);\n\n program.command('list', 'List journeys/trees.');\n\n program.command(\n 'describe',\n 'If host argument is supplied, describe the journey/tree indicated by -t, or all journeys/trees in the realm if no -t is supplied, otherwise describe the journey/tree export file indicated by -f.'\n );\n\n program.command('export', 'Export journeys/trees.');\n\n program.command('import', 'Import journeys/trees.');\n\n program.command('delete', 'Delete journeys/trees.');\n\n program.command(\n 'prune',\n 'Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before any destructive operations are performed.'\n );\n\n program.command('enable', 'Enable journeys/trees.');\n\n program.command('disable', 'Disable journeys/trees.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,
|
|
1
|
+
{"version":3,"file":"journey.js","names":["FrodoStubCommand","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["cli/journey/journey.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('journey')\n .description('Manage journeys/trees.')\n .executableDir(__dirname);\n\n program.command('list', 'List journeys/trees.');\n\n program.command(\n 'describe',\n 'If host argument is supplied, describe the journey/tree indicated by -t, or all journeys/trees in the realm if no -t is supplied, otherwise describe the journey/tree export file indicated by -f.'\n );\n\n program.command('export', 'Export journeys/trees.');\n\n program.command('import', 'Import journeys/trees.');\n\n program.command('delete', 'Delete journeys/trees.');\n\n program.command(\n 'prune',\n 'Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before any destructive operations are performed.'\n );\n\n program.command('enable', 'Enable journeys/trees.');\n\n program.command('disable', 'Disable journeys/trees.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIT,gBAAgB,CAAC,SAAS,CAAC,CAC5CU,WAAW,CAAC,wBAAwB,CAAC,CACrCC,aAAa,CAACR,SAAS,CAAC;EAE3BM,OAAO,CAACG,OAAO,CAAC,MAAM,EAAE,sBAAsB,CAAC;EAE/CH,OAAO,CAACG,OAAO,CACb,UAAU,EACV,oMACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,wBAAwB,CAAC;EAEnDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,wBAAwB,CAAC;EAEnDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,wBAAwB,CAAC;EAEnDH,OAAO,CAACG,OAAO,CACb,OAAO,EACP,+JACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CAAC,QAAQ,EAAE,wBAAwB,CAAC;EAEnDH,OAAO,CAACG,OAAO,CAAC,SAAS,EAAE,yBAAyB,CAAC;EAErD,OAAOH,OAAO;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-fetch.js","names":["FrodoCommand","sourcesOptionM","Option","Authenticate","ConnectionProfile","Log","state","config","printMessage","provisionCreds","fetchLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","SECONDS_IN_30_DAYS","SECONDS_IN_1_HOUR","LOG_TIME_WINDOW_MAX","LOG_TIME_WINDOW_INCREMENT","program","description","addOption","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","now","Date","nowString","toISOString","beginTimestamp","tempStartDate","setTime","tempEndDate","endTimestamp","beginTs","parse","endTs","intermediateEndTs","opts","sources","level","timeIncrement","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { sourcesOptionM } from './logs';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, fetchLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst SECONDS_IN_30_DAYS = 2592000;\nconst SECONDS_IN_1_HOUR = 3600;\nconst LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;\nconst LOG_TIME_WINDOW_INCREMENT = 1;\n\nconst program = new FrodoCommand('frodo logs fetch', ['realm', 'type']);\nprogram\n .description(\n 'Fetch Identity Cloud logs between a specified begin and end time period.\\\n WARNING: depending on filters and time period specified, this could take substantial time to complete.'\n )\n .addOption(sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option(\n '-b, --begin-timestamp <beginTs>',\n 'Begin timestamp for period (in ISO8601, example: \"2022-10-13T19:06:28Z\", or \"2022-09.30\". \\\nCannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \\\n(-e is ignored)'\n )\n )\n .addOption(\n new Option(\n '-e, --end-timestamp <endTs>',\n 'End timestamp for period. Default: \"now\"'\n )\n )\n .addOption(\n new Option(\n '-s, --search-string <ss>',\n 'Filter by a specific string (ANDed with transactionID filter)'\n )\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`\n )\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n const nowString = new Date(now * 1000).toISOString();\n if (\n typeof options.beginTimestamp === 'undefined' ||\n !options.beginTimestamp\n ) {\n // no beginTimestamp value specified, default is 1 hour ago\n const tempStartDate = new Date();\n tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1000);\n options.beginTimestamp = tempStartDate.toISOString();\n // also override endTimestamp to now\n const tempEndDate = new Date();\n tempEndDate.setTime(now * 1000);\n options.endTimestamp = tempEndDate;\n printMessage(\n 'No timestamps specified, defaulting to logs from 1 hour ago',\n 'info'\n );\n }\n if (\n typeof options.endTimestamp === 'undefined' ||\n !options.endTimestamp\n ) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = nowString;\n printMessage(\n 'No end timestamp specified, defaulting end timestamp to \"now\"',\n 'info'\n );\n }\n let beginTs = Date.parse(options.beginTimestamp) / 1000;\n const endTs = Date.parse(options.endTimestamp) / 1000;\n if (endTs < beginTs) {\n printMessage(\n 'End timestamp can not be before begin timestamp',\n 'error'\n );\n return;\n }\n if (now - beginTs > LOG_TIME_WINDOW_MAX) {\n printMessage(\n 'Begin timestamp can not be more than 30 days in the past',\n 'error'\n );\n return;\n }\n let intermediateEndTs = 0;\n printMessage(\n `Fetching ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}] of ${\n conn.tenant\n }...`\n );\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n\n let timeIncrement = LOG_TIME_WINDOW_INCREMENT;\n if (endTs - beginTs > 30) {\n timeIncrement = timeIncrement * 30;\n }\n do {\n intermediateEndTs = beginTs + timeIncrement;\n await fetchLogs(\n command.opts().sources,\n new Date(beginTs * 1000).toISOString(),\n new Date(intermediateEndTs * 1000).toISOString(),\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n command.opts().searchString,\n null,\n config.getNoiseFilters(options.defaults)\n );\n beginTs = intermediateEndTs;\n } while (intermediateEndTs < endTs);\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC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B,OAAO,CAAC+B,IAAI,EAAE,CAACC,OAChB,gBAAelD,YAAY,CAACkB,OAAO,CAAC+B,IAAI,EAAE,CAACE,KAAK,CAAE,QACjD9B,IAAI,CAACE,MACN,KAAI,CACN;IACD,IAAIH,mBAAmB,EAAE,MAAMlB,qBAAqB,CAACY,IAAI,CAAC,CAAC,CAAC;;IAE5D,IAAIsC,aAAa,GAAG7C,yBAAyB;IAC7C,IAAIwC,KAAK,GAAGF,OAAO,GAAG,EAAE,EAAE;MACxBO,aAAa,GAAGA,aAAa,GAAG,EAAE;IACpC;IACA,GAAG;MACDJ,iBAAiB,GAAGH,OAAO,GAAGO,aAAa;MAC3C,MAAMrD,SAAS,CACbmB,OAAO,CAAC+B,IAAI,EAAE,CAACC,OAAO,EACtB,IAAIb,IAAI,CAACQ,OAAO,GAAG,IAAI,CAAC,CAACN,WAAW,EAAE,EACtC,IAAIF,IAAI,CAACW,iBAAiB,GAAG,IAAI,CAAC,CAACT,WAAW,EAAE,EAChDvC,YAAY,CAACkB,OAAO,CAAC+B,IAAI,EAAE,CAACE,KAAK,CAAC,EAClCjC,OAAO,CAAC+B,IAAI,EAAE,CAACI,aAAa,EAC5BnC,OAAO,CAAC+B,IAAI,EAAE,CAACK,YAAY,EAC3B,IAAI,EACJ1D,MAAM,CAAC2D,eAAe,CAACtC,OAAO,CAACuC,QAAQ,CAAC,CACzC;MACDX,OAAO,GAAGG,iBAAiB;IAC7B,CAAC,QAAQA,iBAAiB,GAAGD,KAAK;EACpC;AACF,CAAC,CAAC;AAEJvC,OAAO,CAACsC,KAAK,EAAE"}
|
|
1
|
+
{"version":3,"file":"logs-fetch.js","names":["FrodoCommand","sourcesOptionM","Option","Authenticate","ConnectionProfile","Log","state","config","printMessage","provisionCreds","fetchLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","SECONDS_IN_30_DAYS","SECONDS_IN_1_HOUR","LOG_TIME_WINDOW_MAX","LOG_TIME_WINDOW_INCREMENT","program","description","addOption","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","now","Date","nowString","toISOString","beginTimestamp","tempStartDate","setTime","tempEndDate","endTimestamp","beginTs","parse","endTs","intermediateEndTs","opts","sources","level","timeIncrement","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { sourcesOptionM } from './logs';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, fetchLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst SECONDS_IN_30_DAYS = 2592000;\nconst SECONDS_IN_1_HOUR = 3600;\nconst LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;\nconst LOG_TIME_WINDOW_INCREMENT = 1;\n\nconst program = new FrodoCommand('frodo logs fetch', ['realm', 'type']);\nprogram\n .description(\n 'Fetch Identity Cloud logs between a specified begin and end time period.\\\n WARNING: depending on filters and time period specified, this could take substantial time to complete.'\n )\n .addOption(sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option(\n '-b, --begin-timestamp <beginTs>',\n 'Begin timestamp for period (in ISO8601, example: \"2022-10-13T19:06:28Z\", or \"2022-09.30\". \\\nCannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \\\n(-e is ignored)'\n )\n )\n .addOption(\n new Option(\n '-e, --end-timestamp <endTs>',\n 'End timestamp for period. Default: \"now\"'\n )\n )\n .addOption(\n new Option(\n '-s, --search-string <ss>',\n 'Filter by a specific string (ANDed with transactionID filter)'\n )\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`\n )\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n const nowString = new Date(now * 1000).toISOString();\n if (\n typeof options.beginTimestamp === 'undefined' ||\n !options.beginTimestamp\n ) {\n // no beginTimestamp value specified, default is 1 hour ago\n const tempStartDate = new Date();\n tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1000);\n options.beginTimestamp = tempStartDate.toISOString();\n // also override endTimestamp to now\n const tempEndDate = new Date();\n tempEndDate.setTime(now * 1000);\n options.endTimestamp = tempEndDate;\n printMessage(\n 'No timestamps specified, defaulting to logs from 1 hour ago',\n 'info'\n );\n }\n if (\n typeof options.endTimestamp === 'undefined' ||\n !options.endTimestamp\n ) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = nowString;\n printMessage(\n 'No end timestamp specified, defaulting end timestamp to \"now\"',\n 'info'\n );\n }\n let beginTs = Date.parse(options.beginTimestamp) / 1000;\n const endTs = Date.parse(options.endTimestamp) / 1000;\n if (endTs < beginTs) {\n printMessage(\n 'End timestamp can not be before begin timestamp',\n 'error'\n );\n return;\n }\n if (now - beginTs > LOG_TIME_WINDOW_MAX) {\n printMessage(\n 'Begin timestamp can not be more than 30 days in the past',\n 'error'\n );\n return;\n }\n let intermediateEndTs = 0;\n printMessage(\n `Fetching ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}] of ${\n conn.tenant\n }...`\n );\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n\n let timeIncrement = LOG_TIME_WINDOW_INCREMENT;\n if (endTs - beginTs > 30) {\n timeIncrement = timeIncrement * 30;\n }\n do {\n intermediateEndTs = beginTs + timeIncrement;\n await fetchLogs(\n command.opts().sources,\n new Date(beginTs * 1000).toISOString(),\n new Date(intermediateEndTs * 1000).toISOString(),\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n command.opts().searchString,\n null,\n config.getNoiseFilters(options.defaults)\n );\n beginTs = intermediateEndTs;\n } while (intermediateEndTs < endTs);\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,SAAS;EAAEC;AAAa,CAAC,GAAGN,GAAG;AACvD,MAAM;EAAEO,oBAAoB;EAAEC;AAAs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,EAAE,MAAMlB,qBAAqB,CAACY,IAAI,CAAC,CAAC,CAAC;;IAE5D,IAAIsC,aAAa,GAAG7C,yBAAyB;IAC7C,IAAIwC,KAAK,GAAGF,OAAO,GAAG,EAAE,EAAE;MACxBO,aAAa,GAAGA,aAAa,GAAG,EAAE;IACpC;IACA,GAAG;MACDJ,iBAAiB,GAAGH,OAAO,GAAGO,aAAa;MAC3C,MAAMrD,SAAS,CACbmB,OAAO,CAAC+B,IAAI,CAAC,CAAC,CAACC,OAAO,EACtB,IAAIb,IAAI,CAACQ,OAAO,GAAG,IAAI,CAAC,CAACN,WAAW,CAAC,CAAC,EACtC,IAAIF,IAAI,CAACW,iBAAiB,GAAG,IAAI,CAAC,CAACT,WAAW,CAAC,CAAC,EAChDvC,YAAY,CAACkB,OAAO,CAAC+B,IAAI,CAAC,CAAC,CAACE,KAAK,CAAC,EAClCjC,OAAO,CAAC+B,IAAI,CAAC,CAAC,CAACI,aAAa,EAC5BnC,OAAO,CAAC+B,IAAI,CAAC,CAAC,CAACK,YAAY,EAC3B,IAAI,EACJ1D,MAAM,CAAC2D,eAAe,CAACtC,OAAO,CAACuC,QAAQ,CACzC,CAAC;MACDX,OAAO,GAAGG,iBAAiB;IAC7B,CAAC,QAAQA,iBAAiB,GAAGD,KAAK;EACpC;AACF,CAAC,CAAC;AAEJvC,OAAO,CAACsC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-list.js","names":["FrodoCommand","Authenticate","ConnectionProfile","Log","state","printMessage","verboseMessage","provisionCreds","getLogSources","getConnectionProfile","saveConnectionProfile","getTokens","program","description","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","sources","length","forEach","source","parse"],"sources":["cli/logging/logs-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { provisionCreds, getLogSources } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo logs list', ['realm', 'type']);\nprogram\n .description('List available ID Cloud log sources.')\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n verboseMessage('Listing available ID Cloud log sources...');\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n\n const sources = await getLogSources();\n if (sources.length === 0) {\n printMessage(\n \"Can't get sources, possible cause - wrong API key or secret\",\n 'error'\n );\n } else {\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n printMessage(`Log sources from ${conn.tenant}`);\n sources.forEach((source) => {\n printMessage(`${source}`, 'data');\n });\n printMessage(\n 'Use any combination of comma separated sources, example:',\n 'info'\n );\n printMessage(`$ frodo logs tail -c am-core,idm-core ${host}`, 'text');\n }\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAElE,MAAM;EAAEC,cAAc;EAAEC;AAAc,CAAC,GAAGL,GAAG;AAC7C,MAAM;EAAEM,oBAAoB;EAAEC;AAAsB,CAAC,GAAGR,iBAAiB;AACzE,MAAM;EAAES;AAAU,CAAC,GAAGV,YAAY;AAElC,MAAMW,OAAO,GAAG,IAAIZ,YAAY,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACtEY,OAAO,CACJC,WAAW,CAAC,sCAAsC,CAAC,CACnDC,MAAM,CAAC,OAAOC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACxDA,OAAO,CAACC,wBAAwB,CAACL,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,CAAC;EACxE,IAAIE,mBAAmB,GAAG,IAAI;EAC9Bf,cAAc,CAAC,2CAA2C,CAAC;EAC3D,MAAMgB,IAAI,GAAG,MAAMb,oBAAoB,
|
|
1
|
+
{"version":3,"file":"logs-list.js","names":["FrodoCommand","Authenticate","ConnectionProfile","Log","state","printMessage","verboseMessage","provisionCreds","getLogSources","getConnectionProfile","saveConnectionProfile","getTokens","program","description","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","sources","length","forEach","source","parse"],"sources":["cli/logging/logs-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\n\nconst { provisionCreds, getLogSources } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo logs list', ['realm', 'type']);\nprogram\n .description('List available ID Cloud log sources.')\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n verboseMessage('Listing available ID Cloud log sources...');\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n\n const sources = await getLogSources();\n if (sources.length === 0) {\n printMessage(\n \"Can't get sources, possible cause - wrong API key or secret\",\n 'error'\n );\n } else {\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n printMessage(`Log sources from ${conn.tenant}`);\n sources.forEach((source) => {\n printMessage(`${source}`, 'data');\n });\n printMessage(\n 'Use any combination of comma separated sources, example:',\n 'info'\n );\n printMessage(`$ frodo logs tail -c am-core,idm-core ${host}`, 'text');\n }\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAElE,MAAM;EAAEC,cAAc;EAAEC;AAAc,CAAC,GAAGL,GAAG;AAC7C,MAAM;EAAEM,oBAAoB;EAAEC;AAAsB,CAAC,GAAGR,iBAAiB;AACzE,MAAM;EAAES;AAAU,CAAC,GAAGV,YAAY;AAElC,MAAMW,OAAO,GAAG,IAAIZ,YAAY,CAAC,iBAAi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MAAM3B,cAAc,CAAC,CAAC;QACpCH,KAAK,CAACuB,YAAY,CAACO,KAAK,CAACC,UAAU,CAAC;QACpC/B,KAAK,CAACwB,eAAe,CAACM,KAAK,CAACE,cAAc,CAAC;MAC7C;IACF;IAEA,MAAMC,OAAO,GAAG,MAAM7B,aAAa,CAAC,CAAC;IACrC,IAAI6B,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;MACxBjC,YAAY,CACV,6DAA6D,EAC7D,OACF,CAAC;IACH,CAAC,MAAM;MACL,IAAIgB,mBAAmB,EAAE,MAAMX,qBAAqB,CAACK,IAAI,CAAC,CAAC,CAAC;MAC5DV,YAAY,CAAE,oBAAmBiB,IAAI,CAACE,MAAO,EAAC,CAAC;MAC/Ca,OAAO,CAACE,OAAO,CAAEC,MAAM,IAAK;QAC1BnC,YAAY,CAAE,GAAEmC,MAAO,EAAC,EAAE,MAAM,CAAC;MACnC,CAAC,CAAC;MACFnC,YAAY,CACV,0DAA0D,EAC1D,MACF,CAAC;MACDA,YAAY,CAAE,yCAAwCU,IAAK,EAAC,EAAE,MAAM,CAAC;IACvE;EACF;AACF,CAAC,CAAC;AAEJH,OAAO,CAAC6B,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-tail.js","names":["FrodoCommand","sourcesOptionM","Option","Authenticate","ConnectionProfile","Log","state","config","printMessage","provisionCreds","tailLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","program","description","addOption","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","opts","sources","level","transactionId","getNoiseFilters","defaults","parse"],"sources":["cli/logging/logs-tail.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { sourcesOptionM } from './logs';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, tailLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo logs tail', ['realm', 'type']);\nprogram\n .description('Tail Identity Cloud logs.')\n .addOption(sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`\n )\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n printMessage(\n `Tailing ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}] of ${\n conn.tenant\n }...`\n );\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n await tailLogs(\n command.opts().sources,\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n null,\n config.getNoiseFilters(options.defaults)\n );\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,QAAQ;EAAEC;AAAa,CAAC,GAAGN,GAAG;AACtD,MAAM;EAAEO,oBAAoB;EAAEC;AAAsB,CAAC,GAAGT,iBAAiB;AACzE,MAAM;EAAEU;AAAU,CAAC,GAAGX,YAAY;AAElC,MAAMY,OAAO,GAAG,IAAIf,YAAY,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACtEe,OAAO,CACJC,WAAW,CAAC,2BAA2B,CAAC,CACxCC,SAAS,CAAChB,cAAc,CAAC,CACzBgB,SAAS,CACR,IAAIf,MAAM,CACR,qBAAqB,EACrB;AACN;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"logs-tail.js","names":["FrodoCommand","sourcesOptionM","Option","Authenticate","ConnectionProfile","Log","state","config","printMessage","provisionCreds","tailLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","program","description","addOption","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","opts","sources","level","transactionId","getNoiseFilters","defaults","parse"],"sources":["cli/logging/logs-tail.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { sourcesOptionM } from './logs';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, tailLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo logs tail', ['realm', 'type']);\nprogram\n .description('Tail Identity Cloud logs.')\n .addOption(sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`\n )\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n printMessage(\n `Tailing ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}] of ${\n conn.tenant\n }...`\n );\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n await tailLogs(\n command.opts().sources,\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n null,\n config.getNoiseFilters(options.defaults)\n );\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,QAAQ;EAAEC;AAAa,CAAC,GAAGN,GAAG;AACtD,MAAM;EAAEO,oBAAoB;EAAEC;AAAsB,CAAC,GAAGT,iBAAiB;AACzE,MAAM;EAAEU;AAAU,CAAC,GAAGX,YAAY;AAElC,MAAMY,OAAO,GAAG,IAAIf,YAAY,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACtEe,OAAO,CACJC,WAAW,CAAC,2BAA2B,CAAC,CACxCC,SAAS,CAAChB,cAAc,CAAC,CACzBgB,SAAS,CACR,IAAIf,MAAM,CACR,qBAAqB,EACrB;AACN;AACA;AACA;AACA,WACI,CAAC,CAACgB,OAAO,CAAC,OAAO,EAAG,GAAEP,YAAY,CAAC,OAAO,CAAE,EAAC,CAC/C,CAAC,CACAM,SAAS,CACR,IAAIf,MAAM,CAAC,6BAA6B,EAAE,yBAAyB,CACrE,CAAC,CACAe,SAAS,CACR,IAAIf,MAAM,CAAC,gBAA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AAC;QACpCH,KAAK,CAAC2B,YAAY,CAACO,KAAK,CAACC,UAAU,CAAC;QACpCnC,KAAK,CAAC4B,eAAe,CAACM,KAAK,CAACE,cAAc,CAAC;MAC7C;IACF;IACAlC,YAAY,CACT,qDACCiB,OAAO,CAACkB,IAAI,CAAC,CAAC,CAACC,OAChB,gBAAejC,YAAY,CAACc,OAAO,CAACkB,IAAI,CAAC,CAAC,CAACE,KAAK,CAAE,QACjDjB,IAAI,CAACE,MACN,KACH,CAAC;IACD,IAAIH,mBAAmB,EAAE,MAAMd,qBAAqB,CAACQ,IAAI,CAAC,CAAC,CAAC;IAC5D,MAAMX,QAAQ,CACZe,OAAO,CAACkB,IAAI,CAAC,CAAC,CAACC,OAAO,EACtBjC,YAAY,CAACc,OAAO,CAACkB,IAAI,CAAC,CAAC,CAACE,KAAK,CAAC,EAClCpB,OAAO,CAACkB,IAAI,CAAC,CAAC,CAACG,aAAa,EAC5B,IAAI,EACJvC,MAAM,CAACwC,eAAe,CAACvB,OAAO,CAACwB,QAAQ,CACzC,CAAC;EACH;AACF,CAAC,CAAC;AAEJjC,OAAO,CAACkC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","names":["FrodoStubCommand","Option","path","fileURLToPath","__dirname","dirname","import","meta","url","sourcesOptionM","makeOptionMandatory","default","setup","program","summary","description","executableDir","command"],"sources":["cli/logging/logs.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n 'Comma separated list of log sources'\n)\n .makeOptionMandatory()\n .default('am-everything,idm-everything', 'Log everything');\n\nexport default function setup() {\n const program = new FrodoStubCommand('logs')\n .summary('List/View Identity Cloud logs')\n .description(\n `View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`\n )\n .executableDir(__dirname);\n\n program.command('list', 'List available ID Cloud log sources.');\n\n program.command('tail', 'Tail Identity Cloud logs.');\n\n program.command('fetch', 'Fetch Identity Cloud logs for a time window.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,OAAO,MAAMC,cAAc,GAAG,IAAIR,MAAM,CACtC,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"logs.js","names":["FrodoStubCommand","Option","path","fileURLToPath","__dirname","dirname","import","meta","url","sourcesOptionM","makeOptionMandatory","default","setup","program","summary","description","executableDir","command"],"sources":["cli/logging/logs.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n 'Comma separated list of log sources'\n)\n .makeOptionMandatory()\n .default('am-everything,idm-everything', 'Log everything');\n\nexport default function setup() {\n const program = new FrodoStubCommand('logs')\n .summary('List/View Identity Cloud logs')\n .description(\n `View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`\n )\n .executableDir(__dirname);\n\n program.command('list', 'List available ID Cloud log sources.');\n\n program.command('tail', 'Tail Identity Cloud logs.');\n\n program.command('fetch', 'Fetch Identity Cloud logs for a time window.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,OAAO,MAAMC,cAAc,GAAG,IAAIR,MAAM,CACtC,yBAAyB,EACzB,qCACF,CAAC,CACES,mBAAmB,CAAC,CAAC,CACrBC,OAAO,CAAC,8BAA8B,EAAE,gBAAgB,CAAC;AAE5D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIb,gBAAgB,CAAC,MAAM,CAAC,CACzCc,OAAO,CAAC,+BAA+B,CAAC,CACxCC,WAAW,CACT,oJACH,CAAC,CACAC,aAAa,CAACZ,SAAS,CAAC;EAE3BS,OAAO,CAACI,OAAO,CAAC,MAAM,EAAE,sCAAsC,CAAC;EAE/DJ,OAAO,CAACI,OAAO,CAAC,MAAM,EAAE,2BAA2B,CAAC;EAEpDJ,OAAO,CAACI,OAAO,CAAC,OAAO,EAAE,8CAA8C,CAAC;EAExE,OAAOJ,OAAO;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realm-add-custom-domain.js","names":["FrodoCommand","Option","Authenticate","Realm","state","verboseMessage","getTokens","addCustomDomain","program","description","addOption","makeOptionMandatory","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","domain","getRealm","process","exitCode","parse"],"sources":["cli/realm/realm-add-custom-domain.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Realm, state } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { addCustomDomain } = Realm;\n\nconst program = new FrodoCommand('frodo realm add-custom-domain');\n\nprogram\n .description('Add custom domain (realm DNS alias).')\n .addOption(\n new Option(\n '-d, --domain <name>',\n 'Custom DNS domain name.'\n ).makeOptionMandatory()\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(\n `Adding custom DNS domain ${\n options.domain\n } to realm ${state.getRealm()}...`\n );\n await addCustomDomain(state.getRealm(), options.domain);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAClE,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAU,CAAC,GAAGJ,YAAY;AAClC,MAAM;EAAEK;AAAgB,CAAC,GAAGJ,KAAK;AAEjC,MAAMK,OAAO,GAAG,IAAIR,YAAY,CAAC,+BAA+B,CAAC;AAEjEQ,OAAO,CACJC,WAAW,CAAC,sCAAsC,CAAC,CACnDC,SAAS,CACR,IAAIT,MAAM,CACR,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"realm-add-custom-domain.js","names":["FrodoCommand","Option","Authenticate","Realm","state","verboseMessage","getTokens","addCustomDomain","program","description","addOption","makeOptionMandatory","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","domain","getRealm","process","exitCode","parse"],"sources":["cli/realm/realm-add-custom-domain.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Realm, state } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { addCustomDomain } = Realm;\n\nconst program = new FrodoCommand('frodo realm add-custom-domain');\n\nprogram\n .description('Add custom domain (realm DNS alias).')\n .addOption(\n new Option(\n '-d, --domain <name>',\n 'Custom DNS domain name.'\n ).makeOptionMandatory()\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(\n `Adding custom DNS domain ${\n options.domain\n } to realm ${state.getRealm()}...`\n );\n await addCustomDomain(state.getRealm(), options.domain);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAClE,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAU,CAAC,GAAGJ,YAAY;AAClC,MAAM;EAAEK;AAAgB,CAAC,GAAGJ,KAAK;AAEjC,MAAMK,OAAO,GAAG,IAAIR,YAAY,CAAC,+BAA+B,CAAC;AAEjEQ,OAAO,CACJC,WAAW,CAAC,sCAAsC,CAAC,CACnDC,SAAS,CACR,IAAIT,MAAM,CACR,qBAAqB,EACrB,yBACF,CAAC,CAACU,mBAAmB,CAAC,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,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBD,cAAc,CACX,4BACCY,OAAO,CAACG,MACT,aAAYhB,KAAK,CAACiB,QAAQ,CAAC,CAAE,KAChC,CAAC;IACD,MAAMd,eAAe,CAACH,KAAK,CAACiB,QAAQ,CAAC,CAAC,EAAEJ,OAAO,CAACG,MAAM,CAAC;EACzD,CAAC,MAAM;IACLE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHf,OAAO,CAACgB,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realm-describe.js","names":["FrodoCommand","Authenticate","Realm","Utils","state","verboseMessage","getRealmName","getTokens","describe","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","process","exitCode","parse"],"sources":["cli/realm/realm-describe.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate, Realm, Utils, state } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { getRealmName } = Utils;\nconst { getTokens } = Authenticate;\nconst { describe } = Realm;\n\nconst program = new FrodoCommand('frodo realm describe');\n\nprogram.description('Describe realms.').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(`Retrieving details of realm ${state.getRealm()}...`);\n describe(getRealmName(state.getRealm()));\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n);\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,YAAY,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACzE,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAa,CAAC,GAAGH,KAAK;AAC9B,MAAM;EAAEI;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAS,CAAC,GAAGN,KAAK;AAE1B,MAAMO,OAAO,GAAG,IAAIT,YAAY,CAAC,sBAAsB,CAAC;AAExDS,OAAO,CAACC,WAAW,CAAC,kBAAkB,CAAC,CAACC,MAAM;AAC5C;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,
|
|
1
|
+
{"version":3,"file":"realm-describe.js","names":["FrodoCommand","Authenticate","Realm","Utils","state","verboseMessage","getRealmName","getTokens","describe","program","description","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","process","exitCode","parse"],"sources":["cli/realm/realm-describe.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate, Realm, Utils, state } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { getRealmName } = Utils;\nconst { getTokens } = Authenticate;\nconst { describe } = Realm;\n\nconst program = new FrodoCommand('frodo realm describe');\n\nprogram.description('Describe realms.').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(`Retrieving details of realm ${state.getRealm()}...`);\n describe(getRealmName(state.getRealm()));\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n);\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,YAAY,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACzE,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAa,CAAC,GAAGH,KAAK;AAC9B,MAAM;EAAEI;AAAU,CAAC,GAAGN,YAAY;AAClC,MAAM;EAAEO;AAAS,CAAC,GAAGN,KAAK;AAE1B,MAAMO,OAAO,GAAG,IAAIT,YAAY,CAAC,sBAAsB,CAAC;AAExDS,OAAO,CAACC,WAAW,CAAC,kBAAkB,CAAC,CAACC,MAAM;AAC5C;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,+BAA8BD,KAAK,CAACe,QAAQ,CAAC,CAAE,KAAI,CAAC;IACpEX,QAAQ,CAACF,YAAY,CAACF,KAAK,CAACe,QAAQ,CAAC,CAAC,CAAC,CAAC;EAC1C,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEDZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realm-list.js","names":["FrodoCommand","Option","Authenticate","Realm","verboseMessage","listRealms","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","long","process","exitCode","parse"],"sources":["cli/realm/realm-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Realm } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { listRealms } = Realm;\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo realm list');\n\nprogram\n .description('List realms.')\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 realms...');\n await listRealms(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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAW,CAAC,GAAGF,KAAK;AAC5B,MAAM;EAAEG;AAAU,CAAC,GAAGJ,YAAY;AAElC,MAAMK,OAAO,GAAG,IAAIP,YAAY,CAAC,kBAAkB,CAAC;AAEpDO,OAAO,CACJC,WAAW,CAAC,cAAc,CAAC,CAC3BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"realm-list.js","names":["FrodoCommand","Option","Authenticate","Realm","verboseMessage","listRealms","getTokens","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","long","process","exitCode","parse"],"sources":["cli/realm/realm-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, Realm } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\n\nconst { listRealms } = Realm;\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo realm list');\n\nprogram\n .description('List realms.')\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 realms...');\n await listRealms(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,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,MAAM;EAAEC;AAAW,CAAC,GAAGF,KAAK;AAC5B,MAAM;EAAEG;AAAU,CAAC,GAAGJ,YAAY;AAElC,MAAMK,OAAO,GAAG,IAAIP,YAAY,CAAC,kBAAkB,CAAC;AAEpDO,OAAO,CACJC,WAAW,CAAC,cAAc,CAAC,CAC3BC,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,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,uBAAuB,CAAC;IACvC,MAAMC,UAAU,CAACW,OAAO,CAACG,IAAI,CAAC;EAChC,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
|