@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,283 +1,332 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { debugMessage } from './utils/Console';
|
|
2
|
+
import { getCirclesOfTrust as _getCirclesOfTrust, getCircleOfTrust, createCircleOfTrust, updateCircleOfTrust } from '../api/CirclesOfTrustApi';
|
|
3
|
+
import { getMetadata } from './utils/ExportImportUtils';
|
|
4
|
+
export default class CirclesOfTrustOps {
|
|
5
|
+
constructor(state) {
|
|
6
|
+
this.state = state;
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
9
|
+
/**
|
|
10
|
+
* Get SAML circle of trust
|
|
11
|
+
* @param {String} cotId circle of trust id/name
|
|
12
|
+
*/
|
|
13
|
+
async getCircleOfTrust(cotId) {
|
|
14
|
+
return getCircleOfTrust({
|
|
15
|
+
cotId,
|
|
16
|
+
state: this.state
|
|
17
|
+
});
|
|
18
|
+
}
|
|
20
19
|
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cotList = (await getCirclesOfTrust()).result;
|
|
29
|
-
} catch (error) {
|
|
30
|
-
printMessage(`getCirclesOfTrust ERROR: ${error}`, 'error');
|
|
31
|
-
printMessage(error, 'data');
|
|
20
|
+
/**
|
|
21
|
+
* Get SAML circles of trust
|
|
22
|
+
*/
|
|
23
|
+
async getCirclesOfTrust() {
|
|
24
|
+
return getCirclesOfTrust({
|
|
25
|
+
state: this.state
|
|
26
|
+
});
|
|
32
27
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Export SAML circle of trust
|
|
31
|
+
* @param {String} cotId circle of trust id/name
|
|
32
|
+
*/
|
|
33
|
+
async exportCircleOfTrust(cotId) {
|
|
34
|
+
return exportCircleOfTrust({
|
|
35
|
+
cotId,
|
|
36
|
+
state: this.state
|
|
37
37
|
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Export all SAML circles of trust
|
|
42
|
+
*/
|
|
43
|
+
async exportCirclesOfTrust() {
|
|
44
|
+
return exportCirclesOfTrust({
|
|
45
|
+
state: this.state
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Import a SAML circle of trust by id/name from file
|
|
51
|
+
* @param {String} cotId Circle of trust id/name
|
|
52
|
+
* @param {CirclesOfTrustExportInterface} importData Import data
|
|
53
|
+
*/
|
|
54
|
+
async importCircleOfTrust(cotId, importData) {
|
|
55
|
+
return importCircleOfTrust({
|
|
56
|
+
cotId,
|
|
57
|
+
importData,
|
|
58
|
+
state: this.state
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Import first SAML circle of trust
|
|
64
|
+
* @param {CirclesOfTrustExportInterface} importData Import data
|
|
65
|
+
*/
|
|
66
|
+
async importFirstCircleOfTrust(importData) {
|
|
67
|
+
return importFirstCircleOfTrust({
|
|
68
|
+
importData,
|
|
69
|
+
state: this.state
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Import all SAML circles of trust
|
|
75
|
+
* @param {CirclesOfTrustExportInterface} importData Import file name
|
|
76
|
+
*/
|
|
77
|
+
async importCirclesOfTrust(importData) {
|
|
78
|
+
return importCirclesOfTrust({
|
|
79
|
+
importData,
|
|
80
|
+
state: this.state
|
|
42
81
|
});
|
|
43
|
-
printMessage(table.toString());
|
|
44
82
|
}
|
|
45
83
|
}
|
|
46
84
|
|
|
47
85
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
* @param {Object} fileData File data object to add dependencies to
|
|
86
|
+
* Create an empty agent export template
|
|
87
|
+
* @returns {CirclesOfTrustExportInterface} an empty agent export template
|
|
51
88
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
89
|
+
function createCirclesOfTrustExportTemplate({
|
|
90
|
+
state
|
|
91
|
+
}) {
|
|
92
|
+
return {
|
|
93
|
+
meta: getMetadata({
|
|
94
|
+
state
|
|
95
|
+
}),
|
|
96
|
+
script: {},
|
|
97
|
+
saml: {
|
|
98
|
+
hosted: {},
|
|
99
|
+
remote: {},
|
|
100
|
+
metadata: {},
|
|
101
|
+
cot: {}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
55
104
|
}
|
|
105
|
+
export { getCircleOfTrust };
|
|
56
106
|
|
|
57
107
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @param {String} cotId circle of trust id/name
|
|
60
|
-
* @param {String} file Optional filename
|
|
108
|
+
* Get circles of trust
|
|
61
109
|
*/
|
|
62
|
-
export async function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
updateProgressIndicator(`Exporting ${cotId}`);
|
|
72
|
-
const fileData = getFileDataTemplate();
|
|
73
|
-
fileData.saml.cot[cotId] = cotData;
|
|
74
|
-
await exportDependencies(cotData, fileData);
|
|
75
|
-
saveJsonToFile(fileData, fileName);
|
|
76
|
-
stopProgressIndicator(`Exported ${cotId.brightCyan} to ${fileName.brightCyan}.`);
|
|
77
|
-
} catch (err) {
|
|
78
|
-
stopProgressIndicator(`${err}`);
|
|
79
|
-
printMessage(err, 'error');
|
|
80
|
-
}
|
|
110
|
+
export async function getCirclesOfTrust({
|
|
111
|
+
state
|
|
112
|
+
}) {
|
|
113
|
+
const {
|
|
114
|
+
result
|
|
115
|
+
} = await _getCirclesOfTrust({
|
|
116
|
+
state
|
|
117
|
+
});
|
|
118
|
+
return result;
|
|
81
119
|
}
|
|
82
120
|
|
|
83
121
|
/**
|
|
84
|
-
* Export
|
|
85
|
-
* @param {
|
|
122
|
+
* Export circle of trust
|
|
123
|
+
* @param {string} cotId circle of trust id/name
|
|
124
|
+
* @returns {Promise<CirclesOfTrustExportInterface>} a promise that resolves to an CirclesOfTrustExportInterface object
|
|
86
125
|
*/
|
|
87
|
-
export async function
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
126
|
+
export async function exportCircleOfTrust({
|
|
127
|
+
cotId,
|
|
128
|
+
state
|
|
129
|
+
}) {
|
|
130
|
+
debugMessage(`CirclesOfTrustOps.exportCircleOfTrust: start`);
|
|
131
|
+
const exportData = createCirclesOfTrustExportTemplate({
|
|
132
|
+
state
|
|
133
|
+
});
|
|
134
|
+
const errors = [];
|
|
94
135
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// eslint-disable-next-line no-await-in-loop
|
|
101
|
-
await exportDependencies(cotData, fileData);
|
|
102
|
-
fileData.saml.cot[cotData._id] = cotData;
|
|
103
|
-
}
|
|
104
|
-
saveJsonToFile(fileData, fileName);
|
|
105
|
-
stopProgressIndicator(`${allCotData.length} circle(s) of trust exported to ${fileName}.`);
|
|
136
|
+
const cotData = await getCircleOfTrust({
|
|
137
|
+
cotId,
|
|
138
|
+
state
|
|
139
|
+
});
|
|
140
|
+
exportData.saml.cot[cotData._id] = cotData;
|
|
106
141
|
} catch (error) {
|
|
107
|
-
|
|
108
|
-
printMessage(error, 'data');
|
|
142
|
+
errors.push(error);
|
|
109
143
|
}
|
|
144
|
+
if (errors.length) {
|
|
145
|
+
const errorMessages = errors.map(error => {
|
|
146
|
+
var _error$response;
|
|
147
|
+
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 404) {
|
|
148
|
+
return `Circle of trust ${cotId} does not exist in realm ${state.getRealm()}`;
|
|
149
|
+
} else {
|
|
150
|
+
var _error$response2, _error$response2$data;
|
|
151
|
+
return ((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.message) || error.message;
|
|
152
|
+
}
|
|
153
|
+
}).join('\n');
|
|
154
|
+
throw new Error(`Export error:\n${errorMessages}`);
|
|
155
|
+
}
|
|
156
|
+
debugMessage(`CirclesOfTrustOps.exportCircleOfTrust: end`);
|
|
157
|
+
return exportData;
|
|
110
158
|
}
|
|
111
159
|
|
|
112
160
|
/**
|
|
113
|
-
* Export
|
|
161
|
+
* Export circles of trust
|
|
162
|
+
* @returns {Promise<CirclesOfTrustExportInterface>} a promise that resolves to an CirclesOfTrustExportInterface object
|
|
114
163
|
*/
|
|
115
|
-
export async function
|
|
116
|
-
|
|
164
|
+
export async function exportCirclesOfTrust({
|
|
165
|
+
state
|
|
166
|
+
}) {
|
|
167
|
+
debugMessage(`CirclesOfTrustOps.exportCirclesOfTrust: start`);
|
|
168
|
+
const exportData = createCirclesOfTrustExportTemplate({
|
|
169
|
+
state
|
|
170
|
+
});
|
|
171
|
+
const errors = [];
|
|
117
172
|
try {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const fileName = getTypedFilename(cotData._id, 'cot.saml');
|
|
124
|
-
const fileData = getFileDataTemplate();
|
|
125
|
-
// eslint-disable-next-line no-await-in-loop
|
|
126
|
-
await exportDependencies(cotData, fileData);
|
|
127
|
-
fileData.saml.cot[cotData._id] = cotData;
|
|
128
|
-
saveJsonToFile(fileData, fileName);
|
|
173
|
+
const cots = await getCirclesOfTrust({
|
|
174
|
+
state
|
|
175
|
+
});
|
|
176
|
+
for (const cot of cots) {
|
|
177
|
+
exportData.saml.cot[cot._id] = cot;
|
|
129
178
|
}
|
|
130
|
-
stopProgressIndicator(`${allCotData.length} providers exported.`);
|
|
131
179
|
} catch (error) {
|
|
132
|
-
|
|
133
|
-
printMessage(error, 'data');
|
|
180
|
+
errors.push(error);
|
|
134
181
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
*/
|
|
142
|
-
async function importDependencies(cotData, fileData) {
|
|
143
|
-
// TODO: Import dependencies
|
|
144
|
-
return [cotData, fileData];
|
|
182
|
+
if (errors.length) {
|
|
183
|
+
const errorMessages = errors.map(error => error.message).join('\n');
|
|
184
|
+
throw new Error(`Export error:\n${errorMessages}`);
|
|
185
|
+
}
|
|
186
|
+
debugMessage(`CirclesOfTrustOps.exportCirclesOfTrust: end`);
|
|
187
|
+
return exportData;
|
|
145
188
|
}
|
|
146
189
|
|
|
147
190
|
/**
|
|
148
191
|
* Import a SAML circle of trust by id/name from file
|
|
149
192
|
* @param {String} cotId Circle of trust id/name
|
|
150
|
-
* @param {
|
|
193
|
+
* @param {CirclesOfTrustExportInterface} importData import data
|
|
151
194
|
*/
|
|
152
|
-
export async function importCircleOfTrust(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
195
|
+
export async function importCircleOfTrust({
|
|
196
|
+
cotId,
|
|
197
|
+
importData,
|
|
198
|
+
state
|
|
199
|
+
}) {
|
|
200
|
+
let response = null;
|
|
201
|
+
const errors = [];
|
|
202
|
+
const imported = [];
|
|
203
|
+
for (const id of Object.keys(importData.saml.cot)) {
|
|
204
|
+
if (id === cotId) {
|
|
205
|
+
try {
|
|
206
|
+
const cotData = importData.saml.cot[id];
|
|
207
|
+
delete cotData._rev;
|
|
162
208
|
try {
|
|
163
|
-
await createCircleOfTrust(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
209
|
+
response = await createCircleOfTrust({
|
|
210
|
+
cotData,
|
|
211
|
+
state
|
|
212
|
+
});
|
|
213
|
+
} catch (createError) {
|
|
214
|
+
var _createError$response;
|
|
215
|
+
if (((_createError$response = createError.response) === null || _createError$response === void 0 ? void 0 : _createError$response.status) === 409) response = await updateCircleOfTrust({
|
|
216
|
+
cotId: id,
|
|
217
|
+
cotData,
|
|
218
|
+
state
|
|
219
|
+
});else throw createError;
|
|
169
220
|
}
|
|
170
|
-
|
|
171
|
-
|
|
221
|
+
imported.push(id);
|
|
222
|
+
} catch (error) {
|
|
223
|
+
errors.push(error);
|
|
172
224
|
}
|
|
173
|
-
} else {
|
|
174
|
-
printMessage('Import validation failed...', 'error');
|
|
175
225
|
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
createProgressIndicator(1, 'Importing circle of trust...');
|
|
189
|
-
for (const cotId in fileData.saml.cot) {
|
|
190
|
-
if ({}.hasOwnProperty.call(fileData.saml.cot, cotId)) {
|
|
191
|
-
const cotData = _.cloneDeep(fileData.saml.cot[cotId]);
|
|
192
|
-
updateProgressIndicator(`Importing ${cotId}`);
|
|
193
|
-
// eslint-disable-next-line no-await-in-loop
|
|
194
|
-
await importDependencies(cotData, fileData);
|
|
195
|
-
try {
|
|
196
|
-
await createCircleOfTrust(cotData);
|
|
197
|
-
stopProgressIndicator(`Successfully imported ${cotId}.`);
|
|
198
|
-
} catch (createCircleOfTrustErr) {
|
|
199
|
-
stopProgressIndicator(`Error importing ${cotId}.`);
|
|
200
|
-
printMessage(`Error importing ${cotId}`, 'error');
|
|
201
|
-
printMessage(createCircleOfTrustErr.response.data, 'error');
|
|
202
|
-
}
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
} else {
|
|
207
|
-
printMessage('Import validation failed...', 'error');
|
|
208
|
-
}
|
|
209
|
-
});
|
|
226
|
+
}
|
|
227
|
+
if (errors.length) {
|
|
228
|
+
const errorMessages = errors.map(error => {
|
|
229
|
+
var _error$response3, _error$response3$data;
|
|
230
|
+
return ((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.message) || error.message;
|
|
231
|
+
}).join('\n');
|
|
232
|
+
throw new Error(`Import error:\n${errorMessages}`);
|
|
233
|
+
}
|
|
234
|
+
if (0 === imported.length) {
|
|
235
|
+
throw new Error(`Import error:\n${cotId} not found in import data!`);
|
|
236
|
+
}
|
|
237
|
+
return response;
|
|
210
238
|
}
|
|
211
239
|
|
|
212
240
|
/**
|
|
213
|
-
* Import
|
|
214
|
-
* @param {
|
|
241
|
+
* Import first SAML circle of trust
|
|
242
|
+
* @param {CirclesOfTrustExportInterface} importData import data
|
|
215
243
|
*/
|
|
216
|
-
export async function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
244
|
+
export async function importFirstCircleOfTrust({
|
|
245
|
+
importData,
|
|
246
|
+
state
|
|
247
|
+
}) {
|
|
248
|
+
let response = null;
|
|
249
|
+
const errors = [];
|
|
250
|
+
const imported = [];
|
|
251
|
+
for (const id of Object.keys(importData.saml.cot)) {
|
|
252
|
+
try {
|
|
253
|
+
const cotData = importData.saml.cot[id];
|
|
254
|
+
delete cotData._rev;
|
|
255
|
+
try {
|
|
256
|
+
response = await createCircleOfTrust({
|
|
257
|
+
cotData,
|
|
258
|
+
state
|
|
259
|
+
});
|
|
260
|
+
} catch (createError) {
|
|
261
|
+
var _createError$response2;
|
|
262
|
+
if (((_createError$response2 = createError.response) === null || _createError$response2 === void 0 ? void 0 : _createError$response2.status) === 409) response = await updateCircleOfTrust({
|
|
263
|
+
cotId: id,
|
|
264
|
+
cotData,
|
|
265
|
+
state
|
|
266
|
+
});else throw createError;
|
|
236
267
|
}
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
|
|
268
|
+
imported.push(id);
|
|
269
|
+
} catch (error) {
|
|
270
|
+
errors.push(error);
|
|
240
271
|
}
|
|
241
|
-
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
if (errors.length) {
|
|
275
|
+
const errorMessages = errors.map(error => {
|
|
276
|
+
var _error$response4, _error$response4$data;
|
|
277
|
+
return ((_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : _error$response4$data.message) || error.message;
|
|
278
|
+
}).join('\n');
|
|
279
|
+
throw new Error(`Import error:\n${errorMessages}`);
|
|
280
|
+
}
|
|
281
|
+
if (0 === imported.length) {
|
|
282
|
+
throw new Error(`Import error:\nNo circles of trust found in import data!`);
|
|
283
|
+
}
|
|
284
|
+
return response;
|
|
242
285
|
}
|
|
243
286
|
|
|
244
287
|
/**
|
|
245
|
-
* Import
|
|
288
|
+
* Import SAML circles of trust
|
|
289
|
+
* @param {CirclesOfTrustExportInterface} importData import data
|
|
246
290
|
*/
|
|
247
|
-
export async function
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
printMessage(`\nError importing ${cotId}`, 'error');
|
|
271
|
-
printMessage(createCircleOfTrustErr.response.data, 'error');
|
|
272
|
-
}
|
|
273
|
-
}
|
|
291
|
+
export async function importCirclesOfTrust({
|
|
292
|
+
importData,
|
|
293
|
+
state
|
|
294
|
+
}) {
|
|
295
|
+
const response = [];
|
|
296
|
+
const errors = [];
|
|
297
|
+
const imported = [];
|
|
298
|
+
for (const id of Object.keys(importData.saml.cot)) {
|
|
299
|
+
try {
|
|
300
|
+
const cotData = importData.saml.cot[id];
|
|
301
|
+
delete cotData._rev;
|
|
302
|
+
try {
|
|
303
|
+
response.push(await createCircleOfTrust({
|
|
304
|
+
cotData,
|
|
305
|
+
state
|
|
306
|
+
}));
|
|
307
|
+
} catch (createError) {
|
|
308
|
+
var _createError$response3;
|
|
309
|
+
if (((_createError$response3 = createError.response) === null || _createError$response3 === void 0 ? void 0 : _createError$response3.status) === 409) response.push(await updateCircleOfTrust({
|
|
310
|
+
cotId: id,
|
|
311
|
+
cotData,
|
|
312
|
+
state
|
|
313
|
+
}));else throw createError;
|
|
274
314
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
printMessage(`Validation of ${file} failed!`, 'error');
|
|
315
|
+
imported.push(id);
|
|
316
|
+
} catch (error) {
|
|
317
|
+
errors.push(error);
|
|
279
318
|
}
|
|
280
319
|
}
|
|
281
|
-
|
|
320
|
+
if (errors.length) {
|
|
321
|
+
const errorMessages = errors.map(error => {
|
|
322
|
+
var _error$response5, _error$response5$data;
|
|
323
|
+
return ((_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : (_error$response5$data = _error$response5.data) === null || _error$response5$data === void 0 ? void 0 : _error$response5$data.message) || error.message;
|
|
324
|
+
}).join('\n');
|
|
325
|
+
throw new Error(`Import error:\n${errorMessages}`);
|
|
326
|
+
}
|
|
327
|
+
if (0 === imported.length) {
|
|
328
|
+
throw new Error(`Import error:\nNo circles of trust found in import data!`);
|
|
329
|
+
}
|
|
330
|
+
return response;
|
|
282
331
|
}
|
|
283
332
|
//# sourceMappingURL=CirclesOfTrustOps.js.map
|