diff --git a/.pipelines/3p-e2e.yml b/.pipelines/3p-e2e.yml index 9e9a76c9d1..93369a53be 100644 --- a/.pipelines/3p-e2e.yml +++ b/.pipelines/3p-e2e.yml @@ -77,6 +77,7 @@ extends: - "onPageLoad" - "pop" - "customizable-e2e-test" + - "nativeAuthSample" debug: ${{ parameters.debug }} npmInstallTimeout: ${{ parameters.npmInstallTimeout }} - ${{ if eq(parameters.runNodeTests, true) }}: diff --git a/change/@azure-msal-browser-2567a5c9-97e2-49b6-b45c-c1d7f790cff2.json b/change/@azure-msal-browser-2567a5c9-97e2-49b6-b45c-c1d7f790cff2.json new file mode 100644 index 0000000000..ab8669926d --- /dev/null +++ b/change/@azure-msal-browser-2567a5c9-97e2-49b6-b45c-c1d7f790cff2.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add non-OTP E2E tests", + "packageName": "@azure/msal-browser", + "email": "ydi.w127@gmail.com", + "dependentChangeType": "patch" +} diff --git a/lib/msal-browser/rollup.config.js b/lib/msal-browser/rollup.config.js index 72a2c9001e..0f316d3089 100644 --- a/lib/msal-browser/rollup.config.js +++ b/lib/msal-browser/rollup.config.js @@ -182,4 +182,35 @@ export default [ }), ], }, + { + // Custom Auth - UMD build + input: "src/custom_auth/index.ts", + output: [ + { + dir: "lib/custom-auth-path", + format: "umd", + name: "msalCustomAuth", + banner: fileHeader, + inlineDynamicImports: true, + sourcemap: true, + entryFileNames: "msal-custom-auth.js", + }, + ], + plugins: [ + nodeResolve({ + browser: true, + resolveOnly: ["@azure/msal-common", "tslib"], + }), + typescript({ + typescript: require("typescript"), + tsconfig: "tsconfig.custom-auth.build.json", + sourceMap: true, + compilerOptions: { + outDir: "lib/custom-auth-path/types", + declaration: false, + declarationMap: false, + }, + }), + ], + }, ]; diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/README.md b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/README.md new file mode 100644 index 0000000000..599e2665d8 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/README.md @@ -0,0 +1,331 @@ +# MSAL Native Auth Sample + +This sample demonstrates how to use the Native Authentication capabilities of the Microsoft Authentication Library (MSAL) for JavaScript in a browser environment. Native Authentication provides a customizable and secure way to implement authentication flows directly in your application. + +[Previous sections remain unchanged up to Authentication Flow Configurations] + +## Authentication Flow Configurations + +Each authentication flow requires specific query parameters to configure the correct endpoint: + +1. Email + Password Flow: + ``` + ?usePwdConfig=true + ``` + +2. Email + OTP Flow: + ``` + ?useOtpConfig=true + ``` + +3. Email + Password Redirect Flow: + ``` + ?useOtpConfig=true&useRedirectConfig=true + ``` + +## All E2E Tests + +### Sign In Tests (`signin.spec.ts`) + +#### 1. Password-based Authentication + +2. **Install dependencies**: + + ```bash + npm install + ``` + +3. **Build project**: + + Build msal-browser package + + ```bash + npm run build:package + ``` + + Build msal-node package + + ```bash + cd ../../../lib/msal-node && npm run build:all + ``` + +4. **Configure the application**: + + Open `app/authConfig.js` and update with your settings: + + ```javascript + const msalConfig = { + customAuth: { + challengeTypes: ["password", "oob", "redirect"], + authApiProxyUrl: "YOUR_AUTH_PROXY_URL", + }, + auth: { + clientId: "YOUR_CLIENT_ID", + authority: "https://YOUR_TENANT.ciamlogin.com", + redirectUri: "/", + }, + // Additional configuration... + }; + ``` + +5. **Locate folder VanillaJSTestApp2.0 folder and start the development server**: + + ```bash + npm start -- --port 30670 --sample nativeAuthSample + ``` + +6. **Open your browser**: + + Navigate to [http://localhost:30670](http://localhost:30670) + +## Authentication Flows + +### Sign In + +The sample supports multiple sign-in methods: + +1. **Email/Password Authentication**: + - Enter email/username + - Provide password + - Submit for authentication + +2. **Email OTP Authentication**: + - Enter email address + - Receive one-time code via email + - Enter the code to complete authentication + +3. **Redirect Authentication**: + - Enter email address, show redirect error + +### Sign Up + +The sign-up flow includes: + +1. **Email/Password**: + - Enter email address and user attributes + - Verify email with a verification code + - Create a password + - Complete account creation + +2. **Email OTP Authentication**: + - Enter email address and user attributes + - Verify email with a verification code + - Complete account creation + +### Password Reset + +The password reset flow allows users to: + +1. Request a password reset using their email +2. Receive a verification code via email +3. Verify the code +4. Create a new password +5. Complete password reset + +## Project Structure + +The sample application is organized into the following structure: + +``` +nativeAuthSample/ +├── app/ # Application source code +│ ├── app.js # Main application logic +│ ├── authConfig.js # MSAL configuration +│ ├── ui.js # UI handling functions +│ ├── utilities.js # Helper functions +│ ├── UserAccountAttributes.js # User account management +│ ├── signin/ # Sign-in implementation +│ ├── signup/ # Sign-up implementation +│ └── resetPassword/ # Password reset implementation +│ +├── test/ # Test files +│ ├── proxyUtils.ts # Test proxy utilities +│ ├── signin.spec.ts # Sign-in tests +│ ├── signup.spec.ts # Sign-up tests +│ ├── signout.spec.ts # Sign-out tests +│ ├── resetpassword.spec.ts # Password reset tests +│ └── screenshots/ # Test result screenshots +│ +├── index.html # Application entry point +├── styles.css # Application styles +├── cors.js # CORS configuration +├── jest.config.cjs # Jest test configuration +└── package-lock.json # Dependencies lock file +``` + +## Key Components + +### CustomAuthPublicClientApplication + +The core class that provides Native Authentication capabilities: + +- `signIn(signInInputs)`: Initiates sign-in flow +- `getCurrentAccount(accountInputs)`: Retrieves current account +- `signUp(signUpInputs)`: Initiates sign-up flow +- `resetPassword(resetPasswordInputs)`: Initiates password reset + +### Configuration + +The `CustomAuthConfiguration` object includes: + +- Standard MSAL configuration (`auth`, `cache`, `system`) +- Custom auth configuration (`customAuth.authApiProxyUrl`, `customAuth.challengeTypes`) + +## E2E test + +1. **Execute init.ps file to set up env variables** + + Under microsoft-authentication-library-for-js: + ```bash + gen_env.ps1 + ``` + +2. **Locate VanillaJSTestApp2.0 folder and run below command** + + ```bash + npm run test:e2e -- --sample=nativeAuthSample --detectOpenHandles --forceExit --reporters=default --reporters=jest-junit + ``` + +## Authentication Flow Configurations + +Each authentication flow requires specific query parameters to configure the correct endpoint: + +1. Email + Password Flow: + ``` + ?usePwdConfig=true + ``` + +2. Email + OTP Flow: + ``` + ?useOtpConfig=true + ``` + +3. Email + Password Redirect Flow: + ``` + ?useOtpConfig=true&useRedirectConfig=true + ``` + +## End-to-End Test Cases + +### 1. Sign Up Tests + +#### Email + Password Authentication + +##### Positive Cases + +* User inputs new email and user attributes, verifies code, creates password meeting requirements, completes sign up flow, then automatically sign-in. +* User inputs new email and user attributes, enters incorrect verification code, resend code, verifies code, creates password meeting requirements, completes sign up flow, then automatically sign-in. +* User inputs new email, verifies code, creates password meeting requirements, give user attributes, completes sign up flow, then automatically sign-in. +* User inputs new email and password, verifies code, give user attributes, completes sign up flow, then automatically sign-in. +* User inputs new email, password and user attributes, verifies code, completes sign up flow, then automatically sign-in. + +##### Negative Cases + +* User makes a request with invalid format email address, receives invalid email error. +* User inputs new email, verifies code, creates invalid password (does not meet requirements), receives sign up error. +* User inputs existing email (registered with email + Password), receives user existed error. +* User inputs new email and invalid attributes, receives validation error. +* User signs in an existing email, then try to sign up, receives error to sign out first. + +##### Email + OTP Authentication + +##### Positive Cases + +* User enters new email and user attributes, verifies code successfully, completes sign up flow, then automatically sign-in. +* User enters new email and user attributes, uses invalid OTP, requests new code, completes sign up flow, then automatically sign-in. +* User enters new email, verifies code successfully, gives and user attributes, completes sign up flow, then automatically sign-in. + +##### Negative Cases + +* User makes a request with invalid format email address, receives invalid email error. +* User inputs new email and invalid attributes, receives validation error. + +#### Redirect + +* Server requires password authentication, which is not supported by the developer (aka redirect flow) + +### 2. Sign In Tests + +#### Email + Password Authentication + +##### Positive Cases + +* User inputs registered email, then provides correct password, signs in successfully, check cache tokens use getCurrentAccount. +* User inputs registered email, then provides correct password, signs in successfully, use getCurrentAccount with forceRefresh=true to force refresh tokens, ensure the access token is updated. +* User inputs registered email and password, signs in successfully +* Ability to provide scope to control auth strength of the token + +##### Negative Cases + +* User inputs non-registered email, receives account not found error +* User inputs registered email, provides incorrect password, receives error +* User signs in with account A, while data for account A already exists +* User email is registered with email OTP auth method, which is supported by the developer + +#### Email + OTP Authentication + +##### Positive Cases + +* User inputs registered email, then receives OTP, verifies successfully +* User inputs registered email and OTP, signs in successfully +* User inputs registered email, enters incorrect OTP code, requests new OTP, enters valid code, signs in successfully + +##### Negative Cases + +* User inputs non-registered email, receives account not found error + +#### Redirct + +* User email is registered with email OTP auth method, which is not supported by the developer (aka redirect flow), sign in with pop up login. +* User email is registered with password method, which is not supported by client (aka redirect flow), sign in with pop up login. + +### 3. Password Reset Tests + +#### Email + Password Authentication + +##### Positive Cases + +* User requests reset inputs emails, receives code, sets new valid password, completes reset, auto-signs in +* User requests reset inputs emails, provides incorrect verification code, resend code, validates code, sets new valid password, completes reset, auto-signs in + +##### Negative Cases + +* User submits non-existing email, receives account not found error +* User submits existing email, but email does not linked to any password (registered as email + OTP) +* User submits existing email, receives code, creates invalid password (doesn’t meet password complexity requirements), receives requirements error + +#### Redirect + +* When SSPR requires a challenge type not supported by the client, redirect to web-fallback + +### 4. Sign Out Tests + +* User sign in with either email + OTP or email + password flow, click sign out, cache cleared. + +### 5. JIT + +#### Email + Password Authentication only + +##### Positive Cases + +* JIT is triggered in continue sign in after sign up - preverified, same email as strong auth method +* JIT is triggered in continue sign in after sign up - use a second email as strong auth method, and use code validation +* JIT is triggered in continue sign in after sign up - use a second email as strong auth method, resend code +* JIT is triggered in sign in flow + +##### Negative Cases + +* Do not send registration_required capability and receive browserRequired + +### 6. MFA + +#### Email + Password Authentication only + +##### Positive Cases + +* Sign in using password with MFA Get Auth Methods then complete successfully +* Sign in Authentication Context Claim Flow is Triggered and access token contains claims + +##### Negative Cases + +* Do not send mfa_required capability and receive browserRequired \ No newline at end of file diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/app.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/app.js new file mode 100644 index 0000000000..2a0b75fb12 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/app.js @@ -0,0 +1,330 @@ +/* + * MSAL Native Auth Sample Application + * Main application entry point for CustomAuthPublicClientApplication + */ + +import { Utilities } from './utilities.js'; +import { SignInModule } from './signin/index.js'; +import { SignUpModule } from './signup/index.js'; +import { ResetPasswordModule } from './resetPassword/index.js'; +import { initMsalConfig } from './authConfig.js'; + +// Export singleton instance of NativeAuthApp +let nativeAuthAppInstance = null; + +class NativeAuthApp { + constructor() { + this.msalInstance = null; + this.currentAccount = null; + this.CustomAuthPublicClientApplication = null; + this.signInModule = null; + this.signUpModule = null; + this.resetPasswordModule = null; + } + + async initializeMSAL() { + Utilities.logMessage("Initializing MSAL Native Auth...", "info"); + + if (typeof msalCustomAuth !== 'undefined' && msalCustomAuth.CustomAuthPublicClientApplication) { + this.CustomAuthPublicClientApplication = msalCustomAuth.CustomAuthPublicClientApplication; + Utilities.logMessage("Custom Auth API is loaded", "info"); + } else { + Utilities.logMessage("No MSAL object found globally", "info"); + throw new Error("MSAL Custom Auth library not found. Please ensure the library is properly built and included."); + } + + if (this.CustomAuthPublicClientApplication) { + // Get the MSAL configuration + const msalConfig = await initMsalConfig(); + Utilities.logMessage("Creating MSAL instance with config: " + JSON.stringify(msalConfig), "info"); + + this.msalInstance = await this.CustomAuthPublicClientApplication.create(msalConfig); + Utilities.logMessage("MSAL instance created successfully", "success"); + + // Initialize sign-in module + this.signInModule = new SignInModule(this.msalInstance); + this.signInModule.initialize(); + + // Initialize sign-up module + this.signUpModule = new SignUpModule(); + await this.signUpModule.initialize(this.msalInstance); + + // Initialize reset password module + this.resetPasswordModule = new ResetPasswordModule(); + await this.resetPasswordModule.initialize(this.msalInstance); + + // Initialize app-level navigation + this.initializeNavigation(); + + // Get current account if there is one + this.getCurrentAccount(); + + // Set initialization flag to true ONLY after MSAL and all modules are fully initialized + this.setInitializedFlagTrue(); + Utilities.logMessage("MSAL fully initialized and ready for tests", "success"); + + return this.msalInstance; + } else { + throw new Error("MSAL Custom Auth library not found. Please ensure the library is properly built and included."); + } + } + + // Set the initialized flag to true for test detection + setInitializedFlagTrue() { + const pcaInitElement = document.getElementById("pca-initialized"); + if (pcaInitElement) { + pcaInitElement.textContent = "true"; + Utilities.logMessage("PCA initialization flag set to true for tests", "info"); + } else { + Utilities.logMessage("Could not find pca-initialized element", "error"); + // Create element for test detection + const initElement = document.createElement('div'); + initElement.id = 'pca-initialized'; + initElement.style.display = 'none'; + initElement.textContent = 'true'; + document.body.appendChild(initElement); + } + } + + // Core Authentication Methods + + // Get modules from instance + getSignInModule() { + return this.signInModule; + } + + getSignUpModule() { + return this.signUpModule; + } + + getResetPasswordModule() { + return this.resetPasswordModule; + } + + getCurrentAccount() { + try { + Utilities.logMessage("Getting current account...", "info"); + + if (!this.msalInstance) { + throw new Error("MSAL not initialized. Cannot get current account."); + } + + const result = this.msalInstance.getCurrentAccount(); + + if (result.data) { + const account = result.data.account; + this.currentAccount = account; + Utilities.logMessage("Current account retrieved successfully", "success"); + return { success: true, account: account }; + } else { + Utilities.logMessage("No current account found", "info"); + return { success: false, account: null }; + } + + } catch (error) { + Utilities.logMessage(`Failed to get current account`, "error"); + Utilities.logMessage("Get account error: " + error.message, "error"); + throw error; + } + } + + async signOut() { + try { + Utilities.logMessage("Signing out...", "info"); + + if (!this.msalInstance) { + throw new Error("MSAL not initialized. Cannot perform sign-out."); + } + + const account = this.msalInstance.getCurrentAccount(); + + if (account.data) { + await account.data.signOut(); + Utilities.logMessage("User successfully signed out", "success"); + } else { + Utilities.logMessage("No account data available to sign out", "info"); + } + + // Clear current account + this.currentAccount = null; + // cleanupMsalResources(true); + + Utilities.logMessage("Signed out successfully", "success"); + return true; + + } catch (error) { + Utilities.logMessage(`Sign-out failed`, "error"); + Utilities.logMessage("Sign-out error: " + error.message, "error"); + throw error; + } + } + + /** + * Initialize app-level navigation between sign-in and sign-up forms + */ + initializeNavigation() { + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const showResetPasswordBtn = document.getElementById('showResetPasswordBtn'); + + // Handle navigation to sign-in form + if (showSignInBtn) { + showSignInBtn.addEventListener('click', () => { + this.showSignInForm(); + }); + } + + // Handle navigation to sign-up form + if (showSignUpBtn) { + showSignUpBtn.addEventListener('click', () => { + this.showSignUpForm(); + }); + } + + // Handle navigation to reset password form + if (showResetPasswordBtn) { + showResetPasswordBtn.addEventListener('click', () => { + this.showResetPasswordForm(); + }); + } + + Utilities.logMessage('App-level navigation initialized', 'info'); + } + + /** + * Show sign-in form and hide other forms + */ + showSignInForm() { + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const resetPasswordCard = document.getElementById('resetPasswordCard'); + const resetPasswordCodeCard = document.getElementById('resetPasswordCodeCard'); + const resetPasswordNewPasswordCard = document.getElementById('resetPasswordNewPasswordCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + + // Update button states + if (showSignInBtn) showSignInBtn.classList.add('active'); + if (showSignUpBtn) showSignUpBtn.classList.remove('active'); + + // Show sign-in form, hide other forms + if (signInCard) signInCard.style.display = 'block'; + if (signUpCard) signUpCard.style.display = 'none'; + if (resetPasswordCard) resetPasswordCard.style.display = 'none'; + if (resetPasswordCodeCard) resetPasswordCodeCard.style.display = 'none'; + if (resetPasswordNewPasswordCard) resetPasswordNewPasswordCard.style.display = 'none'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + Utilities.logMessage('Switched to sign-in form', 'info'); + } + + /** + * Show sign-up form and hide other forms + */ + showSignUpForm() { + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const resetPasswordCard = document.getElementById('resetPasswordCard'); + const resetPasswordCodeCard = document.getElementById('resetPasswordCodeCard'); + const resetPasswordNewPasswordCard = document.getElementById('resetPasswordNewPasswordCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + + // Update button states + if (showSignInBtn) showSignInBtn.classList.remove('active'); + if (showSignUpBtn) showSignUpBtn.classList.add('active'); + + // Show sign-up form, hide other forms + if (signInCard) signInCard.style.display = 'none'; + if (signUpCard) signUpCard.style.display = 'block'; + if (resetPasswordCard) resetPasswordCard.style.display = 'none'; + if (resetPasswordCodeCard) resetPasswordCodeCard.style.display = 'none'; + if (resetPasswordNewPasswordCard) resetPasswordNewPasswordCard.style.display = 'none'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + Utilities.logMessage('Switched to sign-up form', 'info'); + } + + /** + * Show reset password form and hide other forms + */ + showResetPasswordForm() { + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const showResetPasswordBtn = document.getElementById('showResetPasswordBtn'); + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const resetPasswordCard = document.getElementById('resetPasswordCard'); + const resetPasswordCodeCard = document.getElementById('resetPasswordCodeCard'); + const resetPasswordNewPasswordCard = document.getElementById('resetPasswordNewPasswordCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + + // Update button states + if (showSignInBtn) showSignInBtn.classList.remove('active'); + if (showSignUpBtn) showSignUpBtn.classList.remove('active'); + if (showResetPasswordBtn) showResetPasswordBtn.classList.add('active'); + + // Show reset password form, hide other forms + if (signInCard) signInCard.style.display = 'none'; + if (signUpCard) signUpCard.style.display = 'none'; + if (resetPasswordCard) resetPasswordCard.style.display = 'block'; + if (resetPasswordCodeCard) resetPasswordCodeCard.style.display = 'none'; + if (resetPasswordNewPasswordCard) resetPasswordNewPasswordCard.style.display = 'none'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + Utilities.logMessage('Switched to reset password form', 'info'); + } +} + +/** + * Get the singleton instance of NativeAuthApp + * @returns {NativeAuthApp} The singleton instance + */ +export function getNativeAuthApp() { + return nativeAuthAppInstance; +} + +// Helper functions to access modules from the nativeAuthAppInstance +export function getSignInModule() { + return nativeAuthAppInstance?.signInModule || null; +} + +export function getSignUpModule() { + return nativeAuthAppInstance?.signUpModule || null; +} + +export function getResetPasswordModule() { + return nativeAuthAppInstance?.resetPasswordModule || null; +} + +// Initialize the app when DOM is loaded and make it globally available +document.addEventListener('DOMContentLoaded', async () => { + try { + // Create new instance + const app = new NativeAuthApp(); + nativeAuthAppInstance = app; + + // Initialize MSAL + await app.initializeMSAL(); + + } catch (error) { + Utilities.logMessage("Failed to initialize MSAL: " + error.message, "error"); + // Don't set initialization flag to true if initialization fails + } +}); + +// Export a clean API for importing modules +export default { + getNativeAuthApp, + getSignInModule, + getSignUpModule, + getResetPasswordModule, +}; diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/authConfig.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/authConfig.js new file mode 100644 index 0000000000..ea523299ed --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/authConfig.js @@ -0,0 +1,106 @@ +/* + * MSAL Native Auth Configuration + */ + +// Access LogLevel from the global msalCustomAuth object +const { LogLevel } = msalCustomAuth; + +import { Utilities } from './utilities.js'; +import { + initNativeAuthConfig, + getClientIdByFlow, + getAuthorityUrl, + getProxyPort +} from './configParser.js'; + +/** + * Get client ID based on URL parameters or default to email/password flow + * @returns {string} The appropriate client ID + */ +function getClientId() { + const urlParams = new URLSearchParams(window.location.search); + + if (urlParams.get('usePwdConfig') === 'true') { + return getClientIdByFlow('email_password'); + } else if (urlParams.get('useOtpConfig') === 'true') { + return getClientIdByFlow('email_code'); + } else if (urlParams.get('usePwdAttributesConfig') === 'true') { + return getClientIdByFlow('email_password_attributes'); + } else if (urlParams.get('useOtpAttributesConfig') === 'true') { + return getClientIdByFlow('email_code_attributes'); + } + + // Default to email/password flow + return getClientIdByFlow('email_password'); +} + +/** + * Get challenge types based on URL parameters + * @returns {string[]} Array of supported challenge types + */ +function getChallengeTypes() { + const urlParams = new URLSearchParams(window.location.search); + + if (urlParams.get('useRedirectConfig') === 'true') { + return ["redirect"]; // Only redirect for testing redirect-only scenarios + } + + return ["password", "oob", "redirect"]; // Default challenge types +} + +/** + * Initialize and get MSAL configuration with dynamic values + * @returns {Promise} The MSAL configuration object + */ +async function initMsalConfig() { + // Ensure config is loaded first + await initNativeAuthConfig(); + + const clientId = getClientId(); + const authority = getAuthorityUrl(); + const proxyPort = getProxyPort(); + + return { + customAuth: { + challengeTypes: getChallengeTypes(), + authApiProxyUrl: `http://localhost:${proxyPort}/api`, + }, + auth: { + clientId: clientId, + authority: authority, + redirectUri: "/", // You must register this URI on Azure Portal/App Registration. Defaults to window.location.href e.g. http://localhost:3000/ + postLogoutRedirectUri: "", + navigateToLoginRequestUrl: false, + }, + cache: { + cacheLocation: "sessionStorage", + storeAuthStateInCookie: false, + }, + system: { + loggerOptions: { + loggerCallback: (level, message, containsPii) => { + if (containsPii) { + return; + } + switch (level) { + case LogLevel.Error: + Utilities.logMessage(message, "error"); + return; + case LogLevel.Info: + Utilities.logMessage(message, "info"); + return; + case LogLevel.Verbose: + Utilities.logMessage(message, "info"); // Use info for verbose as we don't have a debug level + return; + case LogLevel.Warning: + Utilities.logMessage(message, "warning"); + return; + } + }, + } + } + }; +} + +// Export the initialization function +export { initMsalConfig }; diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/configParser.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/configParser.js new file mode 100644 index 0000000000..4526473b93 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/configParser.js @@ -0,0 +1,122 @@ +/* + * Browser-compatible Native Auth Configuration Parser + * This file provides configuration values dynamically loaded from nativeAuthConfig.json + */ + + +// Cache for loaded configuration +let configCache = null; +let configPromise = null; + +/** + * Load configuration from nativeAuthConfig.json (internal function) + * @returns {Promise} The parsed configuration object + */ +async function loadConfig() { + if (configCache) { + return configCache; + } + + if (configPromise) { + return configPromise; + } + + configPromise = (async () => { + try { + const response = await fetch('../nativeAuthConfig.json'); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const rawConfig = await response.json(); + + // Transform to a flat, easy-to-use structure + configCache = { + emailPasswordClientId: rawConfig.native_auth.email_password_client_id, + emailCodeClientId: rawConfig.native_auth.email_code_client_id, + emailPasswordAttributesClientId: rawConfig.native_auth.email_password_attributes_client_id, + emailCodeAttributesClientId: rawConfig.native_auth.email_code_attributes_client_id, + tenantSubdomain: rawConfig.native_auth.tenant_subdomain, + tenantId: rawConfig.native_auth.tenant_id, + signInEmailPasswordUsername: rawConfig.native_auth.sign_in_email_password_username, + signInEmailCodeUsername: rawConfig.native_auth.sign_in_email_code_username, + resetPasswordUsername: rawConfig.native_auth.reset_password_username, + resetPasswordUsernameMacos: rawConfig.native_auth.reset_password_username_macos, + passwordSignInEmailCode: rawConfig.native_auth.password_sign_in_email_code, + keyvaultUrl: rawConfig.native_auth.keyvault_url, + proxyPort: 30001 // Static value for test consistency + }; + + return configCache; + } catch (error) { + console.error('Failed to load native auth configuration:', error); + configPromise = null; // Reset promise on error to allow retry + throw new Error(`Failed to load native auth configuration: ${error.message}`); + } + })(); + + return configPromise; +} + +/** + * Initialize configuration (must be called before using sync functions) + * @returns {Promise} The configuration object + */ +export async function initNativeAuthConfig() { + return await loadConfig(); +} + + +/** + * Get client ID based on authentication flow type (synchronous) + * @param {string} flowType - The type of auth flow + * @returns {string} The appropriate client ID for the flow + * @throws {Error} If configuration not loaded or invalid flow type + */ +export function getClientIdByFlow(flowType) { + if (!configCache) { + throw new Error('Configuration not loaded. Call initNativeAuthConfig() first.'); + } + + switch (flowType) { + case "email_password": + return configCache.emailPasswordClientId; + case "email_code": + return configCache.emailCodeClientId; + case "email_password_attributes": + return configCache.emailPasswordAttributesClientId; + case "email_code_attributes": + return configCache.emailCodeAttributesClientId; + default: + throw new Error(`Unknown flow type: ${flowType}`); + } +} + +/** + * Build authority URL using tenant subdomain (synchronous) + * @returns {string} The complete authority URL + * @throws {Error} If configuration not loaded + */ +export function getAuthorityUrl() { + if (!configCache) { + throw new Error('Configuration not loaded. Call initNativeAuthConfig() first.'); + } + return `https://${configCache.tenantSubdomain}.ciamlogin.com`; +} + +/** + * Get proxy port (synchronous) + * @returns {number} The proxy port + * @throws {Error} If configuration not loaded + */ +export function getProxyPort() { + if (!configCache) { + throw new Error('Configuration not loaded. Call initNativeAuthConfig() first.'); + } + return configCache.proxyPort; +} + + +// Auto-initialize configuration when module loads +initNativeAuthConfig().catch(error => { + console.error('Failed to auto-initialize native auth configuration:', error); +}); diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/ResetPasswordService.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/ResetPasswordService.js new file mode 100644 index 0000000000..273caa306d --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/ResetPasswordService.js @@ -0,0 +1,295 @@ +/* + * Reset Password Service for MSAL Native Auth Sample + * + * This service handles all password reset related authentication operations, including + * email submission, code verification, and new password submission. It provides a clean + * interface for password reset functionality following the same pattern as sign-up. + */ + +import { Utilities } from '../utilities.js'; + +export class ResetPasswordService { + constructor(msalInstance) { + this.msalInstance = msalInstance; + this.pendingResetResult = null; + this.currentEmail = null; + } + + /** + * Updates the MSAL instance + * @param {Object} msalInstance - The new MSAL instance + */ + setMsalInstance(msalInstance) { + this.msalInstance = msalInstance; + } + + /** + * Initiates password reset flow with email + * @param {string} email - The email for password reset + * @returns {Promise} Reset password result with success status and next steps + */ + async resetPassword(email) { + try { + if (!this.msalInstance) { + throw new Error("MSAL instance not initialized"); + } + + if (!email) { + throw new Error("Email is required"); + } + + Utilities.logMessage(`Starting password reset for: ${email}`, "info"); + + // Store current email for potential later use + this.currentEmail = email; + + // Use MSAL native auth password reset start + const result = await this.msalInstance.resetPassword({ + username: email + }); + + return await this.handleResetPasswordResult(result); + } catch (error) { + Utilities.logMessage(`Password reset failed: ${error}`, "error"); + Utilities.logMessage(`Password reset error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Handle the result from MSAL password reset operations + * @param {Object} result - The result from MSAL password reset call + * @returns {Promise} Processed result with success status and state info + */ + async handleResetPasswordResult(result) { + if (!result) { + return { success: false, error: "No result received from password reset operation" }; + } + + // 1. Check if password reset FAILED + if (result.isFailed()) { + Utilities.logMessage("STATE: FAILED - Password reset failed", "error"); + if (result.error) { + Utilities.logMessage(`Error details: ${JSON.stringify(result.error, null, 2)}`, "error"); + } + return { success: false, result: result, error: result.error.errorData, state: 'failed'}; + } + + // 2. Check if CODE is REQUIRED (Email verification) + if (result.isCodeRequired && result.isCodeRequired()) { + Utilities.logMessage("STATE: CODE_REQUIRED - Email verification code needed", "info"); + + // Store the result for later use + this.pendingResetResult = result; + + return { + success: false, + result: result, + state: 'code_required', + email: this.currentEmail + }; + } + + // 3. Check if PASSWORD is REQUIRED (New password submission) + if (result.isPasswordRequired && result.isPasswordRequired()) { + Utilities.logMessage("STATE: PASSWORD_REQUIRED - New password needed", "info"); + + // Store the result for later use + this.pendingResetResult = result; + + return { + success: false, + result: result, + state: 'password_required', + email: this.currentEmail + }; + } + + // 4. Check if password reset is COMPLETE/SUCCESS + if (result.isCompleted && result.isCompleted()) { + Utilities.logMessage("STATE: SUCCESS - Password reset completed successfully", "success"); + + // Check if state has signIn method and call it for automatic sign-in after password reset + if (result.state && typeof result.state.signIn === 'function') { + Utilities.logMessage("STATE: AUTO_SIGNIN - Attempting automatic sign-in after password reset completion", "info"); + Utilities.logMessage("🔍 RESET PASSWORD SERVICE: Auto sign-in method found, attempting sign-in...", "info"); + try { + const signInResult = await result.state.signIn(); + Utilities.logMessage("STATE: AUTO_SIGNIN_SUCCESS - Automatic sign-in completed", "success"); + + // Clear pending result on success + this.pendingResetResult = null; + + const finalResult = { + success: true, + result: signInResult, + account: signInResult.data || result.data, + state: 'completed_with_signin', + email: this.currentEmail, + autoSignIn: true + }; + + Utilities.logMessage("🔍 RESET PASSWORD SERVICE: Final auto sign-in result success", "info"); + return finalResult; + } catch (signInError) { + Utilities.logMessage(`STATE: AUTO_SIGNIN_FAILED - Automatic sign-in failed: ${signInError}`, "warning"); + Utilities.logMessage(`🔍 RESET PASSWORD SERVICE: Auto sign-in failed: ${signInError}`, "error"); + // Fall back to regular completion without automatic sign-in + } + } else { + Utilities.logMessage("🔍 RESET PASSWORD SERVICE: No auto sign-in method available", "info"); + Utilities.logMessage(`🔍 RESET PASSWORD SERVICE: result.state available: ${!!result.state}`, "info"); + Utilities.logMessage(`🔍 RESET PASSWORD SERVICE: typeof result.state?.signIn: ${typeof result.state?.signIn}`, "info"); + } + + // Clear pending result on success + this.pendingResetResult = null; + + return { + success: true, + result: result, + account: result.data, + state: 'completed', + email: this.currentEmail + }; + } + + // Default case - unknown state + Utilities.logMessage(`STATE: UNKNOWN - Unhandled result state: ${JSON.stringify(result, null, 2)}`, "warning"); + return { success: false, result: result, state: 'unknown' }; + } + + /** + * Submits new password for password reset when required + * @param {string} password - The new password + * @returns {Promise} Password submission result + */ + async submitPassword(password) { + try { + if (!this.pendingResetResult) { + throw new Error("No pending password reset operation found"); + } + + if (!password) { + throw new Error("Password is required"); + } + + Utilities.logMessage(`Submitting new password for reset...`, "info"); + + // Submit the password using the pending result + const result = await this.pendingResetResult.state.submitNewPassword(password); + + // Handle the result of password submission + const finalResult = await this.handleResetPasswordResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingResetResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Password submission failed: ${error}`, "error"); + Utilities.logMessage(`Submit password error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Submits verification code for email verification during password reset + * @param {string} code - The 8-digit verification code received via email + * @returns {Promise} Verification result + */ + async submitCode(code) { + try { + Utilities.logMessage("🔍 RESET PASSWORD SERVICE: submitCode called", "info"); + + if (!this.pendingResetResult) { + throw new Error("No pending password reset operation found"); + } + + if (!code) { + throw new Error("Verification code is required"); + } + + // Validate code format (8 digits) + if (!/^\d{8}$/.test(code)) { + throw new Error("Verification code must be 8 digits"); + } + + Utilities.logMessage(`Submitting verification code: ${code}`, "info"); + + Utilities.logMessage("Submitting code for password reset...", "info"); + // Submit the code using the pending result + const result = await this.pendingResetResult.state.submitCode(code); + + // Handle the result of code submission + const finalResult = await this.handleResetPasswordResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingResetResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Code submission failed: ${error}`, "error"); + Utilities.logMessage(`Submit code error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Resends verification code for email verification + * @returns {Promise} Resend operation result + */ + async resendCode() { + try { + if (!this.pendingResetResult) { + throw new Error("No pending password reset operation found"); + } + + Utilities.logMessage("Resending verification code...", "info"); + + // Check if resend method is available + if (this.pendingResetResult.state.resendCode) { + await this.pendingResetResult.state.resendCode(); + Utilities.logMessage("Verification code resent successfully", "success"); + return { success: true }; + } else { + throw new Error("Resend code method not available"); + } + + } catch (error) { + Utilities.logMessage(`Failed to resend code: ${error}`, "error"); + Utilities.logMessage(`Resend code error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Clears any pending password reset operation + */ + clearPendingOperation() { + this.pendingResetResult = null; + this.currentEmail = null; + Utilities.logMessage("Pending password reset operation cleared", "info"); + } + + /** + * Checks if there's a pending password reset operation + */ + hasPendingOperation() { + return this.pendingResetResult !== null; + } + + /** + * Gets the current email being used for password reset + * @returns {string|null} The current email or null if not set + */ + getCurrentEmail() { + return this.currentEmail; + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/ResetPasswordUIManager.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/ResetPasswordUIManager.js new file mode 100644 index 0000000000..5b640765f5 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/ResetPasswordUIManager.js @@ -0,0 +1,542 @@ +/* + * Reset Password UI Manager for MSAL Native Auth Sample + * + * This module handles all password reset related UI interactions, form submissions, and DOM manipulation. + * It manages the email input form, code verification, and new password submission following the same + * pattern as the SignUpUIManager. + */ + +import { Utilities } from "../utilities.js"; +import uiManager from "../ui.js"; + +export class ResetPasswordUIManager { + constructor(resetPasswordService) { + this.resetPasswordService = resetPasswordService; + this.eventListenersInitialized = false; + this.currentContext = null; // Track current context (resetPassword) + this.boundHandlers = new Map(); // Store bound event handlers for cleanup + this.activeListeners = new Map(); // Track active event listeners by element and event type + + // Initialize event listeners when DOM is ready + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', () => { + this.initializeEventListeners(); + }); + } else { + // DOM is already ready + this.initializeEventListeners(); + } + } + + /** + * Update the reset password service reference + */ + setResetPasswordService(resetPasswordService) { + this.resetPasswordService = resetPasswordService; + } + + /** + * Initialize all reset password related event listeners + */ + initializeEventListeners() { + if (this.eventListenersInitialized) { + return; + } + + Utilities.logMessage('Initializing ResetPasswordUIManager event listeners...', 'info'); + + // Bind handlers to maintain proper 'this' context + const resetPasswordFormHandler = (e) => this.handleResetPasswordSubmit(e); + const resetPasswordCodeFormHandler = (e) => this.handleResetPasswordCodeSubmit(e); + const resetPasswordNewPasswordFormHandler = (e) => this.handleResetPasswordNewPasswordSubmit(e); + const showResetPasswordHandler = (e) => this.showResetPasswordForm(e); + + // Store bound handlers for cleanup + this.boundHandlers.set('resetPasswordForm', resetPasswordFormHandler); + this.boundHandlers.set('resetPasswordCodeForm', resetPasswordCodeFormHandler); + this.boundHandlers.set('resetPasswordNewPasswordForm', resetPasswordNewPasswordFormHandler); + this.boundHandlers.set('showResetPassword', showResetPasswordHandler); + + // Add event listeners with tracking + this.addEventListenerWithTracking('resetPasswordForm', 'submit', resetPasswordFormHandler); + this.addEventListenerWithTracking('resetPasswordCodeForm', 'submit', resetPasswordCodeFormHandler); + this.addEventListenerWithTracking('resetPasswordNewPasswordForm', 'submit', resetPasswordNewPasswordFormHandler); + this.addEventListenerWithTracking('showResetPasswordBtn', 'click', showResetPasswordHandler); + + this.eventListenersInitialized = true; + Utilities.logMessage('ResetPasswordUIManager event listeners initialized successfully', 'success'); + } + + /** + * Add event listener with tracking for easy cleanup + */ + addEventListenerWithTracking(elementId, eventType, handler) { + const element = document.getElementById(elementId); + if (element) { + element.addEventListener(eventType, handler); + + // Track the listener for cleanup + const key = `${elementId}_${eventType}`; + this.activeListeners.set(key, { element, eventType, handler }); + + Utilities.logMessage(`Event listener attached: ${elementId} (${eventType})`, 'info'); + } else { + Utilities.logMessage(`Element not found: ${elementId}`, 'warning'); + } + } + + /** + * Remove event listener and stop tracking + */ + removeEventListenerWithTracking(elementId, eventType) { + const key = `${elementId}_${eventType}`; + const listenerInfo = this.activeListeners.get(key); + + if (listenerInfo) { + listenerInfo.element.removeEventListener(listenerInfo.eventType, listenerInfo.handler); + this.activeListeners.delete(key); + Utilities.logMessage(`Event listener removed: ${elementId} (${eventType})`, 'info'); + } + } + + /** + * Handle reset password form submission (Step 1: Email input) + */ + async handleResetPasswordSubmit(event) { + event.preventDefault(); + + Utilities.logMessage('🔍 RESET PASSWORD UI: handleResetPasswordSubmit called', 'info'); + + try { + const emailInput = document.getElementById('resetPasswordEmail'); + const email = emailInput ? emailInput.value.trim() : ''; + + if (!email) { + this.displayMessage('Please enter your email address', 'error'); + return; + } + + // Validate email format + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailRegex.test(email)) { + this.displayMessage('Please enter a valid email address', 'error'); + return; + } + + this.displayMessage('Starting password reset...', 'info'); + this.disableFormInputs('resetPasswordForm'); + + // Call the reset password service + const result = await this.resetPasswordService.resetPassword(email); + + Utilities.logMessage('Reset password result received', 'info'); + + if (result.success) { + this.displayMessage('Password reset completed successfully!', 'success'); + this.showSignInForm(); + } else if (result.state === 'code_required') { + this.displayMessage('Verification code sent to your email. Please check your inbox.', 'success'); + this.showResetPasswordCodeForm(); + } else { + const errorMessage = result.error || 'Password reset failed. Please try again.'; + this.displayMessage(errorMessage, 'error'); + } + + } catch (error) { + Utilities.logMessage(`Reset password error: ${error}`, 'error'); + this.displayMessage('An unexpected error occurred. Please try again.', 'error'); + } finally { + this.enableFormInputs('resetPasswordForm'); + } + } + + /** + * Handle reset password code form submission (Step 2: Code verification) + */ + async handleResetPasswordCodeSubmit(event) { + event.preventDefault(); + + Utilities.logMessage('🔍 RESET PASSWORD UI: handleResetPasswordCodeSubmit called', 'info'); + + try { + const codeInput = document.getElementById('resetPasswordCode'); + const code = codeInput ? codeInput.value.trim() : ''; + + if (!code) { + this.displayMessage('Please enter the verification code', 'error'); + return; + } + + // Validate code format (8 digits) + if (!/^\d{8}$/.test(code)) { + this.displayMessage('Verification code must be 8 digits', 'error'); + return; + } + + this.displayMessage('Verifying code...', 'info'); + this.disableFormInputs('resetPasswordCodeForm'); + + // Submit the verification code + const result = await this.resetPasswordService.submitCode(code); + + Utilities.logMessage('Code verification result received', 'info'); + + if (result.success) { + this.displayMessage('Password reset completed successfully!', 'success'); + this.showSignInForm(); + } else if (result.state === 'password_required') { + this.displayMessage('Code verified! Please enter your new password.', 'success'); + this.showResetPasswordNewPasswordForm(); + } else { + const errorMessage = result.error || 'Code verification failed. Please try again.'; + this.displayMessage(errorMessage, 'error'); + } + + } catch (error) { + Utilities.logMessage(`Code verification error: ${error}`, 'error'); + this.displayMessage('An unexpected error occurred. Please try again.', 'error'); + } finally { + this.enableFormInputs('resetPasswordCodeForm'); + } + } + + /** + * Handle reset password new password form submission (Step 3: New password submission) + */ + async handleResetPasswordNewPasswordSubmit(event) { + event.preventDefault(); + + Utilities.logMessage('🔍 RESET PASSWORD UI: handleResetPasswordNewPasswordSubmit called', 'info'); + + try { + const passwordInput = document.getElementById('resetPasswordNewPassword'); + const password = passwordInput ? passwordInput.value : ''; + + if (!password) { + this.displayMessage('Please enter a new password', 'error'); + return; + } + + // Basic password validation + if (password.length < 8) { + this.displayMessage('Password must be at least 8 characters long', 'error'); + return; + } + + this.displayMessage('Setting new password...', 'info'); + this.disableFormInputs('resetPasswordNewPasswordForm'); + + // Submit the new password + const result = await this.resetPasswordService.submitPassword(password); + + Utilities.logMessage('🔍 RESET PASSWORD UI: Password submission result received', 'info'); + + if (result.success && result.autoSignIn && result.state === 'completed_with_signin') { + // Password reset completed with automatic sign-in + Utilities.logMessage("🔍 RESET PASSWORD UI: Password reset completed with automatic sign-in", "success"); + Utilities.logMessage("🔍 RESET PASSWORD UI: Account info from password reset received", "info"); + + // Notify main UI manager about successful reset password and sign-in + if (uiManager && uiManager.updateAccountInfo) { + Utilities.logMessage("🔍 RESET PASSWORD UI: Updating account info after password reset", "info"); + uiManager.updateAccountInfo(result.account); + + Utilities.logMessage("🔍 RESET PASSWORD UI: Account info updated successfully after password reset", "success"); + } else { + Utilities.logMessage("🔍 RESET PASSWORD UI: uiManager or updateAccountInfo method not available after password reset", "warning"); + } + + // Hide the new password form and return to main reset password form + this.hideNewPasswordForm(); + + // Clear the form on success + event.target.reset(); + + } else if (result.success) { + // Password reset completed successfully but without auto sign-in + this.displayMessage('Password reset completed successfully! You can now sign in with your new password.', 'success'); + this.showSignInForm(); + } else { + const errorMessage = result.error || 'Password reset failed. Please try again.'; + this.displayMessage(errorMessage, 'error'); + } + + } catch (error) { + Utilities.logMessage(`Password submission error: ${error}`, 'error'); + this.displayMessage('An unexpected error occurred. Please try again.', 'error'); + } finally { + this.enableFormInputs('resetPasswordNewPasswordForm'); + } + } + + /** + * Show the reset password form (Step 1) + */ + showResetPasswordForm() { + Utilities.logMessage('Showing reset password form', 'info'); + + // Hide other forms + this.hideAllForms(); + + // Show reset password form + const resetPasswordDiv = document.getElementById('resetPasswordCard'); + if (resetPasswordDiv) { + resetPasswordDiv.style.display = 'block'; + this.clearFormInputs('resetPasswordForm'); + this.clearMessages(); + + // Focus on email input + const emailInput = document.getElementById('resetPasswordEmail'); + if (emailInput) { + setTimeout(() => emailInput.focus(), 100); + } + } + } + + /** + * Show the reset password code verification form (Step 2) + */ + showResetPasswordCodeForm() { + Utilities.logMessage('Showing reset password code verification form', 'info'); + + // Hide other forms + this.hideAllForms(); + + // Show code verification form + const codeVerificationDiv = document.getElementById('resetPasswordCodeCard'); + if (codeVerificationDiv) { + codeVerificationDiv.style.display = 'block'; + this.clearFormInputs('resetPasswordCodeForm'); + + // Focus on code input + const codeInput = document.getElementById('resetPasswordCode'); + if (codeInput) { + setTimeout(() => codeInput.focus(), 100); + } + } + } + + /** + * Show the reset password new password form (Step 3) + */ + showResetPasswordNewPasswordForm() { + Utilities.logMessage('Showing reset password new password form', 'info'); + + // Hide other forms + this.hideAllForms(); + + // Show password submission form + const passwordSubmissionDiv = document.getElementById('resetPasswordNewPasswordCard'); + if (passwordSubmissionDiv) { + passwordSubmissionDiv.style.display = 'block'; + this.clearFormInputs('resetPasswordNewPasswordForm'); + + // Focus on password input + const passwordInput = document.getElementById('resetPasswordNewPassword'); + if (passwordInput) { + setTimeout(() => passwordInput.focus(), 100); + } + } + } + + /** + * Show the sign-in form + */ + showSignInForm() { + Utilities.logMessage('Showing sign-in form', 'info'); + + // Hide all forms + this.hideAllForms(); + + // Show sign-in form + const signInDiv = document.getElementById('signInDiv'); + if (signInDiv) { + signInDiv.style.display = 'block'; + } + + // Clear any pending operations + if (this.resetPasswordService) { + this.resetPasswordService.clearPendingOperation(); + } + } + + /** + * Hide all forms + */ + hideAllForms() { + const forms = [ + 'signInDiv', + 'signUpDiv', + 'resetPasswordCard', + 'resetPasswordCodeCard', + 'resetPasswordNewPasswordCard', + 'signUpPasswordCard', + 'codeVerificationCard', + 'passwordInputCard', + 'welcomeDiv' + ]; + + forms.forEach(formId => { + const form = document.getElementById(formId); + if (form) { + form.style.display = 'none'; + } + }); + } + + /** + * Display a message to the user + */ + displayMessage(message, type = 'info') { + Utilities.logMessage(`Reset Password UI Message (${type}): ${message}`, type); + + // For error messages, use the global error banner + if (type === 'error') { + uiManager.showErrorBanner(message, 'resetpassword'); + return; + } + + const messageElement = document.getElementById('message'); + if (messageElement) { + messageElement.textContent = message; + messageElement.className = `message ${type}`; + messageElement.style.display = 'block'; + + Utilities.logMessage(message, type); + } + } + + /** + * Clear all messages + */ + clearMessages() { + const messageElement = document.getElementById('message'); + if (messageElement) { + messageElement.textContent = ''; + messageElement.className = 'message'; + messageElement.style.display = 'none'; + } + } + + /** + * Clear form inputs + */ + clearFormInputs(formId) { + const form = document.getElementById(formId); + if (form) { + const inputs = form.querySelectorAll('input'); + inputs.forEach(input => { + input.value = ''; + }); + } + } + + /** + * Disable form inputs + */ + disableFormInputs(formId) { + const form = document.getElementById(formId); + if (form) { + const inputs = form.querySelectorAll('input, button'); + inputs.forEach(input => { + input.disabled = true; + }); + } + } + + /** + * Enable form inputs + */ + enableFormInputs(formId) { + const form = document.getElementById(formId); + if (form) { + const inputs = form.querySelectorAll('input, button'); + inputs.forEach(input => { + input.disabled = false; + }); + } + } + + /** + * Handle resend code button click + */ + async handleResendCode() { + try { + this.displayMessage('Resending verification code...', 'info'); + + const result = await this.resetPasswordService.resendCode(); + + if (result.success) { + this.displayMessage('Verification code resent successfully. Please check your email.', 'success'); + } else { + this.displayMessage('Failed to resend code. Please try again.', 'error'); + } + } catch (error) { + Utilities.logMessage(`Resend code error: ${error}`, 'error'); + this.displayMessage('An unexpected error occurred. Please try again.', 'error'); + } + } + + /** + * Hide the new password form and return to main reset password form + * Similar to hidePasswordInputForm() in SignUpUIManager.js + */ + hideNewPasswordForm() { + const resetPasswordNewPasswordCard = document.getElementById('resetPasswordNewPasswordCard'); + if (resetPasswordNewPasswordCard) resetPasswordNewPasswordCard.style.display = 'none'; + + // Clear the password input + const passwordInput = document.getElementById('resetPasswordNewPassword'); + if (passwordInput) { + passwordInput.value = ''; + } + + // Show reset password form again to allow users to start the flow again + this.showResetPasswordForm(); + } + + /** + * Show success message for automatic sign-in after password reset + */ + showResetPasswordSuccessWithSignIn(username) { + Utilities.logMessage(`🔍 RESET PASSWORD UI: Password reset and automatic sign-in successful for ${username}`, 'success'); + + // Do NOT hide reset password forms - keep them visible after successful completion + // This matches the behavior pattern from signup flow where forms remain visible + + // Show a success message indicating automatic sign-in + this.displayMessage(`Password reset completed successfully! You have been automatically signed in as ${username}.`, 'success'); + + // Optional: You could also show a welcome message or redirect to a specific page + // For now, we'll rely on the main UI manager to update the account information + } + + /** + * Hide all reset password forms + */ + hideAllResetPasswordForms() { + const resetPasswordCard = document.getElementById('resetPasswordCard'); + const resetPasswordCodeCard = document.getElementById('resetPasswordCodeCard'); + const resetPasswordNewPasswordCard = document.getElementById('resetPasswordNewPasswordCard'); + + if (resetPasswordCard) resetPasswordCard.style.display = 'none'; + if (resetPasswordCodeCard) resetPasswordCodeCard.style.display = 'none'; + if (resetPasswordNewPasswordCard) resetPasswordNewPasswordCard.style.display = 'none'; + } + + /** + * Clean up resources and event listeners + */ + cleanup() { + // Remove all tracked event listeners + for (const [key, listenerInfo] of this.activeListeners) { + listenerInfo.element.removeEventListener(listenerInfo.eventType, listenerInfo.handler); + } + + this.activeListeners.clear(); + this.boundHandlers.clear(); + this.eventListenersInitialized = false; + + Utilities.logMessage('ResetPasswordUIManager cleaned up', 'info'); + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/index.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/index.js new file mode 100644 index 0000000000..a065c021a5 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/resetPassword/index.js @@ -0,0 +1,191 @@ +/* + * Reset Password Module for MSAL Native Auth Sample + */ + +import { ResetPasswordService } from './ResetPasswordService.js'; +import { ResetPasswordUIManager } from './ResetPasswordUIManager.js'; +import { Utilities } from '../utilities.js'; + +export class ResetPasswordModule { + constructor() { + this.resetPasswordService = null; + this.resetPasswordUIManager = null; + this.isInitialized = false; + } + + // Initialize the reset password module with MSAL instance + async initialize(msalInstance) { + try { + if (this.isInitialized) { + Utilities.logMessage('ResetPasswordModule already initialized', 'warning'); + return; + } + + if (!msalInstance) { + throw new Error('MSAL instance is required for reset password module initialization'); + } + + Utilities.logMessage('Initializing ResetPasswordModule...', 'info'); + + // Initialize the reset password service + this.resetPasswordService = new ResetPasswordService(msalInstance); + Utilities.logMessage('ResetPasswordService initialized', 'info'); + + // Initialize the UI manager + this.resetPasswordUIManager = new ResetPasswordUIManager(this.resetPasswordService); + Utilities.logMessage('ResetPasswordUIManager initialized', 'info'); + + this.isInitialized = true; + Utilities.logMessage('ResetPasswordModule initialization completed successfully', 'success'); + + } catch (error) { + Utilities.logMessage('Failed to initialize ResetPasswordModule: ' + error.message, 'error'); + throw error; + } + } + + /** + * Update the MSAL instance (useful for configuration changes) + * @param {Object} msalInstance - The new MSAL instance + */ + updateMsalInstance(msalInstance) { + if (this.resetPasswordService) { + this.resetPasswordService.setMsalInstance(msalInstance); + Utilities.logMessage('MSAL instance updated in ResetPasswordService', 'info'); + } + } + + /** + * Get the reset password service instance + * @returns {ResetPasswordService|null} The reset password service instance + */ + getResetPasswordService() { + return this.resetPasswordService; + } + + /** + * Get the reset password service instance (alias for compatibility) + * @returns {ResetPasswordService|null} The reset password service instance + */ + getService() { + return this.resetPasswordService; + } + + /** + * Get the reset password UI manager instance + * @returns {ResetPasswordUIManager|null} The reset password UI manager instance + */ + getResetPasswordUIManager() { + return this.resetPasswordUIManager; + } + + /** + * Get the reset password UI manager instance (alias for compatibility) + * @returns {ResetPasswordUIManager|null} The reset password UI manager instance + */ + getUIManager() { + return this.resetPasswordUIManager; + } + + /** + * Check if the module is initialized + * @returns {boolean} True if initialized, false otherwise + */ + getIsInitialized() { + return this.isInitialized; + } + + /** + * Clear any pending reset password operations + */ + clearPendingOperations() { + if (this.resetPasswordService) { + this.resetPasswordService.clearPendingOperation(); + } + } + + /** + * Clear any pending reset password operation (alias for compatibility) + */ + clearPendingOperation() { + this.clearPendingOperations(); + } + + /** + * Check if there's a pending reset password operation + * @returns {boolean} True if there's a pending operation + */ + hasPendingOperation() { + if (!this.resetPasswordService) { + return false; + } + return this.resetPasswordService.hasPendingOperation(); + } + + /** + * Get current reset password state information + * @returns {Object} Current state information + */ + getCurrentState() { + if (!this.resetPasswordService) { + return { initialized: false }; + } + + return { + initialized: this.isInitialized, + pendingOperation: this.resetPasswordService.hasPendingOperation(), + currentEmail: this.resetPasswordService.getCurrentEmail() + }; + } + + /** + * Programmatically show the reset password form + */ + showResetPasswordForm() { + if (this.resetPasswordUIManager) { + this.resetPasswordUIManager.showResetPasswordForm(); + } else { + Utilities.logMessage('ResetPasswordUIManager not initialized', 'warning'); + } + } + + /** + * Programmatically hide the reset password form and show sign-in + */ + showSignInForm() { + if (this.resetPasswordUIManager) { + this.resetPasswordUIManager.showSignInForm(); + } else { + Utilities.logMessage('ResetPasswordUIManager not initialized', 'warning'); + } + } + + /** + * Clean up resources and event listeners + */ + cleanup() { + if (this.resetPasswordService) { + this.resetPasswordService.clearPendingOperation(); + } + + if (this.resetPasswordUIManager && this.resetPasswordUIManager.cleanup) { + this.resetPasswordUIManager.cleanup(); + } + + this.isInitialized = false; + Utilities.logMessage('ResetPasswordModule cleaned up', 'info'); + } + + /** + * Get module status for debugging + * @returns {Object} Module status information + */ + getStatus() { + return { + initialized: this.isInitialized, + hasResetPasswordService: !!this.resetPasswordService, + hasResetPasswordUIManager: !!this.resetPasswordUIManager, + currentState: this.getCurrentState() + }; + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/SignInService.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/SignInService.js new file mode 100644 index 0000000000..9bfeda4a00 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/SignInService.js @@ -0,0 +1,184 @@ +/* + * Sign-In Service for MSAL Native Auth Sample + */ + +import { Utilities } from '../utilities.js'; + +export class SignInService { + constructor(msalInstance) { + this.msalInstance = msalInstance; + this.pendingSignInResult = null; + } + + // Update the MSAL instance (used when app initializes) + setMsalInstance(msalInstance) { + this.msalInstance = msalInstance; + } + + // Initiates sign-in flow + async signIn(username) { + try { + Utilities.logMessage(`Starting sign-in process`, "info"); + + if (!this.msalInstance) { + throw new Error("MSAL not initialized. Cannot perform sign-in."); + } + + const signInInputs = { username: username }; + + const result = await this.msalInstance.signIn(signInInputs); + return this.handleSignInResult(result); + } catch (error) { + Utilities.logMessage(`Sign-in error: ${error}`, "error"); + throw error; + } + } + + // Handles the result from sign-in operations and determines next steps + handleSignInResult(result) { + // Check if sign-in is COMPLETED + if (result.isCompleted()) { + Utilities.logMessage("STATE: COMPLETED - Sign-in successful!", "success"); + const account = result.data; + Utilities.logMessage(`User account successfully authenticated`, "info"); + return { success: true, account: account }; + } + + // 2. Check if sign-in FAILED + if (result.isFailed()) { + Utilities.logMessage("STATE: FAILED - Sign-in failed", "error"); + if (result.error) { + Utilities.logMessage(`Error occurred during sign-in`, "error"); + } + return { success: false, result: result, error: result.error.errorData, state: 'failed' }; + } + + // 3. Check if CODE is REQUIRED (OOB Challenge - Email/SMS verification) + if (result.isCodeRequired()) { + Utilities.logMessage("STATE: CODE_REQUIRED - Email/SMS verification code needed", "info"); + + // Store the result for later use + this.pendingSignInResult = result; + + return { success: false, result: result, state: 'code_required' }; + } + + // 4. Check if PASSWORD is REQUIRED + if (result.isPasswordRequired()) { + Utilities.logMessage("STATE: PASSWORD_REQUIRED - Password authentication needed", "info"); + + // Store the result for later use + this.pendingSignInResult = result; + + return { success: false, result: result, state: 'password_required' }; + } + + return { success: false, result: result, state: 'unknown' }; + } + + /** + * Submits verification code for OTP authentication + */ + async submitCode(code) { + try { + Utilities.logMessage("🔍 SIGNIN SERVICE: submitCode called", "info"); + + if (!this.pendingSignInResult) { + throw new Error("No pending sign-in operation found"); + } + + Utilities.logMessage(`Submitting verification code`, "info"); + + // Submit the code using the pending result + const result = await this.pendingSignInResult.state.submitCode(code); + + // Handle the result of code submission + const finalResult = this.handleSignInResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingSignInResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Code submission failed`, "error"); + Utilities.logMessage(`Submit code error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Resends verification code + */ + async resendCode() { + try { + if (!this.pendingSignInResult) { + throw new Error("No pending sign-in operation found"); + } + + Utilities.logMessage("Resending verification code...", "info"); + + // Check if resend method is available + if (this.pendingSignInResult.state.resendCode) { + await this.pendingSignInResult.state.resendCode(); + Utilities.logMessage("Verification code resent successfully", "success"); + return { success: true }; + } else { + throw new Error("Resend code method not available"); + } + + } catch (error) { + Utilities.logMessage(`Failed to resend code`, "error"); + Utilities.logMessage(`Resend code error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Submits password for authentication + */ + async submitPassword(password) { + try { + if (!this.pendingSignInResult) { + throw new Error("No pending sign-in operation found"); + } + + Utilities.logMessage(`Submitting password for authentication...`, "info"); + + // Submit the password using the pending result + const result = await this.pendingSignInResult.state.submitPassword(password); + + // Handle the result of password submission + const finalResult = this.handleSignInResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingSignInResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Password submission failed`, "error"); + Utilities.logMessage(`Submit password error: ${error}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Clears any pending sign-in operation + */ + clearPendingOperation() { + this.pendingSignInResult = null; + Utilities.logMessage("Pending sign-in operation cleared", "info"); + } + + /** + * Checks if there's a pending sign-in operation + */ + hasPendingOperation() { + return this.pendingSignInResult !== null; + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/SignInUIManager.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/SignInUIManager.js new file mode 100644 index 0000000000..fbcd7689fd --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/SignInUIManager.js @@ -0,0 +1,446 @@ +/* + * Sign-In UI Manager for MSAL Native Auth Sample + */ + +import uiManager from '../ui.js'; +import { Utilities } from '../utilities.js'; + +export class SignInUIManager { + constructor(signInService) { + this.signInService = signInService; + this.eventListenersInitialized = false; + + // Initialize event listeners when DOM is ready + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', () => { + this.initializeEventListeners(); + }); + } else { + // DOM is already ready + this.initializeEventListeners(); + } + } + + /** + * Update the sign-in service reference + */ + setSignInService(signInService) { + this.signInService = signInService; + } + + /** + * Initialize all sign-in related event listeners + */ + initializeEventListeners() { + // Prevent double initialization + if (this.eventListenersInitialized) { + return; + } + + Utilities.logMessage('Initializing SignInUIManager event listeners...', 'info'); + + // Form submissions + const signInForm = document.getElementById('signInForm'); + if (signInForm) { + signInForm.addEventListener('submit', this.handleSignInSubmit.bind(this)); + Utilities.logMessage('Sign-in form event listener attached', 'info'); + } else { + Utilities.logMessage('Sign-in form not found in DOM', 'warning'); + } + + // Code verification form handlers are now set up dynamically in setupCodeVerificationHandlers + // This prevents conflicts with SignUpUIManager handlers + + // Password input form + const passwordInputForm = document.getElementById('passwordInputForm'); + if (passwordInputForm) { + passwordInputForm.addEventListener('submit', this.handlePasswordSubmit.bind(this)); + } + + const cancelPasswordBtn = document.getElementById('cancelPasswordBtn'); + if (cancelPasswordBtn) { + cancelPasswordBtn.addEventListener('click', this.handleCancelPassword.bind(this)); + } + + // Navigation buttons + const showSignInBtn = document.getElementById('showSignInBtn'); + if (showSignInBtn) { + showSignInBtn.addEventListener('click', this.showSignInForm.bind(this)); + } + + this.eventListenersInitialized = true; + Utilities.logMessage('SignInUIManager event listeners initialized successfully', 'success'); + } + + // Navigation Methods + showSignInForm() { + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + + // Update button states + if (showSignInBtn) showSignInBtn.classList.add('active'); + if (showSignUpBtn) showSignUpBtn.classList.remove('active'); + + // Show sign-in form, hide other forms + if (signInCard) signInCard.style.display = 'block'; + if (signUpCard) signUpCard.style.display = 'none'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + // Clear any previous form data + this.clearSignInForm(); + } + + showCodeVerificationForm(username) { + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + const codeInstructions = document.getElementById('codeInstructions'); + + // Hide other forms + if (signInCard) signInCard.style.display = 'none'; + if (signUpCard) signUpCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + // Update instructions with username + if (codeInstructions) { + codeInstructions.textContent = `A verification code has been sent to ${username}. Please check your email and enter the code below:`; + } + + // Show code verification form + if (codeVerificationCard) codeVerificationCard.style.display = 'block'; + + // Set up context-specific event handlers + this.setupCodeVerificationHandlers('signin'); + + // Focus on the code input field + const verificationCodeInput = document.getElementById('verificationCode'); + if (verificationCodeInput) { + setTimeout(() => verificationCodeInput.focus(), 100); + } + } + + showPasswordInputForm(username) { + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + const passwordInstructions = document.getElementById('passwordInstructions'); + + // Hide other forms + if (signInCard) signInCard.style.display = 'none'; + if (signUpCard) signUpCard.style.display = 'none'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + + // Update instructions with username + if (passwordInstructions) { + passwordInstructions.textContent = `Please enter your password for ${username} to complete sign-in:`; + } + + // Show password input form + if (passwordInputCard) passwordInputCard.style.display = 'block'; + + // Focus on the password input field + const passwordInput = document.getElementById('signInPassword'); + if (passwordInput) { + setTimeout(() => passwordInput.focus(), 100); + } + } + + hideCodeVerificationForm() { + const codeVerificationCard = document.getElementById('codeVerificationCard'); + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + + // Clear the verification code input + const verificationCodeInput = document.getElementById('verificationCode'); + if (verificationCodeInput) { + verificationCodeInput.value = ''; + } + + // Show sign-in form again + this.showSignInForm(); + } + + hidePasswordInputForm() { + const passwordInputCard = document.getElementById('passwordInputCard'); + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + // Clear the password input + const passwordInput = document.getElementById('signInPassword'); + if (passwordInput) { + passwordInput.value = ''; + } + + // Show sign-in form again + this.showSignInForm(); + } + + clearSignInForm() { + const signUpForm = document.getElementById('signInForm'); + if (signUpForm) { + signUpForm.reset(); + } + } + + /** + * Set up context-specific handlers for code verification + */ + setupCodeVerificationHandlers(context = 'signin') { + // Remove any existing handlers first (in case they were set by another manager) + const codeVerificationForm = document.getElementById('codeVerificationForm'); + const resendCodeBtn = document.getElementById('resendCodeBtn'); + const cancelCodeBtn = document.getElementById('cancelCodeBtn'); + + if (codeVerificationForm) { + // Remove existing listeners by cloning the element (removes all listeners) + const newForm = codeVerificationForm.cloneNode(true); + codeVerificationForm.parentNode.replaceChild(newForm, codeVerificationForm); + } + + if (resendCodeBtn) { + const newResendBtn = resendCodeBtn.cloneNode(true); + resendCodeBtn.parentNode.replaceChild(newResendBtn, resendCodeBtn); + } + + if (cancelCodeBtn) { + const newCancelBtn = cancelCodeBtn.cloneNode(true); + cancelCodeBtn.parentNode.replaceChild(newCancelBtn, cancelCodeBtn); + } + + // Add context-specific handlers + if (context === 'signin') { + const newCodeForm = document.getElementById('codeVerificationForm'); + const newResendBtn = document.getElementById('resendCodeBtn'); + const newCancelBtn = document.getElementById('cancelCodeBtn'); + + if (newCodeForm) { + newCodeForm.addEventListener('submit', this.handleCodeSubmit.bind(this)); + } + + if (newResendBtn) { + newResendBtn.addEventListener('click', this.handleResendCode.bind(this)); + } + + if (newCancelBtn) { + newCancelBtn.addEventListener('click', this.handleCancelCode.bind(this)); + } + } + } + + // Form Handlers + async handleSignInSubmit(event) { + event.preventDefault(); + + const signInBtn = document.getElementById('signInBtn'); + const originalText = signInBtn ? signInBtn.textContent : 'Sign In'; + + try { + // Show loading state + if (signInBtn) this.setButtonLoading(signInBtn, 'Signing in...'); + + // Get form data + const formData = new FormData(event.target); + const username = formData.get('username'); + + if (!username) { + throw new Error("Username is required"); + } + + if (!this.signInService) { + throw new Error("Sign-in service not available"); + } + + // Call the authentication method (passwordless flow) + const result = await this.signInService.signIn(username); + + Utilities.logMessage("🔍 SIGNIN UI MANAGER: handleSignInSubmit result received", "info"); + if (result.success) { + // Notify main UI manager about successful sign-in + uiManager.updateAccountInfo(result.account); + + // Clear the form on success + event.target.reset(); + } else if (result.state === 'code_required') { + // Show code verification form + this.showCodeVerificationForm(username); + } else if (result.state === 'password_required') { + // Show password input form + this.showPasswordInputForm(username); + } else { + // Handle other failure cases + Utilities.logMessage(`Sign-in failed`, "error"); + throw new Error(result.error || "An error occurred during sign-in"); + } + + } catch (error) { + Utilities.logMessage(error.message, "error"); + // Show error in the UI + uiManager.showErrorBanner(error.message, 'signin'); + } finally { + if (signInBtn) this.resetButton(signInBtn, originalText); + } + } + + async handleCodeSubmit(event) { + event.preventDefault(); + + Utilities.logMessage("🔍 SIGNIN UI MANAGER: handleCodeSubmit called", "info"); + + const submitCodeBtn = document.getElementById('submitCodeBtn'); + const originalText = submitCodeBtn ? submitCodeBtn.textContent : 'Verify Code'; + + try { + // Show loading state + if (submitCodeBtn) this.setButtonLoading(submitCodeBtn, 'Verifying...'); + + // Get form data + const formData = new FormData(event.target); + const code = formData.get('code'); + + if (!code) { + throw new Error("Verification code is required"); + } + + if (!this.signInService) { + throw new Error("Sign-in service not available"); + } + + // Call the code submission method + const result = await this.signInService.submitCode(code); + + if (result.success) { + // Notify main UI manager about successful verification + uiManager.updateAccountInfo(result.account); + this.hideCodeVerificationForm(); + + // Clear the form on success + event.target.reset(); + } else if (result.state === 'failed') { + throw new Error(result.error || "Code verification failed"); + } + + } catch (error) { + Utilities.logMessage(`Code verification error: ${error}`, "error"); + // Show error in the UI + uiManager.showErrorBanner(error.message || "An error occurred during code verification", 'signin'); + } finally { + if (submitCodeBtn) this.resetButton(submitCodeBtn, originalText); + } + } + + async handleResendCode() { + const resendCodeBtn = document.getElementById('resendCodeBtn'); + const originalText = resendCodeBtn ? resendCodeBtn.textContent : 'Resend Code'; + + try { + // Show loading state + if (resendCodeBtn) this.setButtonLoading(resendCodeBtn, 'Resending...'); + + if (!this.signInService) { + throw new Error("Sign-in service not available"); + } + + // Call the resend code method + const result = await this.signInService.resendCode(); + + if (result.success) { + Utilities.logMessage("Verification code resent successfully", "success"); + } else { + throw new Error("Failed to resend verification code"); + } + + } catch (error) { + Utilities.logMessage(`Resend code error: ${error}`, "error"); + // Show error in the UI + uiManager.showErrorBanner(error.message || "Failed to resend verification code", 'signin'); + } finally { + if (resendCodeBtn) this.resetButton(resendCodeBtn, originalText); + } + } + + handleCancelCode() { + // Hide the code verification form and return to sign-in + this.hideCodeVerificationForm(); + Utilities.logMessage("Code verification cancelled", "info"); + + // Clear any pending operations + if (this.signInService) { + this.signInService.clearPendingOperation(); + } + } + + async handlePasswordSubmit(event) { + event.preventDefault(); + + const submitPasswordBtn = document.getElementById('submitPasswordBtn'); + const originalText = submitPasswordBtn ? submitPasswordBtn.textContent : 'Verify Password'; + + try { + // Show loading state + if (submitPasswordBtn) this.setButtonLoading(submitPasswordBtn, 'Verifying...'); + + // Get form data + const formData = new FormData(event.target); + const password = formData.get('password'); + + if (!password) { + throw new Error("Password is required"); + } + + if (!this.signInService) { + throw new Error("Sign-in service not available"); + } + + // Call the password submission method + const result = await this.signInService.submitPassword(password); + + if (result.success) { + // Notify main UI manager about successful verification + uiManager.updateAccountInfo(result.account); + this.hidePasswordInputForm(); + + // Clear the form on success + event.target.reset(); + } else if (result.state === 'failed') { + throw new Error("Password verification failed"); + } + } catch (error) { + Utilities.logMessage(`Password verification error: ${error}`, "error"); + // Show error in the UI + uiManager.showErrorBanner(error.message || "Invalid password or authentication error", 'signin'); + } finally { + if (submitPasswordBtn) this.resetButton(submitPasswordBtn, originalText); + } + } + + handleCancelPassword() { + // Hide the password input form and return to sign-in + this.hidePasswordInputForm(); + Utilities.logMessage("Password input cancelled", "info"); + + // Clear any pending operations + if (this.signInService) { + this.signInService.clearPendingOperation(); + } + } + + // UI Helper Methods + setButtonLoading(button, text) { + if (button) { + button.disabled = true; + button.innerHTML = `${text}`; + } + } + + resetButton(button, originalText) { + if (button) { + button.disabled = false; + button.textContent = originalText; + } + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/index.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/index.js new file mode 100644 index 0000000000..0f7f7e30a1 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signin/index.js @@ -0,0 +1,43 @@ +/* + * Sign-In Module Entry Point for MSAL Native Auth Sample + */ + +import { SignInService } from './SignInService.js'; +import { SignInUIManager } from './SignInUIManager.js'; +import { Utilities } from '../utilities.js'; + +export class SignInModule { + constructor(msalInstance) { + this.msalInstance = msalInstance; + this.signInService = new SignInService(msalInstance); + this.signInUIManager = new SignInUIManager(this.signInService); + } + + /** + * Initialize the sign-in module + */ + initialize() { + // The SignInUIManager already initializes event listeners in its constructor + Utilities.logMessage('Sign-in module initialized', 'info'); + } + + // Get service and UI manager access + getService() { + return this.signInService; + } + + getUIManager() { + return this.signInUIManager; + } + + hasPendingOperation() { + return this.signInService.hasPendingOperation(); + } + + /** + * Clear any pending sign-in operation + */ + clearPendingOperation() { + this.signInService.clearPendingOperation(); + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/SignUpService.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/SignUpService.js new file mode 100644 index 0000000000..a4c7432765 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/SignUpService.js @@ -0,0 +1,359 @@ +/* + * Sign-Up Service for MSAL Native Auth Sample + * + * This service handles all sign-up related authentication operations, including + * user registration, code verification, and password handling. It provides a clean + * interface for sign-up functionality separate from sign-in operations. + */ + +import { Utilities } from '../utilities.js'; + +export class SignUpService { + constructor(msalInstance) { + this.msalInstance = msalInstance; + this.pendingSignUpResult = null; + this.currentUsername = null; + this.currentPassword = null; + } + + /** + * Updates the MSAL instance + * @param {Object} msalInstance - The new MSAL instance + */ + setMsalInstance(msalInstance) { + this.msalInstance = msalInstance; + } + + /** + * Initiates username-first sign-up flow + * @param {string} username - The username/email for sign-up + * @param {Object} attributes - Optional user attributes (firstName, lastName) + * @returns {Promise} Sign-up result with success status and next steps + */ + async signUp(username, attributes = {}) { + try { + if (!this.msalInstance) { + throw new Error("MSAL instance not initialized"); + } + + if (!username) { + throw new Error("Username is required"); + } + + Utilities.logMessage(`Starting sign-up process`, "info"); + + // Store current username for potential later use + this.currentUsername = username; + + // Prepare sign-up parameters + const signUpParams = { + username: username + }; + + // If attributes are provided, add them to the sign-up call + if (attributes && (attributes.firstName || attributes.lastName || attributes.city || attributes.country)) { + // Create attributes object as key-value pairs + const userAttributes = {}; + + if (attributes.firstName) { + userAttributes.givenName = attributes.firstName; + } + if (attributes.lastName) { + userAttributes.surname = attributes.lastName; + } + if (attributes.city) { + userAttributes.city = attributes.city; + } + if (attributes.country) { + userAttributes.country = attributes.country; + } + + signUpParams.attributes = userAttributes; + + Utilities.logMessage(`Sign-up with additional attributes provided`, "info"); + } + + // Use MSAL native auth sign-up start + const result = await this.msalInstance.signUp(signUpParams); + + return await this.handleSignUpResult(result); + } catch (error) { + Utilities.logMessage(`Sign-up failed: ${error.message}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Handle the result from MSAL sign-up operations + * @param {Object} result - The result from MSAL sign-up call + * @returns {Promise} Processed result with success status and account info + */ + async handleSignUpResult(result) { + if (!result) { + return { success: false, error: "No result received from sign-up operation" }; + } + + // 1. Check if sign-up FAILED + if (result.isFailed()) { + Utilities.logMessage("STATE: FAILED - Sign-up failed", "error"); + if (result.error) { + Utilities.logMessage(`Error occurred during sign-up`, "error"); + } + return { success: false, result: result, error: result.error.errorData, state: 'failed'}; + } + + // 2. Check if CODE is REQUIRED (Email verification) + if (result.isCodeRequired && result.isCodeRequired()) { + Utilities.logMessage("STATE: CODE_REQUIRED - Email verification code needed", "info"); + + // Store the result for later use + this.pendingSignUpResult = result; + + return { + success: false, + result: result, + state: 'code_required', + username: this.currentUsername + }; + } + + // 3. Check if PASSWORD is REQUIRED (Progressive disclosure) + if (result.isPasswordRequired && result.isPasswordRequired()) { + Utilities.logMessage("STATE: PASSWORD_REQUIRED - Password needed for sign-up", "info"); + + // Store the result for later use + this.pendingSignUpResult = result; + + return { + success: false, + result: result, + state: 'password_required', + username: this.currentUsername + }; + } + + // 4. Check if additional ATTRIBUTES are REQUIRED + if (result.isAttributesRequired && result.isAttributesRequired()) { + Utilities.logMessage("STATE: ATTRIBUTES_REQUIRED - Additional attributes needed", "info"); + + this.pendingSignUpResult = result; + + return { + success: false, + result: result, + state: 'attributes_required', + username: this.currentUsername + }; + } + + // 5. Check if sign-up is COMPLETE/SUCCESS + if (result.isCompleted && result.isCompleted()) { + Utilities.logMessage("STATE: SUCCESS - Sign-up completed successfully", "success"); + + // Check if state has signIn method and call it for automatic sign-in after sign-up + if (result.state && typeof result.state.signIn === 'function') { + Utilities.logMessage("STATE: AUTO_SIGNIN - Attempting automatic sign-in after sign-up completion", "info"); + try { + const signInResult = await result.state.signIn(); + Utilities.logMessage("STATE: AUTO_SIGNIN_SUCCESS - Automatic sign-in completed", "success"); + + // Clear pending result on success + this.pendingSignUpResult = null; + + return { + success: true, + result: signInResult, + account: signInResult.data || result.data, + state: 'completed_with_signin', + username: this.currentUsername, + autoSignIn: true + }; + } catch (signInError) { + Utilities.logMessage(`STATE: AUTO_SIGNIN_FAILED - Automatic sign-in failed`, "warning"); + // Fall back to regular completion without automatic sign-in + } + } + + // Clear pending result on success + this.pendingSignUpResult = null; + + return { + success: true, + result: result, + account: result.data, + state: 'completed', + username: this.currentUsername + }; + } + + // Default case - unknown state + Utilities.logMessage(`STATE: UNKNOWN - Unhandled result state encountered`, "warning"); + return { success: false, result: result, state: 'unknown' }; + } + + /** + * Submits password for sign-up when required + * @param {string} password - The password for sign-up + * @returns {Promise} Password submission result + */ + async submitPassword(password) { + try { + if (!this.pendingSignUpResult) { + throw new Error("No pending sign-up operation found"); + } + + if (!password) { + throw new Error("Password is required"); + } + + Utilities.logMessage(`Submitting password for sign-up...`, "info"); + + // Store password for potential later use + this.currentPassword = password; + + // Submit the password using the pending result + const result = await this.pendingSignUpResult.state.submitPassword(password); + + // Handle the result of password submission + const finalResult = await this.handleSignUpResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingSignUpResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Password submission failed: ${error.message}`, "error"); + return { success: false, error: error.message }; + } + } + + + + /** + * Submits verification code for email verification during sign-up + * @param {string} code - The verification code received via email + * @returns {Promise} Verification result + */ + async submitCode(code) { + try { + Utilities.logMessage("🔍 SIGNUP SERVICE: submitCode called", "info"); + + if (!this.pendingSignUpResult) { + throw new Error("No pending sign-up operation found"); + } + + if (!code) { + throw new Error("Verification code is required"); + } + + Utilities.logMessage(`Submitting verification code`, "info"); + // Submit the code using the pending result + const result = await this.pendingSignUpResult.state.submitCode(code); + + // Handle the result of code submission + const finalResult = await this.handleSignUpResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingSignUpResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Code submission failed: ${error.message}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Resends verification code for email verification + * @returns {Promise} Resend operation result + */ + async resendCode() { + try { + if (!this.pendingSignUpResult) { + throw new Error("No pending sign-up operation found"); + } + + Utilities.logMessage("Resending verification code...", "info"); + + // Check if resend method is available + if (this.pendingSignUpResult.state.resendCode) { + await this.pendingSignUpResult.state.resendCode(); + Utilities.logMessage("Verification code resent successfully", "success"); + return { success: true }; + } else { + throw new Error("Resend code method not available"); + } + + } catch (error) { + Utilities.logMessage(`Failed to resend code: ${error.message}`, "error"); + return { success: false, error: error.message, state: 'resend_failed' }; + } + } + + /** + * Submits additional attributes if required during sign-up + * @param {Object} attributes - The required attributes + * @returns {Promise} Attribute submission result + */ + async submitAttributes(attributes) { + try { + if (!this.pendingSignUpResult) { + throw new Error("No pending sign-up operation found"); + } + + if (!attributes) { + throw new Error("Attributes are required"); + } + + Utilities.logMessage("Submitting additional attributes...", "info"); + + // Submit the attributes using the pending result + const result = await this.pendingSignUpResult.state.submitAttributes(attributes); + + // Handle the result of attribute submission + const finalResult = this.handleSignUpResult(result); + + if (finalResult.success) { + // Clear the pending result on success + this.pendingSignUpResult = null; + } + + return finalResult; + + } catch (error) { + Utilities.logMessage(`Attribute submission failed: ${error.message}`, "error"); + return { success: false, error: error.message }; + } + } + + /** + * Clears any pending sign-up operation + */ + clearPendingOperation() { + this.pendingSignUpResult = null; + this.currentUsername = null; + this.currentPassword = null; + Utilities.logMessage("Pending sign-up operation cleared", "info"); + } + + /** + * Checks if there's a pending sign-up operation + */ + hasPendingOperation() { + return this.pendingSignUpResult !== null; + } + + /** + * Gets the current username being used for sign-up + * @returns {string|null} The current username or null if not set + */ + getCurrentUsername() { + return this.currentUsername; + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/SignUpUIManager.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/SignUpUIManager.js new file mode 100644 index 0000000000..12511c2a72 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/SignUpUIManager.js @@ -0,0 +1,646 @@ +/* + * Sign-Up UI Manager for MSAL Native Auth Sample + * + * This module handles all sign-up related UI interactions, form submissions, and DOM manipulation + * extracted from the SignInUIManager. It manages the sign-up forms, code verification, and attribute input. + */ + +import { Utilities } from "../utilities.js"; +import uiManager from "../ui.js"; + +export class SignUpUIManager { + constructor(signUpService) { + this.signUpService = signUpService; + this.eventListenersInitialized = false; + this.currentContext = null; // Track current context (signup/signin) + this.boundHandlers = new Map(); // Store bound event handlers for cleanup + this.activeListeners = new Map(); // Track active event listeners by element and event type + + // Initialize event listeners when DOM is ready + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', () => { + this.initializeEventListeners(); + }); + } else { + // DOM is already ready + this.initializeEventListeners(); + } + } + + /** + * Update the sign-up service reference + */ + setSignUpService(signUpService) { + this.signUpService = signUpService; + } + + /** + * Initialize all sign-up related event listeners + */ + initializeEventListeners() { + if (this.eventListenersInitialized) { + return; + } + + Utilities.logMessage('Initializing SignUpUIManager event listeners...', 'info'); + + // Bind handlers to maintain proper 'this' context + const signUpFormHandler = (e) => this.handleSignUpSubmit(e); + const showSignUpHandler = (e) => this.showSignUpForm(e); + + // Store bound handlers for cleanup + this.boundHandlers.set('signUpForm', signUpFormHandler); + this.boundHandlers.set('showSignUp', showSignUpHandler); + + // Add event listeners with tracking + this.addEventListenerWithTracking('signUpForm', 'submit', signUpFormHandler); + this.addEventListenerWithTracking('showSignUpBtn', 'click', showSignUpHandler); + + this.eventListenersInitialized = true; + Utilities.logMessage('SignUpUIManager event listeners initialized successfully', 'success'); + } + + /** + * Add event listener with tracking for easy cleanup + */ + addEventListenerWithTracking(elementId, eventType, handler) { + const element = document.getElementById(elementId); + if (element) { + element.addEventListener(eventType, handler); + + // Track the listener for cleanup + const key = `${elementId}_${eventType}`; + this.activeListeners.set(key, { element, eventType, handler }); + + Utilities.logMessage(`Event listener attached: ${elementId} (${eventType})`, 'info'); + } else { + Utilities.logMessage(`Element not found: ${elementId}`, 'warning'); + } + } + + /** + * Remove event listener and stop tracking + */ + removeEventListenerWithTracking(elementId, eventType) { + const key = `${elementId}_${eventType}`; + const listenerInfo = this.activeListeners.get(key); + + if (listenerInfo) { + listenerInfo.element.removeEventListener(listenerInfo.eventType, listenerInfo.handler); + this.activeListeners.delete(key); + Utilities.logMessage(`Event listener removed: ${elementId} (${eventType})`, 'info'); + } + } + + /** + * Set up context-specific handlers for code verification + */ + setupCodeVerificationHandlers(context) { + this.currentContext = context; + + // Remove existing code verification handlers + this.removeEventListenerWithTracking('codeVerificationForm', 'submit'); + this.removeEventListenerWithTracking('resendCodeBtn', 'click'); + this.removeEventListenerWithTracking('cancelCodeBtn', 'click'); + + // Add context-specific handlers + if (context === 'signup') { + const codeFormHandler = (e) => this.handleSignUpCodeSubmit(e); + const resendCodeHandler = (e) => this.handleSignUpResendCode(e); + const cancelCodeHandler = (e) => this.handleSignUpCancelCode(e); + + this.boundHandlers.set('codeForm_signup', codeFormHandler); + this.boundHandlers.set('resendCode_signup', resendCodeHandler); + this.boundHandlers.set('cancelCode_signup', cancelCodeHandler); + + this.addEventListenerWithTracking('codeVerificationForm', 'submit', codeFormHandler); + this.addEventListenerWithTracking('resendCodeBtn', 'click', resendCodeHandler); + this.addEventListenerWithTracking('cancelCodeBtn', 'click', cancelCodeHandler); + } + } + + /** + * Clean up event listeners to prevent memory leaks + */ + cleanup() { + // Remove all tracked event listeners + for (const [key, listenerInfo] of this.activeListeners) { + listenerInfo.element.removeEventListener(listenerInfo.eventType, listenerInfo.handler); + } + + this.activeListeners.clear(); + this.boundHandlers.clear(); + this.eventListenersInitialized = false; + this.currentContext = null; + Utilities.logMessage('SignUpUIManager cleanup completed', 'info'); + } + + // Navigation Methods + showSignUpForm() { + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + + // Update button states + if (showSignInBtn) showSignInBtn.classList.remove('active'); + if (showSignUpBtn) showSignUpBtn.classList.add('active'); + + // Show sign-up form, hide other forms + if (signInCard) signInCard.style.display = 'none'; + if (signUpCard) signUpCard.style.display = 'block'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + this.clearSignInForm(); + } + + clearSignInForm() { + const signUpForm = document.getElementById('signUpForm'); + if (signUpForm) { + signUpForm.reset(); + } + } + + showCodeVerificationForm(username, context = 'signup') { + const signInCard = document.getElementById('signInCard'); + const signUpCard = document.getElementById('signUpCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInputCard = document.getElementById('passwordInputCard'); + const codeInstructions = document.getElementById('codeInstructions'); + + // Hide other forms + if (signInCard) signInCard.style.display = 'none'; + if (signUpCard) signUpCard.style.display = 'none'; + if (passwordInputCard) passwordInputCard.style.display = 'none'; + + // Update instructions with username and context + if (codeInstructions) { + const message = context === 'signup' + ? `A verification code has been sent to ${username}. Please check your email and enter the code below to complete your registration:` + : `A verification code has been sent to ${username}. Please check your email and enter the code below:`; + codeInstructions.textContent = message; + } + + // Show code verification form + if (codeVerificationCard) codeVerificationCard.style.display = 'block'; + + // Set up context-specific event handlers + this.setupCodeVerificationHandlers(context); + + // Focus on the code input field + const verificationCodeInput = document.getElementById('verificationCode'); + if (verificationCodeInput) { + setTimeout(() => verificationCodeInput.focus(), 100); + } + } + + hideCodeVerificationForm() { + const codeVerificationCard = document.getElementById('codeVerificationCard'); + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + + // Clear the verification code input + const verificationCodeInput = document.getElementById('verificationCode'); + if (verificationCodeInput) { + verificationCodeInput.value = ''; + } + + // Remove context-specific handlers + this.removeEventListenerWithTracking('codeVerificationForm', 'submit'); + this.removeEventListenerWithTracking('resendCodeBtn', 'click'); + this.removeEventListenerWithTracking('cancelCodeBtn', 'click'); + this.currentContext = null; + + // Show sign-up form again + this.showSignUpForm(); + } + + // Form Handlers + async handleSignUpSubmit(event) { + event.preventDefault(); + + const signUpBtn = document.getElementById('signUpBtn'); + const originalText = signUpBtn ? signUpBtn.textContent : 'Sign Up'; + + try { + // Show loading state + if (signUpBtn) this.setButtonLoading(signUpBtn, 'Signing up...'); + + // Get form data + const formData = new FormData(event.target); + const username = formData.get('username'); + const firstName = formData.get('firstName'); + const lastName = formData.get('lastName'); + const city = formData.get('city'); + const country = formData.get('country'); + + if (!username) { + throw new Error("Username is required"); + } + + if (!this.signUpService) { + throw new Error("Sign-up service not available"); + } + + // Prepare attributes if any user attributes are provided + const attributes = {}; + if (firstName) attributes.firstName = firstName; + if (lastName) attributes.lastName = lastName; + if (city) attributes.city = city; + if (country) attributes.country = country; + + Utilities.logMessage("Processing sign-up form submission...", "info"); + + // Call the username-first sign-up method (progressive disclosure) + const result = await this.signUpService.signUp(username, attributes); + + if (result.state === 'code_required') { + // Show code verification form for email verification + this.showCodeVerificationForm(username, 'signup'); + + } else if (result.state === 'password_required') { + // Show password input form (progressive disclosure) + this.showPasswordInputForm(username); + + } else if (result.state === 'attributes_required') { + // Show additional attributes form (if needed) + this.showAttributesForm(result.result); + + } else if (result.state === 'failed') { + // Handle sign-up failure + Utilities.logMessage(`Sign-up failed: ${result.error || 'Unknown error'}`, "error"); + this.showSignUpError(result.error || 'Sign-up failed. Please try again.'); + } else { + // Handle other failure cases + Utilities.logMessage(`Sign-up failed`, "error"); + this.showSignUpError('Sign-up failed. Please try again.'); + } + + } catch (error) { + Utilities.logMessage("Sign-up error occurred: " + (error.message || "Unknown error"), "error"); + this.showSignUpError('An error occurred. Please try again.'); + } finally { + if (signUpBtn) this.resetButton(signUpBtn, originalText); + } + } + + async handleSignUpCodeSubmit(event) { + event.preventDefault(); + + Utilities.logMessage("🔍 SIGNUP UI MANAGER: handleSignUpCodeSubmit called", "info"); + + const submitCodeBtn = document.getElementById('submitCodeBtn'); + const originalText = submitCodeBtn ? submitCodeBtn.textContent : 'Verify Code'; + + try { + // Show loading state + if (submitCodeBtn) this.setButtonLoading(submitCodeBtn, 'Verifying...'); + + // Get form data + const formData = new FormData(event.target); + const code = formData.get('code'); + + if (!code) { + throw new Error("Verification code is required"); + } + + if (!this.signUpService) { + throw new Error("Sign-up service not available"); + } + + // Call the code submission method + const result = await this.signUpService.submitCode(code); + + if (result.success && result.state === 'completed_with_signin') { + // Code verification successful and sign-up completed with automatic sign-in + Utilities.logMessage("🔍 SIGNUP UI: Code verification completed with automatic sign-in", "success"); + + if (uiManager && uiManager.updateAccountInfo) { + Utilities.logMessage("🔍 SIGNUP UI: Updating account info after code verification", "info"); + uiManager.updateAccountInfo(result.account); + + Utilities.logMessage("🔍 SIGNUP UI: Account info updated successfully after code verification", "success"); + } else { + Utilities.logMessage("🔍 SIGNUP UI: uiManager or updateAccountInfo method not available after code verification", "warning"); + } + + this.hideCodeVerificationForm(); + + // Clear the form on success + event.target.reset(); + + } else if (result.state === 'password_required') { + // Code verification successful, but password is now required + Utilities.logMessage("🔍 SIGNUP UI: Code verified successfully, password now required", "info"); + + this.hideCodeVerificationForm(); + + // Clear the form + event.target.reset(); + + // Show password input form for sign-up + this.showPasswordInputForm(this.signUpService.getCurrentUsername()); + + } else if (result.state === 'attributes_required') { + // Code verification successful, but additional attributes required + Utilities.logMessage("Code verified successfully, attributes now required", "info"); + + this.hideCodeVerificationForm(); + + // Clear the form + event.target.reset(); + + // Show attributes form (if implemented) + this.showAttributesForm(result.result); + + } else { + // Handle verification failure + this.showCodeVerificationError(result.error || 'Code verification failed. Please try again.'); + } + + } catch (error) { + Utilities.logMessage("Code verification error occurred: " + (error.message || "Unknown error"), "error"); + this.showCodeVerificationError(error.message); + } finally { + if (submitCodeBtn) this.resetButton(submitCodeBtn, originalText); + } + } + + async handleSignUpResendCode() { + const resendCodeBtn = document.getElementById('resendCodeBtn'); + const originalText = resendCodeBtn ? resendCodeBtn.textContent : 'Resend Code'; + + try { + // Show loading state + if (resendCodeBtn) this.setButtonLoading(resendCodeBtn, 'Resending...'); + + if (!this.signUpService) { + throw new Error("Sign-up service not available"); + } + + // Call the resend code method + const result = await this.signUpService.resendCode(); + + if (result.success) { + Utilities.logMessage("Verification code resent successfully", "success"); + this.showCodeResendSuccess(); + } else { + throw new Error("Failed to resend verification code"); + } + + } catch (error) { + Utilities.logMessage("Resend code error occurred: " + (error.message || "Unknown error"), "error"); + this.showCodeResendError(error.message); + } finally { + if (resendCodeBtn) this.resetButton(resendCodeBtn, originalText); + } + } + + handleSignUpCancelCode() { + // Hide the code verification form and return to sign-up + this.hideCodeVerificationForm(); + Utilities.logMessage("Sign-up code verification cancelled", "info"); + + // Clear any pending operations + if (this.signUpService) { + this.signUpService.clearPendingOperation(); + } + } + + // UI Helper Methods + setButtonLoading(button, text) { + if (button) { + button.disabled = true; + button.innerHTML = `${text}`; + } + } + + resetButton(button, originalText) { + if (button) { + button.disabled = false; + button.textContent = originalText; + } + } + + clearSignUpForm() { + const signUpForm = document.getElementById('signUpForm'); + if (signUpForm) { + signUpForm.reset(); + } + + // Clear any error messages + this.clearErrorMessages(); + } + + showPasswordInputForm(username) { + const signUpCard = document.getElementById('signUpCard'); + const signUpPasswordCard = document.getElementById('signUpPasswordCard'); + const codeVerificationCard = document.getElementById('codeVerificationCard'); + const passwordInstructions = document.getElementById('signUpPasswordInstructions'); + + // Hide other forms + if (signUpCard) signUpCard.style.display = 'none'; + if (codeVerificationCard) codeVerificationCard.style.display = 'none'; + + // Update instructions with username + if (passwordInstructions) { + passwordInstructions.textContent = `Please create a password for ${username} to complete sign-up:`; + } + + // Show password input form + if (signUpPasswordCard) signUpPasswordCard.style.display = 'block'; + + // Set up password form event listeners + this.setupPasswordFormHandlers(); + + // Focus on the password input field + const passwordInput = document.getElementById('signUpPassword'); + if (passwordInput) { + setTimeout(() => passwordInput.focus(), 100); + } + } + + hidePasswordInputForm() { + const signUpPasswordCard = document.getElementById('signUpPasswordCard'); + if (signUpPasswordCard) signUpPasswordCard.style.display = 'none'; + + // Clear the password input + const passwordInput = document.getElementById('signUpPassword'); + if (passwordInput) { + passwordInput.value = ''; + } + + // Remove password form handlers + this.removePasswordFormHandlers(); + + // Show sign-up form again + this.showSignUpForm(); + } + + setupPasswordFormHandlers() { + // Remove existing handlers first + this.removePasswordFormHandlers(); + + // Add password form submit handler + const passwordFormHandler = (e) => this.handlePasswordSubmit(e); + const cancelPasswordHandler = (e) => this.handleCancelPassword(e); + + this.boundHandlers.set('signUpPasswordForm', passwordFormHandler); + this.boundHandlers.set('cancelSignUpPassword', cancelPasswordHandler); + + this.addEventListenerWithTracking('signUpPasswordForm', 'submit', passwordFormHandler); + this.addEventListenerWithTracking('cancelSignUpPasswordBtn', 'click', cancelPasswordHandler); + } + + removePasswordFormHandlers() { + this.removeEventListenerWithTracking('signUpPasswordForm', 'submit'); + this.removeEventListenerWithTracking('cancelSignUpPasswordBtn', 'click'); + + this.boundHandlers.delete('signUpPasswordForm'); + this.boundHandlers.delete('cancelSignUpPassword'); + } + + async handlePasswordSubmit(event) { + event.preventDefault(); + + Utilities.logMessage("🔍 SIGNUP UI: handlePasswordSubmit called", "info"); + + const submitPasswordBtn = document.getElementById('submitSignUpPasswordBtn'); + const originalText = submitPasswordBtn ? submitPasswordBtn.textContent : 'Create Account'; + + try { + // Show loading state + if (submitPasswordBtn) this.setButtonLoading(submitPasswordBtn, 'Creating account...'); + + // Get form data + const formData = new FormData(event.target); + const password = formData.get('password'); + + if (!password) { + throw new Error("Password is required"); + } + + if (!this.signUpService) { + throw new Error("Sign-up service not available"); + } + + // Call the password submission method + const result = await this.signUpService.submitPassword(password); + + if (result.success && result.state === 'completed_with_signin') { + // Password accepted and sign-up completed with automatic sign-in + Utilities.logMessage("🔍 SIGNUP UI: Password submission completed with automatic sign-in", "success"); + + // Notify main UI manager about successful sign-up and sign-in + if (uiManager && uiManager.updateAccountInfo) { + Utilities.logMessage("🔍 SIGNUP UI: Updating account info after password submission", "info"); + uiManager.updateAccountInfo(result.account); + + Utilities.logMessage("🔍 SIGNUP UI: Account info updated successfully after password submission", "success"); + } else { + Utilities.logMessage("🔍 SIGNUP UI: uiManager or updateAccountInfo method not available after password submission", "warning"); + } + this.hidePasswordInputForm(); + + // Clear the form on success + event.target.reset(); + + } else { + // Handle password submission failure + Utilities.logMessage(`Password submission failed: ${result.error || 'Unknown error'}`, "error"); + this.showSignUpError('Password submission failed. Please try again.'); + } + + } catch (error) { + Utilities.logMessage("Password submission error: " + (error.message || "Unknown error"), "error"); + this.showSignUpError(error.message); + } finally { + if (submitPasswordBtn) this.resetButton(submitPasswordBtn, originalText); + } + } + + handleCancelPassword(event) { + event.preventDefault(); + this.hidePasswordInputForm(); + + // Clear any pending operations + if (this.signUpService) { + this.signUpService.clearPendingOperation(); + } + } + + showSignUpSuccess(username) { + // You can customize this to show a success message in the UI + Utilities.logMessage(`Sign-up successful for ${username}`, "success"); + } + + showSignUpSuccessWithSignIn(username) { + // Show success message for automatic sign-in after sign-up + Utilities.logMessage(`Sign-up and automatic sign-in successful for ${username}`, "success"); + } + + showSignUpError(message) { + // Log the error to console + Utilities.logMessage(`Sign-up error: ${message}`, "error"); + + // Display the error in the global error banner + uiManager.showErrorBanner(message, 'signup'); + } + + showCodeVerificationError(message) { + Utilities.logMessage(`Code verification error: ${message}`, "error"); + uiManager.showErrorBanner(message, 'signup'); + } + + showCodeResendSuccess() { + Utilities.logMessage("Code resent successfully", "success"); + // Show a temporary success message + const errorBanner = document.getElementById('errorBanner'); + const errorMessageElement = document.getElementById('errorMessage'); + + if (errorBanner && errorMessageElement) { + errorMessageElement.textContent = "Verification code has been resent to your email."; + errorBanner.style.display = 'flex'; + errorBanner.style.backgroundColor = 'rgba(75, 181, 67, 0.2)'; + errorBanner.style.borderColor = '#4bb543'; + errorMessageElement.style.color = '#2c7b25'; + + // Auto-hide after 5 seconds + setTimeout(() => { + uiManager.hideErrorBanner(); + // Reset styles + errorBanner.style.backgroundColor = ''; + errorBanner.style.borderColor = ''; + errorMessageElement.style.color = ''; + }, 5000); + } + } + + showCodeResendError(message) { + Utilities.logMessage(`Code resend error: ${message}`, "error"); + uiManager.showErrorBanner(`Failed to resend code: ${message}`, 'signup'); + } + + showAttributesForm(result) { + // Placeholder for additional attributes form if needed + Utilities.logMessage("Additional attributes required for sign-up", "info"); + uiManager.showErrorBanner("Additional information is required to complete registration.", 'signup'); + } + + // UI Helper Methods + setButtonLoading(button, text) { + if (button) { + button.disabled = true; + button.innerHTML = `${text}`; + } + } + + resetButton(button, originalText) { + if (button) { + button.disabled = false; + button.textContent = originalText; + } + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/index.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/index.js new file mode 100644 index 0000000000..11299e343a --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/signup/index.js @@ -0,0 +1,191 @@ +/* + * Sign-Up Module for MSAL Native Auth Sample + */ + +import { SignUpService } from './SignUpService.js'; +import { SignUpUIManager } from './SignUpUIManager.js'; +import { Utilities } from '../utilities.js'; + +export class SignUpModule { + constructor() { + this.signUpService = null; + this.signUpUIManager = null; + this.isInitialized = false; + } + + // Initialize the sign-up module with MSAL instance + async initialize(msalInstance) { + try { + if (this.isInitialized) { + Utilities.logMessage('SignUpModule already initialized', 'warning'); + return; + } + + if (!msalInstance) { + throw new Error('MSAL instance is required for sign-up module initialization'); + } + + Utilities.logMessage('Initializing SignUpModule...', 'info'); + + // Initialize the sign-up service + this.signUpService = new SignUpService(msalInstance); + Utilities.logMessage('SignUpService initialized', 'info'); + + // Initialize the UI manager + this.signUpUIManager = new SignUpUIManager(this.signUpService); + Utilities.logMessage('SignUpUIManager initialized', 'info'); + + this.isInitialized = true; + Utilities.logMessage('SignUpModule initialization completed successfully', 'success'); + + } catch (error) { + Utilities.logMessage(`Failed to initialize SignUpModule: ${error}`, 'error'); + throw error; + } + } + + /** + * Update the MSAL instance (useful for configuration changes) + * @param {Object} msalInstance - The new MSAL instance + */ + updateMsalInstance(msalInstance) { + if (this.signUpService) { + this.signUpService.setMsalInstance(msalInstance); + Utilities.logMessage('MSAL instance updated in SignUpService', 'info'); + } + } + + /** + * Get the sign-up service instance + * @returns {SignUpService|null} The sign-up service instance + */ + getSignUpService() { + return this.signUpService; + } + + /** + * Get the sign-up service instance (alias for compatibility) + * @returns {SignUpService|null} The sign-up service instance + */ + getService() { + return this.signUpService; + } + + /** + * Get the sign-up UI manager instance + * @returns {SignUpUIManager|null} The sign-up UI manager instance + */ + getSignUpUIManager() { + return this.signUpUIManager; + } + + /** + * Get the sign-up UI manager instance (alias for compatibility) + * @returns {SignUpUIManager|null} The sign-up UI manager instance + */ + getUIManager() { + return this.signUpUIManager; + } + + /** + * Check if the module is initialized + * @returns {boolean} True if initialized, false otherwise + */ + getIsInitialized() { + return this.isInitialized; + } + + /** + * Clear any pending sign-up operations + */ + clearPendingOperations() { + if (this.signUpService) { + this.signUpService.clearPendingOperation(); + } + } + + /** + * Clear any pending sign-up operation (alias for compatibility) + */ + clearPendingOperation() { + this.clearPendingOperations(); + } + + /** + * Check if there's a pending sign-up operation + * @returns {boolean} True if there's a pending operation + */ + hasPendingOperation() { + if (!this.signUpService) { + return false; + } + return this.signUpService.hasPendingOperation(); + } + + /** + * Get current sign-up state information + * @returns {Object} Current state information + */ + getCurrentState() { + if (!this.signUpService) { + return { initialized: false }; + } + + return { + initialized: this.isInitialized, + pendingOperation: this.signUpService.hasPendingOperation(), + currentUsername: this.signUpService.getCurrentUsername() + }; + } + + /** + * Programmatically show the sign-up form + */ + showSignUpForm() { + if (this.signUpUIManager) { + this.signUpUIManager.showSignUpForm(); + } else { + Utilities.logMessage('SignUpUIManager not initialized', 'warning'); + } + } + + /** + * Programmatically hide the sign-up form and show sign-in + */ + showSignInForm() { + if (this.signUpUIManager) { + this.signUpUIManager.showSignInForm(); + } else { + Utilities.logMessage('SignUpUIManager not initialized', 'warning'); + } + } + + /** + * Clean up resources and event listeners + */ + cleanup() { + if (this.signUpService) { + this.signUpService.clearPendingOperation(); + } + + if (this.signUpUIManager && this.signUpUIManager.cleanup) { + this.signUpUIManager.cleanup(); + } + + this.isInitialized = false; + Utilities.logMessage('SignUpModule cleaned up', 'info'); + } + + /** + * Get module status for debugging + * @returns {Object} Module status information + */ + getStatus() { + return { + initialized: this.isInitialized, + hasSignUpService: !!this.signUpService, + hasSignUpUIManager: !!this.signUpUIManager, + currentState: this.getCurrentState() + }; + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/ui.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/ui.js new file mode 100644 index 0000000000..d0780f2c9d --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/ui.js @@ -0,0 +1,201 @@ +/* + * UI Management for MSAL Native Auth Sample + */ + +// Import the NativeAuthApp module and utilities +import { getNativeAuthApp } from './app.js'; +import { Utilities } from './utilities.js'; + +class UIManager { + constructor() { + // Track if we have a current account + this.hasCurrentAccount = false; + + // Initialize the auth status banner + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', () => { + this.updateAuthStatusBanner(); + }); + } else { + this.updateAuthStatusBanner(); + } + + this.initializeEventListeners(); + } + + initializeEventListeners() { + // Wait for the app to be initialized + document.addEventListener('DOMContentLoaded', () => { + // Check if user is already signed in + this.handleGetCurrentAccount(); + + // For the navigation bar sign out button + const navSignOutBtn = document.getElementById('navSignOutBtn'); + if (navSignOutBtn) { + navSignOutBtn.addEventListener('click', this.handleSignOut.bind(this)); + } + + // For dismissing error messages + const dismissErrorBtn = document.getElementById('dismissErrorBtn'); + if (dismissErrorBtn) { + dismissErrorBtn.addEventListener('click', this.hideErrorBanner.bind(this)); + } + }); + } + + // handleViewAccountDetails method removed as it was related to account information + + async handleGetCurrentAccount() { + try { + // Get the native auth app instance using the imported function + const nativeAuthApp = getNativeAuthApp(); + + if (!nativeAuthApp) { + throw new Error("Authentication app not initialized"); + } + + const result = await nativeAuthApp.getCurrentAccount(); + + if (result.success && result.account) { + this.updateAccountInfo(result.account); + } else { + this.updateAccountInfo(null); + } + } catch (error) { + Utilities.logMessage(`Get current account error: ${error}`, "error"); + this.updateAccountInfo(null); + } + } + + async handleSignOut() { + try { + // Get the native auth app instance using the imported function + const nativeAuthApp = getNativeAuthApp(); + + if (!nativeAuthApp) { + throw new Error("Authentication app not initialized"); + } + + // First check if there's a current account by calling getCurrentAccount + const accountResult = await nativeAuthApp.getCurrentAccount(); + + // Only sign out if there's a current account + if (accountResult.success && accountResult.account) { + await nativeAuthApp.signOut(); + + // Update account status + this.updateAccountInfo(null); + + // Hide the auth success card + const authSuccessCard = document.getElementById('authSuccessCard'); + if (authSuccessCard) { + authSuccessCard.style.display = 'none'; + } + + // Clear forms + const signInForm = document.getElementById('signInForm'); + if (signInForm) { + signInForm.reset(); + } + + const signUpForm = document.getElementById('signUpForm'); + if (signUpForm) { + signUpForm.reset(); + } + + const resetPasswordForm = document.getElementById('resetPasswordForm'); + if (resetPasswordForm) { + resetPasswordForm.reset(); + } + + // Update navigation button status + const showSignInBtn = document.getElementById('showSignInBtn'); + const showSignUpBtn = document.getElementById('showSignUpBtn'); + const showResetPasswordBtn = document.getElementById('showResetPasswordBtn'); + + if (showSignInBtn) showSignInBtn.classList.add('active'); + if (showSignUpBtn) showSignUpBtn.classList.remove('active'); + if (showResetPasswordBtn) showResetPasswordBtn.classList.remove('active'); + } + } catch (error) { + Utilities.logMessage(`Sign-out error: ${error}`, "error"); + } + } + + // UI Helper Methods (button loading methods moved to SignInUIManager) + + updateAccountInfo(account) { + // Update hasCurrentAccount flag + this.hasCurrentAccount = !!account; + + // Update the auth status banner + this.updateAuthStatusBanner(); + } + + updateAuthStatusBanner() { + const authStatusBanner = document.getElementById('authStatusBanner'); + if (authStatusBanner) { + if (this.hasCurrentAccount) { + authStatusBanner.textContent = 'Signed in!'; + authStatusBanner.className = 'auth-status-banner auth-status-signed-in'; + } else { + authStatusBanner.textContent = 'No user signed in'; + authStatusBanner.className = 'auth-status-banner auth-status-signed-out'; + } + } + } + + /** + * Shows an error banner with the provided message + * @param {string} errorMessage - The error message to display + * @param {string} flow - The flow during which the error occurred ('signin', 'signup', or 'resetpassword') + */ + showErrorBanner(errorMessage, flow = 'general') { + Utilities.logMessage(`Error in ${flow} flow: ${errorMessage}`, "error"); + + const errorBanner = document.getElementById('errorBanner'); + const errorMessageElement = document.getElementById('errorMessage'); + + if (errorBanner && errorMessageElement) { + // Format the message with flow context + let formattedMessage = errorMessage; + switch (flow) { + case 'signin': + formattedMessage = `Sign-in Error: ${errorMessage}`; + break; + case 'signup': + formattedMessage = `Sign-up Error: ${errorMessage}`; + break; + case 'resetpassword': + formattedMessage = `Password Reset Error: ${errorMessage}`; + break; + default: + formattedMessage = `Error: ${errorMessage}`; + } + + errorMessageElement.textContent = formattedMessage; + errorBanner.style.display = 'flex'; + + // Auto-hide after 10 seconds + setTimeout(() => { + this.hideErrorBanner(); + }, 10000); + } + } + + /** + * Hides the error banner + */ + hideErrorBanner() { + const errorBanner = document.getElementById('errorBanner'); + if (errorBanner) { + errorBanner.style.display = 'none'; + } + } +} + +// Create and export a singleton instance of UIManager +const uiManager = new UIManager(); + +// Export the instance for module imports +export default uiManager; diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/utilities.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/utilities.js new file mode 100644 index 0000000000..ca3f21bdf6 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/app/utilities.js @@ -0,0 +1,27 @@ +/* + * Utilities Module + */ + +export class Utilities { + static logMessage(message, type = 'info') { + // Log to console instead of UI + const timestamp = new Date().toLocaleTimeString(); + const logEntry = `[${timestamp}] ${message}`; + + switch (type) { + case 'error': + console.error(logEntry); + break; + case 'warning': + console.warn(logEntry); + break; + case 'success': + console.log('%c' + logEntry, 'color: green'); + break; + case 'info': + default: + console.info(logEntry); + break; + } + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/cors.js b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/cors.js new file mode 100644 index 0000000000..f10ac22d14 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/cors.js @@ -0,0 +1,101 @@ +const http = require("http"); +const https = require("https"); +const url = require("url"); +const argv = require("yargs") + .usage( + "Usage: $0 --tenantSubdomain [subdomain] --tenantId [id] --port [PORT]" + ) + .alias("d", "tenantSubdomain") + .alias("t", "tenantId") + .alias("p", "port") + .describe("tenantSubdomain", "Tenant subdomain") + .describe("tenantId", "Tenant ID") + .describe("port", "Port to run the proxy on") + .default("port", 30001) + .strict().argv; + +const port = argv.port; +const apiPath = "/api"; +const serviceUri = `https://${argv.tenantSubdomain}.ciamlogin.com/${argv.tenantId}`; + +const extraHeaders = [ + "x-client-SKU", + "x-client-VER", + "x-client-OS", + "x-client-CPU", + "x-client-current-telemetry", + "x-client-last-telemetry", + "client-request-id", +]; +http.createServer((req, res) => { + const reqUrl = url.parse(req.url); + const domain = url.parse(serviceUri).hostname; + + // Set CORS headers for all responses including OPTIONS + const corsHeaders = { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS", + "Access-Control-Allow-Headers": + "Content-Type, Authorization, " + extraHeaders.join(", "), + "Access-Control-Allow-Credentials": "true", + "Access-Control-Max-Age": "86400", // 24 hours + }; + + // Handle preflight OPTIONS request + if (req.method === "OPTIONS") { + res.writeHead(204, corsHeaders); + res.end(); + return; + } + + if (reqUrl.pathname.startsWith(apiPath)) { + const targetUrl = + serviceUri + + reqUrl.pathname?.replace(apiPath, "") + + (reqUrl.search || ""); + + console.log( + "Incoming request -> " + req.url + " ===> " + reqUrl.pathname + ); + + const newHeaders = {}; + for (let [key, value] of Object.entries(req.headers)) { + if (key !='origin') { + newHeaders[key] = value; + } + } + + const proxyReq = https.request( + targetUrl, // CodeQL [SM04580] The newly generated target URL utilizes the configured proxy URL to resolve the CORS issue and will be used exclusively for demo purposes and run locally. + { + method: req.method, + headers: { + ...newHeaders, + host: domain, + }, + }, + (proxyRes) => { + res.writeHead(proxyRes.statusCode, { + ...proxyRes.headers, + ...corsHeaders, + }); + + proxyRes.pipe(res); + } + ); + + proxyReq.on("error", (err) => { + console.error("Error with the proxy request:", err); + res.writeHead(500, { "Content-Type": "text/plain" }); + res.end("Proxy error."); + }); + + req.pipe(proxyReq); + } else { + res.writeHead(404, { "Content-Type": "text/plain" }); + res.end("Not Found"); + } +}).listen(port, () => { + console.log("CORS proxy running on http://localhost:" + port); + console.log("Proxying from " + apiPath + " ===> " + serviceUri); +}); diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/gen_env_native_auth.ps1 b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/gen_env_native_auth.ps1 new file mode 100644 index 0000000000..523acd3eb8 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/gen_env_native_auth.ps1 @@ -0,0 +1,19 @@ +# Variables +# To be used with @azure/identity functionality, they must adhere to the same names as described in: +# https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet + +# login - you should have permission already to ready the necessary keyvault +# if not, ask your manager to help with onboarding +az login --tenant "72f988bf-86f1-41af-91ab-2d7cd011db47" --output none + +# get the config file +$base64Config = (az keyvault secret show --vault-name "buildautomation" -n "js-native-auth-config").value + +$outputFile = (Get-Location).Path + "\nativeAuthConfig.json" + +$decodedConfig = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($base64Config)) + +# Use UTF-8 encoding without BOM to prevent syntax errors when reading the JSON file +$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False +$cleanedConfig = $decodedConfig.replace("`r`n", [System.Environment]::NewLine) +[System.IO.File]::WriteAllText($outputFile, $cleanedConfig, $utf8NoBomEncoding) diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/index.html b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/index.html new file mode 100644 index 0000000000..876f76ef7d --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/index.html @@ -0,0 +1,227 @@ + + + + + + MSAL Native Auth Sample + + + +
+

+ +
+

MSAL Native Auth Sample

+ +
+ +
+
+
+

Sign In

+
+
+ + +
+ +
+
+ + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/jest.config.cjs b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/jest.config.cjs new file mode 100644 index 0000000000..1eb1c80027 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/jest.config.cjs @@ -0,0 +1,12 @@ +module.exports = { + displayName: "Native Auth Sample App", + globals: { + __PORT__: 30670, + __STARTCMD__: "npm start -- --port 30670 --sample nativeAuthSample", + }, + testMatch: ["/test/**/*.spec.ts"], + preset: "../../../../e2eTestUtils/jest-puppeteer-utils/jest-preset.js", + transform: { + "^.+\\.ts?$": "ts-jest", + }, +}; diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/package-lock.json b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/package-lock.json new file mode 100644 index 0000000000..58d2876faf --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/package-lock.json @@ -0,0 +1,4974 @@ +{ + "name": "native-auth-sample", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "native-auth-sample", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@azure/msal-browser": "^4.0.0", + "express": "^4.20.0", + "morgan": "^1.5.2" + }, + "devDependencies": { + "@azure/msal-browser": "^4.0.0", + "@types/express": "^4.17.3", + "@types/jest": "^29.5.0", + "@types/morgan": "^1.9.0", + "e2e-test-utils": "file:../../e2eTestUtils", + "jest": "^29.5.0", + "jest-junit": "^16.0.0", + "jose": "^2.0.7", + "ts-jest": "^29.1.0", + "typescript": "^4.9.5" + } + }, + "../../e2eTestUtils": { + "dev": true + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@azure/msal-browser": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-4.13.0.tgz", + "integrity": "sha512-n2ySryLd+wHmm/0Y1mwFI4J9UXVCu2DeWKtoWNWLVcpvK2k0Ez1qIigKleUm2ZfTbfAXdue+V8htmFft0qgyGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@azure/msal-common": "15.7.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/msal-common": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-15.7.0.tgz", + "integrity": "sha512-m9M5hoFoxhe/HlXNVa4qBHekrX60CVPkWzsjhKQGuzw/OPOmurosKRPDIMn8fug/E1hHI5v33DvT1LVJfItjcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.27.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.5.tgz", + "integrity": "sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", + "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.3", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.27.3", + "@babel/helpers": "^7.27.4", + "@babel/parser": "^7.27.4", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.27.4", + "@babel/types": "^7.27.3", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/generator": { + "version": "7.27.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.5.tgz", + "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.27.5", + "@babel/types": "^7.27.3", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz", + "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.27.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.6.tgz", + "integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.27.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz", + "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.3" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", + "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", + "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", + "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.3", + "@babel/parser": "^7.27.4", + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.3", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/types": { + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@panva/asn1.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@panva/asn1.js/-/asn1.js-1.0.0.tgz", + "integrity": "sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.7.tgz", + "integrity": "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.23.tgz", + "integrity": "sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/morgan": { + "version": "1.9.10", + "resolved": "https://registry.npmjs.org/@types/morgan/-/morgan-1.9.10.tgz", + "integrity": "sha512-sS4A1zheMvsADRVfT0lYbJ4S9lmsey8Zo2F7cnbYjWHP67Q0AwMYuuzLlkIM2N8gAbb9cubhIVFwcIN2XyYCkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "22.15.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.30.tgz", + "integrity": "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", + "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/basic-auth/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001721", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz", + "integrity": "sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/dedent": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz", + "integrity": "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/e2e-test-utils": { + "resolved": "../../e2eTestUtils", + "link": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.165", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.165.tgz", + "integrity": "sha512-naiMx1Z6Nb2TxPU6fiFrUrDTjyPMLdTtaOd2oLmG8zVSg2hCWGkhPyxwk+qRmZ1ytwVqUv0u7ZcDA5+ALhaUtw==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jose": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/jose/-/jose-2.0.7.tgz", + "integrity": "sha512-5hFWIigKqC+e/lRyQhfnirrAqUdIPMB7SJRqflJaO29dW7q5DFvH1XCSTmv6PQ6pb++0k6MJlLRoS0Wv4s38Wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@panva/asn1.js": "^1.0.0" + }, + "engines": { + "node": ">=10.13.0 < 13 || >=13.7.0" + }, + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "license": "MIT", + "dependencies": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-jest": { + "version": "29.3.4", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.4.tgz", + "integrity": "sha512-Iqbrm8IXOmV+ggWHOTEbjwyCf2xZlUMv5npExksXohL+tk8va4Fjhb+X2+Rt9NBmgO7bJ8WpnMLOwih/DnMlFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.7.2", + "type-fest": "^4.41.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true, + "license": "MIT" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/styles.css b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/styles.css new file mode 100644 index 0000000000..df00eacdfe --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/styles.css @@ -0,0 +1,520 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + min-height: 100vh; + color: #333; +} + +.auth-status-banner { + padding: 8px 16px; + text-align: center; + margin-bottom: 15px; + border-radius: 4px; + font-weight: bold; + transition: all 0.3s ease; +} + +.auth-status-signed-in { + background-color: rgba(75, 181, 67, 0.2); + color: #2c7b25; + border: 1px solid #4bb543; +} + +.auth-status-signed-out { + background-color: rgba(255, 102, 102, 0.2); + color: #cc0000; + border: 1px solid #ff6666; +} + +.error-banner { + padding: 12px 20px; + margin-bottom: 15px; + background-color: rgba(255, 59, 48, 0.2); + color: #d40c00; + border-radius: 4px; + border: 1px solid #ff3b30; + font-weight: bold; + display: flex; + justify-content: space-between; + align-items: center; + animation: fadeIn 0.3s ease; +} + +.dismiss-btn { + background: none; + border: none; + color: #d40c00; + font-size: 20px; + cursor: pointer; + padding: 0 8px; + font-weight: bold; +} + +.dismiss-btn:hover { + opacity: 0.8; +} + +@keyframes fadeIn { + from { opacity: 0; transform: translateY(-10px); } + to { opacity: 1; transform: translateY(0); } +} + +.container { + max-width: 1200px; + margin: 0 auto; + padding: 20px; +} + +header { + text-align: center; + margin-bottom: 40px; + color: white; +} + +header h1 { + font-size: 2.5rem; + margin-bottom: 10px; + font-weight: 300; +} + +header p { + font-size: 1.1rem; + opacity: 0.9; +} + +/* Navigation Bar Styles */ +.auth-nav { + margin-top: 20px; + display: flex; + justify-content: center; + gap: 10px; +} + +.nav-btn { + padding: 12px 24px; + border: 2px solid rgba(255, 255, 255, 0.3); + border-radius: 25px; + background: rgba(255, 255, 255, 0.1); + color: white; + font-size: 16px; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + backdrop-filter: blur(10px); + text-decoration: none; + text-align: center; + display: inline-block; +} + +.nav-btn:hover { + background: rgba(255, 255, 255, 0.2); + border-color: rgba(255, 255, 255, 0.5); + transform: translateY(-2px); + text-decoration: none; +} + +.nav-btn.active { + background: rgba(255, 255, 255, 0.9); + color: #667eea; + border-color: rgba(255, 255, 255, 0.9); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); +} + +.nav-btn.active:hover { + background: white; + transform: translateY(-2px); +} + +.nav-btn.btn-danger { + background: rgba(229, 62, 62, 0.9); + color: white; + border-color: rgba(229, 62, 62, 0.5); +} + +.nav-btn.btn-danger:hover { + background: rgba(229, 62, 62, 1); + border-color: rgba(229, 62, 62, 0.8); + transform: translateY(-2px); +} + + + +main { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + gap: 20px; + margin-bottom: 30px; +} + +@media (max-width: 1024px) { + main { + grid-template-columns: 1fr 1fr; + } +} + +@media (max-width: 768px) { + main { + grid-template-columns: 1fr; + } +} + +.auth-section { + display: contents; +} + +.card { + background: white; + border-radius: 12px; + padding: 30px; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.card:hover { + transform: translateY(-2px); + box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15); +} + +.card h2 { + color: #4a5568; + margin-bottom: 20px; + font-size: 1.5rem; + font-weight: 600; +} + +.form-group { + margin-bottom: 20px; +} + +.form-group label { + display: block; + margin-bottom: 8px; + font-weight: 500; + color: #2d3748; +} + +.form-group input { + width: 100%; + padding: 12px 16px; + border: 2px solid #e2e8f0; + border-radius: 8px; + font-size: 16px; + transition: border-color 0.2s ease, box-shadow 0.2s ease; +} + +.form-group input:focus { + outline: none; + border-color: #667eea; + box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); +} + +.btn { + padding: 12px 24px; + border: none; + border-radius: 8px; + font-size: 16px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease; + margin-right: 10px; + margin-bottom: 10px; +} + +.btn:disabled { + opacity: 0.6; + cursor: not-allowed; +} + +.btn-primary { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; +} + +.btn-primary:hover:not(:disabled) { + transform: translateY(-1px); + box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); +} + +.btn-secondary { + background: #718096; + color: white; +} + +.btn-secondary:hover:not(:disabled) { + background: #4a5568; + transform: translateY(-1px); +} + +.btn-danger { + background: #e53e3e; + color: white; +} + +.btn-danger:hover:not(:disabled) { + background: #c53030; + transform: translateY(-1px); +} + +.loading { + display: inline-block; + width: 20px; + height: 20px; + border: 3px solid #f3f3f3; + border-top: 3px solid #667eea; + border-radius: 50%; + animation: spin 1s linear infinite; + margin-right: 10px; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +/* Code Verification Styles */ +.form-actions { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-top: 20px; +} + +.form-actions .btn { + margin-right: 0; + margin-bottom: 0; + flex: 1; + min-width: 120px; +} + +#codeInstructions { + color: #4a5568; + margin-bottom: 20px; + padding: 12px; + background: #f7fafc; + border-left: 4px solid #667eea; + border-radius: 4px; + font-size: 14px; +} + +#verificationCode { + text-align: center; + letter-spacing: 2px; + font-size: 18px; + font-weight: 600; +} + +#verificationCode:focus { + border-color: #667eea; + box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); +} + +/* Animation for showing/hiding cards */ +.card { + transition: all 0.3s ease; +} + +.card[style*="display: none"] { + opacity: 0; + transform: translateY(-10px); +} + +@media (max-width: 768px) { + main { + grid-template-columns: 1fr; + gap: 20px; + } + + header h1 { + font-size: 2rem; + } + + .card { + padding: 20px; + } + + .auth-nav { + flex-direction: column; + align-items: center; + gap: 15px; + } + + .nav-btn { + width: 200px; + text-align: center; + } + + .form-actions { + flex-direction: column; + } + + .form-actions .btn { + flex: none; + width: 100%; + } +} + +/* Account Information Styles */ +.account-section { + margin: 20px 0; + padding: 15px; + background: rgba(255, 255, 255, 0.05); + border-radius: 8px; + border: 1px solid rgba(255, 255, 255, 0.1); +} + +.account-section h4 { + color: #667eea; + margin-bottom: 15px; + font-size: 1.2rem; + font-weight: 600; + border-bottom: 2px solid rgba(102, 126, 234, 0.3); + padding-bottom: 8px; +} + +.account-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 12px; +} + +.account-item { + display: flex; + flex-direction: column; + padding: 10px; + background: rgba(255, 255, 255, 0.03); + border-radius: 6px; + border: 1px solid rgba(255, 255, 255, 0.08); + transition: all 0.3s ease; +} + +.account-item:hover { + background: rgba(255, 255, 255, 0.08); + border-color: rgba(102, 126, 234, 0.3); +} + +.account-label { + font-weight: 600; + color: #8B9DC3; + font-size: 0.9rem; + margin-bottom: 4px; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.account-value { + color: #333; + font-size: 1rem; + word-break: break-word; + line-height: 1.4; +} + +.account-claims { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 10px; +} + +.account-claims .account-item { + min-height: auto; +} + +.account-raw-data { + margin-top: 10px; +} + +.account-raw-data summary { + cursor: pointer; + padding: 10px; + background: rgba(255, 255, 255, 0.05); + border-radius: 6px; + border: 1px solid rgba(255, 255, 255, 0.1); + font-weight: 600; + color: #667eea; + transition: all 0.3s ease; +} + +.account-raw-data summary:hover { + background: rgba(255, 255, 255, 0.1); + border-color: rgba(102, 126, 234, 0.3); +} + +.account-json { + background: #f8f9fa; + border: 1px solid #e9ecef; + border-radius: 6px; + padding: 15px; + margin-top: 10px; + font-family: 'Courier New', monospace; + font-size: 0.85rem; + overflow-x: auto; + color: #495057; + line-height: 1.5; + max-height: 400px; + overflow-y: auto; +} + +/* Enhanced account info responsiveness */ +@media (max-width: 768px) { + .account-grid { + grid-template-columns: 1fr; + } + + .account-claims { + grid-template-columns: 1fr; + } + + .account-section { + margin: 15px 0; + padding: 12px; + } + + .account-item { + padding: 8px; + } +} + +/* Success Card Styles */ +.success-icon { + font-size: 60px; + height: 80px; + width: 80px; + margin: 0 auto 20px; + background-color: #4CAF50; + color: white; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); +} + +@keyframes success-appear { + 0% { + opacity: 0; + transform: scale(0.8); + } + 50% { + transform: scale(1.05); + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +.user-welcome { + margin: 20px 0; + padding: 15px; + background-color: rgba(255, 255, 255, 0.7); + border-radius: 8px; + font-size: 18px; + font-weight: bold; + color: #333; + margin-bottom: 2rem; +} diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/proxyUtils.ts b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/proxyUtils.ts new file mode 100644 index 0000000000..d99fb85dd7 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/proxyUtils.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import { spawn, ChildProcess } from "child_process"; +import path from "path"; + +/** + * Starts a CORS proxy server for testing purposes + * + * @param {string} domain - The domain for the CORS proxy (e.g., "MSIDLABCIAM6") + * @param {string} tenantId - The tenant ID for the CORS proxy + * @param {number} port - The port to run the CORS proxy on + * @returns {Promise} A Promise that resolves with the proxy server process + */ +export function startCorsProxy( + domain: string = "MSIDLABCIAM6", + tenantId: string = "fe362aec-5d43-45d1-b730-9755e60dc3b9", + port: number = 30001 +): Promise { + return new Promise((resolve, reject) => { + try { + // Start the CORS proxy server + const corsProcess = spawn( + "node", + [ + path.join(__dirname, "../cors.js"), + "-d", + domain, + "-t", + tenantId, + "-p", + port.toString(), + ], + { + stdio: "inherit", + cwd: path.join(__dirname, ".."), + } + ); + + // Set up error handling + corsProcess.on('error', (err) => { + console.error('Failed to start CORS proxy:', err); + reject(err); + }); + + // Wait a bit to ensure the proxy is up before resolving the promise + setTimeout(() => { + console.log(`CORS proxy started on port ${port} for domain ${domain}`); + resolve(corsProcess); + }, 2000); + + } catch (error) { + console.error('Error starting CORS proxy:', error); + reject(error); + } + }); +} + +/** + * Stops the CORS proxy server + * + * @param {ChildProcess | null} corsProcess - The CORS proxy process to stop + */ +export function stopCorsProxy(corsProcess: ChildProcess | null): void { + if (corsProcess) { + try { + corsProcess.kill(); + console.log('CORS proxy stopped'); + } catch (error) { + console.error('Error stopping CORS proxy:', error); + } + } +} + + diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/resetpassword.spec.ts b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/resetpassword.spec.ts new file mode 100644 index 0000000000..0ec5a761a4 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/resetpassword.spec.ts @@ -0,0 +1,311 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import * as puppeteer from "puppeteer"; +import { + Screenshot, + createFolder, + getBrowser, + pcaInitializedPoller, + BrowserCacheUtils, + ONE_SECOND_IN_MS, + LabClient, + getHomeUrl, +} from "e2e-test-utils"; +import { ChildProcess } from "child_process"; +import path = require("path"); +import { startCorsProxy, stopCorsProxy } from "./proxyUtils"; + +import { + testConfig, + getTenantInfo, + getProxyPort, + getTestUsers, + getTestData, + nativeAuthConfig +} from "./testConfig"; + +// Use configuration instead of hardcoded values +const SCREENSHOT_BASE_FOLDER_NAME = path.join(__dirname, testConfig.screenshots.baseFolderName, "/resetpassword"); +const STANDARD_TIMEOUT = testConfig.timeouts.standard; +const AUTH_TIMEOUT = testConfig.timeouts.auth; +const TEST_TIMEOUT = testConfig.timeouts.test; +let sampleHomeUrl = ""; + +describe("Native Auth Sample - Reset Password Tests", () => { + let context: puppeteer.BrowserContext; + let page: puppeteer.Page; + let BrowserCache: BrowserCacheUtils; + let browser: puppeteer.Browser; + let resetPasswordEmailWithPwd: string = ""; + let resetPasswordEmailWithOtp: string = ""; + let corsProcess: ChildProcess; + + + beforeAll(async () => { + // Start the CORS proxy server using configuration values + const tenantInfo = getTenantInfo(); + corsProcess = await startCorsProxy( + tenantInfo.name, + tenantInfo.id, + getProxyPort() + ); + + if (testConfig.screenshots.enabled) { + createFolder(SCREENSHOT_BASE_FOLDER_NAME); + } + browser = await getBrowser(); + sampleHomeUrl = getHomeUrl(); + + const labClient = new LabClient(); + + // Use configuration for test user emails from JSON config + resetPasswordEmailWithPwd = nativeAuthConfig.signInEmailPasswordUsername; + resetPasswordEmailWithOtp = nativeAuthConfig.signInEmailCodeUsername; + }); + + afterAll(async () => { + await context?.close(); + await browser?.close(); + // Stop the CORS proxy server using the utility function + stopCorsProxy(corsProcess); + }); + + + beforeEach(async () => { + context = await browser.createBrowserContext(); + page = await context.newPage(); + + BrowserCache = new BrowserCacheUtils( + page, + "sessionStorage" // Based on Native Auth Sample configuration + ); // Navigate to the Native Auth Sample home page and wait for network idle to ensure full page load + }); + + afterEach(async () => { + // Clear storage after each test + await page.evaluate(() => { + Object.assign({}, window.sessionStorage.clear()); + }); + await page.evaluate(() => { + Object.assign({}, window.localStorage.clear()); + }); + await page.close(); + }); + + describe("Reset Password Flow", () => { + beforeEach(async () => { + await page.goto(sampleHomeUrl + `?usePwdConfig=true`); + + // Wait for the application to initialize + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + // Verify reset password button is visible on the navigation bar + const showResetPasswordButton = await page.$("#showResetPasswordBtn"); + expect(showResetPasswordButton).toBeTruthy(); + + // Click reset password button on the navigation bar + await page.click("#showResetPasswordBtn"); + + // Verify reset password card is visible + const resetPasswordCard = await page.$("#resetPasswordCard"); + expect(resetPasswordCard).toBeTruthy(); + + // Verify reset password form elements are present + const resetPasswordEmailInput = await page.$("#resetPasswordEmail"); + const resetPasswordButton = await page.$("#resetPasswordBtn"); + expect(resetPasswordEmailInput).toBeTruthy(); + expect(resetPasswordButton).toBeTruthy(); + + // Verify the form is visible + const isResetPasswordCardVisible = await page.evaluate(() => { + const card = document.getElementById("resetPasswordCard"); + return card && window.getComputedStyle(card).display !== "none"; + }); + expect(isResetPasswordCardVisible).toBe(true); + }); + + it("User reset password with incorrect otp", async () => { + const testName = "resetPasswordFormDisplay"; + let screenshot: Screenshot | undefined; + + if (testConfig.screenshots.enabled) { + screenshot = new Screenshot(`${SCREENSHOT_BASE_FOLDER_NAME}/${testName}`); + } + + // Enter username in the reset password form and click reset password button + await page.waitForSelector("#resetPasswordEmail", { visible: true }); + await page.type("#resetPasswordEmail", resetPasswordEmailWithPwd); + // Make sure reset password button is visible and clickable + await page.waitForSelector("#resetPasswordBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const resetPasswordButton = document.getElementById("resetPasswordBtn"); + if (resetPasswordButton) { + resetPasswordButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "resetPasswordButtonClicked"); + + // Wait for code input card to appear + await page.waitForSelector("#resetPasswordCodeCard", { visible: true, timeout: 45000 }); + await screenshot.takeScreenshot(page, "resetPasswordCodeCard"); + + // Enter code and submit - ensure code field is fully visible first + await page.waitForSelector("#resetPasswordCode", { visible: true }); + await page.type("#resetPasswordCode", "12345678"); // Enter incorrect code + await screenshot.takeScreenshot(page, "verificationCodeEntered"); + await page.click("#submitResetPasswordCodeBtn"); + await screenshot.takeScreenshot(page, "submitCodeButtonClicked"); + + // Wait for error message to appear + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain("Error: invalid_grant: AADSTS50181: Unable to validate the otp"); + }, AUTH_TIMEOUT); + + it("Email is not found in records", async () => { + const testName = "resetPasswordWithNonExistingUsername"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the reset password form and click reset password button + await page.waitForSelector("#resetPasswordEmail", { visible: true }); + await page.type("#resetPasswordEmail", "non-existemail@test.com"); + + // Make sure reset password button is visible and clickable + await page.waitForSelector("#resetPasswordBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const resetPasswordButton = document.getElementById("resetPasswordBtn"); + if (resetPasswordButton) { + resetPasswordButton.click(); + } else { + throw new Error("Reset Password button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "resetPasswordButtonClicked"); + + // Wait for error message to appear + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain(""); + }, AUTH_TIMEOUT); + + it("Email exists but not linked to any password (registered using otp flow)", async () => { + const testName = "resetPasswordWithOtpUsername"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the reset password form and click reset password button + await page.waitForSelector("#resetPasswordEmail", { visible: true }); + await page.type("#resetPasswordEmail", resetPasswordEmailWithOtp); + + // Make sure reset password button is visible and clickable + await page.waitForSelector("#resetPasswordBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const resetPasswordButton = document.getElementById("resetPasswordBtn"); + if (resetPasswordButton) { + resetPasswordButton.click(); + } else { + throw new Error("Reset Password button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "resetPasswordButtonClicked"); + + // Wait for error message to appear + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain(""); + }, AUTH_TIMEOUT); + }); + + describe("Reset Password Flow - Redirect", () => { + beforeEach(async () => { + // Use useRedirectConfig=true to ensure the app initializes with redirect-only challenge types + await page.goto(sampleHomeUrl + `?usePwdConfig=true&useRedirectConfig=true`); + + // Wait for the application to initialize with a longer timeout + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + + // Verify reset password button is visible on the navigation bar + const showResetPasswordButton = await page.$("#showResetPasswordBtn"); + expect(showResetPasswordButton).toBeTruthy(); + + // Click reset password button on the navigation bar + await page.click("#showResetPasswordBtn"); + + // Verify reset password card is visible + const resetPasswordCard = await page.$("#resetPasswordCard"); + expect(resetPasswordCard).toBeTruthy(); + + // Verify reset password form elements are present + const resetPasswordEmailInput = await page.$("#resetPasswordEmail"); + const resetPasswordButton = await page.$("#resetPasswordBtn"); + expect(resetPasswordEmailInput).toBeTruthy(); + expect(resetPasswordButton).toBeTruthy(); + + // Verify the form is visible + const isResetPasswordCardVisible = await page.evaluate(() => { + const card = document.getElementById("resetPasswordCard"); + return card && window.getComputedStyle(card).display !== "none"; + }); + expect(isResetPasswordCardVisible).toBe(true); + }); + + it("User email is registered with email OTP auth method, which is not supported by the developer (redirect flow)", async () => { + const testName = "emailResetPasswordRedirect"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the reset password form and click reset password button + await page.waitForSelector("#resetPasswordEmail", { visible: true }); + await page.type("#resetPasswordEmail", resetPasswordEmailWithOtp); + + // Make sure reset password button is visible and clickable + await page.waitForSelector("#resetPasswordBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const resetPasswordButton = document.getElementById("resetPasswordBtn"); + if (resetPasswordButton) { + resetPasswordButton.click(); + } else { + throw new Error("Reset Password button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "resetPasswordButtonClicked"); + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain("Password Reset Error: Error: invalid_request: AADSTS500222:"); + + }, AUTH_TIMEOUT); + }); +}); diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signin.spec.ts b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signin.spec.ts new file mode 100644 index 0000000000..de6d8ce9fe --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signin.spec.ts @@ -0,0 +1,777 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import * as puppeteer from "puppeteer"; +import { + Screenshot, + createFolder, + getBrowser, + pcaInitializedPoller, + BrowserCacheUtils, + ONE_SECOND_IN_MS, + LabClient, + getHomeUrl, +} from "e2e-test-utils"; +import { ChildProcess } from "child_process"; +import path = require("path"); +import { startCorsProxy, stopCorsProxy } from "./proxyUtils"; + +import { + testConfig, + getTenantInfo, + getProxyPort, + getTestUsers, + getTestData, + nativeAuthConfig +} from "./testConfig"; + +// Use configuration instead of hardcoded values +const SCREENSHOT_BASE_FOLDER_NAME = path.join(__dirname, testConfig.screenshots.baseFolderName, "/signin"); +const STANDARD_TIMEOUT = testConfig.timeouts.standard; +const AUTH_TIMEOUT = testConfig.timeouts.auth; +const TEST_TIMEOUT = testConfig.timeouts.test; +let sampleHomeUrl = ""; + +describe("Native Auth Sample - Sign In Tests", () => { + let context: puppeteer.BrowserContext; + let page: puppeteer.Page; + let BrowserCache: BrowserCacheUtils; + let browser: puppeteer.Browser; + let signInEmailUsername: string = ""; + let accountPwd: string = ""; + let signInEmailOtpUsername: string = ""; + let corsProcess: ChildProcess; + let invalidTestUsers: any; // Store test data for all tests + + beforeAll(async () => { + // Start the CORS proxy server using configuration values + const tenantInfo = getTenantInfo(); + corsProcess = await startCorsProxy( + tenantInfo.name, + tenantInfo.id, + getProxyPort() + ); + + if (testConfig.screenshots.enabled) { + createFolder(SCREENSHOT_BASE_FOLDER_NAME); + } + browser = await getBrowser(); + sampleHomeUrl = getHomeUrl(); + + const labClient = new LabClient(); + + // Use configuration for test user emails from JSON config + signInEmailUsername = nativeAuthConfig.signInEmailPasswordUsername; + const accountCredential = await labClient.getSecret(testConfig.testUsers.labSecretName); + accountPwd = accountCredential.value; + signInEmailOtpUsername = nativeAuthConfig.signInEmailCodeUsername; + + // Fetch test data once for all tests + invalidTestUsers = getTestData(); + }); + + afterAll(async () => { + await context?.close(); + await browser?.close(); + // Stop the CORS proxy server using the utility function + stopCorsProxy(corsProcess); + }); + + beforeEach(async () => { + context = await browser.createBrowserContext(); + page = await context.newPage(); + + BrowserCache = new BrowserCacheUtils( + page, + "sessionStorage" // Based on Native Auth Sample configuration + ); + }); + + afterEach(async () => { + // // Clear storage after each test + await page.evaluate(() => { + Object.assign({}, window.sessionStorage.clear()); + }); + await page.evaluate(() => { + Object.assign({}, window.localStorage.clear()); + }); + await page.close(); + }); + + describe("Sign In Flow - Email + Password", () => { + beforeEach(async () => { + await page.goto(sampleHomeUrl + `?usePwdConfig=true`); + + // Wait for the application to initialize + await pcaInitializedPoller(page, AUTH_TIMEOUT); + + // Verify that no user signed in initially + const authStatusBanner = await page.$eval( + "#authStatusBanner", + (el) => el.textContent + ); + expect(authStatusBanner).toContain("No user signed in"); + + // Verify sign-in button is visible on the navigation bar + const showSignInBtn = await page.$("#showSignInBtn"); + expect(showSignInBtn).toBeTruthy(); + + // Click sign-in button on the navigation bar + await page.click("#showSignInBtn"); + + // Verify sign-in card is visible + const signInCard = await page.$("#signInCard"); + expect(signInCard).toBeTruthy(); + + // Verify sign-in form elements are present + const usernameInput = await page.$("#username"); + const signInButton = await page.$("#signInBtn"); + expect(usernameInput).toBeTruthy(); + expect(signInButton).toBeTruthy(); + + // Verify the form is visible + const isSignInCardVisible = await page.evaluate(() => { + const card = document.getElementById("signInCard"); + return card && window.getComputedStyle(card).display !== "none"; + }); + expect(isSignInCardVisible).toBe(true); + }); + + it("User enters username and correct password", async () => { + const testName = "signInFormDisplay"; + let screenshot: Screenshot | undefined; + + if (testConfig.screenshots.enabled) { + screenshot = new Screenshot(`${SCREENSHOT_BASE_FOLDER_NAME}/${testName}`); + } + + // Enter username in the sign-in form and click sign-in button + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailUsername); + + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + if (screenshot) { + await screenshot.takeScreenshot(page, "signInButtonClicked"); + } + + // Wait for password input card to appear + await page.waitForSelector("#passwordInputCard"); + if (screenshot) { + await screenshot.takeScreenshot(page, "passwordInputDisplayed"); + } + + // Enter password and submit - ensure password field is fully visible first + await page.waitForSelector("#signInPassword", { + visible: true, + }); + await page.type("#signInPassword", accountPwd); + if (screenshot) { + await screenshot.takeScreenshot(page, "passwordInputEntered"); + } + + // Wait for the submit button to be visible and enabled + await page.waitForSelector("#submitPasswordBtn:enabled", { + visible: true, + timeout: 15000, + }); + // Use evaluate to ensure a clean click operation rather than direct page.click() + await page.evaluate(() => { + const submitButton = + document.getElementById("submitPasswordBtn"); + if (submitButton) { + submitButton.click(); + } else { + throw new Error("Submit button not found in the DOM"); + } + }); + if (screenshot) { + await screenshot.takeScreenshot(page, "passwordSubmitted"); + } + + // Wait for successful sign-in (check for both auth status banner and account info) + // Use a more reliable indicator with longer timeout since authentication can take time + await page.waitForFunction( + () => { + // Check auth status banner + const authStatusBanner = + document.getElementById("authStatusBanner"); + const isSignedIn = + authStatusBanner && + authStatusBanner.textContent?.includes("Signed in"); + return isSignedIn; + }, + { timeout: 30000 } // Increase timeout for more reliability + ); + const tokenStore = await BrowserCache.getTokens(); + expect(tokenStore.idTokens).toHaveLength(1); + expect(tokenStore.accessTokens).toHaveLength(1); + expect(tokenStore.refreshTokens).toHaveLength(1); + expect(await BrowserCache.getAccountFromCache()).toBeDefined(); + expect( + await BrowserCache.accessTokenForScopesExists( + tokenStore.accessTokens, + ["openid", "profile", "user.read"] + ) + ).toBeTruthy(); + if (screenshot) { + await screenshot.takeScreenshot(page, "signInSuccessful"); + } + }, AUTH_TIMEOUT); + + it( + "User enters username and incorrect password", + async () => { + const testName = "incorrectPasswordSignIn"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the sign-in form and click sign-in button + await page.type("#username", signInEmailUsername); + await page.click("#signInBtn"); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for password input card to appear + await page.waitForSelector("#passwordInputCard"); + await screenshot.takeScreenshot(page, "passwordInputDisplayed"); + + // Enter incorrect password and submit + await page.waitForSelector("#signInPassword", { + visible: true, + }); + await page.type("#signInPassword", invalidTestUsers.incorrectPassword); + await screenshot.takeScreenshot( + page, + "incorrectPasswordEntered" + ); + + // Wait for the submit button to be visible and enabled + await page.waitForSelector("#submitPasswordBtn:enabled", { + visible: true, + timeout: 15000, + }); + await page.click("#submitPasswordBtn"); + await screenshot.takeScreenshot( + page, + "incorrectPasswordSubmitted" + ); + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { + visible: true, + timeout: 15000, + }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval( + "#errorMessage", + (el) => el.textContent + ); + expect(errorMessage).toContain("Sign-in Error:"); + + // Verify that the user is still not signed in + const authStatusBanner = await page.$eval( + "#authStatusBanner", + (el) => el.textContent + ); + expect(authStatusBanner).toContain("No user signed in"); + + // Verify we're still on the password input form + const passwordInputCard = await page.$("#passwordInputCard"); + expect(passwordInputCard).toBeTruthy(); + + const isVisible = await page.evaluate(() => { + const card = document.getElementById("passwordInputCard"); + return ( + card && window.getComputedStyle(card).display !== "none" + ); + }); + expect(isVisible).toBe(true); + + // Try dismissing the error banner + await page.click("#dismissErrorBtn"); + + // Verify error banner is hidden + const errorBannerVisible = await page.evaluate(() => { + const banner = document.getElementById("errorBanner"); + return banner + ? window.getComputedStyle(banner).display !== "none" + : false; + }); + expect(errorBannerVisible).toBe(false); + }, + AUTH_TIMEOUT + ); + + it( + "User signs in with account A when account A has already signed in", + async () => { + const testName = "signInFormErrorWithSameAccount"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the sign-in form and click sign-in button + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailUsername); + + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for password input card to appear + await page.waitForSelector("#passwordInputCard"); + await screenshot.takeScreenshot(page, "passwordInputDisplayed"); + + // Enter password and submit - ensure password field is fully visible first + await page.waitForSelector("#signInPassword", { + visible: true, + }); + await page.type("#signInPassword", accountPwd); + await screenshot.takeScreenshot(page, "passwordInputEntered"); + + // Wait for the submit button to be visible and enabled + await page.waitForSelector("#submitPasswordBtn:enabled", { + visible: true, + timeout: 15000, + }); + // Use evaluate to ensure a clean click operation rather than direct page.click() + await page.evaluate(() => { + const submitButton = + document.getElementById("submitPasswordBtn"); + if (submitButton) { + submitButton.click(); + } else { + throw new Error("Submit button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "passwordSubmitted"); + + // Wait for successful sign-in (check for both auth status banner and account info) + // Use a more reliable indicator with longer timeout since authentication can take time + await page.waitForFunction( + () => { + // Check auth status banner + const authStatusBanner = + document.getElementById("authStatusBanner"); + const isSignedIn = + authStatusBanner && + authStatusBanner.textContent?.includes("Signed in"); + return isSignedIn; + }, + { timeout: 30000 } // Increase timeout for more reliability + ); + const tokenStore = await BrowserCache.getTokens(); + expect(tokenStore.idTokens).toHaveLength(1); + expect(tokenStore.accessTokens).toHaveLength(1); + expect(tokenStore.refreshTokens).toHaveLength(1); + expect(await BrowserCache.getAccountFromCache()).toBeDefined(); + expect( + await BrowserCache.accessTokenForScopesExists( + tokenStore.accessTokens, + ["openid", "profile", "user.read"] + ) + ).toBeTruthy(); + + // Now sign in with same account + // Click sign-in button again + await page.click("#showSignInBtn"); + // Verify sign-in card is visible + const signInCard = await page.$("#signInCard"); + expect(signInCard).toBeTruthy(); + // Enter account B username in the sign-in form + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailUsername); // Using account B email + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { + visible: true, + timeout: 15000, + }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval( + "#errorMessage", + (el) => el.textContent + ); + expect(errorMessage).toContain( + "Error: user_already_signed_in:" + ); + }, + AUTH_TIMEOUT + ); + + it( + "User signs in with account B when account A has already signed in", + async () => { + const testName = "signInFormErrorWithDifferentAccount"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the sign-in form and click sign-in button + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailUsername); + + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for password input card to appear + await page.waitForSelector("#passwordInputCard"); + await screenshot.takeScreenshot(page, "passwordInputDisplayed"); + + // Enter password and submit - ensure password field is fully visible first + await page.waitForSelector("#signInPassword", { + visible: true, + }); + await page.type("#signInPassword", accountPwd); + await screenshot.takeScreenshot(page, "passwordInputEntered"); + + // Wait for the submit button to be visible and enabled + await page.waitForSelector("#submitPasswordBtn:enabled", { + visible: true, + timeout: 15000, + }); + // Use evaluate to ensure a clean click operation rather than direct page.click() + await page.evaluate(() => { + const submitButton = + document.getElementById("submitPasswordBtn"); + if (submitButton) { + submitButton.click(); + } else { + throw new Error("Submit button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "passwordSubmitted"); + + // Wait for successful sign-in (check for both auth status banner and account info) + // Use a more reliable indicator with longer timeout since authentication can take time + await page.waitForFunction( + () => { + // Check auth status banner + const authStatusBanner = + document.getElementById("authStatusBanner"); + const isSignedIn = + authStatusBanner && + authStatusBanner.textContent?.includes("Signed in"); + return isSignedIn; + }, + { timeout: 30000 } // Increase timeout for more reliability + ); + const tokenStore = await BrowserCache.getTokens(); + expect(tokenStore.idTokens).toHaveLength(1); + expect(tokenStore.accessTokens).toHaveLength(1); + expect(tokenStore.refreshTokens).toHaveLength(1); + expect(await BrowserCache.getAccountFromCache()).toBeDefined(); + expect( + await BrowserCache.accessTokenForScopesExists( + tokenStore.accessTokens, + ["openid", "profile", "user.read"] + ) + ).toBeTruthy(); + + // Now sign in with a different account + const accountBEmail = invalidTestUsers.invalidUserEmail; + // Click sign-in button again + await page.click("#showSignInBtn"); + // Verify sign-in card is visible + const signInCard = await page.$("#signInCard"); + expect(signInCard).toBeTruthy(); + // Enter account B username in the sign-in form + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", accountBEmail); // Using account B email + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { + visible: true, + timeout: 15000, + }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval( + "#errorMessage", + (el) => el.textContent + ); + expect(errorMessage).toContain( + "Error: user_already_signed_in:" + ); + }, + AUTH_TIMEOUT + ); + + it( + "User enters non registered username", + async () => { + const testName = "nonRegisteredUsernameSignIn"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the sign-in form and click sign-in button + const nonRegisteredEmail = invalidTestUsers.nonRegisteredEmail; + await page.type("#username", nonRegisteredEmail); + await page.click("#signInBtn"); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { + visible: true, + timeout: 15000, + }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval( + "#errorMessage", + (el) => el.textContent + ); + expect(errorMessage).toContain("Error: user_not_found"); + + // Verify that the user is still not signed in + const authStatusBanner = await page.$eval( + "#authStatusBanner", + (el) => el.textContent + ); + expect(authStatusBanner).toContain("No user signed in"); + }, + AUTH_TIMEOUT + ); + }); + + describe("Sign In Flow - Email + OTP", () => { + beforeEach(async () => { + await page.goto(sampleHomeUrl + `?useOtpConfig=true`); + + // Wait for the application to initialize + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + + // Verify that no user signed in initially + const authStatusBanner = await page.$eval( + "#authStatusBanner", + (el) => el.textContent + ); + expect(authStatusBanner).toContain("No user signed in"); + + // Verify sign-in button is visible on the navigation bar + const showSignInBtn = await page.$("#showSignInBtn"); + expect(showSignInBtn).toBeTruthy(); + + // Click sign-in button on the navigation bar + await page.click("#showSignInBtn"); + + // Verify sign-in card is visible + const signInCard = await page.$("#signInCard"); + expect(signInCard).toBeTruthy(); + + // Verify sign-in form elements are present + const usernameInput = await page.$("#username"); + const signInButton = await page.$("#signInBtn"); + expect(usernameInput).toBeTruthy(); + expect(signInButton).toBeTruthy(); + + // Verify the form is visible + const isSignInCardVisible = await page.evaluate(() => { + const card = document.getElementById("signInCard"); + return card && window.getComputedStyle(card).display !== "none"; + }); + expect(isSignInCardVisible).toBe(true); + }); + + it( + "User email is registered with email OTP auth method, which is supported by the developer (unfinished)", + async () => { + const testName = "emailOtpSignIn"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter email in the sign-in form and click sign-in button + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailOtpUsername); // Using signInEmailOtpUsername instead of username + + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for OTP input card to appear + await page.waitForSelector("#codeVerificationCard", { + visible: true, + }); + await screenshot.takeScreenshot(page, "otpInputDisplayed"); + + // Enter OTP and submit - ensure OTP field is fully visible first + await page.waitForSelector("#verificationCode", { + visible: true, + }); + // Wait for the submit button to be visible and enabled + await page.waitForSelector("#submitCodeBtn:enabled", { + visible: true, + timeout: 15000, + }); + // cannot obtain otp code from email, so just verify the submit button is enabled + await screenshot.takeScreenshot( + page, + "otpInputReadyForSubmission" + ); + }, + AUTH_TIMEOUT + ); + }); + + describe("Sign In Flow - Email + OTP Redirect", () => { + beforeEach(async () => { + // Use useRedirectConfig=true to ensure the app initializes with redirect-only challenge types + await page.goto( + sampleHomeUrl + `?useOtpConfig=true&useRedirectConfig=true` + ); + // Wait for the application to initialize with a longer timeout + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + + // Verify that no user signed in initially + const authStatusBanner = await page.$eval( + "#authStatusBanner", + (el) => el.textContent + ); + expect(authStatusBanner).toContain("No user signed in"); + + // Take a screenshot of the initialized state + const setupScreenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/setup` + ); + await setupScreenshot.takeScreenshot(page, "appInitialized"); + + // Verify sign-in button is visible on the navigation bar + const showSignInBtn = await page.$("#showSignInBtn"); + expect(showSignInBtn).toBeTruthy(); + + // Click sign-in button on the navigation bar + await page.click("#showSignInBtn"); + + // Verify sign-in card is visible + const signInCard = await page.$("#signInCard"); + expect(signInCard).toBeTruthy(); + + // Verify sign-in form elements are present + const usernameInput = await page.$("#username"); + const signInButton = await page.$("#signInBtn"); + expect(usernameInput).toBeTruthy(); + expect(signInButton).toBeTruthy(); + }); + + it( + "User email is registered with email OTP auth method, which is not supported by the developer (redirect flow)", + async () => { + const testName = "emailOtpSignInRedirect"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter email in the sign-in form and click sign-in button + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailOtpUsername); // Using signInEmailOtpUsername instead of username + + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { + visible: true, + timeout: 15000, + }); + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + + // Verify error banner content + const errorMessage = await page.$eval( + "#errorMessage", + (el) => el.textContent + ); + expect(errorMessage).toContain( + "redirect" + ); + }, + AUTH_TIMEOUT + ); + }); +}); diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signout.spec.ts b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signout.spec.ts new file mode 100644 index 0000000000..7b8c01d77a --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signout.spec.ts @@ -0,0 +1,214 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import * as puppeteer from "puppeteer"; +import { + Screenshot, + createFolder, + getBrowser, + pcaInitializedPoller, + BrowserCacheUtils, + ONE_SECOND_IN_MS, + LabClient, + getHomeUrl, +} from "e2e-test-utils"; +import { ChildProcess } from "child_process"; +import path = require("path"); +import { startCorsProxy, stopCorsProxy } from "./proxyUtils"; + +import { + testConfig, + getTenantInfo, + getProxyPort, + getTestUsers, + getTestData, + nativeAuthConfig +} from "./testConfig"; + +// Use configuration instead of hardcoded values +const SCREENSHOT_BASE_FOLDER_NAME = path.join(__dirname, testConfig.screenshots.baseFolderName, "/signout"); +const STANDARD_TIMEOUT = testConfig.timeouts.standard; +const AUTH_TIMEOUT = testConfig.timeouts.auth; +const TEST_TIMEOUT = testConfig.timeouts.test; +let sampleHomeUrl = ""; + +describe("Native Auth Sample - Sign Out Tests", () => { + let context: puppeteer.BrowserContext; + let page: puppeteer.Page; + let BrowserCache: BrowserCacheUtils; + let browser: puppeteer.Browser; + let signInEmailUsername: string = ""; + let accountPwd: string = ""; + let corsProcess: ChildProcess; + + beforeAll(async () => { + // Start the CORS proxy server using configuration values + const tenantInfo = getTenantInfo(); + corsProcess = await startCorsProxy( + tenantInfo.name, + tenantInfo.id, + getProxyPort() + ); + + if (testConfig.screenshots.enabled) { + createFolder(SCREENSHOT_BASE_FOLDER_NAME); + } + browser = await getBrowser(); + sampleHomeUrl = getHomeUrl(); + + const labClient = new LabClient(); + + // Use configuration for test user emails from JSON config + signInEmailUsername = nativeAuthConfig.signInEmailPasswordUsername; + const accountCredential = await labClient.getSecret(testConfig.testUsers.labSecretName); + accountPwd = accountCredential.value; + }); + + afterAll(async () => { + await context?.close(); + await browser?.close(); + stopCorsProxy(corsProcess); + }); + + + beforeEach(async () => { + context = await browser.createBrowserContext(); + page = await context.newPage(); + + BrowserCache = new BrowserCacheUtils( + page, + "sessionStorage" // Based on Native Auth Sample configuration + ); // Navigate to the Native Auth Sample home page and wait for network idle to ensure full page load + }); + + afterEach(async () => { + // Clear storage after each test + await page.evaluate(() => { + Object.assign({}, window.sessionStorage.clear()); + }); + await page.evaluate(() => { + Object.assign({}, window.localStorage.clear()); + }); + await page.close(); + }); + + describe("Sign Out Flow - Email + Password", () => { + beforeEach(async () => { + await page.goto(sampleHomeUrl + `?usePwdConfig=true`); + + // Wait for the application to initialize + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + + // Verify that no user signed in initially + const authStatusBanner = await page.$eval("#authStatusBanner", (el) => el.textContent); + expect(authStatusBanner).toContain("No user signed in"); + + // Verify sign-in button is visible on the navigation bar + const showSignInBtn = await page.$("#showSignInBtn"); + expect(showSignInBtn).toBeTruthy(); + + // Click sign-in button on the navigation bar + await page.click("#showSignInBtn"); + + // Verify sign-in card is visible + const signInCard = await page.$("#signInCard"); + expect(signInCard).toBeTruthy(); + + // Verify sign-in form elements are present + const usernameInput = await page.$("#username"); + const signInButton = await page.$("#signInBtn"); + expect(usernameInput).toBeTruthy(); + expect(signInButton).toBeTruthy(); + + // Verify the form is visible + const isSignInCardVisible = await page.evaluate(() => { + const card = document.getElementById("signInCard"); + return card && window.getComputedStyle(card).display !== "none"; + }); + expect(isSignInCardVisible).toBe(true); + }); + + it("User sign-in with username and correct password, then sign out", async () => { + const testName = "signInFormDisplay"; + const screenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/${testName}` + ); + + // Enter username in the sign-in form and click sign-in button + await page.waitForSelector("#username", { visible: true }); + await page.type("#username", signInEmailUsername); + + // Make sure sign-in button is visible and clickable + await page.waitForSelector("#signInBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signInButton = document.getElementById("signInBtn"); + if (signInButton) { + signInButton.click(); + } else { + throw new Error("Sign in button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "signInButtonClicked"); + + // Wait for password input card to appear + await page.waitForSelector("#passwordInputCard"); + await screenshot.takeScreenshot(page, "passwordInputDisplayed"); + + // Enter password and submit - ensure password field is fully visible first + await page.waitForSelector("#signInPassword", { visible: true }); + await page.type("#signInPassword", accountPwd); + await screenshot.takeScreenshot(page, "passwordInputEntered"); + + // Wait for the submit button to be visible and enabled + await page.waitForSelector("#submitPasswordBtn:enabled", { visible: true, timeout: 15000 }); + // Use evaluate to ensure a clean click operation rather than direct page.click() + await page.evaluate(() => { + const submitButton = document.getElementById("submitPasswordBtn"); + if (submitButton) { + submitButton.click(); + } else { + throw new Error("Submit button not found in the DOM"); + } + }); + await screenshot.takeScreenshot(page, "passwordSubmitted"); + + // Wait for successful sign-in (check for both auth status banner and account info) + // Use a more reliable indicator with longer timeout since authentication can take time + await page.waitForFunction( + () => { + // Check auth status banner + const authStatusBanner = document.getElementById("authStatusBanner"); + const isSignedIn = authStatusBanner && authStatusBanner.textContent?.includes("Signed in"); + return isSignedIn; + }, + { timeout: 30000 } // Increase timeout for more reliability + ); + const tokenStore = await BrowserCache.getTokens(); + expect(tokenStore.idTokens).toHaveLength(1); + expect(tokenStore.accessTokens).toHaveLength(1); + expect(tokenStore.refreshTokens).toHaveLength(1); + expect( + await BrowserCache.getAccountFromCache() + ).toBeDefined(); + expect( + await BrowserCache.accessTokenForScopesExists( + tokenStore.accessTokens, + ["openid", "profile", "user.read"] + ) + ).toBeTruthy(); + await screenshot.takeScreenshot(page, "signInSuccessful"); + + // click sign-out button to end the session + await page.click("#navSignOutBtn"); + await screenshot.takeScreenshot(page, "signOutButtonClicked"); + // Wait for the sign-out confirmation + const authStatusBanner = await page.$eval("#authStatusBanner", (el) => el.textContent); + expect(authStatusBanner).toContain("No user signed in"); + }, AUTH_TIMEOUT); + }); + +}); diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signup.spec.ts b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signup.spec.ts new file mode 100644 index 0000000000..b220cf7b50 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/signup.spec.ts @@ -0,0 +1,329 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import * as puppeteer from "puppeteer"; +import { + Screenshot, + createFolder, + getBrowser, + pcaInitializedPoller, + BrowserCacheUtils, + ONE_SECOND_IN_MS, + LabClient, + getHomeUrl, +} from "e2e-test-utils"; +import { ChildProcess } from "child_process"; +import path = require("path"); +import { startCorsProxy, stopCorsProxy } from "./proxyUtils"; + +import { + testConfig, + getTenantInfo, + getProxyPort, + getTestUsers, + getTestData, + nativeAuthConfig +} from "./testConfig"; + +// Use configuration instead of hardcoded values +const SCREENSHOT_BASE_FOLDER_NAME = path.join(__dirname, testConfig.screenshots.baseFolderName, "/signup"); +const STANDARD_TIMEOUT = testConfig.timeouts.standard; +const AUTH_TIMEOUT = testConfig.timeouts.auth; +const TEST_TIMEOUT = testConfig.timeouts.test; +let sampleHomeUrl = ""; + +describe("Native Auth Sample - Sign Up Tests", () => { + let context: puppeteer.BrowserContext; + let page: puppeteer.Page; + let BrowserCache: BrowserCacheUtils; + let browser: puppeteer.Browser; + let signUpEmailWithPwd: string = ""; + let accountPwd: string = ""; + let signUpEmailWithOtp: string = ""; + let testFirstName: string = ""; + let testLastName: string = ""; + let existingPwdEmail: string = ""; + let corsProcess: ChildProcess; + + beforeAll(async () => { + // Start the CORS proxy server using configuration values + const tenantInfo = getTenantInfo(); + corsProcess = await startCorsProxy( + tenantInfo.name, + tenantInfo.id, + getProxyPort() + ); + + if (testConfig.screenshots.enabled) { + createFolder(SCREENSHOT_BASE_FOLDER_NAME); + } + browser = await getBrowser(); + sampleHomeUrl = getHomeUrl(); + + const labClient = new LabClient(); + + // Use configuration for test user emails from JSON config + signUpEmailWithPwd = "test-pwd@test.com" + signUpEmailWithOtp = "test-otp@test.com" + existingPwdEmail = nativeAuthConfig.signInEmailPasswordUsername; + + testFirstName = "TestFirstName"; + testLastName = "TestLastName"; + const accountCredential = await labClient.getSecret(testConfig.testUsers.labSecretName); + accountPwd = accountCredential.value; + }); + + afterAll(async () => { + await context?.close(); + await browser?.close(); + // Stop the CORS proxy server using the utility function + stopCorsProxy(corsProcess); + }); + + + beforeEach(async () => { + context = await browser.createBrowserContext(); + page = await context.newPage(); + + BrowserCache = new BrowserCacheUtils( + page, + "sessionStorage" // Based on Native Auth Sample configuration + ); // Navigate to the Native Auth Sample home page and wait for network idle to ensure full page load + }); + + afterEach(async () => { + // Clear storage after each test + await page.evaluate(() => { + Object.assign({}, window.sessionStorage.clear()); + }); + await page.evaluate(() => { + Object.assign({}, window.localStorage.clear()); + }); + await page.close(); + }); + + describe("Sign Up Flow - Email + Password", () => { + beforeEach(async () => { + await page.goto(sampleHomeUrl + `?usePwdConfig=true`); + + // Wait for the application to initialize + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + // Verify sign-up button is visible on the navigation bar + const showSignUpBtn = await page.$("#showSignUpBtn"); + expect(showSignUpBtn).toBeTruthy(); + + // Click sign-up button on the navigation bar + await page.click("#showSignUpBtn"); + + // Verify sign-up card is visible + const signUpCard = await page.$("#signUpCard"); + expect(signUpCard).toBeTruthy(); + + // Verify sign-up form elements are present + const usernameInput = await page.$("#signUpUsername"); + const signUpButton = await page.$("#signUpBtn"); + expect(usernameInput).toBeTruthy(); + expect(signUpButton).toBeTruthy(); + + // Verify the form is visible + const isSignUpCardVisible = await page.evaluate(() => { + const card = document.getElementById("signUpCard"); + return card && window.getComputedStyle(card).display !== "none"; + }); + expect(isSignUpCardVisible).toBe(true); + }); + + it("User enters username, attributes to start sign-up flow, and enter the incorrect otp", async () => { + const testName = "signUpFormDisplay"; + let screenshot: Screenshot | undefined; + + if (testConfig.screenshots.enabled) { + screenshot = new Screenshot(`${SCREENSHOT_BASE_FOLDER_NAME}/${testName}`); + } + + // Enter username in the sign-up form and click sign-up button + await page.waitForSelector("#signUpFirstName", { visible: true }); + await page.waitForSelector("#signUpLastName", { visible: true }); + await page.waitForSelector("#signUpUsername", { visible: true }); + + await page.type("#signUpFirstName", testFirstName); + await page.type("#signUpLastName", testLastName); + await page.type("#signUpUsername", signUpEmailWithPwd); + + // Make sure sign-up button is visible and clickable + await page.waitForSelector("#signUpBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signUpButton = document.getElementById("signUpBtn"); + if (signUpButton) { + signUpButton.click(); + } else { + throw new Error("Sign up button not found in the DOM"); + } + }); + if (screenshot) { + await screenshot.takeScreenshot(page, "signUpButtonClicked"); + } + + // Wait for code input card to appear + await page.waitForSelector("#codeVerificationCard"); + if (screenshot) { + await screenshot.takeScreenshot(page, "codeVerificationCardDisplayed"); + } + + // Enter code and submit - ensure code field is fully visible first + await page.waitForSelector("#verificationCode", { visible: true }); + await page.type("#verificationCode", "12345678"); // Enter incorrect code + if (screenshot) { + await screenshot.takeScreenshot(page, "verificationCodeEntered"); + } + await page.click("#submitCodeBtn"); + if (screenshot) { + await screenshot.takeScreenshot(page, "submitCodeButtonClicked"); + } + // Wait for error message to appear + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + if (screenshot) { + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + } + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain("Sign-up Error: Error: invalid_grant: AADSTS50181: Unable to validate the otp"); + }, AUTH_TIMEOUT); + + it("User sign up with existing username", async () => { + const testName = "signUpWithExistingUsername"; + let screenshot: Screenshot | undefined; + + if (testConfig.screenshots.enabled) { + screenshot = new Screenshot(`${SCREENSHOT_BASE_FOLDER_NAME}/${testName}`); + } + + // Enter username in the sign-up form and click sign-up button + await page.waitForSelector("#signUpFirstName", { visible: true }); + await page.waitForSelector("#signUpLastName", { visible: true }); + await page.waitForSelector("#signUpUsername", { visible: true }); + + await page.type("#signUpFirstName", testFirstName); + await page.type("#signUpLastName", testLastName); + await page.type("#signUpUsername", existingPwdEmail); + + // Make sure sign-up button is visible and clickable + await page.waitForSelector("#signUpBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signUpButton = document.getElementById("signUpBtn"); + if (signUpButton) { + signUpButton.click(); + } else { + throw new Error("Sign up button not found in the DOM"); + } + }); + if (screenshot) { + await screenshot.takeScreenshot(page, "signUpButtonClicked"); + } + + // Wait for code input card to appear + await page.waitForSelector("#codeVerificationCard"); + if (screenshot) { + await screenshot.takeScreenshot(page, "codeVerificationCardDisplayed"); + } + + // Wait for error message to appear + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + if (screenshot) { + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + } + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain(" Error: user_already_exists: AADSTS1003037"); + }, AUTH_TIMEOUT); + }); + + describe("Sign Up Flow - Redirect", () => { + beforeEach(async () => { + // Use useRedirectConfig=true to ensure the app initializes with redirect-only challenge types + await page.goto(sampleHomeUrl + `?useOtpConfig=true&useRedirectConfig=true`); + + // Wait for the application to initialize with a longer timeout + await pcaInitializedPoller(page, AUTH_TIMEOUT); // Increase timeout for more stability + + // Verify that no user signed in initially + const authStatusBanner = await page.$eval("#authStatusBanner", (el) => el.textContent); + expect(authStatusBanner).toContain("No user signed in"); + + // Take a screenshot of the initialized state + if (testConfig.screenshots.enabled) { + const setupScreenshot = new Screenshot( + `${SCREENSHOT_BASE_FOLDER_NAME}/setup` + ); + await setupScreenshot.takeScreenshot(page, "appInitialized"); + } + + // Verify sign-up button is visible on the navigation bar + const showSignUpBtn = await page.$("#showSignUpBtn"); + expect(showSignUpBtn).toBeTruthy(); + + // Click sign-up button on the navigation bar + await page.click("#showSignUpBtn"); + + // Verify sign-up card is visible + const signUpCard = await page.$("#signUpCard"); + expect(signUpCard).toBeTruthy(); + + // Verify sign-up form elements are present + const usernameInput = await page.$("#signUpUsername"); + const signUpButton = await page.$("#signUpBtn"); + expect(usernameInput).toBeTruthy(); + expect(signUpButton).toBeTruthy(); + }); + + it("User email is registered with email OTP auth method, which is not supported by the developer (redirect flow)", async () => { + const testName = "emailOtpSignUpRedirect"; + let screenshot: Screenshot | undefined; + + if (testConfig.screenshots.enabled) { + screenshot = new Screenshot(`${SCREENSHOT_BASE_FOLDER_NAME}/${testName}`); + } + + // Enter email in the sign-up form and click sign-up button + await page.waitForSelector("#signUpUsername", { visible: true }); + await page.type("#signUpUsername", signUpEmailWithOtp); + + // Make sure sign-up button is visible and clickable + await page.waitForSelector("#signUpBtn", { visible: true }); + + // Use evaluate to click to avoid potential click issues + await page.evaluate(() => { + const signUpButton = document.getElementById("signUpBtn"); + if (signUpButton) { + signUpButton.click(); + } else { + throw new Error("Sign up button not found in the DOM"); + } + }); + if (screenshot) { + await screenshot.takeScreenshot(page, "signUpButtonClicked"); + } + + // Wait for the error banner to appear with increased timeout + await page.waitForSelector("#errorBanner", { visible: true, timeout: 15000 }); + if (screenshot) { + await screenshot.takeScreenshot(page, "errorBannerDisplayed"); + } + + // Verify error banner content + const errorMessage = await page.$eval("#errorMessage", (el) => el.textContent); + expect(errorMessage).toContain("redirect"); + + }, AUTH_TIMEOUT); + }); +}); diff --git a/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/testConfig.ts b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/testConfig.ts new file mode 100644 index 0000000000..b70e323f50 --- /dev/null +++ b/samples/msal-browser-samples/VanillaJSTestApp2.0/app/nativeAuthSample/test/testConfig.ts @@ -0,0 +1,183 @@ +/** + * Test configuration for Native Auth Sample E2E tests + * Contains tenant information, proxy settings, timeouts, and test user data + */ + +import * as fs from 'fs'; +import * as path from 'path'; + +/** + * Default test configuration + * Update these values based on your test environment + */ +export const testConfig = { + tenant: { + name: "MSIDLABCIAM6", + id: "fe362aec-5d43-45d1-b730-9755e60dc3b9", + labKeyVaultName: "MSIDLABCIAM6" + }, + + proxy: { + port: 30001, + enabled: true + }, + + timeouts: { + standard: 45000, // 45 seconds + auth: 60000, // 60 seconds + test: 120000 // 120 seconds + }, + + testUsers: { + signInEmailUsername: "nativeauthuser1@1secmail.org", + signInEmailOtpUsername: "nativeauthuser5@chefalicious.com", + labSecretName: "MSIDLABCIAM6" + }, + + screenshots: { + enabled: true, + baseFolderName: "./screenshots" + } +}; + + +/** + * Utility functions + */ +export const getTenantInfo = () => ({ + name: testConfig.tenant.name, + id: testConfig.tenant.id +}); + +export const getProxyPort = () => testConfig.proxy.port; + +export const getLabKeyVaultName = () => testConfig.tenant.labKeyVaultName; + +/** + * Constants for nativeAuthConfig.json keys + * These represent the existing keys in the configuration file + */ +export const NATIVE_AUTH_CONFIG_KEYS = { + // Root level + NATIVE_AUTH: 'native_auth', + + // Native auth configuration keys + EMAIL_PASSWORD_CLIENT_ID: 'native_auth.email_password_client_id', + EMAIL_CODE_CLIENT_ID: 'native_auth.email_code_client_id', + EMAIL_PASSWORD_ATTRIBUTES_CLIENT_ID: 'native_auth.email_password_attributes_client_id', + EMAIL_CODE_ATTRIBUTES_CLIENT_ID: 'native_auth.email_code_attributes_client_id', + TENANT_SUBDOMAIN: 'native_auth.tenant_subdomain', + TENANT_ID: 'native_auth.tenant_id', + SIGN_IN_EMAIL_PASSWORD_USERNAME: 'native_auth.sign_in_email_password_username', + SIGN_IN_EMAIL_CODE_USERNAME: 'native_auth.sign_in_email_code_username', + RESET_PASSWORD_USERNAME: 'native_auth.reset_password_username', + RESET_PASSWORD_USERNAME_MACOS: 'native_auth.reset_password_username_macos', + PASSWORD_SIGN_IN_EMAIL_CODE: 'native_auth.password_sign_in_email_code', + KEYVAULT_URL: 'native_auth.keyvault_url' +} as const; + +/** + * Utility function to parse nativeAuthConfig.json and read values based on keys + */ +export class NativeAuthConfigParser { + private static configCache: any = null; + private static readonly CONFIG_PATH = path.join(__dirname, '..', 'nativeAuthConfig.json'); + + /** + * Load and parse the nativeAuthConfig.json file + * @returns Parsed configuration object + */ + private static loadConfig(): any { + if (!this.configCache) { + try { + const configData = fs.readFileSync(this.CONFIG_PATH, 'utf8'); + this.configCache = JSON.parse(configData); + } catch (error) { + throw new Error(`Failed to load native auth config from ${this.CONFIG_PATH}: ${error}`); + } + } + return this.configCache; + } + + /** + * Get a value from the native auth configuration using dot notation + * @param key - The key to retrieve (supports dot notation like 'native_auth.email_password_client_id') + * @returns The value associated with the key + */ + static getValue(key: string): any { + const config = this.loadConfig(); + const keys = key.split('.'); + let value: any = config; + + for (const k of keys) { + if (value && typeof value === 'object' && k in value) { + value = value[k]; + } else { + throw new Error(`Key '${key}' not found in native auth configuration`); + } + } + + return value; + } + +} + +/** + * Convenience function to get a value from native auth config + * @param key - The key to retrieve (supports dot notation) + * @returns The value associated with the key + */ +export const getNativeAuthConfigValue = (key: string): any => { + return NativeAuthConfigParser.getValue(key); +}; + +/** + * Parsed native auth configuration values + * These are the actual values from nativeAuthConfig.json + */ +export const nativeAuthConfig = { + emailPasswordClientId: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.EMAIL_PASSWORD_CLIENT_ID), + emailCodeClientId: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.EMAIL_CODE_CLIENT_ID), + emailPasswordAttributesClientId: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.EMAIL_PASSWORD_ATTRIBUTES_CLIENT_ID), + emailCodeAttributesClientId: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.EMAIL_CODE_ATTRIBUTES_CLIENT_ID), + tenantSubdomain: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.TENANT_SUBDOMAIN), + tenantId: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.TENANT_ID), + signInEmailPasswordUsername: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.SIGN_IN_EMAIL_PASSWORD_USERNAME), + signInEmailCodeUsername: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.SIGN_IN_EMAIL_CODE_USERNAME), + resetPasswordUsername: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.RESET_PASSWORD_USERNAME), + resetPasswordUsernameMacos: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.RESET_PASSWORD_USERNAME_MACOS), + passwordSignInEmailCode: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.PASSWORD_SIGN_IN_EMAIL_CODE), + keyvaultUrl: getNativeAuthConfigValue(NATIVE_AUTH_CONFIG_KEYS.KEYVAULT_URL) +}; + +/** + * Test data for negative test cases and other test-specific scenarios + * These should not be replaced with real configuration values + */ +export const testData = { + // Negative test case emails + invalidUserEmail: "test123@test.com", + nonRegisteredEmail: "non-registered@test.com", + + // Other test-specific data + incorrectPassword: "incorrect-password", + invalidOtpCode: "000000" +}; + + +/** + * Get test users object with real account information + * @returns Object containing test user accounts + */ +export const getTestUsers = () => ({ + signInEmailPassword: nativeAuthConfig.signInEmailPasswordUsername, + signInEmailCode: nativeAuthConfig.signInEmailCodeUsername, + resetPassword: nativeAuthConfig.resetPasswordUsername, + resetPasswordMacos: nativeAuthConfig.resetPasswordUsernameMacos +}); + +/** + * Get test data for negative test cases + * @returns Object containing test data for negative scenarios + */ +export const getTestData = () => testData;