@azure/msal-common 15.13.3 → 16.0.0-beta.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/dist/account/AccountInfo.d.ts +0 -1
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AccountInfo.mjs.map +1 -1
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.mjs +2 -3
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +4 -6
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.d.ts +2 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +89 -105
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +6 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +8 -5
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +2 -2
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +34 -31
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +0 -1
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OIDCOptions.d.ts +2 -2
- 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 +3 -3
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +14 -15
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +26 -19
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +70 -83
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +4 -56
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +0 -2
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +35 -17
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +53 -0
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/dist/cache/utils/AccountEntityUtils.mjs +192 -0
- package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -0
- package/dist/cache/utils/CacheHelpers.d.ts +2 -2
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +10 -13
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +0 -1
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +23 -4
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +63 -35
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +17 -4
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +51 -37
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +17 -4
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +28 -15
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +2 -22
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +9 -15
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.d.ts +5 -3
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -2
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +3 -5
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +1 -18
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +12 -34
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.d.ts +1 -6
- package/dist/error/CacheError.d.ts.map +1 -1
- package/dist/error/CacheError.mjs +6 -13
- package/dist/error/CacheError.mjs.map +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.d.ts +0 -229
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +3 -240
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +0 -8
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +2 -10
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +0 -128
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +3 -134
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +3 -5
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +1 -19
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +10 -35
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.d.ts +0 -4
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +3 -8
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/PlatformBrokerError.d.ts.map +1 -1
- package/dist/error/PlatformBrokerError.mjs +3 -2
- package/dist/error/PlatformBrokerError.mjs.map +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/exports-browser-only.d.ts +4 -3
- package/dist/exports-browser-only.d.ts.map +1 -1
- package/dist/exports-common.d.ts +11 -8
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +2 -4
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-node.mjs +15 -10
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +17 -11
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +36 -13
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +105 -22
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/RequestThumbprint.mjs +2 -2
- package/dist/network/RequestThumbprint.mjs.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +6 -7
- package/dist/network/ThrottlingUtils.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +1 -2
- package/dist/protocol/Authorize.d.ts.map +1 -1
- package/dist/protocol/Authorize.mjs +14 -14
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/protocol/Token.d.ts +40 -0
- package/dist/protocol/Token.d.ts.map +1 -0
- package/dist/protocol/Token.mjs +129 -0
- package/dist/protocol/Token.mjs.map +1 -0
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +3 -3
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +4 -8
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +2 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +2 -4
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +2 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +2 -1
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +6 -12
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +11 -24
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +5 -5
- package/dist/request/ScopeSet.mjs.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +7 -6
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +41 -43
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +0 -29
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +5 -81
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +24 -170
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +1 -280
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +2 -483
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.d.ts +66 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs +74 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +2 -26
- package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +28 -30
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts +0 -5
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +5 -13
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.d.ts +81 -112
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -127
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts +2 -2
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +19 -20
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.d.ts +14 -35
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +57 -61
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StateTypes.d.ts +15 -0
- package/dist/utils/StateTypes.d.ts.map +1 -0
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.d.ts +1 -2
- package/dist/utils/UrlUtils.d.ts.map +1 -1
- package/dist/utils/UrlUtils.mjs +3 -10
- package/dist/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +26 -206
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-4Jss3kYh.js → index-node-B7mR4APO.js} +3494 -4270
- package/lib/index-node-B7mR4APO.js.map +1 -0
- package/lib/index-node.cjs +6 -34
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +5 -34
- package/lib/index.cjs.map +1 -1
- package/lib/types/account/AccountInfo.d.ts +0 -1
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/AuthToken.d.ts.map +1 -1
- package/lib/types/account/ClientInfo.d.ts.map +1 -1
- package/lib/types/authority/Authority.d.ts +2 -2
- package/lib/types/authority/Authority.d.ts.map +1 -1
- package/lib/types/authority/AuthorityFactory.d.ts +6 -2
- package/lib/types/authority/AuthorityFactory.d.ts.map +1 -1
- package/lib/types/authority/AuthorityMetadata.d.ts +2 -2
- package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/lib/types/authority/AuthorityOptions.d.ts +0 -1
- package/lib/types/authority/AuthorityOptions.d.ts.map +1 -1
- package/lib/types/authority/OIDCOptions.d.ts +2 -2
- package/lib/types/authority/OIDCOptions.d.ts.map +1 -1
- package/lib/types/authority/RegionDiscovery.d.ts +3 -3
- package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
- package/lib/types/cache/CacheManager.d.ts +26 -19
- package/lib/types/cache/CacheManager.d.ts.map +1 -1
- package/lib/types/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/AccountEntity.d.ts +4 -56
- package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/CredentialEntity.d.ts +0 -2
- package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/lib/types/cache/interface/ICacheManager.d.ts +35 -17
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +53 -0
- package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/lib/types/cache/utils/CacheHelpers.d.ts +2 -2
- package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/lib/types/cache/utils/CacheTypes.d.ts +0 -1
- package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts +23 -4
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +17 -4
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +17 -4
- package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
- package/lib/types/config/ClientConfiguration.d.ts +2 -22
- package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
- package/lib/types/crypto/ICrypto.d.ts +5 -3
- package/lib/types/crypto/ICrypto.d.ts.map +1 -1
- package/lib/types/crypto/PopTokenGenerator.d.ts +2 -2
- package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/lib/types/error/AuthError.d.ts +1 -18
- package/lib/types/error/AuthError.d.ts.map +1 -1
- package/lib/types/error/CacheError.d.ts +1 -6
- package/lib/types/error/CacheError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthError.d.ts +0 -229
- package/lib/types/error/ClientAuthError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthErrorCodes.d.ts +0 -8
- package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationError.d.ts +0 -128
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/error/InteractionRequiredAuthError.d.ts +1 -19
- package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/lib/types/error/JoseHeaderError.d.ts +0 -4
- package/lib/types/error/JoseHeaderError.d.ts.map +1 -1
- package/lib/types/error/PlatformBrokerError.d.ts.map +1 -1
- package/lib/types/exports-browser-only.d.ts +4 -3
- package/lib/types/exports-browser-only.d.ts.map +1 -1
- package/lib/types/exports-common.d.ts +11 -8
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +2 -4
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +36 -13
- package/lib/types/logger/Logger.d.ts.map +1 -1
- package/lib/types/network/ThrottlingUtils.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/protocol/Authorize.d.ts +1 -2
- package/lib/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/types/protocol/Token.d.ts +40 -0
- package/lib/types/protocol/Token.d.ts.map +1 -0
- package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/lib/types/request/BaseAuthRequest.d.ts +4 -8
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +2 -1
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +2 -4
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/lib/types/request/CommonRefreshTokenRequest.d.ts +2 -1
- package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/lib/types/request/CommonSilentFlowRequest.d.ts +2 -1
- package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +6 -12
- package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
- package/lib/types/response/AuthenticationResult.d.ts +1 -1
- package/lib/types/response/AuthenticationResult.d.ts.map +1 -1
- package/lib/types/response/ResponseHandler.d.ts +7 -6
- package/lib/types/response/ResponseHandler.d.ts.map +1 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +0 -29
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +5 -81
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +1 -280
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +66 -0
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/lib/types/url/UrlString.d.ts +0 -5
- package/lib/types/url/UrlString.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +81 -112
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/FunctionWrappers.d.ts +2 -2
- package/lib/types/utils/FunctionWrappers.d.ts.map +1 -1
- package/lib/types/utils/ProtocolUtils.d.ts +14 -35
- package/lib/types/utils/ProtocolUtils.d.ts.map +1 -1
- package/lib/types/utils/StateTypes.d.ts +15 -0
- package/lib/types/utils/StateTypes.d.ts.map +1 -0
- package/lib/types/utils/UrlUtils.d.ts +1 -2
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/account/AccountInfo.ts +0 -1
- package/src/account/AuthToken.ts +1 -2
- package/src/account/ClientInfo.ts +3 -6
- package/src/authority/Authority.ts +145 -146
- package/src/authority/AuthorityFactory.ts +7 -7
- package/src/authority/AuthorityMetadata.ts +54 -47
- package/src/authority/AuthorityOptions.ts +0 -1
- package/src/authority/OIDCOptions.ts +2 -2
- package/src/authority/RegionDiscovery.ts +20 -33
- package/src/cache/CacheManager.ts +177 -128
- package/src/cache/entities/AccessTokenEntity.ts +0 -4
- package/src/cache/entities/AccountEntity.ts +4 -292
- package/src/cache/entities/CredentialEntity.ts +0 -2
- package/src/cache/interface/ICacheManager.ts +55 -20
- package/src/cache/utils/AccountEntityUtils.ts +258 -0
- package/src/cache/utils/CacheHelpers.ts +23 -37
- package/src/cache/utils/CacheTypes.ts +0 -1
- package/src/client/AuthorizationCodeClient.ts +146 -58
- package/src/client/RefreshTokenClient.ts +108 -65
- package/src/client/SilentFlowClient.ts +74 -25
- package/src/config/ClientConfiguration.ts +9 -37
- package/src/crypto/ICrypto.ts +5 -3
- package/src/crypto/PopTokenGenerator.ts +3 -13
- package/src/error/AuthError.ts +11 -30
- package/src/error/CacheError.ts +4 -15
- package/src/error/ClientAuthError.ts +1 -317
- package/src/error/ClientAuthErrorCodes.ts +0 -8
- package/src/error/ClientConfigurationError.ts +1 -202
- package/src/error/ClientConfigurationErrorCodes.ts +0 -4
- package/src/error/InteractionRequiredAuthError.ts +8 -48
- package/src/error/JoseHeaderError.ts +1 -8
- package/src/error/PlatformBrokerError.ts +2 -1
- package/src/exports-browser-only.ts +2 -6
- package/src/exports-common.ts +8 -40
- package/src/exports-node-only.ts +5 -4
- package/src/logger/Logger.ts +174 -39
- package/src/network/RequestThumbprint.ts +1 -1
- package/src/network/ThrottlingUtils.ts +12 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +24 -20
- package/src/protocol/Token.ts +230 -0
- package/src/request/AuthenticationHeaderParser.ts +2 -4
- package/src/request/BaseAuthRequest.ts +4 -8
- package/src/request/CommonAuthorizationCodeRequest.ts +2 -1
- package/src/request/CommonAuthorizationUrlRequest.ts +2 -4
- package/src/request/CommonRefreshTokenRequest.ts +2 -1
- package/src/request/CommonSilentFlowRequest.ts +2 -1
- package/src/request/RequestParameterBuilder.ts +35 -50
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ResponseHandler.ts +56 -60
- package/src/telemetry/performance/IPerformanceClient.ts +0 -40
- package/src/telemetry/performance/PerformanceClient.ts +26 -295
- package/src/telemetry/performance/PerformanceEvent.ts +3 -582
- package/src/telemetry/performance/PerformanceEvents.ts +98 -0
- package/src/telemetry/performance/StubPerformanceClient.ts +0 -16
- package/src/telemetry/server/ServerTelemetryManager.ts +33 -44
- package/src/url/UrlString.ts +3 -12
- package/src/utils/Constants.ts +103 -140
- package/src/utils/FunctionWrappers.ts +28 -29
- package/src/utils/ProtocolUtils.ts +67 -93
- package/src/utils/StateTypes.ts +20 -0
- package/src/utils/UrlUtils.ts +2 -15
- package/dist/cache/entities/AccountEntity.mjs +0 -232
- package/dist/cache/entities/AccountEntity.mjs.map +0 -1
- package/dist/client/BaseClient.d.ts +0 -59
- package/dist/client/BaseClient.d.ts.map +0 -1
- package/dist/client/BaseClient.mjs +0 -167
- package/dist/client/BaseClient.mjs.map +0 -1
- package/dist/index-browser.mjs +0 -72
- package/dist/index-browser.mjs.map +0 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +0 -18
- package/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/lib/index-node-4Jss3kYh.js.map +0 -1
- package/lib/types/client/BaseClient.d.ts +0 -59
- package/lib/types/client/BaseClient.d.ts.map +0 -1
- package/lib/types/request/CommonClientCredentialRequest.d.ts +0 -18
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/src/client/BaseClient.ts +0 -320
- package/src/request/CommonClientCredentialRequest.ts +0 -23
- package/src/request/CommonDeviceCodeRequest.ts +0 -31
- package/src/request/CommonOnBehalfOfRequest.ts +0 -19
- package/src/request/CommonUsernamePasswordRequest.ts +0 -23
|
@@ -4,44 +4,32 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ApplicationTelemetry } from "../../config/ClientConfiguration.js";
|
|
7
|
-
import { Logger } from "../../logger/Logger.js";
|
|
7
|
+
import { getAndFlushLogsFromCache, Logger } from "../../logger/Logger.js";
|
|
8
8
|
import {
|
|
9
9
|
InProgressPerformanceEvent,
|
|
10
10
|
IPerformanceClient,
|
|
11
11
|
PerformanceCallbackFunction,
|
|
12
|
-
QueueMeasurement,
|
|
13
12
|
} from "./IPerformanceClient.js";
|
|
14
13
|
import {
|
|
15
14
|
IntFields,
|
|
16
15
|
PerformanceEvent,
|
|
17
|
-
PerformanceEventAbbreviations,
|
|
18
16
|
PerformanceEventContext,
|
|
19
|
-
PerformanceEvents,
|
|
20
17
|
PerformanceEventStackedContext,
|
|
21
18
|
PerformanceEventStatus,
|
|
22
19
|
} from "./PerformanceEvent.js";
|
|
23
|
-
import { IPerformanceMeasurement } from "./IPerformanceMeasurement.js";
|
|
24
|
-
import { StubPerformanceMeasurement } from "./StubPerformanceClient.js";
|
|
25
20
|
import { AuthError } from "../../error/AuthError.js";
|
|
26
21
|
import { CacheError } from "../../error/CacheError.js";
|
|
27
22
|
import { ServerError } from "../../error/ServerError.js";
|
|
28
23
|
import { InteractionRequiredAuthError } from "../../error/InteractionRequiredAuthError.js";
|
|
29
24
|
import { AccountInfo } from "../../account/AccountInfo.js";
|
|
30
25
|
|
|
31
|
-
export interface PreQueueEvent {
|
|
32
|
-
name: PerformanceEvents;
|
|
33
|
-
time: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
26
|
/**
|
|
37
27
|
* Starts context by adding payload to the stack
|
|
38
28
|
* @param event {PerformanceEvent}
|
|
39
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
40
29
|
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
41
30
|
*/
|
|
42
31
|
export function startContext(
|
|
43
32
|
event: PerformanceEvent,
|
|
44
|
-
abbreviations: Map<string, string>,
|
|
45
33
|
stack?: PerformanceEventStackedContext[]
|
|
46
34
|
): void {
|
|
47
35
|
if (!stack) {
|
|
@@ -49,7 +37,7 @@ export function startContext(
|
|
|
49
37
|
}
|
|
50
38
|
|
|
51
39
|
stack.push({
|
|
52
|
-
name:
|
|
40
|
+
name: event.name,
|
|
53
41
|
});
|
|
54
42
|
}
|
|
55
43
|
|
|
@@ -57,13 +45,11 @@ export function startContext(
|
|
|
57
45
|
* Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
|
|
58
46
|
*
|
|
59
47
|
* @param event {PerformanceEvent}
|
|
60
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
61
48
|
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
62
49
|
* @param error {?unknown} error
|
|
63
50
|
*/
|
|
64
51
|
export function endContext(
|
|
65
52
|
event: PerformanceEvent,
|
|
66
|
-
abbreviations: Map<string, string>,
|
|
67
53
|
stack?: PerformanceEventStackedContext[],
|
|
68
54
|
error?: unknown
|
|
69
55
|
): PerformanceEventContext | undefined {
|
|
@@ -75,7 +61,7 @@ export function endContext(
|
|
|
75
61
|
return stack.length ? stack[stack.length - 1] : undefined;
|
|
76
62
|
};
|
|
77
63
|
|
|
78
|
-
const abbrEventName =
|
|
64
|
+
const abbrEventName = event.name;
|
|
79
65
|
const top = peek(stack);
|
|
80
66
|
if (top?.name !== abbrEventName) {
|
|
81
67
|
return;
|
|
@@ -297,22 +283,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
297
283
|
*/
|
|
298
284
|
protected eventsByCorrelationId: Map<string, PerformanceEvent>;
|
|
299
285
|
|
|
300
|
-
/**
|
|
301
|
-
* Map of pre-queue times by correlation Id
|
|
302
|
-
*
|
|
303
|
-
* @protected
|
|
304
|
-
* @type {Map<string, PreQueueEvent>}
|
|
305
|
-
*/
|
|
306
|
-
protected preQueueTimeByCorrelationId: Map<string, PreQueueEvent>;
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Map of queue measurements by correlation Id
|
|
310
|
-
*
|
|
311
|
-
* @protected
|
|
312
|
-
* @type {Map<string, Array<QueueMeasurement>>}
|
|
313
|
-
*/
|
|
314
|
-
protected queueMeasurements: Map<string, Array<QueueMeasurement>>;
|
|
315
|
-
|
|
316
286
|
protected intFields: Set<string>;
|
|
317
287
|
|
|
318
288
|
/**
|
|
@@ -322,13 +292,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
322
292
|
*/
|
|
323
293
|
protected eventStack: Map<string, PerformanceEventStackedContext[]>;
|
|
324
294
|
|
|
325
|
-
/**
|
|
326
|
-
* Event name abbreviations
|
|
327
|
-
*
|
|
328
|
-
* @protected
|
|
329
|
-
*/
|
|
330
|
-
protected abbreviations: Map<string, string>;
|
|
331
|
-
|
|
332
295
|
/**
|
|
333
296
|
* Creates an instance of PerformanceClient,
|
|
334
297
|
* an abstract class containing core performance telemetry logic.
|
|
@@ -341,7 +304,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
341
304
|
* @param {string} libraryVersion Version of the library
|
|
342
305
|
* @param {ApplicationTelemetry} applicationTelemetry application name and version
|
|
343
306
|
* @param {Set<String>} intFields integer fields to be truncated
|
|
344
|
-
* @param {Map<string, string>} abbreviations event name abbreviations
|
|
345
307
|
*/
|
|
346
308
|
constructor(
|
|
347
309
|
clientId: string,
|
|
@@ -350,8 +312,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
350
312
|
libraryName: string,
|
|
351
313
|
libraryVersion: string,
|
|
352
314
|
applicationTelemetry: ApplicationTelemetry,
|
|
353
|
-
intFields?: Set<string
|
|
354
|
-
abbreviations?: Map<string, string>
|
|
315
|
+
intFields?: Set<string>
|
|
355
316
|
) {
|
|
356
317
|
this.authority = authority;
|
|
357
318
|
this.libraryName = libraryName;
|
|
@@ -362,16 +323,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
362
323
|
this.callbacks = new Map();
|
|
363
324
|
this.eventsByCorrelationId = new Map();
|
|
364
325
|
this.eventStack = new Map();
|
|
365
|
-
this.queueMeasurements = new Map();
|
|
366
|
-
this.preQueueTimeByCorrelationId = new Map();
|
|
367
326
|
this.intFields = intFields || new Set();
|
|
368
327
|
for (const item of IntFields) {
|
|
369
328
|
this.intFields.add(item);
|
|
370
329
|
}
|
|
371
|
-
this.abbreviations = abbreviations || new Map();
|
|
372
|
-
for (const [key, value] of PerformanceEventAbbreviations) {
|
|
373
|
-
this.abbreviations.set(key, value);
|
|
374
|
-
}
|
|
375
330
|
}
|
|
376
331
|
|
|
377
332
|
/**
|
|
@@ -382,152 +337,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
382
337
|
*/
|
|
383
338
|
abstract generateId(): string;
|
|
384
339
|
|
|
385
|
-
/**
|
|
386
|
-
* Starts and returns an platform-specific implementation of IPerformanceMeasurement.
|
|
387
|
-
* Note: this function can be changed to abstract at the next major version bump.
|
|
388
|
-
*
|
|
389
|
-
* @param {string} measureName
|
|
390
|
-
* @param {string} correlationId
|
|
391
|
-
* @returns {IPerformanceMeasurement}
|
|
392
|
-
* @deprecated This method will be removed in the next major version
|
|
393
|
-
*/
|
|
394
|
-
startPerformanceMeasurement(
|
|
395
|
-
measureName: string, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
396
|
-
correlationId: string // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
397
|
-
): IPerformanceMeasurement {
|
|
398
|
-
return {} as IPerformanceMeasurement;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Sets pre-queue time by correlation Id
|
|
403
|
-
*
|
|
404
|
-
* @abstract
|
|
405
|
-
* @param {PerformanceEvents} eventName
|
|
406
|
-
* @param {string} correlationId
|
|
407
|
-
* @returns
|
|
408
|
-
*/
|
|
409
|
-
abstract setPreQueueTime(
|
|
410
|
-
eventName: PerformanceEvents,
|
|
411
|
-
correlationId?: string
|
|
412
|
-
): void;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Gets map of pre-queue times by correlation Id
|
|
416
|
-
*
|
|
417
|
-
* @param {PerformanceEvents} eventName
|
|
418
|
-
* @param {string} correlationId
|
|
419
|
-
* @returns {number}
|
|
420
|
-
*/
|
|
421
|
-
getPreQueueTime(eventName: string, correlationId: string): number | void {
|
|
422
|
-
const preQueueEvent: PreQueueEvent | undefined =
|
|
423
|
-
this.preQueueTimeByCorrelationId.get(correlationId);
|
|
424
|
-
|
|
425
|
-
if (!preQueueEvent) {
|
|
426
|
-
this.logger.trace(
|
|
427
|
-
`PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: ${correlationId}, unable to add queue measurement`
|
|
428
|
-
);
|
|
429
|
-
return;
|
|
430
|
-
} else if (preQueueEvent.name !== eventName) {
|
|
431
|
-
this.logger.trace(
|
|
432
|
-
`PerformanceClient.getPreQueueTime: no pre-queue time found for ${eventName}, unable to add queue measurement`
|
|
433
|
-
);
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
return preQueueEvent.time;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Calculates the difference between current time and time when function was queued.
|
|
442
|
-
* Note: It is possible to have 0 as the queue time if the current time and the queued time was the same.
|
|
443
|
-
*
|
|
444
|
-
* @param {number} preQueueTime
|
|
445
|
-
* @param {number} currentTime
|
|
446
|
-
* @returns {number}
|
|
447
|
-
*/
|
|
448
|
-
calculateQueuedTime(preQueueTime: number, currentTime: number): number {
|
|
449
|
-
if (preQueueTime < 1) {
|
|
450
|
-
this.logger.trace(
|
|
451
|
-
`PerformanceClient: preQueueTime should be a positive integer and not ${preQueueTime}`
|
|
452
|
-
);
|
|
453
|
-
return 0;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
if (currentTime < 1) {
|
|
457
|
-
this.logger.trace(
|
|
458
|
-
`PerformanceClient: currentTime should be a positive integer and not ${currentTime}`
|
|
459
|
-
);
|
|
460
|
-
return 0;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
if (currentTime < preQueueTime) {
|
|
464
|
-
this.logger.trace(
|
|
465
|
-
"PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved"
|
|
466
|
-
);
|
|
467
|
-
return 0;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
return currentTime - preQueueTime;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
* Adds queue measurement time to QueueMeasurements array for given correlation ID.
|
|
475
|
-
*
|
|
476
|
-
* @param {PerformanceEvents} eventName
|
|
477
|
-
* @param {?string} correlationId
|
|
478
|
-
* @param {?number} queueTime
|
|
479
|
-
* @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
|
|
480
|
-
* @returns
|
|
481
|
-
*/
|
|
482
|
-
addQueueMeasurement(
|
|
483
|
-
eventName: string,
|
|
484
|
-
correlationId?: string,
|
|
485
|
-
queueTime?: number,
|
|
486
|
-
manuallyCompleted?: boolean
|
|
487
|
-
): void {
|
|
488
|
-
if (!correlationId) {
|
|
489
|
-
this.logger.trace(
|
|
490
|
-
`PerformanceClient.addQueueMeasurement: correlationId not provided for ${eventName}, cannot add queue measurement`
|
|
491
|
-
);
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
if (queueTime === 0) {
|
|
496
|
-
// Possible for there to be no queue time after calculation
|
|
497
|
-
this.logger.trace(
|
|
498
|
-
`PerformanceClient.addQueueMeasurement: queue time provided for ${eventName} is ${queueTime}`
|
|
499
|
-
);
|
|
500
|
-
} else if (!queueTime) {
|
|
501
|
-
this.logger.trace(
|
|
502
|
-
`PerformanceClient.addQueueMeasurement: no queue time provided for ${eventName}`
|
|
503
|
-
);
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
const queueMeasurement: QueueMeasurement = {
|
|
508
|
-
eventName,
|
|
509
|
-
// Always default queue time to 0 for manually completed (improperly instrumented)
|
|
510
|
-
queueTime: manuallyCompleted ? 0 : queueTime,
|
|
511
|
-
manuallyCompleted,
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
// Adds to existing correlation Id if present in queueMeasurements
|
|
515
|
-
const existingMeasurements = this.queueMeasurements.get(correlationId);
|
|
516
|
-
if (existingMeasurements) {
|
|
517
|
-
existingMeasurements.push(queueMeasurement);
|
|
518
|
-
this.queueMeasurements.set(correlationId, existingMeasurements);
|
|
519
|
-
} else {
|
|
520
|
-
// Sets new correlation Id if not present in queueMeasurements
|
|
521
|
-
this.logger.trace(
|
|
522
|
-
`PerformanceClient.addQueueMeasurement: adding correlationId ${correlationId} to queue measurements`
|
|
523
|
-
);
|
|
524
|
-
const measurementArray = [queueMeasurement];
|
|
525
|
-
this.queueMeasurements.set(correlationId, measurementArray);
|
|
526
|
-
}
|
|
527
|
-
// Delete processed pre-queue event.
|
|
528
|
-
this.preQueueTimeByCorrelationId.delete(correlationId);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
340
|
/**
|
|
532
341
|
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
|
|
533
342
|
*
|
|
@@ -541,17 +350,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
541
350
|
): InProgressPerformanceEvent {
|
|
542
351
|
// Generate a placeholder correlation if the request does not provide one
|
|
543
352
|
const eventCorrelationId = correlationId || this.generateId();
|
|
544
|
-
if (!correlationId) {
|
|
545
|
-
this.logger.info(
|
|
546
|
-
`PerformanceClient: No correlation id provided for ${measureName}, generating`,
|
|
547
|
-
eventCorrelationId
|
|
548
|
-
);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
this.logger.trace(
|
|
552
|
-
`PerformanceClient: Performance measurement started for ${measureName}`,
|
|
553
|
-
eventCorrelationId
|
|
554
|
-
);
|
|
555
353
|
|
|
556
354
|
const inProgressEvent: PerformanceEvent = {
|
|
557
355
|
eventId: this.generateId(),
|
|
@@ -569,11 +367,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
569
367
|
|
|
570
368
|
// Store in progress events so they can be discarded if not ended properly
|
|
571
369
|
this.cacheEventByCorrelationId(inProgressEvent);
|
|
572
|
-
startContext(
|
|
573
|
-
inProgressEvent,
|
|
574
|
-
this.abbreviations,
|
|
575
|
-
this.eventStack.get(eventCorrelationId)
|
|
576
|
-
);
|
|
370
|
+
startContext(inProgressEvent, this.eventStack.get(eventCorrelationId));
|
|
577
371
|
|
|
578
372
|
// Return the event and functions the caller can use to properly end/flush the measurement
|
|
579
373
|
return {
|
|
@@ -606,7 +400,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
606
400
|
);
|
|
607
401
|
},
|
|
608
402
|
event: inProgressEvent,
|
|
609
|
-
measurement: new StubPerformanceMeasurement(),
|
|
610
403
|
};
|
|
611
404
|
}
|
|
612
405
|
|
|
@@ -630,18 +423,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
630
423
|
this.eventsByCorrelationId.get(event.correlationId);
|
|
631
424
|
if (!rootEvent) {
|
|
632
425
|
this.logger.trace(
|
|
633
|
-
`PerformanceClient: Measurement not found for ${event.eventId}`,
|
|
426
|
+
`PerformanceClient: Measurement not found for '${event.eventId}'`,
|
|
634
427
|
event.correlationId
|
|
635
428
|
);
|
|
636
429
|
return null;
|
|
637
430
|
}
|
|
638
431
|
|
|
639
432
|
const isRoot = event.eventId === rootEvent.eventId;
|
|
640
|
-
let queueInfo = {
|
|
641
|
-
totalQueueTime: 0,
|
|
642
|
-
totalQueueCount: 0,
|
|
643
|
-
manuallyCompletedCount: 0,
|
|
644
|
-
};
|
|
645
433
|
|
|
646
434
|
event.durationMs = Math.round(
|
|
647
435
|
event.durationMs || this.getDurationMs(event.startTimeMs)
|
|
@@ -650,24 +438,17 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
650
438
|
const context = JSON.stringify(
|
|
651
439
|
endContext(
|
|
652
440
|
event,
|
|
653
|
-
this.abbreviations,
|
|
654
441
|
this.eventStack.get(rootEvent.correlationId),
|
|
655
442
|
error
|
|
656
443
|
)
|
|
657
444
|
);
|
|
658
445
|
|
|
659
446
|
if (isRoot) {
|
|
660
|
-
queueInfo = this.getQueueInfo(event.correlationId);
|
|
661
447
|
this.discardMeasurements(rootEvent.correlationId);
|
|
662
448
|
} else {
|
|
663
449
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
664
450
|
}
|
|
665
451
|
|
|
666
|
-
this.logger.trace(
|
|
667
|
-
`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`,
|
|
668
|
-
event.correlationId
|
|
669
|
-
);
|
|
670
|
-
|
|
671
452
|
if (error) {
|
|
672
453
|
addError(error, this.logger, rootEvent);
|
|
673
454
|
}
|
|
@@ -684,7 +465,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
684
465
|
(rootEvent.errorCode || rootEvent.subErrorCode)
|
|
685
466
|
) {
|
|
686
467
|
this.logger.trace(
|
|
687
|
-
`PerformanceClient: Remove error and sub-error codes for root event ${event.name} as intermediate error was successfully handled`,
|
|
468
|
+
`PerformanceClient: Remove error and sub-error codes for root event '${event.name}' as intermediate error was successfully handled`,
|
|
688
469
|
event.correlationId
|
|
689
470
|
);
|
|
690
471
|
rootEvent.errorCode = undefined;
|
|
@@ -696,21 +477,27 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
696
477
|
// Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.
|
|
697
478
|
finalEvent.incompleteSubMeasurements?.forEach((subMeasurement) => {
|
|
698
479
|
this.logger.trace(
|
|
699
|
-
`PerformanceClient: Incomplete submeasurement ${subMeasurement.name} found for ${event.name}`,
|
|
480
|
+
`PerformanceClient: Incomplete submeasurement '${subMeasurement.name}' found for '${event.name}'`,
|
|
700
481
|
finalEvent.correlationId
|
|
701
482
|
);
|
|
702
483
|
incompleteSubsCount++;
|
|
703
484
|
});
|
|
704
485
|
finalEvent.incompleteSubMeasurements = undefined;
|
|
705
486
|
|
|
487
|
+
const logs = getAndFlushLogsFromCache(event.correlationId);
|
|
488
|
+
// Format logs: [millis1,hash1;millis2,hash2;...]
|
|
489
|
+
const formattedLogs = logs
|
|
490
|
+
.map(
|
|
491
|
+
(logMessage) => `${logMessage.milliseconds},${logMessage.hash}`
|
|
492
|
+
)
|
|
493
|
+
.join(";");
|
|
494
|
+
|
|
706
495
|
finalEvent = {
|
|
707
496
|
...finalEvent,
|
|
708
|
-
queuedTimeMs: queueInfo.totalQueueTime,
|
|
709
|
-
queuedCount: queueInfo.totalQueueCount,
|
|
710
|
-
queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount,
|
|
711
497
|
status: PerformanceEventStatus.Completed,
|
|
712
498
|
incompleteSubsCount,
|
|
713
499
|
context,
|
|
500
|
+
logs: formattedLogs,
|
|
714
501
|
};
|
|
715
502
|
if (account) {
|
|
716
503
|
finalEvent.accountType = getAccountType(account);
|
|
@@ -732,7 +519,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
732
519
|
fields: { [key: string]: {} | undefined },
|
|
733
520
|
correlationId: string
|
|
734
521
|
): void {
|
|
735
|
-
this.logger.trace("PerformanceClient: Updating static fields");
|
|
736
522
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
737
523
|
if (event) {
|
|
738
524
|
this.eventsByCorrelationId.set(correlationId, {
|
|
@@ -756,7 +542,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
756
542
|
fields: { [key: string]: number | undefined },
|
|
757
543
|
correlationId: string
|
|
758
544
|
): void {
|
|
759
|
-
this.logger.trace("PerformanceClient: Updating counters");
|
|
760
545
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
761
546
|
if (event) {
|
|
762
547
|
for (const counter in fields) {
|
|
@@ -787,10 +572,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
787
572
|
protected cacheEventByCorrelationId(event: PerformanceEvent): void {
|
|
788
573
|
const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
|
|
789
574
|
if (rootEvent) {
|
|
790
|
-
this.logger.trace(
|
|
791
|
-
`PerformanceClient: Performance measurement for ${event.name} added/updated`,
|
|
792
|
-
event.correlationId
|
|
793
|
-
);
|
|
794
575
|
rootEvent.incompleteSubMeasurements =
|
|
795
576
|
rootEvent.incompleteSubMeasurements || new Map();
|
|
796
577
|
rootEvent.incompleteSubMeasurements.set(event.eventId, {
|
|
@@ -798,72 +579,18 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
798
579
|
startTimeMs: event.startTimeMs,
|
|
799
580
|
});
|
|
800
581
|
} else {
|
|
801
|
-
this.logger.trace(
|
|
802
|
-
`PerformanceClient: Performance measurement for ${event.name} started`,
|
|
803
|
-
event.correlationId
|
|
804
|
-
);
|
|
805
582
|
this.eventsByCorrelationId.set(event.correlationId, { ...event });
|
|
806
583
|
this.eventStack.set(event.correlationId, []);
|
|
807
584
|
}
|
|
808
585
|
}
|
|
809
586
|
|
|
810
|
-
private getQueueInfo(correlationId: string): {
|
|
811
|
-
totalQueueTime: number;
|
|
812
|
-
totalQueueCount: number;
|
|
813
|
-
manuallyCompletedCount: number;
|
|
814
|
-
} {
|
|
815
|
-
const queueMeasurementForCorrelationId =
|
|
816
|
-
this.queueMeasurements.get(correlationId);
|
|
817
|
-
if (!queueMeasurementForCorrelationId) {
|
|
818
|
-
this.logger.trace(
|
|
819
|
-
`PerformanceClient: no queue measurements found for for correlationId: ${correlationId}`
|
|
820
|
-
);
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
let totalQueueTime = 0;
|
|
824
|
-
let totalQueueCount = 0;
|
|
825
|
-
let manuallyCompletedCount = 0;
|
|
826
|
-
queueMeasurementForCorrelationId?.forEach((measurement) => {
|
|
827
|
-
totalQueueTime += measurement.queueTime;
|
|
828
|
-
totalQueueCount++;
|
|
829
|
-
manuallyCompletedCount += measurement.manuallyCompleted ? 1 : 0;
|
|
830
|
-
});
|
|
831
|
-
|
|
832
|
-
return {
|
|
833
|
-
totalQueueTime,
|
|
834
|
-
totalQueueCount,
|
|
835
|
-
manuallyCompletedCount,
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
|
|
839
587
|
/**
|
|
840
588
|
* Removes measurements and aux data for a given correlation id.
|
|
841
589
|
*
|
|
842
590
|
* @param {string} correlationId
|
|
843
591
|
*/
|
|
844
592
|
discardMeasurements(correlationId: string): void {
|
|
845
|
-
this.logger.trace(
|
|
846
|
-
"PerformanceClient: Performance measurements discarded",
|
|
847
|
-
correlationId
|
|
848
|
-
);
|
|
849
593
|
this.eventsByCorrelationId.delete(correlationId);
|
|
850
|
-
|
|
851
|
-
this.logger.trace(
|
|
852
|
-
"PerformanceClient: QueueMeasurements discarded",
|
|
853
|
-
correlationId
|
|
854
|
-
);
|
|
855
|
-
this.queueMeasurements.delete(correlationId);
|
|
856
|
-
|
|
857
|
-
this.logger.trace(
|
|
858
|
-
"PerformanceClient: Pre-queue times discarded",
|
|
859
|
-
correlationId
|
|
860
|
-
);
|
|
861
|
-
this.preQueueTimeByCorrelationId.delete(correlationId);
|
|
862
|
-
|
|
863
|
-
this.logger.trace(
|
|
864
|
-
"PerformanceClient: Event stack discarded",
|
|
865
|
-
correlationId
|
|
866
|
-
);
|
|
867
594
|
this.eventStack.delete(correlationId);
|
|
868
595
|
}
|
|
869
596
|
|
|
@@ -877,7 +604,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
877
604
|
for (const [id, cb] of this.callbacks) {
|
|
878
605
|
if (cb.toString() === callback.toString()) {
|
|
879
606
|
this.logger.warning(
|
|
880
|
-
`PerformanceClient: Performance callback is already registered with id: ${id}
|
|
607
|
+
`PerformanceClient: Performance callback is already registered with id: ${id}`,
|
|
608
|
+
""
|
|
881
609
|
);
|
|
882
610
|
return id;
|
|
883
611
|
}
|
|
@@ -886,7 +614,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
886
614
|
const callbackId = this.generateId();
|
|
887
615
|
this.callbacks.set(callbackId, callback);
|
|
888
616
|
this.logger.verbose(
|
|
889
|
-
`PerformanceClient: Performance callback registered with id: ${callbackId}
|
|
617
|
+
`PerformanceClient: Performance callback registered with id: '${callbackId}'`,
|
|
618
|
+
""
|
|
890
619
|
);
|
|
891
620
|
|
|
892
621
|
return callbackId;
|
|
@@ -903,11 +632,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
903
632
|
|
|
904
633
|
if (result) {
|
|
905
634
|
this.logger.verbose(
|
|
906
|
-
`PerformanceClient: Performance callback ${callbackId} removed
|
|
635
|
+
`PerformanceClient: Performance callback '${callbackId}' removed.`,
|
|
636
|
+
""
|
|
907
637
|
);
|
|
908
638
|
} else {
|
|
909
639
|
this.logger.verbose(
|
|
910
|
-
`PerformanceClient: Performance callback ${callbackId} not removed
|
|
640
|
+
`PerformanceClient: Performance callback '${callbackId}' not removed.`,
|
|
641
|
+
""
|
|
911
642
|
);
|
|
912
643
|
}
|
|
913
644
|
|
|
@@ -929,7 +660,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
929
660
|
this.callbacks.forEach(
|
|
930
661
|
(callback: PerformanceCallbackFunction, callbackId: string) => {
|
|
931
662
|
this.logger.trace(
|
|
932
|
-
`PerformanceClient: Emitting event to callback ${callbackId}`,
|
|
663
|
+
`PerformanceClient: Emitting event to callback '${callbackId}'`,
|
|
933
664
|
correlationId
|
|
934
665
|
);
|
|
935
666
|
callback.apply(null, [events]);
|