@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
package/esm/ops/AgentOps.mjs
CHANGED
|
@@ -4,6 +4,423 @@ import { validateImport } from './utils/ExportImportUtils';
|
|
|
4
4
|
export const AGENT_TYPE_IG = 'IdentityGatewayAgent';
|
|
5
5
|
export const AGENT_TYPE_JAVA = 'J2EEAgent';
|
|
6
6
|
export const AGENT_TYPE_WEB = 'WebAgent';
|
|
7
|
+
export default class AgentOps {
|
|
8
|
+
constructor(state) {
|
|
9
|
+
this.state = state;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Get all agents. Results are sorted aphabetically.
|
|
14
|
+
* @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array of agent objects
|
|
15
|
+
*/
|
|
16
|
+
async getAgents() {
|
|
17
|
+
return getAgents({
|
|
18
|
+
state: this.state
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get agent
|
|
24
|
+
* @param {string} agentId agent id/name
|
|
25
|
+
* @returns {Promise} a promise that resolves to an agent object
|
|
26
|
+
*/
|
|
27
|
+
async getAgent(agentId) {
|
|
28
|
+
return getAgent({
|
|
29
|
+
agentId,
|
|
30
|
+
state: this.state
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get agent by type and id
|
|
36
|
+
* @param {string} agentType agent type (IdentityGatewayAgent, J2EEAgent, WebAgent)
|
|
37
|
+
* @param {string} agentId agent id/name
|
|
38
|
+
* @returns {Promise} a promise that resolves to an agent object
|
|
39
|
+
*/
|
|
40
|
+
async getAgentByTypeAndId(agentType, agentId) {
|
|
41
|
+
return getAgentByTypeAndId({
|
|
42
|
+
agentType,
|
|
43
|
+
agentId,
|
|
44
|
+
state: this.state
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get identity gateway agents
|
|
50
|
+
* @returns {Promise} a promise that resolves to an array of IdentityGatewayAgent objects
|
|
51
|
+
*/
|
|
52
|
+
async getIdentityGatewayAgents() {
|
|
53
|
+
return getIdentityGatewayAgents({
|
|
54
|
+
state: this.state
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get identity gateway agent
|
|
60
|
+
* @param {string} gatewayId gateway id
|
|
61
|
+
* @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object
|
|
62
|
+
*/
|
|
63
|
+
async getIdentityGatewayAgent(gatewayId) {
|
|
64
|
+
return getIdentityGatewayAgent({
|
|
65
|
+
gatewayId,
|
|
66
|
+
state: this.state
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Put identity gateway agent
|
|
72
|
+
* @param {string} gatewayId gateway id
|
|
73
|
+
* @param {Object} gatewayData IdentityGatewayAgent object
|
|
74
|
+
* @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object
|
|
75
|
+
*/
|
|
76
|
+
async putIdentityGatewayAgent(gatewayId, gatewayData) {
|
|
77
|
+
return putIdentityGatewayAgent({
|
|
78
|
+
gatewayId,
|
|
79
|
+
gatewayData,
|
|
80
|
+
state: this.state
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get java agents
|
|
86
|
+
* @returns {Promise} a promise that resolves to an array of J2EEAgent objects
|
|
87
|
+
*/
|
|
88
|
+
async getJavaAgents() {
|
|
89
|
+
return getJavaAgents({
|
|
90
|
+
state: this.state
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get java agent
|
|
96
|
+
* @param {string} agentId java agent id
|
|
97
|
+
* @returns {Promise} a promise that resolves to an object containing an J2EEAgent object
|
|
98
|
+
*/
|
|
99
|
+
async getJavaAgent(agentId) {
|
|
100
|
+
return getJavaAgent({
|
|
101
|
+
agentId,
|
|
102
|
+
state: this.state
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Put java agent
|
|
108
|
+
* @param {string} agentId java agent id
|
|
109
|
+
* @param {Object} agentData java agent object
|
|
110
|
+
* @returns {Promise} a promise that resolves to an object containing an java agent object
|
|
111
|
+
*/
|
|
112
|
+
async putJavaAgent(agentId, agentData) {
|
|
113
|
+
return putJavaAgent({
|
|
114
|
+
agentId,
|
|
115
|
+
agentData,
|
|
116
|
+
state: this.state
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get web agents
|
|
122
|
+
* @returns {Promise} a promise that resolves to an array of WebAgent objects
|
|
123
|
+
*/
|
|
124
|
+
async getWebAgents() {
|
|
125
|
+
return getWebAgents({
|
|
126
|
+
state: this.state
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Get web agent
|
|
132
|
+
* @param {string} agentId web agent id
|
|
133
|
+
* @returns {Promise} a promise that resolves to an object containing an WebAgent object
|
|
134
|
+
*/
|
|
135
|
+
async getWebAgent(agentId) {
|
|
136
|
+
return getWebAgent({
|
|
137
|
+
agentId,
|
|
138
|
+
state: this.state
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Put web agent
|
|
144
|
+
* @param {string} agentId web agent id
|
|
145
|
+
* @param {Object} agentData WebAgent object
|
|
146
|
+
* @returns {Promise} a promise that resolves to an object containing an WebAgent object
|
|
147
|
+
*/
|
|
148
|
+
async putWebAgent(agentId, agentData) {
|
|
149
|
+
return putWebAgent({
|
|
150
|
+
agentId,
|
|
151
|
+
agentData,
|
|
152
|
+
state: this.state
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Export all agents. The response can be saved to file as is.
|
|
158
|
+
* @returns {Promise<AgentExportInterface>} Promise resolving to an AgentExportInterface object.
|
|
159
|
+
*/
|
|
160
|
+
async exportAgents() {
|
|
161
|
+
return exportAgents({
|
|
162
|
+
state: this.state
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Export all identity gateway agents. The response can be saved to file as is.
|
|
168
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
169
|
+
*/
|
|
170
|
+
async exportIdentityGatewayAgents() {
|
|
171
|
+
return exportIdentityGatewayAgents({
|
|
172
|
+
state: this.state
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Export all java agents. The response can be saved to file as is.
|
|
178
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
179
|
+
*/
|
|
180
|
+
async exportJavaAgents() {
|
|
181
|
+
return exportJavaAgents({
|
|
182
|
+
state: this.state
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Export all web agents. The response can be saved to file as is.
|
|
188
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
189
|
+
*/
|
|
190
|
+
async exportWebAgents() {
|
|
191
|
+
return exportWebAgents({
|
|
192
|
+
state: this.state
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Export agent. The response can be saved to file as is.
|
|
198
|
+
* @param agentId agent id/name
|
|
199
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
200
|
+
*/
|
|
201
|
+
async exportAgent(agentId) {
|
|
202
|
+
return exportAgent({
|
|
203
|
+
agentId,
|
|
204
|
+
state: this.state
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Export identity gateway agent. The response can be saved to file as is.
|
|
210
|
+
* @param agentId agent id/name
|
|
211
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
212
|
+
*/
|
|
213
|
+
async exportIdentityGatewayAgent(agentId) {
|
|
214
|
+
return exportIdentityGatewayAgent({
|
|
215
|
+
agentId,
|
|
216
|
+
state: this.state
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Export java agent. The response can be saved to file as is.
|
|
222
|
+
* @param agentId agent id/name
|
|
223
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
224
|
+
*/
|
|
225
|
+
async exportJavaAgent(agentId) {
|
|
226
|
+
return exportJavaAgent({
|
|
227
|
+
agentId,
|
|
228
|
+
state: this.state
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Export web agent. The response can be saved to file as is.
|
|
234
|
+
* @param agentId agent id/name
|
|
235
|
+
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
236
|
+
*/
|
|
237
|
+
async exportWebAgent(agentId) {
|
|
238
|
+
return exportWebAgent({
|
|
239
|
+
agentId,
|
|
240
|
+
state: this.state
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Import agents. The import data is usually read from an agent export file.
|
|
246
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
247
|
+
*/
|
|
248
|
+
async importAgents(importData) {
|
|
249
|
+
return importAgents({
|
|
250
|
+
importData,
|
|
251
|
+
state: this.state
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Import identity gateway agents. The import data is usually read from an agent export file.
|
|
257
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
258
|
+
*/
|
|
259
|
+
async importIdentityGatewayAgents(importData) {
|
|
260
|
+
return importIdentityGatewayAgents({
|
|
261
|
+
importData,
|
|
262
|
+
state: this.state
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Import java agents. The import data is usually read from an agent export file.
|
|
268
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
269
|
+
*/
|
|
270
|
+
async importJavaAgents(importData) {
|
|
271
|
+
return importJavaAgents({
|
|
272
|
+
importData,
|
|
273
|
+
state: this.state
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Import web agents. The import data is usually read from an agent export file.
|
|
279
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
280
|
+
*/
|
|
281
|
+
async importWebAgents(importData) {
|
|
282
|
+
return importWebAgents({
|
|
283
|
+
importData,
|
|
284
|
+
state: this.state
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Import agent. The import data is usually read from an agent export file.
|
|
290
|
+
* @param {string} agentId agent id/name
|
|
291
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
292
|
+
* @returns {Promise} Promise resolving to an agent object.
|
|
293
|
+
*/
|
|
294
|
+
async importAgent(agentId, importData) {
|
|
295
|
+
return importAgent({
|
|
296
|
+
agentId,
|
|
297
|
+
importData,
|
|
298
|
+
state: this.state
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Import identity gateway agent. The import data is usually read from an agent export file.
|
|
304
|
+
* @param {string} agentId agent id/name
|
|
305
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
306
|
+
* @returns {Promise} Promise resolving to an agent object.
|
|
307
|
+
*/
|
|
308
|
+
async importIdentityGatewayAgent(agentId, importData) {
|
|
309
|
+
return importIdentityGatewayAgent({
|
|
310
|
+
agentId,
|
|
311
|
+
importData,
|
|
312
|
+
state: this.state
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Import java agent. The import data is usually read from an agent export file.
|
|
318
|
+
* @param {string} agentId agent id/name
|
|
319
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
320
|
+
* @returns {Promise} Promise resolving to an agent object.
|
|
321
|
+
*/
|
|
322
|
+
async importJavaAgent(agentId, importData) {
|
|
323
|
+
return importJavaAgent({
|
|
324
|
+
agentId,
|
|
325
|
+
importData,
|
|
326
|
+
state: this.state
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Import java agent. The import data is usually read from an agent export file.
|
|
332
|
+
* @param {string} agentId agent id/name
|
|
333
|
+
* @param {AgentExportInterface} importData agent import data.
|
|
334
|
+
* @returns {Promise} Promise resolving to an agent object.
|
|
335
|
+
*/
|
|
336
|
+
async importWebAgent(agentId, importData) {
|
|
337
|
+
return importWebAgent({
|
|
338
|
+
agentId,
|
|
339
|
+
importData,
|
|
340
|
+
state: this.state
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Delete all agents
|
|
346
|
+
*/
|
|
347
|
+
async deleteAgents() {
|
|
348
|
+
return deleteAgents({
|
|
349
|
+
state: this.state
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Delete agent
|
|
355
|
+
* @param agentId agent id/name
|
|
356
|
+
*/
|
|
357
|
+
async deleteAgent(agentId) {
|
|
358
|
+
return deleteAgent({
|
|
359
|
+
agentId,
|
|
360
|
+
state: this.state
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Delete all identity gateway agents
|
|
366
|
+
*/
|
|
367
|
+
async deleteIdentityGatewayAgents() {
|
|
368
|
+
return deleteIdentityGatewayAgents({
|
|
369
|
+
state: this.state
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Delete identity gateway agent
|
|
375
|
+
* @param agentId agent id/name
|
|
376
|
+
*/
|
|
377
|
+
async deleteIdentityGatewayAgent(agentId) {
|
|
378
|
+
return deleteIdentityGatewayAgent({
|
|
379
|
+
agentId,
|
|
380
|
+
state: this.state
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Delete all java agents
|
|
386
|
+
*/
|
|
387
|
+
async deleteJavaAgents() {
|
|
388
|
+
return deleteJavaAgents({
|
|
389
|
+
state: this.state
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Delete java agent
|
|
395
|
+
* @param agentId agent id/name
|
|
396
|
+
*/
|
|
397
|
+
async deleteJavaAgent(agentId) {
|
|
398
|
+
return deleteJavaAgent({
|
|
399
|
+
agentId,
|
|
400
|
+
state: this.state
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Delete all web agents
|
|
406
|
+
*/
|
|
407
|
+
async deleteWebAgents() {
|
|
408
|
+
return deleteWebAgents({
|
|
409
|
+
state: this.state
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Delete web agent
|
|
415
|
+
* @param agentId agent id/name
|
|
416
|
+
*/
|
|
417
|
+
async deleteWebAgent(agentId) {
|
|
418
|
+
return deleteWebAgent({
|
|
419
|
+
agentId,
|
|
420
|
+
state: this.state
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
}
|
|
7
424
|
|
|
8
425
|
/**
|
|
9
426
|
* Create an empty agent export template
|
|
@@ -20,11 +437,22 @@ export function createAgentExportTemplate() {
|
|
|
20
437
|
* Get all agents. Results are sorted aphabetically.
|
|
21
438
|
* @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array of agent objects
|
|
22
439
|
*/
|
|
23
|
-
export async function getAgents(
|
|
440
|
+
export async function getAgents({
|
|
441
|
+
state
|
|
442
|
+
}) {
|
|
24
443
|
debugMessage(`AgentOps.getAgents: start`);
|
|
25
444
|
let agents = [];
|
|
26
445
|
try {
|
|
27
|
-
const resolved = await Promise.all([getAgentsByType(
|
|
446
|
+
const resolved = await Promise.all([getAgentsByType({
|
|
447
|
+
agentType: 'IdentityGatewayAgent',
|
|
448
|
+
state
|
|
449
|
+
}), getAgentsByType({
|
|
450
|
+
agentType: 'J2EEAgent',
|
|
451
|
+
state
|
|
452
|
+
}), getAgentsByType({
|
|
453
|
+
agentType: 'WebAgent',
|
|
454
|
+
state
|
|
455
|
+
})]);
|
|
28
456
|
agents = agents.concat(resolved[0].result);
|
|
29
457
|
agents = agents.concat(resolved[1].result);
|
|
30
458
|
agents = agents.concat(resolved[2].result);
|
|
@@ -42,11 +470,21 @@ export async function getAgents() {
|
|
|
42
470
|
* @param {string} agentId agent id/name
|
|
43
471
|
* @returns {Promise} a promise that resolves to an agent object
|
|
44
472
|
*/
|
|
45
|
-
export async function getAgent(
|
|
473
|
+
export async function getAgent({
|
|
474
|
+
agentId,
|
|
475
|
+
state
|
|
476
|
+
}) {
|
|
46
477
|
debugMessage(`AgentOps.getAgent: start`);
|
|
47
|
-
const agents = await findAgentById(
|
|
478
|
+
const agents = await findAgentById({
|
|
479
|
+
agentId,
|
|
480
|
+
state
|
|
481
|
+
});
|
|
48
482
|
if (agents.length === 1) {
|
|
49
|
-
const result = await _getAgentByTypeAndId(
|
|
483
|
+
const result = await _getAgentByTypeAndId({
|
|
484
|
+
agentType: agents[0]._type,
|
|
485
|
+
agentId: agents[0]._id,
|
|
486
|
+
state
|
|
487
|
+
});
|
|
50
488
|
debugMessage(`AgentOps.getAgent: end`);
|
|
51
489
|
return result;
|
|
52
490
|
} else if (agents.length === 0) {
|
|
@@ -62,9 +500,17 @@ export async function getAgent(agentId) {
|
|
|
62
500
|
* @param {string} agentId agent id/name
|
|
63
501
|
* @returns {Promise} a promise that resolves to an agent object
|
|
64
502
|
*/
|
|
65
|
-
export async function getAgentByTypeAndId(
|
|
503
|
+
export async function getAgentByTypeAndId({
|
|
504
|
+
agentType,
|
|
505
|
+
agentId,
|
|
506
|
+
state
|
|
507
|
+
}) {
|
|
66
508
|
debugMessage(`AgentOps.getAgentByTypeAndId: start`);
|
|
67
|
-
const result = await _getAgentByTypeAndId(
|
|
509
|
+
const result = await _getAgentByTypeAndId({
|
|
510
|
+
agentType,
|
|
511
|
+
agentId,
|
|
512
|
+
state
|
|
513
|
+
});
|
|
68
514
|
debugMessage(`AgentOps.getAgentByTypeAndId: start`);
|
|
69
515
|
return result;
|
|
70
516
|
}
|
|
@@ -73,11 +519,16 @@ export async function getAgentByTypeAndId(agentType, agentId) {
|
|
|
73
519
|
* Get identity gateway agents
|
|
74
520
|
* @returns {Promise} a promise that resolves to an array of IdentityGatewayAgent objects
|
|
75
521
|
*/
|
|
76
|
-
export async function getIdentityGatewayAgents(
|
|
522
|
+
export async function getIdentityGatewayAgents({
|
|
523
|
+
state
|
|
524
|
+
}) {
|
|
77
525
|
debugMessage(`AgentOps.getIdentityGatewayAgents: start`);
|
|
78
526
|
const {
|
|
79
527
|
result
|
|
80
|
-
} = await getAgentsByType(
|
|
528
|
+
} = await getAgentsByType({
|
|
529
|
+
agentType: AGENT_TYPE_IG,
|
|
530
|
+
state
|
|
531
|
+
});
|
|
81
532
|
debugMessage(`AgentOps.getIdentityGatewayAgents: end`);
|
|
82
533
|
return result;
|
|
83
534
|
}
|
|
@@ -87,9 +538,16 @@ export async function getIdentityGatewayAgents() {
|
|
|
87
538
|
* @param {string} gatewayId gateway id
|
|
88
539
|
* @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object
|
|
89
540
|
*/
|
|
90
|
-
export async function getIdentityGatewayAgent(
|
|
541
|
+
export async function getIdentityGatewayAgent({
|
|
542
|
+
gatewayId,
|
|
543
|
+
state
|
|
544
|
+
}) {
|
|
91
545
|
debugMessage(`AgentOps.getIdentityGatewayAgent: start`);
|
|
92
|
-
const result = await getAgentByTypeAndId(
|
|
546
|
+
const result = await getAgentByTypeAndId({
|
|
547
|
+
agentType: AGENT_TYPE_IG,
|
|
548
|
+
agentId: gatewayId,
|
|
549
|
+
state
|
|
550
|
+
});
|
|
93
551
|
debugMessage(`AgentOps.getIdentityGatewayAgent: end`);
|
|
94
552
|
return result;
|
|
95
553
|
}
|
|
@@ -100,9 +558,18 @@ export async function getIdentityGatewayAgent(gatewayId) {
|
|
|
100
558
|
* @param {Object} gatewayData IdentityGatewayAgent object
|
|
101
559
|
* @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object
|
|
102
560
|
*/
|
|
103
|
-
export async function putIdentityGatewayAgent(
|
|
561
|
+
export async function putIdentityGatewayAgent({
|
|
562
|
+
gatewayId,
|
|
563
|
+
gatewayData,
|
|
564
|
+
state
|
|
565
|
+
}) {
|
|
104
566
|
debugMessage(`AgentOps.putIdentityGatewayAgent: start`);
|
|
105
|
-
const result = await putAgentByTypeAndId(
|
|
567
|
+
const result = await putAgentByTypeAndId({
|
|
568
|
+
agentType: AGENT_TYPE_IG,
|
|
569
|
+
agentId: gatewayId,
|
|
570
|
+
agentData: gatewayData,
|
|
571
|
+
state
|
|
572
|
+
});
|
|
106
573
|
debugMessage(`AgentOps.putIdentityGatewayAgent: end`);
|
|
107
574
|
return result;
|
|
108
575
|
}
|
|
@@ -111,11 +578,16 @@ export async function putIdentityGatewayAgent(gatewayId, gatewayData) {
|
|
|
111
578
|
* Get java agents
|
|
112
579
|
* @returns {Promise} a promise that resolves to an array of J2EEAgent objects
|
|
113
580
|
*/
|
|
114
|
-
export async function getJavaAgents(
|
|
581
|
+
export async function getJavaAgents({
|
|
582
|
+
state
|
|
583
|
+
}) {
|
|
115
584
|
debugMessage(`AgentOps.getJavaAgents: start`);
|
|
116
585
|
const {
|
|
117
586
|
result
|
|
118
|
-
} = await getAgentsByType(
|
|
587
|
+
} = await getAgentsByType({
|
|
588
|
+
agentType: AGENT_TYPE_JAVA,
|
|
589
|
+
state
|
|
590
|
+
});
|
|
119
591
|
debugMessage(`AgentOps.getJavaAgents: end`);
|
|
120
592
|
return result;
|
|
121
593
|
}
|
|
@@ -125,9 +597,16 @@ export async function getJavaAgents() {
|
|
|
125
597
|
* @param {string} agentId java agent id
|
|
126
598
|
* @returns {Promise} a promise that resolves to an object containing an J2EEAgent object
|
|
127
599
|
*/
|
|
128
|
-
export async function getJavaAgent(
|
|
600
|
+
export async function getJavaAgent({
|
|
601
|
+
agentId,
|
|
602
|
+
state
|
|
603
|
+
}) {
|
|
129
604
|
debugMessage(`AgentOps.getJavaAgent: start`);
|
|
130
|
-
const result = await getAgentByTypeAndId(
|
|
605
|
+
const result = await getAgentByTypeAndId({
|
|
606
|
+
agentType: AGENT_TYPE_JAVA,
|
|
607
|
+
agentId,
|
|
608
|
+
state
|
|
609
|
+
});
|
|
131
610
|
debugMessage(`AgentOps.getJavaAgent: end`);
|
|
132
611
|
return result;
|
|
133
612
|
}
|
|
@@ -138,9 +617,18 @@ export async function getJavaAgent(agentId) {
|
|
|
138
617
|
* @param {Object} agentData java agent object
|
|
139
618
|
* @returns {Promise} a promise that resolves to an object containing an java agent object
|
|
140
619
|
*/
|
|
141
|
-
export async function putJavaAgent(
|
|
620
|
+
export async function putJavaAgent({
|
|
621
|
+
agentId,
|
|
622
|
+
agentData,
|
|
623
|
+
state
|
|
624
|
+
}) {
|
|
142
625
|
debugMessage(`AgentOps.putJavaAgent: start`);
|
|
143
|
-
const result = await putAgentByTypeAndId(
|
|
626
|
+
const result = await putAgentByTypeAndId({
|
|
627
|
+
agentType: AGENT_TYPE_JAVA,
|
|
628
|
+
agentId,
|
|
629
|
+
agentData,
|
|
630
|
+
state
|
|
631
|
+
});
|
|
144
632
|
debugMessage(`AgentOps.putJavaAgent: end`);
|
|
145
633
|
return result;
|
|
146
634
|
}
|
|
@@ -149,11 +637,16 @@ export async function putJavaAgent(agentId, agentData) {
|
|
|
149
637
|
* Get web agents
|
|
150
638
|
* @returns {Promise} a promise that resolves to an array of WebAgent objects
|
|
151
639
|
*/
|
|
152
|
-
export async function getWebAgents(
|
|
640
|
+
export async function getWebAgents({
|
|
641
|
+
state
|
|
642
|
+
}) {
|
|
153
643
|
debugMessage(`AgentOps.getWebAgents: start`);
|
|
154
644
|
const {
|
|
155
645
|
result
|
|
156
|
-
} = await getAgentsByType(
|
|
646
|
+
} = await getAgentsByType({
|
|
647
|
+
agentType: AGENT_TYPE_WEB,
|
|
648
|
+
state
|
|
649
|
+
});
|
|
157
650
|
debugMessage(`AgentOps.getWebAgents: end`);
|
|
158
651
|
return result;
|
|
159
652
|
}
|
|
@@ -163,9 +656,16 @@ export async function getWebAgents() {
|
|
|
163
656
|
* @param {string} agentId web agent id
|
|
164
657
|
* @returns {Promise} a promise that resolves to an object containing an WebAgent object
|
|
165
658
|
*/
|
|
166
|
-
export async function getWebAgent(
|
|
659
|
+
export async function getWebAgent({
|
|
660
|
+
agentId,
|
|
661
|
+
state
|
|
662
|
+
}) {
|
|
167
663
|
debugMessage(`AgentOps.getWebAgent: start`);
|
|
168
|
-
const result = await getAgentByTypeAndId(
|
|
664
|
+
const result = await getAgentByTypeAndId({
|
|
665
|
+
agentType: AGENT_TYPE_WEB,
|
|
666
|
+
agentId,
|
|
667
|
+
state
|
|
668
|
+
});
|
|
169
669
|
debugMessage(`AgentOps.getWebAgent: end`);
|
|
170
670
|
return result;
|
|
171
671
|
}
|
|
@@ -176,9 +676,18 @@ export async function getWebAgent(agentId) {
|
|
|
176
676
|
* @param {Object} agentData WebAgent object
|
|
177
677
|
* @returns {Promise} a promise that resolves to an object containing an WebAgent object
|
|
178
678
|
*/
|
|
179
|
-
export async function putWebAgent(
|
|
679
|
+
export async function putWebAgent({
|
|
680
|
+
agentId,
|
|
681
|
+
agentData,
|
|
682
|
+
state
|
|
683
|
+
}) {
|
|
180
684
|
debugMessage(`AgentOps.putWebAgent: start`);
|
|
181
|
-
const result = await putAgentByTypeAndId(
|
|
685
|
+
const result = await putAgentByTypeAndId({
|
|
686
|
+
agentType: AGENT_TYPE_WEB,
|
|
687
|
+
agentId,
|
|
688
|
+
agentData,
|
|
689
|
+
state
|
|
690
|
+
});
|
|
182
691
|
debugMessage(`AgentOps.putWebAgent: end`);
|
|
183
692
|
return result;
|
|
184
693
|
}
|
|
@@ -187,10 +696,14 @@ export async function putWebAgent(agentId, agentData) {
|
|
|
187
696
|
* Export all agents. The response can be saved to file as is.
|
|
188
697
|
* @returns {Promise<AgentExportInterface>} Promise resolving to an AgentExportInterface object.
|
|
189
698
|
*/
|
|
190
|
-
export async function exportAgents(
|
|
699
|
+
export async function exportAgents({
|
|
700
|
+
state
|
|
701
|
+
}) {
|
|
191
702
|
debugMessage(`AgentOps.exportAgents: start`);
|
|
192
703
|
const exportData = createAgentExportTemplate();
|
|
193
|
-
const agents = await getAgents(
|
|
704
|
+
const agents = await getAgents({
|
|
705
|
+
state
|
|
706
|
+
});
|
|
194
707
|
for (const agent of agents) {
|
|
195
708
|
exportData.agents[agent._id] = agent;
|
|
196
709
|
}
|
|
@@ -202,10 +715,14 @@ export async function exportAgents() {
|
|
|
202
715
|
* Export all identity gateway agents. The response can be saved to file as is.
|
|
203
716
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
204
717
|
*/
|
|
205
|
-
export async function exportIdentityGatewayAgents(
|
|
718
|
+
export async function exportIdentityGatewayAgents({
|
|
719
|
+
state
|
|
720
|
+
}) {
|
|
206
721
|
debugMessage(`AgentOps.exportIdentityGatewayAgents: start`);
|
|
207
722
|
const exportData = createAgentExportTemplate();
|
|
208
|
-
const agents = await getIdentityGatewayAgents(
|
|
723
|
+
const agents = await getIdentityGatewayAgents({
|
|
724
|
+
state
|
|
725
|
+
});
|
|
209
726
|
for (const agent of agents) {
|
|
210
727
|
exportData.agents[agent._id] = agent;
|
|
211
728
|
}
|
|
@@ -217,10 +734,14 @@ export async function exportIdentityGatewayAgents() {
|
|
|
217
734
|
* Export all java agents. The response can be saved to file as is.
|
|
218
735
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
219
736
|
*/
|
|
220
|
-
export async function exportJavaAgents(
|
|
737
|
+
export async function exportJavaAgents({
|
|
738
|
+
state
|
|
739
|
+
}) {
|
|
221
740
|
debugMessage(`AgentOps.exportJavaAgents: start`);
|
|
222
741
|
const exportData = createAgentExportTemplate();
|
|
223
|
-
const agents = await getJavaAgents(
|
|
742
|
+
const agents = await getJavaAgents({
|
|
743
|
+
state
|
|
744
|
+
});
|
|
224
745
|
for (const agent of agents) {
|
|
225
746
|
exportData.agents[agent._id] = agent;
|
|
226
747
|
}
|
|
@@ -232,10 +753,14 @@ export async function exportJavaAgents() {
|
|
|
232
753
|
* Export all web agents. The response can be saved to file as is.
|
|
233
754
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
234
755
|
*/
|
|
235
|
-
export async function exportWebAgents(
|
|
756
|
+
export async function exportWebAgents({
|
|
757
|
+
state
|
|
758
|
+
}) {
|
|
236
759
|
debugMessage(`AgentOps.exportWebAgents: start`);
|
|
237
760
|
const exportData = createAgentExportTemplate();
|
|
238
|
-
const agents = await getWebAgents(
|
|
761
|
+
const agents = await getWebAgents({
|
|
762
|
+
state
|
|
763
|
+
});
|
|
239
764
|
for (const agent of agents) {
|
|
240
765
|
exportData.agents[agent._id] = agent;
|
|
241
766
|
}
|
|
@@ -248,10 +773,16 @@ export async function exportWebAgents() {
|
|
|
248
773
|
* @param agentId agent id/name
|
|
249
774
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
250
775
|
*/
|
|
251
|
-
export async function exportAgent(
|
|
776
|
+
export async function exportAgent({
|
|
777
|
+
agentId,
|
|
778
|
+
state
|
|
779
|
+
}) {
|
|
252
780
|
debugMessage(`AgentOps.exportAgent: start`);
|
|
253
781
|
const exportData = createAgentExportTemplate();
|
|
254
|
-
const agentObject = await getAgent(
|
|
782
|
+
const agentObject = await getAgent({
|
|
783
|
+
agentId,
|
|
784
|
+
state
|
|
785
|
+
});
|
|
255
786
|
exportData.agents[agentId] = agentObject;
|
|
256
787
|
debugMessage(`AgentOps.exportAgent: end`);
|
|
257
788
|
return exportData;
|
|
@@ -262,10 +793,16 @@ export async function exportAgent(agentId) {
|
|
|
262
793
|
* @param agentId agent id/name
|
|
263
794
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
264
795
|
*/
|
|
265
|
-
export async function exportIdentityGatewayAgent(
|
|
796
|
+
export async function exportIdentityGatewayAgent({
|
|
797
|
+
agentId,
|
|
798
|
+
state
|
|
799
|
+
}) {
|
|
266
800
|
debugMessage(`AgentOps.exportIdentityGatewayAgent: start`);
|
|
267
801
|
const exportData = createAgentExportTemplate();
|
|
268
|
-
const agentObject = await getIdentityGatewayAgent(
|
|
802
|
+
const agentObject = await getIdentityGatewayAgent({
|
|
803
|
+
gatewayId: agentId,
|
|
804
|
+
state
|
|
805
|
+
});
|
|
269
806
|
exportData.agents[agentId] = agentObject;
|
|
270
807
|
debugMessage(`AgentOps.exportIdentityGatewayAgent: end`);
|
|
271
808
|
return exportData;
|
|
@@ -276,10 +813,16 @@ export async function exportIdentityGatewayAgent(agentId) {
|
|
|
276
813
|
* @param agentId agent id/name
|
|
277
814
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
278
815
|
*/
|
|
279
|
-
export async function exportJavaAgent(
|
|
816
|
+
export async function exportJavaAgent({
|
|
817
|
+
agentId,
|
|
818
|
+
state
|
|
819
|
+
}) {
|
|
280
820
|
debugMessage(`AgentOps.exportJavaAgent: start`);
|
|
281
821
|
const exportData = createAgentExportTemplate();
|
|
282
|
-
const agentObject = await getJavaAgent(
|
|
822
|
+
const agentObject = await getJavaAgent({
|
|
823
|
+
agentId,
|
|
824
|
+
state
|
|
825
|
+
});
|
|
283
826
|
exportData.agents[agentId] = agentObject;
|
|
284
827
|
debugMessage(`AgentOps.exportJavaAgent: end`);
|
|
285
828
|
return exportData;
|
|
@@ -290,10 +833,16 @@ export async function exportJavaAgent(agentId) {
|
|
|
290
833
|
* @param agentId agent id/name
|
|
291
834
|
* @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
|
|
292
835
|
*/
|
|
293
|
-
export async function exportWebAgent(
|
|
836
|
+
export async function exportWebAgent({
|
|
837
|
+
agentId,
|
|
838
|
+
state
|
|
839
|
+
}) {
|
|
294
840
|
debugMessage(`AgentOps.exportWebAgent: start`);
|
|
295
841
|
const exportData = createAgentExportTemplate();
|
|
296
|
-
const agentObject = await getWebAgent(
|
|
842
|
+
const agentObject = await getWebAgent({
|
|
843
|
+
agentId,
|
|
844
|
+
state
|
|
845
|
+
});
|
|
297
846
|
exportData.agents[agentId] = agentObject;
|
|
298
847
|
debugMessage(`AgentOps.exportWebAgent: end`);
|
|
299
848
|
return exportData;
|
|
@@ -303,13 +852,21 @@ export async function exportWebAgent(agentId) {
|
|
|
303
852
|
* Import agents. The import data is usually read from an agent export file.
|
|
304
853
|
* @param {AgentExportInterface} importData agent import data.
|
|
305
854
|
*/
|
|
306
|
-
export async function importAgents(
|
|
855
|
+
export async function importAgents({
|
|
856
|
+
importData,
|
|
857
|
+
state
|
|
858
|
+
}) {
|
|
307
859
|
debugMessage(`AgentOps.importAgents: start`);
|
|
308
860
|
if (validateImport(importData.meta)) {
|
|
309
861
|
for (const agentId of Object.keys(importData.agents)) {
|
|
310
862
|
const agentType = importData.agents[agentId]._type._id;
|
|
311
863
|
debugMessage(`AgentOps.importAgents: ${agentId} [${agentType}]`);
|
|
312
|
-
await putAgentByTypeAndId(
|
|
864
|
+
await putAgentByTypeAndId({
|
|
865
|
+
agentType,
|
|
866
|
+
agentId,
|
|
867
|
+
agentData: importData.agents[agentId],
|
|
868
|
+
state
|
|
869
|
+
});
|
|
313
870
|
}
|
|
314
871
|
} else {
|
|
315
872
|
throw new Error('Invalid meta data.');
|
|
@@ -321,13 +878,21 @@ export async function importAgents(importData) {
|
|
|
321
878
|
* Import identity gateway agents. The import data is usually read from an agent export file.
|
|
322
879
|
* @param {AgentExportInterface} importData agent import data.
|
|
323
880
|
*/
|
|
324
|
-
export async function importIdentityGatewayAgents(
|
|
881
|
+
export async function importIdentityGatewayAgents({
|
|
882
|
+
importData,
|
|
883
|
+
state
|
|
884
|
+
}) {
|
|
325
885
|
debugMessage(`AgentOps.importIdentityGatewayAgents: start`);
|
|
326
886
|
if (validateImport(importData.meta)) {
|
|
327
887
|
for (const agentId of Object.keys(importData.agents)) {
|
|
328
888
|
const agentType = importData.agents[agentId]._type._id;
|
|
329
889
|
if (agentType !== AGENT_TYPE_IG) throw new Error(`Wrong agent type! Expected '${AGENT_TYPE_IG}' but got '${agentType}'.`);
|
|
330
|
-
await putAgentByTypeAndId(
|
|
890
|
+
await putAgentByTypeAndId({
|
|
891
|
+
agentType,
|
|
892
|
+
agentId,
|
|
893
|
+
agentData: importData.agents[agentId],
|
|
894
|
+
state
|
|
895
|
+
});
|
|
331
896
|
}
|
|
332
897
|
} else {
|
|
333
898
|
throw new Error('Invalid meta data.');
|
|
@@ -339,13 +904,21 @@ export async function importIdentityGatewayAgents(importData) {
|
|
|
339
904
|
* Import java agents. The import data is usually read from an agent export file.
|
|
340
905
|
* @param {AgentExportInterface} importData agent import data.
|
|
341
906
|
*/
|
|
342
|
-
export async function importJavaAgents(
|
|
907
|
+
export async function importJavaAgents({
|
|
908
|
+
importData,
|
|
909
|
+
state
|
|
910
|
+
}) {
|
|
343
911
|
debugMessage(`AgentOps.importJavaAgents: start`);
|
|
344
912
|
if (validateImport(importData.meta)) {
|
|
345
913
|
for (const agentId of Object.keys(importData.agents)) {
|
|
346
914
|
const agentType = importData.agents[agentId]._type._id;
|
|
347
915
|
if (agentType !== AGENT_TYPE_JAVA) throw new Error(`Wrong agent type! Expected '${AGENT_TYPE_JAVA}' but got '${agentType}'.`);
|
|
348
|
-
await putAgentByTypeAndId(
|
|
916
|
+
await putAgentByTypeAndId({
|
|
917
|
+
agentType,
|
|
918
|
+
agentId,
|
|
919
|
+
agentData: importData.agents[agentId],
|
|
920
|
+
state
|
|
921
|
+
});
|
|
349
922
|
}
|
|
350
923
|
} else {
|
|
351
924
|
throw new Error('Invalid meta data.');
|
|
@@ -357,13 +930,21 @@ export async function importJavaAgents(importData) {
|
|
|
357
930
|
* Import web agents. The import data is usually read from an agent export file.
|
|
358
931
|
* @param {AgentExportInterface} importData agent import data.
|
|
359
932
|
*/
|
|
360
|
-
export async function importWebAgents(
|
|
933
|
+
export async function importWebAgents({
|
|
934
|
+
importData,
|
|
935
|
+
state
|
|
936
|
+
}) {
|
|
361
937
|
debugMessage(`AgentOps.importWebAgents: start`);
|
|
362
938
|
if (validateImport(importData.meta)) {
|
|
363
939
|
for (const agentId of Object.keys(importData.agents)) {
|
|
364
940
|
const agentType = importData.agents[agentId]._type._id;
|
|
365
941
|
if (agentType !== AGENT_TYPE_WEB) throw new Error(`Wrong agent type! Expected '${AGENT_TYPE_WEB}' but got '${agentType}'.`);
|
|
366
|
-
await putAgentByTypeAndId(
|
|
942
|
+
await putAgentByTypeAndId({
|
|
943
|
+
agentType,
|
|
944
|
+
agentId,
|
|
945
|
+
agentData: importData.agents[agentId],
|
|
946
|
+
state
|
|
947
|
+
});
|
|
367
948
|
}
|
|
368
949
|
} else {
|
|
369
950
|
throw new Error('Invalid meta data.');
|
|
@@ -377,12 +958,21 @@ export async function importWebAgents(importData) {
|
|
|
377
958
|
* @param {AgentExportInterface} importData agent import data.
|
|
378
959
|
* @returns {Promise} Promise resolving to an agent object.
|
|
379
960
|
*/
|
|
380
|
-
export async function importAgent(
|
|
961
|
+
export async function importAgent({
|
|
962
|
+
agentId,
|
|
963
|
+
importData,
|
|
964
|
+
state
|
|
965
|
+
}) {
|
|
381
966
|
debugMessage(`AgentOps.importAgent: start`);
|
|
382
967
|
if (validateImport(importData.meta)) {
|
|
383
968
|
var _importData$agents$ag;
|
|
384
969
|
const agentType = (_importData$agents$ag = importData.agents[agentId]) === null || _importData$agents$ag === void 0 ? void 0 : _importData$agents$ag._type._id;
|
|
385
|
-
const result = await putAgentByTypeAndId(
|
|
970
|
+
const result = await putAgentByTypeAndId({
|
|
971
|
+
agentType,
|
|
972
|
+
agentId,
|
|
973
|
+
agentData: importData.agents[agentId],
|
|
974
|
+
state
|
|
975
|
+
});
|
|
386
976
|
debugMessage(`AgentOps.importAgent: end`);
|
|
387
977
|
return result;
|
|
388
978
|
} else {
|
|
@@ -396,13 +986,22 @@ export async function importAgent(agentId, importData) {
|
|
|
396
986
|
* @param {AgentExportInterface} importData agent import data.
|
|
397
987
|
* @returns {Promise} Promise resolving to an agent object.
|
|
398
988
|
*/
|
|
399
|
-
export async function importIdentityGatewayAgent(
|
|
989
|
+
export async function importIdentityGatewayAgent({
|
|
990
|
+
agentId,
|
|
991
|
+
importData,
|
|
992
|
+
state
|
|
993
|
+
}) {
|
|
400
994
|
debugMessage(`AgentOps.importIdentityGatewayAgent: start`);
|
|
401
995
|
if (validateImport(importData.meta)) {
|
|
402
996
|
var _importData$agents$ag2;
|
|
403
997
|
const agentType = (_importData$agents$ag2 = importData.agents[agentId]) === null || _importData$agents$ag2 === void 0 ? void 0 : _importData$agents$ag2._type._id;
|
|
404
998
|
if (agentType !== AGENT_TYPE_IG) throw new Error(`Wrong agent type! Expected '${AGENT_TYPE_IG}' but got '${agentType}'.`);
|
|
405
|
-
const result = await putAgentByTypeAndId(
|
|
999
|
+
const result = await putAgentByTypeAndId({
|
|
1000
|
+
agentType,
|
|
1001
|
+
agentId,
|
|
1002
|
+
agentData: importData.agents[agentId],
|
|
1003
|
+
state
|
|
1004
|
+
});
|
|
406
1005
|
debugMessage(`AgentOps.importIdentityGatewayAgent: end`);
|
|
407
1006
|
return result;
|
|
408
1007
|
} else {
|
|
@@ -416,13 +1015,22 @@ export async function importIdentityGatewayAgent(agentId, importData) {
|
|
|
416
1015
|
* @param {AgentExportInterface} importData agent import data.
|
|
417
1016
|
* @returns {Promise} Promise resolving to an agent object.
|
|
418
1017
|
*/
|
|
419
|
-
export async function importJavaAgent(
|
|
1018
|
+
export async function importJavaAgent({
|
|
1019
|
+
agentId,
|
|
1020
|
+
importData,
|
|
1021
|
+
state
|
|
1022
|
+
}) {
|
|
420
1023
|
debugMessage(`AgentOps.importJavaAgent: start`);
|
|
421
1024
|
if (validateImport(importData.meta)) {
|
|
422
1025
|
var _importData$agents$ag3;
|
|
423
1026
|
const agentType = (_importData$agents$ag3 = importData.agents[agentId]) === null || _importData$agents$ag3 === void 0 ? void 0 : _importData$agents$ag3._type._id;
|
|
424
1027
|
if (agentType !== AGENT_TYPE_JAVA) throw new Error(`Wrong agent type! Expected '${AGENT_TYPE_JAVA}' but got '${agentType}'.`);
|
|
425
|
-
const result = await putAgentByTypeAndId(
|
|
1028
|
+
const result = await putAgentByTypeAndId({
|
|
1029
|
+
agentType,
|
|
1030
|
+
agentId,
|
|
1031
|
+
agentData: importData.agents[agentId],
|
|
1032
|
+
state
|
|
1033
|
+
});
|
|
426
1034
|
debugMessage(`AgentOps.importJavaAgent: end`);
|
|
427
1035
|
return result;
|
|
428
1036
|
} else {
|
|
@@ -436,13 +1044,22 @@ export async function importJavaAgent(agentId, importData) {
|
|
|
436
1044
|
* @param {AgentExportInterface} importData agent import data.
|
|
437
1045
|
* @returns {Promise} Promise resolving to an agent object.
|
|
438
1046
|
*/
|
|
439
|
-
export async function importWebAgent(
|
|
1047
|
+
export async function importWebAgent({
|
|
1048
|
+
agentId,
|
|
1049
|
+
importData,
|
|
1050
|
+
state
|
|
1051
|
+
}) {
|
|
440
1052
|
debugMessage(`AgentOps.importWebAgent: start`);
|
|
441
1053
|
if (validateImport(importData.meta)) {
|
|
442
1054
|
var _importData$agents$ag4;
|
|
443
1055
|
const agentType = (_importData$agents$ag4 = importData.agents[agentId]) === null || _importData$agents$ag4 === void 0 ? void 0 : _importData$agents$ag4._type._id;
|
|
444
1056
|
if (agentType !== AGENT_TYPE_WEB) throw new Error(`Wrong agent type! Expected '${AGENT_TYPE_WEB}' but got '${agentType}'.`);
|
|
445
|
-
const result = await putAgentByTypeAndId(
|
|
1057
|
+
const result = await putAgentByTypeAndId({
|
|
1058
|
+
agentType,
|
|
1059
|
+
agentId,
|
|
1060
|
+
agentData: importData.agents[agentId],
|
|
1061
|
+
state
|
|
1062
|
+
});
|
|
446
1063
|
debugMessage(`AgentOps.importWebAgent: end`);
|
|
447
1064
|
return result;
|
|
448
1065
|
} else {
|
|
@@ -453,12 +1070,20 @@ export async function importWebAgent(agentId, importData) {
|
|
|
453
1070
|
/**
|
|
454
1071
|
* Delete all agents
|
|
455
1072
|
*/
|
|
456
|
-
export async function deleteAgents(
|
|
1073
|
+
export async function deleteAgents({
|
|
1074
|
+
state
|
|
1075
|
+
}) {
|
|
457
1076
|
debugMessage(`AgentOps.deleteAgents: start`);
|
|
458
|
-
const agents = await getAgents(
|
|
1077
|
+
const agents = await getAgents({
|
|
1078
|
+
state
|
|
1079
|
+
});
|
|
459
1080
|
for (const agent of agents) {
|
|
460
1081
|
debugMessage(`AgentOps.deleteAgent: '${agent['_id']}'`);
|
|
461
|
-
await deleteAgentByTypeAndId(
|
|
1082
|
+
await deleteAgentByTypeAndId({
|
|
1083
|
+
agentType: agent['_type']['_id'],
|
|
1084
|
+
agentId: agent['_id'],
|
|
1085
|
+
state
|
|
1086
|
+
});
|
|
462
1087
|
}
|
|
463
1088
|
debugMessage(`AgentOps.deleteAgents: end`);
|
|
464
1089
|
}
|
|
@@ -467,13 +1092,23 @@ export async function deleteAgents() {
|
|
|
467
1092
|
* Delete agent
|
|
468
1093
|
* @param agentId agent id/name
|
|
469
1094
|
*/
|
|
470
|
-
export async function deleteAgent(
|
|
1095
|
+
export async function deleteAgent({
|
|
1096
|
+
agentId,
|
|
1097
|
+
state
|
|
1098
|
+
}) {
|
|
471
1099
|
debugMessage(`AgentOps.deleteAgent: start`);
|
|
472
|
-
const agents = await findAgentById(
|
|
1100
|
+
const agents = await findAgentById({
|
|
1101
|
+
agentId,
|
|
1102
|
+
state
|
|
1103
|
+
});
|
|
473
1104
|
if (agents.length) {
|
|
474
1105
|
for (const agent of agents) {
|
|
475
1106
|
debugMessage(`AgentOps.deleteAgent: '${agent['_id']}'`);
|
|
476
|
-
await deleteAgentByTypeAndId(
|
|
1107
|
+
await deleteAgentByTypeAndId({
|
|
1108
|
+
agentType: agent['_type'],
|
|
1109
|
+
agentId: agent['_id'],
|
|
1110
|
+
state
|
|
1111
|
+
});
|
|
477
1112
|
}
|
|
478
1113
|
} else {
|
|
479
1114
|
throw new Error(`Agent '${agentId}' not found!`);
|
|
@@ -484,12 +1119,20 @@ export async function deleteAgent(agentId) {
|
|
|
484
1119
|
/**
|
|
485
1120
|
* Delete all identity gateway agents
|
|
486
1121
|
*/
|
|
487
|
-
export async function deleteIdentityGatewayAgents(
|
|
1122
|
+
export async function deleteIdentityGatewayAgents({
|
|
1123
|
+
state
|
|
1124
|
+
}) {
|
|
488
1125
|
debugMessage(`AgentOps.deleteIdentityGatewayAgents: start`);
|
|
489
|
-
const agents = await getIdentityGatewayAgents(
|
|
1126
|
+
const agents = await getIdentityGatewayAgents({
|
|
1127
|
+
state
|
|
1128
|
+
});
|
|
490
1129
|
for (const agent of agents) {
|
|
491
1130
|
debugMessage(`AgentOps.deleteIdentityGatewayAgent: '${agent['_id']}'`);
|
|
492
|
-
await deleteAgentByTypeAndId(
|
|
1131
|
+
await deleteAgentByTypeAndId({
|
|
1132
|
+
agentType: agent['_type']['_id'],
|
|
1133
|
+
agentId: agent['_id'],
|
|
1134
|
+
state
|
|
1135
|
+
});
|
|
493
1136
|
}
|
|
494
1137
|
debugMessage(`AgentOps.deleteIdentityGatewayAgents: end`);
|
|
495
1138
|
}
|
|
@@ -498,13 +1141,24 @@ export async function deleteIdentityGatewayAgents() {
|
|
|
498
1141
|
* Delete identity gateway agent
|
|
499
1142
|
* @param agentId agent id/name
|
|
500
1143
|
*/
|
|
501
|
-
export async function deleteIdentityGatewayAgent(
|
|
1144
|
+
export async function deleteIdentityGatewayAgent({
|
|
1145
|
+
agentId,
|
|
1146
|
+
state
|
|
1147
|
+
}) {
|
|
502
1148
|
debugMessage(`AgentOps.deleteIdentityGatewayAgent: start`);
|
|
503
|
-
const agents = await findAgentByTypeAndId(
|
|
1149
|
+
const agents = await findAgentByTypeAndId({
|
|
1150
|
+
agentType: AGENT_TYPE_IG,
|
|
1151
|
+
agentId,
|
|
1152
|
+
state
|
|
1153
|
+
});
|
|
504
1154
|
if (agents.length) {
|
|
505
1155
|
for (const agent of agents) {
|
|
506
1156
|
debugMessage(`AgentOps.deleteIdentityGatewayAgent: '${agent['_id']}'`);
|
|
507
|
-
await deleteAgentByTypeAndId(
|
|
1157
|
+
await deleteAgentByTypeAndId({
|
|
1158
|
+
agentType: agent['_type']['_id'],
|
|
1159
|
+
agentId: agent['_id'],
|
|
1160
|
+
state
|
|
1161
|
+
});
|
|
508
1162
|
}
|
|
509
1163
|
} else {
|
|
510
1164
|
throw new Error(`Identity gateway agent '${agentId}' not found!`);
|
|
@@ -515,12 +1169,20 @@ export async function deleteIdentityGatewayAgent(agentId) {
|
|
|
515
1169
|
/**
|
|
516
1170
|
* Delete all java agents
|
|
517
1171
|
*/
|
|
518
|
-
export async function deleteJavaAgents(
|
|
1172
|
+
export async function deleteJavaAgents({
|
|
1173
|
+
state
|
|
1174
|
+
}) {
|
|
519
1175
|
debugMessage(`AgentOps.deleteJavaAgents: start`);
|
|
520
|
-
const agents = await getJavaAgents(
|
|
1176
|
+
const agents = await getJavaAgents({
|
|
1177
|
+
state
|
|
1178
|
+
});
|
|
521
1179
|
for (const agent of agents) {
|
|
522
1180
|
debugMessage(`AgentOps.deleteJavaAgent: '${agent['_id']}'`);
|
|
523
|
-
await deleteAgentByTypeAndId(
|
|
1181
|
+
await deleteAgentByTypeAndId({
|
|
1182
|
+
agentType: agent['_type']['_id'],
|
|
1183
|
+
agentId: agent['_id'],
|
|
1184
|
+
state
|
|
1185
|
+
});
|
|
524
1186
|
}
|
|
525
1187
|
debugMessage(`AgentOps.deleteJavaAgents: end`);
|
|
526
1188
|
}
|
|
@@ -529,13 +1191,24 @@ export async function deleteJavaAgents() {
|
|
|
529
1191
|
* Delete java agent
|
|
530
1192
|
* @param agentId agent id/name
|
|
531
1193
|
*/
|
|
532
|
-
export async function deleteJavaAgent(
|
|
1194
|
+
export async function deleteJavaAgent({
|
|
1195
|
+
agentId,
|
|
1196
|
+
state
|
|
1197
|
+
}) {
|
|
533
1198
|
debugMessage(`AgentOps.deleteJavaAgent: start`);
|
|
534
|
-
const agents = await findAgentByTypeAndId(
|
|
1199
|
+
const agents = await findAgentByTypeAndId({
|
|
1200
|
+
agentType: AGENT_TYPE_JAVA,
|
|
1201
|
+
agentId,
|
|
1202
|
+
state
|
|
1203
|
+
});
|
|
535
1204
|
if (agents.length) {
|
|
536
1205
|
for (const agent of agents) {
|
|
537
1206
|
debugMessage(`AgentOps.deleteJavaAgent: '${agent['_id']}'`);
|
|
538
|
-
await deleteAgentByTypeAndId(
|
|
1207
|
+
await deleteAgentByTypeAndId({
|
|
1208
|
+
agentType: agent['_type']['_id'],
|
|
1209
|
+
agentId: agent['_id'],
|
|
1210
|
+
state
|
|
1211
|
+
});
|
|
539
1212
|
}
|
|
540
1213
|
} else {
|
|
541
1214
|
throw new Error(`Java agent '${agentId}' not found!`);
|
|
@@ -546,12 +1219,20 @@ export async function deleteJavaAgent(agentId) {
|
|
|
546
1219
|
/**
|
|
547
1220
|
* Delete all web agents
|
|
548
1221
|
*/
|
|
549
|
-
export async function deleteWebAgents(
|
|
1222
|
+
export async function deleteWebAgents({
|
|
1223
|
+
state
|
|
1224
|
+
}) {
|
|
550
1225
|
debugMessage(`AgentOps.deleteWebAgents: start`);
|
|
551
|
-
const agents = await getWebAgents(
|
|
1226
|
+
const agents = await getWebAgents({
|
|
1227
|
+
state
|
|
1228
|
+
});
|
|
552
1229
|
for (const agent of agents) {
|
|
553
1230
|
debugMessage(`AgentOps.deleteWebAgent: '${agent['_id']}'`);
|
|
554
|
-
await deleteAgentByTypeAndId(
|
|
1231
|
+
await deleteAgentByTypeAndId({
|
|
1232
|
+
agentType: agent['_type']['_id'],
|
|
1233
|
+
agentId: agent['_id'],
|
|
1234
|
+
state
|
|
1235
|
+
});
|
|
555
1236
|
}
|
|
556
1237
|
debugMessage(`AgentOps.deleteWebAgents: end`);
|
|
557
1238
|
}
|
|
@@ -560,13 +1241,24 @@ export async function deleteWebAgents() {
|
|
|
560
1241
|
* Delete web agent
|
|
561
1242
|
* @param agentId agent id/name
|
|
562
1243
|
*/
|
|
563
|
-
export async function deleteWebAgent(
|
|
1244
|
+
export async function deleteWebAgent({
|
|
1245
|
+
agentId,
|
|
1246
|
+
state
|
|
1247
|
+
}) {
|
|
564
1248
|
debugMessage(`AgentOps.deleteWebAgent: start`);
|
|
565
|
-
const agents = await findAgentByTypeAndId(
|
|
1249
|
+
const agents = await findAgentByTypeAndId({
|
|
1250
|
+
agentType: AGENT_TYPE_WEB,
|
|
1251
|
+
agentId,
|
|
1252
|
+
state
|
|
1253
|
+
});
|
|
566
1254
|
if (agents.length) {
|
|
567
1255
|
for (const agent of agents) {
|
|
568
1256
|
debugMessage(`AgentOps.deleteWebAgent: '${agent['_id']}'`);
|
|
569
|
-
await deleteAgentByTypeAndId(
|
|
1257
|
+
await deleteAgentByTypeAndId({
|
|
1258
|
+
agentType: agent['_type']['_id'],
|
|
1259
|
+
agentId: agent['_id'],
|
|
1260
|
+
state
|
|
1261
|
+
});
|
|
570
1262
|
}
|
|
571
1263
|
} else {
|
|
572
1264
|
throw new Error(`Web agent '${agentId}' not found!`);
|