@rockcarver/frodo-lib 1.0.0 → 2.0.0-1
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 +3 -7
- package/cjs/api/AgentApi.js +91 -37
- package/cjs/api/AgentApi.js.map +1 -1
- package/cjs/api/AgentApi.test.js.map +1 -1
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/AuthenticateApi.js +18 -11
- package/cjs/api/AuthenticateApi.js.map +1 -1
- package/cjs/api/AuthenticateApi.test.js.map +1 -1
- package/cjs/api/BaseApi.js +50 -26
- package/cjs/api/BaseApi.js.map +1 -1
- package/cjs/api/CirclesOfTrustApi.js +47 -23
- package/cjs/api/CirclesOfTrustApi.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +54 -21
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/IdmSystemApi.js +9 -6
- package/cjs/api/IdmSystemApi.js.map +1 -1
- package/cjs/api/ManagedObjectApi.js +49 -27
- package/cjs/api/ManagedObjectApi.js.map +1 -1
- package/cjs/api/NodeApi.js +71 -32
- package/cjs/api/NodeApi.js.map +1 -1
- package/cjs/api/NodeApi.test.js.map +1 -1
- package/cjs/api/OAuth2ClientApi.js +43 -20
- package/cjs/api/OAuth2ClientApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.js +74 -27
- package/cjs/api/OAuth2OIDCApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.test.js.map +1 -1
- package/cjs/api/OAuth2ProviderApi.js +10 -9
- package/cjs/api/OAuth2ProviderApi.js.map +1 -1
- package/cjs/api/PoliciesApi.js +54 -22
- package/cjs/api/PoliciesApi.js.map +1 -1
- package/cjs/api/PoliciesApi.test.js.map +1 -1
- package/cjs/api/PolicySetApi.js +54 -23
- package/cjs/api/PolicySetApi.js.map +1 -1
- package/cjs/api/PolicySetApi.test.js.map +1 -1
- package/cjs/api/RealmApi.js +73 -29
- package/cjs/api/RealmApi.js.map +1 -1
- package/cjs/api/ResourceTypesApi.js +67 -28
- package/cjs/api/ResourceTypesApi.js.map +1 -1
- package/cjs/api/ResourceTypesApi.test.js.map +1 -1
- package/cjs/api/Saml2Api.js +90 -122
- package/cjs/api/Saml2Api.js.map +1 -1
- package/cjs/api/ScriptApi.js +54 -23
- package/cjs/api/ScriptApi.js.map +1 -1
- package/cjs/api/ServerInfoApi.js +23 -10
- package/cjs/api/ServerInfoApi.js.map +1 -1
- package/cjs/api/ServiceApi.js +91 -42
- package/cjs/api/ServiceApi.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +70 -31
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/api/TreeApi.js +43 -20
- package/cjs/api/TreeApi.js.map +1 -1
- package/cjs/api/TreeApi.test.js.map +1 -1
- package/cjs/api/cloud/EnvInfoApi.js +10 -6
- package/cjs/api/cloud/EnvInfoApi.js.map +1 -1
- package/cjs/api/cloud/FeatureApi.js +9 -6
- package/cjs/api/cloud/FeatureApi.js.map +1 -1
- package/cjs/api/cloud/LogApi.js +48 -18
- package/cjs/api/cloud/LogApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.js +109 -35
- package/cjs/api/cloud/SecretsApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
- package/cjs/api/cloud/StartupApi.js +21 -10
- package/cjs/api/cloud/StartupApi.js.map +1 -1
- package/cjs/api/cloud/StartupApi.test.js.map +1 -1
- package/cjs/api/cloud/VariablesApi.js +52 -20
- package/cjs/api/cloud/VariablesApi.js.map +1 -1
- package/cjs/api/cloud/VariablesApi.test.js.map +1 -1
- package/cjs/api/utils/ApiUtils.js +2 -5
- package/cjs/api/utils/ApiUtils.js.map +1 -1
- package/cjs/api/utils/ApiUtils.test.js.map +1 -1
- package/cjs/index.js +22 -17
- package/cjs/index.js.map +1 -1
- package/cjs/lib/FrodoLib.js +142 -0
- package/cjs/lib/FrodoLib.js.map +1 -0
- package/cjs/ops/AdminOps.js +578 -90
- package/cjs/ops/AdminOps.js.map +1 -1
- package/cjs/ops/AgentOps.js +956 -118
- package/cjs/ops/AgentOps.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +155 -87
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.test.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +334 -291
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +241 -46
- package/cjs/ops/ConnectionProfileOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +84 -10
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
- package/cjs/ops/IdmOps.js +97 -81
- package/cjs/ops/IdmOps.js.map +1 -1
- package/cjs/ops/IdmOps.test.js.map +1 -1
- package/cjs/ops/IdpOps.js +275 -42
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/IdpOps.test.js.map +1 -1
- package/cjs/ops/InfoOps.js +42 -27
- package/cjs/ops/InfoOps.js.map +1 -1
- package/cjs/ops/JoseOps.test.js.map +1 -1
- package/cjs/ops/JourneyOps.js +721 -126
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/JourneyOps.test.js.map +1 -1
- package/cjs/ops/ManagedObjectOps.js +79 -12
- package/cjs/ops/ManagedObjectOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +127 -100
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.js +323 -65
- package/cjs/ops/OAuth2ClientOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.test.js.map +1 -1
- package/cjs/ops/OAuth2ProviderOps.js +20 -13
- package/cjs/ops/OAuth2ProviderOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js.map +1 -1
- package/cjs/ops/OrganizationOps.js +67 -12
- package/cjs/ops/OrganizationOps.js.map +1 -1
- package/cjs/ops/PolicyOps.js +476 -136
- package/cjs/ops/PolicyOps.js.map +1 -1
- package/cjs/ops/PolicyOps.test.js.map +1 -1
- package/cjs/ops/PolicySetOps.js +402 -132
- package/cjs/ops/PolicySetOps.js.map +1 -1
- package/cjs/ops/PolicySetOps.test.js.map +1 -1
- package/cjs/ops/RealmOps.js +119 -84
- package/cjs/ops/RealmOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.js +348 -95
- package/cjs/ops/ResourceTypeOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.test.js.map +1 -1
- package/cjs/ops/Saml2Ops.js +407 -145
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/Saml2Ops.test.js.map +1 -1
- package/cjs/ops/ScriptOps.js +256 -79
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/ScriptOps.test.js.map +1 -1
- package/cjs/ops/ServiceOps.js +328 -55
- package/cjs/ops/ServiceOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +349 -54
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/cjs/ops/ThemeOps.test.js.map +1 -1
- package/cjs/ops/cloud/FeatureOps.js +57 -12
- package/cjs/ops/cloud/FeatureOps.js.map +1 -1
- package/cjs/ops/cloud/LogOps.js +136 -6
- package/cjs/ops/cloud/LogOps.js.map +1 -1
- package/cjs/ops/cloud/SecretsOps.js +230 -289
- package/cjs/ops/cloud/SecretsOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.js +101 -18
- package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.test.js.map +1 -1
- package/cjs/ops/cloud/StartupOps.js +64 -9
- package/cjs/ops/cloud/StartupOps.js.map +1 -1
- package/cjs/ops/cloud/VariablesOps.js +100 -175
- package/cjs/ops/cloud/VariablesOps.js.map +1 -1
- package/cjs/ops/utils/Console.js +9 -10
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/DataProtection.js +2 -2
- package/cjs/ops/utils/DataProtection.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js +35 -13
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.js +7 -5
- package/cjs/ops/utils/OpsUtils.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.test.js.map +1 -1
- package/cjs/ops/utils/{ValidationUtils.js → ScriptValidationUtils.js} +1 -1
- package/cjs/ops/utils/ScriptValidationUtils.js.map +1 -0
- package/cjs/ops/utils/ScriptValidationUtils.test.js.map +1 -0
- package/cjs/ops/utils/Version.js +9 -2
- package/cjs/ops/utils/Version.js.map +1 -1
- package/cjs/shared/State.js +455 -210
- package/cjs/shared/State.js.map +1 -1
- package/cjs/shared/State.test.js.map +1 -1
- package/cjs/utils/AutoSetupPolly.js +4 -1
- package/cjs/utils/AutoSetupPolly.js.map +1 -1
- package/esm/api/AgentApi.mjs +75 -27
- package/esm/api/AgentApi.test.mjs +319 -71
- package/esm/api/AuthenticateApi.mjs +15 -4
- package/esm/api/AuthenticateApi.test.mjs +27 -8
- package/esm/api/BaseApi.mjs +43 -19
- package/esm/api/CirclesOfTrustApi.mjs +39 -17
- package/esm/api/IdmConfigApi.mjs +44 -13
- package/esm/api/IdmSystemApi.mjs +7 -3
- package/esm/api/ManagedObjectApi.mjs +44 -20
- package/esm/api/NodeApi.mjs +59 -24
- package/esm/api/NodeApi.test.mjs +158 -40
- package/esm/api/OAuth2ClientApi.mjs +36 -15
- package/esm/api/OAuth2OIDCApi.mjs +69 -20
- package/esm/api/OAuth2OIDCApi.test.mjs +21 -3
- package/esm/api/OAuth2ProviderApi.mjs +8 -6
- package/esm/api/PoliciesApi.mjs +45 -16
- package/esm/api/PoliciesApi.test.mjs +63 -15
- package/esm/api/PolicySetApi.mjs +44 -16
- package/esm/api/PolicySetApi.test.mjs +48 -12
- package/esm/api/RealmApi.mjs +65 -24
- package/esm/api/ResourceTypesApi.mjs +56 -21
- package/esm/api/ResourceTypesApi.test.mjs +58 -14
- package/esm/api/Saml2Api.mjs +75 -89
- package/esm/api/ScriptApi.mjs +45 -17
- package/esm/api/ServerInfoApi.mjs +19 -6
- package/esm/api/ServiceApi.mjs +77 -26
- package/esm/api/SocialIdentityProvidersApi.mjs +58 -23
- package/esm/api/TreeApi.mjs +36 -15
- package/esm/api/TreeApi.test.mjs +129 -34
- package/esm/api/cloud/EnvInfoApi.mjs +8 -3
- package/esm/api/cloud/FeatureApi.mjs +7 -3
- package/esm/api/cloud/LogApi.mjs +38 -11
- package/esm/api/cloud/SecretsApi.mjs +89 -21
- package/esm/api/cloud/SecretsApi.test.mjs +193 -50
- package/esm/api/cloud/StartupApi.mjs +17 -6
- package/esm/api/cloud/StartupApi.test.mjs +28 -11
- package/esm/api/cloud/VariablesApi.mjs +43 -14
- package/esm/api/cloud/VariablesApi.test.mjs +124 -33
- package/esm/api/utils/ApiUtils.mjs +2 -4
- package/esm/api/utils/ApiUtils.test.mjs +14 -6
- package/esm/index.mjs +3 -4
- package/esm/lib/FrodoLib.mjs +127 -0
- package/esm/ops/AdminOps.mjs +500 -71
- package/esm/ops/AgentOps.mjs +773 -81
- package/esm/ops/AgentOps.test.mjs +296 -113
- package/esm/ops/AuthenticateOps.mjs +136 -64
- package/esm/ops/AuthenticateOps.test.mjs +7 -4
- package/esm/ops/CirclesOfTrustOps.mjs +278 -229
- package/esm/ops/ConnectionProfileOps.mjs +206 -35
- package/esm/ops/ConnectionProfileOps.test.mjs +25 -5
- package/esm/ops/EmailTemplateOps.mjs +66 -6
- package/esm/ops/EmailTemplateOps.test.mjs +32 -11
- package/esm/ops/IdmOps.mjs +60 -47
- package/esm/ops/IdmOps.test.mjs +54 -18
- package/esm/ops/IdpOps.mjs +227 -31
- package/esm/ops/IdpOps.test.mjs +57 -20
- package/esm/ops/InfoOps.mjs +36 -23
- package/esm/ops/JoseOps.test.mjs +8 -0
- package/esm/ops/JourneyOps.mjs +634 -96
- package/esm/ops/JourneyOps.test.mjs +73 -31
- package/esm/ops/ManagedObjectOps.mjs +66 -10
- package/esm/ops/NodeOps.mjs +108 -85
- package/esm/ops/OAuth2ClientOps.mjs +258 -42
- package/esm/ops/OAuth2ClientOps.test.mjs +80 -29
- package/esm/ops/OAuth2ProviderOps.mjs +11 -8
- package/esm/ops/OrganizationOps.mjs +56 -8
- package/esm/ops/PolicyOps.mjs +379 -93
- package/esm/ops/PolicyOps.test.mjs +180 -65
- package/esm/ops/PolicySetOps.mjs +311 -88
- package/esm/ops/PolicySetOps.test.mjs +108 -39
- package/esm/ops/RealmOps.mjs +85 -65
- package/esm/ops/ResourceTypeOps.mjs +268 -61
- package/esm/ops/ResourceTypeOps.test.mjs +113 -27
- package/esm/ops/Saml2Ops.mjs +346 -106
- package/esm/ops/Saml2Ops.test.mjs +117 -81
- package/esm/ops/ScriptOps.mjs +202 -56
- package/esm/ops/ScriptOps.test.mjs +64 -23
- package/esm/ops/ServiceOps.mjs +258 -27
- package/esm/ops/ThemeOps.mjs +300 -33
- package/esm/ops/ThemeOps.test.mjs +197 -47
- package/esm/ops/cloud/FeatureOps.mjs +45 -10
- package/esm/ops/cloud/LogOps.mjs +117 -4
- package/esm/ops/cloud/SecretsOps.mjs +123 -204
- package/esm/ops/cloud/ServiceAccountOps.mjs +85 -15
- package/esm/ops/cloud/ServiceAccountOps.test.mjs +16 -6
- package/esm/ops/cloud/StartupOps.mjs +49 -6
- package/esm/ops/cloud/VariablesOps.mjs +58 -120
- package/esm/ops/utils/Console.mjs +9 -8
- package/esm/ops/utils/DataProtection.mjs +2 -3
- package/esm/ops/utils/ExportImportUtils.mjs +28 -8
- package/esm/ops/utils/OpsUtils.mjs +4 -3
- package/esm/ops/utils/OpsUtils.test.mjs +21 -5
- package/esm/ops/utils/{ValidationUtils.mjs → ScriptValidationUtils.mjs} +1 -1
- package/esm/ops/utils/{ValidationUtils.test.mjs → ScriptValidationUtils.test.mjs} +2 -2
- package/esm/ops/utils/Version.mjs +8 -2
- package/esm/shared/State.mjs +459 -145
- package/esm/shared/State.test.mjs +8 -0
- package/esm/utils/AutoSetupPolly.mjs +4 -1
- package/package.json +1 -1
- package/types/api/AgentApi.d.ts +37 -8
- package/types/api/AgentApi.d.ts.map +1 -1
- package/types/api/ApiTypes.d.ts +12 -0
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/AuthenticateApi.d.ts +13 -3
- package/types/api/AuthenticateApi.d.ts.map +1 -1
- package/types/api/BaseApi.d.ts +36 -7
- package/types/api/BaseApi.d.ts.map +1 -1
- package/types/api/CirclesOfTrustApi.d.ts +21 -7
- package/types/api/CirclesOfTrustApi.d.ts.map +1 -1
- package/types/api/IdmConfigApi.d.ts +28 -13
- package/types/api/IdmConfigApi.d.ts.map +1 -1
- package/types/api/IdmSystemApi.d.ts +4 -1
- package/types/api/IdmSystemApi.d.ts.map +1 -1
- package/types/api/ManagedObjectApi.d.ts +25 -10
- package/types/api/ManagedObjectApi.d.ts.map +1 -1
- package/types/api/NodeApi.d.ts +31 -9
- package/types/api/NodeApi.d.ts.map +1 -1
- package/types/api/OAuth2ClientApi.d.ts +18 -5
- package/types/api/OAuth2ClientApi.d.ts.map +1 -1
- package/types/api/OAuth2OIDCApi.d.ts +45 -11
- package/types/api/OAuth2OIDCApi.d.ts.map +1 -1
- package/types/api/OAuth2ProviderApi.d.ts +4 -1
- package/types/api/OAuth2ProviderApi.d.ts.map +1 -1
- package/types/api/PoliciesApi.d.ts +21 -5
- package/types/api/PoliciesApi.d.ts.map +1 -1
- package/types/api/PolicySetApi.d.ts +20 -5
- package/types/api/PolicySetApi.d.ts.map +1 -1
- package/types/api/RealmApi.d.ts +26 -10
- package/types/api/RealmApi.d.ts.map +1 -1
- package/types/api/ResourceTypesApi.d.ts +27 -8
- package/types/api/ResourceTypesApi.d.ts.map +1 -1
- package/types/api/Saml2Api.d.ts +39 -32
- package/types/api/Saml2Api.d.ts.map +1 -1
- package/types/api/ScriptApi.d.ts +21 -5
- package/types/api/ScriptApi.d.ts.map +1 -1
- package/types/api/ServerInfoApi.d.ts +9 -2
- package/types/api/ServerInfoApi.d.ts.map +1 -1
- package/types/api/ServiceApi.d.ts +41 -7
- package/types/api/ServiceApi.d.ts.map +1 -1
- package/types/api/SocialIdentityProvidersApi.d.ts +30 -8
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
- package/types/api/TreeApi.d.ts +18 -4
- package/types/api/TreeApi.d.ts.map +1 -1
- package/types/api/cloud/EnvInfoApi.d.ts +4 -1
- package/types/api/cloud/EnvInfoApi.d.ts.map +1 -1
- package/types/api/cloud/FeatureApi.d.ts +4 -1
- package/types/api/cloud/FeatureApi.d.ts.map +1 -1
- package/types/api/cloud/LogApi.d.ts +24 -6
- package/types/api/cloud/LogApi.d.ts.map +1 -1
- package/types/api/cloud/SecretsApi.d.ts +50 -10
- package/types/api/cloud/SecretsApi.d.ts.map +1 -1
- package/types/api/cloud/StartupApi.d.ts +7 -2
- package/types/api/cloud/StartupApi.d.ts.map +1 -1
- package/types/api/cloud/VariablesApi.d.ts +23 -5
- package/types/api/cloud/VariablesApi.d.ts.map +1 -1
- package/types/api/utils/ApiUtils.d.ts +3 -2
- package/types/api/utils/ApiUtils.d.ts.map +1 -1
- package/types/index.d.ts +2 -2
- package/types/index.d.ts.map +1 -1
- package/types/lib/FrodoLib.d.ts +95 -0
- package/types/lib/FrodoLib.d.ts.map +1 -0
- package/types/ops/AdminOps.d.ts +71 -12
- package/types/ops/AdminOps.d.ts.map +1 -1
- package/types/ops/AgentOps.d.ts +345 -36
- package/types/ops/AgentOps.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts +18 -5
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/CirclesOfTrustOps.d.ts +76 -26
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
- package/types/ops/ConnectionProfileOps.d.ts +88 -9
- package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
- package/types/ops/EmailTemplateOps.d.ts +36 -3
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/ops/IdmOps.d.ts +28 -40
- package/types/ops/IdmOps.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts +88 -10
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/ops/InfoOps.d.ts +12 -1
- package/types/ops/InfoOps.d.ts.map +1 -1
- package/types/ops/JourneyOps.d.ts +237 -34
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/ManagedObjectOps.d.ts +37 -8
- package/types/ops/ManagedObjectOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts +61 -6
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OAuth2ClientOps.d.ts +104 -10
- package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
- package/types/ops/OAuth2ProviderOps.d.ts +8 -5
- package/types/ops/OAuth2ProviderOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +12 -1
- package/types/ops/OpsTypes.d.ts.map +1 -1
- package/types/ops/OrganizationOps.d.ts +24 -3
- package/types/ops/OrganizationOps.d.ts.map +1 -1
- package/types/ops/PolicyOps.d.ts +103 -28
- package/types/ops/PolicyOps.d.ts.map +1 -1
- package/types/ops/PolicySetOps.d.ts +76 -30
- package/types/ops/PolicySetOps.d.ts.map +1 -1
- package/types/ops/RealmOps.d.ts +34 -14
- package/types/ops/RealmOps.d.ts.map +1 -1
- package/types/ops/ResourceTypeOps.d.ts +116 -29
- package/types/ops/ResourceTypeOps.d.ts.map +1 -1
- package/types/ops/Saml2Ops.d.ts +124 -41
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/ScriptOps.d.ts +88 -23
- package/types/ops/ScriptOps.d.ts.map +1 -1
- package/types/ops/ServiceOps.d.ts +94 -8
- package/types/ops/ServiceOps.d.ts.map +1 -1
- package/types/ops/ThemeOps.d.ts +113 -9
- package/types/ops/ThemeOps.d.ts.map +1 -1
- package/types/ops/cloud/FeatureOps.d.ts +23 -2
- package/types/ops/cloud/FeatureOps.d.ts.map +1 -1
- package/types/ops/cloud/LogOps.d.ts +61 -3
- package/types/ops/cloud/LogOps.d.ts.map +1 -1
- package/types/ops/cloud/SecretsOps.d.ts +77 -63
- package/types/ops/cloud/SecretsOps.d.ts.map +1 -1
- package/types/ops/cloud/ServiceAccountOps.d.ts +48 -3
- package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -1
- package/types/ops/cloud/StartupOps.d.ts +25 -2
- package/types/ops/cloud/StartupOps.d.ts.map +1 -1
- package/types/ops/cloud/VariablesOps.d.ts +39 -39
- package/types/ops/cloud/VariablesOps.d.ts.map +1 -1
- package/types/ops/utils/Console.d.ts.map +1 -1
- package/types/ops/utils/DataProtection.d.ts +1 -1
- package/types/ops/utils/DataProtection.d.ts.map +1 -1
- package/types/ops/utils/ExportImportUtils.d.ts +29 -11
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
- package/types/ops/utils/OpsUtils.d.ts +4 -1
- package/types/ops/utils/OpsUtils.d.ts.map +1 -1
- package/types/ops/utils/ScriptValidationUtils.d.ts.map +1 -0
- package/types/ops/utils/Version.d.ts +5 -1
- package/types/ops/utils/Version.d.ts.map +1 -1
- package/types/shared/State.d.ts +80 -177
- package/types/shared/State.d.ts.map +1 -1
- package/types/utils/AutoSetupPolly.d.ts.map +1 -1
- package/cjs/ops/utils/ValidationUtils.js.map +0 -1
- package/cjs/ops/utils/ValidationUtils.test.js.map +0 -1
- package/types/ops/utils/ValidationUtils.d.ts.map +0 -1
- /package/types/ops/utils/{ValidationUtils.d.ts → ScriptValidationUtils.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JourneyOps.test.js","names":["_index","require","_ForgeRockApiMockEngine","_AutoSetupPolly","globalConfig","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","autoSetupPolly","state","setDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","stageJourney","_x","_stageJourney","journey","create","length","Journey","getJourney","id","deleteJourney","deep","verbose","progress","importJourney","reUuid","deps","describe","journey1","journey2","journey3","journey4","journey5","journey6","journey7","journey8","journey9","beforeAll","process","env","FRODO_POLLY_MODE","afterAll","FRODO_RECORD_PHASE","test","expect","getJourneys","toBeDefined","journeys","toMatchSnapshot","exportJourney","concat","response","useStringArrays","meta","any","journeyExport","assertions","toBeTruthy","enableJourney","result","disableJourney"],"sources":["ops/JourneyOps.test.ts"],"sourcesContent":["/**\n * To record and update snapshots, you must perform 3 steps in order:\n *\n * 1. Record API responses & update ESM snapshots\n *\n * This step breaks down into 4 phases:\n *\n * Phase 1: Record Non-destructive tests\n * Phase 2: Record Group 1 of DESTRUCTIVE tests - Deletes by ID\n * Phase 3: Record Group 2 of DESTRUCTIVE tests - Deletes by tag\n * Phase 4: Record Group 3 of DESTRUCTIVE tests - Delete all\n *\n * Because destructive tests interfere with the recording of non-destructive\n * tests and also interfere among themselves, they have to be run in groups\n * of non-interfering tests.\n *\n * To record and update ESM snapshots, you must call the test:record\n * script and override all the connection state variables required\n * to connect to the env to record from and also indicate the phase:\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=1 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * THESE TESTS ARE DESTRUCTIVE!!! DO NOT RUN AGAINST AN ENV WITH ACTIVE JOURNEYS!!!\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=2 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=3 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=4 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * The above command assumes that you have a connection profile for\n * 'frodo-dev' on your development machine.\n *\n * 2. Update CJS snapshots\n *\n * After recording, the ESM snapshots will already be updated as that happens\n * in one go, but you must manually update the CJS snapshots by running:\n *\n * FRODO_DEBUG=1 npm run test:update JourneyOps\n *\n * 3. Test your changes\n *\n * If 1 and 2 didn't produce any errors, you are ready to run the tests in\n * replay mode and make sure they all succeed as well:\n *\n * npm run test:only JourneyOps\n *\n * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output\n * in case things don't function as expected\n */\nimport { Journey, state } from '../index';\nimport { getJourney } from '../test/mocks/ForgeRockApiMockEngine';\nimport { autoSetupPolly } from '../utils/AutoSetupPolly';\nimport * as globalConfig from '../storage/StaticStorage';\n\nautoSetupPolly();\n\nstate.setDeploymentType(globalConfig.CLOUD_DEPLOYMENT_TYPE_KEY);\n\nasync function stageJourney(journey: { id: string }, create = true) {\n // delete if exists, then create\n try {\n await Journey.getJourney(journey.id);\n await Journey.deleteJourney(journey.id, {\n deep: true,\n verbose: false,\n progress: false,\n });\n } catch (error) {\n // ignore\n } finally {\n if (create) {\n await Journey.importJourney(getJourney(journey.id), {\n reUuid: false,\n deps: true,\n });\n }\n }\n}\n\ndescribe('JourneyOps', () => {\n const journey1 = {\n id: 'FrodoTestJourney1',\n };\n const journey2 = {\n id: 'FrodoTestJourney2',\n };\n const journey3 = {\n id: 'FrodoTestJourney3',\n };\n const journey4 = {\n id: 'FrodoTestJourney4',\n };\n const journey5 = {\n id: 'FrodoTestJourney5',\n };\n const journey6 = {\n id: 'FrodoTestJourney6',\n };\n const journey7 = {\n id: 'FrodoTestJourney7',\n };\n const journey8 = {\n id: 'FrodoTestJourney8',\n };\n const journey9 = {\n id: 'FrodoTestJourney9',\n };\n // in recording mode, setup test data before recording\n beforeAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1);\n await stageJourney(journey2);\n await stageJourney(journey3);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6);\n await stageJourney(journey7);\n await stageJourney(journey8);\n await stageJourney(journey9);\n }\n });\n // in recording mode, remove test data after recording\n afterAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1, false);\n await stageJourney(journey2, false);\n await stageJourney(journey3, false);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6, false);\n await stageJourney(journey7, false);\n await stageJourney(journey8, false);\n await stageJourney(journey9, false);\n }\n });\n // Phase 1\n if (\n !process.env.FRODO_POLLY_MODE ||\n (process.env.FRODO_POLLY_MODE === 'record' &&\n process.env.FRODO_RECORD_PHASE === '1')\n ) {\n describe('getJourneys()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.getJourneys).toBeDefined();\n });\n\n test('1: Get all journeys', async () => {\n const journeys = await Journey.getJourneys();\n expect(journeys).toMatchSnapshot();\n });\n });\n\n describe('exportJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.exportJourney).toBeDefined();\n });\n\n test(`1: Export journey '${journey3.id}' w/o dependencies`, async () => {\n const response = await Journey.exportJourney(journey3.id, {\n useStringArrays: false,\n deps: false,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n\n test(`2: Export journey '${journey3.id}' w/ dependencies`, async () => {\n const response = await Journey.exportJourney(journey3.id, {\n useStringArrays: false,\n deps: true,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n });\n\n describe('importJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.importJourney).toBeDefined();\n });\n\n test(`1: Import journey '${journey4.id}' w/o dependencies`, async () => {\n const journeyExport = getJourney(journey4.id);\n expect.assertions(1);\n const response = await Journey.importJourney(journeyExport, {\n reUuid: false,\n deps: false,\n });\n expect(response).toBeTruthy();\n });\n\n test(`2: Import journey '${journey5.id}' w/ dependencies`, async () => {\n const journeyExport = getJourney(journey5.id);\n expect.assertions(1);\n const response = await Journey.importJourney(journeyExport, {\n reUuid: false,\n deps: true,\n });\n expect(response).toBeTruthy();\n });\n });\n\n describe('enableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.enableJourney).toBeDefined();\n });\n\n test(`1: Enable disabled journey '${journey6.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.enableJourney(journey6.id);\n expect(result).toBeTruthy();\n });\n\n test(`2: Enable already enabled journey '${journey7.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.enableJourney(journey7.id);\n expect(result).toBeTruthy();\n });\n });\n\n describe('disableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.disableJourney).toBeDefined();\n });\n\n test(`1: Disable enabled journey '${journey8.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.disableJourney(journey8.id);\n expect(result).toBeTruthy();\n });\n\n test(`2: Disable already disabled journey '${journey9.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.disableJourney(journey9.id);\n expect(result).toBeTruthy();\n });\n });\n }\n});\n"],"mappings":";;AAgDA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAAyD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,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ApB,iBAAA,CAAK,aAAY;QACrE6C,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,IAAMG,MAAM,SAAS1C,cAAO,CAACyC,aAAa,CAACxB,QAAQ,CAACf,EAAE,CAAC;QACvDyB,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,EAAC;IACJ,CAAC,CAAC;IAEF9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM;MACjCgB,IAAI,CAAC,0BAA0B,eAAA5C,iBAAA,CAAE,aAAY;QAC3C6C,MAAM,CAAC3B,cAAO,CAAC2C,cAAc,CAAC,CAACd,WAAW,CAAC,CAAC;MAC9C,CAAC,EAAC;MAEFH,IAAI,gCAAAO,MAAA,CAAgCf,QAAQ,CAAChB,EAAE,qBAAApB,iBAAA,CAAK,aAAY;QAC9D6C,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,IAAMG,MAAM,SAAS1C,cAAO,CAAC2C,cAAc,CAACzB,QAAQ,CAAChB,EAAE,CAAC;QACxDyB,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,EAAC;MAEFd,IAAI,yCAAAO,MAAA,CAAyCd,QAAQ,CAACjB,EAAE,qBAAApB,iBAAA,CAAK,aAAY;QACvE6C,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,IAAMG,MAAM,SAAS1C,cAAO,CAAC2C,cAAc,CAACxB,QAAQ,CAACjB,EAAE,CAAC;QACxDyB,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,EAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"JourneyOps.test.js","names":["_index","require","JourneyOps","_interopRequireWildcard","_ForgeRockApiMockEngine","_AutoSetupPolly","globalConfig","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","autoSetupPolly","state","setDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","stageJourney","_x","_stageJourney","journey","create","length","getJourney","journeyId","id","deleteJourney","options","deep","verbose","progress","importJourney","treeObject","reUuid","deps","describe","journey1","journey2","journey3","journey4","journey5","journey6","journey7","journey8","journey9","beforeAll","process","env","FRODO_POLLY_MODE","afterAll","FRODO_RECORD_PHASE","test","expect","getJourneys","toBeDefined","journeys","toMatchSnapshot","exportJourney","concat","response","treeId","useStringArrays","meta","any","journeyExport","assertions","toBeTruthy","enableJourney","result","disableJourney"],"sources":["ops/JourneyOps.test.ts"],"sourcesContent":["/**\n * To record and update snapshots, you must perform 3 steps in order:\n *\n * 1. Record API responses & update ESM snapshots\n *\n * This step breaks down into 4 phases:\n *\n * Phase 1: Record Non-destructive tests\n * Phase 2: Record Group 1 of DESTRUCTIVE tests - Deletes by ID\n * Phase 3: Record Group 2 of DESTRUCTIVE tests - Deletes by tag\n * Phase 4: Record Group 3 of DESTRUCTIVE tests - Delete all\n *\n * Because destructive tests interfere with the recording of non-destructive\n * tests and also interfere among themselves, they have to be run in groups\n * of non-interfering tests.\n *\n * To record and update ESM snapshots, you must call the test:record\n * script and override all the connection state variables required\n * to connect to the env to record from and also indicate the phase:\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=1 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * THESE TESTS ARE DESTRUCTIVE!!! DO NOT RUN AGAINST AN ENV WITH ACTIVE JOURNEYS!!!\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=2 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=3 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=4 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * The above command assumes that you have a connection profile for\n * 'frodo-dev' on your development machine.\n *\n * 2. Update CJS snapshots\n *\n * After recording, the ESM snapshots will already be updated as that happens\n * in one go, but you must manually update the CJS snapshots by running:\n *\n * FRODO_DEBUG=1 npm run test:update JourneyOps\n *\n * 3. Test your changes\n *\n * If 1 and 2 didn't produce any errors, you are ready to run the tests in\n * replay mode and make sure they all succeed as well:\n *\n * npm run test:only JourneyOps\n *\n * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output\n * in case things don't function as expected\n */\nimport { state } from '../index';\nimport * as JourneyOps from './JourneyOps';\nimport { getJourney } from '../test/mocks/ForgeRockApiMockEngine';\nimport { autoSetupPolly } from '../utils/AutoSetupPolly';\nimport * as globalConfig from '../storage/StaticStorage';\n\nautoSetupPolly();\n\nstate.setDeploymentType(globalConfig.CLOUD_DEPLOYMENT_TYPE_KEY);\n\nasync function stageJourney(journey: { id: string }, create = true) {\n // delete if exists, then create\n try {\n await JourneyOps.getJourney({ journeyId: journey.id, state });\n await JourneyOps.deleteJourney({\n journeyId: journey.id,\n options: {\n deep: true,\n verbose: false,\n progress: false,\n },\n state,\n });\n } catch (error) {\n // ignore\n } finally {\n if (create) {\n await JourneyOps.importJourney({\n treeObject: getJourney(journey.id),\n options: {\n reUuid: false,\n deps: true,\n },\n state,\n });\n }\n }\n}\n\ndescribe('JourneyOps', () => {\n const journey1 = {\n id: 'FrodoTestJourney1',\n };\n const journey2 = {\n id: 'FrodoTestJourney2',\n };\n const journey3 = {\n id: 'FrodoTestJourney3',\n };\n const journey4 = {\n id: 'FrodoTestJourney4',\n };\n const journey5 = {\n id: 'FrodoTestJourney5',\n };\n const journey6 = {\n id: 'FrodoTestJourney6',\n };\n const journey7 = {\n id: 'FrodoTestJourney7',\n };\n const journey8 = {\n id: 'FrodoTestJourney8',\n };\n const journey9 = {\n id: 'FrodoTestJourney9',\n };\n // in recording mode, setup test data before recording\n beforeAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1);\n await stageJourney(journey2);\n await stageJourney(journey3);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6);\n await stageJourney(journey7);\n await stageJourney(journey8);\n await stageJourney(journey9);\n }\n });\n // in recording mode, remove test data after recording\n afterAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1, false);\n await stageJourney(journey2, false);\n await stageJourney(journey3, false);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6, false);\n await stageJourney(journey7, false);\n await stageJourney(journey8, false);\n await stageJourney(journey9, false);\n }\n });\n // Phase 1\n if (\n !process.env.FRODO_POLLY_MODE ||\n (process.env.FRODO_POLLY_MODE === 'record' &&\n process.env.FRODO_RECORD_PHASE === '1')\n ) {\n describe('getJourneys()', () => {\n test('0: Method is implemented', async () => {\n expect(JourneyOps.getJourneys).toBeDefined();\n });\n\n test('1: Get all journeys', async () => {\n const journeys = await JourneyOps.getJourneys({ state });\n expect(journeys).toMatchSnapshot();\n });\n });\n\n describe('exportJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(JourneyOps.exportJourney).toBeDefined();\n });\n\n test(`1: Export journey '${journey3.id}' w/o dependencies`, async () => {\n const response = await JourneyOps.exportJourney({\n treeId: journey3.id,\n options: {\n useStringArrays: false,\n deps: false,\n },\n state,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n\n test(`2: Export journey '${journey3.id}' w/ dependencies`, async () => {\n const response = await JourneyOps.exportJourney({\n treeId: journey3.id,\n options: {\n useStringArrays: false,\n deps: true,\n },\n state,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n });\n\n describe('importJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(JourneyOps.importJourney).toBeDefined();\n });\n\n test(`1: Import journey '${journey4.id}' w/o dependencies`, async () => {\n const journeyExport = getJourney(journey4.id);\n expect.assertions(1);\n const response = await JourneyOps.importJourney({\n treeObject: journeyExport,\n options: {\n reUuid: false,\n deps: false,\n },\n state,\n });\n expect(response).toBeTruthy();\n });\n\n test(`2: Import journey '${journey5.id}' w/ dependencies`, async () => {\n const journeyExport = getJourney(journey5.id);\n expect.assertions(1);\n const response = await JourneyOps.importJourney({\n treeObject: journeyExport,\n options: {\n reUuid: false,\n deps: true,\n },\n state,\n });\n expect(response).toBeTruthy();\n });\n });\n\n describe('enableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(JourneyOps.enableJourney).toBeDefined();\n });\n\n test(`1: Enable disabled journey '${journey6.id}'`, async () => {\n expect.assertions(1);\n const result = await JourneyOps.enableJourney({\n journeyId: journey6.id,\n state,\n });\n expect(result).toBeTruthy();\n });\n\n test(`2: Enable already enabled journey '${journey7.id}'`, async () => {\n expect.assertions(1);\n const result = await JourneyOps.enableJourney({\n journeyId: journey7.id,\n state,\n });\n expect(result).toBeTruthy();\n });\n });\n\n describe('disableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(JourneyOps.disableJourney).toBeDefined();\n });\n\n test(`1: Disable enabled journey '${journey8.id}'`, async () => {\n expect.assertions(1);\n const result = await JourneyOps.disableJourney({\n journeyId: journey8.id,\n state,\n });\n expect(result).toBeTruthy();\n });\n\n test(`2: Disable already disabled journey '${journey9.id}'`, async () => {\n expect.assertions(1);\n const result = await JourneyOps.disableJourney({\n journeyId: journey9.id,\n state,\n });\n expect(result).toBeTruthy();\n });\n });\n }\n});\n"],"mappings":";;AAgDA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAH,uBAAA,CAAAF,OAAA;AAAyD,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,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,0BAA0B,eAAA9C,iBAAA,CAAE,aAAY;QAC3C+C,MAAM,CAACvF,UAAU,CAACwG,cAAc,CAAC,CAACf,WAAW,CAAC,CAAC;MACjD,CAAC,EAAC;MAEFH,IAAI,gCAAAO,MAAA,CAAgCf,QAAQ,CAAClB,EAAE,qBAAApB,iBAAA,CAAK,aAAY;QAC9D+C,MAAM,CAACa,UAAU,CAAC,CAAC,CAAC;QACpB,IAAMG,MAAM,SAASvG,UAAU,CAACwG,cAAc,CAAC;UAC7C7C,SAAS,EAAEmB,QAAQ,CAAClB,EAAE;UACtBX,KAAK,EAALA;QACF,CAAC,CAAC;QACFsC,MAAM,CAACgB,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,EAAC;MAEFf,IAAI,yCAAAO,MAAA,CAAyCd,QAAQ,CAACnB,EAAE,qBAAApB,iBAAA,CAAK,aAAY;QACvE+C,MAAM,CAACa,UAAU,CAAC,CAAC,CAAC;QACpB,IAAMG,MAAM,SAASvG,UAAU,CAACwG,cAAc,CAAC;UAC7C7C,SAAS,EAAEoB,QAAQ,CAACnB,EAAE;UACtBX,KAAK,EAALA;QACF,CAAC,CAAC;QACFsC,MAAM,CAACgB,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,EAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
@@ -3,30 +3,86 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.default = void 0;
|
|
6
7
|
exports.resolveFullName = resolveFullName;
|
|
7
8
|
exports.resolveUserName = resolveUserName;
|
|
8
9
|
var _ManagedObjectApi = require("../api/ManagedObjectApi");
|
|
10
|
+
var _ApiUtils = require("../api/utils/ApiUtils");
|
|
9
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
12
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
class ManagedObjectOps {
|
|
14
|
+
constructor(state) {
|
|
15
|
+
this.state = state;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a managed object's uuid to a human readable username
|
|
20
|
+
* @param {string} type managed object type, e.g. teammember or alpha_user
|
|
21
|
+
* @param {string} id managed object _id
|
|
22
|
+
* @returns {string} resolved username or uuid if any error occurs during reslution
|
|
23
|
+
*/
|
|
24
|
+
resolveUserName(type, id) {
|
|
25
|
+
var _this = this;
|
|
26
|
+
return _asyncToGenerator(function* () {
|
|
27
|
+
return resolveUserName({
|
|
28
|
+
type,
|
|
29
|
+
id,
|
|
30
|
+
state: _this.state
|
|
31
|
+
});
|
|
32
|
+
})();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a managed object's uuid to a human readable full name
|
|
37
|
+
* @param {string} type managed object type, e.g. teammember or alpha_user
|
|
38
|
+
* @param {string} id managed object _id
|
|
39
|
+
* @returns {string} resolved full name or uuid if any error occurs during reslution
|
|
40
|
+
*/
|
|
41
|
+
resolveFullName(type, id) {
|
|
42
|
+
var _this2 = this;
|
|
43
|
+
return _asyncToGenerator(function* () {
|
|
44
|
+
return resolveFullName({
|
|
45
|
+
type,
|
|
46
|
+
id,
|
|
47
|
+
state: _this2.state
|
|
48
|
+
});
|
|
49
|
+
})();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
11
53
|
/**
|
|
12
54
|
* Resolve a managed object's uuid to a human readable username
|
|
13
|
-
* @param {
|
|
14
|
-
* @param {
|
|
15
|
-
* @
|
|
55
|
+
* @param {string} type managed object type, e.g. teammember or alpha_user
|
|
56
|
+
* @param {string} id managed object _id
|
|
57
|
+
* @param {State} state library state
|
|
58
|
+
* @returns {string} resolved username or uuid if any error occurs during reslution
|
|
16
59
|
*/
|
|
17
|
-
|
|
60
|
+
exports.default = ManagedObjectOps;
|
|
61
|
+
function resolveUserName(_x) {
|
|
18
62
|
return _resolveUserName.apply(this, arguments);
|
|
19
63
|
}
|
|
20
64
|
/**
|
|
21
65
|
* Resolve a managed object's uuid to a human readable full name
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {
|
|
24
|
-
* @
|
|
66
|
+
* @param {string} type managed object type, e.g. teammember or alpha_user
|
|
67
|
+
* @param {string} id managed object _id
|
|
68
|
+
* @param {State} state library state
|
|
69
|
+
* @returns {string} resolved full name or uuid if any error occurs during reslution
|
|
25
70
|
*/
|
|
26
71
|
function _resolveUserName() {
|
|
27
|
-
_resolveUserName = _asyncToGenerator(function* (
|
|
72
|
+
_resolveUserName = _asyncToGenerator(function* (_ref) {
|
|
73
|
+
var {
|
|
74
|
+
type,
|
|
75
|
+
id,
|
|
76
|
+
state
|
|
77
|
+
} = _ref;
|
|
28
78
|
try {
|
|
29
|
-
return (yield (0, _ManagedObjectApi.getManagedObject)(
|
|
79
|
+
return (yield (0, _ManagedObjectApi.getManagedObject)({
|
|
80
|
+
baseUrl: (0, _ApiUtils.getTenantURL)(state.getHost()),
|
|
81
|
+
type,
|
|
82
|
+
id,
|
|
83
|
+
fields: ['userName'],
|
|
84
|
+
state
|
|
85
|
+
})).userName;
|
|
30
86
|
} catch (error) {
|
|
31
87
|
// eslint-disable-next-line no-empty
|
|
32
88
|
}
|
|
@@ -34,13 +90,24 @@ function _resolveUserName() {
|
|
|
34
90
|
});
|
|
35
91
|
return _resolveUserName.apply(this, arguments);
|
|
36
92
|
}
|
|
37
|
-
function resolveFullName(
|
|
93
|
+
function resolveFullName(_x2) {
|
|
38
94
|
return _resolveFullName.apply(this, arguments);
|
|
39
95
|
}
|
|
40
96
|
function _resolveFullName() {
|
|
41
|
-
_resolveFullName = _asyncToGenerator(function* (
|
|
97
|
+
_resolveFullName = _asyncToGenerator(function* (_ref2) {
|
|
98
|
+
var {
|
|
99
|
+
type,
|
|
100
|
+
id,
|
|
101
|
+
state
|
|
102
|
+
} = _ref2;
|
|
42
103
|
try {
|
|
43
|
-
var managedObject = yield (0, _ManagedObjectApi.getManagedObject)(
|
|
104
|
+
var managedObject = yield (0, _ManagedObjectApi.getManagedObject)({
|
|
105
|
+
baseUrl: (0, _ApiUtils.getTenantURL)(state.getHost()),
|
|
106
|
+
type,
|
|
107
|
+
id,
|
|
108
|
+
fields: ['givenName', 'sn'],
|
|
109
|
+
state
|
|
110
|
+
});
|
|
44
111
|
return "".concat(managedObject.givenName, " ").concat(managedObject.sn);
|
|
45
112
|
} catch (error) {
|
|
46
113
|
// eslint-disable-next-line no-empty
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedObjectOps.js","names":["_ManagedObjectApi","require","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","
|
|
1
|
+
{"version":3,"file":"ManagedObjectOps.js","names":["_ManagedObjectApi","require","_ApiUtils","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","ManagedObjectOps","constructor","state","resolveUserName","type","id","_this","resolveFullName","_this2","exports","default","_x","_resolveUserName","_ref","getManagedObject","baseUrl","getTenantURL","getHost","fields","userName","_x2","_resolveFullName","_ref2","managedObject","concat","givenName","sn"],"sources":["ops/ManagedObjectOps.ts"],"sourcesContent":["import { getManagedObject } from '../api/ManagedObjectApi';\nimport { getTenantURL } from '../api/utils/ApiUtils';\nimport State from '../shared/State';\n\nexport default class ManagedObjectOps {\n state: State;\n constructor(state: State) {\n this.state = state;\n }\n\n /**\n * Resolve a managed object's uuid to a human readable username\n * @param {string} type managed object type, e.g. teammember or alpha_user\n * @param {string} id managed object _id\n * @returns {string} resolved username or uuid if any error occurs during reslution\n */\n async resolveUserName(type: string, id: string) {\n return resolveUserName({ type, id, state: this.state });\n }\n\n /**\n * Resolve a managed object's uuid to a human readable full name\n * @param {string} type managed object type, e.g. teammember or alpha_user\n * @param {string} id managed object _id\n * @returns {string} resolved full name or uuid if any error occurs during reslution\n */\n async resolveFullName(type: string, id: string) {\n return resolveFullName({ type, id, state: this.state });\n }\n}\n\n/**\n * Resolve a managed object's uuid to a human readable username\n * @param {string} type managed object type, e.g. teammember or alpha_user\n * @param {string} id managed object _id\n * @param {State} state library state\n * @returns {string} resolved username or uuid if any error occurs during reslution\n */\nexport async function resolveUserName({\n type,\n id,\n state,\n}: {\n type: string;\n id: string;\n state: State;\n}) {\n try {\n return (\n await getManagedObject({\n baseUrl: getTenantURL(state.getHost()),\n type,\n id,\n fields: ['userName'],\n state,\n })\n ).userName;\n } catch (error) {\n // eslint-disable-next-line no-empty\n }\n return id;\n}\n\n/**\n * Resolve a managed object's uuid to a human readable full name\n * @param {string} type managed object type, e.g. teammember or alpha_user\n * @param {string} id managed object _id\n * @param {State} state library state\n * @returns {string} resolved full name or uuid if any error occurs during reslution\n */\nexport async function resolveFullName({\n type,\n id,\n state,\n}: {\n type: string;\n id: string;\n state: State;\n}) {\n try {\n const managedObject = await getManagedObject({\n baseUrl: getTenantURL(state.getHost()),\n type,\n id,\n fields: ['givenName', 'sn'],\n state,\n });\n return `${managedObject.givenName} ${managedObject.sn}`;\n } catch (error) {\n // eslint-disable-next-line no-empty\n }\n return id;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAAqD,SAAAE,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,G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a,CAACE,SAAS,OAAAD,MAAA,CAAID,aAAa,CAACG,EAAE;IACvD,CAAC,CAAC,OAAOtC,KAAK,EAAE;MACd;IAAA;IAEF,OAAOiB,EAAE;EACX,CAAC;EAAA,OAAAgB,gBAAA,CAAAxB,KAAA,OAAAD,SAAA;AAAA"}
|
package/cjs/ops/NodeOps.js
CHANGED
|
@@ -3,128 +3,130 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.default = void 0;
|
|
6
7
|
exports.findOrphanedNodes = findOrphanedNodes;
|
|
7
8
|
exports.getNodeClassification = getNodeClassification;
|
|
8
9
|
exports.isCloudOnlyNode = isCloudOnlyNode;
|
|
9
10
|
exports.isCustomNode = isCustomNode;
|
|
10
11
|
exports.isPremiumNode = isPremiumNode;
|
|
11
12
|
exports.removeOrphanedNodes = removeOrphanedNodes;
|
|
12
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
|
-
var state = _interopRequireWildcard(require("../shared/State"));
|
|
14
13
|
var _NodeApi = require("../api/NodeApi");
|
|
15
14
|
var _TreeApi = require("../api/TreeApi");
|
|
16
15
|
var _Console = require("./utils/Console");
|
|
17
|
-
var _Saml2Api = require("../api/Saml2Api");
|
|
18
|
-
var _Base = require("../api/utils/Base64");
|
|
19
16
|
var _OpsTypes = require("./OpsTypes");
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
17
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
24
18
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
class NodeOps {
|
|
20
|
+
constructor(state) {
|
|
21
|
+
this.state = state;
|
|
22
|
+
}
|
|
29
23
|
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Find all node configuration objects that are no longer referenced by any tree
|
|
26
|
+
* @returns {Promise<unknown[]>} a promise that resolves to an array of orphaned nodes
|
|
27
|
+
*/
|
|
28
|
+
findOrphanedNodes() {
|
|
29
|
+
var _this = this;
|
|
30
|
+
return _asyncToGenerator(function* () {
|
|
31
|
+
return findOrphanedNodes({
|
|
32
|
+
state: _this.state
|
|
33
|
+
});
|
|
34
|
+
})();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Remove orphaned nodes
|
|
39
|
+
* @param {NodeSkeleton[]} orphanedNodes Pass in an array of orphaned node configuration objects to remove
|
|
40
|
+
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an array nodes that encountered errors deleting
|
|
41
|
+
*/
|
|
42
|
+
removeOrphanedNodes(orphanedNodes) {
|
|
43
|
+
var _this2 = this;
|
|
44
|
+
return _asyncToGenerator(function* () {
|
|
45
|
+
return removeOrphanedNodes({
|
|
46
|
+
orphanedNodes,
|
|
47
|
+
state: _this2.state
|
|
48
|
+
});
|
|
49
|
+
})();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Analyze if a node is a premium node.
|
|
54
|
+
* @param {string} nodeType Node type
|
|
55
|
+
* @returns {boolean} True if the node type is premium, false otherwise.
|
|
56
|
+
*/
|
|
57
|
+
isPremiumNode(nodeType) {
|
|
58
|
+
return isPremiumNode(nodeType);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Analyze if a node is a cloud-only node.
|
|
63
|
+
* @param {string} nodeType Node type
|
|
64
|
+
* @returns {boolean} True if the node type is cloud-only, false otherwise.
|
|
65
|
+
*/
|
|
66
|
+
isCloudOnlyNode(nodeType) {
|
|
67
|
+
return isCloudOnlyNode(nodeType);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Analyze if a node is custom.
|
|
72
|
+
* @param {string} nodeType Node type
|
|
73
|
+
* @returns {boolean} True if the node type is custom, false otherwise.
|
|
74
|
+
*/
|
|
75
|
+
isCustomNode(nodeType) {
|
|
76
|
+
return isCustomNode({
|
|
77
|
+
nodeType,
|
|
78
|
+
state: this.state
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get a node's classifications, which can be one or multiple of:
|
|
84
|
+
* - standard: can run on any instance of a ForgeRock platform
|
|
85
|
+
* - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud
|
|
86
|
+
* - premium: utilizes nodes, which come at a premium
|
|
87
|
+
* @param {string} nodeType Node type
|
|
88
|
+
* @returns {NodeClassification[]} an array of one or multiple classifications
|
|
89
|
+
*/
|
|
90
|
+
getNodeClassification(nodeType) {
|
|
91
|
+
return getNodeClassification({
|
|
92
|
+
nodeType,
|
|
93
|
+
state: this.state
|
|
94
|
+
});
|
|
95
|
+
}
|
|
39
96
|
}
|
|
97
|
+
exports.default = NodeOps;
|
|
98
|
+
var containerNodes = ['PageNode', 'CustomPageNode'];
|
|
99
|
+
|
|
40
100
|
/**
|
|
41
101
|
* Find all node configuration objects that are no longer referenced by any tree
|
|
42
102
|
* @returns {Promise<unknown[]>} a promise that resolves to an array of orphaned nodes
|
|
43
103
|
*/
|
|
44
|
-
function
|
|
45
|
-
_getSaml2NodeDependencies = _asyncToGenerator(function* (nodeObject, allProviders, allCirclesOfTrust) {
|
|
46
|
-
var samlProperties = ['metaAlias', 'idpEntityId'];
|
|
47
|
-
var saml2EntityPromises = [];
|
|
48
|
-
for (var samlProperty of samlProperties) {
|
|
49
|
-
// In the following line nodeObject[samlProperty] will look like '/alpha/iSPAzure'.
|
|
50
|
-
var entityId = samlProperty === 'metaAlias' ? _lodash.default.last(nodeObject[samlProperty].split('/')) : nodeObject[samlProperty];
|
|
51
|
-
var entity = _lodash.default.find(allProviders, {
|
|
52
|
-
entityId
|
|
53
|
-
});
|
|
54
|
-
if (entity) {
|
|
55
|
-
try {
|
|
56
|
-
var providerResponse = yield (0, _Saml2Api.getProviderByLocationAndId)(entity.location, entity._id);
|
|
57
|
-
/**
|
|
58
|
-
* Adding entityLocation here to the entityResponse because the import tool
|
|
59
|
-
* needs to know whether the saml2 entity is remote or not (this will be removed
|
|
60
|
-
* from the config before importing see updateSaml2Entity and createSaml2Entity functions).
|
|
61
|
-
* Importing a remote saml2 entity is a slightly different request (see createSaml2Entity).
|
|
62
|
-
*/
|
|
63
|
-
providerResponse.entityLocation = entity.location;
|
|
64
|
-
if (entity.location === 'remote') {
|
|
65
|
-
// get the xml representation of this entity and add it to the entityResponse;
|
|
66
|
-
var metaDataResponse = yield (0, _Saml2Api.getProviderMetadata)(providerResponse.entityId);
|
|
67
|
-
providerResponse.base64EntityXML = (0, _Base.encodeBase64Url)(metaDataResponse);
|
|
68
|
-
}
|
|
69
|
-
saml2EntityPromises.push(providerResponse);
|
|
70
|
-
} catch (error) {
|
|
71
|
-
(0, _Console.printMessage)(error.message, 'error');
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
var saml2EntitiesPromisesResults = yield Promise.all(saml2EntityPromises);
|
|
77
|
-
var saml2Entities = [];
|
|
78
|
-
for (var saml2Entity of saml2EntitiesPromisesResults) {
|
|
79
|
-
if (saml2Entity) {
|
|
80
|
-
saml2Entities.push(saml2Entity);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
var samlEntityIds = _lodash.default.map(saml2Entities, saml2EntityConfig => "".concat(saml2EntityConfig.entityId, "|saml2"));
|
|
84
|
-
var circlesOfTrust = _lodash.default.filter(allCirclesOfTrust, circleOfTrust => {
|
|
85
|
-
var hasEntityId = false;
|
|
86
|
-
for (var trustedProvider of circleOfTrust.trustedProviders) {
|
|
87
|
-
if (!hasEntityId && samlEntityIds.includes(trustedProvider)) {
|
|
88
|
-
hasEntityId = true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return hasEntityId;
|
|
92
|
-
});
|
|
93
|
-
var saml2NodeDependencies = {
|
|
94
|
-
saml2Entities,
|
|
95
|
-
circlesOfTrust
|
|
96
|
-
};
|
|
97
|
-
return saml2NodeDependencies;
|
|
98
|
-
} catch (error) {
|
|
99
|
-
(0, _Console.printMessage)(error.message, 'error');
|
|
100
|
-
var _saml2NodeDependencies = {
|
|
101
|
-
saml2Entities: [],
|
|
102
|
-
circlesOfTrust: []
|
|
103
|
-
};
|
|
104
|
-
return _saml2NodeDependencies;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return _getSaml2NodeDependencies.apply(this, arguments);
|
|
108
|
-
}
|
|
109
|
-
function findOrphanedNodes() {
|
|
104
|
+
function findOrphanedNodes(_x) {
|
|
110
105
|
return _findOrphanedNodes.apply(this, arguments);
|
|
111
106
|
}
|
|
112
107
|
/**
|
|
113
108
|
* Remove orphaned nodes
|
|
114
|
-
* @param {[
|
|
115
|
-
* @returns {Promise<
|
|
109
|
+
* @param {NodeSkeleton[]} orphanedNodes Pass in an array of orphaned node configuration objects to remove
|
|
110
|
+
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an array nodes that encountered errors deleting
|
|
116
111
|
*/
|
|
117
112
|
function _findOrphanedNodes() {
|
|
118
|
-
_findOrphanedNodes = _asyncToGenerator(function* () {
|
|
113
|
+
_findOrphanedNodes = _asyncToGenerator(function* (_ref) {
|
|
114
|
+
var {
|
|
115
|
+
state
|
|
116
|
+
} = _ref;
|
|
119
117
|
var allNodes = [];
|
|
120
118
|
var orphanedNodes = [];
|
|
121
119
|
var types = [];
|
|
122
|
-
var allJourneys = (yield (0, _TreeApi.getTrees)(
|
|
120
|
+
var allJourneys = (yield (0, _TreeApi.getTrees)({
|
|
121
|
+
state
|
|
122
|
+
})).result;
|
|
123
123
|
var errorMessage = '';
|
|
124
124
|
var errorTypes = [];
|
|
125
125
|
(0, _Console.createProgressIndicator)(undefined, "Counting total nodes...", 'indeterminate');
|
|
126
126
|
try {
|
|
127
|
-
types = (yield (0, _NodeApi.getNodeTypes)(
|
|
127
|
+
types = (yield (0, _NodeApi.getNodeTypes)({
|
|
128
|
+
state
|
|
129
|
+
})).result;
|
|
128
130
|
} catch (error) {
|
|
129
131
|
(0, _Console.printMessage)('Error retrieving all available node types:', 'error');
|
|
130
132
|
(0, _Console.printMessage)(error.response.data, 'error');
|
|
@@ -133,7 +135,10 @@ function _findOrphanedNodes() {
|
|
|
133
135
|
for (var type of types) {
|
|
134
136
|
try {
|
|
135
137
|
// eslint-disable-next-line no-await-in-loop, no-loop-func
|
|
136
|
-
var nodes = (yield (0, _NodeApi.getNodesByType)(
|
|
138
|
+
var nodes = (yield (0, _NodeApi.getNodesByType)({
|
|
139
|
+
nodeType: type._id,
|
|
140
|
+
state
|
|
141
|
+
})).result;
|
|
137
142
|
for (var node of nodes) {
|
|
138
143
|
allNodes.push(node);
|
|
139
144
|
(0, _Console.updateProgressIndicator)("".concat(allNodes.length, " total nodes").concat(errorMessage));
|
|
@@ -158,7 +163,11 @@ function _findOrphanedNodes() {
|
|
|
158
163
|
(0, _Console.updateProgressIndicator)("".concat(activeNodes.length, " active nodes"));
|
|
159
164
|
var _node = journey.nodes[nodeId];
|
|
160
165
|
if (containerNodes.includes(_node.nodeType)) {
|
|
161
|
-
var containerNode = yield (0, _NodeApi.getNode)(
|
|
166
|
+
var containerNode = yield (0, _NodeApi.getNode)({
|
|
167
|
+
nodeId,
|
|
168
|
+
nodeType: _node.nodeType,
|
|
169
|
+
state
|
|
170
|
+
});
|
|
162
171
|
for (var innerNode of containerNode.nodes) {
|
|
163
172
|
activeNodes.push(innerNode._id);
|
|
164
173
|
(0, _Console.updateProgressIndicator)("".concat(activeNodes.length, " active nodes"));
|
|
@@ -178,18 +187,25 @@ function _findOrphanedNodes() {
|
|
|
178
187
|
});
|
|
179
188
|
return _findOrphanedNodes.apply(this, arguments);
|
|
180
189
|
}
|
|
181
|
-
function removeOrphanedNodes(
|
|
190
|
+
function removeOrphanedNodes(_x2) {
|
|
182
191
|
return _removeOrphanedNodes.apply(this, arguments);
|
|
183
192
|
}
|
|
184
193
|
function _removeOrphanedNodes() {
|
|
185
|
-
_removeOrphanedNodes = _asyncToGenerator(function* (
|
|
194
|
+
_removeOrphanedNodes = _asyncToGenerator(function* (_ref2) {
|
|
195
|
+
var {
|
|
196
|
+
orphanedNodes,
|
|
197
|
+
state
|
|
198
|
+
} = _ref2;
|
|
186
199
|
var errorNodes = [];
|
|
187
200
|
(0, _Console.createProgressIndicator)(orphanedNodes.length, 'Removing orphaned nodes...');
|
|
188
201
|
for (var node of orphanedNodes) {
|
|
189
202
|
(0, _Console.updateProgressIndicator)("Removing ".concat(node['_id'], "..."));
|
|
190
203
|
try {
|
|
191
|
-
|
|
192
|
-
|
|
204
|
+
yield (0, _NodeApi.deleteNode)({
|
|
205
|
+
nodeId: node['_id'],
|
|
206
|
+
nodeType: node['_type']['_id'],
|
|
207
|
+
state
|
|
208
|
+
});
|
|
193
209
|
} catch (deleteError) {
|
|
194
210
|
errorNodes.push(node);
|
|
195
211
|
(0, _Console.printMessage)(" ".concat(deleteError), 'error');
|
|
@@ -232,7 +248,11 @@ function isCloudOnlyNode(nodeType) {
|
|
|
232
248
|
* @param {string} nodeType Node type
|
|
233
249
|
* @returns {boolean} True if the node type is custom, false otherwise.
|
|
234
250
|
*/
|
|
235
|
-
function isCustomNode(
|
|
251
|
+
function isCustomNode(_ref3) {
|
|
252
|
+
var {
|
|
253
|
+
nodeType,
|
|
254
|
+
state
|
|
255
|
+
} = _ref3;
|
|
236
256
|
var ootbNodeTypes = [];
|
|
237
257
|
switch (state.getAmVersion()) {
|
|
238
258
|
case '7.1.0':
|
|
@@ -283,10 +303,17 @@ function isCustomNode(nodeType) {
|
|
|
283
303
|
* @param {string} nodeType Node type
|
|
284
304
|
* @returns {NodeClassification[]} an array of one or multiple classifications
|
|
285
305
|
*/
|
|
286
|
-
function getNodeClassification(
|
|
306
|
+
function getNodeClassification(_ref4) {
|
|
307
|
+
var {
|
|
308
|
+
nodeType,
|
|
309
|
+
state
|
|
310
|
+
} = _ref4;
|
|
287
311
|
var classifications = [];
|
|
288
312
|
var premium = isPremiumNode(nodeType);
|
|
289
|
-
var custom = isCustomNode(
|
|
313
|
+
var custom = isCustomNode({
|
|
314
|
+
nodeType,
|
|
315
|
+
state
|
|
316
|
+
});
|
|
290
317
|
var cloud = isCloudOnlyNode(nodeType);
|
|
291
318
|
if (custom) {
|
|
292
319
|
classifications.push(_OpsTypes.NodeClassification.CUSTOM);
|