@azure/msal-browser 5.15.0 → 5.17.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/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AccountManager.mjs.map +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +4 -2
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheHelpers.mjs.map +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CacheKeys.mjs.map +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/CookieStorage.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs.map +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/LocalStorage.mjs.map +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs.map +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +2 -1
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +2 -2
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs.map +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs.map +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs.map +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs.map +1 -1
- package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationError.mjs.map +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
- package/dist/custom_auth/core/error/MethodNotImplementedError.mjs.map +1 -1
- package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/MsalCustomAuthError.mjs.map +1 -1
- package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
- package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs.map +1 -1
- package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlError.mjs.map +1 -1
- package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
- package/dist/custom_auth/core/error/UnexpectedError.mjs.map +1 -1
- package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
- package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs.map +1 -1
- package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAccountAttributeError.mjs.map +1 -1
- package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs.map +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs.map +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs.map +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs.map +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs.map +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
- package/dist/custom_auth/index.mjs +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs.map +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs.map +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs.map +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthError.mjs.map +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs.map +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventHandler.mjs.map +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventMessage.mjs.map +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/event/EventType.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +77 -10
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/log-strings-mapping.json +7 -3
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +2 -2
- package/dist/naa/BridgeProxy.mjs.map +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs.map +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/network/FetchClient.mjs.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +21 -0
- package/dist/popup_relay/constants.mjs.map +1 -0
- package/dist/popup_relay/index.mjs +163 -0
- package/dist/popup_relay/index.mjs.map +1 -0
- package/dist/popup_relay/relayClient.mjs +114 -0
- package/dist/popup_relay/relayClient.mjs.map +1 -0
- package/dist/protocol/Authorize.mjs +42 -24
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/redirect_bridge/index.mjs.map +1 -1
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs.map +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.mjs +2 -2
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/Helpers.mjs.map +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs.map +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +7 -3
- package/lib/custom-auth-path/msal-custom-auth.cjs +5966 -5754
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +5966 -5754
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +7 -3
- package/lib/msal-browser.cjs +6801 -6567
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +6801 -6567
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +278 -0
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -0
- package/lib/popup-relay/msal-popup-relay.js +284 -0
- package/lib/popup-relay/msal-popup-relay.js.map +1 -0
- package/lib/popup-relay/msal-popup-relay.min.js +2 -0
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +39 -39
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +39 -39
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -2
- package/package.json +14 -3
- package/scripts/README.md +112 -0
- package/scripts/decode-logs.cjs +822 -0
- package/src/cache/BrowserCacheManager.ts +3 -4
- package/src/config/Configuration.ts +18 -0
- package/src/error/BrowserAuthErrorCodes.ts +1 -0
- package/src/interaction_client/PopupClient.ts +137 -23
- package/src/packageMetadata.ts +1 -1
- package/src/popup_relay/constants.ts +17 -0
- package/src/popup_relay/index.ts +221 -0
- package/src/popup_relay/relayClient.ts +178 -0
- package/src/protocol/Authorize.ts +76 -27
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/config/Configuration.d.ts +16 -0
- package/types/config/Configuration.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
- package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts +13 -0
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/popup_relay/constants.d.ts +13 -0
- package/types/popup_relay/constants.d.ts.map +1 -0
- package/types/popup_relay/index.d.cts +1 -0
- package/types/popup_relay/index.d.ts +42 -0
- package/types/popup_relay/index.d.ts.map +1 -0
- package/types/popup_relay/relayClient.d.ts +43 -0
- package/types/popup_relay/relayClient.d.ts.map +1 -0
- package/types/protocol/Authorize.d.ts +25 -0
- package/types/protocol/Authorize.d.ts.map +1 -1
|
@@ -0,0 +1,822 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*
|
|
7
|
+
* MSAL Browser Log Decoder
|
|
8
|
+
*
|
|
9
|
+
* This script decodes hashed logging strings from browser console logs back to their original messages.
|
|
10
|
+
* It processes log files where each MSAL log entry is on a separate line with module@version information.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* node scripts/decode-logs.cjs <path-to-log-file>
|
|
14
|
+
* node scripts/decode-logs.cjs --verbose <path-to-log-file>
|
|
15
|
+
* npm run decode-logs -- <path-to-log-file>
|
|
16
|
+
* npm run decode-logs -- --verbose /path/to/console.log
|
|
17
|
+
*
|
|
18
|
+
* Examples:
|
|
19
|
+
* node scripts/decode-logs.cjs ./console-logs.txt
|
|
20
|
+
* node scripts/decode-logs.cjs --verbose ./console-logs.txt
|
|
21
|
+
* npm run decode-logs -- ./logs/debug.log
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const fs = require('fs');
|
|
25
|
+
const path = require('path');
|
|
26
|
+
const https = require('https');
|
|
27
|
+
const http = require('http');
|
|
28
|
+
|
|
29
|
+
// Colors for console output
|
|
30
|
+
const colors = {
|
|
31
|
+
reset: '\x1b[0m',
|
|
32
|
+
bright: '\x1b[1m',
|
|
33
|
+
dim: '\x1b[2m',
|
|
34
|
+
red: '\x1b[31m',
|
|
35
|
+
green: '\x1b[32m',
|
|
36
|
+
yellow: '\x1b[33m',
|
|
37
|
+
blue: '\x1b[34m',
|
|
38
|
+
magenta: '\x1b[35m',
|
|
39
|
+
cyan: '\x1b[36m',
|
|
40
|
+
white: '\x1b[37m',
|
|
41
|
+
gray: '\x1b[90m'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Log level color mapping
|
|
45
|
+
const logLevelColors = {
|
|
46
|
+
error: colors.red,
|
|
47
|
+
errorpii: colors.red,
|
|
48
|
+
warning: colors.yellow,
|
|
49
|
+
info: colors.blue,
|
|
50
|
+
infopii: colors.blue,
|
|
51
|
+
verbose: colors.green,
|
|
52
|
+
verbosepii: colors.green,
|
|
53
|
+
trace: colors.magenta,
|
|
54
|
+
tracepii: colors.magenta,
|
|
55
|
+
unknown: colors.gray
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Global verbose mode flag
|
|
59
|
+
let isVerbose = false;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to log messages only in verbose mode
|
|
63
|
+
*/
|
|
64
|
+
function verboseLog(message) {
|
|
65
|
+
if (isVerbose) {
|
|
66
|
+
console.log(message);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Sets verbose mode
|
|
72
|
+
*/
|
|
73
|
+
function setVerbose(verbose) {
|
|
74
|
+
isVerbose = verbose;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Downloads a file from URL
|
|
79
|
+
*/
|
|
80
|
+
function downloadFile(url, options = {}) {
|
|
81
|
+
return new Promise((resolve, reject) => {
|
|
82
|
+
const client = url.startsWith('https:') ? https : http;
|
|
83
|
+
|
|
84
|
+
const request = client.get(url, options, (response) => {
|
|
85
|
+
if (response.statusCode !== 200) {
|
|
86
|
+
reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const chunks = [];
|
|
91
|
+
response.on('data', chunk => chunks.push(chunk));
|
|
92
|
+
response.on('end', () => resolve(Buffer.concat(chunks)));
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
request.on('error', reject);
|
|
96
|
+
request.setTimeout(30000, () => {
|
|
97
|
+
request.destroy();
|
|
98
|
+
reject(new Error('Request timeout'));
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Gets the cache directory path
|
|
105
|
+
*/
|
|
106
|
+
function getCacheDir() {
|
|
107
|
+
const homeDir = require('os').homedir();
|
|
108
|
+
const cacheDir = path.join(homeDir, '.msal-decoder-cache');
|
|
109
|
+
|
|
110
|
+
if (!fs.existsSync(cacheDir)) {
|
|
111
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return cacheDir;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gets the cached mapping file path
|
|
119
|
+
*/
|
|
120
|
+
function getCachedMappingPath(libraryName, version) {
|
|
121
|
+
const cacheDir = getCacheDir();
|
|
122
|
+
const filename = `${libraryName.replace('@', '').replace('/', '-')}-${version}.json`;
|
|
123
|
+
return path.join(cacheDir, filename);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Checks if cached mapping is valid (exists and not older than 24 hours)
|
|
128
|
+
*/
|
|
129
|
+
function isCacheValid(cachePath) {
|
|
130
|
+
if (!fs.existsSync(cachePath)) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const stats = fs.statSync(cachePath);
|
|
135
|
+
const oneDay = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
|
|
136
|
+
const isRecent = (Date.now() - stats.mtime.getTime()) < oneDay;
|
|
137
|
+
|
|
138
|
+
return isRecent;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Gets the mapping file paths for a library
|
|
143
|
+
*/
|
|
144
|
+
function getMappingPaths(libraryName) {
|
|
145
|
+
if (libraryName === '@azure/msal-browser') {
|
|
146
|
+
return [
|
|
147
|
+
'dist/log-strings-mapping.json',
|
|
148
|
+
'lib/custom-auth-path/log-strings-mapping.json'
|
|
149
|
+
];
|
|
150
|
+
} else if (libraryName === '@azure/msal-common') {
|
|
151
|
+
return [
|
|
152
|
+
'dist-browser/log-strings-mapping.json'
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return ['dist/log-strings-mapping.json'];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Gets local mapping file paths relative to script directory
|
|
161
|
+
*/
|
|
162
|
+
function getLocalMappingPaths(libraryName, scriptDir) {
|
|
163
|
+
const paths = [];
|
|
164
|
+
|
|
165
|
+
if (libraryName === '@azure/msal-browser') {
|
|
166
|
+
paths.push(
|
|
167
|
+
path.join(scriptDir, '..', 'dist', 'log-strings-mapping.json'),
|
|
168
|
+
path.join(scriptDir, '..', 'lib', 'custom-auth-path', 'log-strings-mapping.json')
|
|
169
|
+
);
|
|
170
|
+
} else if (libraryName === '@azure/msal-common') {
|
|
171
|
+
paths.push(
|
|
172
|
+
path.join(scriptDir, '..', '..', 'msal-common', 'dist-browser', 'log-strings-mapping.json')
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return paths;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Loads local mapping files as fallback
|
|
181
|
+
*/
|
|
182
|
+
function loadLocalMapping(libraryName, scriptDir) {
|
|
183
|
+
const localPaths = getLocalMappingPaths(libraryName, scriptDir);
|
|
184
|
+
|
|
185
|
+
for (const localPath of localPaths) {
|
|
186
|
+
if (fs.existsSync(localPath)) {
|
|
187
|
+
try {
|
|
188
|
+
const content = fs.readFileSync(localPath, 'utf8');
|
|
189
|
+
const data = JSON.parse(content);
|
|
190
|
+
verboseLog(`${colors.green}✓ Using local mapping file: ${localPath}${colors.reset}`);
|
|
191
|
+
return normalizeMapping(data);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
verboseLog(`${colors.yellow}⚠ Failed to load local mapping ${localPath}: ${error.message}${colors.reset}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Normalizes mapping data to consistent format
|
|
203
|
+
*/
|
|
204
|
+
function normalizeMapping(data) {
|
|
205
|
+
if (data.logStrings) {
|
|
206
|
+
return data;
|
|
207
|
+
} else if (data.mappings) {
|
|
208
|
+
const normalized = { logStrings: {} };
|
|
209
|
+
for (const [hash, mapping] of Object.entries(data.mappings)) {
|
|
210
|
+
normalized.logStrings[hash] = mapping.message || mapping;
|
|
211
|
+
}
|
|
212
|
+
return normalized;
|
|
213
|
+
}
|
|
214
|
+
return data;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Resolves a dependency version spec to a concrete published version. MSAL pins
|
|
219
|
+
* its internal @azure/msal-* dependencies to exact versions, so any range prefix
|
|
220
|
+
* (^, ~, >=, etc.) is stripped to obtain the underlying version.
|
|
221
|
+
*/
|
|
222
|
+
function resolveDependencyVersion(spec) {
|
|
223
|
+
if (typeof spec !== 'string') {
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
const match = spec.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/);
|
|
227
|
+
return match ? match[0] : null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Fetches remote mapping from npm registry
|
|
232
|
+
*/
|
|
233
|
+
async function fetchRemoteMapping(libraryName, version, registryUrl = 'https://registry.npmjs.org', visited = new Set()) {
|
|
234
|
+
verboseLog(`${colors.dim}Fetching mapping for ${libraryName}@${version} from npm registry${colors.reset}`);
|
|
235
|
+
|
|
236
|
+
// Check cache first
|
|
237
|
+
const cachePath = getCachedMappingPath(libraryName, version);
|
|
238
|
+
if (isCacheValid(cachePath)) {
|
|
239
|
+
verboseLog(`${colors.dim}Using cached mapping from ${cachePath}${colors.reset}`);
|
|
240
|
+
const cachedContent = fs.readFileSync(cachePath, 'utf8');
|
|
241
|
+
const cachedData = JSON.parse(cachedContent);
|
|
242
|
+
return normalizeMapping(cachedData);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
try {
|
|
246
|
+
// Fetch package metadata
|
|
247
|
+
const packageUrl = `${registryUrl}/${libraryName}`;
|
|
248
|
+
const metadata = await downloadFile(packageUrl);
|
|
249
|
+
const packageData = JSON.parse(metadata.toString());
|
|
250
|
+
|
|
251
|
+
// Get the specific version or latest
|
|
252
|
+
const versionData = version === 'latest'
|
|
253
|
+
? packageData.versions[packageData['dist-tags'].latest]
|
|
254
|
+
: packageData.versions[version];
|
|
255
|
+
|
|
256
|
+
if (!versionData) {
|
|
257
|
+
throw new Error(`Version ${version} not found for ${libraryName}`);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const dependencies = versionData.dependencies || {};
|
|
261
|
+
|
|
262
|
+
// Get tarball URL and download it
|
|
263
|
+
const tarballUrl = versionData.dist.tarball;
|
|
264
|
+
verboseLog(`${colors.dim}Downloading tarball from ${tarballUrl}${colors.reset}`);
|
|
265
|
+
|
|
266
|
+
const tarballBuffer = await downloadFile(tarballUrl);
|
|
267
|
+
const mappingPaths = getMappingPaths(libraryName);
|
|
268
|
+
const allMappings = { logStrings: {} };
|
|
269
|
+
|
|
270
|
+
// Extract mapping files from tarball
|
|
271
|
+
for (const mappingPath of mappingPaths) {
|
|
272
|
+
try {
|
|
273
|
+
const mappingContent = await extractFileFromTarball(tarballBuffer, mappingPath);
|
|
274
|
+
if (mappingContent) {
|
|
275
|
+
const mappingData = JSON.parse(mappingContent);
|
|
276
|
+
const normalized = normalizeMapping(mappingData);
|
|
277
|
+
|
|
278
|
+
if (normalized.logStrings) {
|
|
279
|
+
Object.assign(allMappings.logStrings, normalized.logStrings);
|
|
280
|
+
verboseLog(`${colors.green} ✓ Found mapping file: ${mappingPath}${colors.reset}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
} catch (error) {
|
|
284
|
+
verboseLog(`${colors.dim} - Not found: ${mappingPath}${colors.reset}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// @azure/msal-common (and other @azure/msal-* dependencies) emit their log
|
|
289
|
+
// strings through the Logger created by the wrapping package (e.g. msal-browser),
|
|
290
|
+
// so those lines are labeled with the wrapper's package name rather than the
|
|
291
|
+
// originating package. Merge the transitive @azure/msal-* dependency mappings so
|
|
292
|
+
// those hashes resolve too. Own-package strings take precedence over dependency
|
|
293
|
+
// strings on hash collisions.
|
|
294
|
+
visited.add(`${libraryName}@${version}`);
|
|
295
|
+
for (const [depName, depSpec] of Object.entries(dependencies)) {
|
|
296
|
+
if (!depName.startsWith('@azure/msal-')) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const depVersion = resolveDependencyVersion(depSpec);
|
|
300
|
+
if (!depVersion || visited.has(`${depName}@${depVersion}`)) {
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
verboseLog(`${colors.dim} Resolving dependency mapping ${depName}@${depVersion}${colors.reset}`);
|
|
304
|
+
const depMapping = await fetchRemoteMapping(depName, depVersion, registryUrl, visited);
|
|
305
|
+
if (depMapping && depMapping.logStrings) {
|
|
306
|
+
let added = 0;
|
|
307
|
+
for (const [hash, message] of Object.entries(depMapping.logStrings)) {
|
|
308
|
+
if (!(hash in allMappings.logStrings)) {
|
|
309
|
+
allMappings.logStrings[hash] = message;
|
|
310
|
+
added++;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
verboseLog(`${colors.green} ✓ Merged ${added} strings from ${depName}@${depVersion}${colors.reset}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (Object.keys(allMappings.logStrings).length > 0) {
|
|
318
|
+
// Cache the mapping
|
|
319
|
+
fs.writeFileSync(cachePath, JSON.stringify(allMappings, null, 2), 'utf8');
|
|
320
|
+
verboseLog(`${colors.dim}Cached mapping to ${cachePath}${colors.reset}`);
|
|
321
|
+
return allMappings;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
throw new Error('No mapping files found in package');
|
|
325
|
+
} catch (error) {
|
|
326
|
+
verboseLog(`${colors.yellow}Failed to fetch remote mapping: ${error.message}${colors.reset}`);
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Extracts a specific file from a gzipped tarball buffer
|
|
333
|
+
*/
|
|
334
|
+
async function extractFileFromTarball(tarballBuffer, targetPath) {
|
|
335
|
+
const zlib = require('zlib');
|
|
336
|
+
|
|
337
|
+
return new Promise((resolve, reject) => {
|
|
338
|
+
try {
|
|
339
|
+
zlib.gunzip(tarballBuffer, (err, decompressed) => {
|
|
340
|
+
if (err) {
|
|
341
|
+
reject(new Error(`Failed to decompress tarball: ${err.message}`));
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
let offset = 0;
|
|
346
|
+
const buffer = decompressed;
|
|
347
|
+
|
|
348
|
+
while (offset < buffer.length) {
|
|
349
|
+
if (offset + 512 > buffer.length) break;
|
|
350
|
+
|
|
351
|
+
const header = buffer.slice(offset, offset + 512);
|
|
352
|
+
const filename = header.toString('utf8', 0, 100).replace(/\0.*$/, '');
|
|
353
|
+
const fileSizeOctal = header.toString('utf8', 124, 136).replace(/\0.*$/, '').trim();
|
|
354
|
+
|
|
355
|
+
if (!fileSizeOctal) {
|
|
356
|
+
offset += 512;
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const fileSize = parseInt(fileSizeOctal, 8) || 0;
|
|
361
|
+
const paddedSize = Math.ceil(fileSize / 512) * 512;
|
|
362
|
+
|
|
363
|
+
if (filename.endsWith(targetPath) || filename === `package/${targetPath}`) {
|
|
364
|
+
const fileData = buffer.slice(offset + 512, offset + 512 + fileSize);
|
|
365
|
+
resolve(fileData.toString('utf8'));
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
offset += 512 + paddedSize;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
resolve(null);
|
|
373
|
+
});
|
|
374
|
+
} catch (error) {
|
|
375
|
+
reject(new Error(`Tar extraction failed: ${error.message}`));
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Parses a log line and extracts module@version and hash information
|
|
382
|
+
*/
|
|
383
|
+
function parseLogLine(line) {
|
|
384
|
+
const msalRegex = /(@azure\/msal-[a-z-]+|msal(?:\.[a-z]+)+)@([^:\s]+)\s*:\s*\w+\s*-\s*([a-zA-Z0-9]{6})(?=\s|$)([^\r\n]*)/;
|
|
385
|
+
const match = line.match(msalRegex);
|
|
386
|
+
|
|
387
|
+
if (!match) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const [, rawPackage, version, hash, rawArgs] = match;
|
|
392
|
+
const module = normalizeModuleName(rawPackage);
|
|
393
|
+
|
|
394
|
+
// Only msal-browser and msal-common strings are decodable by this script.
|
|
395
|
+
// Other libraries (msal-react, msal-angular, msal-node, ...) are skipped.
|
|
396
|
+
if (!module) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
return {
|
|
401
|
+
fullLine: line,
|
|
402
|
+
moduleVersion: `@azure/${module}@${version}`,
|
|
403
|
+
hash: hash,
|
|
404
|
+
// Trailing variable values appended after the hash (may be empty)
|
|
405
|
+
rawArgs: rawArgs || ''
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Normalizes any MSAL package name or SKU to a canonical module family used as
|
|
411
|
+
* the mapping pool key. Returns "msal-browser", "msal-common", or null when the
|
|
412
|
+
* package is not one this script can decode.
|
|
413
|
+
*
|
|
414
|
+
* Examples:
|
|
415
|
+
* "@azure/msal-browser" -> "msal-browser"
|
|
416
|
+
* "msal.js.browser" -> "msal-browser" (browser SKU)
|
|
417
|
+
* "msal.js" -> "msal-browser" (generic browser SKU fallback)
|
|
418
|
+
* "@azure/msal-common" -> "msal-common"
|
|
419
|
+
* "@azure/msal-react" -> null (not decoded here)
|
|
420
|
+
*/
|
|
421
|
+
function normalizeModuleName(rawPackage) {
|
|
422
|
+
if (rawPackage === '@azure/msal-common') {
|
|
423
|
+
return 'msal-common';
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Everything in the browser family: the scoped package, the browser SKU, or
|
|
427
|
+
// the generic "msal.js" SKU.
|
|
428
|
+
if (
|
|
429
|
+
rawPackage === '@azure/msal-browser' ||
|
|
430
|
+
rawPackage.startsWith('msal.js')
|
|
431
|
+
) {
|
|
432
|
+
return 'msal-browser';
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return null;
|
|
436
|
+
}/**
|
|
437
|
+
* Parses log file and extracts all MSAL entries while preserving all original lines
|
|
438
|
+
*/
|
|
439
|
+
function parseLogFile(filePath) {
|
|
440
|
+
if (!fs.existsSync(filePath)) {
|
|
441
|
+
throw new Error(`Log file not found: ${filePath}`);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
445
|
+
const lines = content.split('\n');
|
|
446
|
+
|
|
447
|
+
const entries = [];
|
|
448
|
+
const moduleVersionsSet = new Set();
|
|
449
|
+
const allLines = [];
|
|
450
|
+
|
|
451
|
+
for (let i = 0; i < lines.length; i++) {
|
|
452
|
+
const line = lines[i];
|
|
453
|
+
const parsed = parseLogLine(line);
|
|
454
|
+
|
|
455
|
+
if (parsed) {
|
|
456
|
+
entries.push({ ...parsed, lineIndex: i });
|
|
457
|
+
moduleVersionsSet.add(parsed.moduleVersion);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
allLines.push(line);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return {
|
|
464
|
+
entries,
|
|
465
|
+
moduleVersions: Array.from(moduleVersionsSet),
|
|
466
|
+
allLines
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Loads mappings for all required module@version combinations
|
|
472
|
+
*/
|
|
473
|
+
async function loadMappings(moduleVersions) {
|
|
474
|
+
const mappings = {};
|
|
475
|
+
const uniqueVersions = [...new Set(moduleVersions)];
|
|
476
|
+
|
|
477
|
+
verboseLog(`${colors.cyan}Downloading mappings for ${uniqueVersions.length} unique module@version combination(s)${colors.reset}\n`);
|
|
478
|
+
|
|
479
|
+
for (const moduleVersion of uniqueVersions) {
|
|
480
|
+
const [moduleName, version] = moduleVersion.split('@').filter(Boolean);
|
|
481
|
+
const fullModuleName = `@${moduleName}`;
|
|
482
|
+
|
|
483
|
+
verboseLog(`${colors.cyan}Loading mapping for ${fullModuleName}@${version}${colors.reset}`);
|
|
484
|
+
|
|
485
|
+
const mapping = await fetchRemoteMapping(fullModuleName, version);
|
|
486
|
+
|
|
487
|
+
if (mapping) {
|
|
488
|
+
mappings[moduleVersion] = mapping;
|
|
489
|
+
verboseLog(`${colors.green}✓ Loaded ${Object.keys(mapping.logStrings || {}).length} strings for ${moduleVersion}${colors.reset}`);
|
|
490
|
+
} else {
|
|
491
|
+
const localMapping = loadLocalMapping(fullModuleName, __dirname);
|
|
492
|
+
if (localMapping) {
|
|
493
|
+
mappings[moduleVersion] = localMapping;
|
|
494
|
+
verboseLog(`${colors.green}✓ Using local mapping as fallback for ${moduleVersion}${colors.reset}`);
|
|
495
|
+
} else {
|
|
496
|
+
console.error(`${colors.yellow}⚠ Warning: Could not load mapping for ${moduleVersion}${colors.reset}`);
|
|
497
|
+
mappings[moduleVersion] = { logStrings: {} };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
verboseLog('');
|
|
503
|
+
return mappings;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Finds all `${...}` placeholder spans in a decoded template message, in source
|
|
508
|
+
* order. Brace depth is tracked so nested braces (e.g. `${JSON.stringify({a:1})}`)
|
|
509
|
+
* are handled correctly. Returns an array of { start, end } where `start` is the
|
|
510
|
+
* index of the `$` and `end` is the index of the matching closing `}`.
|
|
511
|
+
*/
|
|
512
|
+
function findPlaceholders(template) {
|
|
513
|
+
const spans = [];
|
|
514
|
+
let i = 0;
|
|
515
|
+
|
|
516
|
+
while (i < template.length) {
|
|
517
|
+
if (template[i] === '$' && template[i + 1] === '{') {
|
|
518
|
+
const start = i;
|
|
519
|
+
let j = i + 2;
|
|
520
|
+
let depth = 1;
|
|
521
|
+
|
|
522
|
+
while (j < template.length && depth > 0) {
|
|
523
|
+
if (template[j] === '{') {
|
|
524
|
+
depth++;
|
|
525
|
+
} else if (template[j] === '}') {
|
|
526
|
+
depth--;
|
|
527
|
+
if (depth === 0) {
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
j++;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
spans.push({ start, end: j });
|
|
535
|
+
i = j + 1;
|
|
536
|
+
} else {
|
|
537
|
+
i++;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return spans;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Injects the runtime variable values captured after a hash into the decoded
|
|
546
|
+
* template's `${...}` placeholders.
|
|
547
|
+
*
|
|
548
|
+
* Values are appended by the logger-minify plugin in the same source order as
|
|
549
|
+
* the placeholders, separated by single spaces. They are mapped one-to-one onto
|
|
550
|
+
* the placeholders; if more tokens than placeholders are present (e.g. a trailing
|
|
551
|
+
* value contained spaces), the final placeholder absorbs the remaining tokens.
|
|
552
|
+
* Placeholders without a corresponding value are left intact so it is obvious the
|
|
553
|
+
* value was not captured.
|
|
554
|
+
*
|
|
555
|
+
* @param {string} template Decoded message, e.g. "'${a}' from '${b}'"
|
|
556
|
+
* @param {string} rawArgs Trailing values from the log line, e.g. " oob ext-id"
|
|
557
|
+
* @returns {string} The template with placeholders substituted by their values
|
|
558
|
+
*/
|
|
559
|
+
function injectVariables(template, rawArgs) {
|
|
560
|
+
const spans = findPlaceholders(template);
|
|
561
|
+
if (spans.length === 0) {
|
|
562
|
+
return template;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const argsString = (rawArgs || '').trim();
|
|
566
|
+
if (!argsString) {
|
|
567
|
+
// No values captured (e.g. legacy logs or telemetry-style bare hash)
|
|
568
|
+
return template;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const tokens = argsString.split(/\s+/);
|
|
572
|
+
|
|
573
|
+
// Map tokens onto placeholders in order
|
|
574
|
+
const values = [];
|
|
575
|
+
if (tokens.length <= spans.length) {
|
|
576
|
+
for (let k = 0; k < spans.length; k++) {
|
|
577
|
+
values.push(k < tokens.length ? tokens[k] : null);
|
|
578
|
+
}
|
|
579
|
+
} else {
|
|
580
|
+
for (let k = 0; k < spans.length - 1; k++) {
|
|
581
|
+
values.push(tokens[k]);
|
|
582
|
+
}
|
|
583
|
+
// Last placeholder absorbs any remaining tokens
|
|
584
|
+
values.push(tokens.slice(spans.length - 1).join(' '));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// Replace from end to start to keep earlier indices valid
|
|
588
|
+
let result = template;
|
|
589
|
+
for (let k = spans.length - 1; k >= 0; k--) {
|
|
590
|
+
const value = values[k];
|
|
591
|
+
if (value === null || value === undefined) {
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
result =
|
|
595
|
+
result.slice(0, spans[k].start) +
|
|
596
|
+
value +
|
|
597
|
+
result.slice(spans[k].end + 1);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
return result;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Decodes log entries using the provided mappings while preserving all original lines
|
|
605
|
+
*/
|
|
606
|
+
function decodeLogEntries(entries, mappings, allLines, useColors = true) {
|
|
607
|
+
const decodedLines = [...allLines]; // Start with all original lines
|
|
608
|
+
const stats = { total: 0, decoded: 0, notFound: 0, nonMsal: allLines.length - entries.length };
|
|
609
|
+
|
|
610
|
+
// Create a map of MSAL entries by line index for efficient lookup
|
|
611
|
+
const msalEntriesByLine = new Map();
|
|
612
|
+
for (const entry of entries) {
|
|
613
|
+
msalEntriesByLine.set(entry.lineIndex, entry);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// Process each MSAL entry and replace the corresponding line if we can decode it
|
|
617
|
+
for (const entry of entries) {
|
|
618
|
+
stats.total++;
|
|
619
|
+
|
|
620
|
+
let decodedMessage = null;
|
|
621
|
+
|
|
622
|
+
// First try the module-specific mapping
|
|
623
|
+
const moduleMapping = mappings[entry.moduleVersion];
|
|
624
|
+
if (moduleMapping && moduleMapping.logStrings && moduleMapping.logStrings[entry.hash]) {
|
|
625
|
+
decodedMessage = moduleMapping.logStrings[entry.hash];
|
|
626
|
+
} else {
|
|
627
|
+
// If not found in module-specific mapping, search across all mappings
|
|
628
|
+
for (const [mappingKey, mapping] of Object.entries(mappings)) {
|
|
629
|
+
if (mapping && mapping.logStrings && mapping.logStrings[entry.hash]) {
|
|
630
|
+
decodedMessage = mapping.logStrings[entry.hash];
|
|
631
|
+
verboseLog(`${colors.dim}Hash ${entry.hash} found in ${mappingKey} instead of ${entry.moduleVersion}${colors.reset}`);
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if (decodedMessage) {
|
|
638
|
+
// Extract log level from original line if possible
|
|
639
|
+
const logLevelMatch = entry.fullLine.match(/\b(Error|ErrorPii|Warning|Info|InfoPii|Verbose|VerbosePii|Trace|TracePii)\b/i);
|
|
640
|
+
const logLevel = logLevelMatch ? logLevelMatch[1].toLowerCase() : 'unknown';
|
|
641
|
+
|
|
642
|
+
// Inject any runtime variable values captured after the hash into the
|
|
643
|
+
// decoded template's ${...} placeholders
|
|
644
|
+
const injectedMessage = injectVariables(decodedMessage, entry.rawArgs);
|
|
645
|
+
|
|
646
|
+
// The encoded span in the original line is the hash plus its trailing
|
|
647
|
+
// variable values; replace the whole span so the raw values are not
|
|
648
|
+
// left duplicated after the decoded message.
|
|
649
|
+
const encoded = `${entry.hash}${entry.rawArgs || ''}`;
|
|
650
|
+
const replacementText = useColors
|
|
651
|
+
? `${logLevelColors[logLevel] || colors.gray}${injectedMessage}${colors.reset}`
|
|
652
|
+
: injectedMessage;
|
|
653
|
+
|
|
654
|
+
// Use a function replacement so '$' sequences in values/messages are
|
|
655
|
+
// treated literally (not as String.replace special patterns).
|
|
656
|
+
const decodedLine = entry.fullLine.replace(encoded, () => replacementText);
|
|
657
|
+
|
|
658
|
+
// Replace the line at the correct index
|
|
659
|
+
decodedLines[entry.lineIndex] = decodedLine;
|
|
660
|
+
stats.decoded++;
|
|
661
|
+
} else {
|
|
662
|
+
stats.notFound++;
|
|
663
|
+
// Keep the original line (already in decodedLines from the copy)
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
return { decodedLines, stats };
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Parses command line arguments
|
|
672
|
+
*/
|
|
673
|
+
function parseArguments() {
|
|
674
|
+
const args = process.argv.slice(2);
|
|
675
|
+
let filePath = null;
|
|
676
|
+
let help = false;
|
|
677
|
+
|
|
678
|
+
for (let i = 0; i < args.length; i++) {
|
|
679
|
+
const arg = args[i];
|
|
680
|
+
|
|
681
|
+
if (arg === '--verbose' || arg === '-V') {
|
|
682
|
+
setVerbose(true);
|
|
683
|
+
} else if (arg === '--help' || arg === '-h') {
|
|
684
|
+
help = true;
|
|
685
|
+
} else if (!arg.startsWith('-')) {
|
|
686
|
+
filePath = arg;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
return { filePath, help };
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Shows usage information
|
|
695
|
+
*/
|
|
696
|
+
function showUsage() {
|
|
697
|
+
console.log(`
|
|
698
|
+
${colors.bright}MSAL Browser Log Decoder${colors.reset}
|
|
699
|
+
|
|
700
|
+
${colors.bright}Usage:${colors.reset}
|
|
701
|
+
node scripts/decode-logs.cjs [options] <path-to-log-file>
|
|
702
|
+
|
|
703
|
+
${colors.bright}Options:${colors.reset}
|
|
704
|
+
--verbose, -V Enable verbose output for debugging
|
|
705
|
+
--help, -h Show this help message
|
|
706
|
+
|
|
707
|
+
${colors.bright}Examples:${colors.reset}
|
|
708
|
+
node scripts/decode-logs.cjs ./console-logs.txt
|
|
709
|
+
node scripts/decode-logs.cjs --verbose /Users/user/Downloads/browser-console.log
|
|
710
|
+
npm run decode-logs -- ./logs/debug.log
|
|
711
|
+
|
|
712
|
+
${colors.bright}Log Format:${colors.reset}
|
|
713
|
+
Expected format per line:
|
|
714
|
+
[timestamp] : [correlation-id] : @azure/[module]@[version] : [LogLevel] - [hash][ values...]
|
|
715
|
+
|
|
716
|
+
The [hash] is a 6-character code, optionally followed by space-separated
|
|
717
|
+
runtime values that are injected into the message's placeholders. Keep those
|
|
718
|
+
trailing tokens intact - stripping them prevents variable injection.
|
|
719
|
+
|
|
720
|
+
Example:
|
|
721
|
+
[Tue, 07 Oct 2025 16:50:29 GMT] : [] : @azure/msal-browser@4.13.1 : Verbose - 0hoqeo
|
|
722
|
+
[Thu, 11 Jun 2026 21:02:51 GMT] : [019eb87e] : @azure/msal-common@16.6.1 : Verbose - 1q3g2x 72f988bf {tenantid}
|
|
723
|
+
`);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
async function main() {
|
|
727
|
+
// Parse command line arguments
|
|
728
|
+
const { filePath, help } = parseArguments();
|
|
729
|
+
|
|
730
|
+
if (help) {
|
|
731
|
+
showUsage();
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
if (!filePath) {
|
|
736
|
+
console.error(`${colors.red}Error: No log file path provided${colors.reset}`);
|
|
737
|
+
showUsage();
|
|
738
|
+
process.exit(1);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
try {
|
|
742
|
+
console.log(`${colors.bright}${colors.blue}MSAL Browser Log Decoder${colors.reset}\n`);
|
|
743
|
+
|
|
744
|
+
// Step 1: Parse log file and identify all unique module@version combinations
|
|
745
|
+
verboseLog(`${colors.cyan}Step 1: Scanning log file...${colors.reset}`);
|
|
746
|
+
const { entries, moduleVersions, allLines } = parseLogFile(filePath);
|
|
747
|
+
verboseLog(`${colors.green}✓ Found ${entries.length} log entries${colors.reset}`);
|
|
748
|
+
verboseLog(`${colors.green}✓ Detected ${moduleVersions.length} unique module@version combination(s): ${moduleVersions.join(', ')}${colors.reset}\n`);
|
|
749
|
+
|
|
750
|
+
// Step 2: Download all required mappings (only once per unique module@version)
|
|
751
|
+
verboseLog(`${colors.cyan}Step 2: Downloading mappings...${colors.reset}`);
|
|
752
|
+
const mappings = await loadMappings(moduleVersions);
|
|
753
|
+
|
|
754
|
+
// Step 3: Decode log entries
|
|
755
|
+
verboseLog(`${colors.cyan}Step 3: Decoding log entries...${colors.reset}`);
|
|
756
|
+
const { decodedLines, stats } = decodeLogEntries(entries, mappings, allLines, false); // No color for file output
|
|
757
|
+
|
|
758
|
+
// Step 4: Generate output file path
|
|
759
|
+
const parsedPath = path.parse(filePath);
|
|
760
|
+
const outputFilePath = path.join(
|
|
761
|
+
parsedPath.dir,
|
|
762
|
+
`${parsedPath.name}-decoded${parsedPath.ext}`
|
|
763
|
+
);
|
|
764
|
+
|
|
765
|
+
// Step 5: Write decoded logs to file
|
|
766
|
+
fs.writeFileSync(outputFilePath, decodedLines.join('\n'), 'utf8');
|
|
767
|
+
|
|
768
|
+
console.log(`${colors.green}✓ Successfully decoded logs${colors.reset}`);
|
|
769
|
+
console.log(`${colors.cyan}Output saved to: ${colors.bright}${outputFilePath}${colors.reset}\n`);
|
|
770
|
+
|
|
771
|
+
// Show stats
|
|
772
|
+
console.log(`${colors.bright}${colors.cyan}Decoding Statistics:${colors.reset}`);
|
|
773
|
+
console.log(`${colors.dim}Total MSAL entries: ${stats.total}${colors.reset}`);
|
|
774
|
+
console.log(`${colors.green}Successfully decoded: ${stats.decoded}${colors.reset}`);
|
|
775
|
+
if (stats.notFound > 0) {
|
|
776
|
+
console.log(`${colors.yellow}Hashes not found: ${stats.notFound}${colors.reset}`);
|
|
777
|
+
}
|
|
778
|
+
if (stats.nonMsal > 0) {
|
|
779
|
+
console.log(`${colors.dim}Non-MSAL lines: ${stats.nonMsal}${colors.reset}`);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
if (moduleVersions.length > 1) {
|
|
783
|
+
verboseLog(`\n${colors.dim}Note: Multiple module versions detected in the same file${colors.reset}`);
|
|
784
|
+
}
|
|
785
|
+
} catch (error) {
|
|
786
|
+
console.error(`${colors.red}Error: ${error.message}${colors.reset}`);
|
|
787
|
+
verboseLog(error.stack);
|
|
788
|
+
process.exit(1);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// Export common functions for reuse in other scripts
|
|
793
|
+
module.exports = {
|
|
794
|
+
colors,
|
|
795
|
+
verboseLog,
|
|
796
|
+
setVerbose,
|
|
797
|
+
downloadFile,
|
|
798
|
+
getCacheDir,
|
|
799
|
+
getCachedMappingPath,
|
|
800
|
+
isCacheValid,
|
|
801
|
+
getMappingPaths,
|
|
802
|
+
getLocalMappingPaths,
|
|
803
|
+
loadLocalMapping,
|
|
804
|
+
normalizeMapping,
|
|
805
|
+
fetchRemoteMapping,
|
|
806
|
+
extractFileFromTarball,
|
|
807
|
+
parseLogLine,
|
|
808
|
+
parseLogFile,
|
|
809
|
+
normalizeModuleName,
|
|
810
|
+
loadMappings,
|
|
811
|
+
decodeLogEntries,
|
|
812
|
+
findPlaceholders,
|
|
813
|
+
injectVariables,
|
|
814
|
+
parseArguments,
|
|
815
|
+
showUsage,
|
|
816
|
+
main
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
// Run if called directly
|
|
820
|
+
if (require.main === module) {
|
|
821
|
+
main();
|
|
822
|
+
}
|