@rockcarver/frodo-cli 2.0.0-2 → 2.0.0-21
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 +186 -3
- package/esm/app.js +14 -5
- package/esm/app.js.map +1 -1
- package/esm/cli/FrodoCommand.js +18 -4
- package/esm/cli/FrodoCommand.js.map +1 -1
- package/esm/cli/_template/something-delete.js +7 -4
- package/esm/cli/_template/something-delete.js.map +1 -1
- package/esm/cli/_template/something-describe.js +7 -4
- package/esm/cli/_template/something-describe.js.map +1 -1
- package/esm/cli/_template/something-else-delete.js +7 -4
- package/esm/cli/_template/something-else-delete.js.map +1 -1
- package/esm/cli/_template/something-else-describe.js +7 -4
- package/esm/cli/_template/something-else-describe.js.map +1 -1
- package/esm/cli/_template/something-else-export.js +7 -4
- package/esm/cli/_template/something-else-export.js.map +1 -1
- package/esm/cli/_template/something-else-import.js +7 -4
- package/esm/cli/_template/something-else-import.js.map +1 -1
- package/esm/cli/_template/something-else-list.js +7 -4
- package/esm/cli/_template/something-else-list.js.map +1 -1
- package/esm/cli/_template/something-else.js +1 -1
- package/esm/cli/_template/something-else.js.map +1 -1
- package/esm/cli/_template/something-export.js +7 -4
- package/esm/cli/_template/something-export.js.map +1 -1
- package/esm/cli/_template/something-import.js +7 -4
- package/esm/cli/_template/something-import.js.map +1 -1
- package/esm/cli/_template/something-list.js +7 -4
- package/esm/cli/_template/something-list.js.map +1 -1
- package/esm/cli/_template/something-other-delete.js +7 -4
- package/esm/cli/_template/something-other-delete.js.map +1 -1
- package/esm/cli/_template/something-other-describe.js +7 -4
- package/esm/cli/_template/something-other-describe.js.map +1 -1
- package/esm/cli/_template/something-other-export.js +7 -4
- package/esm/cli/_template/something-other-export.js.map +1 -1
- package/esm/cli/_template/something-other-import.js +7 -4
- package/esm/cli/_template/something-other-import.js.map +1 -1
- package/esm/cli/_template/something-other-list.js +7 -4
- package/esm/cli/_template/something-other-list.js.map +1 -1
- package/esm/cli/_template/something-other.js +1 -1
- package/esm/cli/_template/something-other.js.map +1 -1
- package/esm/cli/_template/something.js +2 -2
- package/esm/cli/_template/something.js.map +1 -1
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +10 -4
- 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 +14 -7
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-federation-export.js +45 -0
- package/esm/cli/admin/admin-federation-export.js.map +1 -0
- package/esm/cli/admin/admin-federation-import.js +49 -0
- package/esm/cli/admin/admin-federation-import.js.map +1 -0
- package/esm/cli/admin/admin-federation-list.js +29 -0
- package/esm/cli/admin/admin-federation-list.js.map +1 -0
- package/esm/cli/admin/admin-federation.js +13 -0
- package/esm/cli/admin/admin-federation.js.map +1 -0
- package/esm/cli/admin/admin-get-access-token.js +12 -6
- package/esm/cli/admin/admin-get-access-token.js.map +1 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +12 -6
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js +11 -5
- 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 +10 -4
- 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 +10 -4
- 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 +11 -5
- package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js +12 -5
- package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-repair-org-model.js +11 -5
- package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +12 -6
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js +11 -5
- package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
- package/esm/cli/admin/admin.js +3 -2
- package/esm/cli/admin/admin.js.map +1 -1
- package/esm/cli/agent/agent-delete.js +13 -6
- package/esm/cli/agent/agent-delete.js.map +1 -1
- package/esm/cli/agent/agent-describe.js +7 -4
- package/esm/cli/agent/agent-describe.js.map +1 -1
- package/esm/cli/agent/agent-export.js +8 -5
- package/esm/cli/agent/agent-export.js.map +1 -1
- package/esm/cli/agent/agent-gateway-delete.js +13 -6
- package/esm/cli/agent/agent-gateway-delete.js.map +1 -1
- package/esm/cli/agent/agent-gateway-describe.js +7 -4
- package/esm/cli/agent/agent-gateway-describe.js.map +1 -1
- package/esm/cli/agent/agent-gateway-export.js +8 -5
- package/esm/cli/agent/agent-gateway-export.js.map +1 -1
- package/esm/cli/agent/agent-gateway-import.js +8 -5
- package/esm/cli/agent/agent-gateway-import.js.map +1 -1
- package/esm/cli/agent/agent-gateway-list.js +7 -4
- package/esm/cli/agent/agent-gateway-list.js.map +1 -1
- package/esm/cli/agent/agent-gateway.js +1 -1
- package/esm/cli/agent/agent-gateway.js.map +1 -1
- package/esm/cli/agent/agent-import.js +8 -5
- package/esm/cli/agent/agent-import.js.map +1 -1
- package/esm/cli/agent/agent-java-delete.js +13 -6
- package/esm/cli/agent/agent-java-delete.js.map +1 -1
- package/esm/cli/agent/agent-java-describe.js +7 -4
- package/esm/cli/agent/agent-java-describe.js.map +1 -1
- package/esm/cli/agent/agent-java-export.js +8 -5
- package/esm/cli/agent/agent-java-export.js.map +1 -1
- package/esm/cli/agent/agent-java-import.js +8 -5
- package/esm/cli/agent/agent-java-import.js.map +1 -1
- package/esm/cli/agent/agent-java-list.js +7 -4
- package/esm/cli/agent/agent-java-list.js.map +1 -1
- package/esm/cli/agent/agent-java.js +1 -1
- package/esm/cli/agent/agent-java.js.map +1 -1
- package/esm/cli/agent/agent-list.js +7 -4
- package/esm/cli/agent/agent-list.js.map +1 -1
- package/esm/cli/agent/agent-web-delete.js +13 -6
- package/esm/cli/agent/agent-web-delete.js.map +1 -1
- package/esm/cli/agent/agent-web-describe.js +7 -4
- package/esm/cli/agent/agent-web-describe.js.map +1 -1
- package/esm/cli/agent/agent-web-export.js +8 -5
- package/esm/cli/agent/agent-web-export.js.map +1 -1
- package/esm/cli/agent/agent-web-import.js +8 -5
- package/esm/cli/agent/agent-web-import.js.map +1 -1
- package/esm/cli/agent/agent-web-list.js +7 -4
- package/esm/cli/agent/agent-web-list.js.map +1 -1
- package/esm/cli/agent/agent-web.js +1 -1
- package/esm/cli/agent/agent-web.js.map +1 -1
- package/esm/cli/agent/agent.js +2 -2
- package/esm/cli/agent/agent.js.map +1 -1
- package/esm/cli/app/app-delete.js +27 -8
- package/esm/cli/app/app-delete.js.map +1 -1
- package/esm/cli/app/app-describe.js +9 -5
- package/esm/cli/app/app-describe.js.map +1 -1
- package/esm/cli/app/app-export.js +17 -13
- package/esm/cli/app/app-export.js.map +1 -1
- package/esm/cli/app/app-import.js +21 -17
- package/esm/cli/app/app-import.js.map +1 -1
- package/esm/cli/app/app-list.js +12 -8
- package/esm/cli/app/app-list.js.map +1 -1
- package/esm/cli/app/app.js +8 -12
- package/esm/cli/app/app.js.map +1 -1
- package/esm/cli/authz/authz-policy-delete.js +10 -7
- package/esm/cli/authz/authz-policy-delete.js.map +1 -1
- package/esm/cli/authz/authz-policy-describe.js +8 -5
- package/esm/cli/authz/authz-policy-describe.js.map +1 -1
- package/esm/cli/authz/authz-policy-export.js +12 -9
- package/esm/cli/authz/authz-policy-export.js.map +1 -1
- package/esm/cli/authz/authz-policy-import.js +10 -7
- package/esm/cli/authz/authz-policy-import.js.map +1 -1
- package/esm/cli/authz/authz-policy-list.js +9 -6
- package/esm/cli/authz/authz-policy-list.js.map +1 -1
- package/esm/cli/authz/authz-policy.js +1 -1
- package/esm/cli/authz/authz-policy.js.map +1 -1
- package/esm/cli/authz/authz-set-delete.js +9 -6
- package/esm/cli/authz/authz-set-delete.js.map +1 -1
- package/esm/cli/authz/authz-set-describe.js +8 -5
- package/esm/cli/authz/authz-set-describe.js.map +1 -1
- package/esm/cli/authz/authz-set-export.js +10 -7
- package/esm/cli/authz/authz-set-export.js.map +1 -1
- package/esm/cli/authz/authz-set-import.js +10 -7
- package/esm/cli/authz/authz-set-import.js.map +1 -1
- package/esm/cli/authz/authz-set-list.js +7 -4
- package/esm/cli/authz/authz-set-list.js.map +1 -1
- package/esm/cli/authz/authz-set.js +1 -1
- package/esm/cli/authz/authz-set.js.map +1 -1
- package/esm/cli/authz/authz-type-delete.js +10 -7
- package/esm/cli/authz/authz-type-delete.js.map +1 -1
- package/esm/cli/authz/authz-type-describe.js +9 -6
- package/esm/cli/authz/authz-type-describe.js.map +1 -1
- package/esm/cli/authz/authz-type-export.js +11 -8
- package/esm/cli/authz/authz-type-export.js.map +1 -1
- package/esm/cli/authz/authz-type-import.js +12 -9
- package/esm/cli/authz/authz-type-import.js.map +1 -1
- package/esm/cli/authz/authz-type-list.js +8 -5
- package/esm/cli/authz/authz-type-list.js.map +1 -1
- package/esm/cli/authz/authz-type.js +1 -1
- package/esm/cli/authz/authz-type.js.map +1 -1
- package/esm/cli/authz/authz.js +2 -2
- package/esm/cli/authz/authz.js.map +1 -1
- package/esm/cli/conn/conn-delete.js +2 -2
- package/esm/cli/conn/conn-delete.js.map +1 -1
- package/esm/cli/conn/conn-describe.js +2 -2
- package/esm/cli/conn/conn-describe.js.map +1 -1
- package/esm/cli/conn/conn-list.js +2 -2
- package/esm/cli/conn/conn-list.js.map +1 -1
- package/esm/cli/conn/conn-save.js +31 -15
- package/esm/cli/conn/conn-save.js.map +1 -1
- package/esm/cli/conn/conn.js +2 -2
- package/esm/cli/conn/conn.js.map +1 -1
- package/esm/cli/email/email-template-export.js +10 -7
- package/esm/cli/email/email-template-export.js.map +1 -1
- package/esm/cli/email/email-template-import.js +11 -8
- package/esm/cli/email/email-template-import.js.map +1 -1
- package/esm/cli/email/email-template-list.js +8 -5
- package/esm/cli/email/email-template-list.js.map +1 -1
- package/esm/cli/email/email-template.js +1 -1
- package/esm/cli/email/email-template.js.map +1 -1
- package/esm/cli/email/email.js +2 -2
- package/esm/cli/email/email.js.map +1 -1
- package/esm/cli/esv/esv-apply.js +18 -8
- package/esm/cli/esv/esv-apply.js.map +1 -1
- package/esm/cli/esv/esv-secret-create.js +8 -5
- package/esm/cli/esv/esv-secret-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-delete.js +9 -6
- package/esm/cli/esv/esv-secret-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-describe.js +8 -5
- package/esm/cli/esv/esv-secret-describe.js.map +1 -1
- package/esm/cli/esv/esv-secret-export.js +7 -4
- package/esm/cli/esv/esv-secret-export.js.map +1 -1
- package/esm/cli/esv/esv-secret-import.js +7 -4
- package/esm/cli/esv/esv-secret-import.js.map +1 -1
- package/esm/cli/esv/esv-secret-list.js +8 -5
- package/esm/cli/esv/esv-secret-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-set.js +8 -5
- package/esm/cli/esv/esv-secret-set.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-activate.js +8 -5
- package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-create.js +9 -6
- package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-deactivate.js +8 -5
- package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-delete.js +9 -6
- package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-list.js +8 -5
- package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-version.js +1 -1
- package/esm/cli/esv/esv-secret-version.js.map +1 -1
- package/esm/cli/esv/esv-secret.js +1 -1
- package/esm/cli/esv/esv-secret.js.map +1 -1
- package/esm/cli/esv/esv-variable-create.js +10 -6
- package/esm/cli/esv/esv-variable-create.js.map +1 -1
- package/esm/cli/esv/esv-variable-delete.js +9 -6
- package/esm/cli/esv/esv-variable-delete.js.map +1 -1
- package/esm/cli/esv/esv-variable-describe.js +8 -5
- package/esm/cli/esv/esv-variable-describe.js.map +1 -1
- package/esm/cli/esv/esv-variable-export.js +7 -4
- package/esm/cli/esv/esv-variable-export.js.map +1 -1
- package/esm/cli/esv/esv-variable-import.js +7 -4
- package/esm/cli/esv/esv-variable-import.js.map +1 -1
- package/esm/cli/esv/esv-variable-list.js +8 -5
- package/esm/cli/esv/esv-variable-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-set.js +8 -5
- package/esm/cli/esv/esv-variable-set.js.map +1 -1
- package/esm/cli/esv/esv-variable.js +1 -1
- package/esm/cli/esv/esv-variable.js.map +1 -1
- package/esm/cli/esv/esv.js +2 -2
- package/esm/cli/esv/esv.js.map +1 -1
- package/esm/cli/idm/idm-count.js +9 -6
- package/esm/cli/idm/idm-count.js.map +1 -1
- package/esm/cli/idm/idm-export.js +10 -7
- package/esm/cli/idm/idm-export.js.map +1 -1
- package/esm/cli/idm/idm-import.js +11 -8
- package/esm/cli/idm/idm-import.js.map +1 -1
- package/esm/cli/idm/idm-list.js +7 -4
- package/esm/cli/idm/idm-list.js.map +1 -1
- package/esm/cli/idm/idm.js +2 -2
- package/esm/cli/idm/idm.js.map +1 -1
- package/esm/cli/idp/idp-export.js +11 -8
- package/esm/cli/idp/idp-export.js.map +1 -1
- package/esm/cli/idp/idp-import.js +15 -12
- package/esm/cli/idp/idp-import.js.map +1 -1
- package/esm/cli/idp/idp-list.js +7 -4
- package/esm/cli/idp/idp-list.js.map +1 -1
- package/esm/cli/idp/idp.js +2 -2
- package/esm/cli/idp/idp.js.map +1 -1
- package/esm/cli/info/info.js +16 -10
- package/esm/cli/info/info.js.map +1 -1
- package/esm/cli/journey/journey-delete.js +8 -5
- package/esm/cli/journey/journey-delete.js.map +1 -1
- package/esm/cli/journey/journey-describe.js +18 -10
- package/esm/cli/journey/journey-describe.js.map +1 -1
- package/esm/cli/journey/journey-disable.js +12 -6
- package/esm/cli/journey/journey-disable.js.map +1 -1
- package/esm/cli/journey/journey-enable.js +12 -6
- package/esm/cli/journey/journey-enable.js.map +1 -1
- package/esm/cli/journey/journey-export.js +10 -7
- package/esm/cli/journey/journey-export.js.map +1 -1
- package/esm/cli/journey/journey-import.js +11 -8
- package/esm/cli/journey/journey-import.js.map +1 -1
- package/esm/cli/journey/journey-list.js +6 -3
- package/esm/cli/journey/journey-list.js.map +1 -1
- package/esm/cli/journey/journey-prune.js +23 -12
- package/esm/cli/journey/journey-prune.js.map +1 -1
- package/esm/cli/journey/journey.js +2 -2
- package/esm/cli/journey/journey.js.map +1 -1
- package/esm/cli/{logging/logs-fetch.js → log/log-fetch.js} +68 -36
- package/esm/cli/log/log-fetch.js.map +1 -0
- package/esm/cli/log/log-key-delete.js +35 -0
- package/esm/cli/log/log-key-delete.js.map +1 -0
- package/esm/cli/log/log-key-describe.js +22 -0
- package/esm/cli/log/log-key-describe.js.map +1 -0
- package/esm/cli/log/log-key-list.js +26 -0
- package/esm/cli/log/log-key-list.js.map +1 -0
- package/esm/cli/log/log-key.js +8 -0
- package/esm/cli/log/log-key.js.map +1 -0
- package/esm/cli/log/log-list.js +80 -0
- package/esm/cli/log/log-list.js.map +1 -0
- package/esm/cli/log/log-tail.js +77 -0
- package/esm/cli/log/log-tail.js.map +1 -0
- package/esm/cli/{logging/logs.js → log/log.js} +6 -3
- package/esm/cli/log/log.js.map +1 -0
- package/esm/cli/oauth/oauth-client-delete.js +22 -0
- package/esm/cli/oauth/oauth-client-delete.js.map +1 -0
- package/esm/cli/oauth/oauth-client-describe.js +22 -0
- package/esm/cli/oauth/oauth-client-describe.js.map +1 -0
- package/esm/cli/oauth/oauth-client-export.js +52 -0
- package/esm/cli/oauth/oauth-client-export.js.map +1 -0
- package/esm/cli/oauth/oauth-client-import.js +57 -0
- package/esm/cli/oauth/oauth-client-import.js.map +1 -0
- package/esm/cli/oauth/oauth-client-list.js +25 -0
- package/esm/cli/oauth/oauth-client-list.js.map +1 -0
- package/esm/cli/oauth/oauth-client.js +14 -0
- package/esm/cli/oauth/oauth-client.js.map +1 -0
- package/esm/cli/oauth/oauth.js +13 -0
- package/esm/cli/oauth/oauth.js.map +1 -0
- package/esm/cli/realm/realm-add-custom-domain.js +8 -5
- package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
- package/esm/cli/realm/realm-describe.js +8 -5
- package/esm/cli/realm/realm-describe.js.map +1 -1
- package/esm/cli/realm/realm-list.js +8 -5
- package/esm/cli/realm/realm-list.js.map +1 -1
- package/esm/cli/realm/realm-remove-custom-domain.js +11 -5
- package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
- package/esm/cli/realm/realm.js +2 -2
- package/esm/cli/realm/realm.js.map +1 -1
- package/esm/cli/saml/saml-cot-export.js +10 -7
- package/esm/cli/saml/saml-cot-export.js.map +1 -1
- package/esm/cli/saml/saml-cot-import.js +11 -8
- package/esm/cli/saml/saml-cot-import.js.map +1 -1
- package/esm/cli/saml/saml-cot-list.js +8 -5
- package/esm/cli/saml/saml-cot-list.js.map +1 -1
- package/esm/cli/saml/saml-cot.js +1 -1
- package/esm/cli/saml/saml-cot.js.map +1 -1
- package/esm/cli/saml/saml-delete.js +14 -7
- package/esm/cli/saml/saml-delete.js.map +1 -1
- package/esm/cli/saml/saml-describe.js +8 -5
- package/esm/cli/saml/saml-describe.js.map +1 -1
- package/esm/cli/saml/saml-export.js +10 -7
- package/esm/cli/saml/saml-export.js.map +1 -1
- package/esm/cli/saml/saml-import.js +11 -8
- package/esm/cli/saml/saml-import.js.map +1 -1
- package/esm/cli/saml/saml-list.js +8 -5
- package/esm/cli/saml/saml-list.js.map +1 -1
- package/esm/cli/saml/saml-metadata-export.js +9 -6
- package/esm/cli/saml/saml-metadata-export.js.map +1 -1
- package/esm/cli/saml/saml-metadata.js +1 -1
- package/esm/cli/saml/saml-metadata.js.map +1 -1
- package/esm/cli/saml/saml.js +2 -2
- package/esm/cli/saml/saml.js.map +1 -1
- package/esm/cli/script/script-delete.js +7 -4
- package/esm/cli/script/script-delete.js.map +1 -1
- package/esm/cli/script/script-describe.js +7 -4
- package/esm/cli/script/script-describe.js.map +1 -1
- package/esm/cli/script/script-export.js +8 -5
- package/esm/cli/script/script-export.js.map +1 -1
- package/esm/cli/script/script-import.js +9 -6
- package/esm/cli/script/script-import.js.map +1 -1
- package/esm/cli/script/script-list.js +8 -5
- package/esm/cli/script/script-list.js.map +1 -1
- package/esm/cli/script/script.js +2 -2
- package/esm/cli/script/script.js.map +1 -1
- package/esm/cli/service/service-delete.js +8 -5
- package/esm/cli/service/service-delete.js.map +1 -1
- package/esm/cli/service/service-export.js +9 -6
- package/esm/cli/service/service-export.js.map +1 -1
- package/esm/cli/service/service-import.js +10 -7
- package/esm/cli/service/service-import.js.map +1 -1
- package/esm/cli/service/service-list.js +7 -4
- package/esm/cli/service/service-list.js.map +1 -1
- package/esm/cli/service/service.js +2 -2
- package/esm/cli/service/service.js.map +1 -1
- package/esm/cli/shell/shell.js +57 -0
- package/esm/cli/shell/shell.js.map +1 -0
- package/esm/cli/theme/theme-delete.js +10 -7
- package/esm/cli/theme/theme-delete.js.map +1 -1
- package/esm/cli/theme/theme-export.js +11 -8
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/cli/theme/theme-import.js +12 -9
- package/esm/cli/theme/theme-import.js.map +1 -1
- package/esm/cli/theme/theme-list.js +7 -4
- package/esm/cli/theme/theme-list.js.map +1 -1
- package/esm/cli/theme/theme.js +2 -2
- package/esm/cli/theme/theme.js.map +1 -1
- package/esm/help/SampleData.js +7 -0
- package/esm/help/SampleData.js.map +1 -0
- package/esm/launch.js +1 -1
- package/esm/launch.js.map +1 -1
- package/esm/loader.js +2 -2
- package/esm/loader.js.map +1 -1
- package/esm/ops/AdminFederationOps.js +216 -0
- package/esm/ops/AdminFederationOps.js.map +1 -0
- package/esm/ops/AgentOps.js +88 -54
- package/esm/ops/AgentOps.js.map +1 -1
- package/esm/ops/ApplicationOps.js +309 -0
- package/esm/ops/ApplicationOps.js.map +1 -0
- package/esm/ops/CirclesOfTrustOps.js +25 -13
- package/esm/ops/CirclesOfTrustOps.js.map +1 -1
- package/esm/ops/ConnectionProfileOps.js +13 -6
- package/esm/ops/ConnectionProfileOps.js.map +1 -1
- package/esm/ops/EmailTemplateOps.js +53 -47
- package/esm/ops/EmailTemplateOps.js.map +1 -1
- package/esm/ops/IdmOps.js +58 -64
- package/esm/ops/IdmOps.js.map +1 -1
- package/esm/ops/IdpOps.js +48 -25
- package/esm/ops/IdpOps.js.map +1 -1
- package/esm/ops/JourneyOps.js +108 -43
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/LogOps.js +92 -30
- package/esm/ops/LogOps.js.map +1 -1
- package/esm/ops/NodeOps.js +6 -3
- package/esm/ops/NodeOps.js.map +1 -1
- package/esm/ops/OAuth2ClientOps.js +29 -16
- package/esm/ops/OAuth2ClientOps.js.map +1 -1
- package/esm/ops/OrganizationOps.js +14 -22
- package/esm/ops/OrganizationOps.js.map +1 -1
- package/esm/ops/PolicyOps.js +60 -28
- package/esm/ops/PolicyOps.js.map +1 -1
- package/esm/ops/PolicySetOps.js +39 -22
- package/esm/ops/PolicySetOps.js.map +1 -1
- package/esm/ops/RealmOps.js +15 -8
- package/esm/ops/RealmOps.js.map +1 -1
- package/esm/ops/ResourceTypeOps.js +43 -27
- package/esm/ops/ResourceTypeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js +56 -42
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/Saml2Ops.test_.js.map +1 -1
- package/esm/ops/ScriptOps.js +72 -18
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/ops/SecretsOps.js +33 -18
- package/esm/ops/SecretsOps.js.map +1 -1
- package/esm/ops/ServiceOps.js +49 -28
- package/esm/ops/ServiceOps.js.map +1 -1
- package/esm/ops/ThemeOps.js +42 -22
- package/esm/ops/ThemeOps.js.map +1 -1
- package/esm/ops/VariablesOps.js +37 -28
- package/esm/ops/VariablesOps.js.map +1 -1
- package/esm/ops/utils/OpsUtils.js +1 -1
- package/esm/ops/utils/OpsUtils.js.map +1 -1
- package/esm/ops/utils/Wordwrap.js +1 -1
- package/esm/ops/utils/Wordwrap.js.map +1 -1
- package/esm/storage/StaticStorage.js +1 -1
- package/esm/storage/StaticStorage.js.map +1 -1
- package/esm/utils/Config.js +7 -4
- package/esm/utils/Config.js.map +1 -1
- package/esm/utils/Console.js +9 -5
- package/esm/utils/Console.js.map +1 -1
- package/esm/utils/ExportImportUtils.js +32 -66
- package/esm/utils/ExportImportUtils.js.map +1 -1
- package/esm/utils/Version.js +19 -16
- package/esm/utils/Version.js.map +1 -1
- package/package.json +45 -35
- package/esm/cli/logging/logs-fetch.js.map +0 -1
- package/esm/cli/logging/logs-list.js +0 -49
- package/esm/cli/logging/logs-list.js.map +0 -1
- package/esm/cli/logging/logs-tail.js +0 -46
- package/esm/cli/logging/logs-tail.js.map +0 -1
- package/esm/cli/logging/logs.js.map +0 -1
- package/esm/cli/theme/theme-delete.e2e.test_.js.map +0 -1
- package/esm/cli/theme/theme-list.e2e.test_.js.map +0 -1
package/esm/ops/IdpOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdpOps.js","names":["frodo","fs","createProgressBar","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getRealmString","getTypedFilename","saveJsonToFile","getOneLineDescription","socialIdpObj","description","_id","_type","getTableHeaderMd","markdown","getTableRowMd","row","enabled","name","listSocialProviders","providers","oauth2oidc","external","getSocialIdentityProviders","sort","a","b","localeCompare","forEach","socialIdentityProvider","err","message","exportSocialProviderToFile","providerId","file","fileName","fileData","exportSocialProvider","exportSocialProvidersToFile","exportSocialProviders","exportSocialProvidersToFiles","allIdpsData","length","idpData","importSocialProviderFromFile","outcome","readFile","data","JSON","parse","importSocialProvider","error","_error$response","response","importFirstSocialProviderFromFile","importFirstSocialProvider","_error$response2","importSocialProvidersFromFile","importSocialProviders","_error$response3","importSocialProvidersFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","total","readFileSync","count","Object","keys","idp"],"sources":["ops/IdpOps.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport type { SocialIdpSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport {\n createProgressBar,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getRealmString,\n getTypedFilename,\n saveJsonToFile,\n} from '../utils/ExportImportUtils';\n\n/**\n * Get a one-line description of the social idp object\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(socialIdpObj: SocialIdpSkeleton): string {\n const description = `[${socialIdpObj._id['brightCyan']}] ${socialIdpObj._type._id}`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name/Id | Status | Type |\\n';\n markdown += '| ------- | ------ | ---- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the social idp in markdown\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a table-row of the social idp in markdown\n */\nexport function getTableRowMd(socialIdpObj: SocialIdpSkeleton): string {\n const row = `| ${socialIdpObj._id} | ${\n socialIdpObj.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n } | ${socialIdpObj._type.name} |`;\n return row;\n}\n\n/**\n * List providers\n */\nexport async function listSocialProviders() {\n try {\n const providers =\n await frodo.oauth2oidc.external.getSocialIdentityProviders();\n providers.sort((a, b) => a._id.localeCompare(b._id));\n providers.forEach((socialIdentityProvider) => {\n printMessage(`${socialIdentityProvider._id}`, 'data');\n });\n } catch (err) {\n printMessage(`listSocialProviders ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n}\n\n/**\n * Export provider by id\n * @param {string} providerId provider id/name\n * @param {string} file optional export file name\n */\nexport async function exportSocialProviderToFile(\n providerId: string,\n file = ''\n) {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(providerId, 'idp');\n }\n createProgressBar(1, `Exporting ${providerId}`);\n try {\n updateProgressBar(`Writing file ${fileName}`);\n const fileData = await frodo.oauth2oidc.external.exportSocialProvider(\n providerId\n );\n saveJsonToFile(fileData, fileName);\n stopProgressBar(\n `Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`\n );\n } catch (err) {\n stopProgressBar(`${err}`);\n printMessage(`${err}`, 'error');\n }\n}\n\n/**\n * Export all providers\n * @param {string} file optional export file name\n */\nexport async function exportSocialProvidersToFile(file = '') {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`all${getRealmString()}Providers`, 'idp');\n }\n const fileData = await frodo.oauth2oidc.external.exportSocialProviders();\n saveJsonToFile(fileData, fileName);\n}\n\n/**\n * Export all providers to individual files\n */\nexport async function exportSocialProvidersToFiles() {\n const allIdpsData =\n await frodo.oauth2oidc.external.getSocialIdentityProviders();\n // printMessage(allIdpsData, 'data');\n createProgressBar(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n updateProgressBar(`Writing provider ${idpData._id}`);\n const fileName = getTypedFilename(idpData._id, 'idp');\n const fileData = await frodo.oauth2oidc.external.exportSocialProvider(\n idpData._id\n );\n saveJsonToFile(fileData, fileName);\n }\n stopProgressBar(`${allIdpsData.length} providers exported.`);\n}\n\n/**\n * Import provider by id/name\n * @param {string} providerId provider id/name\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if provider was imported successfully, false otherwise\n */\nexport async function importSocialProviderFromFile(\n providerId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing provider ${providerId} from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importSocialProvider(\n providerId,\n fileData\n );\n succeedSpinner(\n `Successfully imported provider ${providerId} from ${file}.`\n );\n } catch (error) {\n failSpinner(`Error importing provider ${providerId} from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import first provider from file\n * @param {String} file import file name\n * @returns {Promise<boolean>} true if first provider was imported successfully, false otherwise\n */\nexport async function importFirstSocialProviderFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing first provider from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importFirstSocialProvider(\n fileData\n );\n succeedSpinner(`Successfully imported first provider from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing first provider from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all providers from file\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if all providers were imported successfully, false otherwise\n */\nexport async function importSocialProvidersFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing providers from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importSocialProviders(fileData);\n succeedSpinner(`Successfully imported providers from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing providers from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import providers from *.idp.json files in current working directory\n */\nexport async function importSocialProvidersFromFiles() {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.idp.json')\n );\n\n createProgressBar(jsonFiles.length, 'Importing providers...');\n let total = 0;\n for (const file of jsonFiles) {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n const count = Object.keys(fileData.idp).length;\n total += count;\n await frodo.oauth2oidc.external.importSocialProviders(fileData);\n updateProgressBar(`Imported ${count} provider(s) from ${file}`);\n }\n stopProgressBar(\n `Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`\n );\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SACEC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,4BAA4B;;AAEnC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,YAA+B,EAAU;EAC7E,MAAMC,WAAW,GAAI,IAAGD,YAAY,CAACE,GAAG,CAAC,YAAY,CAAE,KAAIF,YAAY,CAACG,KAAK,CAACD,GAAI,EAAC;EACnF,OAAOD,WAAW;AACpB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASG,gBAAgBA,CAAA,EAAW;EACzC,IAAIC,QAAQ,GAAG,EAAE;EACjBA,QAAQ,IAAI,+BAA+B;EAC3CA,QAAQ,IAAI,6BAA6B;EACzC,OAAOA,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACN,YAA+B,EAAU;EACrE,MAAMO,GAAG,GAAI,KAAIP,YAAY,CAACE,GAAI,MAChCF,YAAY,CAACQ,OAAO,KAAK,KAAK,GAC1B,gBAAgB,GAChB,8BACL,MAAKR,YAAY,CAACG,KAAK,CAACM,IAAK,IAAG;EACjC,OAAOF,GAAG;AACZ;;AAEA;AACA;AACA;AACA,OAAO,eAAeG,mBAAmBA,CAAA,EAAG;EAC1C,I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MC,SAAS,GAAGF,KAAK,CAACG,MAAM,CAAE9C,IAAI,IAClCA,IAAI,CAAC+C,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,WAAW,CACzC,CAAC;EAEDpE,iBAAiB,CAACiE,SAAS,CAACrB,MAAM,EAAE,wBAAwB,CAAC;EAC7D,IAAIyB,KAAK,GAAG,CAAC;EACb,KAAK,MAAMjC,IAAI,IAAI6B,SAAS,EAAE;IAC5B,MAAMhB,IAAI,GAAGlD,EAAE,CAACuE,YAAY,CAAClC,IAAI,EAAE,MAAM,CAAC;IAC1C,MAAME,QAAQ,GAAGY,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC;IACjC,MAAMsB,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACnC,QAAQ,CAACoC,GAAG,CAAC,CAAC9B,MAAM;IAC9CyB,KAAK,IAAIE,KAAK;IACd,MAAMzE,KAAK,CAACyB,UAAU,CAACC,QAAQ,CAACoC,qBAAqB,CAACtB,QAAQ,CAAC;IAC/DhC,iBAAiB,CAAE,YAAWiE,KAAM,qBAAoBnC,IAAK,EAAC,CAAC;EACjE;EACAhC,eAAe,CACZ,sBAAqBiE,KAAM,qBAAoBJ,SAAS,CAACrB,MAAO,WACnE,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"IdpOps.js","names":["frodo","fs","createProgressBar","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getRealmString","getTypedFilename","saveJsonToFile","readSocialIdentityProviders","exportSocialIdentityProvider","exportSocialIdentityProviders","importFirstSocialIdentityProvider","importSocialIdentityProvider","importSocialIdentityProviders","oauth2oidc","external","getOneLineDescription","socialIdpObj","description","_id","_type","getTableHeaderMd","markdown","getTableRowMd","row","enabled","name","listSocialProviders","providers","sort","a","b","localeCompare","forEach","socialIdentityProvider","err","message","exportSocialIdentityProviderToFile","providerId","file","fileName","fileData","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","allIdpsData","length","idpData","error","importSocialIdentityProviderFromFile","outcome","readFile","data","JSON","parse","_error$response","response","importFirstSocialIdentityProviderFromFile","_error$response2","importSocialIdentityProvidersFromFile","_error$response3","importSocialIdentityProvidersFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","total","readFileSync","count","Object","keys","idp"],"sources":["../../src/ops/IdpOps.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { SocialIdpSkeleton } from '@rockcarver/frodo-lib/types/api/SocialIdentityProvidersApi';\nimport fs from 'fs';\n\nimport {\n createProgressBar,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getRealmString,\n getTypedFilename,\n saveJsonToFile,\n} from '../utils/ExportImportUtils';\n\nconst {\n readSocialIdentityProviders,\n exportSocialIdentityProvider,\n exportSocialIdentityProviders,\n importFirstSocialIdentityProvider,\n importSocialIdentityProvider,\n importSocialIdentityProviders,\n} = frodo.oauth2oidc.external;\n\n/**\n * Get a one-line description of the social idp object\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(socialIdpObj: SocialIdpSkeleton): string {\n const description = `[${socialIdpObj._id['brightCyan']}] ${socialIdpObj._type._id}`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name/Id | Status | Type |\\n';\n markdown += '| ------- | ------ | ---- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the social idp in markdown\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a table-row of the social idp in markdown\n */\nexport function getTableRowMd(socialIdpObj: SocialIdpSkeleton): string {\n const row = `| ${socialIdpObj._id} | ${\n socialIdpObj.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n } | ${socialIdpObj._type.name} |`;\n return row;\n}\n\n/**\n * List providers\n */\nexport async function listSocialProviders() {\n try {\n const providers = await readSocialIdentityProviders();\n providers.sort((a, b) => a._id.localeCompare(b._id));\n providers.forEach((socialIdentityProvider) => {\n printMessage(`${socialIdentityProvider._id}`, 'data');\n });\n } catch (err) {\n printMessage(`listSocialProviders ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n}\n\n/**\n * Export provider by id\n * @param {string} providerId provider id/name\n * @param {string} file optional export file name\n */\nexport async function exportSocialIdentityProviderToFile(\n providerId: string,\n file = ''\n) {\n debugMessage(`cli.IdpOps.exportSocialIdentityProviderToFile: start`);\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(providerId, 'idp');\n }\n createProgressBar(1, `Exporting ${providerId}`);\n try {\n updateProgressBar(`Writing file ${fileName}`);\n const fileData = await exportSocialIdentityProvider(providerId);\n saveJsonToFile(fileData, fileName);\n stopProgressBar(\n `Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`\n );\n } catch (err) {\n stopProgressBar(`${err}`);\n printMessage(`${err}`, 'error');\n }\n debugMessage(`cli.IdpOps.exportSocialIdentityProviderToFile: end`);\n}\n\n/**\n * Export all providers\n * @param {string} file optional export file name\n */\nexport async function exportSocialIdentityProvidersToFile(file = '') {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`all${getRealmString()}Providers`, 'idp');\n }\n const fileData = await exportSocialIdentityProviders();\n saveJsonToFile(fileData, fileName);\n}\n\n/**\n * Export all providers to individual files\n */\nexport async function exportSocialIdentityProvidersToFiles() {\n debugMessage(`cli.IdpOps.exportSocialIdentityProvidersToFiles: start`);\n try {\n const allIdpsData = await readSocialIdentityProviders();\n createProgressBar(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n try {\n const fileName = getTypedFilename(idpData._id, 'idp');\n const fileData = await exportSocialIdentityProvider(idpData._id);\n saveJsonToFile(fileData, fileName);\n updateProgressBar(`Exported provider ${idpData._id}`);\n } catch (error) {\n printMessage(`Error exporting ${idpData._id}: ${error}`, 'error');\n }\n }\n stopProgressBar(`${allIdpsData.length} providers exported.`);\n } catch (error) {\n stopProgressBar(`${error}`);\n printMessage(`${error}`, 'error');\n }\n debugMessage(`cli.IdpOps.exportSocialIdentityProvidersToFiles: end`);\n}\n\n/**\n * Import provider by id/name\n * @param {string} providerId provider id/name\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if provider was imported successfully, false otherwise\n */\nexport async function importSocialIdentityProviderFromFile(\n providerId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing provider ${providerId} from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importSocialIdentityProvider(providerId, fileData);\n outcome = true;\n succeedSpinner(\n `Successfully imported provider ${providerId} from ${file}.`\n );\n } catch (error) {\n failSpinner(`Error importing provider ${providerId} from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import first provider from file\n * @param {String} file import file name\n * @returns {Promise<boolean>} true if first provider was imported successfully, false otherwise\n */\nexport async function importFirstSocialIdentityProviderFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing first provider from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importFirstSocialIdentityProvider(fileData);\n outcome = true;\n succeedSpinner(`Successfully imported first provider from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing first provider from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all providers from file\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if all providers were imported successfully, false otherwise\n */\nexport async function importSocialIdentityProvidersFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing providers from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importSocialIdentityProviders(fileData);\n outcome = true;\n succeedSpinner(`Successfully imported providers from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing providers from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import providers from *.idp.json files in current working directory\n */\nexport async function importSocialIdentityProvidersFromFiles() {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.idp.json')\n );\n\n createProgressBar(jsonFiles.length, 'Importing providers...');\n let total = 0;\n for (const file of jsonFiles) {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n const count = Object.keys(fileData.idp).length;\n total += count;\n await importSocialIdentityProviders(fileData);\n updateProgressBar(`Imported ${count} provider(s) from ${file}`);\n }\n stopProgressBar(\n `Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`\n );\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SACEC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,4BAA4B;AAEnC,MAAM;EACJC,2BAA2B;EAC3BC,4BAA4B;EAC5BC,6BAA6B;EAC7BC,iCAAiC;EACjCC,4BAA4B;EAC5BC;AACF,CAAC,GAAGlB,KAAK,CAACmB,UAAU,CAACC,QAAQ;;AAE7B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,YAA+B,EAAU;EAC7E,MAAMC,WAAW,GAAI,IAAGD,YAAY,CAACE,GAAG,CAAC,YAAY,CAAE,KAAIF,YAAY,CAACG,KAAK,CAACD,GAAI,EAAC;EACnF,OAAOD,WAAW;AACpB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASG,gBAAgBA,CAAA,EAAW;EACzC,IAAIC,QAAQ,GA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EAAC,CAAC;EACjE;EACArC,eAAe,CACZ,sBAAqBiE,KAAM,qBAAoBJ,SAAS,CAAClB,MAAO,WACnE,CAAC;AACH"}
|
package/esm/ops/JourneyOps.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import {
|
|
3
|
+
import { createProgressBar, createTable, debugMessage, failSpinner, printMessage, showSpinner, stopProgressBar, succeedSpinner, updateProgressBar } from '../utils/Console';
|
|
4
4
|
import * as CirclesOfTrust from './CirclesOfTrustOps';
|
|
5
5
|
import * as EmailTemplate from './EmailTemplateOps';
|
|
6
6
|
import * as Idp from './IdpOps';
|
|
@@ -8,8 +8,25 @@ import * as Node from './NodeOps';
|
|
|
8
8
|
import * as Saml2 from './Saml2Ops';
|
|
9
9
|
import * as Script from './ScriptOps';
|
|
10
10
|
import * as Theme from './ThemeOps';
|
|
11
|
-
import wordwrap from './utils/Wordwrap';
|
|
12
11
|
import { cloneDeep } from './utils/OpsUtils';
|
|
12
|
+
import wordwrap from './utils/Wordwrap';
|
|
13
|
+
const {
|
|
14
|
+
getTypedFilename,
|
|
15
|
+
saveJsonToFile,
|
|
16
|
+
getRealmString
|
|
17
|
+
} = frodo.utils;
|
|
18
|
+
const {
|
|
19
|
+
readJourneys,
|
|
20
|
+
exportJourney,
|
|
21
|
+
createMultiTreeExportTemplate,
|
|
22
|
+
resolveDependencies,
|
|
23
|
+
importJourneys,
|
|
24
|
+
importJourney,
|
|
25
|
+
getTreeDescendents,
|
|
26
|
+
getNodeRef,
|
|
27
|
+
onlineTreeExportResolver,
|
|
28
|
+
getJourneyClassification: _getJourneyClassification
|
|
29
|
+
} = frodo.authn.journey;
|
|
13
30
|
|
|
14
31
|
/**
|
|
15
32
|
* List all the journeys/trees
|
|
@@ -20,7 +37,7 @@ import { cloneDeep } from './utils/OpsUtils';
|
|
|
20
37
|
export async function listJourneys(long = false, analyze = false) {
|
|
21
38
|
let journeys = [];
|
|
22
39
|
try {
|
|
23
|
-
journeys = await
|
|
40
|
+
journeys = await readJourneys();
|
|
24
41
|
if (!long && !analyze) {
|
|
25
42
|
for (const journeyStub of journeys) {
|
|
26
43
|
printMessage(`${journeyStub['_id']}`, 'data');
|
|
@@ -38,7 +55,7 @@ export async function listJourneys(long = false, analyze = false) {
|
|
|
38
55
|
const exportPromises = [];
|
|
39
56
|
try {
|
|
40
57
|
for (const journeyStub of journeys) {
|
|
41
|
-
exportPromises.push(
|
|
58
|
+
exportPromises.push(exportJourney(journeyStub['_id'], {
|
|
42
59
|
useStringArrays: false,
|
|
43
60
|
deps: false
|
|
44
61
|
}));
|
|
@@ -74,7 +91,7 @@ export async function exportJourneyToFile(journeyId, file, options) {
|
|
|
74
91
|
debugMessage(`exportJourneyToFile: start`);
|
|
75
92
|
const verbose = state.getDebug();
|
|
76
93
|
if (!file) {
|
|
77
|
-
file =
|
|
94
|
+
file = getTypedFilename(journeyId, 'journey');
|
|
78
95
|
}
|
|
79
96
|
if (state.getDirectory()) {
|
|
80
97
|
const dir = state.getDirectory().replace(/\/$/, '');
|
|
@@ -90,9 +107,9 @@ export async function exportJourneyToFile(journeyId, file, options) {
|
|
|
90
107
|
}
|
|
91
108
|
if (!verbose) showSpinner(`${journeyId}`);
|
|
92
109
|
try {
|
|
93
|
-
const fileData = await
|
|
110
|
+
const fileData = await exportJourney(journeyId, options);
|
|
94
111
|
if (verbose) showSpinner(`${journeyId}`);
|
|
95
|
-
|
|
112
|
+
saveJsonToFile(fileData, file);
|
|
96
113
|
succeedSpinner(`Exported ${journeyId['brightCyan']} to ${file['brightCyan']}.`);
|
|
97
114
|
} catch (error) {
|
|
98
115
|
if (verbose) showSpinner(`${journeyId}`);
|
|
@@ -111,22 +128,34 @@ export async function exportJourneysToFile(file, options = {
|
|
|
111
128
|
}) {
|
|
112
129
|
let fileName = file;
|
|
113
130
|
if (!fileName) {
|
|
114
|
-
fileName =
|
|
131
|
+
fileName = getTypedFilename(`all${getRealmString()}Journeys`, 'journey');
|
|
132
|
+
}
|
|
133
|
+
if (state.getDirectory()) {
|
|
134
|
+
const dir = state.getDirectory().replace(/\/$/, '');
|
|
135
|
+
debugMessage(`exportJourneysToFile: directory='${dir}'`);
|
|
136
|
+
fileName = `${dir}/${fileName}`;
|
|
137
|
+
// create directory if it doesn't exist
|
|
138
|
+
if (!fs.existsSync(dir)) {
|
|
139
|
+
debugMessage(`exportJourneysToFile: creating directory '${dir}'`);
|
|
140
|
+
fs.mkdirSync(dir, {
|
|
141
|
+
recursive: true
|
|
142
|
+
});
|
|
143
|
+
}
|
|
115
144
|
}
|
|
116
|
-
const trees = await
|
|
117
|
-
const fileData =
|
|
145
|
+
const trees = await readJourneys();
|
|
146
|
+
const fileData = createMultiTreeExportTemplate();
|
|
118
147
|
createProgressBar(trees.length, 'Exporting journeys...');
|
|
119
148
|
for (const tree of trees) {
|
|
120
149
|
updateProgressBar(`${tree._id}`);
|
|
121
150
|
try {
|
|
122
|
-
const exportData = await
|
|
151
|
+
const exportData = await exportJourney(tree._id, options);
|
|
123
152
|
delete exportData.meta;
|
|
124
153
|
fileData.trees[tree._id] = exportData;
|
|
125
154
|
} catch (error) {
|
|
126
155
|
printMessage(`Error exporting journey ${tree._id}: ${error}`, 'error');
|
|
127
156
|
}
|
|
128
157
|
}
|
|
129
|
-
|
|
158
|
+
saveJsonToFile(fileData, fileName);
|
|
130
159
|
stopProgressBar(`Exported to ${fileName}`);
|
|
131
160
|
}
|
|
132
161
|
|
|
@@ -135,14 +164,26 @@ export async function exportJourneysToFile(file, options = {
|
|
|
135
164
|
* @param {TreeExportOptions} options export options
|
|
136
165
|
*/
|
|
137
166
|
export async function exportJourneysToFiles(options) {
|
|
138
|
-
const
|
|
167
|
+
const dir = state.getDirectory() ? state.getDirectory().replace(/\/$/, '') : undefined;
|
|
168
|
+
debugMessage(`exportJourneysToFiles: directory='${dir}'`);
|
|
169
|
+
// create directory if it doesn't exist
|
|
170
|
+
if (dir && !fs.existsSync(dir)) {
|
|
171
|
+
debugMessage(`exportJourneysToFiles: creating directory '${dir}'`);
|
|
172
|
+
fs.mkdirSync(dir, {
|
|
173
|
+
recursive: true
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const trees = await readJourneys();
|
|
139
177
|
createProgressBar(trees.length, 'Exporting journeys...');
|
|
140
178
|
for (const tree of trees) {
|
|
141
179
|
updateProgressBar(`${tree._id}`);
|
|
142
|
-
|
|
180
|
+
let fileName = getTypedFilename(`${tree._id}`, 'journey');
|
|
181
|
+
if (dir) {
|
|
182
|
+
fileName = `${dir}/${fileName}`;
|
|
183
|
+
}
|
|
143
184
|
try {
|
|
144
|
-
const exportData = await
|
|
145
|
-
|
|
185
|
+
const exportData = await exportJourney(tree._id, options);
|
|
186
|
+
saveJsonToFile(exportData, fileName);
|
|
146
187
|
} catch (error) {
|
|
147
188
|
// do we need to report status here?
|
|
148
189
|
}
|
|
@@ -171,17 +212,17 @@ export async function importJourneyFromFile(journeyId, file, options) {
|
|
|
171
212
|
// if a journeyId was specified, only import the matching journey
|
|
172
213
|
if (journeyData && journeyId === journeyData.tree._id) {
|
|
173
214
|
// attempt dependency resolution for single tree import
|
|
174
|
-
const installedJourneys = (await
|
|
215
|
+
const installedJourneys = (await readJourneys()).map(x => x._id);
|
|
175
216
|
const unresolvedJourneys = {};
|
|
176
217
|
const resolvedJourneys = [];
|
|
177
218
|
showSpinner('Resolving dependencies');
|
|
178
|
-
await
|
|
219
|
+
await resolveDependencies(installedJourneys, {
|
|
179
220
|
[journeyId]: journeyData
|
|
180
221
|
}, unresolvedJourneys, resolvedJourneys);
|
|
181
222
|
if (Object.keys(unresolvedJourneys).length === 0) {
|
|
182
223
|
succeedSpinner(`Resolved all dependencies.`);
|
|
183
224
|
if (!verbose) showSpinner(`Importing ${journeyId}...`);
|
|
184
|
-
|
|
225
|
+
importJourney(journeyData, options).then(() => {
|
|
185
226
|
if (verbose) showSpinner(`Importing ${journeyId}...`);
|
|
186
227
|
succeedSpinner(`Imported ${journeyId}.`);
|
|
187
228
|
}).catch(importError => {
|
|
@@ -231,17 +272,17 @@ export async function importFirstJourneyFromFile(file, options) {
|
|
|
231
272
|
// if a journeyId was specified, only import the matching journey
|
|
232
273
|
if (journeyData && journeyId) {
|
|
233
274
|
// attempt dependency resolution for single tree import
|
|
234
|
-
const installedJourneys = (await
|
|
275
|
+
const installedJourneys = (await readJourneys()).map(x => x._id);
|
|
235
276
|
const unresolvedJourneys = {};
|
|
236
277
|
const resolvedJourneys = [];
|
|
237
278
|
showSpinner('Resolving dependencies');
|
|
238
|
-
await
|
|
279
|
+
await resolveDependencies(installedJourneys, {
|
|
239
280
|
[journeyId]: journeyData
|
|
240
281
|
}, unresolvedJourneys, resolvedJourneys);
|
|
241
282
|
if (Object.keys(unresolvedJourneys).length === 0) {
|
|
242
283
|
succeedSpinner(`Resolved all dependencies.`);
|
|
243
284
|
if (!verbose) showSpinner(`Importing ${journeyId}...`);
|
|
244
|
-
|
|
285
|
+
importJourney(journeyData, options).then(() => {
|
|
245
286
|
if (verbose) showSpinner(`Importing ${journeyId}...`);
|
|
246
287
|
succeedSpinner(`Imported ${journeyId}.`);
|
|
247
288
|
}).catch(importError => {
|
|
@@ -270,8 +311,22 @@ export async function importFirstJourneyFromFile(file, options) {
|
|
|
270
311
|
export async function importJourneysFromFile(file, options) {
|
|
271
312
|
fs.readFile(file, 'utf8', (err, data) => {
|
|
272
313
|
if (err) throw err;
|
|
273
|
-
|
|
274
|
-
|
|
314
|
+
try {
|
|
315
|
+
const fileData = JSON.parse(data);
|
|
316
|
+
importJourneys(fileData.trees, options);
|
|
317
|
+
} catch (error) {
|
|
318
|
+
if (error.name === 'UnresolvedDependenciesError') {
|
|
319
|
+
for (const journey of Object.keys(error.unresolvedJourneys)) {
|
|
320
|
+
printMessage({
|
|
321
|
+
message: ` - ${journey} requires ${error.unresolvedJourneys[journey]}`,
|
|
322
|
+
type: 'info',
|
|
323
|
+
state
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
printMessage(`${error.message}`, 'error');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
275
330
|
});
|
|
276
331
|
}
|
|
277
332
|
|
|
@@ -289,7 +344,12 @@ export async function importJourneysFromFiles(options) {
|
|
|
289
344
|
const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
290
345
|
allJourneysData.trees[journeyData.tree._id] = journeyData;
|
|
291
346
|
}
|
|
292
|
-
|
|
347
|
+
try {
|
|
348
|
+
await importJourneys(allJourneysData.trees, options);
|
|
349
|
+
} catch (error) {
|
|
350
|
+
var _error$response2;
|
|
351
|
+
printMessage(`${((_error$response2 = error.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 ? void 0 : _error$response2.message) || error.message}`, 'error');
|
|
352
|
+
}
|
|
293
353
|
}
|
|
294
354
|
|
|
295
355
|
/**
|
|
@@ -298,16 +358,16 @@ export async function importJourneysFromFiles(options) {
|
|
|
298
358
|
* @returns {string[]} Colored string array of classifications
|
|
299
359
|
*/
|
|
300
360
|
export function getJourneyClassification(journey) {
|
|
301
|
-
return
|
|
361
|
+
return _getJourneyClassification(journey).map(it => {
|
|
302
362
|
switch (it) {
|
|
303
363
|
case 'standard':
|
|
304
|
-
return it
|
|
364
|
+
return it['brightGreen'];
|
|
305
365
|
case 'cloud':
|
|
306
|
-
return it
|
|
366
|
+
return it['brightMagenta'];
|
|
307
367
|
case 'custom':
|
|
308
|
-
return it
|
|
368
|
+
return it['brightRed'];
|
|
309
369
|
case 'premium':
|
|
310
|
-
return it
|
|
370
|
+
return it['brightYellow'];
|
|
311
371
|
}
|
|
312
372
|
});
|
|
313
373
|
}
|
|
@@ -318,16 +378,16 @@ export function getJourneyClassification(journey) {
|
|
|
318
378
|
* @returns {string[]} Colored string array of classifications
|
|
319
379
|
*/
|
|
320
380
|
export function getJourneyClassificationMd(journey) {
|
|
321
|
-
return
|
|
381
|
+
return _getJourneyClassification(journey).map(it => {
|
|
322
382
|
switch (it) {
|
|
323
383
|
case 'standard':
|
|
324
|
-
return `:green_circle: \`${it
|
|
384
|
+
return `:green_circle: \`${it}\``;
|
|
325
385
|
case 'cloud':
|
|
326
|
-
return `:purple_circle: \`${it
|
|
386
|
+
return `:purple_circle: \`${it}\``;
|
|
327
387
|
case 'custom':
|
|
328
|
-
return `:red_circle: \`${it
|
|
388
|
+
return `:red_circle: \`${it}\``;
|
|
329
389
|
case 'premium':
|
|
330
|
-
return `:yellow_circle: \`${it
|
|
390
|
+
return `:yellow_circle: \`${it}\``;
|
|
331
391
|
}
|
|
332
392
|
});
|
|
333
393
|
}
|
|
@@ -410,7 +470,7 @@ function describeTreeDescendentsMd(descendents, depth = 0) {
|
|
|
410
470
|
* @param {SingleTreeExportInterface} journeyData journey export object
|
|
411
471
|
* @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
|
|
412
472
|
*/
|
|
413
|
-
export async function describeJourney(journeyData, resolveTreeExport =
|
|
473
|
+
export async function describeJourney(journeyData, resolveTreeExport = onlineTreeExportResolver) {
|
|
414
474
|
var _journeyData$meta, _journeyData$tree$uiC, _journeyData$themes;
|
|
415
475
|
const allNodes = {
|
|
416
476
|
...journeyData.nodes,
|
|
@@ -454,8 +514,13 @@ export async function describeJourney(journeyData, resolveTreeExport = frodo.aut
|
|
|
454
514
|
}
|
|
455
515
|
|
|
456
516
|
// Dependency Tree
|
|
457
|
-
|
|
458
|
-
|
|
517
|
+
try {
|
|
518
|
+
const descendents = await getTreeDescendents(journeyData, resolveTreeExport);
|
|
519
|
+
describeTreeDescendents(descendents);
|
|
520
|
+
} catch (error) {
|
|
521
|
+
printMessage(`Error resolving inner tree dependencies:`, 'error');
|
|
522
|
+
printMessage(error.stack, 'error');
|
|
523
|
+
}
|
|
459
524
|
|
|
460
525
|
// Node Types
|
|
461
526
|
if (Object.entries(nodeTypeMap).length) {
|
|
@@ -469,7 +534,7 @@ export async function describeJourney(journeyData, resolveTreeExport = frodo.aut
|
|
|
469
534
|
if (Object.entries(allNodes).length) {
|
|
470
535
|
printMessage(`\nNodes (${Object.entries(allNodes).length}):`, 'data');
|
|
471
536
|
for (const nodeObj of Object.values(allNodes)) {
|
|
472
|
-
printMessage(`- ${Node.getOneLineDescription(nodeObj,
|
|
537
|
+
printMessage(`- ${Node.getOneLineDescription(nodeObj, getNodeRef(nodeObj, journeyData))}`, 'data');
|
|
473
538
|
}
|
|
474
539
|
}
|
|
475
540
|
|
|
@@ -537,7 +602,7 @@ export async function describeJourney(journeyData, resolveTreeExport = frodo.aut
|
|
|
537
602
|
* @param {SingleTreeExportInterface} journeyData journey export object
|
|
538
603
|
* @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
|
|
539
604
|
*/
|
|
540
|
-
export async function describeJourneyMd(journeyData, resolveTreeExport =
|
|
605
|
+
export async function describeJourneyMd(journeyData, resolveTreeExport = onlineTreeExportResolver) {
|
|
541
606
|
var _journeyData$meta2, _journeyData$tree$uiC2, _journeyData$themes2;
|
|
542
607
|
const allNodes = {
|
|
543
608
|
...journeyData.nodes,
|
|
@@ -574,7 +639,7 @@ export async function describeJourneyMd(journeyData, resolveTreeExport = frodo.a
|
|
|
574
639
|
printMessage(`\n[]()\n`, 'data');
|
|
575
640
|
|
|
576
641
|
// Dependency Tree
|
|
577
|
-
const descendents = await
|
|
642
|
+
const descendents = await getTreeDescendents(journeyData, resolveTreeExport);
|
|
578
643
|
printMessage(describeTreeDescendentsMd(descendents), 'data');
|
|
579
644
|
|
|
580
645
|
// Node Types
|
|
@@ -592,7 +657,7 @@ export async function describeJourneyMd(journeyData, resolveTreeExport = frodo.a
|
|
|
592
657
|
printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');
|
|
593
658
|
printMessage(Node.getTableHeaderMd(), 'data');
|
|
594
659
|
for (const nodeObj of Object.values(allNodes)) {
|
|
595
|
-
printMessage(`${Node.getTableRowMd(nodeObj,
|
|
660
|
+
printMessage(`${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`, 'data');
|
|
596
661
|
}
|
|
597
662
|
}
|
|
598
663
|
|
|
@@ -650,4 +715,4 @@ export async function describeJourneyMd(journeyData, resolveTreeExport = frodo.a
|
|
|
650
715
|
}
|
|
651
716
|
}
|
|
652
717
|
}
|
|
653
|
-
//# sourceMappingURL=JourneyOps.js.map
|
|
718
|
+
//# sourceMappingURL=JourneyOps.js.map
|