@azure/msal-common 15.12.0 → 16.0.0-alpha.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.mjs +1 -1
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/CcsCredential.mjs.map +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/account/TokenClaims.mjs.map +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 +8 -8
- 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/AuthorityType.mjs.map +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/ProtocolMode.mjs.map +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 +25 -17
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +69 -80
- 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 +41 -12
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/dist/cache/utils/AccountEntityUtils.mjs +212 -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 +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +16 -20
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +3 -3
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +7 -12
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +22 -27
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +8 -12
- 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/JoseHeader.mjs.map +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 -224
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +3 -235
- 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 -123
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +3 -129
- 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/NetworkError.mjs.map +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/error/ServerError.mjs.map +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 +8 -6
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +1 -4
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-browser.mjs +12 -8
- package/dist/index-browser.mjs.map +1 -1
- package/dist/index-node.mjs +10 -7
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +12 -13
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +16 -21
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/RequestThumbprint.mjs +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/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 +1 -7
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +3 -9
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +7 -20
- 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 +6 -5
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +39 -41
- 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 -166
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -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 +65 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs +73 -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/ClientAssertionUtils.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +81 -117
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -131
- 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.mjs +7 -7
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +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 -201
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-C8h2xZEM.js → index-node-FrCFfFuh.js} +1606 -2487
- package/lib/index-node-FrCFfFuh.js.map +1 -0
- package/lib/index-node.cjs +4 -33
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +3 -33
- 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/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 +25 -17
- 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 +41 -12
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +60 -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 +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/BaseClient.d.ts +3 -3
- package/lib/types/client/BaseClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +1 -1
- 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 -224
- 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 -123
- 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/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 +8 -6
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +1 -4
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +12 -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/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/lib/types/request/BaseAuthRequest.d.ts +1 -7
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +3 -9
- 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 +6 -5
- 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 +0 -280
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +65 -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 -117
- 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/UrlUtils.d.ts +1 -2
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +120 -122
- package/src/account/AccountInfo.ts +0 -1
- 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 +21 -12
- 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 +176 -126
- package/src/cache/entities/AccessTokenEntity.ts +0 -4
- package/src/cache/entities/AccountEntity.ts +4 -285
- package/src/cache/entities/CredentialEntity.ts +0 -2
- package/src/cache/interface/ICacheManager.ts +61 -15
- package/src/cache/utils/AccountEntityUtils.ts +287 -0
- package/src/cache/utils/CacheHelpers.ts +23 -37
- package/src/cache/utils/CacheTypes.ts +0 -1
- package/src/client/AuthorizationCodeClient.ts +28 -49
- package/src/client/BaseClient.ts +8 -20
- package/src/client/RefreshTokenClient.ts +29 -61
- package/src/client/SilentFlowClient.ts +11 -20
- 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 -311
- package/src/error/ClientAuthErrorCodes.ts +0 -8
- package/src/error/ClientConfigurationError.ts +1 -194
- package/src/error/ClientConfigurationErrorCodes.ts +0 -3
- package/src/error/InteractionRequiredAuthError.ts +8 -48
- package/src/error/JoseHeaderError.ts +1 -8
- package/src/exports-browser-only.ts +2 -6
- package/src/exports-common.ts +4 -34
- package/src/exports-node-only.ts +1 -4
- package/src/logger/Logger.ts +26 -39
- package/src/network/ThrottlingUtils.ts +12 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +24 -20
- package/src/request/AuthenticationHeaderParser.ts +2 -4
- package/src/request/BaseAuthRequest.ts +1 -7
- package/src/request/RequestParameterBuilder.ts +30 -45
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ResponseHandler.ts +53 -58
- package/src/telemetry/performance/IPerformanceClient.ts +0 -40
- package/src/telemetry/performance/PerformanceClient.ts +29 -266
- package/src/telemetry/performance/PerformanceEvent.ts +0 -582
- package/src/telemetry/performance/PerformanceEvents.ts +97 -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 -146
- package/src/utils/FunctionWrappers.ts +28 -29
- package/src/utils/ProtocolUtils.ts +6 -6
- package/src/utils/UrlUtils.ts +2 -15
- package/dist/cache/entities/AccountEntity.mjs +0 -226
- package/dist/cache/entities/AccountEntity.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-C8h2xZEM.js.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/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
|
@@ -9,38 +9,26 @@ 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
|
|
|
30
|
-
export interface PreQueueEvent {
|
|
31
|
-
name: PerformanceEvents;
|
|
32
|
-
time: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
25
|
/**
|
|
36
26
|
* Starts context by adding payload to the stack
|
|
37
27
|
* @param event {PerformanceEvent}
|
|
38
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
39
28
|
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
40
29
|
*/
|
|
41
30
|
export function startContext(
|
|
42
31
|
event: PerformanceEvent,
|
|
43
|
-
abbreviations: Map<string, string>,
|
|
44
32
|
stack?: PerformanceEventStackedContext[]
|
|
45
33
|
): void {
|
|
46
34
|
if (!stack) {
|
|
@@ -48,7 +36,7 @@ export function startContext(
|
|
|
48
36
|
}
|
|
49
37
|
|
|
50
38
|
stack.push({
|
|
51
|
-
name:
|
|
39
|
+
name: event.name,
|
|
52
40
|
});
|
|
53
41
|
}
|
|
54
42
|
|
|
@@ -56,13 +44,11 @@ export function startContext(
|
|
|
56
44
|
* Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
|
|
57
45
|
*
|
|
58
46
|
* @param event {PerformanceEvent}
|
|
59
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
60
47
|
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
61
48
|
* @param error {?unknown} error
|
|
62
49
|
*/
|
|
63
50
|
export function endContext(
|
|
64
51
|
event: PerformanceEvent,
|
|
65
|
-
abbreviations: Map<string, string>,
|
|
66
52
|
stack?: PerformanceEventStackedContext[],
|
|
67
53
|
error?: unknown
|
|
68
54
|
): PerformanceEventContext | undefined {
|
|
@@ -74,7 +60,7 @@ export function endContext(
|
|
|
74
60
|
return stack.length ? stack[stack.length - 1] : undefined;
|
|
75
61
|
};
|
|
76
62
|
|
|
77
|
-
const abbrEventName =
|
|
63
|
+
const abbrEventName = event.name;
|
|
78
64
|
const top = peek(stack);
|
|
79
65
|
if (top?.name !== abbrEventName) {
|
|
80
66
|
return;
|
|
@@ -280,22 +266,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
280
266
|
*/
|
|
281
267
|
protected eventsByCorrelationId: Map<string, PerformanceEvent>;
|
|
282
268
|
|
|
283
|
-
/**
|
|
284
|
-
* Map of pre-queue times by correlation Id
|
|
285
|
-
*
|
|
286
|
-
* @protected
|
|
287
|
-
* @type {Map<string, PreQueueEvent>}
|
|
288
|
-
*/
|
|
289
|
-
protected preQueueTimeByCorrelationId: Map<string, PreQueueEvent>;
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Map of queue measurements by correlation Id
|
|
293
|
-
*
|
|
294
|
-
* @protected
|
|
295
|
-
* @type {Map<string, Array<QueueMeasurement>>}
|
|
296
|
-
*/
|
|
297
|
-
protected queueMeasurements: Map<string, Array<QueueMeasurement>>;
|
|
298
|
-
|
|
299
269
|
protected intFields: Set<string>;
|
|
300
270
|
|
|
301
271
|
/**
|
|
@@ -305,13 +275,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
305
275
|
*/
|
|
306
276
|
protected eventStack: Map<string, PerformanceEventStackedContext[]>;
|
|
307
277
|
|
|
308
|
-
/**
|
|
309
|
-
* Event name abbreviations
|
|
310
|
-
*
|
|
311
|
-
* @protected
|
|
312
|
-
*/
|
|
313
|
-
protected abbreviations: Map<string, string>;
|
|
314
|
-
|
|
315
278
|
/**
|
|
316
279
|
* Creates an instance of PerformanceClient,
|
|
317
280
|
* an abstract class containing core performance telemetry logic.
|
|
@@ -324,7 +287,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
324
287
|
* @param {string} libraryVersion Version of the library
|
|
325
288
|
* @param {ApplicationTelemetry} applicationTelemetry application name and version
|
|
326
289
|
* @param {Set<String>} intFields integer fields to be truncated
|
|
327
|
-
* @param {Map<string, string>} abbreviations event name abbreviations
|
|
328
290
|
*/
|
|
329
291
|
constructor(
|
|
330
292
|
clientId: string,
|
|
@@ -333,8 +295,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
333
295
|
libraryName: string,
|
|
334
296
|
libraryVersion: string,
|
|
335
297
|
applicationTelemetry: ApplicationTelemetry,
|
|
336
|
-
intFields?: Set<string
|
|
337
|
-
abbreviations?: Map<string, string>
|
|
298
|
+
intFields?: Set<string>
|
|
338
299
|
) {
|
|
339
300
|
this.authority = authority;
|
|
340
301
|
this.libraryName = libraryName;
|
|
@@ -345,16 +306,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
345
306
|
this.callbacks = new Map();
|
|
346
307
|
this.eventsByCorrelationId = new Map();
|
|
347
308
|
this.eventStack = new Map();
|
|
348
|
-
this.queueMeasurements = new Map();
|
|
349
|
-
this.preQueueTimeByCorrelationId = new Map();
|
|
350
309
|
this.intFields = intFields || new Set();
|
|
351
310
|
for (const item of IntFields) {
|
|
352
311
|
this.intFields.add(item);
|
|
353
312
|
}
|
|
354
|
-
this.abbreviations = abbreviations || new Map();
|
|
355
|
-
for (const [key, value] of PerformanceEventAbbreviations) {
|
|
356
|
-
this.abbreviations.set(key, value);
|
|
357
|
-
}
|
|
358
313
|
}
|
|
359
314
|
|
|
360
315
|
/**
|
|
@@ -365,152 +320,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
365
320
|
*/
|
|
366
321
|
abstract generateId(): string;
|
|
367
322
|
|
|
368
|
-
/**
|
|
369
|
-
* Starts and returns an platform-specific implementation of IPerformanceMeasurement.
|
|
370
|
-
* Note: this function can be changed to abstract at the next major version bump.
|
|
371
|
-
*
|
|
372
|
-
* @param {string} measureName
|
|
373
|
-
* @param {string} correlationId
|
|
374
|
-
* @returns {IPerformanceMeasurement}
|
|
375
|
-
* @deprecated This method will be removed in the next major version
|
|
376
|
-
*/
|
|
377
|
-
startPerformanceMeasurement(
|
|
378
|
-
measureName: string, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
379
|
-
correlationId: string // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
380
|
-
): IPerformanceMeasurement {
|
|
381
|
-
return {} as IPerformanceMeasurement;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Sets pre-queue time by correlation Id
|
|
386
|
-
*
|
|
387
|
-
* @abstract
|
|
388
|
-
* @param {PerformanceEvents} eventName
|
|
389
|
-
* @param {string} correlationId
|
|
390
|
-
* @returns
|
|
391
|
-
*/
|
|
392
|
-
abstract setPreQueueTime(
|
|
393
|
-
eventName: PerformanceEvents,
|
|
394
|
-
correlationId?: string
|
|
395
|
-
): void;
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* Gets map of pre-queue times by correlation Id
|
|
399
|
-
*
|
|
400
|
-
* @param {PerformanceEvents} eventName
|
|
401
|
-
* @param {string} correlationId
|
|
402
|
-
* @returns {number}
|
|
403
|
-
*/
|
|
404
|
-
getPreQueueTime(eventName: string, correlationId: string): number | void {
|
|
405
|
-
const preQueueEvent: PreQueueEvent | undefined =
|
|
406
|
-
this.preQueueTimeByCorrelationId.get(correlationId);
|
|
407
|
-
|
|
408
|
-
if (!preQueueEvent) {
|
|
409
|
-
this.logger.trace(
|
|
410
|
-
`PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: ${correlationId}, unable to add queue measurement`
|
|
411
|
-
);
|
|
412
|
-
return;
|
|
413
|
-
} else if (preQueueEvent.name !== eventName) {
|
|
414
|
-
this.logger.trace(
|
|
415
|
-
`PerformanceClient.getPreQueueTime: no pre-queue time found for ${eventName}, unable to add queue measurement`
|
|
416
|
-
);
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return preQueueEvent.time;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Calculates the difference between current time and time when function was queued.
|
|
425
|
-
* Note: It is possible to have 0 as the queue time if the current time and the queued time was the same.
|
|
426
|
-
*
|
|
427
|
-
* @param {number} preQueueTime
|
|
428
|
-
* @param {number} currentTime
|
|
429
|
-
* @returns {number}
|
|
430
|
-
*/
|
|
431
|
-
calculateQueuedTime(preQueueTime: number, currentTime: number): number {
|
|
432
|
-
if (preQueueTime < 1) {
|
|
433
|
-
this.logger.trace(
|
|
434
|
-
`PerformanceClient: preQueueTime should be a positive integer and not ${preQueueTime}`
|
|
435
|
-
);
|
|
436
|
-
return 0;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
if (currentTime < 1) {
|
|
440
|
-
this.logger.trace(
|
|
441
|
-
`PerformanceClient: currentTime should be a positive integer and not ${currentTime}`
|
|
442
|
-
);
|
|
443
|
-
return 0;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
if (currentTime < preQueueTime) {
|
|
447
|
-
this.logger.trace(
|
|
448
|
-
"PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved"
|
|
449
|
-
);
|
|
450
|
-
return 0;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
return currentTime - preQueueTime;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Adds queue measurement time to QueueMeasurements array for given correlation ID.
|
|
458
|
-
*
|
|
459
|
-
* @param {PerformanceEvents} eventName
|
|
460
|
-
* @param {?string} correlationId
|
|
461
|
-
* @param {?number} queueTime
|
|
462
|
-
* @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
|
|
463
|
-
* @returns
|
|
464
|
-
*/
|
|
465
|
-
addQueueMeasurement(
|
|
466
|
-
eventName: string,
|
|
467
|
-
correlationId?: string,
|
|
468
|
-
queueTime?: number,
|
|
469
|
-
manuallyCompleted?: boolean
|
|
470
|
-
): void {
|
|
471
|
-
if (!correlationId) {
|
|
472
|
-
this.logger.trace(
|
|
473
|
-
`PerformanceClient.addQueueMeasurement: correlationId not provided for ${eventName}, cannot add queue measurement`
|
|
474
|
-
);
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if (queueTime === 0) {
|
|
479
|
-
// Possible for there to be no queue time after calculation
|
|
480
|
-
this.logger.trace(
|
|
481
|
-
`PerformanceClient.addQueueMeasurement: queue time provided for ${eventName} is ${queueTime}`
|
|
482
|
-
);
|
|
483
|
-
} else if (!queueTime) {
|
|
484
|
-
this.logger.trace(
|
|
485
|
-
`PerformanceClient.addQueueMeasurement: no queue time provided for ${eventName}`
|
|
486
|
-
);
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
const queueMeasurement: QueueMeasurement = {
|
|
491
|
-
eventName,
|
|
492
|
-
// Always default queue time to 0 for manually completed (improperly instrumented)
|
|
493
|
-
queueTime: manuallyCompleted ? 0 : queueTime,
|
|
494
|
-
manuallyCompleted,
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
// Adds to existing correlation Id if present in queueMeasurements
|
|
498
|
-
const existingMeasurements = this.queueMeasurements.get(correlationId);
|
|
499
|
-
if (existingMeasurements) {
|
|
500
|
-
existingMeasurements.push(queueMeasurement);
|
|
501
|
-
this.queueMeasurements.set(correlationId, existingMeasurements);
|
|
502
|
-
} else {
|
|
503
|
-
// Sets new correlation Id if not present in queueMeasurements
|
|
504
|
-
this.logger.trace(
|
|
505
|
-
`PerformanceClient.addQueueMeasurement: adding correlationId ${correlationId} to queue measurements`
|
|
506
|
-
);
|
|
507
|
-
const measurementArray = [queueMeasurement];
|
|
508
|
-
this.queueMeasurements.set(correlationId, measurementArray);
|
|
509
|
-
}
|
|
510
|
-
// Delete processed pre-queue event.
|
|
511
|
-
this.preQueueTimeByCorrelationId.delete(correlationId);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
323
|
/**
|
|
515
324
|
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
|
|
516
325
|
*
|
|
@@ -526,13 +335,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
526
335
|
const eventCorrelationId = correlationId || this.generateId();
|
|
527
336
|
if (!correlationId) {
|
|
528
337
|
this.logger.info(
|
|
529
|
-
`PerformanceClient: No correlation id provided for ${measureName}, generating`,
|
|
338
|
+
`PerformanceClient: No correlation id provided for '${measureName}', generating`,
|
|
530
339
|
eventCorrelationId
|
|
531
340
|
);
|
|
532
341
|
}
|
|
533
342
|
|
|
534
343
|
this.logger.trace(
|
|
535
|
-
`PerformanceClient: Performance measurement started for ${measureName}`,
|
|
344
|
+
`PerformanceClient: Performance measurement started for '${measureName}'`,
|
|
536
345
|
eventCorrelationId
|
|
537
346
|
);
|
|
538
347
|
|
|
@@ -552,11 +361,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
552
361
|
|
|
553
362
|
// Store in progress events so they can be discarded if not ended properly
|
|
554
363
|
this.cacheEventByCorrelationId(inProgressEvent);
|
|
555
|
-
startContext(
|
|
556
|
-
inProgressEvent,
|
|
557
|
-
this.abbreviations,
|
|
558
|
-
this.eventStack.get(eventCorrelationId)
|
|
559
|
-
);
|
|
364
|
+
startContext(inProgressEvent, this.eventStack.get(eventCorrelationId));
|
|
560
365
|
|
|
561
366
|
// Return the event and functions the caller can use to properly end/flush the measurement
|
|
562
367
|
return {
|
|
@@ -587,7 +392,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
587
392
|
);
|
|
588
393
|
},
|
|
589
394
|
event: inProgressEvent,
|
|
590
|
-
measurement: new StubPerformanceMeasurement(),
|
|
591
395
|
};
|
|
592
396
|
}
|
|
593
397
|
|
|
@@ -609,18 +413,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
609
413
|
this.eventsByCorrelationId.get(event.correlationId);
|
|
610
414
|
if (!rootEvent) {
|
|
611
415
|
this.logger.trace(
|
|
612
|
-
`PerformanceClient: Measurement not found for ${event.eventId}`,
|
|
416
|
+
`PerformanceClient: Measurement not found for '${event.eventId}'`,
|
|
613
417
|
event.correlationId
|
|
614
418
|
);
|
|
615
419
|
return null;
|
|
616
420
|
}
|
|
617
421
|
|
|
618
422
|
const isRoot = event.eventId === rootEvent.eventId;
|
|
619
|
-
let queueInfo = {
|
|
620
|
-
totalQueueTime: 0,
|
|
621
|
-
totalQueueCount: 0,
|
|
622
|
-
manuallyCompletedCount: 0,
|
|
623
|
-
};
|
|
624
423
|
|
|
625
424
|
event.durationMs = Math.round(
|
|
626
425
|
event.durationMs || this.getDurationMs(event.startTimeMs)
|
|
@@ -629,21 +428,19 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
629
428
|
const context = JSON.stringify(
|
|
630
429
|
endContext(
|
|
631
430
|
event,
|
|
632
|
-
this.abbreviations,
|
|
633
431
|
this.eventStack.get(rootEvent.correlationId),
|
|
634
432
|
error
|
|
635
433
|
)
|
|
636
434
|
);
|
|
637
435
|
|
|
638
436
|
if (isRoot) {
|
|
639
|
-
queueInfo = this.getQueueInfo(event.correlationId);
|
|
640
437
|
this.discardMeasurements(rootEvent.correlationId);
|
|
641
438
|
} else {
|
|
642
439
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
643
440
|
}
|
|
644
441
|
|
|
645
442
|
this.logger.trace(
|
|
646
|
-
`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`,
|
|
443
|
+
`PerformanceClient: Performance measurement ended for '${event.name}': '${event.durationMs}' ms`,
|
|
647
444
|
event.correlationId
|
|
648
445
|
);
|
|
649
446
|
|
|
@@ -663,7 +460,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
663
460
|
(rootEvent.errorCode || rootEvent.subErrorCode)
|
|
664
461
|
) {
|
|
665
462
|
this.logger.trace(
|
|
666
|
-
`PerformanceClient: Remove error and sub-error codes for root event ${event.name} as intermediate error was successfully handled`,
|
|
463
|
+
`PerformanceClient: Remove error and sub-error codes for root event '${event.name}' as intermediate error was successfully handled`,
|
|
667
464
|
event.correlationId
|
|
668
465
|
);
|
|
669
466
|
rootEvent.errorCode = undefined;
|
|
@@ -675,7 +472,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
675
472
|
// Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.
|
|
676
473
|
finalEvent.incompleteSubMeasurements?.forEach((subMeasurement) => {
|
|
677
474
|
this.logger.trace(
|
|
678
|
-
`PerformanceClient: Incomplete submeasurement ${subMeasurement.name} found for ${event.name}`,
|
|
475
|
+
`PerformanceClient: Incomplete submeasurement '${subMeasurement.name}' found for '${event.name}'`,
|
|
679
476
|
finalEvent.correlationId
|
|
680
477
|
);
|
|
681
478
|
incompleteSubsCount++;
|
|
@@ -684,9 +481,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
684
481
|
|
|
685
482
|
finalEvent = {
|
|
686
483
|
...finalEvent,
|
|
687
|
-
queuedTimeMs: queueInfo.totalQueueTime,
|
|
688
|
-
queuedCount: queueInfo.totalQueueCount,
|
|
689
|
-
queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount,
|
|
690
484
|
status: PerformanceEventStatus.Completed,
|
|
691
485
|
incompleteSubsCount,
|
|
692
486
|
context,
|
|
@@ -706,7 +500,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
706
500
|
fields: { [key: string]: {} | undefined },
|
|
707
501
|
correlationId: string
|
|
708
502
|
): void {
|
|
709
|
-
this.logger.trace(
|
|
503
|
+
this.logger.trace(
|
|
504
|
+
"PerformanceClient: Updating static fields",
|
|
505
|
+
correlationId
|
|
506
|
+
);
|
|
710
507
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
711
508
|
if (event) {
|
|
712
509
|
this.eventsByCorrelationId.set(correlationId, {
|
|
@@ -730,7 +527,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
730
527
|
fields: { [key: string]: number | undefined },
|
|
731
528
|
correlationId: string
|
|
732
529
|
): void {
|
|
733
|
-
this.logger.trace(
|
|
530
|
+
this.logger.trace(
|
|
531
|
+
"PerformanceClient: Updating counters",
|
|
532
|
+
correlationId
|
|
533
|
+
);
|
|
734
534
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
735
535
|
if (event) {
|
|
736
536
|
for (const counter in fields) {
|
|
@@ -762,7 +562,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
762
562
|
const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
|
|
763
563
|
if (rootEvent) {
|
|
764
564
|
this.logger.trace(
|
|
765
|
-
`PerformanceClient: Performance measurement for ${event.name} added/updated`,
|
|
565
|
+
`PerformanceClient: Performance measurement for '${event.name}' added/updated`,
|
|
766
566
|
event.correlationId
|
|
767
567
|
);
|
|
768
568
|
rootEvent.incompleteSubMeasurements =
|
|
@@ -773,7 +573,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
773
573
|
});
|
|
774
574
|
} else {
|
|
775
575
|
this.logger.trace(
|
|
776
|
-
`PerformanceClient: Performance measurement for ${event.name} started`,
|
|
576
|
+
`PerformanceClient: Performance measurement for '${event.name}' started`,
|
|
777
577
|
event.correlationId
|
|
778
578
|
);
|
|
779
579
|
this.eventsByCorrelationId.set(event.correlationId, { ...event });
|
|
@@ -781,35 +581,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
781
581
|
}
|
|
782
582
|
}
|
|
783
583
|
|
|
784
|
-
private getQueueInfo(correlationId: string): {
|
|
785
|
-
totalQueueTime: number;
|
|
786
|
-
totalQueueCount: number;
|
|
787
|
-
manuallyCompletedCount: number;
|
|
788
|
-
} {
|
|
789
|
-
const queueMeasurementForCorrelationId =
|
|
790
|
-
this.queueMeasurements.get(correlationId);
|
|
791
|
-
if (!queueMeasurementForCorrelationId) {
|
|
792
|
-
this.logger.trace(
|
|
793
|
-
`PerformanceClient: no queue measurements found for for correlationId: ${correlationId}`
|
|
794
|
-
);
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
let totalQueueTime = 0;
|
|
798
|
-
let totalQueueCount = 0;
|
|
799
|
-
let manuallyCompletedCount = 0;
|
|
800
|
-
queueMeasurementForCorrelationId?.forEach((measurement) => {
|
|
801
|
-
totalQueueTime += measurement.queueTime;
|
|
802
|
-
totalQueueCount++;
|
|
803
|
-
manuallyCompletedCount += measurement.manuallyCompleted ? 1 : 0;
|
|
804
|
-
});
|
|
805
|
-
|
|
806
|
-
return {
|
|
807
|
-
totalQueueTime,
|
|
808
|
-
totalQueueCount,
|
|
809
|
-
manuallyCompletedCount,
|
|
810
|
-
};
|
|
811
|
-
}
|
|
812
|
-
|
|
813
584
|
/**
|
|
814
585
|
* Removes measurements and aux data for a given correlation id.
|
|
815
586
|
*
|
|
@@ -822,18 +593,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
822
593
|
);
|
|
823
594
|
this.eventsByCorrelationId.delete(correlationId);
|
|
824
595
|
|
|
825
|
-
this.logger.trace(
|
|
826
|
-
"PerformanceClient: QueueMeasurements discarded",
|
|
827
|
-
correlationId
|
|
828
|
-
);
|
|
829
|
-
this.queueMeasurements.delete(correlationId);
|
|
830
|
-
|
|
831
|
-
this.logger.trace(
|
|
832
|
-
"PerformanceClient: Pre-queue times discarded",
|
|
833
|
-
correlationId
|
|
834
|
-
);
|
|
835
|
-
this.preQueueTimeByCorrelationId.delete(correlationId);
|
|
836
|
-
|
|
837
596
|
this.logger.trace(
|
|
838
597
|
"PerformanceClient: Event stack discarded",
|
|
839
598
|
correlationId
|
|
@@ -851,7 +610,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
851
610
|
for (const [id, cb] of this.callbacks) {
|
|
852
611
|
if (cb.toString() === callback.toString()) {
|
|
853
612
|
this.logger.warning(
|
|
854
|
-
`PerformanceClient: Performance callback is already registered with id: ${id}
|
|
613
|
+
`PerformanceClient: Performance callback is already registered with id: ${id}`,
|
|
614
|
+
""
|
|
855
615
|
);
|
|
856
616
|
return id;
|
|
857
617
|
}
|
|
@@ -860,7 +620,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
860
620
|
const callbackId = this.generateId();
|
|
861
621
|
this.callbacks.set(callbackId, callback);
|
|
862
622
|
this.logger.verbose(
|
|
863
|
-
`PerformanceClient: Performance callback registered with id: ${callbackId}
|
|
623
|
+
`PerformanceClient: Performance callback registered with id: '${callbackId}'`,
|
|
624
|
+
""
|
|
864
625
|
);
|
|
865
626
|
|
|
866
627
|
return callbackId;
|
|
@@ -877,11 +638,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
877
638
|
|
|
878
639
|
if (result) {
|
|
879
640
|
this.logger.verbose(
|
|
880
|
-
`PerformanceClient: Performance callback ${callbackId} removed
|
|
641
|
+
`PerformanceClient: Performance callback '${callbackId}' removed.`,
|
|
642
|
+
""
|
|
881
643
|
);
|
|
882
644
|
} else {
|
|
883
645
|
this.logger.verbose(
|
|
884
|
-
`PerformanceClient: Performance callback ${callbackId} not removed
|
|
646
|
+
`PerformanceClient: Performance callback '${callbackId}' not removed.`,
|
|
647
|
+
""
|
|
885
648
|
);
|
|
886
649
|
}
|
|
887
650
|
|
|
@@ -903,7 +666,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
903
666
|
this.callbacks.forEach(
|
|
904
667
|
(callback: PerformanceCallbackFunction, callbackId: string) => {
|
|
905
668
|
this.logger.trace(
|
|
906
|
-
`PerformanceClient: Emitting event to callback ${callbackId}`,
|
|
669
|
+
`PerformanceClient: Emitting event to callback '${callbackId}'`,
|
|
907
670
|
correlationId
|
|
908
671
|
);
|
|
909
672
|
callback.apply(null, [events]);
|