@azure/msal-common 15.13.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 -4
- 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 +1 -5
- 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 -57
- 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 +1 -31
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +6 -85
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +28 -188
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -282
- 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 +29 -222
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-D8Iaiqq3.js → index-node-FrCFfFuh.js} +1606 -2493
- 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 -4
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/ClientInfo.d.ts +1 -5
- 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 -57
- 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 +1 -31
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +6 -85
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +0 -282
- 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 -6
- package/src/account/ClientInfo.ts +4 -11
- 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 -293
- 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 +1 -43
- package/src/telemetry/performance/PerformanceClient.ts +32 -295
- package/src/telemetry/performance/PerformanceEvent.ts +0 -586
- 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 -232
- 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-D8Iaiqq3.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,39 +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
|
-
import { AccountInfo } from "../../account/AccountInfo.js";
|
|
30
|
-
|
|
31
|
-
export interface PreQueueEvent {
|
|
32
|
-
name: PerformanceEvents;
|
|
33
|
-
time: number;
|
|
34
|
-
}
|
|
35
24
|
|
|
36
25
|
/**
|
|
37
26
|
* Starts context by adding payload to the stack
|
|
38
27
|
* @param event {PerformanceEvent}
|
|
39
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
40
28
|
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
41
29
|
*/
|
|
42
30
|
export function startContext(
|
|
43
31
|
event: PerformanceEvent,
|
|
44
|
-
abbreviations: Map<string, string>,
|
|
45
32
|
stack?: PerformanceEventStackedContext[]
|
|
46
33
|
): void {
|
|
47
34
|
if (!stack) {
|
|
@@ -49,7 +36,7 @@ export function startContext(
|
|
|
49
36
|
}
|
|
50
37
|
|
|
51
38
|
stack.push({
|
|
52
|
-
name:
|
|
39
|
+
name: event.name,
|
|
53
40
|
});
|
|
54
41
|
}
|
|
55
42
|
|
|
@@ -57,13 +44,11 @@ export function startContext(
|
|
|
57
44
|
* Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
|
|
58
45
|
*
|
|
59
46
|
* @param event {PerformanceEvent}
|
|
60
|
-
* @param abbreviations {Map<string, string>} event name abbreviations
|
|
61
47
|
* @param stack {?PerformanceEventStackedContext[]} stack
|
|
62
48
|
* @param error {?unknown} error
|
|
63
49
|
*/
|
|
64
50
|
export function endContext(
|
|
65
51
|
event: PerformanceEvent,
|
|
66
|
-
abbreviations: Map<string, string>,
|
|
67
52
|
stack?: PerformanceEventStackedContext[],
|
|
68
53
|
error?: unknown
|
|
69
54
|
): PerformanceEventContext | undefined {
|
|
@@ -75,7 +60,7 @@ export function endContext(
|
|
|
75
60
|
return stack.length ? stack[stack.length - 1] : undefined;
|
|
76
61
|
};
|
|
77
62
|
|
|
78
|
-
const abbrEventName =
|
|
63
|
+
const abbrEventName = event.name;
|
|
79
64
|
const top = peek(stack);
|
|
80
65
|
if (top?.name !== abbrEventName) {
|
|
81
66
|
return;
|
|
@@ -265,22 +250,6 @@ export function compactStackLine(line: string): string {
|
|
|
265
250
|
return line.trimStart();
|
|
266
251
|
}
|
|
267
252
|
|
|
268
|
-
export function getAccountType(
|
|
269
|
-
account?: AccountInfo
|
|
270
|
-
): "AAD" | "MSA" | "B2C" | undefined {
|
|
271
|
-
const idTokenClaims = account?.idTokenClaims;
|
|
272
|
-
if (idTokenClaims?.tfp || idTokenClaims?.acr) {
|
|
273
|
-
return "B2C";
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (!idTokenClaims?.tid) {
|
|
277
|
-
return undefined;
|
|
278
|
-
} else if (idTokenClaims?.tid === "9188040d-6c67-4c5b-b112-36a304b66dad") {
|
|
279
|
-
return "MSA";
|
|
280
|
-
}
|
|
281
|
-
return "AAD";
|
|
282
|
-
}
|
|
283
|
-
|
|
284
253
|
export abstract class PerformanceClient implements IPerformanceClient {
|
|
285
254
|
protected authority: string;
|
|
286
255
|
protected libraryName: string;
|
|
@@ -297,22 +266,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
297
266
|
*/
|
|
298
267
|
protected eventsByCorrelationId: Map<string, PerformanceEvent>;
|
|
299
268
|
|
|
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
269
|
protected intFields: Set<string>;
|
|
317
270
|
|
|
318
271
|
/**
|
|
@@ -322,13 +275,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
322
275
|
*/
|
|
323
276
|
protected eventStack: Map<string, PerformanceEventStackedContext[]>;
|
|
324
277
|
|
|
325
|
-
/**
|
|
326
|
-
* Event name abbreviations
|
|
327
|
-
*
|
|
328
|
-
* @protected
|
|
329
|
-
*/
|
|
330
|
-
protected abbreviations: Map<string, string>;
|
|
331
|
-
|
|
332
278
|
/**
|
|
333
279
|
* Creates an instance of PerformanceClient,
|
|
334
280
|
* an abstract class containing core performance telemetry logic.
|
|
@@ -341,7 +287,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
341
287
|
* @param {string} libraryVersion Version of the library
|
|
342
288
|
* @param {ApplicationTelemetry} applicationTelemetry application name and version
|
|
343
289
|
* @param {Set<String>} intFields integer fields to be truncated
|
|
344
|
-
* @param {Map<string, string>} abbreviations event name abbreviations
|
|
345
290
|
*/
|
|
346
291
|
constructor(
|
|
347
292
|
clientId: string,
|
|
@@ -350,8 +295,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
350
295
|
libraryName: string,
|
|
351
296
|
libraryVersion: string,
|
|
352
297
|
applicationTelemetry: ApplicationTelemetry,
|
|
353
|
-
intFields?: Set<string
|
|
354
|
-
abbreviations?: Map<string, string>
|
|
298
|
+
intFields?: Set<string>
|
|
355
299
|
) {
|
|
356
300
|
this.authority = authority;
|
|
357
301
|
this.libraryName = libraryName;
|
|
@@ -362,16 +306,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
362
306
|
this.callbacks = new Map();
|
|
363
307
|
this.eventsByCorrelationId = new Map();
|
|
364
308
|
this.eventStack = new Map();
|
|
365
|
-
this.queueMeasurements = new Map();
|
|
366
|
-
this.preQueueTimeByCorrelationId = new Map();
|
|
367
309
|
this.intFields = intFields || new Set();
|
|
368
310
|
for (const item of IntFields) {
|
|
369
311
|
this.intFields.add(item);
|
|
370
312
|
}
|
|
371
|
-
this.abbreviations = abbreviations || new Map();
|
|
372
|
-
for (const [key, value] of PerformanceEventAbbreviations) {
|
|
373
|
-
this.abbreviations.set(key, value);
|
|
374
|
-
}
|
|
375
313
|
}
|
|
376
314
|
|
|
377
315
|
/**
|
|
@@ -382,152 +320,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
382
320
|
*/
|
|
383
321
|
abstract generateId(): string;
|
|
384
322
|
|
|
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
323
|
/**
|
|
532
324
|
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
|
|
533
325
|
*
|
|
@@ -543,13 +335,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
543
335
|
const eventCorrelationId = correlationId || this.generateId();
|
|
544
336
|
if (!correlationId) {
|
|
545
337
|
this.logger.info(
|
|
546
|
-
`PerformanceClient: No correlation id provided for ${measureName}, generating`,
|
|
338
|
+
`PerformanceClient: No correlation id provided for '${measureName}', generating`,
|
|
547
339
|
eventCorrelationId
|
|
548
340
|
);
|
|
549
341
|
}
|
|
550
342
|
|
|
551
343
|
this.logger.trace(
|
|
552
|
-
`PerformanceClient: Performance measurement started for ${measureName}`,
|
|
344
|
+
`PerformanceClient: Performance measurement started for '${measureName}'`,
|
|
553
345
|
eventCorrelationId
|
|
554
346
|
);
|
|
555
347
|
|
|
@@ -569,18 +361,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
569
361
|
|
|
570
362
|
// Store in progress events so they can be discarded if not ended properly
|
|
571
363
|
this.cacheEventByCorrelationId(inProgressEvent);
|
|
572
|
-
startContext(
|
|
573
|
-
inProgressEvent,
|
|
574
|
-
this.abbreviations,
|
|
575
|
-
this.eventStack.get(eventCorrelationId)
|
|
576
|
-
);
|
|
364
|
+
startContext(inProgressEvent, this.eventStack.get(eventCorrelationId));
|
|
577
365
|
|
|
578
366
|
// Return the event and functions the caller can use to properly end/flush the measurement
|
|
579
367
|
return {
|
|
580
368
|
end: (
|
|
581
369
|
event?: Partial<PerformanceEvent>,
|
|
582
|
-
error?: unknown
|
|
583
|
-
account?: AccountInfo
|
|
370
|
+
error?: unknown
|
|
584
371
|
): PerformanceEvent | null => {
|
|
585
372
|
return this.endMeasurement(
|
|
586
373
|
{
|
|
@@ -589,8 +376,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
589
376
|
// Properties set when event ends
|
|
590
377
|
...event,
|
|
591
378
|
},
|
|
592
|
-
error
|
|
593
|
-
account
|
|
379
|
+
error
|
|
594
380
|
);
|
|
595
381
|
},
|
|
596
382
|
discard: () => {
|
|
@@ -606,7 +392,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
606
392
|
);
|
|
607
393
|
},
|
|
608
394
|
event: inProgressEvent,
|
|
609
|
-
measurement: new StubPerformanceMeasurement(),
|
|
610
395
|
};
|
|
611
396
|
}
|
|
612
397
|
|
|
@@ -618,30 +403,23 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
618
403
|
*
|
|
619
404
|
* @param {PerformanceEvent} event
|
|
620
405
|
* @param {unknown} error
|
|
621
|
-
* @param {AccountInfo?} account
|
|
622
406
|
* @returns {(PerformanceEvent | null)}
|
|
623
407
|
*/
|
|
624
408
|
endMeasurement(
|
|
625
409
|
event: PerformanceEvent,
|
|
626
|
-
error?: unknown
|
|
627
|
-
account?: AccountInfo
|
|
410
|
+
error?: unknown
|
|
628
411
|
): PerformanceEvent | null {
|
|
629
412
|
const rootEvent: PerformanceEvent | undefined =
|
|
630
413
|
this.eventsByCorrelationId.get(event.correlationId);
|
|
631
414
|
if (!rootEvent) {
|
|
632
415
|
this.logger.trace(
|
|
633
|
-
`PerformanceClient: Measurement not found for ${event.eventId}`,
|
|
416
|
+
`PerformanceClient: Measurement not found for '${event.eventId}'`,
|
|
634
417
|
event.correlationId
|
|
635
418
|
);
|
|
636
419
|
return null;
|
|
637
420
|
}
|
|
638
421
|
|
|
639
422
|
const isRoot = event.eventId === rootEvent.eventId;
|
|
640
|
-
let queueInfo = {
|
|
641
|
-
totalQueueTime: 0,
|
|
642
|
-
totalQueueCount: 0,
|
|
643
|
-
manuallyCompletedCount: 0,
|
|
644
|
-
};
|
|
645
423
|
|
|
646
424
|
event.durationMs = Math.round(
|
|
647
425
|
event.durationMs || this.getDurationMs(event.startTimeMs)
|
|
@@ -650,21 +428,19 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
650
428
|
const context = JSON.stringify(
|
|
651
429
|
endContext(
|
|
652
430
|
event,
|
|
653
|
-
this.abbreviations,
|
|
654
431
|
this.eventStack.get(rootEvent.correlationId),
|
|
655
432
|
error
|
|
656
433
|
)
|
|
657
434
|
);
|
|
658
435
|
|
|
659
436
|
if (isRoot) {
|
|
660
|
-
queueInfo = this.getQueueInfo(event.correlationId);
|
|
661
437
|
this.discardMeasurements(rootEvent.correlationId);
|
|
662
438
|
} else {
|
|
663
439
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
664
440
|
}
|
|
665
441
|
|
|
666
442
|
this.logger.trace(
|
|
667
|
-
`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`,
|
|
443
|
+
`PerformanceClient: Performance measurement ended for '${event.name}': '${event.durationMs}' ms`,
|
|
668
444
|
event.correlationId
|
|
669
445
|
);
|
|
670
446
|
|
|
@@ -684,7 +460,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
684
460
|
(rootEvent.errorCode || rootEvent.subErrorCode)
|
|
685
461
|
) {
|
|
686
462
|
this.logger.trace(
|
|
687
|
-
`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`,
|
|
688
464
|
event.correlationId
|
|
689
465
|
);
|
|
690
466
|
rootEvent.errorCode = undefined;
|
|
@@ -696,7 +472,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
696
472
|
// Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.
|
|
697
473
|
finalEvent.incompleteSubMeasurements?.forEach((subMeasurement) => {
|
|
698
474
|
this.logger.trace(
|
|
699
|
-
`PerformanceClient: Incomplete submeasurement ${subMeasurement.name} found for ${event.name}`,
|
|
475
|
+
`PerformanceClient: Incomplete submeasurement '${subMeasurement.name}' found for '${event.name}'`,
|
|
700
476
|
finalEvent.correlationId
|
|
701
477
|
);
|
|
702
478
|
incompleteSubsCount++;
|
|
@@ -705,18 +481,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
705
481
|
|
|
706
482
|
finalEvent = {
|
|
707
483
|
...finalEvent,
|
|
708
|
-
queuedTimeMs: queueInfo.totalQueueTime,
|
|
709
|
-
queuedCount: queueInfo.totalQueueCount,
|
|
710
|
-
queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount,
|
|
711
484
|
status: PerformanceEventStatus.Completed,
|
|
712
485
|
incompleteSubsCount,
|
|
713
486
|
context,
|
|
714
487
|
};
|
|
715
|
-
if (account) {
|
|
716
|
-
finalEvent.accountType = getAccountType(account);
|
|
717
|
-
finalEvent.dataBoundary = account.dataBoundary;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
488
|
this.truncateIntegralFields(finalEvent);
|
|
721
489
|
this.emitEvents([finalEvent], event.correlationId);
|
|
722
490
|
|
|
@@ -732,7 +500,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
732
500
|
fields: { [key: string]: {} | undefined },
|
|
733
501
|
correlationId: string
|
|
734
502
|
): void {
|
|
735
|
-
this.logger.trace(
|
|
503
|
+
this.logger.trace(
|
|
504
|
+
"PerformanceClient: Updating static fields",
|
|
505
|
+
correlationId
|
|
506
|
+
);
|
|
736
507
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
737
508
|
if (event) {
|
|
738
509
|
this.eventsByCorrelationId.set(correlationId, {
|
|
@@ -756,7 +527,10 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
756
527
|
fields: { [key: string]: number | undefined },
|
|
757
528
|
correlationId: string
|
|
758
529
|
): void {
|
|
759
|
-
this.logger.trace(
|
|
530
|
+
this.logger.trace(
|
|
531
|
+
"PerformanceClient: Updating counters",
|
|
532
|
+
correlationId
|
|
533
|
+
);
|
|
760
534
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
761
535
|
if (event) {
|
|
762
536
|
for (const counter in fields) {
|
|
@@ -788,7 +562,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
788
562
|
const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
|
|
789
563
|
if (rootEvent) {
|
|
790
564
|
this.logger.trace(
|
|
791
|
-
`PerformanceClient: Performance measurement for ${event.name} added/updated`,
|
|
565
|
+
`PerformanceClient: Performance measurement for '${event.name}' added/updated`,
|
|
792
566
|
event.correlationId
|
|
793
567
|
);
|
|
794
568
|
rootEvent.incompleteSubMeasurements =
|
|
@@ -799,7 +573,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
799
573
|
});
|
|
800
574
|
} else {
|
|
801
575
|
this.logger.trace(
|
|
802
|
-
`PerformanceClient: Performance measurement for ${event.name} started`,
|
|
576
|
+
`PerformanceClient: Performance measurement for '${event.name}' started`,
|
|
803
577
|
event.correlationId
|
|
804
578
|
);
|
|
805
579
|
this.eventsByCorrelationId.set(event.correlationId, { ...event });
|
|
@@ -807,35 +581,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
807
581
|
}
|
|
808
582
|
}
|
|
809
583
|
|
|
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
584
|
/**
|
|
840
585
|
* Removes measurements and aux data for a given correlation id.
|
|
841
586
|
*
|
|
@@ -848,18 +593,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
848
593
|
);
|
|
849
594
|
this.eventsByCorrelationId.delete(correlationId);
|
|
850
595
|
|
|
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
596
|
this.logger.trace(
|
|
864
597
|
"PerformanceClient: Event stack discarded",
|
|
865
598
|
correlationId
|
|
@@ -877,7 +610,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
877
610
|
for (const [id, cb] of this.callbacks) {
|
|
878
611
|
if (cb.toString() === callback.toString()) {
|
|
879
612
|
this.logger.warning(
|
|
880
|
-
`PerformanceClient: Performance callback is already registered with id: ${id}
|
|
613
|
+
`PerformanceClient: Performance callback is already registered with id: ${id}`,
|
|
614
|
+
""
|
|
881
615
|
);
|
|
882
616
|
return id;
|
|
883
617
|
}
|
|
@@ -886,7 +620,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
886
620
|
const callbackId = this.generateId();
|
|
887
621
|
this.callbacks.set(callbackId, callback);
|
|
888
622
|
this.logger.verbose(
|
|
889
|
-
`PerformanceClient: Performance callback registered with id: ${callbackId}
|
|
623
|
+
`PerformanceClient: Performance callback registered with id: '${callbackId}'`,
|
|
624
|
+
""
|
|
890
625
|
);
|
|
891
626
|
|
|
892
627
|
return callbackId;
|
|
@@ -903,11 +638,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
903
638
|
|
|
904
639
|
if (result) {
|
|
905
640
|
this.logger.verbose(
|
|
906
|
-
`PerformanceClient: Performance callback ${callbackId} removed
|
|
641
|
+
`PerformanceClient: Performance callback '${callbackId}' removed.`,
|
|
642
|
+
""
|
|
907
643
|
);
|
|
908
644
|
} else {
|
|
909
645
|
this.logger.verbose(
|
|
910
|
-
`PerformanceClient: Performance callback ${callbackId} not removed
|
|
646
|
+
`PerformanceClient: Performance callback '${callbackId}' not removed.`,
|
|
647
|
+
""
|
|
911
648
|
);
|
|
912
649
|
}
|
|
913
650
|
|
|
@@ -929,7 +666,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
929
666
|
this.callbacks.forEach(
|
|
930
667
|
(callback: PerformanceCallbackFunction, callbackId: string) => {
|
|
931
668
|
this.logger.trace(
|
|
932
|
-
`PerformanceClient: Emitting event to callback ${callbackId}`,
|
|
669
|
+
`PerformanceClient: Emitting event to callback '${callbackId}'`,
|
|
933
670
|
correlationId
|
|
934
671
|
);
|
|
935
672
|
callback.apply(null, [events]);
|