@azure/msal-common 14.14.1 → 14.15.0
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/browser/README.md +1 -0
- package/browser/package.json +5 -0
- package/dist/account/AccountInfo.d.ts +1 -1
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AuthToken.d.ts +1 -1
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.d.ts +12 -12
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/AuthorityFactory.d.ts +6 -6
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +6 -6
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -1
- package/dist/authority/AuthorityOptions.d.ts +4 -4
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OIDCOptions.d.ts +1 -1
- package/dist/authority/OIDCOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.d.ts +5 -5
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/authority/RegionDiscoveryMetadata.d.ts +1 -1
- package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -1
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +6 -6
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
- package/dist/cache/CacheManager.d.ts +18 -18
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +2 -2
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +6 -6
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.d.ts +5 -5
- package/dist/cache/entities/CacheRecord.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/IdTokenEntity.d.ts +1 -1
- package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.d.ts +1 -1
- package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +12 -12
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/interface/ICachePlugin.d.ts +1 -1
- package/dist/cache/interface/ICachePlugin.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.d.ts +1 -1
- package/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.d.ts +9 -9
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +11 -11
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +10 -9
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +13 -5
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +13 -13
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/RefreshTokenClient.d.ts +6 -6
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +1 -1
- package/dist/client/SilentFlowClient.d.ts +6 -6
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.d.ts +13 -11
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +2 -1
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.d.ts +2 -2
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/JoseHeader.d.ts +1 -1
- package/dist/crypto/JoseHeader.d.ts.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +3 -3
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/error/AuthError.d.ts +1 -1
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.d.ts +1 -1
- package/dist/error/CacheError.d.ts.map +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.d.ts +2 -2
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.d.ts +2 -2
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +2 -2
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.d.ts +2 -2
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/ServerError.d.ts +1 -1
- package/dist/error/ServerError.d.ts.map +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/exports-browser-only.d.ts +10 -0
- package/dist/exports-browser-only.d.ts.map +1 -0
- package/dist/exports-common.d.ts +80 -0
- package/dist/exports-common.d.ts.map +1 -0
- package/dist/exports-node-only.d.ts +18 -0
- package/dist/exports-node-only.d.ts.map +1 -0
- package/dist/index-browser.d.ts +7 -0
- package/dist/index-browser.d.ts.map +1 -0
- package/dist/index-browser.mjs +67 -0
- package/dist/index-browser.mjs.map +1 -0
- package/dist/index-node.d.ts +7 -0
- package/dist/index-node.d.ts.map +1 -0
- package/dist/index-node.mjs +66 -0
- package/dist/index-node.mjs.map +1 -0
- package/dist/index.d.ts +7 -103
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +30 -30
- package/dist/logger/Logger.d.ts +1 -1
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.d.ts +1 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/NetworkManager.d.ts +4 -4
- package/dist/network/NetworkManager.d.ts.map +1 -1
- package/dist/network/NetworkManager.mjs +1 -1
- package/dist/network/RequestThumbprint.d.ts +2 -2
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts +5 -5
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/BaseAuthRequest.d.ts +5 -5
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +3 -3
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +4 -4
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +3 -3
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +3 -3
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +2 -2
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +3 -3
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +3 -3
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/dist/request/NativeRequest.d.ts +1 -1
- package/dist/request/NativeRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +5 -5
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestValidator.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ExternalTokenResponse.d.ts +1 -1
- package/dist/response/ExternalTokenResponse.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +16 -16
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +2 -2
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +5 -5
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -4
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -5
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +3 -3
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +5 -5
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.d.ts +1 -1
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.d.ts +1 -1
- package/dist/utils/ClientAssertionUtils.d.ts.map +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/FunctionWrappers.d.ts +2 -2
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ProtocolUtils.d.ts +1 -1
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.d.ts +1 -1
- package/dist/utils/UrlUtils.d.ts.map +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/lib/index-browser.cjs +838 -0
- package/lib/index-browser.cjs.map +1 -0
- package/{dist/index.cjs → lib/index-node-aee3f7b6.js} +39 -769
- package/lib/index-node-aee3f7b6.js.map +1 -0
- package/lib/index-node.cjs +103 -0
- package/lib/index-node.cjs.map +1 -0
- package/lib/index.cjs +111 -0
- package/lib/index.cjs.map +1 -0
- package/lib/package.json +1 -0
- package/lib/types/account/AccountInfo.d.ts +67 -0
- package/lib/types/account/AccountInfo.d.ts.map +1 -0
- package/lib/types/account/AuthToken.d.ts +18 -0
- package/lib/types/account/AuthToken.d.ts.map +1 -0
- package/lib/types/account/CcsCredential.d.ts +10 -0
- package/lib/types/account/CcsCredential.d.ts.map +1 -0
- package/lib/types/account/ClientCredentials.d.ts +20 -0
- package/lib/types/account/ClientCredentials.d.ts.map +1 -0
- package/lib/types/account/ClientInfo.d.ts +19 -0
- package/lib/types/account/ClientInfo.d.ts.map +1 -0
- package/lib/types/account/TokenClaims.d.ts +84 -0
- package/lib/types/account/TokenClaims.d.ts.map +1 -0
- package/lib/types/authority/Authority.d.ts +255 -0
- package/lib/types/authority/Authority.d.ts.map +1 -0
- package/lib/types/authority/AuthorityFactory.d.ts +19 -0
- package/lib/types/authority/AuthorityFactory.d.ts.map +1 -0
- package/lib/types/authority/AuthorityMetadata.d.ts +44 -0
- package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -0
- package/lib/types/authority/AuthorityOptions.d.ts +28 -0
- package/lib/types/authority/AuthorityOptions.d.ts.map +1 -0
- package/lib/types/authority/AuthorityType.d.ts +11 -0
- package/lib/types/authority/AuthorityType.d.ts.map +1 -0
- package/lib/types/authority/AzureRegion.d.ts +2 -0
- package/lib/types/authority/AzureRegion.d.ts.map +1 -0
- package/lib/types/authority/AzureRegionConfiguration.d.ts +6 -0
- package/lib/types/authority/AzureRegionConfiguration.d.ts.map +1 -0
- package/lib/types/authority/CloudDiscoveryMetadata.d.ts +6 -0
- package/lib/types/authority/CloudDiscoveryMetadata.d.ts.map +1 -0
- package/lib/types/authority/CloudInstanceDiscoveryErrorResponse.d.ts +14 -0
- package/lib/types/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -0
- package/lib/types/authority/CloudInstanceDiscoveryResponse.d.ts +10 -0
- package/lib/types/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -0
- package/lib/types/authority/ImdsOptions.d.ts +6 -0
- package/lib/types/authority/ImdsOptions.d.ts.map +1 -0
- package/lib/types/authority/OIDCOptions.d.ts +9 -0
- package/lib/types/authority/OIDCOptions.d.ts.map +1 -0
- package/lib/types/authority/OpenIdConfigResponse.d.ts +12 -0
- package/lib/types/authority/OpenIdConfigResponse.d.ts.map +1 -0
- package/lib/types/authority/ProtocolMode.d.ts +9 -0
- package/lib/types/authority/ProtocolMode.d.ts.map +1 -0
- package/lib/types/authority/RegionDiscovery.d.ts +33 -0
- package/lib/types/authority/RegionDiscovery.d.ts.map +1 -0
- package/lib/types/authority/RegionDiscoveryMetadata.d.ts +7 -0
- package/lib/types/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
- package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
- package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
- package/lib/types/cache/CacheManager.d.ts +498 -0
- package/lib/types/cache/CacheManager.d.ts.map +1 -0
- package/lib/types/cache/entities/AccessTokenEntity.d.ts +26 -0
- package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/AccountEntity.d.ts +107 -0
- package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/AppMetadataEntity.d.ts +12 -0
- package/lib/types/cache/entities/AppMetadataEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/AuthorityMetadataEntity.d.ts +16 -0
- package/lib/types/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/CacheRecord.d.ts +14 -0
- package/lib/types/cache/entities/CacheRecord.d.ts.map +1 -0
- package/lib/types/cache/entities/CredentialEntity.d.ts +31 -0
- package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/IdTokenEntity.d.ts +9 -0
- package/lib/types/cache/entities/IdTokenEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/RefreshTokenEntity.d.ts +8 -0
- package/lib/types/cache/entities/RefreshTokenEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/ServerTelemetryEntity.d.ts +7 -0
- package/lib/types/cache/entities/ServerTelemetryEntity.d.ts.map +1 -0
- package/lib/types/cache/entities/ThrottlingEntity.d.ts +8 -0
- package/lib/types/cache/entities/ThrottlingEntity.d.ts.map +1 -0
- package/lib/types/cache/interface/ICacheManager.d.ts +167 -0
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -0
- package/lib/types/cache/interface/ICachePlugin.d.ts +6 -0
- package/lib/types/cache/interface/ICachePlugin.d.ts.map +1 -0
- package/lib/types/cache/interface/ISerializableTokenCache.d.ts +5 -0
- package/lib/types/cache/interface/ISerializableTokenCache.d.ts.map +1 -0
- package/lib/types/cache/persistence/TokenCacheContext.d.ts +24 -0
- package/lib/types/cache/persistence/TokenCacheContext.d.ts.map +1 -0
- package/lib/types/cache/utils/CacheHelpers.d.ts +95 -0
- package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -0
- package/lib/types/cache/utils/CacheTypes.d.ts +70 -0
- package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -0
- package/lib/types/client/AuthorizationCodeClient.d.ts +76 -0
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -0
- package/lib/types/client/BaseClient.d.ts +52 -0
- package/lib/types/client/BaseClient.d.ts.map +1 -0
- package/lib/types/client/RefreshTokenClient.d.ts +36 -0
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -0
- package/lib/types/client/SilentFlowClient.d.ts +28 -0
- package/lib/types/client/SilentFlowClient.d.ts.map +1 -0
- package/lib/types/config/AppTokenProvider.d.ts +39 -0
- package/lib/types/config/AppTokenProvider.d.ts.map +1 -0
- package/lib/types/config/ClientConfiguration.d.ts +153 -0
- package/lib/types/config/ClientConfiguration.d.ts.map +1 -0
- package/lib/types/constants/AADServerParamKeys.d.ts +54 -0
- package/lib/types/constants/AADServerParamKeys.d.ts.map +1 -0
- package/lib/types/crypto/ICrypto.d.ts +69 -0
- package/lib/types/crypto/ICrypto.d.ts.map +1 -0
- package/lib/types/crypto/IGuidGenerator.d.ts +5 -0
- package/lib/types/crypto/IGuidGenerator.d.ts.map +1 -0
- package/lib/types/crypto/JoseHeader.d.ts +23 -0
- package/lib/types/crypto/JoseHeader.d.ts.map +1 -0
- package/lib/types/crypto/PopTokenGenerator.d.ts +60 -0
- package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -0
- package/lib/types/crypto/SignedHttpRequest.d.ts +16 -0
- package/lib/types/crypto/SignedHttpRequest.d.ts.map +1 -0
- package/lib/types/error/AuthError.d.ts +45 -0
- package/lib/types/error/AuthError.d.ts.map +1 -0
- package/lib/types/error/AuthErrorCodes.d.ts +6 -0
- package/lib/types/error/AuthErrorCodes.d.ts.map +1 -0
- package/lib/types/error/CacheError.d.ts +21 -0
- package/lib/types/error/CacheError.d.ts.map +1 -0
- package/lib/types/error/CacheErrorCodes.d.ts +3 -0
- package/lib/types/error/CacheErrorCodes.d.ts.map +1 -0
- package/lib/types/error/ClientAuthError.d.ts +238 -0
- package/lib/types/error/ClientAuthError.d.ts.map +1 -0
- package/lib/types/error/ClientAuthErrorCodes.d.ts +45 -0
- package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -0
- package/lib/types/error/ClientConfigurationError.d.ts +129 -0
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -0
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +23 -0
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -0
- package/lib/types/error/InteractionRequiredAuthError.d.ts +66 -0
- package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -0
- package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts +8 -0
- package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -0
- package/lib/types/error/JoseHeaderError.d.ts +16 -0
- package/lib/types/error/JoseHeaderError.d.ts.map +1 -0
- package/lib/types/error/JoseHeaderErrorCodes.d.ts +3 -0
- package/lib/types/error/JoseHeaderErrorCodes.d.ts.map +1 -0
- package/lib/types/error/ServerError.d.ts +16 -0
- package/lib/types/error/ServerError.d.ts.map +1 -0
- package/lib/types/exports-browser-only.d.ts +10 -0
- package/lib/types/exports-browser-only.d.ts.map +1 -0
- package/lib/types/exports-common.d.ts +80 -0
- package/lib/types/exports-common.d.ts.map +1 -0
- package/lib/types/exports-node-only.d.ts +18 -0
- package/lib/types/exports-node-only.d.ts.map +1 -0
- package/lib/types/index-browser.d.ts +7 -0
- package/lib/types/index-browser.d.ts.map +1 -0
- package/lib/types/index-node.d.ts +7 -0
- package/lib/types/index-node.d.ts.map +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/logger/Logger.d.ts +96 -0
- package/lib/types/logger/Logger.d.ts.map +1 -0
- package/lib/types/network/INetworkModule.d.ts +30 -0
- package/lib/types/network/INetworkModule.d.ts.map +1 -0
- package/lib/types/network/NetworkManager.d.ts +34 -0
- package/lib/types/network/NetworkManager.d.ts.map +1 -0
- package/lib/types/network/RequestThumbprint.d.ts +19 -0
- package/lib/types/network/RequestThumbprint.d.ts.map +1 -0
- package/lib/types/network/ThrottlingUtils.d.ts +43 -0
- package/lib/types/network/ThrottlingUtils.d.ts.map +1 -0
- package/lib/types/packageMetadata.d.ts +3 -0
- package/lib/types/packageMetadata.d.ts.map +1 -0
- package/lib/types/request/AuthenticationHeaderParser.d.ts +20 -0
- package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -0
- package/lib/types/request/BaseAuthRequest.d.ts +48 -0
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -0
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +28 -0
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -0
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +51 -0
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -0
- package/lib/types/request/CommonClientCredentialRequest.d.ts +18 -0
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -0
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +22 -0
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -0
- package/lib/types/request/CommonEndSessionRequest.d.ts +22 -0
- package/lib/types/request/CommonEndSessionRequest.d.ts.map +1 -0
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +14 -0
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -0
- package/lib/types/request/CommonRefreshTokenRequest.d.ts +23 -0
- package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -0
- package/lib/types/request/CommonSilentFlowRequest.d.ts +28 -0
- package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -0
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +18 -0
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -0
- package/lib/types/request/NativeRequest.d.ts +20 -0
- package/lib/types/request/NativeRequest.d.ts.map +1 -0
- package/lib/types/request/NativeSignOutRequest.d.ts +6 -0
- package/lib/types/request/NativeSignOutRequest.d.ts.map +1 -0
- package/lib/types/request/RequestParameterBuilder.d.ts +218 -0
- package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -0
- package/lib/types/request/RequestValidator.d.ts +28 -0
- package/lib/types/request/RequestValidator.d.ts.map +1 -0
- package/lib/types/request/ScopeSet.d.ts +89 -0
- package/lib/types/request/ScopeSet.d.ts.map +1 -0
- package/lib/types/request/StoreInCache.d.ts +9 -0
- package/lib/types/request/StoreInCache.d.ts.map +1 -0
- package/lib/types/response/AuthenticationResult.d.ts +42 -0
- package/lib/types/response/AuthenticationResult.d.ts.map +1 -0
- package/lib/types/response/AuthorizationCodePayload.d.ts +14 -0
- package/lib/types/response/AuthorizationCodePayload.d.ts.map +1 -0
- package/lib/types/response/DeviceCodeResponse.d.ts +26 -0
- package/lib/types/response/DeviceCodeResponse.d.ts.map +1 -0
- package/lib/types/response/ExternalTokenResponse.d.ts +16 -0
- package/lib/types/response/ExternalTokenResponse.d.ts.map +1 -0
- package/lib/types/response/IMDSBadResponse.d.ts +5 -0
- package/lib/types/response/IMDSBadResponse.d.ts.map +1 -0
- package/lib/types/response/ResponseHandler.d.ts +70 -0
- package/lib/types/response/ResponseHandler.d.ts.map +1 -0
- package/lib/types/response/ServerAuthorizationCodeResponse.d.ts +27 -0
- package/lib/types/response/ServerAuthorizationCodeResponse.d.ts.map +1 -0
- package/lib/types/response/ServerAuthorizationTokenResponse.d.ts +48 -0
- package/lib/types/response/ServerAuthorizationTokenResponse.d.ts.map +1 -0
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +58 -0
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
- package/lib/types/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
- package/lib/types/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +243 -0
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -0
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +512 -0
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +25 -0
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +79 -0
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -0
- package/lib/types/telemetry/server/ServerTelemetryRequest.d.ts +9 -0
- package/lib/types/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -0
- package/lib/types/url/IUri.d.ts +13 -0
- package/lib/types/url/IUri.d.ts.map +1 -0
- package/lib/types/url/UrlString.d.ts +49 -0
- package/lib/types/url/UrlString.d.ts.map +1 -0
- package/lib/types/utils/ClientAssertionUtils.d.ts +3 -0
- package/lib/types/utils/ClientAssertionUtils.d.ts.map +1 -0
- package/lib/types/utils/Constants.d.ts +310 -0
- package/lib/types/utils/Constants.d.ts.map +1 -0
- package/lib/types/utils/FunctionWrappers.d.ts +28 -0
- package/lib/types/utils/FunctionWrappers.d.ts.map +1 -0
- package/lib/types/utils/MsalTypes.d.ts +7 -0
- package/lib/types/utils/MsalTypes.d.ts.map +1 -0
- package/lib/types/utils/ProtocolUtils.d.ts +43 -0
- package/lib/types/utils/ProtocolUtils.d.ts.map +1 -0
- package/lib/types/utils/StringUtils.d.ts +41 -0
- package/lib/types/utils/StringUtils.d.ts.map +1 -0
- package/lib/types/utils/TimeUtils.d.ts +26 -0
- package/lib/types/utils/TimeUtils.d.ts.map +1 -0
- package/lib/types/utils/UrlUtils.d.ts +11 -0
- package/lib/types/utils/UrlUtils.d.ts.map +1 -0
- package/node/README.md +1 -0
- package/node/package.json +5 -0
- package/package.json +37 -8
- package/src/account/AccountInfo.ts +1 -1
- package/src/account/AuthToken.ts +2 -2
- package/src/account/ClientInfo.ts +2 -2
- package/src/authority/Authority.ts +26 -26
- package/src/authority/AuthorityFactory.ts +9 -9
- package/src/authority/AuthorityMetadata.ts +7 -7
- package/src/authority/AuthorityOptions.ts +4 -4
- package/src/authority/AzureRegionConfiguration.ts +1 -1
- package/src/authority/CloudInstanceDiscoveryResponse.ts +1 -1
- package/src/authority/OIDCOptions.ts +1 -1
- package/src/authority/RegionDiscovery.ts +10 -10
- package/src/authority/RegionDiscoveryMetadata.ts +1 -1
- package/src/broker/nativeBroker/INativeBrokerPlugin.ts +5 -5
- package/src/cache/CacheManager.ts +28 -28
- package/src/cache/entities/AccessTokenEntity.ts +2 -2
- package/src/cache/entities/AccountEntity.ts +10 -10
- package/src/cache/entities/CacheRecord.ts +5 -5
- package/src/cache/entities/CredentialEntity.ts +1 -1
- package/src/cache/entities/IdTokenEntity.ts +1 -1
- package/src/cache/entities/RefreshTokenEntity.ts +1 -1
- package/src/cache/interface/ICacheManager.ts +12 -12
- package/src/cache/interface/ICachePlugin.ts +1 -1
- package/src/cache/persistence/TokenCacheContext.ts +1 -1
- package/src/cache/utils/CacheHelpers.ts +13 -13
- package/src/cache/utils/CacheTypes.ts +11 -11
- package/src/client/AuthorizationCodeClient.ts +51 -38
- package/src/client/BaseClient.ts +19 -19
- package/src/client/RefreshTokenClient.ts +29 -29
- package/src/client/SilentFlowClient.ts +17 -17
- package/src/config/ClientConfiguration.ts +18 -15
- package/src/crypto/ICrypto.ts +3 -3
- package/src/crypto/JoseHeader.ts +2 -2
- package/src/crypto/PopTokenGenerator.ts +7 -7
- package/src/crypto/SignedHttpRequest.ts +1 -1
- package/src/error/AuthError.ts +2 -2
- package/src/error/CacheError.ts +1 -1
- package/src/error/ClientAuthError.ts +2 -2
- package/src/error/ClientConfigurationError.ts +2 -2
- package/src/error/InteractionRequiredAuthError.ts +3 -3
- package/src/error/JoseHeaderError.ts +2 -2
- package/src/error/ServerError.ts +1 -1
- package/src/exports-browser-only.ts +29 -0
- package/src/exports-common.ts +192 -0
- package/src/exports-node-only.ts +35 -0
- package/src/index-browser.ts +11 -0
- package/src/index-node.ts +11 -0
- package/src/index.ts +7 -250
- package/src/logger/Logger.ts +2 -2
- package/src/network/INetworkModule.ts +2 -2
- package/src/network/NetworkManager.ts +7 -7
- package/src/network/RequestThumbprint.ts +2 -2
- package/src/network/ThrottlingUtils.ts +8 -8
- package/src/packageMetadata.ts +1 -1
- package/src/request/AuthenticationHeaderParser.ts +2 -2
- package/src/request/BaseAuthRequest.ts +5 -5
- package/src/request/CommonAuthorizationCodeRequest.ts +3 -3
- package/src/request/CommonAuthorizationUrlRequest.ts +4 -4
- package/src/request/CommonClientCredentialRequest.ts +3 -3
- package/src/request/CommonDeviceCodeRequest.ts +3 -3
- package/src/request/CommonEndSessionRequest.ts +2 -2
- package/src/request/CommonOnBehalfOfRequest.ts +1 -1
- package/src/request/CommonRefreshTokenRequest.ts +3 -3
- package/src/request/CommonSilentFlowRequest.ts +3 -3
- package/src/request/CommonUsernamePasswordRequest.ts +1 -1
- package/src/request/NativeRequest.ts +1 -1
- package/src/request/RequestParameterBuilder.ts +9 -9
- package/src/request/RequestValidator.ts +2 -2
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ExternalTokenResponse.ts +1 -1
- package/src/response/ResponseHandler.ts +31 -31
- package/src/response/ServerAuthorizationTokenResponse.ts +1 -1
- package/src/telemetry/performance/IPerformanceClient.ts +2 -2
- package/src/telemetry/performance/PerformanceClient.ts +10 -10
- package/src/telemetry/performance/PerformanceEvent.ts +0 -5
- package/src/telemetry/performance/StubPerformanceClient.ts +6 -3
- package/src/telemetry/server/ServerTelemetryManager.ts +6 -6
- package/src/url/UrlString.ts +5 -5
- package/src/utils/ClientAssertionUtils.ts +1 -1
- package/src/utils/FunctionWrappers.ts +2 -2
- package/src/utils/ProtocolUtils.ts +3 -3
- package/src/utils/UrlUtils.ts +2 -2
- package/dist/index.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.15.0 2024-09-20 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -1667,10 +1667,6 @@ const PerformanceEvents = {
|
|
|
1667
1667
|
*/
|
|
1668
1668
|
InitializeSilentRequest: "initializeSilentRequest",
|
|
1669
1669
|
InitializeClientApplication: "initializeClientApplication",
|
|
1670
|
-
/**
|
|
1671
|
-
* Helper function in PopupClient class (msal-browser).
|
|
1672
|
-
*/
|
|
1673
|
-
PopupClientTokenHelper: "popupClientTokenHelper",
|
|
1674
1670
|
/**
|
|
1675
1671
|
* Helper function in SilentIframeClient class (msal-browser).
|
|
1676
1672
|
*/
|
|
@@ -3467,28 +3463,6 @@ var AuthorityFactory = /*#__PURE__*/Object.freeze({
|
|
|
3467
3463
|
createDiscoveredInstance: createDiscoveredInstance
|
|
3468
3464
|
});
|
|
3469
3465
|
|
|
3470
|
-
/*
|
|
3471
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3472
|
-
* Licensed under the MIT License.
|
|
3473
|
-
*/
|
|
3474
|
-
async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
3475
|
-
if (typeof clientAssertion === "string") {
|
|
3476
|
-
return clientAssertion;
|
|
3477
|
-
}
|
|
3478
|
-
else {
|
|
3479
|
-
const config = {
|
|
3480
|
-
clientId: clientId,
|
|
3481
|
-
tokenEndpoint: tokenEndpoint,
|
|
3482
|
-
};
|
|
3483
|
-
return clientAssertion(config);
|
|
3484
|
-
}
|
|
3485
|
-
}
|
|
3486
|
-
|
|
3487
|
-
var ClientAssertionUtils = /*#__PURE__*/Object.freeze({
|
|
3488
|
-
__proto__: null,
|
|
3489
|
-
getClientAssertion: getClientAssertion
|
|
3490
|
-
});
|
|
3491
|
-
|
|
3492
3466
|
/*
|
|
3493
3467
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3494
3468
|
* Licensed under the MIT License.
|
|
@@ -3832,7 +3806,7 @@ class Logger {
|
|
|
3832
3806
|
|
|
3833
3807
|
/* eslint-disable header/header */
|
|
3834
3808
|
const name = "@azure/msal-common";
|
|
3835
|
-
const version = "14.
|
|
3809
|
+
const version = "14.15.0";
|
|
3836
3810
|
|
|
3837
3811
|
/*
|
|
3838
3812
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5783,6 +5757,7 @@ function buildAuthOptions(authOptions) {
|
|
|
5783
5757
|
clientCapabilities: [],
|
|
5784
5758
|
azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,
|
|
5785
5759
|
skipAuthorityMetadataCache: false,
|
|
5760
|
+
instanceAware: false,
|
|
5786
5761
|
...authOptions,
|
|
5787
5762
|
};
|
|
5788
5763
|
}
|
|
@@ -7164,6 +7139,28 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
7164
7139
|
return baseAccount;
|
|
7165
7140
|
}
|
|
7166
7141
|
|
|
7142
|
+
/*
|
|
7143
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7144
|
+
* Licensed under the MIT License.
|
|
7145
|
+
*/
|
|
7146
|
+
async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
7147
|
+
if (typeof clientAssertion === "string") {
|
|
7148
|
+
return clientAssertion;
|
|
7149
|
+
}
|
|
7150
|
+
else {
|
|
7151
|
+
const config = {
|
|
7152
|
+
clientId: clientId,
|
|
7153
|
+
tokenEndpoint: tokenEndpoint,
|
|
7154
|
+
};
|
|
7155
|
+
return clientAssertion(config);
|
|
7156
|
+
}
|
|
7157
|
+
}
|
|
7158
|
+
|
|
7159
|
+
var ClientAssertionUtils = /*#__PURE__*/Object.freeze({
|
|
7160
|
+
__proto__: null,
|
|
7161
|
+
getClientAssertion: getClientAssertion
|
|
7162
|
+
});
|
|
7163
|
+
|
|
7167
7164
|
/*
|
|
7168
7165
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7169
7166
|
* Licensed under the MIT License.
|
|
@@ -7524,9 +7521,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7524
7521
|
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
7525
7522
|
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
7526
7523
|
}
|
|
7527
|
-
|
|
7528
|
-
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
7529
|
-
}
|
|
7524
|
+
this.addExtraQueryParams(request, parameterBuilder);
|
|
7530
7525
|
if (request.nativeBroker) {
|
|
7531
7526
|
// signal ests that this is a WAM call
|
|
7532
7527
|
parameterBuilder.addNativeBroker();
|
|
@@ -7568,10 +7563,20 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7568
7563
|
if (request.logoutHint) {
|
|
7569
7564
|
parameterBuilder.addLogoutHint(request.logoutHint);
|
|
7570
7565
|
}
|
|
7566
|
+
this.addExtraQueryParams(request, parameterBuilder);
|
|
7567
|
+
return parameterBuilder.createQueryString();
|
|
7568
|
+
}
|
|
7569
|
+
addExtraQueryParams(request, parameterBuilder) {
|
|
7570
|
+
const hasRequestInstanceAware = request.extraQueryParameters &&
|
|
7571
|
+
request.extraQueryParameters.hasOwnProperty("instance_aware");
|
|
7572
|
+
// Set instance_aware flag if config auth param is set
|
|
7573
|
+
if (!hasRequestInstanceAware && this.config.authOptions.instanceAware) {
|
|
7574
|
+
request.extraQueryParameters = request.extraQueryParameters || {};
|
|
7575
|
+
request.extraQueryParameters["instance_aware"] = "true";
|
|
7576
|
+
}
|
|
7571
7577
|
if (request.extraQueryParameters) {
|
|
7572
7578
|
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
7573
7579
|
}
|
|
7574
|
-
return parameterBuilder.createQueryString();
|
|
7575
7580
|
}
|
|
7576
7581
|
/**
|
|
7577
7582
|
* Helper to get sid from account. Returns null if idTokenClaims are not present or sid is not present.
|
|
@@ -7944,74 +7949,6 @@ const StubbedNetworkModule = {
|
|
|
7944
7949
|
},
|
|
7945
7950
|
};
|
|
7946
7951
|
|
|
7947
|
-
/*
|
|
7948
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7949
|
-
* Licensed under the MIT License.
|
|
7950
|
-
*/
|
|
7951
|
-
const missingKidError = "missing_kid_error";
|
|
7952
|
-
const missingAlgError = "missing_alg_error";
|
|
7953
|
-
|
|
7954
|
-
/*
|
|
7955
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7956
|
-
* Licensed under the MIT License.
|
|
7957
|
-
*/
|
|
7958
|
-
const JoseHeaderErrorMessages = {
|
|
7959
|
-
[missingKidError]: "The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",
|
|
7960
|
-
[missingAlgError]: "The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided.",
|
|
7961
|
-
};
|
|
7962
|
-
/**
|
|
7963
|
-
* Error thrown when there is an error in the client code running on the browser.
|
|
7964
|
-
*/
|
|
7965
|
-
class JoseHeaderError extends AuthError {
|
|
7966
|
-
constructor(errorCode, errorMessage) {
|
|
7967
|
-
super(errorCode, errorMessage);
|
|
7968
|
-
this.name = "JoseHeaderError";
|
|
7969
|
-
Object.setPrototypeOf(this, JoseHeaderError.prototype);
|
|
7970
|
-
}
|
|
7971
|
-
}
|
|
7972
|
-
/** Returns JoseHeaderError object */
|
|
7973
|
-
function createJoseHeaderError(code) {
|
|
7974
|
-
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
7975
|
-
}
|
|
7976
|
-
|
|
7977
|
-
/*
|
|
7978
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7979
|
-
* Licensed under the MIT License.
|
|
7980
|
-
*/
|
|
7981
|
-
/** @internal */
|
|
7982
|
-
class JoseHeader {
|
|
7983
|
-
constructor(options) {
|
|
7984
|
-
this.typ = options.typ;
|
|
7985
|
-
this.alg = options.alg;
|
|
7986
|
-
this.kid = options.kid;
|
|
7987
|
-
}
|
|
7988
|
-
/**
|
|
7989
|
-
* Builds SignedHttpRequest formatted JOSE Header from the
|
|
7990
|
-
* JOSE Header options provided or previously set on the object and returns
|
|
7991
|
-
* the stringified header object.
|
|
7992
|
-
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
|
|
7993
|
-
* @param shrHeaderOptions
|
|
7994
|
-
* @returns
|
|
7995
|
-
*/
|
|
7996
|
-
static getShrHeaderString(shrHeaderOptions) {
|
|
7997
|
-
// KeyID is required on the SHR header
|
|
7998
|
-
if (!shrHeaderOptions.kid) {
|
|
7999
|
-
throw createJoseHeaderError(missingKidError);
|
|
8000
|
-
}
|
|
8001
|
-
// Alg is required on the SHR header
|
|
8002
|
-
if (!shrHeaderOptions.alg) {
|
|
8003
|
-
throw createJoseHeaderError(missingAlgError);
|
|
8004
|
-
}
|
|
8005
|
-
const shrHeader = new JoseHeader({
|
|
8006
|
-
// Access Token PoP headers must have type pop, but the type header can be overriden for special cases
|
|
8007
|
-
typ: shrHeaderOptions.typ || JsonWebTokenTypes.Pop,
|
|
8008
|
-
kid: shrHeaderOptions.kid,
|
|
8009
|
-
alg: shrHeaderOptions.alg,
|
|
8010
|
-
});
|
|
8011
|
-
return JSON.stringify(shrHeader);
|
|
8012
|
-
}
|
|
8013
|
-
}
|
|
8014
|
-
|
|
8015
7952
|
/*
|
|
8016
7953
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8017
7954
|
* Licensed under the MIT License.
|
|
@@ -8329,671 +8266,6 @@ class ServerTelemetryManager {
|
|
|
8329
8266
|
}
|
|
8330
8267
|
}
|
|
8331
8268
|
|
|
8332
|
-
/*
|
|
8333
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8334
|
-
* Licensed under the MIT License.
|
|
8335
|
-
*/
|
|
8336
|
-
class StubPerformanceMeasurement {
|
|
8337
|
-
startMeasurement() {
|
|
8338
|
-
return;
|
|
8339
|
-
}
|
|
8340
|
-
endMeasurement() {
|
|
8341
|
-
return;
|
|
8342
|
-
}
|
|
8343
|
-
flushMeasurement() {
|
|
8344
|
-
return null;
|
|
8345
|
-
}
|
|
8346
|
-
}
|
|
8347
|
-
class StubPerformanceClient {
|
|
8348
|
-
generateId() {
|
|
8349
|
-
return "callback-id";
|
|
8350
|
-
}
|
|
8351
|
-
startMeasurement(measureName, correlationId) {
|
|
8352
|
-
return {
|
|
8353
|
-
end: () => null,
|
|
8354
|
-
discard: () => { },
|
|
8355
|
-
add: () => { },
|
|
8356
|
-
increment: () => { },
|
|
8357
|
-
event: {
|
|
8358
|
-
eventId: this.generateId(),
|
|
8359
|
-
status: PerformanceEventStatus.InProgress,
|
|
8360
|
-
authority: "",
|
|
8361
|
-
libraryName: "",
|
|
8362
|
-
libraryVersion: "",
|
|
8363
|
-
clientId: "",
|
|
8364
|
-
name: measureName,
|
|
8365
|
-
startTimeMs: Date.now(),
|
|
8366
|
-
correlationId: correlationId || "",
|
|
8367
|
-
},
|
|
8368
|
-
measurement: new StubPerformanceMeasurement(),
|
|
8369
|
-
};
|
|
8370
|
-
}
|
|
8371
|
-
startPerformanceMeasurement() {
|
|
8372
|
-
return new StubPerformanceMeasurement();
|
|
8373
|
-
}
|
|
8374
|
-
calculateQueuedTime() {
|
|
8375
|
-
return 0;
|
|
8376
|
-
}
|
|
8377
|
-
addQueueMeasurement() {
|
|
8378
|
-
return;
|
|
8379
|
-
}
|
|
8380
|
-
setPreQueueTime() {
|
|
8381
|
-
return;
|
|
8382
|
-
}
|
|
8383
|
-
endMeasurement() {
|
|
8384
|
-
return null;
|
|
8385
|
-
}
|
|
8386
|
-
discardMeasurements() {
|
|
8387
|
-
return;
|
|
8388
|
-
}
|
|
8389
|
-
removePerformanceCallback() {
|
|
8390
|
-
return true;
|
|
8391
|
-
}
|
|
8392
|
-
addPerformanceCallback() {
|
|
8393
|
-
return "";
|
|
8394
|
-
}
|
|
8395
|
-
emitEvents() {
|
|
8396
|
-
return;
|
|
8397
|
-
}
|
|
8398
|
-
addFields() {
|
|
8399
|
-
return;
|
|
8400
|
-
}
|
|
8401
|
-
incrementFields() {
|
|
8402
|
-
return;
|
|
8403
|
-
}
|
|
8404
|
-
cacheEventByCorrelationId() {
|
|
8405
|
-
return;
|
|
8406
|
-
}
|
|
8407
|
-
}
|
|
8408
|
-
|
|
8409
|
-
/*
|
|
8410
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8411
|
-
* Licensed under the MIT License.
|
|
8412
|
-
*/
|
|
8413
|
-
/**
|
|
8414
|
-
* Starts context by adding payload to the stack
|
|
8415
|
-
* @param event {PerformanceEvent}
|
|
8416
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
8417
|
-
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
8418
|
-
*/
|
|
8419
|
-
function startContext(event, abbreviations, stack) {
|
|
8420
|
-
if (!stack) {
|
|
8421
|
-
return;
|
|
8422
|
-
}
|
|
8423
|
-
stack.push({
|
|
8424
|
-
name: abbreviations.get(event.name) || event.name,
|
|
8425
|
-
});
|
|
8426
|
-
}
|
|
8427
|
-
/**
|
|
8428
|
-
* Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
|
|
8429
|
-
*
|
|
8430
|
-
* @param event {PerformanceEvent}
|
|
8431
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
8432
|
-
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
8433
|
-
* @param error {?unknown} error
|
|
8434
|
-
*/
|
|
8435
|
-
function endContext(event, abbreviations, stack, error) {
|
|
8436
|
-
if (!stack?.length) {
|
|
8437
|
-
return;
|
|
8438
|
-
}
|
|
8439
|
-
const peek = (stack) => {
|
|
8440
|
-
return stack.length ? stack[stack.length - 1] : undefined;
|
|
8441
|
-
};
|
|
8442
|
-
const abbrEventName = abbreviations.get(event.name) || event.name;
|
|
8443
|
-
const top = peek(stack);
|
|
8444
|
-
if (top?.name !== abbrEventName) {
|
|
8445
|
-
return;
|
|
8446
|
-
}
|
|
8447
|
-
const current = stack?.pop();
|
|
8448
|
-
if (!current) {
|
|
8449
|
-
return;
|
|
8450
|
-
}
|
|
8451
|
-
const errorCode = error instanceof AuthError
|
|
8452
|
-
? error.errorCode
|
|
8453
|
-
: error instanceof Error
|
|
8454
|
-
? error.name
|
|
8455
|
-
: undefined;
|
|
8456
|
-
const subErr = error instanceof AuthError ? error.subError : undefined;
|
|
8457
|
-
if (errorCode && current.childErr !== errorCode) {
|
|
8458
|
-
current.err = errorCode;
|
|
8459
|
-
if (subErr) {
|
|
8460
|
-
current.subErr = subErr;
|
|
8461
|
-
}
|
|
8462
|
-
}
|
|
8463
|
-
delete current.name;
|
|
8464
|
-
delete current.childErr;
|
|
8465
|
-
const context = {
|
|
8466
|
-
...current,
|
|
8467
|
-
dur: event.durationMs,
|
|
8468
|
-
};
|
|
8469
|
-
if (!event.success) {
|
|
8470
|
-
context.fail = 1;
|
|
8471
|
-
}
|
|
8472
|
-
const parent = peek(stack);
|
|
8473
|
-
if (!parent) {
|
|
8474
|
-
return { [abbrEventName]: context };
|
|
8475
|
-
}
|
|
8476
|
-
if (errorCode) {
|
|
8477
|
-
parent.childErr = errorCode;
|
|
8478
|
-
}
|
|
8479
|
-
let childName;
|
|
8480
|
-
if (!parent[abbrEventName]) {
|
|
8481
|
-
childName = abbrEventName;
|
|
8482
|
-
}
|
|
8483
|
-
else {
|
|
8484
|
-
const siblings = Object.keys(parent).filter((key) => key.startsWith(abbrEventName)).length;
|
|
8485
|
-
childName = `${abbrEventName}_${siblings + 1}`;
|
|
8486
|
-
}
|
|
8487
|
-
parent[childName] = context;
|
|
8488
|
-
return parent;
|
|
8489
|
-
}
|
|
8490
|
-
/**
|
|
8491
|
-
* Adds error name and stack trace to the telemetry event
|
|
8492
|
-
* @param error {Error}
|
|
8493
|
-
* @param logger {Logger}
|
|
8494
|
-
* @param event {PerformanceEvent}
|
|
8495
|
-
* @param stackMaxSize {number} max error stack size to capture
|
|
8496
|
-
*/
|
|
8497
|
-
function addError(error, logger, event, stackMaxSize = 5) {
|
|
8498
|
-
if (!(error instanceof Error)) {
|
|
8499
|
-
logger.trace("PerformanceClient.addErrorStack: Input error is not instance of Error", event.correlationId);
|
|
8500
|
-
return;
|
|
8501
|
-
}
|
|
8502
|
-
else if (error instanceof AuthError) {
|
|
8503
|
-
event.errorCode = error.errorCode;
|
|
8504
|
-
event.subErrorCode = error.subError;
|
|
8505
|
-
if (error instanceof ServerError ||
|
|
8506
|
-
error instanceof InteractionRequiredAuthError) {
|
|
8507
|
-
event.serverErrorNo = error.errorNo;
|
|
8508
|
-
}
|
|
8509
|
-
return;
|
|
8510
|
-
}
|
|
8511
|
-
else if (error instanceof CacheError) {
|
|
8512
|
-
event.errorCode = error.errorCode;
|
|
8513
|
-
return;
|
|
8514
|
-
}
|
|
8515
|
-
else if (event.errorStack?.length) {
|
|
8516
|
-
logger.trace("PerformanceClient.addErrorStack: Stack already exist", event.correlationId);
|
|
8517
|
-
return;
|
|
8518
|
-
}
|
|
8519
|
-
else if (!error.stack?.length) {
|
|
8520
|
-
logger.trace("PerformanceClient.addErrorStack: Input stack is empty", event.correlationId);
|
|
8521
|
-
return;
|
|
8522
|
-
}
|
|
8523
|
-
if (error.stack) {
|
|
8524
|
-
event.errorStack = compactStack(error.stack, stackMaxSize);
|
|
8525
|
-
}
|
|
8526
|
-
event.errorName = error.name;
|
|
8527
|
-
}
|
|
8528
|
-
/**
|
|
8529
|
-
* Compacts error stack into array by fetching N first entries
|
|
8530
|
-
* @param stack {string} error stack
|
|
8531
|
-
* @param stackMaxSize {number} max error stack size to capture
|
|
8532
|
-
* @returns {string[]}
|
|
8533
|
-
*/
|
|
8534
|
-
function compactStack(stack, stackMaxSize) {
|
|
8535
|
-
if (stackMaxSize < 0) {
|
|
8536
|
-
return [];
|
|
8537
|
-
}
|
|
8538
|
-
const stackArr = stack.split("\n") || [];
|
|
8539
|
-
if (stackArr.length < 2) {
|
|
8540
|
-
return [];
|
|
8541
|
-
}
|
|
8542
|
-
const res = [];
|
|
8543
|
-
// Get top N stack lines
|
|
8544
|
-
for (
|
|
8545
|
-
// Skip first line as it may contain PII data
|
|
8546
|
-
let ix = Math.max(stackArr.length - stackMaxSize - 1, 1); ix < stackArr.length; ix++) {
|
|
8547
|
-
const line = stackArr[ix];
|
|
8548
|
-
if (res.length >= stackMaxSize) {
|
|
8549
|
-
break;
|
|
8550
|
-
}
|
|
8551
|
-
res.push(compactStackLine(line));
|
|
8552
|
-
}
|
|
8553
|
-
return res;
|
|
8554
|
-
}
|
|
8555
|
-
/**
|
|
8556
|
-
* Compacts error stack line by shortening file path
|
|
8557
|
-
* Example: https://localhost/msal-common/src/authority/Authority.js:100:1 -> Authority.js:100:1
|
|
8558
|
-
* @param line {string} stack line
|
|
8559
|
-
* @returns {string}
|
|
8560
|
-
*/
|
|
8561
|
-
function compactStackLine(line) {
|
|
8562
|
-
const filePathIx = line.lastIndexOf(" ") + 1;
|
|
8563
|
-
if (filePathIx < 1) {
|
|
8564
|
-
return line;
|
|
8565
|
-
}
|
|
8566
|
-
const filePath = line.substring(filePathIx);
|
|
8567
|
-
let fileNameIx = filePath.lastIndexOf("/");
|
|
8568
|
-
fileNameIx = fileNameIx < 0 ? filePath.lastIndexOf("\\") : fileNameIx;
|
|
8569
|
-
if (fileNameIx >= 0) {
|
|
8570
|
-
return (line.substring(0, filePathIx) +
|
|
8571
|
-
"(" +
|
|
8572
|
-
filePath.substring(fileNameIx + 1) +
|
|
8573
|
-
(filePath.charAt(filePath.length - 1) === ")" ? "" : ")")).trimStart();
|
|
8574
|
-
}
|
|
8575
|
-
return line.trimStart();
|
|
8576
|
-
}
|
|
8577
|
-
class PerformanceClient {
|
|
8578
|
-
/**
|
|
8579
|
-
* Creates an instance of PerformanceClient,
|
|
8580
|
-
* an abstract class containing core performance telemetry logic.
|
|
8581
|
-
*
|
|
8582
|
-
* @constructor
|
|
8583
|
-
* @param {string} clientId Client ID of the application
|
|
8584
|
-
* @param {string} authority Authority used by the application
|
|
8585
|
-
* @param {Logger} logger Logger used by the application
|
|
8586
|
-
* @param {string} libraryName Name of the library
|
|
8587
|
-
* @param {string} libraryVersion Version of the library
|
|
8588
|
-
* @param {ApplicationTelemetry} applicationTelemetry application name and version
|
|
8589
|
-
* @param {Set<String>} intFields integer fields to be truncated
|
|
8590
|
-
* @param {Map<string, string>} abbreviations event name abbreviations
|
|
8591
|
-
*/
|
|
8592
|
-
constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, intFields, abbreviations) {
|
|
8593
|
-
this.authority = authority;
|
|
8594
|
-
this.libraryName = libraryName;
|
|
8595
|
-
this.libraryVersion = libraryVersion;
|
|
8596
|
-
this.applicationTelemetry = applicationTelemetry;
|
|
8597
|
-
this.clientId = clientId;
|
|
8598
|
-
this.logger = logger;
|
|
8599
|
-
this.callbacks = new Map();
|
|
8600
|
-
this.eventsByCorrelationId = new Map();
|
|
8601
|
-
this.eventStack = new Map();
|
|
8602
|
-
this.queueMeasurements = new Map();
|
|
8603
|
-
this.preQueueTimeByCorrelationId = new Map();
|
|
8604
|
-
this.intFields = intFields || new Set();
|
|
8605
|
-
for (const item of IntFields) {
|
|
8606
|
-
this.intFields.add(item);
|
|
8607
|
-
}
|
|
8608
|
-
this.abbreviations = abbreviations || new Map();
|
|
8609
|
-
for (const [key, value] of PerformanceEventAbbreviations) {
|
|
8610
|
-
this.abbreviations.set(key, value);
|
|
8611
|
-
}
|
|
8612
|
-
}
|
|
8613
|
-
/**
|
|
8614
|
-
* Starts and returns an platform-specific implementation of IPerformanceMeasurement.
|
|
8615
|
-
* Note: this function can be changed to abstract at the next major version bump.
|
|
8616
|
-
*
|
|
8617
|
-
* @param {string} measureName
|
|
8618
|
-
* @param {string} correlationId
|
|
8619
|
-
* @returns {IPerformanceMeasurement}
|
|
8620
|
-
* @deprecated This method will be removed in the next major version
|
|
8621
|
-
*/
|
|
8622
|
-
startPerformanceMeasurement(measureName, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8623
|
-
correlationId // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8624
|
-
) {
|
|
8625
|
-
return {};
|
|
8626
|
-
}
|
|
8627
|
-
/**
|
|
8628
|
-
* Gets map of pre-queue times by correlation Id
|
|
8629
|
-
*
|
|
8630
|
-
* @param {PerformanceEvents} eventName
|
|
8631
|
-
* @param {string} correlationId
|
|
8632
|
-
* @returns {number}
|
|
8633
|
-
*/
|
|
8634
|
-
getPreQueueTime(eventName, correlationId) {
|
|
8635
|
-
const preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);
|
|
8636
|
-
if (!preQueueEvent) {
|
|
8637
|
-
this.logger.trace(`PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: ${correlationId}, unable to add queue measurement`);
|
|
8638
|
-
return;
|
|
8639
|
-
}
|
|
8640
|
-
else if (preQueueEvent.name !== eventName) {
|
|
8641
|
-
this.logger.trace(`PerformanceClient.getPreQueueTime: no pre-queue time found for ${eventName}, unable to add queue measurement`);
|
|
8642
|
-
return;
|
|
8643
|
-
}
|
|
8644
|
-
return preQueueEvent.time;
|
|
8645
|
-
}
|
|
8646
|
-
/**
|
|
8647
|
-
* Calculates the difference between current time and time when function was queued.
|
|
8648
|
-
* Note: It is possible to have 0 as the queue time if the current time and the queued time was the same.
|
|
8649
|
-
*
|
|
8650
|
-
* @param {number} preQueueTime
|
|
8651
|
-
* @param {number} currentTime
|
|
8652
|
-
* @returns {number}
|
|
8653
|
-
*/
|
|
8654
|
-
calculateQueuedTime(preQueueTime, currentTime) {
|
|
8655
|
-
if (preQueueTime < 1) {
|
|
8656
|
-
this.logger.trace(`PerformanceClient: preQueueTime should be a positive integer and not ${preQueueTime}`);
|
|
8657
|
-
return 0;
|
|
8658
|
-
}
|
|
8659
|
-
if (currentTime < 1) {
|
|
8660
|
-
this.logger.trace(`PerformanceClient: currentTime should be a positive integer and not ${currentTime}`);
|
|
8661
|
-
return 0;
|
|
8662
|
-
}
|
|
8663
|
-
if (currentTime < preQueueTime) {
|
|
8664
|
-
this.logger.trace("PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved");
|
|
8665
|
-
return 0;
|
|
8666
|
-
}
|
|
8667
|
-
return currentTime - preQueueTime;
|
|
8668
|
-
}
|
|
8669
|
-
/**
|
|
8670
|
-
* Adds queue measurement time to QueueMeasurements array for given correlation ID.
|
|
8671
|
-
*
|
|
8672
|
-
* @param {PerformanceEvents} eventName
|
|
8673
|
-
* @param {?string} correlationId
|
|
8674
|
-
* @param {?number} queueTime
|
|
8675
|
-
* @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
|
|
8676
|
-
* @returns
|
|
8677
|
-
*/
|
|
8678
|
-
addQueueMeasurement(eventName, correlationId, queueTime, manuallyCompleted) {
|
|
8679
|
-
if (!correlationId) {
|
|
8680
|
-
this.logger.trace(`PerformanceClient.addQueueMeasurement: correlationId not provided for ${eventName}, cannot add queue measurement`);
|
|
8681
|
-
return;
|
|
8682
|
-
}
|
|
8683
|
-
if (queueTime === 0) {
|
|
8684
|
-
// Possible for there to be no queue time after calculation
|
|
8685
|
-
this.logger.trace(`PerformanceClient.addQueueMeasurement: queue time provided for ${eventName} is ${queueTime}`);
|
|
8686
|
-
}
|
|
8687
|
-
else if (!queueTime) {
|
|
8688
|
-
this.logger.trace(`PerformanceClient.addQueueMeasurement: no queue time provided for ${eventName}`);
|
|
8689
|
-
return;
|
|
8690
|
-
}
|
|
8691
|
-
const queueMeasurement = {
|
|
8692
|
-
eventName,
|
|
8693
|
-
// Always default queue time to 0 for manually completed (improperly instrumented)
|
|
8694
|
-
queueTime: manuallyCompleted ? 0 : queueTime,
|
|
8695
|
-
manuallyCompleted,
|
|
8696
|
-
};
|
|
8697
|
-
// Adds to existing correlation Id if present in queueMeasurements
|
|
8698
|
-
const existingMeasurements = this.queueMeasurements.get(correlationId);
|
|
8699
|
-
if (existingMeasurements) {
|
|
8700
|
-
existingMeasurements.push(queueMeasurement);
|
|
8701
|
-
this.queueMeasurements.set(correlationId, existingMeasurements);
|
|
8702
|
-
}
|
|
8703
|
-
else {
|
|
8704
|
-
// Sets new correlation Id if not present in queueMeasurements
|
|
8705
|
-
this.logger.trace(`PerformanceClient.addQueueMeasurement: adding correlationId ${correlationId} to queue measurements`);
|
|
8706
|
-
const measurementArray = [queueMeasurement];
|
|
8707
|
-
this.queueMeasurements.set(correlationId, measurementArray);
|
|
8708
|
-
}
|
|
8709
|
-
// Delete processed pre-queue event.
|
|
8710
|
-
this.preQueueTimeByCorrelationId.delete(correlationId);
|
|
8711
|
-
}
|
|
8712
|
-
/**
|
|
8713
|
-
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
|
|
8714
|
-
*
|
|
8715
|
-
* @param {PerformanceEvents} measureName
|
|
8716
|
-
* @param {?string} [correlationId]
|
|
8717
|
-
* @returns {InProgressPerformanceEvent}
|
|
8718
|
-
*/
|
|
8719
|
-
startMeasurement(measureName, correlationId) {
|
|
8720
|
-
// Generate a placeholder correlation if the request does not provide one
|
|
8721
|
-
const eventCorrelationId = correlationId || this.generateId();
|
|
8722
|
-
if (!correlationId) {
|
|
8723
|
-
this.logger.info(`PerformanceClient: No correlation id provided for ${measureName}, generating`, eventCorrelationId);
|
|
8724
|
-
}
|
|
8725
|
-
this.logger.trace(`PerformanceClient: Performance measurement started for ${measureName}`, eventCorrelationId);
|
|
8726
|
-
const inProgressEvent = {
|
|
8727
|
-
eventId: this.generateId(),
|
|
8728
|
-
status: PerformanceEventStatus.InProgress,
|
|
8729
|
-
authority: this.authority,
|
|
8730
|
-
libraryName: this.libraryName,
|
|
8731
|
-
libraryVersion: this.libraryVersion,
|
|
8732
|
-
clientId: this.clientId,
|
|
8733
|
-
name: measureName,
|
|
8734
|
-
startTimeMs: Date.now(),
|
|
8735
|
-
correlationId: eventCorrelationId,
|
|
8736
|
-
appName: this.applicationTelemetry?.appName,
|
|
8737
|
-
appVersion: this.applicationTelemetry?.appVersion,
|
|
8738
|
-
};
|
|
8739
|
-
// Store in progress events so they can be discarded if not ended properly
|
|
8740
|
-
this.cacheEventByCorrelationId(inProgressEvent);
|
|
8741
|
-
startContext(inProgressEvent, this.abbreviations, this.eventStack.get(eventCorrelationId));
|
|
8742
|
-
// Return the event and functions the caller can use to properly end/flush the measurement
|
|
8743
|
-
return {
|
|
8744
|
-
end: (event, error) => {
|
|
8745
|
-
return this.endMeasurement({
|
|
8746
|
-
// Initial set of event properties
|
|
8747
|
-
...inProgressEvent,
|
|
8748
|
-
// Properties set when event ends
|
|
8749
|
-
...event,
|
|
8750
|
-
}, error);
|
|
8751
|
-
},
|
|
8752
|
-
discard: () => {
|
|
8753
|
-
return this.discardMeasurements(inProgressEvent.correlationId);
|
|
8754
|
-
},
|
|
8755
|
-
add: (fields) => {
|
|
8756
|
-
return this.addFields(fields, inProgressEvent.correlationId);
|
|
8757
|
-
},
|
|
8758
|
-
increment: (fields) => {
|
|
8759
|
-
return this.incrementFields(fields, inProgressEvent.correlationId);
|
|
8760
|
-
},
|
|
8761
|
-
event: inProgressEvent,
|
|
8762
|
-
measurement: new StubPerformanceMeasurement(),
|
|
8763
|
-
};
|
|
8764
|
-
}
|
|
8765
|
-
/**
|
|
8766
|
-
* Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,
|
|
8767
|
-
* as consumers should instead use the function returned by startMeasurement.
|
|
8768
|
-
* Adds a new field named as "[event name]DurationMs" for sub-measurements, completes and emits an event
|
|
8769
|
-
* otherwise.
|
|
8770
|
-
*
|
|
8771
|
-
* @param {PerformanceEvent} event
|
|
8772
|
-
* @param {unknown} error
|
|
8773
|
-
* @returns {(PerformanceEvent | null)}
|
|
8774
|
-
*/
|
|
8775
|
-
endMeasurement(event, error) {
|
|
8776
|
-
const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
|
|
8777
|
-
if (!rootEvent) {
|
|
8778
|
-
this.logger.trace(`PerformanceClient: Measurement not found for ${event.eventId}`, event.correlationId);
|
|
8779
|
-
return null;
|
|
8780
|
-
}
|
|
8781
|
-
const isRoot = event.eventId === rootEvent.eventId;
|
|
8782
|
-
let queueInfo = {
|
|
8783
|
-
totalQueueTime: 0,
|
|
8784
|
-
totalQueueCount: 0,
|
|
8785
|
-
manuallyCompletedCount: 0,
|
|
8786
|
-
};
|
|
8787
|
-
event.durationMs = Math.round(event.durationMs || this.getDurationMs(event.startTimeMs));
|
|
8788
|
-
const context = JSON.stringify(endContext(event, this.abbreviations, this.eventStack.get(rootEvent.correlationId), error));
|
|
8789
|
-
if (isRoot) {
|
|
8790
|
-
queueInfo = this.getQueueInfo(event.correlationId);
|
|
8791
|
-
this.discardMeasurements(rootEvent.correlationId);
|
|
8792
|
-
}
|
|
8793
|
-
else {
|
|
8794
|
-
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
8795
|
-
}
|
|
8796
|
-
this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`, event.correlationId);
|
|
8797
|
-
// Add sub-measurement attribute to root event.
|
|
8798
|
-
if (!isRoot) {
|
|
8799
|
-
rootEvent[event.name + "DurationMs"] = Math.floor(event.durationMs);
|
|
8800
|
-
return { ...rootEvent };
|
|
8801
|
-
}
|
|
8802
|
-
if (error) {
|
|
8803
|
-
addError(error, this.logger, rootEvent);
|
|
8804
|
-
}
|
|
8805
|
-
let finalEvent = { ...rootEvent, ...event };
|
|
8806
|
-
let incompleteSubsCount = 0;
|
|
8807
|
-
// Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.
|
|
8808
|
-
finalEvent.incompleteSubMeasurements?.forEach((subMeasurement) => {
|
|
8809
|
-
this.logger.trace(`PerformanceClient: Incomplete submeasurement ${subMeasurement.name} found for ${event.name}`, finalEvent.correlationId);
|
|
8810
|
-
incompleteSubsCount++;
|
|
8811
|
-
});
|
|
8812
|
-
finalEvent.incompleteSubMeasurements = undefined;
|
|
8813
|
-
finalEvent = {
|
|
8814
|
-
...finalEvent,
|
|
8815
|
-
queuedTimeMs: queueInfo.totalQueueTime,
|
|
8816
|
-
queuedCount: queueInfo.totalQueueCount,
|
|
8817
|
-
queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount,
|
|
8818
|
-
status: PerformanceEventStatus.Completed,
|
|
8819
|
-
incompleteSubsCount,
|
|
8820
|
-
context,
|
|
8821
|
-
};
|
|
8822
|
-
this.truncateIntegralFields(finalEvent);
|
|
8823
|
-
this.emitEvents([finalEvent], event.correlationId);
|
|
8824
|
-
return finalEvent;
|
|
8825
|
-
}
|
|
8826
|
-
/**
|
|
8827
|
-
* Saves extra information to be emitted when the measurements are flushed
|
|
8828
|
-
* @param fields
|
|
8829
|
-
* @param correlationId
|
|
8830
|
-
*/
|
|
8831
|
-
addFields(fields, correlationId) {
|
|
8832
|
-
this.logger.trace("PerformanceClient: Updating static fields");
|
|
8833
|
-
const event = this.eventsByCorrelationId.get(correlationId);
|
|
8834
|
-
if (event) {
|
|
8835
|
-
this.eventsByCorrelationId.set(correlationId, {
|
|
8836
|
-
...event,
|
|
8837
|
-
...fields,
|
|
8838
|
-
});
|
|
8839
|
-
}
|
|
8840
|
-
else {
|
|
8841
|
-
this.logger.trace("PerformanceClient: Event not found for", correlationId);
|
|
8842
|
-
}
|
|
8843
|
-
}
|
|
8844
|
-
/**
|
|
8845
|
-
* Increment counters to be emitted when the measurements are flushed
|
|
8846
|
-
* @param fields {string[]}
|
|
8847
|
-
* @param correlationId {string} correlation identifier
|
|
8848
|
-
*/
|
|
8849
|
-
incrementFields(fields, correlationId) {
|
|
8850
|
-
this.logger.trace("PerformanceClient: Updating counters");
|
|
8851
|
-
const event = this.eventsByCorrelationId.get(correlationId);
|
|
8852
|
-
if (event) {
|
|
8853
|
-
for (const counter in fields) {
|
|
8854
|
-
if (!event.hasOwnProperty(counter)) {
|
|
8855
|
-
event[counter] = 0;
|
|
8856
|
-
}
|
|
8857
|
-
else if (isNaN(Number(event[counter]))) {
|
|
8858
|
-
return;
|
|
8859
|
-
}
|
|
8860
|
-
event[counter] += fields[counter];
|
|
8861
|
-
}
|
|
8862
|
-
}
|
|
8863
|
-
else {
|
|
8864
|
-
this.logger.trace("PerformanceClient: Event not found for", correlationId);
|
|
8865
|
-
}
|
|
8866
|
-
}
|
|
8867
|
-
/**
|
|
8868
|
-
* Upserts event into event cache.
|
|
8869
|
-
* First key is the correlation id, second key is the event id.
|
|
8870
|
-
* Allows for events to be grouped by correlation id,
|
|
8871
|
-
* and to easily allow for properties on them to be updated.
|
|
8872
|
-
*
|
|
8873
|
-
* @private
|
|
8874
|
-
* @param {PerformanceEvent} event
|
|
8875
|
-
*/
|
|
8876
|
-
cacheEventByCorrelationId(event) {
|
|
8877
|
-
const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
|
|
8878
|
-
if (rootEvent) {
|
|
8879
|
-
this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} added/updated`, event.correlationId);
|
|
8880
|
-
rootEvent.incompleteSubMeasurements =
|
|
8881
|
-
rootEvent.incompleteSubMeasurements || new Map();
|
|
8882
|
-
rootEvent.incompleteSubMeasurements.set(event.eventId, {
|
|
8883
|
-
name: event.name,
|
|
8884
|
-
startTimeMs: event.startTimeMs,
|
|
8885
|
-
});
|
|
8886
|
-
}
|
|
8887
|
-
else {
|
|
8888
|
-
this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} started`, event.correlationId);
|
|
8889
|
-
this.eventsByCorrelationId.set(event.correlationId, { ...event });
|
|
8890
|
-
this.eventStack.set(event.correlationId, []);
|
|
8891
|
-
}
|
|
8892
|
-
}
|
|
8893
|
-
getQueueInfo(correlationId) {
|
|
8894
|
-
const queueMeasurementForCorrelationId = this.queueMeasurements.get(correlationId);
|
|
8895
|
-
if (!queueMeasurementForCorrelationId) {
|
|
8896
|
-
this.logger.trace(`PerformanceClient: no queue measurements found for for correlationId: ${correlationId}`);
|
|
8897
|
-
}
|
|
8898
|
-
let totalQueueTime = 0;
|
|
8899
|
-
let totalQueueCount = 0;
|
|
8900
|
-
let manuallyCompletedCount = 0;
|
|
8901
|
-
queueMeasurementForCorrelationId?.forEach((measurement) => {
|
|
8902
|
-
totalQueueTime += measurement.queueTime;
|
|
8903
|
-
totalQueueCount++;
|
|
8904
|
-
manuallyCompletedCount += measurement.manuallyCompleted ? 1 : 0;
|
|
8905
|
-
});
|
|
8906
|
-
return {
|
|
8907
|
-
totalQueueTime,
|
|
8908
|
-
totalQueueCount,
|
|
8909
|
-
manuallyCompletedCount,
|
|
8910
|
-
};
|
|
8911
|
-
}
|
|
8912
|
-
/**
|
|
8913
|
-
* Removes measurements and aux data for a given correlation id.
|
|
8914
|
-
*
|
|
8915
|
-
* @param {string} correlationId
|
|
8916
|
-
*/
|
|
8917
|
-
discardMeasurements(correlationId) {
|
|
8918
|
-
this.logger.trace("PerformanceClient: Performance measurements discarded", correlationId);
|
|
8919
|
-
this.eventsByCorrelationId.delete(correlationId);
|
|
8920
|
-
this.logger.trace("PerformanceClient: QueueMeasurements discarded", correlationId);
|
|
8921
|
-
this.queueMeasurements.delete(correlationId);
|
|
8922
|
-
this.logger.trace("PerformanceClient: Pre-queue times discarded", correlationId);
|
|
8923
|
-
this.preQueueTimeByCorrelationId.delete(correlationId);
|
|
8924
|
-
this.logger.trace("PerformanceClient: Event stack discarded", correlationId);
|
|
8925
|
-
this.eventStack.delete(correlationId);
|
|
8926
|
-
}
|
|
8927
|
-
/**
|
|
8928
|
-
* Registers a callback function to receive performance events.
|
|
8929
|
-
*
|
|
8930
|
-
* @param {PerformanceCallbackFunction} callback
|
|
8931
|
-
* @returns {string}
|
|
8932
|
-
*/
|
|
8933
|
-
addPerformanceCallback(callback) {
|
|
8934
|
-
for (const [id, cb] of this.callbacks) {
|
|
8935
|
-
if (cb.toString() === callback.toString()) {
|
|
8936
|
-
this.logger.warning(`PerformanceClient: Performance callback is already registered with id: ${id}`);
|
|
8937
|
-
return id;
|
|
8938
|
-
}
|
|
8939
|
-
}
|
|
8940
|
-
const callbackId = this.generateId();
|
|
8941
|
-
this.callbacks.set(callbackId, callback);
|
|
8942
|
-
this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${callbackId}`);
|
|
8943
|
-
return callbackId;
|
|
8944
|
-
}
|
|
8945
|
-
/**
|
|
8946
|
-
* Removes a callback registered with addPerformanceCallback.
|
|
8947
|
-
*
|
|
8948
|
-
* @param {string} callbackId
|
|
8949
|
-
* @returns {boolean}
|
|
8950
|
-
*/
|
|
8951
|
-
removePerformanceCallback(callbackId) {
|
|
8952
|
-
const result = this.callbacks.delete(callbackId);
|
|
8953
|
-
if (result) {
|
|
8954
|
-
this.logger.verbose(`PerformanceClient: Performance callback ${callbackId} removed.`);
|
|
8955
|
-
}
|
|
8956
|
-
else {
|
|
8957
|
-
this.logger.verbose(`PerformanceClient: Performance callback ${callbackId} not removed.`);
|
|
8958
|
-
}
|
|
8959
|
-
return result;
|
|
8960
|
-
}
|
|
8961
|
-
/**
|
|
8962
|
-
* Emits events to all registered callbacks.
|
|
8963
|
-
*
|
|
8964
|
-
* @param {PerformanceEvent[]} events
|
|
8965
|
-
* @param {?string} [correlationId]
|
|
8966
|
-
*/
|
|
8967
|
-
emitEvents(events, correlationId) {
|
|
8968
|
-
this.logger.verbose("PerformanceClient: Emitting performance events", correlationId);
|
|
8969
|
-
this.callbacks.forEach((callback, callbackId) => {
|
|
8970
|
-
this.logger.trace(`PerformanceClient: Emitting event to callback ${callbackId}`, correlationId);
|
|
8971
|
-
callback.apply(null, [events]);
|
|
8972
|
-
});
|
|
8973
|
-
}
|
|
8974
|
-
/**
|
|
8975
|
-
* Enforce truncation of integral fields in performance event.
|
|
8976
|
-
* @param {PerformanceEvent} event performance event to update.
|
|
8977
|
-
*/
|
|
8978
|
-
truncateIntegralFields(event) {
|
|
8979
|
-
this.intFields.forEach((key) => {
|
|
8980
|
-
if (key in event && typeof event[key] === "number") {
|
|
8981
|
-
event[key] = Math.floor(event[key]);
|
|
8982
|
-
}
|
|
8983
|
-
});
|
|
8984
|
-
}
|
|
8985
|
-
/**
|
|
8986
|
-
* Returns event duration in milliseconds
|
|
8987
|
-
* @param startTimeMs {number}
|
|
8988
|
-
* @returns {number}
|
|
8989
|
-
*/
|
|
8990
|
-
getDurationMs(startTimeMs) {
|
|
8991
|
-
const durationMs = Date.now() - startTimeMs;
|
|
8992
|
-
// Handle clock skew
|
|
8993
|
-
return durationMs < 0 ? durationMs : 0;
|
|
8994
|
-
}
|
|
8995
|
-
}
|
|
8996
|
-
|
|
8997
8269
|
exports.AADAuthorityConstants = AADAuthorityConstants;
|
|
8998
8270
|
exports.AADServerParamKeys = AADServerParamKeys;
|
|
8999
8271
|
exports.AccountEntity = AccountEntity;
|
|
@@ -9040,14 +8312,13 @@ exports.IntFields = IntFields;
|
|
|
9040
8312
|
exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
|
|
9041
8313
|
exports.InteractionRequiredAuthErrorCodes = InteractionRequiredAuthErrorCodes;
|
|
9042
8314
|
exports.InteractionRequiredAuthErrorMessage = InteractionRequiredAuthErrorMessage;
|
|
9043
|
-
exports.JoseHeader = JoseHeader;
|
|
9044
8315
|
exports.JsonWebTokenTypes = JsonWebTokenTypes;
|
|
9045
8316
|
exports.Logger = Logger;
|
|
9046
8317
|
exports.NetworkManager = NetworkManager;
|
|
9047
8318
|
exports.OIDC_DEFAULT_SCOPES = OIDC_DEFAULT_SCOPES;
|
|
9048
8319
|
exports.ONE_DAY_IN_MS = ONE_DAY_IN_MS;
|
|
9049
8320
|
exports.PasswordGrantConstants = PasswordGrantConstants;
|
|
9050
|
-
exports.
|
|
8321
|
+
exports.PerformanceEventAbbreviations = PerformanceEventAbbreviations;
|
|
9051
8322
|
exports.PerformanceEventStatus = PerformanceEventStatus;
|
|
9052
8323
|
exports.PerformanceEvents = PerformanceEvents;
|
|
9053
8324
|
exports.PersistentCacheKeys = PersistentCacheKeys;
|
|
@@ -9065,7 +8336,6 @@ exports.ServerResponseType = ServerResponseType;
|
|
|
9065
8336
|
exports.ServerTelemetryManager = ServerTelemetryManager;
|
|
9066
8337
|
exports.SilentFlowClient = SilentFlowClient;
|
|
9067
8338
|
exports.StringUtils = StringUtils;
|
|
9068
|
-
exports.StubPerformanceClient = StubPerformanceClient;
|
|
9069
8339
|
exports.StubbedNetworkModule = StubbedNetworkModule;
|
|
9070
8340
|
exports.THE_FAMILY_ID = THE_FAMILY_ID;
|
|
9071
8341
|
exports.ThrottlingConstants = ThrottlingConstants;
|
|
@@ -9091,4 +8361,4 @@ exports.invokeAsync = invokeAsync;
|
|
|
9091
8361
|
exports.tenantIdMatchesHomeTenant = tenantIdMatchesHomeTenant;
|
|
9092
8362
|
exports.updateAccountTenantProfileData = updateAccountTenantProfileData;
|
|
9093
8363
|
exports.version = version;
|
|
9094
|
-
//# sourceMappingURL=index.
|
|
8364
|
+
//# sourceMappingURL=index-node-aee3f7b6.js.map
|