@rockcarver/frodo-lib 1.0.0 → 2.0.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -6
- 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 +13 -112
- 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 +964 -118
- package/cjs/ops/AgentOps.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +182 -87
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.test.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +360 -291
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +221 -139
- 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/OAuth2OidcOps.js +84 -0
- package/cjs/ops/OAuth2OidcOps.js.map +1 -0
- 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 +364 -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 +331 -55
- package/cjs/ops/ServiceOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +363 -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 +126 -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 +144 -13
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.test.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 +36 -6
- package/cjs/ops/utils/Version.js.map +1 -1
- package/cjs/ops/utils/Version.test.js.map +1 -1
- package/cjs/shared/State.js +453 -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 +1 -60
- package/esm/lib/FrodoLib.mjs +128 -0
- package/esm/ops/AdminOps.mjs +500 -71
- package/esm/ops/AgentOps.mjs +781 -81
- package/esm/ops/AgentOps.test.mjs +296 -113
- package/esm/ops/AuthenticateOps.mjs +156 -64
- package/esm/ops/AuthenticateOps.test.mjs +7 -4
- package/esm/ops/CirclesOfTrustOps.mjs +294 -229
- package/esm/ops/ConnectionProfileOps.mjs +190 -123
- 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/OAuth2OidcOps.mjs +40 -0
- 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 +278 -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 +261 -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 +107 -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 +2 -1
- package/esm/ops/utils/DataProtection.mjs +2 -3
- package/esm/ops/utils/ExportImportUtils.mjs +129 -8
- package/esm/ops/utils/ExportImportUtils.test.mjs +15 -2
- 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 +29 -6
- package/esm/ops/utils/Version.test.mjs +4 -1
- package/esm/shared/State.mjs +457 -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 +20 -8
- 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 +1 -48
- package/types/index.d.ts.map +1 -1
- package/types/lib/FrodoLib.d.ts +99 -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 +350 -36
- package/types/ops/AgentOps.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts +27 -4
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/CirclesOfTrustOps.d.ts +88 -24
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
- package/types/ops/ConnectionProfileOps.d.ts +78 -18
- 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/OAuth2OidcOps.d.ts +11 -0
- package/types/ops/OAuth2OidcOps.d.ts.map +1 -0
- 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 +95 -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 +72 -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 +20 -2
- 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,134 +1,72 @@
|
|
|
1
|
-
import { createKeyValueTable, createProgressIndicator, createTable, printMessage, stopProgressIndicator, updateProgressIndicator } from '../utils/Console';
|
|
2
1
|
import { deleteVariable, getVariable, getVariables, putVariable, setVariableDescription } from '../../api/cloud/VariablesApi';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* List variables
|
|
9
|
-
* @param {boolean} long Long version, all the fields
|
|
10
|
-
*/
|
|
11
|
-
export async function listVariables(long) {
|
|
12
|
-
let variables = [];
|
|
13
|
-
try {
|
|
14
|
-
variables = (await getVariables()).result;
|
|
15
|
-
variables.sort((a, b) => a._id.localeCompare(b._id));
|
|
16
|
-
} catch (error) {
|
|
17
|
-
printMessage(`${error.message}`, 'error');
|
|
18
|
-
printMessage(error.response.data, 'error');
|
|
19
|
-
}
|
|
20
|
-
if (long) {
|
|
21
|
-
const table = createTable(['Id'['brightCyan'], 'Value'['brightCyan'], 'Status'['brightCyan'], 'Description'['brightCyan'], 'Modifier'['brightCyan'], 'Modified'['brightCyan']]);
|
|
22
|
-
for (const variable of variables) {
|
|
23
|
-
table.push([variable._id, wordwrap(decode(variable.valueBase64), 40), variable.loaded ? 'loaded'['brightGreen'] : 'unloaded'['brightRed'], wordwrap(variable.description, 40),
|
|
24
|
-
// eslint-disable-next-line no-await-in-loop
|
|
25
|
-
await resolveUserName('teammember', variable.lastChangedBy), new Date(variable.lastChangeDate).toLocaleString()]);
|
|
26
|
-
}
|
|
27
|
-
printMessage(table.toString(), 'data');
|
|
28
|
-
} else {
|
|
29
|
-
variables.forEach(secret => {
|
|
30
|
-
printMessage(secret._id, 'data');
|
|
31
|
-
});
|
|
2
|
+
export default class VariablesOps {
|
|
3
|
+
constructor(state) {
|
|
4
|
+
this.state = state;
|
|
32
5
|
}
|
|
33
|
-
}
|
|
34
6
|
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
stopProgressIndicator(`Created variable ${variableId}`, 'success');
|
|
46
|
-
} catch (error) {
|
|
47
|
-
stopProgressIndicator(`Error: ${error.response.data.code} - ${error.response.data.message}`, 'fail');
|
|
7
|
+
/**
|
|
8
|
+
* Delete variable by id/name
|
|
9
|
+
* @param {string} variableId variable id/name
|
|
10
|
+
* @returns {Promise<unknown>} a promise that resolves to a variable object
|
|
11
|
+
*/
|
|
12
|
+
deleteVariable(variableId) {
|
|
13
|
+
return deleteVariable({
|
|
14
|
+
variableId,
|
|
15
|
+
state: this.state
|
|
16
|
+
});
|
|
48
17
|
}
|
|
49
|
-
}
|
|
50
18
|
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
stopProgressIndicator(`Updated variable ${variableId}`, 'success');
|
|
62
|
-
} catch (error) {
|
|
63
|
-
stopProgressIndicator(`Error: ${error.response.data.code} - ${error.response.data.message}`, 'fail');
|
|
19
|
+
/**
|
|
20
|
+
* Get variable by id/name
|
|
21
|
+
* @param {string} variableId variable id/name
|
|
22
|
+
* @returns {Promise<unknown>} a promise that resolves to a variable object
|
|
23
|
+
*/
|
|
24
|
+
getVariable(variableId) {
|
|
25
|
+
return getVariable({
|
|
26
|
+
variableId,
|
|
27
|
+
state: this.state
|
|
28
|
+
});
|
|
64
29
|
}
|
|
65
|
-
}
|
|
66
30
|
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
await setVariableDescription(variableId, description);
|
|
76
|
-
stopProgressIndicator(`Set description of variable ${variableId}`, 'success');
|
|
77
|
-
} catch (error) {
|
|
78
|
-
stopProgressIndicator(`Error: ${error.response.data.code} - ${error.response.data.message}`, 'fail');
|
|
31
|
+
/**
|
|
32
|
+
* Get all variables
|
|
33
|
+
* @returns {Promise<unknown[]>} a promise that resolves to an array of variable objects
|
|
34
|
+
*/
|
|
35
|
+
getVariables() {
|
|
36
|
+
return getVariables({
|
|
37
|
+
state: this.state
|
|
38
|
+
});
|
|
79
39
|
}
|
|
80
|
-
}
|
|
81
40
|
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Put variable by id/name
|
|
43
|
+
* @param {string} variableId variable id/name
|
|
44
|
+
* @param {string} value variable value
|
|
45
|
+
* @param {string} description variable description
|
|
46
|
+
* @returns {Promise<unknown>} a promise that resolves to a variable object
|
|
47
|
+
*/
|
|
48
|
+
putVariable(variableId, value, description) {
|
|
49
|
+
return putVariable({
|
|
50
|
+
variableId,
|
|
51
|
+
value,
|
|
52
|
+
description,
|
|
53
|
+
state: this.state
|
|
54
|
+
});
|
|
93
55
|
}
|
|
94
|
-
}
|
|
95
56
|
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
} catch (error) {
|
|
109
|
-
printMessage(`Error: ${error.response.data.code} - ${error.response.data.message}`, 'error');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
stopProgressIndicator(`Variables deleted.`);
|
|
113
|
-
} catch (error) {
|
|
114
|
-
printMessage(`Error: ${error.response.data.code} - ${error.response.data.message}`, 'error');
|
|
57
|
+
/**
|
|
58
|
+
* Set variable description
|
|
59
|
+
* @param {string} variableId variable id/name
|
|
60
|
+
* @param {string} description variable description
|
|
61
|
+
* @returns {Promise<unknown>} a promise that resolves to a status object
|
|
62
|
+
*/
|
|
63
|
+
setVariableDescription(variableId, description) {
|
|
64
|
+
return setVariableDescription({
|
|
65
|
+
variableId,
|
|
66
|
+
description,
|
|
67
|
+
state: this.state
|
|
68
|
+
});
|
|
115
69
|
}
|
|
116
70
|
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Describe a variable
|
|
120
|
-
* @param {String} variableId variable id
|
|
121
|
-
*/
|
|
122
|
-
export async function describeVariable(variableId) {
|
|
123
|
-
const variable = await getVariable(variableId);
|
|
124
|
-
const table = createKeyValueTable();
|
|
125
|
-
table.push(['Name'['brightCyan'], variable._id]);
|
|
126
|
-
table.push(['Value'['brightCyan'], wordwrap(decode(variable.valueBase64), 40)]);
|
|
127
|
-
table.push(['Status'['brightCyan'], variable.loaded ? 'loaded'['brightGreen'] : 'unloaded'['brightRed']]);
|
|
128
|
-
table.push(['Description'['brightCyan'], wordwrap(variable.description, 60)]);
|
|
129
|
-
table.push(['Modified'['brightCyan'], new Date(variable.lastChangeDate).toLocaleString()]);
|
|
130
|
-
table.push(['Modifier'['brightCyan'], await resolveUserName('teammember', variable.lastChangedBy)]);
|
|
131
|
-
table.push(['Modifier UUID'['brightCyan'], variable.lastChangedBy]);
|
|
132
|
-
printMessage(table.toString());
|
|
133
|
-
}
|
|
71
|
+
export { deleteVariable, getVariable, getVariables, putVariable, setVariableDescription };
|
|
134
72
|
//# sourceMappingURL=VariablesOps.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Table from 'cli-table3';
|
|
2
|
-
import
|
|
2
|
+
import { state } from '../../lib/FrodoLib';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Handles data / messages output. The caller decides and implements how
|
|
@@ -51,6 +51,7 @@ export function debugMessage(message) {
|
|
|
51
51
|
/**
|
|
52
52
|
* Helper function to mask password header in curl command
|
|
53
53
|
* @param curlCommand curl command to mask
|
|
54
|
+
* @param {State} state library state
|
|
54
55
|
* @returns masked curl command
|
|
55
56
|
*/
|
|
56
57
|
function maskPasswordHeader(curlCommand) {
|
|
@@ -14,7 +14,6 @@ import crypto from 'crypto';
|
|
|
14
14
|
import { homedir } from 'os';
|
|
15
15
|
import { promisify } from 'util';
|
|
16
16
|
import { printMessage } from './Console';
|
|
17
|
-
import * as state from '../../shared/State';
|
|
18
17
|
import { FRODO_MASTER_KEY_PATH_KEY, FRODO_MASTER_KEY_KEY } from '../../storage/StaticStorage';
|
|
19
18
|
const scrypt = promisify(crypto.scrypt);
|
|
20
19
|
// using WeakMaps for added security since it gets garbage collected
|
|
@@ -24,8 +23,8 @@ const _salt = new WeakMap();
|
|
|
24
23
|
const _key = new WeakMap();
|
|
25
24
|
const _encrypt = new WeakMap();
|
|
26
25
|
class DataProtection {
|
|
27
|
-
constructor() {
|
|
28
|
-
const masterKeyPath = () =>
|
|
26
|
+
constructor(pathToMasterKey = null) {
|
|
27
|
+
const masterKeyPath = () => pathToMasterKey || process.env[FRODO_MASTER_KEY_PATH_KEY] || `${homedir()}/.frodo/masterkey.key`;
|
|
29
28
|
// Generates a master key in base64 format. This master key will be used to derive the key for encryption. this key should be protected by an HSM or KMS
|
|
30
29
|
_masterKey.set(this, async () => {
|
|
31
30
|
try {
|
|
@@ -3,10 +3,112 @@ import { lstat, readdir } from 'fs/promises';
|
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import slugify from 'slugify';
|
|
5
5
|
import { decode, decodeBase64Url, encode, encodeBase64Url } from '../../api/utils/Base64';
|
|
6
|
-
import * as state from '../../shared/State';
|
|
7
6
|
import { FRODO_METADATA_ID } from '../../storage/StaticStorage';
|
|
8
7
|
import { debugMessage, printMessage } from './Console';
|
|
9
|
-
export
|
|
8
|
+
export default class ExportImportUtils {
|
|
9
|
+
constructor(state) {
|
|
10
|
+
this.state = state;
|
|
11
|
+
}
|
|
12
|
+
getMetadata() {
|
|
13
|
+
return getMetadata({
|
|
14
|
+
state: this.state
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Output str in title case
|
|
20
|
+
*
|
|
21
|
+
* e.g.: 'ALL UPPERCASE AND all lowercase' = 'All Uppercase And All Lowercase'
|
|
22
|
+
*/
|
|
23
|
+
titleCase(input) {
|
|
24
|
+
return titleCase(input);
|
|
25
|
+
}
|
|
26
|
+
getRealmString() {
|
|
27
|
+
return getRealmString({
|
|
28
|
+
state: this.state
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
convertBase64TextToArray(b64text) {
|
|
32
|
+
return convertBase64TextToArray(b64text);
|
|
33
|
+
}
|
|
34
|
+
convertBase64UrlTextToArray(b64UTF8Text) {
|
|
35
|
+
return convertBase64UrlTextToArray(b64UTF8Text);
|
|
36
|
+
}
|
|
37
|
+
convertTextArrayToBase64(textArray) {
|
|
38
|
+
return convertTextArrayToBase64(textArray);
|
|
39
|
+
}
|
|
40
|
+
convertTextArrayToBase64Url(textArray) {
|
|
41
|
+
return convertTextArrayToBase64Url(textArray);
|
|
42
|
+
}
|
|
43
|
+
validateImport(metadata) {
|
|
44
|
+
return validateImport(metadata);
|
|
45
|
+
}
|
|
46
|
+
getTypedFilename(name, type, suffix = 'json') {
|
|
47
|
+
return getTypedFilename(name, type, suffix);
|
|
48
|
+
}
|
|
49
|
+
getWorkingDirectory() {
|
|
50
|
+
return getWorkingDirectory({
|
|
51
|
+
state: this.state
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
saveToFile(type, data, identifier, filename) {
|
|
55
|
+
return saveToFile({
|
|
56
|
+
type,
|
|
57
|
+
data,
|
|
58
|
+
identifier,
|
|
59
|
+
filename,
|
|
60
|
+
state: this.state
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Save JSON object to file
|
|
66
|
+
* @param {Object} data data object
|
|
67
|
+
* @param {String} filename file name
|
|
68
|
+
* @return {boolean} true if successful, false otherwise
|
|
69
|
+
*/
|
|
70
|
+
saveJsonToFile(data, filename, includeMeta = true) {
|
|
71
|
+
return saveJsonToFile({
|
|
72
|
+
data,
|
|
73
|
+
filename,
|
|
74
|
+
includeMeta,
|
|
75
|
+
state: this.state
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Append text data to file
|
|
81
|
+
* @param {String} data text data
|
|
82
|
+
* @param {String} filename file name
|
|
83
|
+
*/
|
|
84
|
+
appendTextToFile(data, filename) {
|
|
85
|
+
return appendTextToFile(data, filename);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Find files by name
|
|
90
|
+
* @param {string} fileName file name to search for
|
|
91
|
+
* @param {boolean} fast return first result and stop search
|
|
92
|
+
* @param {string} path path to directory where to start the search
|
|
93
|
+
* @returns {string[]} array of found file paths relative to starting directory
|
|
94
|
+
*/
|
|
95
|
+
findFilesByName(fileName, fast = true, path = './') {
|
|
96
|
+
return findFilesByName(fileName, fast, path);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* find all (nested) files in a directory
|
|
101
|
+
*
|
|
102
|
+
* @param directory directory to search
|
|
103
|
+
* @returns list of files
|
|
104
|
+
*/
|
|
105
|
+
async readFilesRecursive(directory) {
|
|
106
|
+
return readFilesRecursive(directory);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export function getMetadata({
|
|
110
|
+
state
|
|
111
|
+
}) {
|
|
10
112
|
const metadata = {
|
|
11
113
|
origin: state.getHost(),
|
|
12
114
|
originAmVersion: state.getAmVersion(),
|
|
@@ -31,7 +133,9 @@ export function titleCase(input) {
|
|
|
31
133
|
}
|
|
32
134
|
return splitStr.join(' ');
|
|
33
135
|
}
|
|
34
|
-
export function getRealmString(
|
|
136
|
+
export function getRealmString({
|
|
137
|
+
state
|
|
138
|
+
}) {
|
|
35
139
|
const realm = state.getRealm();
|
|
36
140
|
return realm.split('/').reduce((result, item) => `${result}${titleCase(item)}`, '');
|
|
37
141
|
}
|
|
@@ -68,7 +172,9 @@ export function getTypedFilename(name, type, suffix = 'json') {
|
|
|
68
172
|
const slug = slugify(name.replace(/^http(s?):\/\//, ''));
|
|
69
173
|
return `${slug}.${type}.${suffix}`;
|
|
70
174
|
}
|
|
71
|
-
export function getWorkingDirectory(
|
|
175
|
+
export function getWorkingDirectory({
|
|
176
|
+
state
|
|
177
|
+
}) {
|
|
72
178
|
let wd = '.';
|
|
73
179
|
if (state.getDirectory()) {
|
|
74
180
|
wd = state.getDirectory().replace(/\/$/, '');
|
|
@@ -82,9 +188,17 @@ export function getWorkingDirectory() {
|
|
|
82
188
|
}
|
|
83
189
|
return wd;
|
|
84
190
|
}
|
|
85
|
-
export function saveToFile(
|
|
191
|
+
export function saveToFile({
|
|
192
|
+
type,
|
|
193
|
+
data,
|
|
194
|
+
identifier,
|
|
195
|
+
filename,
|
|
196
|
+
state
|
|
197
|
+
}) {
|
|
86
198
|
const exportData = {};
|
|
87
|
-
exportData['meta'] = getMetadata(
|
|
199
|
+
exportData['meta'] = getMetadata({
|
|
200
|
+
state
|
|
201
|
+
});
|
|
88
202
|
exportData[type] = {};
|
|
89
203
|
if (Array.isArray(data)) {
|
|
90
204
|
data.forEach(element => {
|
|
@@ -107,9 +221,16 @@ export function saveToFile(type, data, identifier, filename) {
|
|
|
107
221
|
* @param {String} filename file name
|
|
108
222
|
* @return {boolean} true if successful, false otherwise
|
|
109
223
|
*/
|
|
110
|
-
export function saveJsonToFile(
|
|
224
|
+
export function saveJsonToFile({
|
|
225
|
+
data,
|
|
226
|
+
filename,
|
|
227
|
+
includeMeta = true,
|
|
228
|
+
state
|
|
229
|
+
}) {
|
|
111
230
|
const exportData = data;
|
|
112
|
-
if (includeMeta) exportData
|
|
231
|
+
if (includeMeta) exportData['meta'] = getMetadata({
|
|
232
|
+
state
|
|
233
|
+
});
|
|
113
234
|
try {
|
|
114
235
|
fs.writeFileSync(filename, JSON.stringify(exportData, null, 2));
|
|
115
236
|
return true;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { state } from '../../index';
|
|
1
2
|
import { resolve } from 'path';
|
|
2
3
|
import { rmSync, existsSync, readFileSync } from 'fs';
|
|
3
4
|
import { convertTextArrayToBase64, convertBase64TextToArray, saveToFile, validateImport } from './ExportImportUtils';
|
|
@@ -64,7 +65,13 @@ describe.skip('file system based tests', () => {
|
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
// Act
|
|
67
|
-
saveToFile(
|
|
68
|
+
saveToFile({
|
|
69
|
+
type: 'lotr',
|
|
70
|
+
data,
|
|
71
|
+
identifier: 'id',
|
|
72
|
+
filename: PATH_TO_ARTIFACT,
|
|
73
|
+
state
|
|
74
|
+
});
|
|
68
75
|
const resultingJSON = JSON.parse(readFileSync(PATH_TO_ARTIFACT, 'utf8'));
|
|
69
76
|
// Assert
|
|
70
77
|
expect(resultingJSON.lotr).toEqual(expected.lotr);
|
|
@@ -79,7 +86,13 @@ describe.skip('file system based tests', () => {
|
|
|
79
86
|
words: 1064
|
|
80
87
|
}];
|
|
81
88
|
// Act
|
|
82
|
-
saveToFile(
|
|
89
|
+
saveToFile({
|
|
90
|
+
type: 'lotr',
|
|
91
|
+
data,
|
|
92
|
+
identifier: 'id',
|
|
93
|
+
filename: PATH_TO_ARTIFACT,
|
|
94
|
+
state
|
|
95
|
+
});
|
|
83
96
|
const resultingJSON = JSON.parse(readFileSync(PATH_TO_ARTIFACT, 'utf8'));
|
|
84
97
|
// Assert
|
|
85
98
|
expect(Object.keys(resultingJSON.meta)).toEqual(['origin', 'exportedBy', 'exportDate', 'exportTool', 'exportToolVersion']);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as state from '../../shared/State';
|
|
2
1
|
import * as globalConfig from '../../storage/StaticStorage';
|
|
3
2
|
import { getCurrentRealmName, getRealmName as _getRealmName } from '../../api/utils/ApiUtils';
|
|
4
3
|
import { lstat, readdir, readFile } from 'fs/promises';
|
|
@@ -36,10 +35,12 @@ export function applyNameCollisionPolicy(name) {
|
|
|
36
35
|
* Get the name of the managed user object for the current realm
|
|
37
36
|
* @returns {String} the name of the managed user object for the current realm
|
|
38
37
|
*/
|
|
39
|
-
export function getRealmManagedUser(
|
|
38
|
+
export function getRealmManagedUser({
|
|
39
|
+
state
|
|
40
|
+
}) {
|
|
40
41
|
let realmManagedUser = 'user';
|
|
41
42
|
if (state.getDeploymentType() === globalConfig.CLOUD_DEPLOYMENT_TYPE_KEY) {
|
|
42
|
-
realmManagedUser = `${getCurrentRealmName()}_user`;
|
|
43
|
+
realmManagedUser = `${getCurrentRealmName(state)}_user`;
|
|
43
44
|
}
|
|
44
45
|
return realmManagedUser;
|
|
45
46
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run tests
|
|
3
|
+
*
|
|
4
|
+
* npm run test:only OpsUtils
|
|
5
|
+
*
|
|
6
|
+
* Note: FRODO_DEBUG=1 is optional and enables debug logging for some output
|
|
7
|
+
* in case things don't function as expected
|
|
8
|
+
*/
|
|
1
9
|
import * as OpsUtils from './OpsUtils';
|
|
2
|
-
import
|
|
10
|
+
import { state } from '../../index';
|
|
3
11
|
import { CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY, CLASSIC_DEPLOYMENT_TYPE_KEY } from '../../storage/StaticStorage';
|
|
4
12
|
describe('OpsUtils - getRealmManagedUser()', () => {
|
|
5
13
|
test('getRealmManagedUser() 0: Method is implemented', async () => {
|
|
@@ -12,7 +20,9 @@ describe('OpsUtils - getRealmManagedUser()', () => {
|
|
|
12
20
|
state.setRealm(REALM);
|
|
13
21
|
state.setDeploymentType(DEPLOYMENT_TYPE);
|
|
14
22
|
// Act
|
|
15
|
-
const testString = OpsUtils.getRealmManagedUser(
|
|
23
|
+
const testString = OpsUtils.getRealmManagedUser({
|
|
24
|
+
state
|
|
25
|
+
});
|
|
16
26
|
// Assert
|
|
17
27
|
expect(testString).toBe('alpha_user');
|
|
18
28
|
});
|
|
@@ -23,7 +33,9 @@ describe('OpsUtils - getRealmManagedUser()', () => {
|
|
|
23
33
|
state.setRealm(REALM);
|
|
24
34
|
state.setDeploymentType(DEPLOYMENT_TYPE);
|
|
25
35
|
// Act
|
|
26
|
-
const testString = OpsUtils.getRealmManagedUser(
|
|
36
|
+
const testString = OpsUtils.getRealmManagedUser({
|
|
37
|
+
state
|
|
38
|
+
});
|
|
27
39
|
// Assert
|
|
28
40
|
expect(testString).toBe('alpha_user');
|
|
29
41
|
});
|
|
@@ -34,7 +46,9 @@ describe('OpsUtils - getRealmManagedUser()', () => {
|
|
|
34
46
|
state.setRealm(REALM);
|
|
35
47
|
state.setDeploymentType(DEPLOYMENT_TYPE);
|
|
36
48
|
// Act
|
|
37
|
-
const testString = OpsUtils.getRealmManagedUser(
|
|
49
|
+
const testString = OpsUtils.getRealmManagedUser({
|
|
50
|
+
state
|
|
51
|
+
});
|
|
38
52
|
// Assert
|
|
39
53
|
expect(testString).toBe('user');
|
|
40
54
|
});
|
|
@@ -45,7 +59,9 @@ describe('OpsUtils - getRealmManagedUser()', () => {
|
|
|
45
59
|
state.setRealm(REALM);
|
|
46
60
|
state.setDeploymentType(DEPLOYMENT_TYPE);
|
|
47
61
|
// Act
|
|
48
|
-
const testString = OpsUtils.getRealmManagedUser(
|
|
62
|
+
const testString = OpsUtils.getRealmManagedUser({
|
|
63
|
+
state
|
|
64
|
+
});
|
|
49
65
|
// Assert
|
|
50
66
|
expect(testString).toBe('user');
|
|
51
67
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateScriptHooks } from './
|
|
1
|
+
import { validateScriptHooks } from './ScriptValidationUtils';
|
|
2
2
|
describe('validateScriptHooks', () => {
|
|
3
3
|
it('should return false when there is an invalid script', () => {
|
|
4
4
|
const jsonData = {
|
|
@@ -27,4 +27,4 @@ describe('validateScriptHooks', () => {
|
|
|
27
27
|
expect(validateScriptHooks(jsonData)).toBe(true);
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=ScriptValidationUtils.test.js.map
|
|
@@ -2,17 +2,40 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { generateReleaseApi } from '../../api/BaseApi';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
|
+
export default class Version {
|
|
6
|
+
constructor(state) {
|
|
7
|
+
this.state = state;
|
|
8
|
+
}
|
|
9
|
+
getVersion() {
|
|
10
|
+
return getVersion({
|
|
11
|
+
state: this.state
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
async getAllVersions(endpoints) {
|
|
15
|
+
return getAllVersions({
|
|
16
|
+
endpoints,
|
|
17
|
+
state: this.state
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
5
21
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
22
|
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../../package.json'), 'utf8'));
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
export function getVersion({
|
|
24
|
+
state
|
|
25
|
+
}) {
|
|
26
|
+
// must initialize state to avoid library initialization issues
|
|
27
|
+
if (state) return `${pkg.version}`;
|
|
11
28
|
}
|
|
12
|
-
export async function getAllVersions(
|
|
29
|
+
export async function getAllVersions({
|
|
30
|
+
endpoints,
|
|
31
|
+
state
|
|
32
|
+
}) {
|
|
13
33
|
const reqPromises = [];
|
|
14
34
|
endpoints.forEach(item => {
|
|
15
|
-
reqPromises.push(generateReleaseApi(
|
|
35
|
+
reqPromises.push(generateReleaseApi({
|
|
36
|
+
baseUrl: item.base,
|
|
37
|
+
state
|
|
38
|
+
}).get(item.path));
|
|
16
39
|
});
|
|
17
40
|
const result = await Promise.allSettled(reqPromises);
|
|
18
41
|
return result;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { state } from '../../index';
|
|
1
2
|
import fs from 'fs';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import { getVersion } from './Version';
|
|
@@ -6,7 +7,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
6
7
|
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../../package.json'), 'utf8'));
|
|
7
8
|
describe('index', () => {
|
|
8
9
|
test('get library version', () => {
|
|
9
|
-
const result = getVersion(
|
|
10
|
+
const result = getVersion({
|
|
11
|
+
state
|
|
12
|
+
});
|
|
10
13
|
expect(result).toEqual(`${pkg.version}`);
|
|
11
14
|
});
|
|
12
15
|
});
|