@rockcarver/frodo-lib 1.0.0 → 2.0.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -6
- package/cjs/api/AgentApi.js +91 -37
- package/cjs/api/AgentApi.js.map +1 -1
- package/cjs/api/AgentApi.test.js.map +1 -1
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/AuthenticateApi.js +18 -11
- package/cjs/api/AuthenticateApi.js.map +1 -1
- package/cjs/api/AuthenticateApi.test.js.map +1 -1
- package/cjs/api/BaseApi.js +50 -26
- package/cjs/api/BaseApi.js.map +1 -1
- package/cjs/api/CirclesOfTrustApi.js +47 -23
- package/cjs/api/CirclesOfTrustApi.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +54 -21
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/IdmSystemApi.js +9 -6
- package/cjs/api/IdmSystemApi.js.map +1 -1
- package/cjs/api/ManagedObjectApi.js +49 -27
- package/cjs/api/ManagedObjectApi.js.map +1 -1
- package/cjs/api/NodeApi.js +71 -32
- package/cjs/api/NodeApi.js.map +1 -1
- package/cjs/api/NodeApi.test.js.map +1 -1
- package/cjs/api/OAuth2ClientApi.js +43 -20
- package/cjs/api/OAuth2ClientApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.js +74 -27
- package/cjs/api/OAuth2OIDCApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.test.js.map +1 -1
- package/cjs/api/OAuth2ProviderApi.js +10 -9
- package/cjs/api/OAuth2ProviderApi.js.map +1 -1
- package/cjs/api/PoliciesApi.js +54 -22
- package/cjs/api/PoliciesApi.js.map +1 -1
- package/cjs/api/PoliciesApi.test.js.map +1 -1
- package/cjs/api/PolicySetApi.js +54 -23
- package/cjs/api/PolicySetApi.js.map +1 -1
- package/cjs/api/PolicySetApi.test.js.map +1 -1
- package/cjs/api/RealmApi.js +73 -29
- package/cjs/api/RealmApi.js.map +1 -1
- package/cjs/api/ResourceTypesApi.js +67 -28
- package/cjs/api/ResourceTypesApi.js.map +1 -1
- package/cjs/api/ResourceTypesApi.test.js.map +1 -1
- package/cjs/api/Saml2Api.js +90 -122
- package/cjs/api/Saml2Api.js.map +1 -1
- package/cjs/api/ScriptApi.js +54 -23
- package/cjs/api/ScriptApi.js.map +1 -1
- package/cjs/api/ServerInfoApi.js +23 -10
- package/cjs/api/ServerInfoApi.js.map +1 -1
- package/cjs/api/ServiceApi.js +91 -42
- package/cjs/api/ServiceApi.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +70 -31
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/api/TreeApi.js +43 -20
- package/cjs/api/TreeApi.js.map +1 -1
- package/cjs/api/TreeApi.test.js.map +1 -1
- package/cjs/api/cloud/EnvInfoApi.js +10 -6
- package/cjs/api/cloud/EnvInfoApi.js.map +1 -1
- package/cjs/api/cloud/FeatureApi.js +9 -6
- package/cjs/api/cloud/FeatureApi.js.map +1 -1
- package/cjs/api/cloud/LogApi.js +48 -18
- package/cjs/api/cloud/LogApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.js +109 -35
- package/cjs/api/cloud/SecretsApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
- package/cjs/api/cloud/StartupApi.js +21 -10
- package/cjs/api/cloud/StartupApi.js.map +1 -1
- package/cjs/api/cloud/StartupApi.test.js.map +1 -1
- package/cjs/api/cloud/VariablesApi.js +52 -20
- package/cjs/api/cloud/VariablesApi.js.map +1 -1
- package/cjs/api/cloud/VariablesApi.test.js.map +1 -1
- package/cjs/api/utils/ApiUtils.js +2 -5
- package/cjs/api/utils/ApiUtils.js.map +1 -1
- package/cjs/api/utils/ApiUtils.test.js.map +1 -1
- package/cjs/index.js +13 -112
- package/cjs/index.js.map +1 -1
- package/cjs/lib/FrodoLib.js +142 -0
- package/cjs/lib/FrodoLib.js.map +1 -0
- package/cjs/ops/AdminOps.js +578 -90
- package/cjs/ops/AdminOps.js.map +1 -1
- package/cjs/ops/AgentOps.js +964 -118
- package/cjs/ops/AgentOps.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +182 -87
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.test.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +360 -291
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +221 -139
- package/cjs/ops/ConnectionProfileOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +84 -10
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
- package/cjs/ops/IdmOps.js +97 -81
- package/cjs/ops/IdmOps.js.map +1 -1
- package/cjs/ops/IdmOps.test.js.map +1 -1
- package/cjs/ops/IdpOps.js +275 -42
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/IdpOps.test.js.map +1 -1
- package/cjs/ops/InfoOps.js +42 -27
- package/cjs/ops/InfoOps.js.map +1 -1
- package/cjs/ops/JoseOps.test.js.map +1 -1
- package/cjs/ops/JourneyOps.js +721 -126
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/JourneyOps.test.js.map +1 -1
- package/cjs/ops/ManagedObjectOps.js +79 -12
- package/cjs/ops/ManagedObjectOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +127 -100
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.js +323 -65
- package/cjs/ops/OAuth2ClientOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.test.js.map +1 -1
- package/cjs/ops/OAuth2OidcOps.js +84 -0
- package/cjs/ops/OAuth2OidcOps.js.map +1 -0
- package/cjs/ops/OAuth2ProviderOps.js +20 -13
- package/cjs/ops/OAuth2ProviderOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js.map +1 -1
- package/cjs/ops/OrganizationOps.js +67 -12
- package/cjs/ops/OrganizationOps.js.map +1 -1
- package/cjs/ops/PolicyOps.js +476 -136
- package/cjs/ops/PolicyOps.js.map +1 -1
- package/cjs/ops/PolicyOps.test.js.map +1 -1
- package/cjs/ops/PolicySetOps.js +402 -132
- package/cjs/ops/PolicySetOps.js.map +1 -1
- package/cjs/ops/PolicySetOps.test.js.map +1 -1
- package/cjs/ops/RealmOps.js +119 -84
- package/cjs/ops/RealmOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.js +364 -95
- package/cjs/ops/ResourceTypeOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.test.js.map +1 -1
- package/cjs/ops/Saml2Ops.js +407 -145
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/Saml2Ops.test.js.map +1 -1
- package/cjs/ops/ScriptOps.js +256 -79
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/ScriptOps.test.js.map +1 -1
- package/cjs/ops/ServiceOps.js +331 -55
- package/cjs/ops/ServiceOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +363 -54
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/cjs/ops/ThemeOps.test.js.map +1 -1
- package/cjs/ops/cloud/FeatureOps.js +57 -12
- package/cjs/ops/cloud/FeatureOps.js.map +1 -1
- package/cjs/ops/cloud/LogOps.js +126 -6
- package/cjs/ops/cloud/LogOps.js.map +1 -1
- package/cjs/ops/cloud/SecretsOps.js +230 -289
- package/cjs/ops/cloud/SecretsOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.js +101 -18
- package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.test.js.map +1 -1
- package/cjs/ops/cloud/StartupOps.js +64 -9
- package/cjs/ops/cloud/StartupOps.js.map +1 -1
- package/cjs/ops/cloud/VariablesOps.js +100 -175
- package/cjs/ops/cloud/VariablesOps.js.map +1 -1
- package/cjs/ops/utils/Console.js +9 -10
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/DataProtection.js +2 -2
- package/cjs/ops/utils/DataProtection.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js +144 -13
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.test.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.js +7 -5
- package/cjs/ops/utils/OpsUtils.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.test.js.map +1 -1
- package/cjs/ops/utils/{ValidationUtils.js → ScriptValidationUtils.js} +1 -1
- package/cjs/ops/utils/ScriptValidationUtils.js.map +1 -0
- package/cjs/ops/utils/ScriptValidationUtils.test.js.map +1 -0
- package/cjs/ops/utils/Version.js +36 -6
- package/cjs/ops/utils/Version.js.map +1 -1
- package/cjs/ops/utils/Version.test.js.map +1 -1
- package/cjs/shared/State.js +453 -210
- package/cjs/shared/State.js.map +1 -1
- package/cjs/shared/State.test.js.map +1 -1
- package/cjs/utils/AutoSetupPolly.js +4 -1
- package/cjs/utils/AutoSetupPolly.js.map +1 -1
- package/esm/api/AgentApi.mjs +75 -27
- package/esm/api/AgentApi.test.mjs +319 -71
- package/esm/api/AuthenticateApi.mjs +15 -4
- package/esm/api/AuthenticateApi.test.mjs +27 -8
- package/esm/api/BaseApi.mjs +43 -19
- package/esm/api/CirclesOfTrustApi.mjs +39 -17
- package/esm/api/IdmConfigApi.mjs +44 -13
- package/esm/api/IdmSystemApi.mjs +7 -3
- package/esm/api/ManagedObjectApi.mjs +44 -20
- package/esm/api/NodeApi.mjs +59 -24
- package/esm/api/NodeApi.test.mjs +158 -40
- package/esm/api/OAuth2ClientApi.mjs +36 -15
- package/esm/api/OAuth2OIDCApi.mjs +69 -20
- package/esm/api/OAuth2OIDCApi.test.mjs +21 -3
- package/esm/api/OAuth2ProviderApi.mjs +8 -6
- package/esm/api/PoliciesApi.mjs +45 -16
- package/esm/api/PoliciesApi.test.mjs +63 -15
- package/esm/api/PolicySetApi.mjs +44 -16
- package/esm/api/PolicySetApi.test.mjs +48 -12
- package/esm/api/RealmApi.mjs +65 -24
- package/esm/api/ResourceTypesApi.mjs +56 -21
- package/esm/api/ResourceTypesApi.test.mjs +58 -14
- package/esm/api/Saml2Api.mjs +75 -89
- package/esm/api/ScriptApi.mjs +45 -17
- package/esm/api/ServerInfoApi.mjs +19 -6
- package/esm/api/ServiceApi.mjs +77 -26
- package/esm/api/SocialIdentityProvidersApi.mjs +58 -23
- package/esm/api/TreeApi.mjs +36 -15
- package/esm/api/TreeApi.test.mjs +129 -34
- package/esm/api/cloud/EnvInfoApi.mjs +8 -3
- package/esm/api/cloud/FeatureApi.mjs +7 -3
- package/esm/api/cloud/LogApi.mjs +38 -11
- package/esm/api/cloud/SecretsApi.mjs +89 -21
- package/esm/api/cloud/SecretsApi.test.mjs +193 -50
- package/esm/api/cloud/StartupApi.mjs +17 -6
- package/esm/api/cloud/StartupApi.test.mjs +28 -11
- package/esm/api/cloud/VariablesApi.mjs +43 -14
- package/esm/api/cloud/VariablesApi.test.mjs +124 -33
- package/esm/api/utils/ApiUtils.mjs +2 -4
- package/esm/api/utils/ApiUtils.test.mjs +14 -6
- package/esm/index.mjs +1 -60
- package/esm/lib/FrodoLib.mjs +128 -0
- package/esm/ops/AdminOps.mjs +500 -71
- package/esm/ops/AgentOps.mjs +781 -81
- package/esm/ops/AgentOps.test.mjs +296 -113
- package/esm/ops/AuthenticateOps.mjs +156 -64
- package/esm/ops/AuthenticateOps.test.mjs +7 -4
- package/esm/ops/CirclesOfTrustOps.mjs +294 -229
- package/esm/ops/ConnectionProfileOps.mjs +190 -123
- package/esm/ops/ConnectionProfileOps.test.mjs +25 -5
- package/esm/ops/EmailTemplateOps.mjs +66 -6
- package/esm/ops/EmailTemplateOps.test.mjs +32 -11
- package/esm/ops/IdmOps.mjs +60 -47
- package/esm/ops/IdmOps.test.mjs +54 -18
- package/esm/ops/IdpOps.mjs +227 -31
- package/esm/ops/IdpOps.test.mjs +57 -20
- package/esm/ops/InfoOps.mjs +36 -23
- package/esm/ops/JoseOps.test.mjs +8 -0
- package/esm/ops/JourneyOps.mjs +634 -96
- package/esm/ops/JourneyOps.test.mjs +73 -31
- package/esm/ops/ManagedObjectOps.mjs +66 -10
- package/esm/ops/NodeOps.mjs +108 -85
- package/esm/ops/OAuth2ClientOps.mjs +258 -42
- package/esm/ops/OAuth2ClientOps.test.mjs +80 -29
- package/esm/ops/OAuth2OidcOps.mjs +40 -0
- package/esm/ops/OAuth2ProviderOps.mjs +11 -8
- package/esm/ops/OrganizationOps.mjs +56 -8
- package/esm/ops/PolicyOps.mjs +379 -93
- package/esm/ops/PolicyOps.test.mjs +180 -65
- package/esm/ops/PolicySetOps.mjs +311 -88
- package/esm/ops/PolicySetOps.test.mjs +108 -39
- package/esm/ops/RealmOps.mjs +85 -65
- package/esm/ops/ResourceTypeOps.mjs +278 -61
- package/esm/ops/ResourceTypeOps.test.mjs +113 -27
- package/esm/ops/Saml2Ops.mjs +346 -106
- package/esm/ops/Saml2Ops.test.mjs +117 -81
- package/esm/ops/ScriptOps.mjs +202 -56
- package/esm/ops/ScriptOps.test.mjs +64 -23
- package/esm/ops/ServiceOps.mjs +261 -27
- package/esm/ops/ThemeOps.mjs +300 -33
- package/esm/ops/ThemeOps.test.mjs +197 -47
- package/esm/ops/cloud/FeatureOps.mjs +45 -10
- package/esm/ops/cloud/LogOps.mjs +107 -4
- package/esm/ops/cloud/SecretsOps.mjs +123 -204
- package/esm/ops/cloud/ServiceAccountOps.mjs +85 -15
- package/esm/ops/cloud/ServiceAccountOps.test.mjs +16 -6
- package/esm/ops/cloud/StartupOps.mjs +49 -6
- package/esm/ops/cloud/VariablesOps.mjs +58 -120
- package/esm/ops/utils/Console.mjs +2 -1
- package/esm/ops/utils/DataProtection.mjs +2 -3
- package/esm/ops/utils/ExportImportUtils.mjs +129 -8
- package/esm/ops/utils/ExportImportUtils.test.mjs +15 -2
- package/esm/ops/utils/OpsUtils.mjs +4 -3
- package/esm/ops/utils/OpsUtils.test.mjs +21 -5
- package/esm/ops/utils/{ValidationUtils.mjs → ScriptValidationUtils.mjs} +1 -1
- package/esm/ops/utils/{ValidationUtils.test.mjs → ScriptValidationUtils.test.mjs} +2 -2
- package/esm/ops/utils/Version.mjs +29 -6
- package/esm/ops/utils/Version.test.mjs +4 -1
- package/esm/shared/State.mjs +457 -145
- package/esm/shared/State.test.mjs +8 -0
- package/esm/utils/AutoSetupPolly.mjs +4 -1
- package/package.json +1 -1
- package/types/api/AgentApi.d.ts +37 -8
- package/types/api/AgentApi.d.ts.map +1 -1
- package/types/api/ApiTypes.d.ts +20 -8
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/AuthenticateApi.d.ts +13 -3
- package/types/api/AuthenticateApi.d.ts.map +1 -1
- package/types/api/BaseApi.d.ts +36 -7
- package/types/api/BaseApi.d.ts.map +1 -1
- package/types/api/CirclesOfTrustApi.d.ts +21 -7
- package/types/api/CirclesOfTrustApi.d.ts.map +1 -1
- package/types/api/IdmConfigApi.d.ts +28 -13
- package/types/api/IdmConfigApi.d.ts.map +1 -1
- package/types/api/IdmSystemApi.d.ts +4 -1
- package/types/api/IdmSystemApi.d.ts.map +1 -1
- package/types/api/ManagedObjectApi.d.ts +25 -10
- package/types/api/ManagedObjectApi.d.ts.map +1 -1
- package/types/api/NodeApi.d.ts +31 -9
- package/types/api/NodeApi.d.ts.map +1 -1
- package/types/api/OAuth2ClientApi.d.ts +18 -5
- package/types/api/OAuth2ClientApi.d.ts.map +1 -1
- package/types/api/OAuth2OIDCApi.d.ts +45 -11
- package/types/api/OAuth2OIDCApi.d.ts.map +1 -1
- package/types/api/OAuth2ProviderApi.d.ts +4 -1
- package/types/api/OAuth2ProviderApi.d.ts.map +1 -1
- package/types/api/PoliciesApi.d.ts +21 -5
- package/types/api/PoliciesApi.d.ts.map +1 -1
- package/types/api/PolicySetApi.d.ts +20 -5
- package/types/api/PolicySetApi.d.ts.map +1 -1
- package/types/api/RealmApi.d.ts +26 -10
- package/types/api/RealmApi.d.ts.map +1 -1
- package/types/api/ResourceTypesApi.d.ts +27 -8
- package/types/api/ResourceTypesApi.d.ts.map +1 -1
- package/types/api/Saml2Api.d.ts +39 -32
- package/types/api/Saml2Api.d.ts.map +1 -1
- package/types/api/ScriptApi.d.ts +21 -5
- package/types/api/ScriptApi.d.ts.map +1 -1
- package/types/api/ServerInfoApi.d.ts +9 -2
- package/types/api/ServerInfoApi.d.ts.map +1 -1
- package/types/api/ServiceApi.d.ts +41 -7
- package/types/api/ServiceApi.d.ts.map +1 -1
- package/types/api/SocialIdentityProvidersApi.d.ts +30 -8
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
- package/types/api/TreeApi.d.ts +18 -4
- package/types/api/TreeApi.d.ts.map +1 -1
- package/types/api/cloud/EnvInfoApi.d.ts +4 -1
- package/types/api/cloud/EnvInfoApi.d.ts.map +1 -1
- package/types/api/cloud/FeatureApi.d.ts +4 -1
- package/types/api/cloud/FeatureApi.d.ts.map +1 -1
- package/types/api/cloud/LogApi.d.ts +24 -6
- package/types/api/cloud/LogApi.d.ts.map +1 -1
- package/types/api/cloud/SecretsApi.d.ts +50 -10
- package/types/api/cloud/SecretsApi.d.ts.map +1 -1
- package/types/api/cloud/StartupApi.d.ts +7 -2
- package/types/api/cloud/StartupApi.d.ts.map +1 -1
- package/types/api/cloud/VariablesApi.d.ts +23 -5
- package/types/api/cloud/VariablesApi.d.ts.map +1 -1
- package/types/api/utils/ApiUtils.d.ts +3 -2
- package/types/api/utils/ApiUtils.d.ts.map +1 -1
- package/types/index.d.ts +1 -48
- package/types/index.d.ts.map +1 -1
- package/types/lib/FrodoLib.d.ts +99 -0
- package/types/lib/FrodoLib.d.ts.map +1 -0
- package/types/ops/AdminOps.d.ts +71 -12
- package/types/ops/AdminOps.d.ts.map +1 -1
- package/types/ops/AgentOps.d.ts +350 -36
- package/types/ops/AgentOps.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts +27 -4
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/CirclesOfTrustOps.d.ts +88 -24
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
- package/types/ops/ConnectionProfileOps.d.ts +78 -18
- package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
- package/types/ops/EmailTemplateOps.d.ts +36 -3
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/ops/IdmOps.d.ts +28 -40
- package/types/ops/IdmOps.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts +88 -10
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/ops/InfoOps.d.ts +12 -1
- package/types/ops/InfoOps.d.ts.map +1 -1
- package/types/ops/JourneyOps.d.ts +237 -34
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/ManagedObjectOps.d.ts +37 -8
- package/types/ops/ManagedObjectOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts +61 -6
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OAuth2ClientOps.d.ts +104 -10
- package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
- package/types/ops/OAuth2OidcOps.d.ts +11 -0
- package/types/ops/OAuth2OidcOps.d.ts.map +1 -0
- package/types/ops/OAuth2ProviderOps.d.ts +8 -5
- package/types/ops/OAuth2ProviderOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +12 -1
- package/types/ops/OpsTypes.d.ts.map +1 -1
- package/types/ops/OrganizationOps.d.ts +24 -3
- package/types/ops/OrganizationOps.d.ts.map +1 -1
- package/types/ops/PolicyOps.d.ts +103 -28
- package/types/ops/PolicyOps.d.ts.map +1 -1
- package/types/ops/PolicySetOps.d.ts +76 -30
- package/types/ops/PolicySetOps.d.ts.map +1 -1
- package/types/ops/RealmOps.d.ts +34 -14
- package/types/ops/RealmOps.d.ts.map +1 -1
- package/types/ops/ResourceTypeOps.d.ts +116 -29
- package/types/ops/ResourceTypeOps.d.ts.map +1 -1
- package/types/ops/Saml2Ops.d.ts +124 -41
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/ScriptOps.d.ts +88 -23
- package/types/ops/ScriptOps.d.ts.map +1 -1
- package/types/ops/ServiceOps.d.ts +95 -8
- package/types/ops/ServiceOps.d.ts.map +1 -1
- package/types/ops/ThemeOps.d.ts +113 -9
- package/types/ops/ThemeOps.d.ts.map +1 -1
- package/types/ops/cloud/FeatureOps.d.ts +23 -2
- package/types/ops/cloud/FeatureOps.d.ts.map +1 -1
- package/types/ops/cloud/LogOps.d.ts +61 -3
- package/types/ops/cloud/LogOps.d.ts.map +1 -1
- package/types/ops/cloud/SecretsOps.d.ts +77 -63
- package/types/ops/cloud/SecretsOps.d.ts.map +1 -1
- package/types/ops/cloud/ServiceAccountOps.d.ts +48 -3
- package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -1
- package/types/ops/cloud/StartupOps.d.ts +25 -2
- package/types/ops/cloud/StartupOps.d.ts.map +1 -1
- package/types/ops/cloud/VariablesOps.d.ts +39 -39
- package/types/ops/cloud/VariablesOps.d.ts.map +1 -1
- package/types/ops/utils/Console.d.ts.map +1 -1
- package/types/ops/utils/DataProtection.d.ts +1 -1
- package/types/ops/utils/DataProtection.d.ts.map +1 -1
- package/types/ops/utils/ExportImportUtils.d.ts +72 -11
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
- package/types/ops/utils/OpsUtils.d.ts +4 -1
- package/types/ops/utils/OpsUtils.d.ts.map +1 -1
- package/types/ops/utils/ScriptValidationUtils.d.ts.map +1 -0
- package/types/ops/utils/Version.d.ts +20 -2
- package/types/ops/utils/Version.d.ts.map +1 -1
- package/types/shared/State.d.ts +80 -177
- package/types/shared/State.d.ts.map +1 -1
- package/types/utils/AutoSetupPolly.d.ts.map +1 -1
- package/cjs/ops/utils/ValidationUtils.js.map +0 -1
- package/cjs/ops/utils/ValidationUtils.test.js.map +0 -1
- package/types/ops/utils/ValidationUtils.d.ts.map +0 -1
- /package/types/ops/utils/{ValidationUtils.d.ts → ScriptValidationUtils.d.ts} +0 -0
package/types/api/RealmApi.d.ts
CHANGED
|
@@ -1,30 +1,46 @@
|
|
|
1
|
+
import State from '../shared/State';
|
|
1
2
|
/**
|
|
2
3
|
* Get all realms
|
|
3
4
|
* @returns {Promise} a promise that resolves to an object containing an array of realm objects
|
|
4
5
|
*/
|
|
5
|
-
export declare function getRealms(
|
|
6
|
+
export declare function getRealms({ state }: {
|
|
7
|
+
state: State;
|
|
8
|
+
}): Promise<any>;
|
|
6
9
|
/**
|
|
7
10
|
* Get realm by id
|
|
8
|
-
* @param {String}
|
|
11
|
+
* @param {String} realmId realm id
|
|
9
12
|
* @returns {Promise} a promise that resolves to an object containing a realm object
|
|
10
13
|
*/
|
|
11
|
-
export declare function getRealm(
|
|
14
|
+
export declare function getRealm({ realmId, state, }: {
|
|
15
|
+
realmId: string;
|
|
16
|
+
state: State;
|
|
17
|
+
}): Promise<any>;
|
|
12
18
|
/**
|
|
13
19
|
* Get realm by name
|
|
14
|
-
* @param {String}
|
|
20
|
+
* @param {String} realmName realm name
|
|
15
21
|
* @returns {Promise} a promise that resolves to a realm object
|
|
16
22
|
*/
|
|
17
|
-
export declare function getRealmByName(
|
|
23
|
+
export declare function getRealmByName({ realmName, state, }: {
|
|
24
|
+
realmName: string;
|
|
25
|
+
state: State;
|
|
26
|
+
}): Promise<any>;
|
|
18
27
|
/**
|
|
19
28
|
* Put realm
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
29
|
+
* @param {string} realmId realm id
|
|
30
|
+
* @param {object} realmData realm config object
|
|
22
31
|
* @returns {Promise} a promise that resolves to an object containing a realm object
|
|
23
32
|
*/
|
|
24
|
-
export declare function putRealm(
|
|
33
|
+
export declare function putRealm({ realmId, realmData, state, }: {
|
|
34
|
+
realmId: string;
|
|
35
|
+
realmData: object;
|
|
36
|
+
state: State;
|
|
37
|
+
}): Promise<any>;
|
|
25
38
|
/**
|
|
26
39
|
* Delete realm
|
|
27
|
-
* @param {String}
|
|
40
|
+
* @param {String} realmId realm id
|
|
28
41
|
* @returns {Promise} a promise that resolves to an object containing a realm object
|
|
29
42
|
*/
|
|
30
|
-
export declare function deleteRealm(
|
|
43
|
+
export declare function deleteRealm({ realmId, state, }: {
|
|
44
|
+
realmId: string;
|
|
45
|
+
state: State;
|
|
46
|
+
}): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/RealmApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/api/RealmApi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAYpC;;;GAGG;AACH,wBAAsB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,gBAS1D;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,KAAK,GACN,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd,gBASA;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,EACnC,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd,gBAUA;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd,gBAUA;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,KAAK,GACN,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd,gBAaA","file":"RealmApi.d.ts","sourcesContent":["import util from 'util';\nimport { getTenantURL, getRealmName } from './utils/ApiUtils';\nimport { generateAmApi } from './BaseApi';\nimport State from '../shared/State';\n\nconst realmsListURLTemplate = '%s/json/global-config/realms/?_queryFilter=true';\nconst realmURLTemplate = '%s/json/global-config/realms/%s';\n\nconst apiVersion = 'protocol=2.0,resource=1.0';\nconst getApiConfig = () => {\n return {\n apiVersion,\n };\n};\n\n/**\n * Get all realms\n * @returns {Promise} a promise that resolves to an object containing an array of realm objects\n */\nexport async function getRealms({ state }: { state: State }) {\n const urlString = util.format(realmsListURLTemplate, state.getHost());\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get realm by id\n * @param {String} realmId realm id\n * @returns {Promise} a promise that resolves to an object containing a realm object\n */\nexport async function getRealm({\n realmId,\n state,\n}: {\n realmId: string;\n state: State;\n}) {\n const urlString = util.format(realmURLTemplate, state.getHost(), realmId);\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get realm by name\n * @param {String} realmName realm name\n * @returns {Promise} a promise that resolves to a realm object\n */\nexport async function getRealmByName({\n realmName,\n state,\n}: {\n realmName: string;\n state: State;\n}) {\n const { data } = await getRealms({ state }).then((realms) => {\n for (const realm of realms.data.result) {\n if (getRealmName(realmName) === realm.name) {\n return realm;\n }\n }\n throw new Error(`Realm ${realmName} not found!`);\n });\n return data;\n}\n\n/**\n * Put realm\n * @param {string} realmId realm id\n * @param {object} realmData realm config object\n * @returns {Promise} a promise that resolves to an object containing a realm object\n */\nexport async function putRealm({\n realmId,\n realmData,\n state,\n}: {\n realmId: string;\n realmData: object;\n state: State;\n}) {\n const urlString = util.format(realmURLTemplate, state.getHost(), realmId);\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).put(\n urlString,\n realmData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete realm\n * @param {String} realmId realm id\n * @returns {Promise} a promise that resolves to an object containing a realm object\n */\nexport async function deleteRealm({\n realmId,\n state,\n}: {\n realmId: string;\n state: State;\n}) {\n const urlString = util.format(\n realmURLTemplate,\n getTenantURL(state.getHost()),\n realmId\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
|
|
@@ -1,38 +1,57 @@
|
|
|
1
|
+
import State from '../shared/State';
|
|
1
2
|
import { ResourceTypeSkeleton } from './ApiTypes';
|
|
2
3
|
/**
|
|
3
4
|
* Get all resource types
|
|
4
5
|
* @returns {Promise} a promise that resolves to an object containing an array of resource type objects
|
|
5
6
|
*/
|
|
6
|
-
export declare function getResourceTypes(
|
|
7
|
+
export declare function getResourceTypes({ state }: {
|
|
8
|
+
state: State;
|
|
9
|
+
}): Promise<any>;
|
|
7
10
|
/**
|
|
8
11
|
* Get resource type by uuid
|
|
9
12
|
* @param {String} resourceTypeUuid resource type uuid
|
|
10
13
|
* @returns {Promise} a promise that resolves to a node object
|
|
11
14
|
*/
|
|
12
|
-
export declare function getResourceType(resourceTypeUuid
|
|
15
|
+
export declare function getResourceType({ resourceTypeUuid, state, }: {
|
|
16
|
+
resourceTypeUuid: string;
|
|
17
|
+
state: State;
|
|
18
|
+
}): Promise<any>;
|
|
13
19
|
/**
|
|
14
20
|
* Get resource type by name
|
|
15
21
|
* @param {string} resourceTypeName resource type name
|
|
16
22
|
* @returns {Promise} a promise that resolves to a node object
|
|
17
23
|
*/
|
|
18
|
-
export declare function getResourceTypeByName(resourceTypeName
|
|
24
|
+
export declare function getResourceTypeByName({ resourceTypeName, state, }: {
|
|
25
|
+
resourceTypeName: string;
|
|
26
|
+
state: State;
|
|
27
|
+
}): Promise<any>;
|
|
19
28
|
/**
|
|
20
29
|
* Create resource type by uuid
|
|
21
30
|
* @param {string} resourceTypeUuid resource type uuid
|
|
22
31
|
* @param {Object} resourceTypeData resource type object
|
|
23
32
|
* @returns {Promise<ResourceTypeSkeleton>} a promise that resolves to a resource type object
|
|
24
33
|
*/
|
|
25
|
-
export declare function createResourceType(resourceTypeData
|
|
34
|
+
export declare function createResourceType({ resourceTypeData, state, }: {
|
|
35
|
+
resourceTypeData: ResourceTypeSkeleton;
|
|
36
|
+
state: State;
|
|
37
|
+
}): Promise<ResourceTypeSkeleton>;
|
|
26
38
|
/**
|
|
27
39
|
* Update resource type by uuid
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {
|
|
40
|
+
* @param {string} resourceTypeUuid resource type uuid
|
|
41
|
+
* @param {ResourceTypeSkeleton} resourceTypeData resource type object
|
|
30
42
|
* @returns {Promise} a promise that resolves to a resource type object
|
|
31
43
|
*/
|
|
32
|
-
export declare function putResourceType(resourceTypeUuid
|
|
44
|
+
export declare function putResourceType({ resourceTypeUuid, resourceTypeData, state, }: {
|
|
45
|
+
resourceTypeUuid: string;
|
|
46
|
+
resourceTypeData: ResourceTypeSkeleton;
|
|
47
|
+
state: State;
|
|
48
|
+
}): Promise<any>;
|
|
33
49
|
/**
|
|
34
50
|
* Delete resource type
|
|
35
51
|
* @param {String} resourceTypeUuid resource type uuid
|
|
36
52
|
* @returns {Promise} a promise that resolves to an object containing a resource type object
|
|
37
53
|
*/
|
|
38
|
-
export declare function deleteResourceType(resourceTypeUuid
|
|
54
|
+
export declare function deleteResourceType({ resourceTypeUuid, state, }: {
|
|
55
|
+
resourceTypeUuid: string;
|
|
56
|
+
state: State;
|
|
57
|
+
}): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/ResourceTypesApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/api/ResourceTypesApi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAgBlD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,gBAajE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EACpC,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,gBAcA;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,gBAcA;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAahC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,KAAK,EAAE,KAAK,CAAC;CACd,gBAeA;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,gBAcA","file":"ResourceTypesApi.d.ts","sourcesContent":["import util from 'util';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\nimport { generateAmApi } from './BaseApi';\nimport State from '../shared/State';\nimport { ResourceTypeSkeleton } from './ApiTypes';\n\nconst queryAllResourceTypesURLTemplate =\n '%s/json%s/resourcetypes?_sortKeys=name&_queryFilter=name+eq+%22%5E(%3F!Delegation%20Service%24).*%22';\nconst queryResourceTypeByNameURLTemplate =\n '%s/json%s/resourcetypes?_sortKeys=name&_queryFilter=name+eq+%22%s%22+AND+name+eq+%22%5E(%3F!Delegation%20Service%24).*%22';\nconst resourceTypeURLTemplate = '%s/json%s/resourcetypes/%s';\nconst createResourceTypeURLTemplate = '%s/json%s/resourcetypes?_action=create';\n\nconst apiVersion = 'protocol=1.0,resource=1.0';\nconst getApiConfig = () => {\n return {\n apiVersion,\n };\n};\n\n/**\n * Get all resource types\n * @returns {Promise} a promise that resolves to an object containing an array of resource type objects\n */\nexport async function getResourceTypes({ state }: { state: State }) {\n const urlString = util.format(\n queryAllResourceTypesURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state)\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get resource type by uuid\n * @param {String} resourceTypeUuid resource type uuid\n * @returns {Promise} a promise that resolves to a node object\n */\nexport async function getResourceType({\n resourceTypeUuid,\n state,\n}: {\n resourceTypeUuid: string;\n state: State;\n}) {\n const urlString = util.format(\n resourceTypeURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n resourceTypeUuid\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get resource type by name\n * @param {string} resourceTypeName resource type name\n * @returns {Promise} a promise that resolves to a node object\n */\nexport async function getResourceTypeByName({\n resourceTypeName,\n state,\n}: {\n resourceTypeName: string;\n state: State;\n}) {\n const urlString = util.format(\n queryResourceTypeByNameURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n resourceTypeName\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Create resource type by uuid\n * @param {string} resourceTypeUuid resource type uuid\n * @param {Object} resourceTypeData resource type object\n * @returns {Promise<ResourceTypeSkeleton>} a promise that resolves to a resource type object\n */\nexport async function createResourceType({\n resourceTypeData,\n state,\n}: {\n resourceTypeData: ResourceTypeSkeleton;\n state: State;\n}): Promise<ResourceTypeSkeleton> {\n const urlString = util.format(\n createResourceTypeURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state)\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).post(urlString, resourceTypeData, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Update resource type by uuid\n * @param {string} resourceTypeUuid resource type uuid\n * @param {ResourceTypeSkeleton} resourceTypeData resource type object\n * @returns {Promise} a promise that resolves to a resource type object\n */\nexport async function putResourceType({\n resourceTypeUuid,\n resourceTypeData,\n state,\n}: {\n resourceTypeUuid: string;\n resourceTypeData: ResourceTypeSkeleton;\n state: State;\n}) {\n const urlString = util.format(\n resourceTypeURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n resourceTypeUuid\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).put(\n urlString,\n resourceTypeData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete resource type\n * @param {String} resourceTypeUuid resource type uuid\n * @returns {Promise} a promise that resolves to an object containing a resource type object\n */\nexport async function deleteResourceType({\n resourceTypeUuid,\n state,\n}: {\n resourceTypeUuid: string;\n state: State;\n}) {\n const urlString = util.format(\n resourceTypeURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n resourceTypeUuid\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
|
package/types/api/Saml2Api.d.ts
CHANGED
|
@@ -1,41 +1,63 @@
|
|
|
1
|
+
import State from '../shared/State';
|
|
2
|
+
import { Saml2ProviderSkeleton } from './ApiTypes';
|
|
1
3
|
/**
|
|
2
4
|
* Get all SAML2 entity providers
|
|
3
5
|
* @returns {Promise} a promise that resolves to an array of saml2 entity stubs
|
|
4
6
|
*/
|
|
5
|
-
export declare function getProviders(
|
|
7
|
+
export declare function getProviders({ state }: {
|
|
8
|
+
state: State;
|
|
9
|
+
}): Promise<any>;
|
|
6
10
|
/**
|
|
7
11
|
* Find all providers matching the filter and return the requested fields
|
|
8
12
|
* @param {string} filter CREST filter string, eg "entityId+eq+'${entityId}'" or "true" for all providers
|
|
9
13
|
* @param {string[]} fields array of field names to include in the response
|
|
10
14
|
* @returns {Promise} a promise that resolves to an object containing an array of saml2 entities
|
|
11
15
|
*/
|
|
12
|
-
export declare function findProviders(filter
|
|
16
|
+
export declare function findProviders({ filter, fields, state, }: {
|
|
17
|
+
filter?: string;
|
|
18
|
+
fields?: string[];
|
|
19
|
+
state: State;
|
|
20
|
+
}): Promise<any>;
|
|
13
21
|
/**
|
|
14
22
|
* Geta SAML2 entity provider by location and id
|
|
15
23
|
* @param {string} location Entity provider location (hosted or remote)
|
|
16
24
|
* @param {string} entityId64 Base64-encoded provider entity id
|
|
17
25
|
* @returns {Promise} a promise that resolves to a saml2 entity provider object
|
|
18
26
|
*/
|
|
19
|
-
export declare function getProviderByLocationAndId(location
|
|
27
|
+
export declare function getProviderByLocationAndId({ location, entityId64, state, }: {
|
|
28
|
+
location: string;
|
|
29
|
+
entityId64: string;
|
|
30
|
+
state: State;
|
|
31
|
+
}): Promise<any>;
|
|
20
32
|
/**
|
|
21
33
|
* Geta SAML2 entity provider by location and id
|
|
22
34
|
* @param {string} location Entity provider location (hosted or remote)
|
|
23
35
|
* @param {string} entityId64 Base64-encoded provider entity id
|
|
24
36
|
* @returns {Promise} a promise that resolves to a saml2 entity provider object
|
|
25
37
|
*/
|
|
26
|
-
export declare function deleteProviderByLocationAndId(location
|
|
38
|
+
export declare function deleteProviderByLocationAndId({ location, entityId64, state, }: {
|
|
39
|
+
location: string;
|
|
40
|
+
entityId64: string;
|
|
41
|
+
state: State;
|
|
42
|
+
}): Promise<any>;
|
|
27
43
|
/**
|
|
28
44
|
* Get a SAML2 entity provider's metadata URL by entity id
|
|
29
45
|
* @param {string} entityId SAML2 entity id
|
|
30
46
|
* @returns {string} the URL to get the metadata from
|
|
31
47
|
*/
|
|
32
|
-
export declare function getProviderMetadataUrl(entityId
|
|
48
|
+
export declare function getProviderMetadataUrl({ entityId, state, }: {
|
|
49
|
+
entityId: string;
|
|
50
|
+
state: State;
|
|
51
|
+
}): string;
|
|
33
52
|
/**
|
|
34
53
|
* Get a SAML2 entity provider's metadata by entity id
|
|
35
54
|
* @param {String} entityId SAML2 entity id
|
|
36
55
|
* @returns {Promise} a promise that resolves to an object containing a SAML2 metadata
|
|
37
56
|
*/
|
|
38
|
-
export declare function getProviderMetadata(entityId
|
|
57
|
+
export declare function getProviderMetadata({ entityId, state, }: {
|
|
58
|
+
entityId: string;
|
|
59
|
+
state: State;
|
|
60
|
+
}): Promise<any>;
|
|
39
61
|
/**
|
|
40
62
|
* Create a SAML2 entity provider
|
|
41
63
|
* @param {String} location 'hosted' or 'remote'
|
|
@@ -43,35 +65,20 @@ export declare function getProviderMetadata(entityId: any): Promise<any>;
|
|
|
43
65
|
* @param {String} metaData Base64-encoded metadata XML. Only required for remote providers
|
|
44
66
|
* @returns {Promise} a promise that resolves to a saml2 entity provider object
|
|
45
67
|
*/
|
|
46
|
-
export declare function createProvider(location
|
|
68
|
+
export declare function createProvider({ location, providerData, metaData, state, }: {
|
|
69
|
+
location: string;
|
|
70
|
+
providerData: Saml2ProviderSkeleton | object;
|
|
71
|
+
metaData: string;
|
|
72
|
+
state: State;
|
|
73
|
+
}): Promise<any>;
|
|
47
74
|
/**
|
|
48
75
|
* Update SAML2 entity provider
|
|
49
76
|
* @param {String} location Entity provider location (hosted or remote)
|
|
50
77
|
* @param {Object} providerData Object representing a SAML entity provider
|
|
51
78
|
* @returns {Promise} a promise that resolves to a saml2 entity provider object
|
|
52
79
|
*/
|
|
53
|
-
export declare function updateProvider(location
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*/
|
|
59
|
-
export declare function deleteRawProvider(entityId: any): Promise<any>;
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves all entity providers using the legacy federation enpoints.
|
|
62
|
-
* @returns {Promise} a promise that resolves to an object containing an array of providers
|
|
63
|
-
*/
|
|
64
|
-
export declare function getRawProviders(): Promise<any>;
|
|
65
|
-
/**
|
|
66
|
-
* Gets the data for an entity provider including the raw XML.
|
|
67
|
-
* @param {string} entityId The entity provider id
|
|
68
|
-
* @returns Promise that when resolved includes the configuration and raw xml for a SAML entity provider
|
|
69
|
-
*/
|
|
70
|
-
export declare function getRawProvider(entityId: string): Promise<any>;
|
|
71
|
-
/**
|
|
72
|
-
* Stores a new SAML2 entity provider
|
|
73
|
-
* @param {string} entityId The entity provider id
|
|
74
|
-
* @param {string} entityData The actual data containing the entity provider configuration
|
|
75
|
-
* @returns {Promise} Promise that resolves to a provider object
|
|
76
|
-
*/
|
|
77
|
-
export declare function putRawProvider(entityId: string, entityData: any): Promise<any>;
|
|
80
|
+
export declare function updateProvider({ location, providerData, state, }: {
|
|
81
|
+
location: string;
|
|
82
|
+
providerData: Saml2ProviderSkeleton;
|
|
83
|
+
state: State;
|
|
84
|
+
}): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/Saml2Api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/api/Saml2Api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAoBnD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,gBAa7D;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,EAClC,MAAe,EACf,MAAc,EACd,KAAK,GACN,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd,gBAeA;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,QAAQ,EACR,UAAU,EACV,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;CACd,gBAeA;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,QAAQ,EACR,UAAU,EACV,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;CACd,gBAeA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,MAAM,CAOT;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,gBAQA;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,EACnC,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,qBAAqB,GAAG,MAAM,CAAC;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,gBA6BA;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,EACnC,QAAQ,EACR,YAAY,EACZ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,qBAAqB,CAAC;IACpC,KAAK,EAAE,KAAK,CAAC;CACd,gBAgBA","file":"Saml2Api.d.ts","sourcesContent":["import _ from 'lodash';\nimport util from 'util';\nimport State from '../shared/State';\nimport { generateAmApi } from './BaseApi';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\nimport { Saml2ProviderSkeleton } from './ApiTypes';\n\nconst providerByLocationAndIdURLTemplate = '%s/json%s/realm-config/saml2/%s/%s';\nconst createHostedProviderURLTemplate =\n '%s/json%s/realm-config/saml2/hosted/?_action=create';\nconst createRemoteProviderURLTemplate =\n '%s/json%s/realm-config/saml2/remote/?_action=importEntity';\nconst queryAllProvidersURLTemplate =\n '%s/json%s/realm-config/saml2?_queryFilter=true';\nconst queryProvidersByEntityIdURLTemplate =\n '%s/json%s/realm-config/saml2?_queryFilter=%s&_fields=%s';\nconst metadataByEntityIdURLTemplate =\n '%s/saml2/jsp/exportmetadata.jsp?entityid=%s&realm=%s';\nconst apiVersion = 'protocol=2.1,resource=1.0';\nconst getApiConfig = () => {\n return {\n apiVersion,\n };\n};\n\n/**\n * Get all SAML2 entity providers\n * @returns {Promise} a promise that resolves to an array of saml2 entity stubs\n */\nexport async function getProviders({ state }: { state: State }) {\n const urlString = util.format(\n queryAllProvidersURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state)\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Find all providers matching the filter and return the requested fields\n * @param {string} filter CREST filter string, eg \"entityId+eq+'${entityId}'\" or \"true\" for all providers\n * @param {string[]} fields array of field names to include in the response\n * @returns {Promise} a promise that resolves to an object containing an array of saml2 entities\n */\nexport async function findProviders({\n filter = 'true',\n fields = ['*'],\n state,\n}: {\n filter?: string;\n fields?: string[];\n state: State;\n}) {\n const urlString = util.format(\n queryProvidersByEntityIdURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n encodeURIComponent(filter),\n fields.join(',')\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Geta SAML2 entity provider by location and id\n * @param {string} location Entity provider location (hosted or remote)\n * @param {string} entityId64 Base64-encoded provider entity id\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function getProviderByLocationAndId({\n location,\n entityId64,\n state,\n}: {\n location: string;\n entityId64: string;\n state: State;\n}) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n location,\n entityId64\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Geta SAML2 entity provider by location and id\n * @param {string} location Entity provider location (hosted or remote)\n * @param {string} entityId64 Base64-encoded provider entity id\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function deleteProviderByLocationAndId({\n location,\n entityId64,\n state,\n}: {\n location: string;\n entityId64: string;\n state: State;\n}) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n location,\n entityId64\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get a SAML2 entity provider's metadata URL by entity id\n * @param {string} entityId SAML2 entity id\n * @returns {string} the URL to get the metadata from\n */\nexport function getProviderMetadataUrl({\n entityId,\n state,\n}: {\n entityId: string;\n state: State;\n}): string {\n return util.format(\n metadataByEntityIdURLTemplate,\n state.getHost(),\n encodeURIComponent(entityId),\n state.getRealm()\n );\n}\n\n/**\n * Get a SAML2 entity provider's metadata by entity id\n * @param {String} entityId SAML2 entity id\n * @returns {Promise} a promise that resolves to an object containing a SAML2 metadata\n */\nexport async function getProviderMetadata({\n entityId,\n state,\n}: {\n entityId: string;\n state: State;\n}) {\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n getProviderMetadataUrl({ entityId, state }),\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Create a SAML2 entity provider\n * @param {String} location 'hosted' or 'remote'\n * @param {Object} providerData Object representing a SAML entity provider\n * @param {String} metaData Base64-encoded metadata XML. Only required for remote providers\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function createProvider({\n location,\n providerData,\n metaData,\n state,\n}: {\n location: string;\n providerData: Saml2ProviderSkeleton | object;\n metaData: string;\n state: State;\n}) {\n let postData = _.cloneDeep(providerData);\n let urlString = util.format(\n createHostedProviderURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state)\n );\n\n if (location === 'remote') {\n /**\n * Remote entity providers must be created using XML metadata\n */\n urlString = util.format(\n createRemoteProviderURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state)\n );\n postData = {\n standardMetadata: metaData,\n };\n }\n\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).post(urlString, postData, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Update SAML2 entity provider\n * @param {String} location Entity provider location (hosted or remote)\n * @param {Object} providerData Object representing a SAML entity provider\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function updateProvider({\n location,\n providerData,\n state,\n}: {\n location: string;\n providerData: Saml2ProviderSkeleton;\n state: State;\n}) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n location,\n providerData._id\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).put(\n urlString,\n providerData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n"]}
|
package/types/api/ScriptApi.d.ts
CHANGED
|
@@ -1,31 +1,47 @@
|
|
|
1
|
+
import State from '../shared/State';
|
|
1
2
|
import { PagedResult, ScriptSkeleton } from './ApiTypes';
|
|
2
3
|
/**
|
|
3
4
|
* Get all scripts
|
|
4
5
|
* @returns {Promise} a promise that resolves to an object containing an array of script objects
|
|
5
6
|
*/
|
|
6
|
-
export declare function getScripts(
|
|
7
|
+
export declare function getScripts({ state, }: {
|
|
8
|
+
state: State;
|
|
9
|
+
}): Promise<PagedResult<ScriptSkeleton>>;
|
|
7
10
|
/**
|
|
8
11
|
* Get script by name
|
|
9
12
|
* @param {String} scriptName script name
|
|
10
13
|
* @returns {Promise} a promise that resolves to an object containing a script object
|
|
11
14
|
*/
|
|
12
|
-
export declare function getScriptByName(scriptName
|
|
15
|
+
export declare function getScriptByName({ scriptName, state, }: {
|
|
16
|
+
scriptName: string;
|
|
17
|
+
state: State;
|
|
18
|
+
}): Promise<PagedResult<ScriptSkeleton>>;
|
|
13
19
|
/**
|
|
14
20
|
* Get script by id
|
|
15
21
|
* @param {String} scriptId script uuid/name
|
|
16
22
|
* @returns {Promise} a promise that resolves to a script object
|
|
17
23
|
*/
|
|
18
|
-
export declare function getScript(scriptId
|
|
24
|
+
export declare function getScript({ scriptId, state, }: {
|
|
25
|
+
scriptId: string;
|
|
26
|
+
state: State;
|
|
27
|
+
}): Promise<any>;
|
|
19
28
|
/**
|
|
20
29
|
* Put script
|
|
21
30
|
* @param {string} scriptId script uuid
|
|
22
31
|
* @param {Object} scriptData script object
|
|
23
32
|
* @returns {Promise} a promise that resolves to an object containing a script object
|
|
24
33
|
*/
|
|
25
|
-
export declare function putScript(scriptId
|
|
34
|
+
export declare function putScript({ scriptId, scriptData, state, }: {
|
|
35
|
+
scriptId: string;
|
|
36
|
+
scriptData: ScriptSkeleton;
|
|
37
|
+
state: State;
|
|
38
|
+
}): Promise<any>;
|
|
26
39
|
/**
|
|
27
40
|
* Delete script by id
|
|
28
41
|
* @param {String} scriptId script uuid/name
|
|
29
42
|
* @returns {Promise} a promise that resolves to a script object
|
|
30
43
|
*/
|
|
31
|
-
export declare function deleteScript(scriptId
|
|
44
|
+
export declare function deleteScript({ scriptId, state, }: {
|
|
45
|
+
scriptId: string;
|
|
46
|
+
state: State;
|
|
47
|
+
}): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/ScriptApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/api/ScriptApi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAazD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,EAC/B,KAAK,GACN,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAYvC;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EACpC,UAAU,EACV,KAAK,GACN,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAavC;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,EAC9B,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,gBAcA;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,EAC9B,QAAQ,EACR,UAAU,EACV,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;CACd,gBAeA;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,EACjC,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,gBAcA","file":"ScriptApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from './BaseApi';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\nimport State from '../shared/State';\nimport { PagedResult, ScriptSkeleton } from './ApiTypes';\n\nconst scriptURLTemplate = '%s/json%s/scripts/%s';\nconst scriptListURLTemplate = '%s/json%s/scripts?_queryFilter=true';\nconst scriptQueryURLTemplate =\n '%s/json%s/scripts?_queryFilter=name+eq+%%22%s%%22';\nconst apiVersion = 'protocol=2.0,resource=1.0';\nconst getApiConfig = () => {\n return {\n apiVersion,\n };\n};\n\n/**\n * Get all scripts\n * @returns {Promise} a promise that resolves to an object containing an array of script objects\n */\nexport async function getScripts({\n state,\n}: {\n state: State;\n}): Promise<PagedResult<ScriptSkeleton>> {\n const urlString = util.format(\n scriptListURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state)\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get<\n PagedResult<ScriptSkeleton>\n >(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get script by name\n * @param {String} scriptName script name\n * @returns {Promise} a promise that resolves to an object containing a script object\n */\nexport async function getScriptByName({\n scriptName,\n state,\n}: {\n scriptName: string;\n state: State;\n}): Promise<PagedResult<ScriptSkeleton>> {\n const urlString = util.format(\n scriptQueryURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n encodeURIComponent(scriptName)\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get<\n PagedResult<ScriptSkeleton>\n >(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get script by id\n * @param {String} scriptId script uuid/name\n * @returns {Promise} a promise that resolves to a script object\n */\nexport async function getScript({\n scriptId,\n state,\n}: {\n scriptId: string;\n state: State;\n}) {\n const urlString = util.format(\n scriptURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n scriptId\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Put script\n * @param {string} scriptId script uuid\n * @param {Object} scriptData script object\n * @returns {Promise} a promise that resolves to an object containing a script object\n */\nexport async function putScript({\n scriptId,\n scriptData,\n state,\n}: {\n scriptId: string;\n scriptData: ScriptSkeleton;\n state: State;\n}) {\n const urlString = util.format(\n scriptURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n scriptId\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).put(\n urlString,\n scriptData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete script by id\n * @param {String} scriptId script uuid/name\n * @returns {Promise} a promise that resolves to a script object\n */\nexport async function deleteScript({\n scriptId,\n state,\n}: {\n scriptId: string;\n state: State;\n}) {\n const urlString = util.format(\n scriptURLTemplate,\n state.getHost(),\n getCurrentRealmPath(state),\n scriptId\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import State from '../shared/State';
|
|
1
2
|
/**
|
|
2
3
|
* Get server info
|
|
4
|
+
* @param {State} state library state
|
|
3
5
|
* @returns {Promise} a promise that resolves to an object containing a server info object
|
|
4
6
|
*/
|
|
5
|
-
export declare function getServerInfo(
|
|
7
|
+
export declare function getServerInfo({ state }: {
|
|
8
|
+
state: State;
|
|
9
|
+
}): Promise<any>;
|
|
6
10
|
/**
|
|
7
11
|
* Get server version info
|
|
12
|
+
* @param {State} state library state
|
|
8
13
|
* @returns {Promise} a promise that resolves to an object containing a server version info object
|
|
9
14
|
*/
|
|
10
|
-
export declare function getServerVersionInfo(
|
|
15
|
+
export declare function getServerVersionInfo({ state }: {
|
|
16
|
+
state: State;
|
|
17
|
+
}): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/ServerInfoApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/api/ServerInfoApi.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAepC;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,gBAQ9D;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,gBAYrE","file":"ServerInfoApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from './BaseApi';\nimport State from '../shared/State';\n\nconst serverInfoUrlTemplate = '%s/json/serverinfo/%s';\n\nconst serverInfoApiVersion = 'resource=1.1';\nconst serverVersionoApiVersion = 'resource=1.0';\n\nconst getServerInfoApiConfig = () => ({\n apiVersion: serverInfoApiVersion,\n});\n\nconst getServerVersionApiConfig = () => ({\n apiVersion: serverVersionoApiVersion,\n});\n\n/**\n * Get server info\n * @param {State} state library state\n * @returns {Promise} a promise that resolves to an object containing a server info object\n */\nexport async function getServerInfo({ state }: { state: State }) {\n const urlString = util.format(serverInfoUrlTemplate, state.getHost(), '*');\n const { data } = await generateAmApi({\n resource: getServerInfoApiConfig(),\n requestOverride: {},\n state,\n }).get(urlString, {});\n return data;\n}\n\n/**\n * Get server version info\n * @param {State} state library state\n * @returns {Promise} a promise that resolves to an object containing a server version info object\n */\nexport async function getServerVersionInfo({ state }: { state: State }) {\n const urlString = util.format(\n serverInfoUrlTemplate,\n state.getHost(),\n 'version'\n );\n const { data } = await generateAmApi({\n resource: getServerVersionApiConfig(),\n requestOverride: {},\n state,\n }).get(urlString, {});\n return data;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import State from '../shared/State';
|
|
1
2
|
import { AmServiceSkeleton, PagedResult } from './ApiTypes';
|
|
2
3
|
export interface ServiceListItem {
|
|
3
4
|
/**
|
|
@@ -24,21 +25,32 @@ export interface ServiceNextDescendent {
|
|
|
24
25
|
* @param {boolean} globalConfig true if the global list of services is requested, false otherwise. Default: false.
|
|
25
26
|
* @returns {Promise<ServiceListItem[]>} a promise resolving to an array of service list items.
|
|
26
27
|
*/
|
|
27
|
-
export declare function getListOfServices(globalConfig
|
|
28
|
+
export declare function getListOfServices({ globalConfig, state, }: {
|
|
29
|
+
globalConfig: boolean;
|
|
30
|
+
state: State;
|
|
31
|
+
}): Promise<PagedResult<ServiceListItem>>;
|
|
28
32
|
/**
|
|
29
33
|
* Get service
|
|
30
34
|
* @param {string} serviceId servide id
|
|
31
35
|
* @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.
|
|
32
36
|
* @returns {Promise<AmService>} a promise resolving to a service object
|
|
33
37
|
*/
|
|
34
|
-
export declare function getService(serviceId
|
|
38
|
+
export declare function getService({ serviceId, globalConfig, state, }: {
|
|
39
|
+
serviceId: string;
|
|
40
|
+
globalConfig?: boolean;
|
|
41
|
+
state: State;
|
|
42
|
+
}): Promise<AmServiceSkeleton>;
|
|
35
43
|
/**
|
|
36
44
|
* Get a service's decendents (applicable for structured services only, e.g. SocialIdentityProviders)
|
|
37
45
|
* @param {string} serviceId service id
|
|
38
46
|
* @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.
|
|
39
47
|
* @returns {Promise<ServiceNextDescendent[]>} a promise resolving to an array of the service's next decendents
|
|
40
48
|
*/
|
|
41
|
-
export declare function getServiceDescendents(serviceId
|
|
49
|
+
export declare function getServiceDescendents({ serviceId, globalConfig, state, }: {
|
|
50
|
+
serviceId: string;
|
|
51
|
+
globalConfig?: boolean;
|
|
52
|
+
state: State;
|
|
53
|
+
}): Promise<ServiceNextDescendent[]>;
|
|
42
54
|
/**
|
|
43
55
|
* Create or update a service
|
|
44
56
|
* @param {string} serviceId service id
|
|
@@ -46,7 +58,12 @@ export declare function getServiceDescendents(serviceId: string, globalConfig?:
|
|
|
46
58
|
* @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.
|
|
47
59
|
* @returns {Promise<AmService>} a promise resolving to a service object
|
|
48
60
|
*/
|
|
49
|
-
export declare function putService(serviceId
|
|
61
|
+
export declare function putService({ serviceId, serviceData, globalConfig, state, }: {
|
|
62
|
+
serviceId: string;
|
|
63
|
+
serviceData: AmServiceSkeleton;
|
|
64
|
+
globalConfig?: boolean;
|
|
65
|
+
state: State;
|
|
66
|
+
}): Promise<AmServiceSkeleton>;
|
|
50
67
|
/**
|
|
51
68
|
* Create or update a service next descendent instance
|
|
52
69
|
* @param {string} serviceId service id
|
|
@@ -56,14 +73,25 @@ export declare function putService(serviceId: string, serviceData: AmServiceSkel
|
|
|
56
73
|
* @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.
|
|
57
74
|
* @returns {Promise<ServiceNextDescendent>} a promise resolving to a service next descendent
|
|
58
75
|
*/
|
|
59
|
-
export declare function putServiceNextDescendent(serviceId
|
|
76
|
+
export declare function putServiceNextDescendent({ serviceId, serviceType, serviceNextDescendentId, serviceNextDescendentData, globalConfig, state, }: {
|
|
77
|
+
serviceId: string;
|
|
78
|
+
serviceType: string;
|
|
79
|
+
serviceNextDescendentId: string;
|
|
80
|
+
serviceNextDescendentData: ServiceNextDescendent;
|
|
81
|
+
globalConfig?: boolean;
|
|
82
|
+
state: State;
|
|
83
|
+
}): Promise<ServiceNextDescendent>;
|
|
60
84
|
/**
|
|
61
85
|
* Delete service
|
|
62
86
|
* @param {string} serviceId service id
|
|
63
87
|
* @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.
|
|
64
88
|
* @returns {Promise<AmService>} a promise resolving to a service object
|
|
65
89
|
*/
|
|
66
|
-
export declare function deleteService(serviceId
|
|
90
|
+
export declare function deleteService({ serviceId, globalConfig, state, }: {
|
|
91
|
+
serviceId: string;
|
|
92
|
+
globalConfig?: boolean;
|
|
93
|
+
state: State;
|
|
94
|
+
}): Promise<AmServiceSkeleton>;
|
|
67
95
|
/**
|
|
68
96
|
* Delete service next descendent
|
|
69
97
|
* @param {string} serviceId service id
|
|
@@ -72,4 +100,10 @@ export declare function deleteService(serviceId: string, globalConfig?: boolean)
|
|
|
72
100
|
* @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.
|
|
73
101
|
* @returns {Promise<ServiceNextDescendent>} a promise resolving to a service next descendent
|
|
74
102
|
*/
|
|
75
|
-
export declare function deleteServiceNextDescendent(serviceId
|
|
103
|
+
export declare function deleteServiceNextDescendent({ serviceId, serviceType, serviceNextDescendentId, globalConfig, state, }: {
|
|
104
|
+
serviceId: string;
|
|
105
|
+
serviceType: string;
|
|
106
|
+
serviceNextDescendentId: string;
|
|
107
|
+
globalConfig?: boolean;
|
|
108
|
+
state: State;
|
|
109
|
+
}): Promise<ServiceNextDescendent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/ServiceApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmB5D,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAaD,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IAEpC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAwBD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,UAAQ,GACnB,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAavC;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,YAAY,UAAQ,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAe5B;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,YAAY,UAAQ,GACnB,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAclC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,iBAAiB,EAC9B,YAAY,UAAQ,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAgB5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,uBAAuB,EAAE,MAAM,EAC/B,yBAAyB,EAAE,qBAAqB,EAChD,YAAY,UAAQ,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAkBhC;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,YAAY,UAAQ,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAY5B;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,uBAAuB,EAAE,MAAM,EAC/B,YAAY,UAAQ,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAchC","file":"ServiceApi.d.ts","sourcesContent":["import util from 'util';\nimport * as state from '../shared/State';\nimport { AmServiceSkeleton, PagedResult } from './ApiTypes';\nimport { generateAmApi } from './BaseApi';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\n\nconst serviceURLTemplate = '%s/json%s/%s/services/%s';\nconst serviceURLNextDescendentsTemplate =\n '%s/json%s/%s/services/%s?_action=nextdescendents';\nconst serviceURLNextDescendentTemplate = '%s/json%s/%s/services/%s/%s/%s';\nconst serviceListURLTemplate = '%s/json%s/%s/services?_queryFilter=true';\nconst apiVersion = 'protocol=2.0,resource=1.0';\n\nfunction getApiConfig() {\n const configPath = getCurrentRealmPath();\n return {\n path: `${configPath}/realm-config/services`,\n apiVersion,\n };\n}\n\nexport interface ServiceListItem {\n /**\n * The identifier for the service - used to construct the subpath for the service\n */\n _id: string;\n /**\n * The user-facing name of the service\n */\n name: string;\n /**\n * The revision number of the service\n */\n _rev: string;\n}\n\n// export interface AmService {\n// _id: '';\n// _rev: string;\n// _type: {\n// _id: string;\n// name: string;\n// collection: boolean;\n// };\n// [key: string]: any;\n// }\n\nexport interface ServiceNextDescendentResponse {\n result: ServiceNextDescendent;\n}\n\nexport interface ServiceNextDescendent {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\n/**\n * Helper function to get the realm path required for the API call considering if the request\n * should obtain the realm config or the global config of the service in question\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise.\n * @returns {string} The realm path to be used for the request\n */\nfunction getRealmPath(globalConfig: boolean): string {\n if (globalConfig) return '';\n return getCurrentRealmPath();\n}\n\n/**\n * Helper function to get the config path required for the API call considering if the request\n * should obtain the realm config or the global config of the service in question\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise.\n * @returns {string} The config path to be used for the request\n */\nfunction getConfigPath(globalConfig: boolean): string {\n if (globalConfig) return 'global-config';\n return 'realm-config';\n}\n\n/**\n * Get a list of services\n * @param {boolean} globalConfig true if the global list of services is requested, false otherwise. Default: false.\n * @returns {Promise<ServiceListItem[]>} a promise resolving to an array of service list items.\n */\nexport async function getListOfServices(\n globalConfig = false\n): Promise<PagedResult<ServiceListItem>> {\n const urlString = util.format(\n serviceListURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig)\n );\n const { data } = await generateAmApi(getApiConfig()).get<\n PagedResult<ServiceListItem>\n >(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get service\n * @param {string} serviceId servide id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<AmService>} a promise resolving to a service object\n */\nexport async function getService(\n serviceId: string,\n globalConfig = false\n): Promise<AmServiceSkeleton> {\n const urlString = util.format(\n serviceURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi(getApiConfig()).get<AmServiceSkeleton>(\n urlString,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get a service's decendents (applicable for structured services only, e.g. SocialIdentityProviders)\n * @param {string} serviceId service id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<ServiceNextDescendent[]>} a promise resolving to an array of the service's next decendents\n */\nexport async function getServiceDescendents(\n serviceId: string,\n globalConfig = false\n): Promise<ServiceNextDescendent[]> {\n const urlString = util.format(\n serviceURLNextDescendentsTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi(\n getApiConfig()\n ).post<ServiceNextDescendentResponse>(urlString, {\n withCredentials: true,\n });\n return data.result as ServiceNextDescendent[];\n}\n\n/**\n * Create or update a service\n * @param {string} serviceId service id\n * @param {AmService} serviceData service configuration\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<AmService>} a promise resolving to a service object\n */\nexport async function putService(\n serviceId: string,\n serviceData: AmServiceSkeleton,\n globalConfig = false\n): Promise<AmServiceSkeleton> {\n const urlString = util.format(\n serviceURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi(getApiConfig()).put(\n urlString,\n serviceData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Create or update a service next descendent instance\n * @param {string} serviceId service id\n * @param {string} serviceType service type\n * @param {string} serviceNextDescendentId service instance id\n * @param {ServiceNextDescendent} serviceNextDescendentData service next descendent configuration\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<ServiceNextDescendent>} a promise resolving to a service next descendent\n */\nexport async function putServiceNextDescendent(\n serviceId: string,\n serviceType: string,\n serviceNextDescendentId: string,\n serviceNextDescendentData: ServiceNextDescendent,\n globalConfig = false\n): Promise<ServiceNextDescendent> {\n const urlString = util.format(\n serviceURLNextDescendentTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig),\n serviceId,\n serviceType,\n serviceNextDescendentId\n );\n const { data } = await generateAmApi(getApiConfig()).put(\n urlString,\n serviceNextDescendentData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete service\n * @param {string} serviceId service id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<AmService>} a promise resolving to a service object\n */\nexport async function deleteService(\n serviceId: string,\n globalConfig = false\n): Promise<AmServiceSkeleton> {\n const urlString = util.format(\n serviceURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Delete service next descendent\n * @param {string} serviceId service id\n * @param {string} serviceType service type\n * @param {string} serviceNextDescendentId service instance id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<ServiceNextDescendent>} a promise resolving to a service next descendent\n */\nexport async function deleteServiceNextDescendent(\n serviceId: string,\n serviceType: string,\n serviceNextDescendentId: string,\n globalConfig = false\n): Promise<ServiceNextDescendent> {\n const urlString = util.format(\n serviceURLNextDescendentTemplate,\n state.getHost(),\n getRealmPath(globalConfig),\n getConfigPath(globalConfig),\n serviceId,\n serviceType,\n serviceNextDescendentId\n );\n const { data } = await generateAmApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/ServiceApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAiB5D,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAaD,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IAEpC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAwBD;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAaxC;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,EAC/B,SAAS,EACT,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAe7B;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAenC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,EAC/B,SAAS,EACT,WAAW,EACX,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAgB7B;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,MAAM,CAAC;IAChC,yBAAyB,EAAE,qBAAqB,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAkBjC;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,EAClC,SAAS,EACT,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAe7B;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,YAAoB,EACpB,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAiBjC","file":"ServiceApi.d.ts","sourcesContent":["import util from 'util';\nimport State from '../shared/State';\nimport { AmServiceSkeleton, PagedResult } from './ApiTypes';\nimport { generateAmApi } from './BaseApi';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\n\nconst serviceURLTemplate = '%s/json%s/%s/services/%s';\nconst serviceURLNextDescendentsTemplate =\n '%s/json%s/%s/services/%s?_action=nextdescendents';\nconst serviceURLNextDescendentTemplate = '%s/json%s/%s/services/%s/%s/%s';\nconst serviceListURLTemplate = '%s/json%s/%s/services?_queryFilter=true';\nconst apiVersion = 'protocol=2.0,resource=1.0';\n\nfunction getApiConfig() {\n return {\n apiVersion,\n };\n}\n\nexport interface ServiceListItem {\n /**\n * The identifier for the service - used to construct the subpath for the service\n */\n _id: string;\n /**\n * The user-facing name of the service\n */\n name: string;\n /**\n * The revision number of the service\n */\n _rev: string;\n}\n\n// export interface AmService {\n// _id: '';\n// _rev: string;\n// _type: {\n// _id: string;\n// name: string;\n// collection: boolean;\n// };\n// [key: string]: any;\n// }\n\nexport interface ServiceNextDescendentResponse {\n result: ServiceNextDescendent;\n}\n\nexport interface ServiceNextDescendent {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\n/**\n * Helper function to get the realm path required for the API call considering if the request\n * should obtain the realm config or the global config of the service in question\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise.\n * @returns {string} The realm path to be used for the request\n */\nfunction getRealmPath(globalConfig: boolean, state: State): string {\n if (globalConfig) return '';\n return getCurrentRealmPath(state);\n}\n\n/**\n * Helper function to get the config path required for the API call considering if the request\n * should obtain the realm config or the global config of the service in question\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise.\n * @returns {string} The config path to be used for the request\n */\nfunction getConfigPath(globalConfig: boolean): string {\n if (globalConfig) return 'global-config';\n return 'realm-config';\n}\n\n/**\n * Get a list of services\n * @param {boolean} globalConfig true if the global list of services is requested, false otherwise. Default: false.\n * @returns {Promise<ServiceListItem[]>} a promise resolving to an array of service list items.\n */\nexport async function getListOfServices({\n globalConfig = false,\n state,\n}: {\n globalConfig: boolean;\n state: State;\n}): Promise<PagedResult<ServiceListItem>> {\n const urlString = util.format(\n serviceListURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig)\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).get<\n PagedResult<ServiceListItem>\n >(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get service\n * @param {string} serviceId servide id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<AmService>} a promise resolving to a service object\n */\nexport async function getService({\n serviceId,\n globalConfig = false,\n state,\n}: {\n serviceId: string;\n globalConfig?: boolean;\n state: State;\n}): Promise<AmServiceSkeleton> {\n const urlString = util.format(\n serviceURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).get<AmServiceSkeleton>(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get a service's decendents (applicable for structured services only, e.g. SocialIdentityProviders)\n * @param {string} serviceId service id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<ServiceNextDescendent[]>} a promise resolving to an array of the service's next decendents\n */\nexport async function getServiceDescendents({\n serviceId,\n globalConfig = false,\n state,\n}: {\n serviceId: string;\n globalConfig?: boolean;\n state: State;\n}): Promise<ServiceNextDescendent[]> {\n const urlString = util.format(\n serviceURLNextDescendentsTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).post<ServiceNextDescendentResponse>(urlString, {\n withCredentials: true,\n });\n return data.result as ServiceNextDescendent[];\n}\n\n/**\n * Create or update a service\n * @param {string} serviceId service id\n * @param {AmService} serviceData service configuration\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<AmService>} a promise resolving to a service object\n */\nexport async function putService({\n serviceId,\n serviceData,\n globalConfig = false,\n state,\n}: {\n serviceId: string;\n serviceData: AmServiceSkeleton;\n globalConfig?: boolean;\n state: State;\n}): Promise<AmServiceSkeleton> {\n const urlString = util.format(\n serviceURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).put(\n urlString,\n serviceData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Create or update a service next descendent instance\n * @param {string} serviceId service id\n * @param {string} serviceType service type\n * @param {string} serviceNextDescendentId service instance id\n * @param {ServiceNextDescendent} serviceNextDescendentData service next descendent configuration\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<ServiceNextDescendent>} a promise resolving to a service next descendent\n */\nexport async function putServiceNextDescendent({\n serviceId,\n serviceType,\n serviceNextDescendentId,\n serviceNextDescendentData,\n globalConfig = false,\n state,\n}: {\n serviceId: string;\n serviceType: string;\n serviceNextDescendentId: string;\n serviceNextDescendentData: ServiceNextDescendent;\n globalConfig?: boolean;\n state: State;\n}): Promise<ServiceNextDescendent> {\n const urlString = util.format(\n serviceURLNextDescendentTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig),\n serviceId,\n serviceType,\n serviceNextDescendentId\n );\n const { data } = await generateAmApi({ resource: getApiConfig(), state }).put(\n urlString,\n serviceNextDescendentData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete service\n * @param {string} serviceId service id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<AmService>} a promise resolving to a service object\n */\nexport async function deleteService({\n serviceId,\n globalConfig = false,\n state,\n}: {\n serviceId: string;\n globalConfig?: boolean;\n state: State;\n}): Promise<AmServiceSkeleton> {\n const urlString = util.format(\n serviceURLTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig),\n serviceId\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Delete service next descendent\n * @param {string} serviceId service id\n * @param {string} serviceType service type\n * @param {string} serviceNextDescendentId service instance id\n * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false.\n * @returns {Promise<ServiceNextDescendent>} a promise resolving to a service next descendent\n */\nexport async function deleteServiceNextDescendent({\n serviceId,\n serviceType,\n serviceNextDescendentId,\n globalConfig = false,\n state,\n}: {\n serviceId: string;\n serviceType: string;\n serviceNextDescendentId: string;\n globalConfig?: boolean;\n state: State;\n}): Promise<ServiceNextDescendent> {\n const urlString = util.format(\n serviceURLNextDescendentTemplate,\n state.getHost(),\n getRealmPath(globalConfig, state),\n getConfigPath(globalConfig),\n serviceId,\n serviceType,\n serviceNextDescendentId\n );\n const { data } = await generateAmApi({\n resource: getApiConfig(),\n state,\n }).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
|