@rockcarver/frodo-cli 2.0.0-9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +1 -0
- package/CHANGELOG.md +1178 -701
- package/README.md +2 -2
- package/dist/app.cjs +187758 -0
- package/dist/app.cjs.map +1 -0
- package/dist/app.d.cts +2 -0
- package/dist/chunk-MPPKDFVI.cjs +56 -0
- package/dist/chunk-MPPKDFVI.cjs.map +1 -0
- package/dist/launch.cjs +27 -0
- package/dist/launch.cjs.map +1 -0
- package/dist/launch.d.cts +1 -0
- package/dist/loader.cjs +836 -0
- package/dist/loader.cjs.map +1 -0
- package/dist/loader.d.cts +3 -0
- package/global-jest-setup.js +5 -0
- package/package.json +68 -57
- package/tsup.config.ts +40 -0
- package/esm/app.js +0 -63
- package/esm/app.js.map +0 -1
- package/esm/cli/FrodoCommand.js +0 -147
- package/esm/cli/FrodoCommand.js.map +0 -1
- package/esm/cli/_template/something-delete.js +0 -22
- package/esm/cli/_template/something-delete.js.map +0 -1
- package/esm/cli/_template/something-describe.js +0 -22
- package/esm/cli/_template/something-describe.js.map +0 -1
- package/esm/cli/_template/something-else-delete.js +0 -22
- package/esm/cli/_template/something-else-delete.js.map +0 -1
- package/esm/cli/_template/something-else-describe.js +0 -22
- package/esm/cli/_template/something-else-describe.js.map +0 -1
- package/esm/cli/_template/something-else-export.js +0 -22
- package/esm/cli/_template/something-else-export.js.map +0 -1
- package/esm/cli/_template/something-else-import.js +0 -22
- package/esm/cli/_template/something-else-import.js.map +0 -1
- package/esm/cli/_template/something-else-list.js +0 -22
- package/esm/cli/_template/something-else-list.js.map +0 -1
- package/esm/cli/_template/something-else.js +0 -10
- package/esm/cli/_template/something-else.js.map +0 -1
- package/esm/cli/_template/something-export.js +0 -22
- package/esm/cli/_template/something-export.js.map +0 -1
- package/esm/cli/_template/something-import.js +0 -22
- package/esm/cli/_template/something-import.js.map +0 -1
- package/esm/cli/_template/something-list.js +0 -22
- package/esm/cli/_template/something-list.js.map +0 -1
- package/esm/cli/_template/something-other-delete.js +0 -22
- package/esm/cli/_template/something-other-delete.js.map +0 -1
- package/esm/cli/_template/something-other-describe.js +0 -22
- package/esm/cli/_template/something-other-describe.js.map +0 -1
- package/esm/cli/_template/something-other-export.js +0 -22
- package/esm/cli/_template/something-other-export.js.map +0 -1
- package/esm/cli/_template/something-other-import.js +0 -22
- package/esm/cli/_template/something-other-import.js.map +0 -1
- package/esm/cli/_template/something-other-list.js +0 -22
- package/esm/cli/_template/something-other-list.js.map +0 -1
- package/esm/cli/_template/something-other.js +0 -10
- package/esm/cli/_template/something-other.js.map +0 -1
- package/esm/cli/_template/something.js +0 -16
- package/esm/cli/_template/something.js.map +0 -1
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +0 -27
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +0 -1
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +0 -86
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +0 -1
- package/esm/cli/admin/admin-federation-export.js +0 -45
- package/esm/cli/admin/admin-federation-export.js.map +0 -1
- package/esm/cli/admin/admin-federation-import.js +0 -49
- package/esm/cli/admin/admin-federation-import.js.map +0 -1
- package/esm/cli/admin/admin-federation-list.js +0 -29
- package/esm/cli/admin/admin-federation-list.js.map +0 -1
- package/esm/cli/admin/admin-federation.js +0 -13
- package/esm/cli/admin/admin-federation.js.map +0 -1
- package/esm/cli/admin/admin-get-access-token.js +0 -28
- package/esm/cli/admin/admin-get-access-token.js.map +0 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +0 -28
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +0 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js +0 -28
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +0 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +0 -30
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +0 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +0 -30
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +0 -1
- package/esm/cli/admin/admin-list-static-user-mappings.js +0 -31
- package/esm/cli/admin/admin-list-static-user-mappings.js.map +0 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js +0 -27
- package/esm/cli/admin/admin-remove-static-user-mapping.js.map +0 -1
- package/esm/cli/admin/admin-repair-org-model.js +0 -28
- package/esm/cli/admin/admin-repair-org-model.js.map +0 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +0 -28
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +0 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js +0 -28
- package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +0 -1
- package/esm/cli/admin/admin.js +0 -22
- package/esm/cli/admin/admin.js.map +0 -1
- package/esm/cli/agent/agent-delete.js +0 -52
- package/esm/cli/agent/agent-delete.js.map +0 -1
- package/esm/cli/agent/agent-describe.js +0 -22
- package/esm/cli/agent/agent-describe.js.map +0 -1
- package/esm/cli/agent/agent-export.js +0 -42
- package/esm/cli/agent/agent-export.js.map +0 -1
- package/esm/cli/agent/agent-gateway-delete.js +0 -52
- package/esm/cli/agent/agent-gateway-delete.js.map +0 -1
- package/esm/cli/agent/agent-gateway-describe.js +0 -22
- package/esm/cli/agent/agent-gateway-describe.js.map +0 -1
- package/esm/cli/agent/agent-gateway-export.js +0 -42
- package/esm/cli/agent/agent-gateway-export.js.map +0 -1
- package/esm/cli/agent/agent-gateway-import.js +0 -47
- package/esm/cli/agent/agent-gateway-import.js.map +0 -1
- package/esm/cli/agent/agent-gateway-list.js +0 -23
- package/esm/cli/agent/agent-gateway-list.js.map +0 -1
- package/esm/cli/agent/agent-gateway.js +0 -10
- package/esm/cli/agent/agent-gateway.js.map +0 -1
- package/esm/cli/agent/agent-import.js +0 -47
- package/esm/cli/agent/agent-import.js.map +0 -1
- package/esm/cli/agent/agent-java-delete.js +0 -52
- package/esm/cli/agent/agent-java-delete.js.map +0 -1
- package/esm/cli/agent/agent-java-describe.js +0 -22
- package/esm/cli/agent/agent-java-describe.js.map +0 -1
- package/esm/cli/agent/agent-java-export.js +0 -42
- package/esm/cli/agent/agent-java-export.js.map +0 -1
- package/esm/cli/agent/agent-java-import.js +0 -47
- package/esm/cli/agent/agent-java-import.js.map +0 -1
- package/esm/cli/agent/agent-java-list.js +0 -23
- package/esm/cli/agent/agent-java-list.js.map +0 -1
- package/esm/cli/agent/agent-java.js +0 -10
- package/esm/cli/agent/agent-java.js.map +0 -1
- package/esm/cli/agent/agent-list.js +0 -23
- package/esm/cli/agent/agent-list.js.map +0 -1
- package/esm/cli/agent/agent-web-delete.js +0 -52
- package/esm/cli/agent/agent-web-delete.js.map +0 -1
- package/esm/cli/agent/agent-web-describe.js +0 -22
- package/esm/cli/agent/agent-web-describe.js.map +0 -1
- package/esm/cli/agent/agent-web-export.js +0 -42
- package/esm/cli/agent/agent-web-export.js.map +0 -1
- package/esm/cli/agent/agent-web-import.js +0 -47
- package/esm/cli/agent/agent-web-import.js.map +0 -1
- package/esm/cli/agent/agent-web-list.js +0 -23
- package/esm/cli/agent/agent-web-list.js.map +0 -1
- package/esm/cli/agent/agent-web.js +0 -10
- package/esm/cli/agent/agent-web.js.map +0 -1
- package/esm/cli/agent/agent.js +0 -17
- package/esm/cli/agent/agent.js.map +0 -1
- package/esm/cli/app/app-delete.js +0 -22
- package/esm/cli/app/app-delete.js.map +0 -1
- package/esm/cli/app/app-describe.js +0 -22
- package/esm/cli/app/app-describe.js.map +0 -1
- package/esm/cli/app/app-export.js +0 -52
- package/esm/cli/app/app-export.js.map +0 -1
- package/esm/cli/app/app-import.js +0 -57
- package/esm/cli/app/app-import.js.map +0 -1
- package/esm/cli/app/app-list.js +0 -25
- package/esm/cli/app/app-list.js.map +0 -1
- package/esm/cli/app/app.js +0 -21
- package/esm/cli/app/app.js.map +0 -1
- package/esm/cli/authz/authz-policy-delete.js +0 -43
- package/esm/cli/authz/authz-policy-delete.js.map +0 -1
- package/esm/cli/authz/authz-policy-describe.js +0 -30
- package/esm/cli/authz/authz-policy-describe.js.map +0 -1
- package/esm/cli/authz/authz-policy-export.js +0 -75
- package/esm/cli/authz/authz-policy-export.js.map +0 -1
- package/esm/cli/authz/authz-policy-import.js +0 -65
- package/esm/cli/authz/authz-policy-import.js.map +0 -1
- package/esm/cli/authz/authz-policy-list.js +0 -37
- package/esm/cli/authz/authz-policy-list.js.map +0 -1
- package/esm/cli/authz/authz-policy.js +0 -10
- package/esm/cli/authz/authz-policy.js.map +0 -1
- package/esm/cli/authz/authz-set-delete.js +0 -37
- package/esm/cli/authz/authz-set-delete.js.map +0 -1
- package/esm/cli/authz/authz-set-describe.js +0 -30
- package/esm/cli/authz/authz-set-describe.js.map +0 -1
- package/esm/cli/authz/authz-set-export.js +0 -55
- package/esm/cli/authz/authz-set-export.js.map +0 -1
- package/esm/cli/authz/authz-set-import.js +0 -61
- package/esm/cli/authz/authz-set-import.js.map +0 -1
- package/esm/cli/authz/authz-set-list.js +0 -25
- package/esm/cli/authz/authz-set-list.js.map +0 -1
- package/esm/cli/authz/authz-set.js +0 -10
- package/esm/cli/authz/authz-set.js.map +0 -1
- package/esm/cli/authz/authz-type-delete.js +0 -43
- package/esm/cli/authz/authz-type-delete.js.map +0 -1
- package/esm/cli/authz/authz-type-describe.js +0 -34
- package/esm/cli/authz/authz-type-describe.js.map +0 -1
- package/esm/cli/authz/authz-type-export.js +0 -49
- package/esm/cli/authz/authz-type-export.js.map +0 -1
- package/esm/cli/authz/authz-type-import.js +0 -55
- package/esm/cli/authz/authz-type-import.js.map +0 -1
- package/esm/cli/authz/authz-type-list.js +0 -26
- package/esm/cli/authz/authz-type-list.js.map +0 -1
- package/esm/cli/authz/authz-type.js +0 -10
- package/esm/cli/authz/authz-type.js.map +0 -1
- package/esm/cli/authz/authz.js +0 -12
- package/esm/cli/authz/authz.js.map +0 -1
- package/esm/cli/conn/conn-delete.js +0 -14
- package/esm/cli/conn/conn-delete.js.map +0 -1
- package/esm/cli/conn/conn-describe.js +0 -15
- package/esm/cli/conn/conn-describe.js.map +0 -1
- package/esm/cli/conn/conn-list.js +0 -15
- package/esm/cli/conn/conn-list.js.map +0 -1
- package/esm/cli/conn/conn-save.js +0 -107
- package/esm/cli/conn/conn-save.js.map +0 -1
- package/esm/cli/conn/conn.js +0 -15
- package/esm/cli/conn/conn.js.map +0 -1
- package/esm/cli/email/email-template-export.js +0 -40
- package/esm/cli/email/email-template-export.js.map +0 -1
- package/esm/cli/email/email-template-import.js +0 -45
- package/esm/cli/email/email-template-import.js.map +0 -1
- package/esm/cli/email/email-template-list.js +0 -25
- package/esm/cli/email/email-template-list.js.map +0 -1
- package/esm/cli/email/email-template.js +0 -8
- package/esm/cli/email/email-template.js.map +0 -1
- package/esm/cli/email/email.js +0 -11
- package/esm/cli/email/email.js.map +0 -1
- package/esm/cli/esv/esv-apply.js +0 -62
- package/esm/cli/esv/esv-apply.js.map +0 -1
- package/esm/cli/esv/esv-secret-create.js +0 -25
- package/esm/cli/esv/esv-secret-create.js.map +0 -1
- package/esm/cli/esv/esv-secret-delete.js +0 -35
- package/esm/cli/esv/esv-secret-delete.js.map +0 -1
- package/esm/cli/esv/esv-secret-describe.js +0 -25
- package/esm/cli/esv/esv-secret-describe.js.map +0 -1
- package/esm/cli/esv/esv-secret-export.js +0 -22
- package/esm/cli/esv/esv-secret-export.js.map +0 -1
- package/esm/cli/esv/esv-secret-import.js +0 -22
- package/esm/cli/esv/esv-secret-import.js.map +0 -1
- package/esm/cli/esv/esv-secret-list.js +0 -25
- package/esm/cli/esv/esv-secret-list.js.map +0 -1
- package/esm/cli/esv/esv-secret-set.js +0 -25
- package/esm/cli/esv/esv-secret-set.js.map +0 -1
- package/esm/cli/esv/esv-secret-version-activate.js +0 -30
- package/esm/cli/esv/esv-secret-version-activate.js.map +0 -1
- package/esm/cli/esv/esv-secret-version-create.js +0 -25
- package/esm/cli/esv/esv-secret-version-create.js.map +0 -1
- package/esm/cli/esv/esv-secret-version-deactivate.js +0 -30
- package/esm/cli/esv/esv-secret-version-deactivate.js.map +0 -1
- package/esm/cli/esv/esv-secret-version-delete.js +0 -35
- package/esm/cli/esv/esv-secret-version-delete.js.map +0 -1
- package/esm/cli/esv/esv-secret-version-list.js +0 -25
- package/esm/cli/esv/esv-secret-version-list.js.map +0 -1
- package/esm/cli/esv/esv-secret-version.js +0 -10
- package/esm/cli/esv/esv-secret-version.js.map +0 -1
- package/esm/cli/esv/esv-secret.js +0 -16
- package/esm/cli/esv/esv-secret.js.map +0 -1
- package/esm/cli/esv/esv-variable-create.js +0 -24
- package/esm/cli/esv/esv-variable-create.js.map +0 -1
- package/esm/cli/esv/esv-variable-delete.js +0 -35
- package/esm/cli/esv/esv-variable-delete.js.map +0 -1
- package/esm/cli/esv/esv-variable-describe.js +0 -25
- package/esm/cli/esv/esv-variable-describe.js.map +0 -1
- package/esm/cli/esv/esv-variable-export.js +0 -22
- package/esm/cli/esv/esv-variable-export.js.map +0 -1
- package/esm/cli/esv/esv-variable-import.js +0 -22
- package/esm/cli/esv/esv-variable-import.js.map +0 -1
- package/esm/cli/esv/esv-variable-list.js +0 -25
- package/esm/cli/esv/esv-variable-list.js.map +0 -1
- package/esm/cli/esv/esv-variable-set.js +0 -31
- package/esm/cli/esv/esv-variable-set.js.map +0 -1
- package/esm/cli/esv/esv-variable.js +0 -15
- package/esm/cli/esv/esv-variable.js.map +0 -1
- package/esm/cli/esv/esv.js +0 -12
- package/esm/cli/esv/esv.js.map +0 -1
- package/esm/cli/idm/idm-count.js +0 -25
- package/esm/cli/idm/idm-count.js.map +0 -1
- package/esm/cli/idm/idm-export.js +0 -42
- package/esm/cli/idm/idm-export.js.map +0 -1
- package/esm/cli/idm/idm-import.js +0 -45
- package/esm/cli/idm/idm-import.js.map +0 -1
- package/esm/cli/idm/idm-list.js +0 -29
- package/esm/cli/idm/idm-list.js.map +0 -1
- package/esm/cli/idm/idm.js +0 -13
- package/esm/cli/idm/idm.js.map +0 -1
- package/esm/cli/idp/idp-export.js +0 -42
- package/esm/cli/idp/idp-export.js.map +0 -1
- package/esm/cli/idp/idp-import.js +0 -45
- package/esm/cli/idp/idp-import.js.map +0 -1
- package/esm/cli/idp/idp-list.js +0 -28
- package/esm/cli/idp/idp-list.js.map +0 -1
- package/esm/cli/idp/idp.js +0 -12
- package/esm/cli/idp/idp.js.map +0 -1
- package/esm/cli/info/info.js +0 -54
- package/esm/cli/info/info.js.map +0 -1
- package/esm/cli/journey/journey-delete.js +0 -34
- package/esm/cli/journey/journey-delete.js.map +0 -1
- package/esm/cli/journey/journey-describe.js +0 -125
- package/esm/cli/journey/journey-describe.js.map +0 -1
- package/esm/cli/journey/journey-disable.js +0 -43
- package/esm/cli/journey/journey-disable.js.map +0 -1
- package/esm/cli/journey/journey-enable.js +0 -43
- package/esm/cli/journey/journey-enable.js.map +0 -1
- package/esm/cli/journey/journey-export.js +0 -50
- package/esm/cli/journey/journey-export.js.map +0 -1
- package/esm/cli/journey/journey-import.js +0 -57
- package/esm/cli/journey/journey-import.js.map +0 -1
- package/esm/cli/journey/journey-list.js +0 -25
- package/esm/cli/journey/journey-list.js.map +0 -1
- package/esm/cli/journey/journey-prune.js +0 -38
- package/esm/cli/journey/journey-prune.js.map +0 -1
- package/esm/cli/journey/journey.js +0 -17
- package/esm/cli/journey/journey.js.map +0 -1
- package/esm/cli/log/log-fetch.js +0 -101
- package/esm/cli/log/log-fetch.js.map +0 -1
- package/esm/cli/log/log-key-delete.js +0 -35
- package/esm/cli/log/log-key-delete.js.map +0 -1
- package/esm/cli/log/log-key-describe.js +0 -22
- package/esm/cli/log/log-key-describe.js.map +0 -1
- package/esm/cli/log/log-key-list.js +0 -26
- package/esm/cli/log/log-key-list.js.map +0 -1
- package/esm/cli/log/log-key.js +0 -8
- package/esm/cli/log/log-key.js.map +0 -1
- package/esm/cli/log/log-list.js +0 -59
- package/esm/cli/log/log-list.js.map +0 -1
- package/esm/cli/log/log-tail.js +0 -56
- package/esm/cli/log/log-tail.js.map +0 -1
- package/esm/cli/log/log.js +0 -17
- package/esm/cli/log/log.js.map +0 -1
- package/esm/cli/realm/realm-add-custom-domain.js +0 -25
- package/esm/cli/realm/realm-add-custom-domain.js.map +0 -1
- package/esm/cli/realm/realm-describe.js +0 -24
- package/esm/cli/realm/realm-describe.js.map +0 -1
- package/esm/cli/realm/realm-list.js +0 -25
- package/esm/cli/realm/realm-list.js.map +0 -1
- package/esm/cli/realm/realm-remove-custom-domain.js +0 -27
- package/esm/cli/realm/realm-remove-custom-domain.js.map +0 -1
- package/esm/cli/realm/realm.js +0 -18
- package/esm/cli/realm/realm.js.map +0 -1
- package/esm/cli/saml/saml-cot-export.js +0 -43
- package/esm/cli/saml/saml-cot-export.js.map +0 -1
- package/esm/cli/saml/saml-cot-import.js +0 -49
- package/esm/cli/saml/saml-cot-import.js.map +0 -1
- package/esm/cli/saml/saml-cot-list.js +0 -26
- package/esm/cli/saml/saml-cot-list.js.map +0 -1
- package/esm/cli/saml/saml-cot.js +0 -8
- package/esm/cli/saml/saml-cot.js.map +0 -1
- package/esm/cli/saml/saml-delete.js +0 -38
- package/esm/cli/saml/saml-delete.js.map +0 -1
- package/esm/cli/saml/saml-describe.js +0 -25
- package/esm/cli/saml/saml-describe.js.map +0 -1
- package/esm/cli/saml/saml-export.js +0 -40
- package/esm/cli/saml/saml-export.js.map +0 -1
- package/esm/cli/saml/saml-import.js +0 -45
- package/esm/cli/saml/saml-import.js.map +0 -1
- package/esm/cli/saml/saml-list.js +0 -25
- package/esm/cli/saml/saml-list.js.map +0 -1
- package/esm/cli/saml/saml-metadata-export.js +0 -35
- package/esm/cli/saml/saml-metadata-export.js.map +0 -1
- package/esm/cli/saml/saml-metadata.js +0 -6
- package/esm/cli/saml/saml-metadata.js.map +0 -1
- package/esm/cli/saml/saml.js +0 -16
- package/esm/cli/saml/saml.js.map +0 -1
- package/esm/cli/script/script-delete.js +0 -22
- package/esm/cli/script/script-delete.js.map +0 -1
- package/esm/cli/script/script-describe.js +0 -22
- package/esm/cli/script/script-describe.js.map +0 -1
- package/esm/cli/script/script-export.js +0 -62
- package/esm/cli/script/script-export.js.map +0 -1
- package/esm/cli/script/script-import.js +0 -35
- package/esm/cli/script/script-import.js.map +0 -1
- package/esm/cli/script/script-list.js +0 -26
- package/esm/cli/script/script-list.js.map +0 -1
- package/esm/cli/script/script.js +0 -18
- package/esm/cli/script/script.js.map +0 -1
- package/esm/cli/service/service-delete.js +0 -22
- package/esm/cli/service/service-delete.js.map +0 -1
- package/esm/cli/service/service-export.js +0 -40
- package/esm/cli/service/service-export.js.map +0 -1
- package/esm/cli/service/service-import.js +0 -47
- package/esm/cli/service/service-import.js.map +0 -1
- package/esm/cli/service/service-list.js +0 -20
- package/esm/cli/service/service-list.js.map +0 -1
- package/esm/cli/service/service.js +0 -13
- package/esm/cli/service/service.js.map +0 -1
- package/esm/cli/theme/theme-delete.e2e.test_.js.map +0 -1
- package/esm/cli/theme/theme-delete.js +0 -40
- package/esm/cli/theme/theme-delete.js.map +0 -1
- package/esm/cli/theme/theme-export.js +0 -45
- package/esm/cli/theme/theme-export.js.map +0 -1
- package/esm/cli/theme/theme-import.js +0 -50
- package/esm/cli/theme/theme-import.js.map +0 -1
- package/esm/cli/theme/theme-list.e2e.test_.js.map +0 -1
- package/esm/cli/theme/theme-list.js +0 -25
- package/esm/cli/theme/theme-list.js.map +0 -1
- package/esm/cli/theme/theme.js +0 -13
- package/esm/cli/theme/theme.js.map +0 -1
- package/esm/help/SampleData.js +0 -7
- package/esm/help/SampleData.js.map +0 -1
- package/esm/launch.js +0 -15
- package/esm/launch.js.map +0 -1
- package/esm/loader.js +0 -40
- package/esm/loader.js.map +0 -1
- package/esm/ops/AdminFederationOps.js +0 -216
- package/esm/ops/AdminFederationOps.js.map +0 -1
- package/esm/ops/AgentOps.js +0 -691
- package/esm/ops/AgentOps.js.map +0 -1
- package/esm/ops/CirclesOfTrustOps.js +0 -260
- package/esm/ops/CirclesOfTrustOps.js.map +0 -1
- package/esm/ops/ConnectionProfileOps.js +0 -125
- package/esm/ops/ConnectionProfileOps.js.map +0 -1
- package/esm/ops/EmailTemplateOps.js +0 -361
- package/esm/ops/EmailTemplateOps.js.map +0 -1
- package/esm/ops/IdmOps.js +0 -360
- package/esm/ops/IdmOps.js.map +0 -1
- package/esm/ops/IdpOps.js +0 -212
- package/esm/ops/IdpOps.js.map +0 -1
- package/esm/ops/JourneyOps.js +0 -669
- package/esm/ops/JourneyOps.js.map +0 -1
- package/esm/ops/LogOps.js +0 -149
- package/esm/ops/LogOps.js.map +0 -1
- package/esm/ops/NodeOps.js +0 -89
- package/esm/ops/NodeOps.js.map +0 -1
- package/esm/ops/OAuth2ClientOps.js +0 -271
- package/esm/ops/OAuth2ClientOps.js.map +0 -1
- package/esm/ops/OrganizationOps.js +0 -34
- package/esm/ops/OrganizationOps.js.map +0 -1
- package/esm/ops/PolicyOps.js +0 -493
- package/esm/ops/PolicyOps.js.map +0 -1
- package/esm/ops/PolicySetOps.js +0 -379
- package/esm/ops/PolicySetOps.js.map +0 -1
- package/esm/ops/RealmOps.js +0 -116
- package/esm/ops/RealmOps.js.map +0 -1
- package/esm/ops/ResourceTypeOps.js +0 -452
- package/esm/ops/ResourceTypeOps.js.map +0 -1
- package/esm/ops/Saml2Ops.js +0 -293
- package/esm/ops/Saml2Ops.js.map +0 -1
- package/esm/ops/Saml2Ops.test_.js.map +0 -1
- package/esm/ops/ScriptOps.js +0 -383
- package/esm/ops/ScriptOps.js.map +0 -1
- package/esm/ops/SecretsOps.js +0 -237
- package/esm/ops/SecretsOps.js.map +0 -1
- package/esm/ops/ServiceOps.js +0 -213
- package/esm/ops/ServiceOps.js.map +0 -1
- package/esm/ops/ThemeOps.js +0 -361
- package/esm/ops/ThemeOps.js.map +0 -1
- package/esm/ops/VariablesOps.js +0 -144
- package/esm/ops/VariablesOps.js.map +0 -1
- package/esm/ops/utils/OpsUtils.js +0 -9
- package/esm/ops/utils/OpsUtils.js.map +0 -1
- package/esm/ops/utils/Wordwrap.js +0 -5
- package/esm/ops/utils/Wordwrap.js.map +0 -1
- package/esm/storage/StaticStorage.js +0 -12
- package/esm/storage/StaticStorage.js.map +0 -1
- package/esm/utils/Config.js +0 -43
- package/esm/utils/Config.js.map +0 -1
- package/esm/utils/Console.js +0 -537
- package/esm/utils/Console.js.map +0 -1
- package/esm/utils/ExportImportUtils.js +0 -93
- package/esm/utils/ExportImportUtils.js.map +0 -1
- package/esm/utils/Version.js +0 -138
- package/esm/utils/Version.js.map +0 -1
package/esm/utils/Console.js
DELETED
|
@@ -1,537 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import { MultiBar, Presets } from 'cli-progress';
|
|
4
|
-
import { createSpinner } from 'nanospinner';
|
|
5
|
-
import Table from 'cli-table3';
|
|
6
|
-
import Color from 'colors';
|
|
7
|
-
Color.enable();
|
|
8
|
-
const {
|
|
9
|
-
appendTextToFile
|
|
10
|
-
} = frodo.utils.impex;
|
|
11
|
-
let multiBarContainer = null;
|
|
12
|
-
let progressBar = null;
|
|
13
|
-
let spinner = null;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Output a message in default color to stdout or append to `state.getOutputFile()`
|
|
17
|
-
* @param {string | object} message the message
|
|
18
|
-
*/
|
|
19
|
-
function data(message, newline = true) {
|
|
20
|
-
if (!message) return;
|
|
21
|
-
if (state.getOutputFile()) {
|
|
22
|
-
if (typeof message === 'object') {
|
|
23
|
-
message = JSON.stringify(message, null, 2);
|
|
24
|
-
}
|
|
25
|
-
if (newline) {
|
|
26
|
-
message += '\n';
|
|
27
|
-
}
|
|
28
|
-
appendTextToFile(message, state.getOutputFile());
|
|
29
|
-
} else if (typeof message === 'object') {
|
|
30
|
-
console.dir(message, {
|
|
31
|
-
depth: 3
|
|
32
|
-
});
|
|
33
|
-
} else if (newline) {
|
|
34
|
-
console.log(message);
|
|
35
|
-
} else {
|
|
36
|
-
process.stdout.write(message);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Output a default color message to stderr
|
|
42
|
-
* @param {Object} message the message
|
|
43
|
-
*/
|
|
44
|
-
function text(message, newline = true) {
|
|
45
|
-
if (!message) return;
|
|
46
|
-
if (typeof message === 'object') {
|
|
47
|
-
console.dir(message, {
|
|
48
|
-
depth: 3
|
|
49
|
-
});
|
|
50
|
-
} else if (newline) {
|
|
51
|
-
console.error(message);
|
|
52
|
-
} else {
|
|
53
|
-
process.stderr.write(message);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Output a message in bright cyan to stderr
|
|
59
|
-
* @param {Object} message the message
|
|
60
|
-
*/
|
|
61
|
-
function info(message, newline = true) {
|
|
62
|
-
if (!message) return;
|
|
63
|
-
if (typeof message === 'object') {
|
|
64
|
-
console.dir(message, {
|
|
65
|
-
depth: 3
|
|
66
|
-
});
|
|
67
|
-
} else if (newline) {
|
|
68
|
-
console.error(message['brightCyan']);
|
|
69
|
-
} else {
|
|
70
|
-
process.stderr.write(message['brightCyan']);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Output a message in yellow to stderr
|
|
76
|
-
* @param {Object} message the message
|
|
77
|
-
*/
|
|
78
|
-
function warn(message, newline = true) {
|
|
79
|
-
if (!message) return;
|
|
80
|
-
if (typeof message === 'object') {
|
|
81
|
-
console.dir(message, {
|
|
82
|
-
depth: 3
|
|
83
|
-
});
|
|
84
|
-
} else if (newline) {
|
|
85
|
-
console.error(message['yellow']);
|
|
86
|
-
} else {
|
|
87
|
-
process.stderr.write(message['yellow']);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Output a message in bright red to stderr
|
|
93
|
-
* @param {Object} message the message
|
|
94
|
-
*/
|
|
95
|
-
function error(message, newline = true) {
|
|
96
|
-
if (!message) return;
|
|
97
|
-
if (typeof message === 'object') {
|
|
98
|
-
console.dir(message, {
|
|
99
|
-
depth: 3
|
|
100
|
-
});
|
|
101
|
-
} else if (newline) {
|
|
102
|
-
console.error(message['brightRed']);
|
|
103
|
-
} else {
|
|
104
|
-
process.stderr.write(message['brightRed']);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Output a debug message
|
|
110
|
-
* @param {string | object} message the message
|
|
111
|
-
*/
|
|
112
|
-
function debug(message, newline = true) {
|
|
113
|
-
if (!message) return;
|
|
114
|
-
if (typeof message === 'object') {
|
|
115
|
-
console.dir(message, {
|
|
116
|
-
depth: 6
|
|
117
|
-
});
|
|
118
|
-
} else if (newline) {
|
|
119
|
-
console.error(message['brightMagenta']);
|
|
120
|
-
} else {
|
|
121
|
-
process.stderr.write(message['brightMagenta']);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Output a curlirize message
|
|
127
|
-
* @param {string} message the message
|
|
128
|
-
*/
|
|
129
|
-
function curlirize(message) {
|
|
130
|
-
if (!message) return;
|
|
131
|
-
console.error(message['brightBlue']);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Output a message in default color to stderr
|
|
136
|
-
* @param {Object} message the message
|
|
137
|
-
*/
|
|
138
|
-
export function verboseMessage(message) {
|
|
139
|
-
if (!message) return;
|
|
140
|
-
if (state.getVerbose()) {
|
|
141
|
-
text(message);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Output a debug message
|
|
147
|
-
* @param {Object} message the message
|
|
148
|
-
*/
|
|
149
|
-
export function debugMessage(message) {
|
|
150
|
-
if (!message) return;
|
|
151
|
-
if (state.getDebug()) {
|
|
152
|
-
debug(message);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Output a curlirize message
|
|
158
|
-
* @param {Object} message the message
|
|
159
|
-
*/
|
|
160
|
-
export function curlirizeMessage(message) {
|
|
161
|
-
if (!message) return;
|
|
162
|
-
if (state.getCurlirize()) {
|
|
163
|
-
curlirize(message);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Prints a string message to console
|
|
169
|
-
*
|
|
170
|
-
* @param {string} message The string message to print
|
|
171
|
-
* @param {string} [type=text] "text", "info", "warn", "error" or "data". All but
|
|
172
|
-
* type="data" will be written to stderr.
|
|
173
|
-
* @param {boolean} [newline=true] Whether to add a newline at the end of message
|
|
174
|
-
*
|
|
175
|
-
*/
|
|
176
|
-
export function printMessage(message, type = 'text', newline = true) {
|
|
177
|
-
switch (type) {
|
|
178
|
-
case 'data':
|
|
179
|
-
data(message, newline);
|
|
180
|
-
break;
|
|
181
|
-
case 'text':
|
|
182
|
-
text(message, newline);
|
|
183
|
-
break;
|
|
184
|
-
case 'info':
|
|
185
|
-
info(message, newline);
|
|
186
|
-
break;
|
|
187
|
-
case 'warn':
|
|
188
|
-
warn(message, newline);
|
|
189
|
-
break;
|
|
190
|
-
case 'error':
|
|
191
|
-
error(message, newline);
|
|
192
|
-
break;
|
|
193
|
-
default:
|
|
194
|
-
text(message, newline);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Creates a progress bar on stderr
|
|
200
|
-
*
|
|
201
|
-
* Example:
|
|
202
|
-
* [========================================] 100% | 49/49 | Analyzing journey - transactional_auth
|
|
203
|
-
*
|
|
204
|
-
* @param {Number} total The total number of entries to track progress for
|
|
205
|
-
* @param {String} message optional progress bar message
|
|
206
|
-
* @param {Object} options progress bar configuration options
|
|
207
|
-
*
|
|
208
|
-
*/
|
|
209
|
-
export function createProgressBar(total, message = null, options = {
|
|
210
|
-
format: '[{bar}] {percentage}% | {value}/{total} | {data}',
|
|
211
|
-
noTTYOutput: true
|
|
212
|
-
}) {
|
|
213
|
-
let opt = options;
|
|
214
|
-
if (message == null) {
|
|
215
|
-
opt = {
|
|
216
|
-
format: '[{bar}] {percentage}% | {value}/{total}',
|
|
217
|
-
noTTYOutput: true
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
// progressBar = new SingleBar(opt, Presets.legacy); // create only when needed
|
|
221
|
-
// progressBar.start(total, 0, {
|
|
222
|
-
// data: message,
|
|
223
|
-
// });
|
|
224
|
-
multiBarContainer = new MultiBar(opt, Presets.legacy);
|
|
225
|
-
progressBar = multiBarContainer.create(total, 0, {
|
|
226
|
-
data: message
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Updates the progress bar by 1
|
|
232
|
-
* @param {string} message optional message to update the progress bar
|
|
233
|
-
*
|
|
234
|
-
*/
|
|
235
|
-
export function updateProgressBar(message = null) {
|
|
236
|
-
if (message) progressBar.increment({
|
|
237
|
-
data: message
|
|
238
|
-
});else progressBar.increment();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Stop and hide the progress bar
|
|
243
|
-
* @param {*} message optional message to update the progress bar
|
|
244
|
-
*/
|
|
245
|
-
export function stopProgressBar(message = null) {
|
|
246
|
-
if (message) progressBar.update({
|
|
247
|
-
data: message
|
|
248
|
-
});
|
|
249
|
-
// progressBar.stop();
|
|
250
|
-
multiBarContainer.stop();
|
|
251
|
-
multiBarContainer = null;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Create the spinner
|
|
256
|
-
* @param {String} message optional spinner message
|
|
257
|
-
*/
|
|
258
|
-
export function showSpinner(message) {
|
|
259
|
-
spinner = createSpinner(message).start();
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Stop the spinner
|
|
264
|
-
* @param {String} message optional message to update the spinner
|
|
265
|
-
*/
|
|
266
|
-
export function stopSpinner(message = null) {
|
|
267
|
-
if (spinner) {
|
|
268
|
-
let options = {};
|
|
269
|
-
if (message) options = {
|
|
270
|
-
text: message
|
|
271
|
-
};
|
|
272
|
-
spinner.stop(options);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Succeed the spinner. Stop and render success checkmark with optional message.
|
|
278
|
-
* @param {String} message optional message to update the spinner
|
|
279
|
-
*/
|
|
280
|
-
export function succeedSpinner(message = null) {
|
|
281
|
-
if (spinner) {
|
|
282
|
-
let options = {};
|
|
283
|
-
if (message) options = {
|
|
284
|
-
text: message
|
|
285
|
-
};
|
|
286
|
-
spinner.success(options);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Warn the spinner
|
|
292
|
-
* @param {String} message optional message to update the spinner
|
|
293
|
-
*/
|
|
294
|
-
export function warnSpinner(message = null) {
|
|
295
|
-
if (spinner) {
|
|
296
|
-
let options = {};
|
|
297
|
-
if (message) options = {
|
|
298
|
-
text: message
|
|
299
|
-
};
|
|
300
|
-
spinner.warn(options);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Fail the spinner
|
|
306
|
-
* @param {String} message optional message to update the spinner
|
|
307
|
-
*/
|
|
308
|
-
export function failSpinner(message = null) {
|
|
309
|
-
if (spinner) {
|
|
310
|
-
let options = {};
|
|
311
|
-
if (message) options = {
|
|
312
|
-
text: message
|
|
313
|
-
};
|
|
314
|
-
spinner.error(options);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Spin the spinner
|
|
320
|
-
* @param {String} message optional message to update the spinner
|
|
321
|
-
*/
|
|
322
|
-
export function spinSpinner(message = null) {
|
|
323
|
-
if (spinner) {
|
|
324
|
-
let options = {};
|
|
325
|
-
if (message) options = {
|
|
326
|
-
text: message
|
|
327
|
-
};
|
|
328
|
-
spinner.update(options);
|
|
329
|
-
spinner.spin();
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
export function createProgressIndicator(type = 'determinate', total = 0, message = null) {
|
|
333
|
-
if (type === 'determinate') {
|
|
334
|
-
createProgressBar(total, message);
|
|
335
|
-
} else {
|
|
336
|
-
showSpinner(message);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
export function updateProgressIndicator(message) {
|
|
340
|
-
if (!progressBar) {
|
|
341
|
-
spinSpinner(message);
|
|
342
|
-
} else {
|
|
343
|
-
updateProgressBar(message);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
export function stopProgressIndicator(message, status = 'none') {
|
|
347
|
-
if (!progressBar) {
|
|
348
|
-
switch (status) {
|
|
349
|
-
case 'none':
|
|
350
|
-
stopSpinner(message);
|
|
351
|
-
break;
|
|
352
|
-
case 'success':
|
|
353
|
-
succeedSpinner(message);
|
|
354
|
-
break;
|
|
355
|
-
case 'warn':
|
|
356
|
-
warnSpinner(message);
|
|
357
|
-
break;
|
|
358
|
-
case 'fail':
|
|
359
|
-
failSpinner(message);
|
|
360
|
-
break;
|
|
361
|
-
default:
|
|
362
|
-
stopSpinner(message);
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
} else {
|
|
366
|
-
stopProgressBar(message);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Create an empty table
|
|
372
|
-
* @param {string[]} head header row as an array of strings
|
|
373
|
-
* @returns {any} an empty table
|
|
374
|
-
*/
|
|
375
|
-
export function createTable(head) {
|
|
376
|
-
const table = new Table({
|
|
377
|
-
head,
|
|
378
|
-
chars: {
|
|
379
|
-
top: '',
|
|
380
|
-
'top-mid': '',
|
|
381
|
-
'top-left': '',
|
|
382
|
-
'top-right': '',
|
|
383
|
-
bottom: '',
|
|
384
|
-
'bottom-mid': '',
|
|
385
|
-
'bottom-left': '',
|
|
386
|
-
'bottom-right': '',
|
|
387
|
-
left: '',
|
|
388
|
-
'left-mid': '',
|
|
389
|
-
mid: '',
|
|
390
|
-
'mid-mid': '',
|
|
391
|
-
right: '',
|
|
392
|
-
'right-mid': ''
|
|
393
|
-
},
|
|
394
|
-
style: {
|
|
395
|
-
'padding-left': 0,
|
|
396
|
-
'padding-right': 0,
|
|
397
|
-
head: ['brightCyan']
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
return table;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Create a new key/value table
|
|
405
|
-
* @returns {any} an empty key/value table
|
|
406
|
-
*/
|
|
407
|
-
export function createKeyValueTable() {
|
|
408
|
-
const table = new Table({
|
|
409
|
-
chars: {
|
|
410
|
-
top: '',
|
|
411
|
-
'top-mid': '',
|
|
412
|
-
'top-left': '',
|
|
413
|
-
'top-right': '',
|
|
414
|
-
bottom: '',
|
|
415
|
-
'bottom-mid': '',
|
|
416
|
-
'bottom-left': '',
|
|
417
|
-
'bottom-right': '',
|
|
418
|
-
left: '',
|
|
419
|
-
'left-mid': '',
|
|
420
|
-
mid: '',
|
|
421
|
-
'mid-mid': '',
|
|
422
|
-
right: '',
|
|
423
|
-
'right-mid': ''
|
|
424
|
-
},
|
|
425
|
-
style: {
|
|
426
|
-
'padding-left': 0,
|
|
427
|
-
'padding-right': 0
|
|
428
|
-
},
|
|
429
|
-
wordWrap: true
|
|
430
|
-
});
|
|
431
|
-
return table;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Helper function to determine the total depth of an object
|
|
436
|
-
* @param {Object} object input object
|
|
437
|
-
* @returns {Number} total depth of the input object
|
|
438
|
-
*/
|
|
439
|
-
function getObjectDepth(object) {
|
|
440
|
-
return Object(object) === object ? 1 + Math.max(-1, ...Object.values(object).map(getObjectDepth)) : 0;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Helper function to determine if an object has values
|
|
445
|
-
* @param {Object} object input object
|
|
446
|
-
* @returns {boolean} true of the object or any of its sub-objects contain values, false otherwise
|
|
447
|
-
*/
|
|
448
|
-
function hasValues(object) {
|
|
449
|
-
let has = false;
|
|
450
|
-
const keys = Object.keys(object);
|
|
451
|
-
for (const key of keys) {
|
|
452
|
-
if (Object(object[key]) !== object[key]) {
|
|
453
|
-
return true;
|
|
454
|
-
}
|
|
455
|
-
has = has || hasValues(object[key]);
|
|
456
|
-
}
|
|
457
|
-
return has;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Helper function (recursive) to add rows to an object table
|
|
462
|
-
* @param {object} object object to render
|
|
463
|
-
* @param {number} depth total depth of initial object
|
|
464
|
-
* @param {number} level current level
|
|
465
|
-
* @param {any} table the object table to add the rows to
|
|
466
|
-
* @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}
|
|
467
|
-
* @returns the updated object table
|
|
468
|
-
*/
|
|
469
|
-
function addRows(object, depth, level, table, keyMap) {
|
|
470
|
-
const space = ' ';
|
|
471
|
-
const keys = Object.keys(object);
|
|
472
|
-
for (const key of keys) {
|
|
473
|
-
if (Object(object[key]) !== object[key]) {
|
|
474
|
-
if (level === 1) {
|
|
475
|
-
table.push([keyMap[key] ? keyMap[key].brightCyan : key['brightCyan'], object[key]]);
|
|
476
|
-
} else {
|
|
477
|
-
table.push([{
|
|
478
|
-
hAlign: 'right',
|
|
479
|
-
content: keyMap[key] ? keyMap[key].gray : key.gray
|
|
480
|
-
}, object[key]]);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
for (const key of keys) {
|
|
485
|
-
if (Object(object[key]) === object[key]) {
|
|
486
|
-
// only print header if there are any values below
|
|
487
|
-
if (hasValues(object[key])) {
|
|
488
|
-
let indention = new Array(level).fill(space).join('');
|
|
489
|
-
if (level < 3) indention = `\n${indention}`;
|
|
490
|
-
table.push([indention.concat(keyMap[key] ? keyMap[key].brightCyan : key['brightCyan']), '']);
|
|
491
|
-
}
|
|
492
|
-
// eslint-disable-next-line no-param-reassign
|
|
493
|
-
table = addRows(object[key], depth, level + 1, table, keyMap);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return table;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Create and populate an object table from any JSON object. Use for describe commands.
|
|
501
|
-
* @param {Object} object JSON object to create
|
|
502
|
-
* @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}
|
|
503
|
-
* @returns {any} a table that can be printed to the console
|
|
504
|
-
*/
|
|
505
|
-
export function createObjectTable(object, keyMap = {}) {
|
|
506
|
-
// eslint-disable-next-line no-param-reassign
|
|
507
|
-
const depth = getObjectDepth(object);
|
|
508
|
-
// eslint-disable-next-line no-param-reassign
|
|
509
|
-
const level = 0;
|
|
510
|
-
// eslint-disable-next-line no-param-reassign
|
|
511
|
-
const table = new Table({
|
|
512
|
-
chars: {
|
|
513
|
-
top: '',
|
|
514
|
-
'top-mid': '',
|
|
515
|
-
'top-left': '',
|
|
516
|
-
'top-right': '',
|
|
517
|
-
bottom: '',
|
|
518
|
-
'bottom-mid': '',
|
|
519
|
-
'bottom-left': '',
|
|
520
|
-
'bottom-right': '',
|
|
521
|
-
left: '',
|
|
522
|
-
'left-mid': '',
|
|
523
|
-
mid: '',
|
|
524
|
-
'mid-mid': '',
|
|
525
|
-
right: '',
|
|
526
|
-
'right-mid': ''
|
|
527
|
-
},
|
|
528
|
-
style: {
|
|
529
|
-
'padding-left': 0,
|
|
530
|
-
'padding-right': 0,
|
|
531
|
-
head: ['brightCyan']
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
addRows(object, depth, level + 1, table, keyMap);
|
|
535
|
-
return table;
|
|
536
|
-
}
|
|
537
|
-
//# sourceMappingURL=Console.js.map
|
package/esm/utils/Console.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Console.js","names":["frodo","state","MultiBar","Presets","createSpinner","Table","Color","enable","appendTextToFile","utils","impex","multiBarContainer","progressBar","spinner","data","message","newline","getOutputFile","JSON","stringify","console","dir","depth","log","process","stdout","write","text","error","stderr","info","warn","debug","curlirize","verboseMessage","getVerbose","debugMessage","getDebug","curlirizeMessage","getCurlirize","printMessage","type","createProgressBar","total","options","format","noTTYOutput","opt","legacy","create","updateProgressBar","increment","stopProgressBar","update","stop","showSpinner","start","stopSpinner","succeedSpinner","success","warnSpinner","failSpinner","spinSpinner","spin","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","status","createTable","head","table","chars","top","bottom","left","mid","right","style","createKeyValueTable","wordWrap","getObjectDepth","object","Object","Math","max","values","map","hasValues","has","keys","key","addRows","level","keyMap","space","push","brightCyan","hAlign","content","gray","indention","Array","fill","join","concat","createObjectTable"],"sources":["../../src/utils/Console.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { frodo, state } from '@rockcarver/frodo-lib';\nimport { MultiBar, Presets } from 'cli-progress';\nimport { createSpinner } from 'nanospinner';\nimport Table from 'cli-table3';\nimport Color from 'colors';\n\nColor.enable();\n\nconst { appendTextToFile } = frodo.utils.impex;\n\nlet multiBarContainer = null;\nlet progressBar = null;\nlet spinner = null;\n\n/**\n * Output a message in default color to stdout or append to `state.getOutputFile()`\n * @param {string | object} message the message\n */\nfunction data(message: string | object, newline = true) {\n if (!message) return;\n if (state.getOutputFile()) {\n if (typeof message === 'object') {\n message = JSON.stringify(message, null, 2);\n }\n if (newline) {\n message += '\\n';\n }\n appendTextToFile(message, state.getOutputFile());\n } else if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.log(message);\n } else {\n process.stdout.write(message);\n }\n}\n\n/**\n * Output a default color message to stderr\n * @param {Object} message the message\n */\nfunction text(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message);\n } else {\n process.stderr.write(message);\n }\n}\n\n/**\n * Output a message in bright cyan to stderr\n * @param {Object} message the message\n */\nfunction info(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['brightCyan']);\n } else {\n process.stderr.write(message['brightCyan']);\n }\n}\n\n/**\n * Output a message in yellow to stderr\n * @param {Object} message the message\n */\nfunction warn(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['yellow']);\n } else {\n process.stderr.write(message['yellow']);\n }\n}\n\n/**\n * Output a message in bright red to stderr\n * @param {Object} message the message\n */\nfunction error(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['brightRed']);\n } else {\n process.stderr.write(message['brightRed']);\n }\n}\n\n/**\n * Output a debug message\n * @param {string | object} message the message\n */\nfunction debug(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 6 });\n } else if (newline) {\n console.error(message['brightMagenta']);\n } else {\n process.stderr.write(message['brightMagenta']);\n }\n}\n\n/**\n * Output a curlirize message\n * @param {string} message the message\n */\nfunction curlirize(message: string) {\n if (!message) return;\n console.error(message['brightBlue']);\n}\n\n/**\n * Output a message in default color to stderr\n * @param {Object} message the message\n */\nexport function verboseMessage(message) {\n if (!message) return;\n if (state.getVerbose()) {\n text(message);\n }\n}\n\n/**\n * Output a debug message\n * @param {Object} message the message\n */\nexport function debugMessage(message) {\n if (!message) return;\n if (state.getDebug()) {\n debug(message);\n }\n}\n\n/**\n * Output a curlirize message\n * @param {Object} message the message\n */\nexport function curlirizeMessage(message) {\n if (!message) return;\n if (state.getCurlirize()) {\n curlirize(message);\n }\n}\n\n/**\n * Prints a string message to console\n *\n * @param {string} message The string message to print\n * @param {string} [type=text] \"text\", \"info\", \"warn\", \"error\" or \"data\". All but\n * type=\"data\" will be written to stderr.\n * @param {boolean} [newline=true] Whether to add a newline at the end of message\n *\n */\nexport function printMessage(message, type = 'text', newline = true) {\n switch (type) {\n case 'data':\n data(message, newline);\n break;\n case 'text':\n text(message, newline);\n break;\n case 'info':\n info(message, newline);\n break;\n case 'warn':\n warn(message, newline);\n break;\n case 'error':\n error(message, newline);\n break;\n default:\n text(message, newline);\n }\n}\n\n/**\n * Creates a progress bar on stderr\n *\n * Example:\n * [========================================] 100% | 49/49 | Analyzing journey - transactional_auth\n *\n * @param {Number} total The total number of entries to track progress for\n * @param {String} message optional progress bar message\n * @param {Object} options progress bar configuration options\n *\n */\nexport function createProgressBar(\n total,\n message = null,\n options = {\n format: '[{bar}] {percentage}% | {value}/{total} | {data}',\n noTTYOutput: true,\n }\n) {\n let opt = options;\n if (message == null) {\n opt = {\n format: '[{bar}] {percentage}% | {value}/{total}',\n noTTYOutput: true,\n };\n }\n // progressBar = new SingleBar(opt, Presets.legacy); // create only when needed\n // progressBar.start(total, 0, {\n // data: message,\n // });\n multiBarContainer = new MultiBar(opt, Presets.legacy);\n progressBar = multiBarContainer.create(total, 0, {\n data: message,\n });\n}\n\n/**\n * Updates the progress bar by 1\n * @param {string} message optional message to update the progress bar\n *\n */\nexport function updateProgressBar(message = null) {\n if (message)\n progressBar.increment({\n data: message,\n });\n else progressBar.increment();\n}\n\n/**\n * Stop and hide the progress bar\n * @param {*} message optional message to update the progress bar\n */\nexport function stopProgressBar(message = null) {\n if (message)\n progressBar.update({\n data: message,\n });\n // progressBar.stop();\n multiBarContainer.stop();\n multiBarContainer = null;\n}\n\n/**\n * Create the spinner\n * @param {String} message optional spinner message\n */\nexport function showSpinner(message) {\n spinner = createSpinner(message).start();\n}\n\n/**\n * Stop the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function stopSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.stop(options);\n }\n}\n\n/**\n * Succeed the spinner. Stop and render success checkmark with optional message.\n * @param {String} message optional message to update the spinner\n */\nexport function succeedSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.success(options);\n }\n}\n\n/**\n * Warn the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function warnSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.warn(options);\n }\n}\n\n/**\n * Fail the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function failSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.error(options);\n }\n}\n\n/**\n * Spin the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function spinSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.update(options);\n spinner.spin();\n }\n}\n\nexport function createProgressIndicator(\n type = 'determinate',\n total = 0,\n message = null\n) {\n if (type === 'determinate') {\n createProgressBar(total, message);\n } else {\n showSpinner(message);\n }\n}\n\nexport function updateProgressIndicator(message) {\n if (!progressBar) {\n spinSpinner(message);\n } else {\n updateProgressBar(message);\n }\n}\n\nexport function stopProgressIndicator(message, status = 'none') {\n if (!progressBar) {\n switch (status) {\n case 'none':\n stopSpinner(message);\n break;\n case 'success':\n succeedSpinner(message);\n break;\n case 'warn':\n warnSpinner(message);\n break;\n case 'fail':\n failSpinner(message);\n break;\n default:\n stopSpinner(message);\n break;\n }\n } else {\n stopProgressBar(message);\n }\n}\n\n/**\n * Create an empty table\n * @param {string[]} head header row as an array of strings\n * @returns {any} an empty table\n */\nexport function createTable(head) {\n const table = new Table({\n head,\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0, head: ['brightCyan'] },\n });\n return table;\n}\n\n/**\n * Create a new key/value table\n * @returns {any} an empty key/value table\n */\nexport function createKeyValueTable() {\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n wordWrap: true,\n });\n return table;\n}\n\n/**\n * Helper function to determine the total depth of an object\n * @param {Object} object input object\n * @returns {Number} total depth of the input object\n */\nfunction getObjectDepth(object) {\n return Object(object) === object\n ? 1 + Math.max(-1, ...Object.values(object).map(getObjectDepth))\n : 0;\n}\n\n/**\n * Helper function to determine if an object has values\n * @param {Object} object input object\n * @returns {boolean} true of the object or any of its sub-objects contain values, false otherwise\n */\nfunction hasValues(object) {\n let has = false;\n const keys = Object.keys(object);\n for (const key of keys) {\n if (Object(object[key]) !== object[key]) {\n return true;\n }\n has = has || hasValues(object[key]);\n }\n return has;\n}\n\n/**\n * Helper function (recursive) to add rows to an object table\n * @param {object} object object to render\n * @param {number} depth total depth of initial object\n * @param {number} level current level\n * @param {any} table the object table to add the rows to\n * @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}\n * @returns the updated object table\n */\nfunction addRows(object, depth, level, table, keyMap) {\n const space = ' ';\n const keys = Object.keys(object);\n for (const key of keys) {\n if (Object(object[key]) !== object[key]) {\n if (level === 1) {\n table.push([\n keyMap[key] ? keyMap[key].brightCyan : key['brightCyan'],\n object[key],\n ]);\n } else {\n table.push([\n {\n hAlign: 'right',\n content: keyMap[key] ? keyMap[key].gray : key.gray,\n },\n object[key],\n ]);\n }\n }\n }\n for (const key of keys) {\n if (Object(object[key]) === object[key]) {\n // only print header if there are any values below\n if (hasValues(object[key])) {\n let indention = new Array(level).fill(space).join('');\n if (level < 3) indention = `\\n${indention}`;\n table.push([\n indention.concat(\n keyMap[key] ? keyMap[key].brightCyan : key['brightCyan']\n ),\n '',\n ]);\n }\n // eslint-disable-next-line no-param-reassign\n table = addRows(object[key], depth, level + 1, table, keyMap);\n }\n }\n return table;\n}\n\n/**\n * Create and populate an object table from any JSON object. Use for describe commands.\n * @param {Object} object JSON object to create\n * @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}\n * @returns {any} a table that can be printed to the console\n */\nexport function createObjectTable(object, keyMap = {}) {\n // eslint-disable-next-line no-param-reassign\n const depth = getObjectDepth(object);\n // eslint-disable-next-line no-param-reassign\n const level = 0;\n // eslint-disable-next-line no-param-reassign\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0, head: ['brightCyan'] },\n });\n addRows(object, depth, level + 1, table, keyMap);\n return table;\n}\n"],"mappings":"AAAA;AACA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,QAAQ,EAAEC,OAAO,QAAQ,cAAc;AAChD,SAASC,aAAa,QAAQ,aAAa;AAC3C,OAAOC,KAAK,MAAM,YAAY;AAC9B,OAAOC,KAAK,MAAM,QAAQ;AAE1BA,KAAK,CAACC,MAAM,CAAC,CAAC;AAEd,MAAM;EAAEC;AAAiB,CAAC,GAAGR,KAAK,CAACS,KAAK,CAACC,KAAK;AAE9C,IAAIC,iBAAiB,GAAG,IAAI;AAC5B,IAAIC,WAAW,GAAG,IAAI;AACtB,IAAIC,OAAO,GAAG,IAAI;;AAElB;AACA;AACA;AACA;AACA,SAASC,IAAIA,CAACC,OAAwB,EAAEC,OAAO,GAAG,IAAI,EAAE;EACtD,IAAI,CAACD,OAAO,EAAE;EACd,IAAId,KAAK,CAACgB,aAAa,CAAC,CAAC,EAAE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A;AACA,OAAO,SAASmC,iBAAiBA,CAACxB,MAAM,EAAEY,MAAM,GAAG,CAAC,CAAC,EAAE;EACrD;EACA,MAAMvE,KAAK,GAAG0D,cAAc,CAACC,MAAM,CAAC;EACpC;EACA,MAAMW,KAAK,GAAG,CAAC;EACf;EACA,MAAMtB,KAAK,GAAG,IAAIjE,KAAK,CAAC;IACtBkE,KAAK,EAAE;MACLC,GAAG,EAAE,EAAE;MACP,SAAS,EAAE,EAAE;MACb,UAAU,EAAE,EAAE;MACd,WAAW,EAAE,EAAE;MACfC,MAAM,EAAE,EAAE;MACV,YAAY,EAAE,EAAE;MAChB,aAAa,EAAE,EAAE;MACjB,cAAc,EAAE,EAAE;MAClBC,IAAI,EAAE,EAAE;MACR,UAAU,EAAE,EAAE;MACdC,GAAG,EAAE,EAAE;MACP,SAAS,EAAE,EAAE;MACbC,KAAK,EAAE,EAAE;MACT,WAAW,EAAE;IACf,CAAC;IACDC,KAAK,EAAE;MAAE,cAAc,EAAE,CAAC;MAAE,eAAe,EAAE,CAAC;MAAER,IAAI,EAAE,CAAC,YAAY;IAAE;EACvE,CAAC,CAAC;EACFsB,OAAO,CAACV,MAAM,EAAE3D,KAAK,EAAEsE,KAAK,GAAG,CAAC,EAAEtB,KAAK,EAAEuB,MAAM,CAAC;EAChD,OAAOvB,KAAK;AACd"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import slugify from 'slugify';
|
|
4
|
-
import { printMessage } from './Console';
|
|
5
|
-
const {
|
|
6
|
-
getMetadata
|
|
7
|
-
} = frodo.utils.impex;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get a typed filename. E.g. "my-script.script.json"
|
|
11
|
-
*
|
|
12
|
-
* @param name The name of the file
|
|
13
|
-
* @param type The type of the file, e.g. script, idp, etc.
|
|
14
|
-
* @param suffix The suffix of the file, e.g. json, xml, etc. Defaults to json.
|
|
15
|
-
* @returns The typed filename
|
|
16
|
-
*/
|
|
17
|
-
export function getTypedFilename(name, type, suffix = 'json') {
|
|
18
|
-
const slug = slugify(name.replace(/^http(s?):\/\//, ''));
|
|
19
|
-
return `${slug}.${type}.${suffix}`;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Save JSON object to file
|
|
24
|
-
*
|
|
25
|
-
* @param data data object
|
|
26
|
-
* @param filename file name
|
|
27
|
-
*/
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
export function saveJsonToFile(data, filename) {
|
|
30
|
-
const exportData = data;
|
|
31
|
-
if (!exportData.meta) {
|
|
32
|
-
exportData.meta = getMetadata();
|
|
33
|
-
}
|
|
34
|
-
fs.writeFile(filename, JSON.stringify(exportData, null, 2), err => {
|
|
35
|
-
if (err) {
|
|
36
|
-
return printMessage(`ERROR - can't save ${filename}`, 'error');
|
|
37
|
-
}
|
|
38
|
-
return '';
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export function saveToFile(type, data, identifier, filename) {
|
|
42
|
-
const exportData = {};
|
|
43
|
-
exportData['meta'] = getMetadata();
|
|
44
|
-
exportData[type] = {};
|
|
45
|
-
if (Array.isArray(data)) {
|
|
46
|
-
data.forEach(element => {
|
|
47
|
-
exportData[type][element[identifier]] = element;
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
exportData[type][data[identifier]] = data;
|
|
51
|
-
}
|
|
52
|
-
fs.writeFile(filename, JSON.stringify(exportData, null, 2), err => {
|
|
53
|
-
if (err) {
|
|
54
|
-
return printMessage(`ERROR - can't save ${type} to file`, 'error');
|
|
55
|
-
}
|
|
56
|
-
return '';
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Save text data to file
|
|
62
|
-
* @param data text data
|
|
63
|
-
* @param filename file name
|
|
64
|
-
* @return true if successful, false otherwise
|
|
65
|
-
*/
|
|
66
|
-
export function saveTextToFile(data, filename) {
|
|
67
|
-
try {
|
|
68
|
-
fs.writeFileSync(filename, data);
|
|
69
|
-
return true;
|
|
70
|
-
} catch (error) {
|
|
71
|
-
printMessage(`ERROR - can't save ${filename}`, 'error');
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/*
|
|
77
|
-
* Output str in title case
|
|
78
|
-
*
|
|
79
|
-
* e.g.: 'ALL UPPERCASE AND all lowercase' = 'All Uppercase And All Lowercase'
|
|
80
|
-
*/
|
|
81
|
-
export function titleCase(input) {
|
|
82
|
-
const str = input.toString();
|
|
83
|
-
const splitStr = str.toLowerCase().split(' ');
|
|
84
|
-
for (let i = 0; i < splitStr.length; i += 1) {
|
|
85
|
-
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);
|
|
86
|
-
}
|
|
87
|
-
return splitStr.join(' ');
|
|
88
|
-
}
|
|
89
|
-
export function getRealmString() {
|
|
90
|
-
const realm = state.getRealm();
|
|
91
|
-
return realm.split('/').reduce((result, item) => `${result}${titleCase(item)}`, '');
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=ExportImportUtils.js.map
|