diff --git a/packages/react/src/components/SignIn/SignIn.tsx b/packages/react/src/components/SignIn/SignIn.tsx index ca68fae..b43f694 100644 --- a/packages/react/src/components/SignIn/SignIn.tsx +++ b/packages/react/src/components/SignIn/SignIn.tsx @@ -16,40 +16,13 @@ * under the License. */ -import { - AsgardeoUIException, - AuthApiResponse, - AuthClient, - Authenticator, - Branding, - FlowStatus, - Metadata, - PromptType, - ScreenType, - UIAuthClient, - authenticate, - authorize, - getBranding, - keys, -} from '@asgardeo/js'; -import {CircularProgress, ThemeProvider} from '@oxygen-ui/react'; +import {AsgardeoUIException, AuthApiResponse, Branding, authorize, getBranding} from '@asgardeo/js'; import {FC, ReactElement, useContext, useEffect, useState} from 'react'; -import BasicAuth from './fragments/BasicAuth'; -import EmailOtp from './fragments/EmailOtp'; -import IdentifierFirst from './fragments/IdentifierFirst'; -import LoginOptionsBox from './fragments/LoginOptionsBox'; -import SmsOtp from './fragments/SmsOtp'; -import Totp from './fragments/Totp'; +import SignInGeneric from './SignInGeneric'; import AsgardeoContext from '../../contexts/asgardeo-context'; import BrandingPreferenceContext from '../../contexts/branding-preference-context'; -import useAuthentication from '../../hooks/use-authentication'; -import {useConfig} from '../../hooks/use-config'; -import useTranslations from '../../hooks/use-translations'; import AuthContext from '../../models/auth-context'; -import {AlertType, SignInProps} from '../../models/sign-in'; -import {SignIn as UISignIn} from '../../oxygen-ui-react-auth-components'; -import generateThemeSignIn from '../../theme/generate-theme-sign-in'; -import SPACryptoUtils from '../../utils/crypto-utils'; +import {SignInProps} from '../../models/sign-in'; import './sign-in.scss'; /** @@ -62,34 +35,14 @@ import './sign-in.scss'; * @returns {ReactElement} - React element. */ const SignIn: FC = (props: SignInProps): ReactElement => { - const { - basicAuthChildren, - brandingProps, - emailOtpChildren, - identifierFirstChildren, - showFooter = true, - showLogo = true, - showSignUp, - smsOtpChildren, - totpChildren, - } = props; + const {brandingProps, showFooter = true, showLogo = true, showSignUp} = props; - const [alert, setAlert] = useState(); - const [showSelfSignUp, setShowSelfSignUp] = useState(showSignUp); + // const [setAlert] = useState(); const [componentBranding, setComponentBranding] = useState(); - const {isAuthenticated} = useAuthentication(); - const {config} = useConfig(); - const authContext: AuthContext | undefined = useContext(AsgardeoContext); const brandingPreference: Branding = useContext(BrandingPreferenceContext); - const {isLoading, t} = useTranslations({ - componentLocaleOverride: brandingProps?.locale, - componentTextOverrides: brandingProps?.preference?.text, - screen: ScreenType.Common, - }); - useEffect(() => { getBranding({branding: brandingProps, merged: brandingPreference}).then((response: Branding) => { setComponentBranding(response); @@ -105,7 +58,7 @@ const SignIn: FC = (props: SignInProps): ReactElement => { authContext?.setAuthResponse(response); }) .catch((error: Error) => { - setAlert({alertType: {error: true}, key: keys.common.error}); + // setAlert({alertType: {error: true}, key: keys.common.error}); throw new AsgardeoUIException('REACT_UI-SIGN_IN-SI-SE01', 'Authorization failed', error.stack); }) .finally(() => { @@ -113,294 +66,15 @@ const SignIn: FC = (props: SignInProps): ReactElement => { }); }, []); - /** - * Handles the generalized authentication process. - * @param {string} authenticatorId - Authenticator ID. - * @param {object} [authParams] - Authentication parameters. - */ - const handleAuthenticate = async (authenticatorId: string, authParams?: {[key: string]: string}): Promise => { - setAlert(undefined); - - if (authContext?.authResponse === undefined) { - throw new AsgardeoUIException('REACT_UI-SIGN_IN-HA-IV02', 'Auth response is undefined.'); - } - - authContext?.setIsAuthLoading(true); - - const resp: AuthApiResponse = await authenticate({ - flowId: authContext?.authResponse.flowId, - selectedAuthenticator: { - authenticatorId, - params: authParams, - }, - }).catch((authnError: Error) => { - setAlert({alertType: {error: true}, key: keys.common.error}); - authContext?.setIsAuthLoading(false); - throw new AsgardeoUIException('REACT_UI-SIGN_IN-HA-SE03', 'Authentication failed.', authnError.stack); - }); - - if (!authParams) { - const metaData: Metadata = resp.nextStep?.authenticators[0]?.metadata; - if (metaData.promptType === PromptType.RedirectionPromt) { - /** - * Open a popup window to handle redirection prompts - */ - window.open( - metaData.additionalData?.redirectUrl, - resp.nextStep.authenticators[0].authenticator, - 'width=500,height=600', - ); - - /** - * Add an event listener to the window to capture the message from the popup - */ - window.addEventListener('message', function messageEventHandler(event: MessageEvent) { - /** - * Check the origin of the message to ensure it's from the popup window - */ - if (event.origin !== config.signInRedirectURL) return; - - const {code, state} = event.data; - - if (code && state) { - handleAuthenticate(resp?.nextStep?.authenticators[0]?.authenticatorId, {code, state}); - } - - /** - * Remove the event listener - */ - window.removeEventListener('message', messageEventHandler); - }); - } else if (metaData.promptType === PromptType.UserPrompt) { - authContext?.setAuthResponse(resp); - } - } else if (resp.flowStatus === FlowStatus.SuccessCompleted && resp.authData) { - /** - * when the authentication is successful, generate the token - */ - authContext?.setAuthResponse(resp); - - const authInstance: UIAuthClient = AuthClient.getInstance(); - const state: string = (await authInstance.getDataLayer().getTemporaryDataParameter('state')).toString(); - - await authInstance.requestAccessToken(resp.authData.code, resp.authData.session_state, state); - - authContext?.setAuthentication(); - } else if (resp.flowStatus === FlowStatus.FailIncomplete) { - authContext?.setAuthResponse({ - ...resp, - nextStep: authContext?.authResponse.nextStep, - }); - - setAlert({alertType: {error: true}, key: keys.common.error}); - } else { - authContext?.setAuthResponse(resp); - setShowSelfSignUp(false); - } - - authContext?.setIsAuthLoading(false); - }; - - const renderLoginOptions = (authenticators: Authenticator[]): ReactElement[] => { - const LoginOptions: ReactElement[] = []; - - authenticators.forEach((authenticator: Authenticator) => { - const displayName: string = authenticator.idp === 'LOCAL' ? authenticator.authenticator : authenticator.idp; - LoginOptions.push( - => handleAuthenticate(authenticator.authenticatorId)} - key={authenticator.authenticatorId} - />, - ); - }); - - return LoginOptions; - }; - - const renderSignIn = (): ReactElement => { - const authenticators: Authenticator[] = authContext?.authResponse?.nextStep?.authenticators; - - if (authenticators) { - const usernamePasswordAuthenticator: Authenticator = authenticators.find( - (authenticator: Authenticator) => authenticator.authenticator === 'Username & Password', - ); - - if (usernamePasswordAuthenticator) { - return ( - auth.authenticatorId !== usernamePasswordAuthenticator.authenticatorId, - ), - )} - > - {basicAuthChildren} - - ); - } - - const identifierFirstAuthenticator: Authenticator = authenticators.find( - (authenticator: Authenticator) => authenticator.authenticator === 'Identifier First', - ); - - if (identifierFirstAuthenticator) { - return ( - auth.authenticatorId !== identifierFirstAuthenticator.authenticatorId, - ), - )} - > - {identifierFirstChildren} - - ); - } - - if (authenticators.length === 1) { - if (authenticators[0].authenticator === 'TOTP') { - return ( - - {totpChildren} - - ); - } - if ( - // TODO: change after api based auth gets fixed - new SPACryptoUtils() - .base64URLDecode(authContext?.authResponse.nextStep.authenticators[0].authenticatorId) - .split(':')[0] === 'email-otp-authenticator' - ) { - return ( - - {emailOtpChildren} - - ); - } - - if ( - // TODO: change after api based auth gets fixed - new SPACryptoUtils() - .base64URLDecode(authContext?.authResponse.nextStep.authenticators[0].authenticatorId) - .split(':')[0] === 'sms-otp-authenticator' - ) { - return ( - - {smsOtpChildren} - - ); - } - } - - /** - * If there are multiple authenticators without Username and password, render the multiple options screen - */ - if (authenticators.length > 1) { - return ( - - - {t(keys.common.common.title)} - - {!usernamePasswordAuthenticator && alert && ( - - {t(alert.key)} - - )} - {renderLoginOptions(authenticators)} - - ); - } - } - return null; - }; - - /** - * Renders the circular progress component while the component or text is loading. - */ - if (authContext?.isComponentLoading || isLoading || authContext?.isBrandingLoading) { - return ( -
- -
- ); - } - - const imgUrl: string = brandingPreference?.preference?.theme?.LIGHT?.images?.logo?.imgURL; - let copyrightText: string = t(keys.common.copyright); - const DEFAULT_LOCALE: string = 'en-US'; - - if (showFooter && copyrightText.includes('{{currentYear}}')) { - copyrightText = copyrightText.replace('{{currentYear}}', new Date().getFullYear().toString()); - } - return ( - - - {showLogo && !(isLoading || authContext?.isComponentLoading) && ( - - )} - {authContext?.authResponse?.flowStatus !== FlowStatus.SuccessCompleted && !isAuthenticated && ( - <> - {renderSignIn()} - - {showFooter && !(isLoading || authContext?.isComponentLoading) && ( - - {t(keys.common.privacy.policy)} - - ), - }, - { - children: ( - - {t(keys.common.terms.of.service)} - - ), - }, - {children: {componentBranding?.locale ?? DEFAULT_LOCALE}}, - ]} - /> - )} - - )} - {(authContext?.authResponse?.flowStatus === FlowStatus.SuccessCompleted || isAuthenticated) && ( -
Successfully Authenticated
- )} -
-
+ ); }; diff --git a/packages/react/src/components/SignIn/SignInGeneric.tsx b/packages/react/src/components/SignIn/SignInGeneric.tsx new file mode 100644 index 0000000..4455d3a --- /dev/null +++ b/packages/react/src/components/SignIn/SignInGeneric.tsx @@ -0,0 +1,393 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { + AsgardeoUIException, + AuthApiResponse, + AuthClient, + Authenticator, + Branding, + FlowStatus, + Metadata, + PromptType, + UIAuthClient, + authenticate, + getBranding, + keys, +} from '@asgardeo/js'; +import {FC, ReactElement, useContext, useEffect, useState} from 'react'; +import BasicAuth from './fragments/BasicAuth'; +import EmailOtp from './fragments/EmailOtp'; +import IdentifierFirst from './fragments/IdentifierFirst'; +import LoginOptionsBox from './fragments/LoginOptionsBox'; +import SmsOtp from './fragments/SmsOtp'; +import Totp from './fragments/Totp'; +import AsgardeoContext from '../../contexts/asgardeo-context'; +import useAuthentication from '../../hooks/use-authentication'; +import {useConfig} from '../../hooks/use-config'; +import AuthContext from '../../models/auth-context'; +import {AlertType, SignInProps} from '../../models/sign-in'; +import {SignIn as UISignIn} from '../../oxygen-ui-react-auth-components'; +import SPACryptoUtils from '../../utils/crypto-utils'; +import './sign-in.scss'; + +/** + * This component provides the sign-in functionality. + * + * @param {SignInProps} props - Props injected to the component. + * @param {BrandingProps} props.brandingProps - Branding related props. + * @param {boolean} props.showSignUp - Show sign-up. + * + * @returns {ReactElement} - React element. + */ +const SignInGeneric: FC = (props: SignInProps): ReactElement => { + const { + basicAuthChildren, + brandingProps, + emailOtpChildren, + identifierFirstChildren, + showFooter = true, + showLogo = true, + showSignUp, + smsOtpChildren, + totpChildren, + // brandingPreference, + authResponse, + } = props; + + const [alert, setAlert] = useState(); + const [showSelfSignUp, setShowSelfSignUp] = useState(showSignUp); + + const {isAuthenticated} = useAuthentication(); + const {config} = useConfig(); + + const authContext: AuthContext | undefined = useContext(AsgardeoContext); + // const {setAuthResponse, setIsComponentLoading} = authContext; + const [brandingPreference, setComponentBranding] = useState(); + + console.log('auth Response Display'); + console.log(authResponse); + console.log(brandingPreference); + + authContext.setAuthResponse(authResponse); + console.log(authContext); + + // const {isLoading, t} = useTranslations({ + // componentLocaleOverride: brandingProps?.locale, + // componentTextOverrides: brandingProps?.preference?.text, + // screen: ScreenType.Common, + // }); + + useEffect(() => { + getBranding({branding: brandingProps, merged: brandingPreference}).then((response: Branding) => { + setComponentBranding(response); + }); + }, [brandingPreference, brandingProps]); + + /** + * Handles the generalized authentication process. + * @param {string} authenticatorId - Authenticator ID. + * @param {object} [authParams] - Authentication parameters. + */ + const handleAuthenticate = async (authenticatorId: string, authParams?: {[key: string]: string}): Promise => { + setAlert(undefined); + authContext.setAuthResponse(authResponse); + + if (authResponse === undefined) { + throw new AsgardeoUIException('REACT_UI-SIGN_IN-HA-IV02', 'Auth response is undefined.'); + } + + authContext?.setIsAuthLoading(true); + + const resp: AuthApiResponse = await authenticate({ + flowId: authResponse.flowId, + selectedAuthenticator: { + authenticatorId, + params: authParams, + }, + }).catch((authnError: Error) => { + setAlert({alertType: {error: true}, key: keys.common.error}); + authContext?.setIsAuthLoading(false); + throw new AsgardeoUIException('REACT_UI-SIGN_IN-HA-SE03', 'Authentication failed.', authnError.stack); + }); + + if (!authParams) { + const metaData: Metadata = resp.nextStep?.authenticators[0]?.metadata; + if (metaData.promptType === PromptType.RedirectionPromt) { + /** + * Open a popup window to handle redirection prompts + */ + window.open( + metaData.additionalData?.redirectUrl, + resp.nextStep.authenticators[0].authenticator, + 'width=500,height=600', + ); + + /** + * Add an event listener to the window to capture the message from the popup + */ + window.addEventListener('message', function messageEventHandler(event: MessageEvent) { + /** + * Check the origin of the message to ensure it's from the popup window + */ + if (event.origin !== config.signInRedirectURL) return; + + const {code, state} = event.data; + + if (code && state) { + handleAuthenticate(resp?.nextStep?.authenticators[0]?.authenticatorId, {code, state}); + } + + /** + * Remove the event listener + */ + window.removeEventListener('message', messageEventHandler); + }); + } else if (metaData.promptType === PromptType.UserPrompt) { + authContext?.setAuthResponse(resp); + } + } else if (resp.flowStatus === FlowStatus.SuccessCompleted && resp.authData) { + /** + * when the authentication is successful, generate the token + */ + authContext?.setAuthResponse(resp); + + const authInstance: UIAuthClient = AuthClient.getInstance(); + const state: string = (await authInstance.getDataLayer().getTemporaryDataParameter('state')).toString(); + + await authInstance.requestAccessToken(resp.authData.code, resp.authData.session_state, state); + + authContext?.setAuthentication(); + } else if (resp.flowStatus === FlowStatus.FailIncomplete) { + authContext?.setAuthResponse({ + ...resp, + nextStep: authContext?.authResponse.nextStep, + }); + + setAlert({alertType: {error: true}, key: keys.common.error}); + } else { + authContext?.setAuthResponse(resp); + setShowSelfSignUp(false); + } + + authContext?.setIsAuthLoading(false); + }; + + const renderLoginOptions = (authenticators: Authenticator[]): ReactElement[] => { + const LoginOptions: ReactElement[] = []; + + authenticators.forEach((authenticator: Authenticator) => { + const displayName: string = authenticator.idp === 'LOCAL' ? authenticator.authenticator : authenticator.idp; + LoginOptions.push( + => handleAuthenticate(authenticator.authenticatorId)} + key={authenticator.authenticatorId} + />, + ); + }); + + return LoginOptions; + }; + + const renderSignIn = (): ReactElement => { + const authenticators: Authenticator[] = authContext?.authResponse?.nextStep?.authenticators; + + if (authenticators) { + const usernamePasswordAuthenticator: Authenticator = authenticators.find( + (authenticator: Authenticator) => authenticator.authenticator === 'Username & Password', + ); + + if (usernamePasswordAuthenticator) { + return ( + auth.authenticatorId !== usernamePasswordAuthenticator.authenticatorId, + ), + )} + > + {basicAuthChildren} + + ); + } + + const identifierFirstAuthenticator: Authenticator = authenticators.find( + (authenticator: Authenticator) => authenticator.authenticator === 'Identifier First', + ); + + if (identifierFirstAuthenticator) { + return ( + auth.authenticatorId !== identifierFirstAuthenticator.authenticatorId, + ), + )} + > + {identifierFirstChildren} + + ); + } + + if (authenticators.length === 1) { + if (authenticators[0].authenticator === 'TOTP') { + return ( + + {totpChildren} + + ); + } + if ( + // TODO: change after api based auth gets fixed + new SPACryptoUtils() + .base64URLDecode(authContext?.authResponse.nextStep.authenticators[0].authenticatorId) + .split(':')[0] === 'email-otp-authenticator' + ) { + return ( + + {emailOtpChildren} + + ); + } + + if ( + // TODO: change after api based auth gets fixed + new SPACryptoUtils() + .base64URLDecode(authContext?.authResponse.nextStep.authenticators[0].authenticatorId) + .split(':')[0] === 'sms-otp-authenticator' + ) { + return ( + + {smsOtpChildren} + + ); + } + } + + /** + * If there are multiple authenticators without Username and password, render the multiple options screen + */ + if (authenticators.length > 1) { + return ( + + + {keys.common.common.title} + + {!usernamePasswordAuthenticator && alert && ( + + {alert.key} + + )} + {renderLoginOptions(authenticators)} + + ); + } + } + return null; + }; + + /** + * Renders the circular progress component while the component or text is loading. + */ + // if (authContext?.isComponentLoading || isLoading || authContext?.isBrandingLoading) { + // return ( + //
+ // + //
+ // ); + // } + + const imgUrl: string = brandingPreference?.preference?.theme?.LIGHT?.images?.logo?.imgURL; + let copyrightText: string = keys.common.copyright; + + if (showFooter && copyrightText.includes('{{currentYear}}')) { + copyrightText = copyrightText.replace('{{currentYear}}', new Date().getFullYear().toString()); + } + + return ( + // + + {showLogo && !authContext?.isComponentLoading && ( + + )} + {/* {authContext?.authResponse?.flowStatus !== FlowStatus.SuccessCompleted && !isAuthenticated && ( */} + <> + {renderSignIn()} + + {/* {showFooter && !(isLoading || authContext?.isComponentLoading) && ( */} + {/* + {keys.common.privacy.policy} + + ), + }, + { + children: ( + + {keys.common.terms.of.service} + + ), + }, + {children: {brandingPreference?.locale ?? DEFAULT_LOCALE}}, + ]} + /> */} + {/* )} */} + + {/* )} */} + {(authContext?.authResponse?.flowStatus === FlowStatus.SuccessCompleted || isAuthenticated) && ( +
Successfully Authenticated
+ )} +
+ //
+ ); +}; + +export default SignInGeneric; diff --git a/packages/react/src/components/public-components.ts b/packages/react/src/components/public-components.ts index 5e518d1..719873d 100644 --- a/packages/react/src/components/public-components.ts +++ b/packages/react/src/components/public-components.ts @@ -17,6 +17,7 @@ */ export {default as SignIn} from './SignIn/SignIn'; +export {default as SignInGeneric} from './SignIn/SignInGeneric'; export {default as SignedIn} from './SignedIn/SignedIn'; export {default as SignedOut} from './SignedOut/SignedOut'; export {default as SignInButton} from './SignInButton/SignInButton'; diff --git a/packages/react/src/hooks/use-translations.ts b/packages/react/src/hooks/use-translations.ts index 906f4ff..85e26ca 100644 --- a/packages/react/src/hooks/use-translations.ts +++ b/packages/react/src/hooks/use-translations.ts @@ -37,23 +37,23 @@ import UseTranslations from '../models/use-translations'; const useTranslations = (props: SetTranslationsProps): UseTranslations => { const {componentLocaleOverride, componentTextOverrides, screen} = props; - const [isLoading, setIsLoading] = useState(true); + const [isLoading, setIsLoading] = useState(false); const {setIsTextLoading} = useContext(AsgardeoContext); const contextValue: I18n = useContext(I18nContext); const {text, setTranslations} = contextValue; - useEffect(() => { - setTranslations({componentLocaleOverride, componentTextOverrides, screen}).then((response: boolean) => { - setIsLoading(!response); - setIsTextLoading(!response); - }); - }, [componentLocaleOverride, componentTextOverrides, screen, setTranslations]); + // useEffect(() => { + // setTranslations({componentLocaleOverride, componentTextOverrides, screen}).then((response: boolean) => { + // setIsLoading(!response); + // setIsTextLoading(!response); + // }); + // }, [componentLocaleOverride, componentTextOverrides, screen, setIsTextLoading, setTranslations]); - useEffect(() => { - setIsTextLoading(isLoading); - }, [isLoading]); + // useEffect(() => { + // setIsTextLoading(isLoading); + // }, [isLoading, setIsTextLoading]); /** * `t` is a function that retrieves a specific translation from the fetched translations. diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 98f497c..4346ade 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -21,3 +21,4 @@ export * from './models/public-models'; export {default as AsgardeoProvider} from './providers/AsgardeoProvider'; export {default as useAuthentication} from './hooks/use-authentication'; export {default as useOn} from './hooks/use-on'; +export {default as SPACryptoUtils} from './utils/crypto-utils'; diff --git a/packages/react/src/models/jwt-verify-options.ts b/packages/react/src/models/jwt-verify-options.ts index bb1bc20..0e67a71 100644 --- a/packages/react/src/models/jwt-verify-options.ts +++ b/packages/react/src/models/jwt-verify-options.ts @@ -19,7 +19,7 @@ interface JwtVerifyOptions { algorithms: string[]; audience: string; - clockTolerance: number; + clockTolerance: any; issuer: string; subject: string; } diff --git a/packages/react/src/models/sign-in.ts b/packages/react/src/models/sign-in.ts index fecde46..8964b0a 100644 --- a/packages/react/src/models/sign-in.ts +++ b/packages/react/src/models/sign-in.ts @@ -16,14 +16,17 @@ * under the License. */ -import {BrandingProps} from '@asgardeo/js'; +import {AuthApiResponse, Branding, BrandingProps} from '@asgardeo/js'; import {ReactElement} from 'react'; export interface SignInProps { + authResponse?: AuthApiResponse; basicAuthChildren?: ReactElement; + brandingPreference?: Branding; brandingProps?: BrandingProps; emailOtpChildren?: ReactElement; identifierFirstChildren?: ReactElement; + isComponentLoading?: boolean; showFooter?: boolean; showLogo?: boolean; showSignUp?: boolean; diff --git a/packages/react/src/utils/crypto-utils.ts b/packages/react/src/utils/crypto-utils.ts index 9612bdd..69ce7bf 100644 --- a/packages/react/src/utils/crypto-utils.ts +++ b/packages/react/src/utils/crypto-utils.ts @@ -73,7 +73,7 @@ export default class SPACryptoUtils implements CryptoUtils { clientID: string, issuer: string, subject: string, - clockTolerance?: number, + clockTolerance?: any, validateJwtIssuer?: boolean, ): Promise { const jwtVerifyOptions: JwtVerifyOptions = { diff --git a/recipes/next-app-page-router/.eslintrc.json b/recipes/next-app-page-router/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/recipes/next-app-page-router/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/recipes/next-app-page-router/.gitignore b/recipes/next-app-page-router/.gitignore new file mode 100644 index 0000000..fd3dbb5 --- /dev/null +++ b/recipes/next-app-page-router/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/recipes/next-app-page-router/README.md b/recipes/next-app-page-router/README.md new file mode 100644 index 0000000..abf1598 --- /dev/null +++ b/recipes/next-app-page-router/README.md @@ -0,0 +1,47 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with +[`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on +[http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as +[API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and +load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions +are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the +[Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) +from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/recipes/next-app-page-router/components/SignIn.tsx b/recipes/next-app-page-router/components/SignIn.tsx new file mode 100644 index 0000000..383fdd7 --- /dev/null +++ b/recipes/next-app-page-router/components/SignIn.tsx @@ -0,0 +1,282 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {FC, FunctionComponent, ReactElement, useContext, useEffect, useState} from 'react'; +import {AuthApiResponse, Branding, BrandingProps, PredefinedThemes} from '@asgardeo/js'; + +import {InferGetServerSidePropsType} from 'next'; +import {getServerSideProps} from '@/pages'; +import {SignInGeneric} from '@asgardeo/react'; + +export interface SignInProps { + authResponse?: AuthApiResponse; + basicAuthChildren?: ReactElement; + brandingPreference?: Branding; + brandingProps?: BrandingProps; + emailOtpChildren?: ReactElement; + identifierFirstChildren?: ReactElement; + showFooter?: boolean; + showLogo?: boolean; + showSignUp?: boolean; + smsOtpChildren?: ReactElement; + totpChildren?: ReactElement; +} +interface Repo { + authRes: string; + authResponse: AuthApiResponse | undefined | null; +} +export const SignIn: FunctionComponent = (props: SignInProps): ReactElement => { + const {authResponse} = props; + console.log('authResponse'); + console.log(authResponse); + + return ( + //
+ <> +

repo

+

blha {authResponse?.flowStatus} hh

+ + + //
+ ); +}; + +export default SignIn; diff --git a/recipes/next-app-page-router/config/config.ts b/recipes/next-app-page-router/config/config.ts new file mode 100644 index 0000000..9d7e7b8 --- /dev/null +++ b/recipes/next-app-page-router/config/config.ts @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export const asgardeoConfig = { + signInRedirectURL: 'http://localhost:3000', + signOutRedirectURL: 'http://localhost:3000', + clientID: 'YOUR_CLIENT_ID', + baseUrl: 'https://api.asgardeo.io/t/YOUR_TENANT', +}; diff --git a/recipes/next-app-page-router/hooks/useAuth.ts b/recipes/next-app-page-router/hooks/useAuth.ts new file mode 100644 index 0000000..7bd98b6 --- /dev/null +++ b/recipes/next-app-page-router/hooks/useAuth.ts @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {useAuthentication} from '@asgardeo/react'; +import axios from 'axios'; + +export const useAuth = () => { + const {isAuthenticated, user, signOut} = useAuthentication(); + + // const login = async () => { + // try { + // await signIn(); + // } catch (error) { + // console.error('Sign-in failed', error); + // } + // }; + + const exchangeCodeForToken = async (code: any) => { + try { + const response = await axios.post('/api/auth', { + client_id: 'YOUR_CLIENT_ID', + client_secret: process.env.ASGARDEO_CLIENT_SECRET, // Load this from environment variables + redirect_uri: 'http://localhost:3000', + code, + }); + + return response.data; + } catch (error) { + console.error('Token exchange failed', error); + } + }; + + const logout = async () => { + try { + await signOut(); + } catch (error) { + console.error('Sign-out failed', error); + } + }; + + return { + isAuthenticated: isAuthenticated, + // login, + exchangeCodeForToken, + logout, + user: user, + }; +}; diff --git a/recipes/next-app-page-router/package-lock.json b/recipes/next-app-page-router/package-lock.json new file mode 100644 index 0000000..1a62e16 --- /dev/null +++ b/recipes/next-app-page-router/package-lock.json @@ -0,0 +1,1953 @@ +{ + "name": "next-app-page-router", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "next-app-page-router", + "version": "0.1.0", + "dependencies": { + "@asgardeo/auth-js": "^5.0.1", + "@asgardeo/js": "*", + "@asgardeo/react": "*", + "axios": "^1.7.2", + "memory-cache": "^0.2.0", + "next": "14.2.4", + "prettier": "^3.2.5", + "react": "^18", + "react-dom": "^18" + }, + "devDependencies": { + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "eslint": "^8", + "eslint-config-next": "14.2.4", + "postcss": "^8", + "tailwindcss": "^3.4.1", + "typescript": "^5" + } + }, + "../../node_modules/.pnpm/@asgardeo+js@0.1.2/node_modules/@asgardeo/js": { + "version": "0.1.2", + "license": "Apache-2.0", + "dependencies": { + "@asgardeo/auth-js": "^5.0.1", + "csstype": "^3.1.3", + "lodash.isempty": "^4.4.0", + "lodash.merge": "^4.6.2" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-dynamic-import-vars": "^2.1.2", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@types/lodash.isempty": "^4.4.9", + "@types/lodash.merge": "^4.6.9", + "@types/node": "^20.12.7", + "@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?fa0b844715320a3953d6d055997c0770f8695082", + "@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?fa0b844715320a3953d6d055997c0770f8695082", + "eslint": "~8.57.0", + "prettier": "^3.2.5", + "rollup": "^4.17.2", + "rollup-plugin-dts": "^6.1.0", + "tslib": "^2.6.2", + "typescript": "^5.1.6" + } + }, + "../../node_modules/.pnpm/@oxygen-ui+react@1.11.0_@emotion+react@11.11.4_@types+react@18.3.1_react@18.3.1__@emotion+sty_4z44ukeectednlm54aihjiybjq/node_modules/@oxygen-ui/react": { + "version": "1.11.0", + "license": "Apache-2.0", + "dependencies": { + "@mui/x-data-grid": "^6.9.2", + "@oxygen-ui/primitives": "1.11.0", + "@oxygen-ui/react-icons": "1.11.0", + "clsx": "^1.2.1", + "react-world-flags": "^1.5.1" + }, + "devDependencies": { + "@babel/core": "^7.20.2", + "@emotion/react": "^11.10.5", + "@emotion/styled": "^11.10.5", + "@mui/icons-material": "^5.10.16", + "@mui/lab": "5.0.0-alpha.110", + "@mui/material": "^5.10.16", + "@mui/system": "^5.10.16", + "@mui/utils": "^5.10.16", + "@oxygen-ui/logger": "1.11.0", + "@rollup/plugin-commonjs": "^23.0.3", + "@rollup/plugin-image": "^3.0.1", + "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-typescript": "^10.0.1", + "@storybook/addon-a11y": "^6.5.13", + "@storybook/addon-actions": "^6.5.13", + "@storybook/addon-essentials": "^6.5.16", + "@storybook/addon-interactions": "^6.5.13", + "@storybook/addon-links": "^6.5.13", + "@storybook/builder-webpack4": "^6.5.13", + "@storybook/builder-webpack5": "^6.5.13", + "@storybook/client-api": "^6.5.13", + "@storybook/manager-webpack4": "^6.5.13", + "@storybook/manager-webpack5": "^6.5.13", + "@storybook/preset-scss": "^1.0.3", + "@storybook/react": "^6.5.13", + "@storybook/testing-library": "^0.0.13", + "@storybook/types": "7.0.0-alpha.44", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^13.4.0", + "@types/jest": "^29.2.3", + "@types/node": "^18.11.18", + "@types/react": "^18.0.25", + "@types/react-dom": "^18.0.9", + "@types/testing-library__jest-dom": "^5.14.5", + "@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?5bf60cabe9e9a2571e8b1dd16d0c3bdc76db2c4f", + "@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?5bf60cabe9e9a2571e8b1dd16d0c3bdc76db2c4f", + "@wso2/stylelint-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/stylelint-config?5bf60cabe9e9a2571e8b1dd16d0c3bdc76db2c4f", + "babel-jest": "^29.3.1", + "babel-loader": "^8.3.0", + "eslint": "8.25.0", + "eslint-plugin-mdx": "^2.0.5", + "fs-extra": "^11.1.0", + "jest": "29.0.3", + "jest-environment-jsdom": "^29.4.1", + "node-sass": "^8.0.0", + "nodemon": "^2.0.22", + "postcss": "8.4.16", + "prettier": "^2.8.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "rollup": "^3.5.0", + "rollup-plugin-dts": "^5.0.0", + "rollup-plugin-postcss": "^4.0.2", + "rollup-plugin-terser": "^7.0.2", + "sass": "^1.56.1", + "sass-loader": "^13.2.0", + "storybook-addon-designs": "^6.3.1", + "storybook-addon-themes": "^6.1.0", + "storybook-dark-mode": "^1.1.2", + "stylelint": "^15.1.0", + "ts-dedent": "^2.2.0", + "ts-jest": "^29.0.3", + "tsconfig-paths-webpack-plugin": "^4.0.0", + "tslib": "^2.4.1", + "typescript": "^4.9.3" + }, + "peerDependencies": { + "@emotion/react": "^11.10.5", + "@emotion/styled": "^11.10.5", + "@mui/icons-material": "^5.10.16", + "@mui/lab": "5.0.0-alpha.110", + "@mui/material": "^5.10.16", + "@mui/system": "^5.10.16", + "@mui/utils": "^5.10.16", + "react": ">=18.0.0", + "react-dom": ">=18.0.0", + "typescript": ">=4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@rollup+plugin-commonjs@25.0.7_rollup@4.17.2/node_modules/@rollup/plugin-commonjs": { + "version": "25.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^8.0.3", + "is-reference": "1.2.1", + "magic-string": "^0.30.3" + }, + "devDependencies": { + "@rollup/plugin-json": "^5.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "locate-character": "^2.0.5", + "require-relative": "^0.8.7", + "rollup": "^4.0.0-24", + "shx": "^0.3.4", + "source-map": "^0.7.4", + "source-map-support": "^0.5.21", + "typescript": "^4.8.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@rollup+plugin-image@3.0.3_rollup@4.17.2/node_modules/@rollup/plugin-image": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "mini-svg-data-uri": "^1.4.4" + }, + "devDependencies": { + "@rollup/plugin-buble": "^1.0.0", + "rollup": "^4.0.0-24" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@rollup+plugin-node-resolve@15.2.3_rollup@4.17.2/node_modules/@rollup/plugin-node-resolve": { + "version": "15.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.2.1", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "devDependencies": { + "@babel/core": "^7.19.1", + "@babel/plugin-transform-typescript": "^7.10.5", + "@rollup/plugin-babel": "^6.0.0", + "@rollup/plugin-commonjs": "^23.0.0", + "@rollup/plugin-json": "^5.0.0", + "es5-ext": "^0.10.62", + "rollup": "^4.0.0-24", + "source-map": "^0.7.4", + "string-capitalize": "^1.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.17.2_tslib@2.6.2_typescript@5.1.6/node_modules/@rollup/plugin-typescript": { + "version": "11.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "devDependencies": { + "@rollup/plugin-buble": "^1.0.0", + "@rollup/plugin-commonjs": "^23.0.0", + "@types/node": "^14.18.30", + "@types/resolve": "^1.20.2", + "buble": "^0.20.0", + "rollup": "^4.0.0-24", + "typescript": "^4.8.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@types+node@20.12.7/node_modules/@types/node": { + "version": "20.12.7", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "../../node_modules/.pnpm/@types+randombytes@2.0.3/node_modules/@types/randombytes": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "../../node_modules/.pnpm/@types+react-dom@18.3.0/node_modules/@types/react-dom": { + "version": "18.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "../../node_modules/.pnpm/@types+react@18.3.1/node_modules/@types/react": { + "version": "18.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "../../node_modules/.pnpm/@wso2+eslint-plugin@https+++gitpkg.now.sh+brionmario+wso2-ui-configs+packages+eslint-plugin+f_xnwx2k4zkb2iqrwo6rpordvjg4/node_modules/@wso2/eslint-plugin": { + "version": "0.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/core": "^7.20.2", + "@babel/eslint-parser": "^7.19.1", + "@next/eslint-plugin-next": "^13.0.6", + "@typescript-eslint/eslint-plugin": "^5.44.0", + "@typescript-eslint/parser": "^5.44.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.0.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-eslint-plugin": "^5.0.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jest": "^27.1.5", + "eslint-plugin-jsx-a11y": "^6.6.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-react": "^7.31.11", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-testing-library": "^5.9.1", + "eslint-plugin-tsdoc": "^0.2.16", + "eslint-plugin-typescript-sort-keys": "^2.1.0", + "prettier": "^2.8.0", + "requireindex": "^1.2.0" + }, + "devDependencies": { + "@wso2/prettier-config": "*", + "eslint": "^8.19.0", + "mocha": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.0.0 || >= 18.0.0" + }, + "peerDependencies": { + "eslint": ">=8.0.0", + "typescript": ">=4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@wso2+prettier-config@https+++gitpkg.now.sh+brionmario+wso2-ui-configs+packages+prettier-conf_qukeol4brtckymlxjv7eysclka/node_modules/@wso2/prettier-config": { + "version": "0.1.0", + "dev": true, + "license": "Apache-2.0", + "devDependencies": { + "@wso2/eslint-plugin": "*", + "eslint": "^8.19.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "prettier": ">=2.0.0", + "typescript": ">=4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/@wso2+stylelint-config@https+++gitpkg.now.sh+brionmario+wso2-ui-configs+packages+stylelint-co_zm6ypzmckvyqp3lii63k2f3sku/node_modules/@wso2/stylelint-config": { + "version": "0.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "postcss-scss": "^4.0.5", + "stylelint-config-standard-scss": "^6.1.0" + }, + "devDependencies": { + "@wso2/eslint-plugin": "*", + "@wso2/prettier-config": "*", + "eslint": "^8.19.0", + "prettier": "^2.8.0", + "stylelint": "^14.15.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "stylelint": ">=14.0.0", + "typescript": ">=4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/axios@1.7.2/node_modules/axios": { + "version": "1.7.2", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "devDependencies": { + "@babel/core": "^7.23.9", + "@babel/preset-env": "^7.23.9", + "@commitlint/cli": "^17.8.1", + "@commitlint/config-conventional": "^17.8.1", + "@release-it/conventional-changelog": "^5.1.1", + "@rollup/plugin-alias": "^5.1.0", + "@rollup/plugin-babel": "^5.3.1", + "@rollup/plugin-commonjs": "^15.1.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "abortcontroller-polyfill": "^1.7.5", + "auto-changelog": "^2.4.0", + "body-parser": "^1.20.2", + "chalk": "^5.3.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "dev-null": "^0.1.1", + "dtslint": "^4.2.1", + "es6-promise": "^4.2.8", + "eslint": "^8.56.0", + "express": "^4.18.2", + "formdata-node": "^5.0.1", + "formidable": "^2.1.2", + "fs-extra": "^10.1.0", + "get-stream": "^3.0.0", + "gulp": "^4.0.2", + "gzip-size": "^7.0.0", + "handlebars": "^4.7.8", + "husky": "^8.0.3", + "istanbul-instrumenter-loader": "^3.0.1", + "jasmine-core": "^2.99.1", + "karma": "^6.3.17", + "karma-chrome-launcher": "^3.2.0", + "karma-firefox-launcher": "^2.1.2", + "karma-jasmine": "^1.1.2", + "karma-jasmine-ajax": "^0.1.13", + "karma-rollup-preprocessor": "^7.0.8", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "memoizee": "^0.4.15", + "minimist": "^1.2.8", + "mocha": "^10.3.0", + "multer": "^1.4.4", + "pretty-bytes": "^6.1.1", + "release-it": "^15.11.0", + "rollup": "^2.79.1", + "rollup-plugin-auto-external": "^2.0.0", + "rollup-plugin-bundle-size": "^1.0.3", + "rollup-plugin-terser": "^7.0.2", + "sinon": "^4.5.0", + "stream-throttle": "^0.1.3", + "string-replace-async": "^3.0.2", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.9.5" + } + }, + "../../node_modules/.pnpm/base64url@3.0.1/node_modules/base64url": { + "version": "3.0.1", + "license": "MIT", + "devDependencies": { + "@types/node": "^10.0.0", + "tap": "^12.1.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer": { + "version": "6.0.3", + "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", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + }, + "devDependencies": { + "airtap": "^3.0.0", + "benchmark": "^2.1.4", + "browserify": "^17.0.0", + "concat-stream": "^2.0.0", + "hyperquest": "^2.1.3", + "is-buffer": "^2.0.5", + "is-nan": "^1.3.0", + "split": "^1.0.1", + "standard": "*", + "tape": "^5.0.1", + "through2": "^4.0.2", + "uglify-js": "^3.11.5" + } + }, + "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx": { + "version": "2.1.1", + "license": "MIT", + "devDependencies": { + "esm": "3.2.25", + "terser": "4.8.0", + "uvu": "0.5.4" + }, + "engines": { + "node": ">=6" + } + }, + "../../node_modules/.pnpm/eslint-config-next@14.2.4_eslint@8.57.0_typescript@5.4.5/node_modules/eslint-config-next": { + "version": "14.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@next/eslint-plugin-next": "14.2.4", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/eslint@8.57.0/node_modules/eslint": { + "version": "8.57.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "devDependencies": { + "@babel/core": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "@wdio/browser-runner": "^8.14.6", + "@wdio/cli": "^8.14.6", + "@wdio/concise-reporter": "^8.14.0", + "@wdio/globals": "^8.14.6", + "@wdio/mocha-framework": "^8.14.0", + "babel-loader": "^8.0.5", + "c8": "^7.12.0", + "chai": "^4.0.1", + "cheerio": "^0.22.0", + "common-tags": "^1.8.0", + "core-js": "^3.1.3", + "ejs": "^3.0.2", + "eslint": "file:.", + "eslint-config-eslint": "file:packages/eslint-config-eslint", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-eslint-plugin": "^5.2.1", + "eslint-plugin-internal-rules": "file:tools/internal-rules", + "eslint-plugin-jsdoc": "^46.2.5", + "eslint-plugin-n": "^16.6.0", + "eslint-plugin-unicorn": "^49.0.0", + "eslint-release": "^3.2.0", + "eslump": "^3.0.0", + "esprima": "^4.0.1", + "fast-glob": "^3.2.11", + "fs-teardown": "^0.1.3", + "glob": "^7.1.6", + "got": "^11.8.3", + "gray-matter": "^4.0.3", + "lint-staged": "^11.0.0", + "load-perf": "^0.2.0", + "markdown-it": "^12.2.0", + "markdown-it-container": "^3.0.0", + "markdownlint": "^0.32.0", + "markdownlint-cli": "^0.37.0", + "marked": "^4.0.8", + "memfs": "^3.0.1", + "metascraper": "^5.25.7", + "metascraper-description": "^5.25.7", + "metascraper-image": "^5.29.3", + "metascraper-logo": "^5.25.7", + "metascraper-logo-favicon": "^5.25.7", + "metascraper-title": "^5.25.7", + "mocha": "^8.3.2", + "mocha-junit-reporter": "^2.0.0", + "node-polyfill-webpack-plugin": "^1.0.3", + "npm-license": "^0.3.3", + "pirates": "^4.0.5", + "progress": "^2.0.3", + "proxyquire": "^2.0.1", + "recast": "^0.23.0", + "regenerator-runtime": "^0.14.0", + "rollup-plugin-node-polyfills": "^0.2.1", + "semver": "^7.5.3", + "shelljs": "^0.8.2", + "sinon": "^11.0.0", + "vite-plugin-commonjs": "^0.10.0", + "webdriverio": "^8.14.6", + "webpack": "^5.23.0", + "webpack-cli": "^4.5.0", + "yorkie": "^2.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "../../node_modules/.pnpm/fast-sha256@1.3.0/node_modules/fast-sha256": { + "version": "1.3.0", + "license": "Unlicense", + "devDependencies": { + "faucet": "0.x.x", + "tape": "4.11.0", + "tslint": "^5.20.0", + "typescript": "^3.6.4", + "uglify-js": "^3.1.9" + } + }, + "../../node_modules/.pnpm/jose@5.3.0/node_modules/jose": { + "version": "5.3.0", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "../../node_modules/.pnpm/next@14.2.4_@babel+core@7.24.4_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.76.0/node_modules/next": { + "version": "14.2.4", + "license": "MIT", + "dependencies": { + "@next/env": "14.2.4", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, + "devDependencies": { + "@ampproject/toolbox-optimizer": "2.8.3", + "@babel/code-frame": "7.22.5", + "@babel/core": "7.22.5", + "@babel/eslint-parser": "7.22.5", + "@babel/generator": "7.22.5", + "@babel/plugin-proposal-class-properties": "7.18.6", + "@babel/plugin-proposal-export-namespace-from": "7.18.9", + "@babel/plugin-proposal-numeric-separator": "7.18.6", + "@babel/plugin-proposal-object-rest-spread": "7.20.7", + "@babel/plugin-syntax-bigint": "7.8.3", + "@babel/plugin-syntax-dynamic-import": "7.8.3", + "@babel/plugin-syntax-import-assertions": "7.22.5", + "@babel/plugin-syntax-jsx": "7.22.5", + "@babel/plugin-transform-modules-commonjs": "7.22.5", + "@babel/plugin-transform-runtime": "7.22.5", + "@babel/preset-env": "7.22.5", + "@babel/preset-react": "7.22.5", + "@babel/preset-typescript": "7.22.5", + "@babel/runtime": "7.22.5", + "@babel/traverse": "7.22.5", + "@babel/types": "7.22.5", + "@capsizecss/metrics": "2.2.0", + "@edge-runtime/cookies": "4.1.1", + "@edge-runtime/ponyfill": "2.4.2", + "@edge-runtime/primitives": "4.1.0", + "@hapi/accept": "5.0.2", + "@jest/transform": "29.5.0", + "@jest/types": "29.5.0", + "@mswjs/interceptors": "0.23.0", + "@napi-rs/triples": "1.2.0", + "@next/polyfill-module": "14.2.4", + "@next/polyfill-nomodule": "14.2.4", + "@next/react-refresh-utils": "14.2.4", + "@next/swc": "14.2.4", + "@opentelemetry/api": "1.6.0", + "@playwright/test": "1.41.2", + "@taskr/clear": "1.1.0", + "@taskr/esnext": "1.1.0", + "@types/amphtml-validator": "1.0.0", + "@types/babel__code-frame": "7.0.2", + "@types/babel__core": "7.1.12", + "@types/babel__generator": "7.6.2", + "@types/babel__template": "7.4.0", + "@types/babel__traverse": "7.11.0", + "@types/bytes": "3.1.1", + "@types/ci-info": "2.0.0", + "@types/compression": "0.0.36", + "@types/content-disposition": "0.5.4", + "@types/content-type": "1.1.3", + "@types/cookie": "0.3.3", + "@types/cross-spawn": "6.0.0", + "@types/debug": "4.1.5", + "@types/express-serve-static-core": "4.17.33", + "@types/fresh": "0.5.0", + "@types/glob": "7.1.1", + "@types/graceful-fs": "4.1.9", + "@types/jsonwebtoken": "9.0.0", + "@types/lodash": "4.14.198", + "@types/lodash.curry": "4.1.6", + "@types/lru-cache": "5.1.0", + "@types/path-to-regexp": "1.7.0", + "@types/picomatch": "2.3.3", + "@types/platform": "1.3.4", + "@types/react": "18.2.37", + "@types/react-dom": "18.2.15", + "@types/react-is": "17.0.3", + "@types/semver": "7.3.1", + "@types/send": "0.14.4", + "@types/shell-quote": "1.7.1", + "@types/tar": "6.1.5", + "@types/text-table": "0.2.1", + "@types/ua-parser-js": "0.7.36", + "@types/uuid": "8.3.1", + "@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5", + "@types/ws": "8.2.0", + "@vercel/ncc": "0.34.0", + "@vercel/nft": "0.26.4", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240417.2", + "acorn": "8.5.0", + "amphtml-validator": "1.0.35", + "anser": "1.4.9", + "arg": "4.1.0", + "assert": "2.0.0", + "async-retry": "1.2.3", + "async-sema": "3.0.0", + "babel-plugin-transform-define": "2.0.0", + "babel-plugin-transform-react-remove-prop-types": "0.4.24", + "browserify-zlib": "0.2.0", + "browserslist": "4.22.2", + "buffer": "5.6.0", + "bytes": "3.1.1", + "ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540", + "cli-select": "1.1.2", + "client-only": "0.0.1", + "commander": "12.0.0", + "comment-json": "3.0.3", + "compression": "1.7.4", + "conf": "5.0.0", + "constants-browserify": "1.0.0", + "content-disposition": "0.5.3", + "content-type": "1.0.4", + "cookie": "0.4.1", + "cross-spawn": "7.0.3", + "crypto-browserify": "3.12.0", + "css.escape": "1.5.1", + "cssnano-preset-default": "5.2.14", + "data-uri-to-buffer": "3.0.1", + "debug": "4.1.1", + "devalue": "2.0.1", + "domain-browser": "4.19.0", + "edge-runtime": "2.5.4", + "events": "3.3.0", + "find-up": "4.1.0", + "fresh": "0.5.2", + "get-orientation": "1.1.2", + "glob": "7.1.7", + "gzip-size": "5.1.1", + "http-proxy": "1.18.1", + "http-proxy-agent": "5.0.0", + "https-browserify": "1.0.0", + "https-proxy-agent": "5.0.1", + "icss-utils": "5.1.0", + "ignore-loader": "0.1.2", + "image-size": "1.0.0", + "is-docker": "2.0.0", + "is-wsl": "2.2.0", + "jest-worker": "27.5.1", + "json5": "2.2.3", + "jsonwebtoken": "9.0.0", + "loader-runner": "4.3.0", + "loader-utils2": "npm:loader-utils@2.0.0", + "loader-utils3": "npm:loader-utils@3.1.3", + "lodash.curry": "4.1.1", + "lru-cache": "5.1.1", + "mini-css-extract-plugin": "2.4.4", + "msw": "1.3.0", + "nanoid": "3.1.32", + "native-url": "0.3.4", + "neo-async": "2.6.1", + "node-html-parser": "5.3.3", + "ora": "4.0.4", + "os-browserify": "0.3.0", + "p-limit": "3.1.0", + "path-browserify": "1.0.1", + "path-to-regexp": "6.1.0", + "picomatch": "4.0.1", + "platform": "1.3.6", + "postcss-flexbugs-fixes": "5.0.2", + "postcss-modules-extract-imports": "3.0.0", + "postcss-modules-local-by-default": "4.0.4", + "postcss-modules-scope": "3.0.0", + "postcss-modules-values": "4.0.0", + "postcss-preset-env": "7.4.3", + "postcss-safe-parser": "6.0.0", + "postcss-scss": "4.0.3", + "postcss-value-parser": "4.2.0", + "process": "0.11.10", + "punycode": "2.1.1", + "querystring-es3": "0.2.1", + "raw-body": "2.4.1", + "react-is": "18.2.0", + "react-refresh": "0.12.0", + "regenerator-runtime": "0.13.4", + "sass-loader": "12.4.0", + "schema-utils2": "npm:schema-utils@2.7.1", + "schema-utils3": "npm:schema-utils@3.0.0", + "semver": "7.3.2", + "send": "0.17.1", + "server-only": "0.0.1", + "setimmediate": "1.0.5", + "shell-quote": "1.7.3", + "source-map": "0.6.1", + "source-map08": "npm:source-map@0.8.0-beta.0", + "stacktrace-parser": "0.1.10", + "stream-browserify": "3.0.0", + "stream-http": "3.1.1", + "strict-event-emitter": "0.5.0", + "string_decoder": "1.3.0", + "string-hash": "1.1.3", + "strip-ansi": "6.0.0", + "superstruct": "1.0.3", + "tar": "6.1.15", + "taskr": "1.1.0", + "terser": "5.27.0", + "terser-webpack-plugin": "5.3.9", + "text-table": "0.2.0", + "timers-browserify": "2.0.12", + "tty-browserify": "0.0.1", + "ua-parser-js": "1.0.35", + "unistore": "3.4.1", + "util": "0.12.4", + "uuid": "8.3.2", + "vm-browserify": "1.1.2", + "watchpack": "2.4.0", + "web-vitals": "3.0.0", + "webpack": "5.90.0", + "webpack-sources1": "npm:webpack-sources@1.4.3", + "webpack-sources3": "npm:webpack-sources@3.2.3", + "ws": "8.2.3", + "zod": "3.22.3" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.4", + "@next/swc-darwin-x64": "14.2.4", + "@next/swc-linux-arm64-gnu": "14.2.4", + "@next/swc-linux-arm64-musl": "14.2.4", + "@next/swc-linux-x64-gnu": "14.2.4", + "@next/swc-linux-x64-musl": "14.2.4", + "@next/swc-win32-arm64-msvc": "14.2.4", + "@next/swc-win32-ia32-msvc": "14.2.4", + "@next/swc-win32-x64-msvc": "14.2.4" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "../../node_modules/.pnpm/postcss@8.4.38/node_modules/postcss": { + "version": "8.4.38", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "../../node_modules/.pnpm/prettier@3.2.5/node_modules/prettier": { + "version": "3.2.5", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "../../node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + }, + "devDependencies": { + "phantomjs": "^1.9.9", + "standard": "^10.0.2", + "tap-spec": "^2.1.2", + "tape": "^4.6.3", + "zuul": "^3.7.2" + } + }, + "../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom": { + "version": "18.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "../../node_modules/.pnpm/react@18.3.1/node_modules/react": { + "version": "18.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../../node_modules/.pnpm/rollup-plugin-dts@6.1.0_rollup@4.17.2_typescript@5.1.6/node_modules/rollup-plugin-dts": { + "version": "6.1.0", + "dev": true, + "license": "LGPL-3.0", + "dependencies": { + "magic-string": "^0.30.4" + }, + "devDependencies": { + "@babel/code-frame": "^7.22.13", + "@types/babel__code-frame": "^7.0.4", + "@types/d3-drag": "^3.0.4", + "@types/estree": "1.0.2", + "@types/node": "^20.8.0", + "@types/react": "^18.2.24", + "c8": "^8.0.1", + "rollup": "^4.0.1", + "typescript": "5.2.2" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.22.13" + }, + "peerDependencies": { + "rollup": "^3.29.4 || ^4", + "typescript": "^4.5 || ^5.0" + } + }, + "../../node_modules/.pnpm/rollup-plugin-polyfill-node@0.13.0_rollup@4.17.2/node_modules/rollup-plugin-polyfill-node": { + "version": "0.13.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/plugin-inject": "^5.0.4" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^25.0.5", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.3", + "browserify-fs": "^1.0.0", + "buffer-es6": "^4.9.3", + "crypto-browserify": "^3.11.0", + "debug": "^4.1.1", + "glob": "^7.1.6", + "mocha": "^10.2.0", + "np": "^8.0.4", + "process-es6": "^0.11.6", + "rollup": "^4.0.2", + "serve": "^11.3.2", + "typescript": "^5.2.2" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" + } + }, + "../../node_modules/.pnpm/rollup-plugin-styles@4.0.0_rollup@4.17.2/node_modules/rollup-plugin-styles": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^4.1.2", + "@types/cssnano": "^5.0.0", + "cosmiconfig": "^7.0.1", + "cssnano": "^5.0.15", + "fs-extra": "^10.0.0", + "icss-utils": "^5.1.0", + "mime-types": "^2.1.34", + "p-queue": "^6.6.2", + "postcss": "^8.4.5", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.0", + "postcss-modules-scope": "^3.0.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "query-string": "^7.1.0", + "resolve": "^1.21.0", + "source-map-js": "^1.0.1", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@babel/core": "^7.16.7", + "@babel/plugin-proposal-class-properties": "^7.16.7", + "@babel/preset-env": "^7.16.8", + "@commitlint/cli": "^16.0.2", + "@commitlint/config-angular": "^16.0.0", + "@commitlint/prompt-cli": "^16.0.0", + "@rollup/plugin-babel": "^5.3.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "@rollup/plugin-replace": "^3.0.1", + "@rollup/plugin-typescript": "^8.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/git": "^10.0.1", + "@types/fs-extra": "^9.0.13", + "@types/jest": "^27.4.0", + "@types/mime-types": "^2.1.1", + "@types/node": "*", + "@types/resolve": "^1.20.1", + "@types/uglifycss": "^0.0.7", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", + "autoprefixer": "^10.4.2", + "babel-jest": "^27.4.6", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-jest": "^25.3.4", + "eslint-plugin-unicorn": "^40.0.0", + "gh-pages": "^3.2.3", + "husky": "^7.0.4", + "jest": "^27.4.7", + "less": "^4.1.2", + "lint-staged": "^12.1.7", + "minireset.css": "^0.0.7", + "node-sass": "^7.0.1", + "postcss-custom-properties": "^12.1.2", + "prettier": "^2.5.1", + "rollup": "^2.63.0", + "rollup-plugin-dts": "^4.1.0", + "rollup-plugin-lit-css": "^3.2.1", + "rollup-plugin-node-externals": "^3.1.2", + "rollup-plugin-terser": "^7.0.2", + "sass": "^1.48.0", + "semantic-release": "^18.0.1", + "shx": "^0.3.4", + "stylus": "^0.56.0", + "sugarss": "^4.0.1", + "ts-jest": "^27.1.2", + "typedoc": "^0.22.10", + "typedoc-plugin-missing-exports": "^0.22.6", + "typescript": "^4.5.4" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "rollup": "^2.63.0" + } + }, + "../../node_modules/.pnpm/rollup@4.17.2/node_modules/rollup": { + "version": "4.17.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "devDependencies": { + "@codemirror/commands": "^6.5.0", + "@codemirror/lang-javascript": "^6.2.2", + "@codemirror/language": "^6.10.1", + "@codemirror/search": "^6.5.6", + "@codemirror/state": "^6.4.1", + "@codemirror/view": "^6.26.3", + "@jridgewell/sourcemap-codec": "^1.4.15", + "@mermaid-js/mermaid-cli": "^10.8.0", + "@napi-rs/cli": "^2.18.2", + "@rollup/plugin-alias": "^5.1.0", + "@rollup/plugin-buble": "^1.0.3", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.5", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.6", + "@rollup/pluginutils": "^5.1.0", + "@shikijs/vitepress-twoslash": "^1.3.0", + "@types/eslint": "^8.56.10", + "@types/inquirer": "^9.0.7", + "@types/mocha": "^10.0.6", + "@types/node": "~18.18.14", + "@types/yargs-parser": "^21.0.3", + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/parser": "^7.7.1", + "@vue/eslint-config-prettier": "^9.0.0", + "@vue/eslint-config-typescript": "^13.0.0", + "acorn": "^8.11.3", + "acorn-import-assertions": "^1.9.0", + "buble": "^0.20.0", + "builtin-modules": "^3.3.0", + "chokidar": "^3.6.0", + "colorette": "^2.0.20", + "concurrently": "^8.2.2", + "core-js": "3.36.0", + "cross-env": "^7.0.3", + "date-time": "^4.0.0", + "es5-shim": "^4.6.7", + "es6-shim": "^0.35.8", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-unicorn": "^52.0.0", + "eslint-plugin-vue": "^9.25.0", + "fixturify": "^3.0.0", + "flru": "^1.0.2", + "fs-extra": "^11.2.0", + "github-api": "^3.4.0", + "husky": "^9.0.11", + "inquirer": "^9.2.19", + "is-reference": "^3.0.2", + "lint-staged": "^15.2.2", + "locate-character": "^3.0.0", + "magic-string": "^0.30.10", + "mocha": "^10.4.0", + "nyc": "^15.1.0", + "pinia": "^2.1.7", + "prettier": "^3.2.5", + "pretty-bytes": "^6.1.1", + "pretty-ms": "^9.0.0", + "requirejs": "^2.3.6", + "rollup": "^4.16.3", + "rollup-plugin-license": "^3.3.1", + "rollup-plugin-string": "^3.0.0", + "semver": "^7.6.0", + "shx": "^0.3.4", + "signal-exit": "^4.1.0", + "source-map": "^0.7.4", + "source-map-support": "^0.5.21", + "systemjs": "^6.14.3", + "terser": "^5.30.4", + "tslib": "^2.6.2", + "typescript": "^5.4.5", + "vite": "^5.2.10", + "vitepress": "^1.1.3", + "vue": "^3.4.24", + "wasm-pack": "^0.12.1", + "weak-napi": "^2.0.2", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.17.2", + "@rollup/rollup-android-arm64": "4.17.2", + "@rollup/rollup-darwin-arm64": "4.17.2", + "@rollup/rollup-darwin-x64": "4.17.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.17.2", + "@rollup/rollup-linux-arm-musleabihf": "4.17.2", + "@rollup/rollup-linux-arm64-gnu": "4.17.2", + "@rollup/rollup-linux-arm64-musl": "4.17.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2", + "@rollup/rollup-linux-riscv64-gnu": "4.17.2", + "@rollup/rollup-linux-s390x-gnu": "4.17.2", + "@rollup/rollup-linux-x64-gnu": "4.17.2", + "@rollup/rollup-linux-x64-musl": "4.17.2", + "@rollup/rollup-win32-arm64-msvc": "4.17.2", + "@rollup/rollup-win32-ia32-msvc": "4.17.2", + "@rollup/rollup-win32-x64-msvc": "4.17.2", + "fsevents": "~2.3.2" + } + }, + "../../node_modules/.pnpm/sass@1.76.0/node_modules/sass": { + "version": "1.76.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../../node_modules/.pnpm/stylelint@15.1.0_typescript@5.1.6/node_modules/stylelint": { + "version": "15.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-parser-algorithms": "^2.0.1", + "@csstools/css-tokenizer": "^2.0.1", + "@csstools/media-query-list-parser": "^2.0.1", + "@csstools/selector-specificity": "^2.1.1", + "balanced-match": "^2.0.0", + "colord": "^2.9.3", + "cosmiconfig": "^8.0.0", + "css-functions-list": "^3.1.0", + "css-tree": "^2.3.1", + "debug": "^4.3.4", + "fast-glob": "^3.2.12", + "fastest-levenshtein": "^1.0.16", + "file-entry-cache": "^6.0.1", + "global-modules": "^2.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "html-tags": "^3.2.0", + "ignore": "^5.2.4", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "is-plain-object": "^5.0.0", + "known-css-properties": "^0.26.0", + "mathml-tag-names": "^2.1.3", + "meow": "^9.0.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.21", + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.11", + "postcss-value-parser": "^4.2.0", + "resolve-from": "^5.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "style-search": "^0.1.0", + "supports-hyperlinks": "^2.3.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "v8-compile-cache": "^2.3.0", + "write-file-atomic": "^5.0.0" + }, + "bin": { + "stylelint": "bin/stylelint.js" + }, + "devDependencies": { + "@changesets/cli": "^2.26.0", + "@changesets/get-github-info": "^0.5.2", + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "@types/balanced-match": "^1.0.2", + "@types/css-tree": "^2.0.1", + "@types/debug": "^4.1.7", + "@types/file-entry-cache": "^5.0.2", + "@types/global-modules": "^2.0.0", + "@types/globjoin": "^0.1.0", + "@types/imurmurhash": "^0.1.1", + "@types/micromatch": "^4.0.2", + "@types/normalize-path": "^3.0.0", + "@types/postcss-less": "^4.0.2", + "@types/postcss-safe-parser": "^5.0.1", + "@types/style-search": "^0.1.3", + "@types/svg-tags": "^1.0.0", + "@types/write-file-atomic": "^4.0.0", + "benchmark": "^2.1.4", + "common-tags": "^1.8.2", + "deepmerge": "^4.3.0", + "eslint": "^8.33.0", + "eslint-config-stylelint": "^17.1.0", + "husky": "^8.0.3", + "jest": "^29.4.1", + "jest-preset-stylelint": "^6.0.0", + "jest-watch-typeahead": "^2.2.2", + "lint-staged": "^13.1.0", + "node-fetch": "^3.3.0", + "np": "^7.6.3", + "npm-run-all": "^4.1.5", + "patch-package": "^6.5.1", + "postcss-html": "^1.5.0", + "postcss-import": "^15.1.0", + "postcss-less": "^6.0.0", + "postcss-sass": "^0.5.0", + "postcss-scss": "^4.0.6", + "remark-cli": "^11.0.0", + "sugarss": "^4.0.1", + "typescript": "^4.9.5" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + } + }, + "../../node_modules/.pnpm/tailwindcss@3.4.7/node_modules/tailwindcss": { + "version": "3.4.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.0", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "devDependencies": { + "@swc/cli": "^0.1.62", + "@swc/core": "^1.3.55", + "@swc/jest": "^0.2.26", + "@swc/register": "^0.1.10", + "autoprefixer": "^10.4.14", + "browserslist": "^4.21.5", + "concurrently": "^8.0.1", + "cssnano": "^6.0.0", + "esbuild": "^0.20.2", + "eslint": "^8.39.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "jest": "^29.6.0", + "jest-diff": "^29.6.0", + "lightningcss": "1.24.1", + "prettier": "^2.8.8", + "rimraf": "^5.0.0", + "source-map-js": "^1.0.2", + "turbo": "^1.9.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib": { + "version": "2.6.2", + "dev": true, + "license": "0BSD" + }, + "../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript": { + "version": "5.1.6", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "devDependencies": { + "@esfx/canceltoken": "^1.0.0", + "@octokit/rest": "latest", + "@types/chai": "^4.3.4", + "@types/fs-extra": "^9.0.13", + "@types/glob": "^8.1.0", + "@types/microsoft__typescript-etw": "^0.1.1", + "@types/minimist": "^1.2.2", + "@types/mocha": "^10.0.1", + "@types/ms": "^0.7.31", + "@types/node": "latest", + "@types/source-map-support": "^0.5.6", + "@types/which": "^2.0.1", + "@typescript-eslint/eslint-plugin": "^5.33.1", + "@typescript-eslint/parser": "^5.33.1", + "@typescript-eslint/utils": "^5.33.1", + "azure-devops-node-api": "^12.0.0", + "chai": "^4.3.7", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "del": "^6.1.1", + "diff": "^5.1.0", + "esbuild": "^0.17.2", + "eslint": "^8.22.0", + "eslint-formatter-autolinkable-stylish": "^1.2.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-local": "^1.0.0", + "eslint-plugin-no-null": "^1.0.2", + "eslint-plugin-simple-import-sort": "^10.0.0", + "fast-xml-parser": "^4.0.11", + "fs-extra": "^9.1.0", + "glob": "^8.1.0", + "hereby": "^1.6.4", + "jsonc-parser": "^3.2.0", + "minimist": "^1.2.8", + "mocha": "^10.2.0", + "mocha-fivemat-progress-reporter": "^0.1.0", + "ms": "^2.1.3", + "node-fetch": "^3.2.10", + "source-map-support": "^0.5.21", + "tslib": "^2.5.0", + "typescript": "^5.0.2", + "which": "^2.0.2" + }, + "engines": { + "node": ">=14.17" + } + }, + "../../node_modules/.pnpm/typescript@5.4.5/node_modules/typescript": { + "version": "5.4.5", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "devDependencies": { + "@esfx/canceltoken": "^1.0.0", + "@octokit/rest": "^20.0.2", + "@types/chai": "^4.3.11", + "@types/glob": "^8.1.0", + "@types/microsoft__typescript-etw": "^0.1.3", + "@types/minimist": "^1.2.5", + "@types/mocha": "^10.0.6", + "@types/ms": "^0.7.34", + "@types/node": "latest", + "@types/source-map-support": "^0.5.10", + "@types/which": "^3.0.3", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", + "@typescript-eslint/utils": "^6.19.0", + "azure-devops-node-api": "^12.3.0", + "c8": "^9.1.0", + "chai": "^4.4.1", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "diff": "^5.1.0", + "dprint": "^0.45.0", + "esbuild": "^0.20.0", + "eslint": "^8.56.0", + "eslint-formatter-autolinkable-stylish": "^1.3.0", + "eslint-plugin-local": "^3.1.0", + "eslint-plugin-no-null": "^1.0.2", + "eslint-plugin-simple-import-sort": "^10.0.0", + "fast-xml-parser": "^4.3.3", + "glob": "^10.3.10", + "hereby": "^1.8.9", + "jsonc-parser": "^3.2.0", + "minimist": "^1.2.8", + "mocha": "^10.2.0", + "mocha-fivemat-progress-reporter": "^0.1.0", + "ms": "^2.1.3", + "node-fetch": "^3.3.2", + "playwright": "^1.41.0", + "source-map-support": "^0.5.21", + "tslib": "^2.6.2", + "typescript": "5.4.0-dev.20240119", + "which": "^3.0.1" + }, + "engines": { + "node": ">=14.17" + } + }, + "../../packages/react": { + "name": "@asgardeo/react", + "version": "0.5.3", + "license": "Apache-2.0", + "dependencies": { + "@asgardeo/js": "*", + "@oxygen-ui/react": "^1.11.0", + "base64url": "^3.0.1", + "buffer": "^6.0.3", + "clsx": "^2.1.1", + "fast-sha256": "^1.3.0", + "jose": "^5.3.0", + "randombytes": "^2.1.0" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-image": "^3.0.3", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@types/node": "^20.12.7", + "@types/randombytes": "^2.0.3", + "@types/react": "^18.2.79", + "@types/react-dom": "^18.2.25", + "@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?fa0b844715320a3953d6d055997c0770f8695082", + "@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?fa0b844715320a3953d6d055997c0770f8695082", + "@wso2/stylelint-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/stylelint-config?fa0b844715320a3953d6d055997c0770f8695082", + "eslint": "~8.57.0", + "prettier": "^3.2.5", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "rollup": "^4.17.2", + "rollup-plugin-dts": "^6.1.0", + "rollup-plugin-polyfill-node": "^0.13.0", + "rollup-plugin-styles": "^4.0.0", + "sass": "^1.75.0", + "stylelint": "15.1.0", + "tslib": "^2.6.2", + "typescript": "5.1.6" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "../../packages/react/node_modules/@asgardeo/js": { + "resolved": "../../node_modules/.pnpm/@asgardeo+js@0.1.2/node_modules/@asgardeo/js", + "link": true + }, + "../../packages/react/node_modules/@oxygen-ui/react": { + "resolved": "../../node_modules/.pnpm/@oxygen-ui+react@1.11.0_@emotion+react@11.11.4_@types+react@18.3.1_react@18.3.1__@emotion+sty_4z44ukeectednlm54aihjiybjq/node_modules/@oxygen-ui/react", + "link": true + }, + "../../packages/react/node_modules/@rollup/plugin-commonjs": { + "resolved": "../../node_modules/.pnpm/@rollup+plugin-commonjs@25.0.7_rollup@4.17.2/node_modules/@rollup/plugin-commonjs", + "link": true + }, + "../../packages/react/node_modules/@rollup/plugin-image": { + "resolved": "../../node_modules/.pnpm/@rollup+plugin-image@3.0.3_rollup@4.17.2/node_modules/@rollup/plugin-image", + "link": true + }, + "../../packages/react/node_modules/@rollup/plugin-node-resolve": { + "resolved": "../../node_modules/.pnpm/@rollup+plugin-node-resolve@15.2.3_rollup@4.17.2/node_modules/@rollup/plugin-node-resolve", + "link": true + }, + "../../packages/react/node_modules/@rollup/plugin-typescript": { + "resolved": "../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.17.2_tslib@2.6.2_typescript@5.1.6/node_modules/@rollup/plugin-typescript", + "link": true + }, + "../../packages/react/node_modules/@types/node": { + "resolved": "../../node_modules/.pnpm/@types+node@20.12.7/node_modules/@types/node", + "link": true + }, + "../../packages/react/node_modules/@types/randombytes": { + "resolved": "../../node_modules/.pnpm/@types+randombytes@2.0.3/node_modules/@types/randombytes", + "link": true + }, + "../../packages/react/node_modules/@types/react": { + "resolved": "../../node_modules/.pnpm/@types+react@18.3.1/node_modules/@types/react", + "link": true + }, + "../../packages/react/node_modules/@types/react-dom": { + "resolved": "../../node_modules/.pnpm/@types+react-dom@18.3.0/node_modules/@types/react-dom", + "link": true + }, + "../../packages/react/node_modules/@wso2/eslint-plugin": { + "resolved": "../../node_modules/.pnpm/@wso2+eslint-plugin@https+++gitpkg.now.sh+brionmario+wso2-ui-configs+packages+eslint-plugin+f_xnwx2k4zkb2iqrwo6rpordvjg4/node_modules/@wso2/eslint-plugin", + "link": true + }, + "../../packages/react/node_modules/@wso2/prettier-config": { + "resolved": "../../node_modules/.pnpm/@wso2+prettier-config@https+++gitpkg.now.sh+brionmario+wso2-ui-configs+packages+prettier-conf_qukeol4brtckymlxjv7eysclka/node_modules/@wso2/prettier-config", + "link": true + }, + "../../packages/react/node_modules/@wso2/stylelint-config": { + "resolved": "../../node_modules/.pnpm/@wso2+stylelint-config@https+++gitpkg.now.sh+brionmario+wso2-ui-configs+packages+stylelint-co_zm6ypzmckvyqp3lii63k2f3sku/node_modules/@wso2/stylelint-config", + "link": true + }, + "../../packages/react/node_modules/base64url": { + "resolved": "../../node_modules/.pnpm/base64url@3.0.1/node_modules/base64url", + "link": true + }, + "../../packages/react/node_modules/buffer": { + "resolved": "../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer", + "link": true + }, + "../../packages/react/node_modules/clsx": { + "resolved": "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx", + "link": true + }, + "../../packages/react/node_modules/eslint": { + "resolved": "../../node_modules/.pnpm/eslint@8.57.0/node_modules/eslint", + "link": true + }, + "../../packages/react/node_modules/fast-sha256": { + "resolved": "../../node_modules/.pnpm/fast-sha256@1.3.0/node_modules/fast-sha256", + "link": true + }, + "../../packages/react/node_modules/jose": { + "resolved": "../../node_modules/.pnpm/jose@5.3.0/node_modules/jose", + "link": true + }, + "../../packages/react/node_modules/prettier": { + "resolved": "../../node_modules/.pnpm/prettier@3.2.5/node_modules/prettier", + "link": true + }, + "../../packages/react/node_modules/randombytes": { + "resolved": "../../node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes", + "link": true + }, + "../../packages/react/node_modules/react": { + "resolved": "../../node_modules/.pnpm/react@18.3.1/node_modules/react", + "link": true + }, + "../../packages/react/node_modules/react-dom": { + "resolved": "../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom", + "link": true + }, + "../../packages/react/node_modules/rollup": { + "resolved": "../../node_modules/.pnpm/rollup@4.17.2/node_modules/rollup", + "link": true + }, + "../../packages/react/node_modules/rollup-plugin-dts": { + "resolved": "../../node_modules/.pnpm/rollup-plugin-dts@6.1.0_rollup@4.17.2_typescript@5.1.6/node_modules/rollup-plugin-dts", + "link": true + }, + "../../packages/react/node_modules/rollup-plugin-polyfill-node": { + "resolved": "../../node_modules/.pnpm/rollup-plugin-polyfill-node@0.13.0_rollup@4.17.2/node_modules/rollup-plugin-polyfill-node", + "link": true + }, + "../../packages/react/node_modules/rollup-plugin-styles": { + "resolved": "../../node_modules/.pnpm/rollup-plugin-styles@4.0.0_rollup@4.17.2/node_modules/rollup-plugin-styles", + "link": true + }, + "../../packages/react/node_modules/sass": { + "resolved": "../../node_modules/.pnpm/sass@1.76.0/node_modules/sass", + "link": true + }, + "../../packages/react/node_modules/stylelint": { + "resolved": "../../node_modules/.pnpm/stylelint@15.1.0_typescript@5.1.6/node_modules/stylelint", + "link": true + }, + "../../packages/react/node_modules/tslib": { + "resolved": "../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib", + "link": true + }, + "../../packages/react/node_modules/typescript": { + "resolved": "../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript", + "link": true + }, + "node_modules/@asgardeo/auth-js": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@asgardeo/auth-js/-/auth-js-5.1.0.tgz", + "integrity": "sha512-o+bo3r9RDo97CqEAFpneYIGdulBRUbdjR6QhZgF89zy3rnss1U1MA2v2heMwXKNbMfvbZCBiBDq2yhUcAk9SIA==" + }, + "node_modules/@asgardeo/js": { + "resolved": "../../node_modules/.pnpm/@asgardeo+js@0.1.2/node_modules/@asgardeo/js", + "link": true + }, + "node_modules/@asgardeo/react": { + "resolved": "../../packages/react", + "link": true + }, + "node_modules/@types/node": { + "resolved": "../../node_modules/.pnpm/@types+node@20.12.7/node_modules/@types/node", + "link": true + }, + "node_modules/@types/react": { + "resolved": "../../node_modules/.pnpm/@types+react@18.3.1/node_modules/@types/react", + "link": true + }, + "node_modules/@types/react-dom": { + "resolved": "../../node_modules/.pnpm/@types+react-dom@18.3.0/node_modules/@types/react-dom", + "link": true + }, + "node_modules/axios": { + "resolved": "../../node_modules/.pnpm/axios@1.7.2/node_modules/axios", + "link": true + }, + "node_modules/eslint": { + "resolved": "../../node_modules/.pnpm/eslint@8.57.0/node_modules/eslint", + "link": true + }, + "node_modules/eslint-config-next": { + "resolved": "../../node_modules/.pnpm/eslint-config-next@14.2.4_eslint@8.57.0_typescript@5.4.5/node_modules/eslint-config-next", + "link": true + }, + "node_modules/memory-cache": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz", + "integrity": "sha512-OcjA+jzjOYzKmKS6IQVALHLVz+rNTMPoJvCztFaZxwG14wtAW7VRZjwTQu06vKCYOxh4jVnik7ya0SXTB0W+xA==" + }, + "node_modules/next": { + "resolved": "../../node_modules/.pnpm/next@14.2.4_@babel+core@7.24.4_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.76.0/node_modules/next", + "link": true + }, + "node_modules/postcss": { + "resolved": "../../node_modules/.pnpm/postcss@8.4.38/node_modules/postcss", + "link": true + }, + "node_modules/prettier": { + "resolved": "../../node_modules/.pnpm/prettier@3.2.5/node_modules/prettier", + "link": true + }, + "node_modules/react": { + "resolved": "../../node_modules/.pnpm/react@18.3.1/node_modules/react", + "link": true + }, + "node_modules/react-dom": { + "resolved": "../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom", + "link": true + }, + "node_modules/tailwindcss": { + "resolved": "../../node_modules/.pnpm/tailwindcss@3.4.7/node_modules/tailwindcss", + "link": true + }, + "node_modules/typescript": { + "resolved": "../../node_modules/.pnpm/typescript@5.4.5/node_modules/typescript", + "link": true + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.4.tgz", + "integrity": "sha512-AH3mO4JlFUqsYcwFUHb1wAKlebHU/Hv2u2kb1pAuRanDZ7pD/A/KPD98RHZmwsJpdHQwfEc/06mgpSzwrJYnNg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.4.tgz", + "integrity": "sha512-QVadW73sWIO6E2VroyUjuAxhWLZWEpiFqHdZdoQ/AMpN9YWGuHV8t2rChr0ahy+irKX5mlDU7OY68k3n4tAZTg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.4.tgz", + "integrity": "sha512-KT6GUrb3oyCfcfJ+WliXuJnD6pCpZiosx2X3k66HLR+DMoilRb76LpWPGb4tZprawTtcnyrv75ElD6VncVamUQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.4.tgz", + "integrity": "sha512-Alv8/XGSs/ytwQcbCHwze1HmiIkIVhDHYLjczSVrf0Wi2MvKn/blt7+S6FJitj3yTlMwMxII1gIJ9WepI4aZ/A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.4.tgz", + "integrity": "sha512-ze0ShQDBPCqxLImzw4sCdfnB3lRmN3qGMB2GWDRlq5Wqy4G36pxtNOo2usu/Nm9+V2Rh/QQnrRc2l94kYFXO6Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.4.tgz", + "integrity": "sha512-8dwC0UJoc6fC7PX70csdaznVMNr16hQrTDAMPvLPloazlcaWfdPogq+UpZX6Drqb1OBlwowz8iG7WR0Tzk/diQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.4.tgz", + "integrity": "sha512-jxyg67NbEWkDyvM+O8UDbPAyYRZqGLQDTPwvrBBeOSyVWW/jFQkQKQ70JDqDSYg1ZDdl+E3nkbFbq8xM8E9x8A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.4.tgz", + "integrity": "sha512-twrmN753hjXRdcrZmZttb/m5xaCBFa48Dt3FbeEItpJArxriYDunWxJn+QFXdJ3hPkm4u7CKxncVvnmgQMY1ag==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.4.tgz", + "integrity": "sha512-tkLrjBzqFTP8DVrAAQmZelEahfR9OxWpFR++vAI9FBhCiIxtwHwBHC23SBHCTURBtwB4kc/x44imVOnkKGNVGg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + } + } +} diff --git a/recipes/next-app-page-router/package.json b/recipes/next-app-page-router/package.json new file mode 100644 index 0000000..0d0e7f5 --- /dev/null +++ b/recipes/next-app-page-router/package.json @@ -0,0 +1,34 @@ +{ + "name": "next-app-page-router", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@asgardeo/auth-js": "^5.0.1", + "@asgardeo/js": "*", + "@asgardeo/react": "*", + "axios": "^1.7.2", + "memory-cache": "^0.2.0", + "next": "14.2.4", + "prettier": "^3.2.5", + "react": "^18", + "react-dom": "^18" + }, + "devDependencies": { + "@types/memory-cache": "^0.2.6", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "eslint": "^8", + "eslint-config-next": "14.2.4", + "postcss": "^8", + "tailwindcss": "^3.4.1", + "typescript": "^5" + } +} diff --git a/recipes/next-app-page-router/pages/AsgardeoNextProvider.tsx b/recipes/next-app-page-router/pages/AsgardeoNextProvider.tsx new file mode 100644 index 0000000..a44714a --- /dev/null +++ b/recipes/next-app-page-router/pages/AsgardeoNextProvider.tsx @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, {ReactNode, useEffect, useState} from 'react'; +import {AsgardeoProvider as AsgardeoAuthProvider, UIAuthConfig} from '@asgardeo/react'; + +interface AsgardeoNextProviderProps { + children: ReactNode; + clientSecret: string; +} + +const AsgardeoNextProvider: React.FC = ({children, clientSecret}) => { + const [isClient, setIsClient] = useState(false); + + useEffect(() => { + setIsClient(true); + }, []); + + if (!isClient) { + return null; + } + + const AuthConfig: UIAuthConfig = { + signInRedirectURL: process.env.NEXT_PUBLIC_SIGN_IN_REDIRECT_URL || '', + signOutRedirectURL: process.env.NEXT_PUBLIC_SIGN_OUT_REDIRECT_URL || '', + clientID: process.env.NEXT_PUBLIC_ASGARDEO_CLIENT_ID || '', + clientSecret: '*****', + baseUrl: process.env.NEXT_PUBLIC_ASGARDEO_BASE_URL || '', + scope: ['openid', 'internal_login', 'profile'], + }; + + return {children}; +}; + +export default AsgardeoNextProvider; diff --git a/recipes/next-app-page-router/pages/_app.tsx b/recipes/next-app-page-router/pages/_app.tsx new file mode 100644 index 0000000..0b342f6 --- /dev/null +++ b/recipes/next-app-page-router/pages/_app.tsx @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import '@/styles/globals.css'; +import type {AppProps} from 'next/app'; +import AsgardeoNextProvider from './AsgardeoNextProvider'; + +export default function App({Component, pageProps}: AppProps) { + return ( + + + + ); +} diff --git a/recipes/next-app-page-router/pages/_document.tsx b/recipes/next-app-page-router/pages/_document.tsx new file mode 100644 index 0000000..2b25a3d --- /dev/null +++ b/recipes/next-app-page-router/pages/_document.tsx @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {Html, Head, Main, NextScript} from 'next/document'; + +export default function Document() { + return ( + + + +
+ + + + ); +} diff --git a/recipes/next-app-page-router/pages/api/auth.ts b/recipes/next-app-page-router/pages/api/auth.ts new file mode 100644 index 0000000..50deff6 --- /dev/null +++ b/recipes/next-app-page-router/pages/api/auth.ts @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export default async function handler(req: any, res: any) { + const {client_id, client_secret, redirect_uri, code} = req.body; + console.log('hello from api'); + + console.log(process.env.NEXT_PUBLIC_ASGARDEO_BASE_URL); + console.log(process.env.ASGARDEO_CLIENT_SECRET); + + const tokenEndpoint = `https://api.asgardeo.io/t/websdk/oauth2/token`; + const params = new URLSearchParams(); + params.append('client_id', client_id); + params.append('client_secret', client_secret); + params.append('grant_type', 'authorization_code'); + params.append('redirect_uri', redirect_uri); + params.append('code', code); + + try { + const response = await fetch(tokenEndpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: params, + }); + + const data = await response.json(); + + if (response.ok) { + res.status(200).json(data); + } else { + res.status(response.status).json(data); + } + } catch (error) { + res.status(500).json({error: 'Internal Server Error'}); + } +} diff --git a/recipes/next-app-page-router/pages/api/hello.ts b/recipes/next-app-page-router/pages/api/hello.ts new file mode 100644 index 0000000..76beee7 --- /dev/null +++ b/recipes/next-app-page-router/pages/api/hello.ts @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import type {NextApiRequest, NextApiResponse} from 'next'; + +type Data = { + name: string; +}; + +export default function handler(req: NextApiRequest, res: NextApiResponse) { + res.status(200).json({name: 'John Doe'}); +} diff --git a/recipes/next-app-page-router/pages/index.tsx b/recipes/next-app-page-router/pages/index.tsx new file mode 100644 index 0000000..d78a4b7 --- /dev/null +++ b/recipes/next-app-page-router/pages/index.tsx @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {Inter} from 'next/font/google'; +import SignIn from '../components/SignIn'; +import {GetServerSideProps} from 'next'; +import {Store, AsgardeoAuthClient, CryptoUtils, DataLayer} from '@asgardeo/auth-js'; +import {SPACryptoUtils} from '@asgardeo/react'; +import { + AsgardeoUIException, + AuthApiResponse, + AuthClient, + authorize, + Branding, + BrandingProps, + getBranding, + UIAuthClient, + UIAuthConfig, +} from '@asgardeo/js'; +import {MemoryCacheStore} from '@/stores/memory-cache'; + +const inter = Inter({subsets: ['latin']}); + +interface Repo { + authRes: string; + authResponse?: AuthApiResponse | undefined; + brandingProps?: BrandingProps; +} + +const config: UIAuthConfig = { + signInRedirectURL: process.env.NEXT_PUBLIC_SIGN_IN_REDIRECT_URL || '', + signOutRedirectURL: process.env.NEXT_PUBLIC_SIGN_OUT_REDIRECT_URL || '', + clientID: process.env.NEXT_PUBLIC_ASGARDEO_CLIENT_ID || '', + clientSecret: '*****', + baseUrl: process.env.NEXT_PUBLIC_ASGARDEO_BASE_URL || '', + scope: ['openid', 'internal_login', 'profile'], +}; + +export const getServerSideProps: GetServerSideProps<{repo: Repo}> = async () => { + const clientSecret = process.env.ASGARDEO_CLIENT_SECRET || ''; + + const storeInstance: Store = new MemoryCacheStore(); + + const spaUtils: CryptoUtils = new SPACryptoUtils(); + await AuthClient.getInstance(config, storeInstance, spaUtils); + + console.log('Server-side clientSecret:', clientSecret); + + let repo: Repo = { + authRes: '', + }; + + // try { + // const brandingResponse = await getBranding({ branding: repo.brandingProps }); + // repo.brandingProps = brandingResponse; + // } catch (error) { + // console.error('Error fetching branding:', error); + // } + + try { + const authResponse = await authorize(); + repo.authResponse = authResponse; + + console.log('response'); + console.log(authResponse); + } catch (error) { + throw new AsgardeoUIException('REACT_UI-SIGN_IN-SI-SE01', 'Authorization failed'); + } + + return { + props: { + repo, + }, + }; +}; + +const Home: React.FC<{repo: Repo}> = ({repo}) => { + return ( +
+ +
+ ); +}; + +export default Home; diff --git a/recipes/next-app-page-router/public/favicon.ico b/recipes/next-app-page-router/public/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/recipes/next-app-page-router/public/favicon.ico differ diff --git a/recipes/next-app-page-router/public/next.svg b/recipes/next-app-page-router/public/next.svg new file mode 100644 index 0000000..5174b28 --- /dev/null +++ b/recipes/next-app-page-router/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/next-app-page-router/public/vercel.svg b/recipes/next-app-page-router/public/vercel.svg new file mode 100644 index 0000000..d2f8422 --- /dev/null +++ b/recipes/next-app-page-router/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/next-app-page-router/stores/global-store.ts b/recipes/next-app-page-router/stores/global-store.ts new file mode 100644 index 0000000..e8f3a47 --- /dev/null +++ b/recipes/next-app-page-router/stores/global-store.ts @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {Store} from '@asgardeo/auth-js'; + +interface GlobalStoreType { + [key: string]: string | undefined; +} + +// Initialize the global store if it doesn't exist +if (!(global as any).store) { + (global as any).store = {} as GlobalStoreType; +} + +// Type guard to cast global store +const getGlobalStore = (): GlobalStoreType => { + return (global as any).store; +}; + +export class GlobalStore implements Store { + public async setData(key: string, value: string): Promise { + const store = getGlobalStore(); + store[key] = value; + } + + public async getData(key: string): Promise { + const store = getGlobalStore(); + return store[key] || ''; + } + + public async removeData(key: string): Promise { + const store = getGlobalStore(); + delete store[key]; + } +} diff --git a/recipes/next-app-page-router/stores/memory-cache.ts b/recipes/next-app-page-router/stores/memory-cache.ts new file mode 100644 index 0000000..453e975 --- /dev/null +++ b/recipes/next-app-page-router/stores/memory-cache.ts @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {Store} from '@asgardeo/auth-js'; +import cache from 'memory-cache'; + +export class MemoryCacheStore implements Store { + public async setData(key: string, value: string): Promise { + cache.put(key, value); + } + + public async getData(key: string): Promise { + return cache.get(key) ?? '{}'; + } + + public async removeData(key: string): Promise { + cache.del(key); + } +} diff --git a/recipes/next-app-page-router/styles/globals.css b/recipes/next-app-page-router/styles/globals.css new file mode 100644 index 0000000..a0d367b --- /dev/null +++ b/recipes/next-app-page-router/styles/globals.css @@ -0,0 +1,28 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); +} + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} diff --git a/recipes/next-app-page-router/tailwind.config.ts b/recipes/next-app-page-router/tailwind.config.ts new file mode 100644 index 0000000..954ae55 --- /dev/null +++ b/recipes/next-app-page-router/tailwind.config.ts @@ -0,0 +1,19 @@ +import type {Config} from 'tailwindcss'; + +const config: Config = { + content: [ + './pages/**/*.{js,ts,jsx,tsx,mdx}', + './components/**/*.{js,ts,jsx,tsx,mdx}', + './app/**/*.{js,ts,jsx,tsx,mdx}', + ], + theme: { + extend: { + backgroundImage: { + 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', + 'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + }, + }, + }, + plugins: [], +}; +export default config; diff --git a/recipes/next-app-page-router/tsconfig.json b/recipes/next-app-page-router/tsconfig.json new file mode 100644 index 0000000..649790e --- /dev/null +++ b/recipes/next-app-page-router/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "paths": { + "@/*": ["./*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +}