diff --git a/.prettierrc.js b/.prettierrc.js index cc01e16fb7..758bcc6421 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -11,13 +11,5 @@ module.exports = { printWidth: 150, }, }, - { - files: "packages/core/src/**/*.ts", - excludeFiles: "packages/core/src/providers/oauth-types.ts", - options: { - plugins: ["prettier-plugin-jsdoc"], - tsdoc: true, - }, - }, ], } diff --git a/docs/docs/reference/03-react/index.md b/docs/docs/reference/03-react/index.md deleted file mode 100644 index ebc1bf2ac6..0000000000 --- a/docs/docs/reference/03-react/index.md +++ /dev/null @@ -1,237 +0,0 @@ ---- -title: React ---- - -## SessionProvider - -Using the supplied `` allows instances of `useSession()` to share the session object across components, by using [React Context](https://reactjs.org/docs/context.html) under the hood. It also takes care of keeping the session updated and synced between tabs/windows. - -```jsx title="pages/_app.js" -import { SessionProvider } from "next-auth/react" - -export default function App({ - Component, - pageProps: { session, ...pageProps }, -}) { - return ( - - - - ) -} -``` - -If you pass the `session` page prop to the `` – as in the example above – you can avoid checking the session twice on pages that support both server and client side rendering. - -This only works on pages where you provide the correct `pageProps`, however. This is normally done in `getInitialProps` or `getServerSideProps` on an individual page basis like so: - -```js title="pages/index.js" -import { unstable_getServerSession } from "next-auth/next" - -... - -export async function getServerSideProps(ctx) { - return { - props: { - session: await unstable_getServerSession(ctx) - } - } -} -``` - -If every one of your pages needs to be protected, you can do this in `getInitialProps` in `_app`, otherwise you can do it on a page-by-page basis. Alternatively, you can do per page authentication checks client side, instead of having each authentication check be blocking (SSR) by using the method described below in [alternative client session handling](/reference/utilities/#getsession). - -### Options - -The session state is automatically synchronized across all open tabs/windows and they are all updated whenever they gain or lose focus or the state changes (e.g. a user signs in or out) when `refetchOnWindowFocus` is `true`. - -If you have session expiry times of 30 days (the default) or more then you probably don't need to change any of the default options in the Provider. If you need to, you can trigger an update of the session object across all tabs/windows by calling [`getSession()`](/reference/utilities/#getsession) from a client side function. - -However, if you need to customize the session behavior and/or are using short session expiry times, you can pass options to the provider to customize the behavior of the `useSession()` hook. - -```jsx title="pages/_app.js" -import { SessionProvider } from "next-auth/react" - -export default function App({ - Component, - pageProps: { session, ...pageProps }, -}) { - return ( - - - - ) -} -``` - -:::note -**These options have no effect on clients that are not signed in.** - -Every tab/window maintains its own copy of the local session state; the session is not stored in shared storage like localStorage or sessionStorage. Any update in one tab/window triggers a message to other tabs/windows to update their own session state. - -Using low values for `refetchInterval` will increase network traffic and load on authenticated clients and may impact hosting costs and performance. -::: - -#### Base path - -If you are using a custom base path, and your application entry point is not at the root of the domain "/" but something else, for example "/my-app/" you can use the `basePath` prop to make Auth.js aware of that so that all redirects and session handling work as expected. - -#### Refetch interval - -The `refetchInterval` option can be used to contact the server to avoid a session expiring. - -When `refetchInterval` is set to `0` (the default) there will be no session polling. - -If set to any value other than zero, it specifies in seconds how often the client should contact the server to update the session state. If the session state has expired when it is triggered, all open tabs/windows will be updated to reflect this. - -The value for `refetchInterval` should always be lower than the value of the session `maxAge` [session option](/reference/configuration/auth-config#session). - -By default, session polling will keep trying, even when the device has no internet access. To circumvent this, you can also set `refetchWhenOffline` to `false`. This will use [`navigator.onLine`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine) to only poll when the device is online. - -#### Refetch On Window Focus - -The `refetchOnWindowFocus` option can be used to control whether it automatically updates the session state when you switch a focus on tabs/windows. - -When `refetchOnWindowFocus` is set to `true` (the default) tabs/windows will be updated and initialize the components' state when they gain or lose focus. - -However, if it was set to `false`, it stops re-fetching the session and the components will stay as it is. - -:::note -See [**the Next.js documentation**](https://nextjs.org/docs/advanced-features/custom-app) for more information on **\_app.js** in Next.js applications. -::: - ---- - -## useSession() - -- Client Side: **Yes** -- Server Side: No - -The `useSession()` React Hook in the Auth.js client is the easiest way to check if someone is signed in. - -Make sure that [``](#sessionprovider) is added to `pages/_app.js`. - -#### Example - -```jsx -import { useSession } from "next-auth/react" - -export default function Component() { - const { data: session, status } = useSession() - - if (status === "authenticated") { - return

Signed in as {session.user.email}

- } - - return Sign in -} -``` - -`useSession()` returns an object containing two values: `data` and `status`: - -- **`data`**: This can be three values: [`Session`](https://github.com/nextauthjs/next-auth/blob/8ff4b260143458c5d8a16b80b11d1b93baa0690f/types/index.d.ts#L437-L444) / `undefined` / `null`. - - when the session hasn't been fetched yet, `data` will `undefined` - - in case it failed to retrieve the session, `data` will be `null` - - in case of success, `data` will be [`Session`](https://github.com/nextauthjs/next-auth/blob/8ff4b260143458c5d8a16b80b11d1b93baa0690f/types/index.d.ts#L437-L444). -- **`status`**: enum mapping to three possible session states: `"loading" | "authenticated" | "unauthenticated"` - -### Require session - -Due to the way how Next.js handles `getServerSideProps` and `getInitialProps`, every protected page load has to make a server-side request to check if the session is valid and then generate the requested page (SSR). This increases server load, and if you are good with making the requests from the client, there is an alternative. You can use `useSession` in a way that makes sure you always have a valid session. If after the initial loading state there was no session found, you can define the appropriate action to respond. - -The default behavior is to redirect the user to the sign-in page, from where - after a successful login - they will be sent back to the page they started on. You can also define an `onUnauthenticated()` callback, if you would like to do something else: - -#### Example - -```jsx title="pages/protected.jsx" -import { useSession } from "next-auth/react" - -export default function Admin() { - const { status } = useSession({ - required: true, - onUnauthenticated() { - // The user is not authenticated, handle it here. - }, - }) - - if (status === "loading") { - return "Loading or not authenticated..." - } - - return "User is logged in" -} -``` - -### Custom Client Session Handling - -Due to the way Next.js handles `getServerSideProps` / `getInitialProps`, every protected page load has to make a server-side request to check if the session is valid and then generate the requested page. This alternative solution allows for showing a loading state on the initial check and every page transition afterward will be client-side, without having to check with the server and regenerate pages. - -```js title="pages/admin.jsx" -export default function AdminDashboard() { - const { data: session } = useSession() - // session is always non-null inside this page, all the way down the React tree. - return "Some super secret dashboard" -} - -AdminDashboard.auth = true -``` - -```jsx title="pages/_app.jsx" -export default function App({ - Component, - pageProps: { session, ...pageProps }, -}) { - return ( - - {Component.auth ? ( - - - - ) : ( - - )} - - ) -} - -function Auth({ children }) { - // if `{ required: true }` is supplied, `status` can only be "loading" or "authenticated" - const { status } = useSession({ required: true }) - - if (status === "loading") { - return
Loading...
- } - - return children -} -``` - -It can be easily extended/modified to support something like an options object for role based authentication on pages. An example: - -```jsx title="pages/admin.jsx" -AdminDashboard.auth = { - role: "admin", - loading: , - unauthorized: "/login-with-different-user", // redirect to this url -} -``` - -Because of how `_app` is written, it won't unnecessarily contact the `/api/auth/session` endpoint for pages that do not require authentication. - -More information can be found in the following [GitHub Issue](https://github.com/nextauthjs/next-auth/issues/1210). - -### Auth.js + React-Query - -There is also an alternative client-side API library based upon [`react-query`](https://www.npmjs.com/package/react-query) available under [`nextauthjs/react-query`](https://github.com/nextauthjs/react-query). - -If you use `react-query` in your project already, you can leverage it with Auth.js to handle the client-side session management for you as well. This replaces Auth.js's native `useSession` and `SessionProvider` from `next-auth/react`. - -See repository [`README`](https://github.com/nextauthjs/react-query) for more details. diff --git a/docs/docs/reference/03-sveltekit/index.md b/docs/docs/reference/03-sveltekit/index.md index ce51843602..887f11fb1b 100644 --- a/docs/docs/reference/03-sveltekit/index.md +++ b/docs/docs/reference/03-sveltekit/index.md @@ -1,9 +1,9 @@ --- -title: SvelteKit +title: SvelteKit Auth --- :::warning -`@auth/sveltekit` is currently experimental. 🏗 +`@auth/sveltekit` is currently experimental. ::: ## Installation diff --git a/docs/docs/reference/04-nextjs/client.md b/docs/docs/reference/04-nextjs/client.md new file mode 100644 index 0000000000..ac2e14b00e --- /dev/null +++ b/docs/docs/reference/04-nextjs/client.md @@ -0,0 +1,7 @@ +--- +title: Client +--- + +:::warning WIP +`@auth/nextjs/client` is work in progress. For now, please use [NextAuth.js Client API](https://next-auth.js.org/getting-started/client). +::: diff --git a/docs/docs/reference/04-nextjs/index.md b/docs/docs/reference/04-nextjs/index.md index 26bd18ce8e..86ac3d9b93 100644 --- a/docs/docs/reference/04-nextjs/index.md +++ b/docs/docs/reference/04-nextjs/index.md @@ -1,274 +1,7 @@ --- -title: Next.js +title: Next.js Auth --- -## `unstable_getServerSession` - -:::warning -This feature is experimental and may be removed or changed in the future. -::: - -When calling from server-side i.e. in API routes or in `getServerSideProps`, we recommend using this function instead of `getSession` to retrieve the `session` object. This method is especially useful when you are using Auth.js with a database. This method can _drastically_ reduce response time when used over `getSession` server-side, due to avoiding an extra `fetch` to an API Route (this is generally [not recommended in Next.js](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props#getserversideprops-or-api-routes)). In addition, `unstable_getServerSession` will correctly update the cookie expiry time and update the session content if `callbacks.jwt` or `callbacks.session` changed something. - -Otherwise, if you only want to get the session token, see [`getToken`](/guides/basics/securing-pages-and-api-routes#using-gettoken). - -`unstable_getServerSession` requires passing the same object you would pass to `NextAuth` when initializing Auth.js. To do so, you can export your Auth.js options in the following way: - -In `[...nextauth].ts`: - -```ts -import { NextAuth } from "next-auth" -import type { NextAuthOptions } from "next-auth" - -export const authOptions: NextAuthOptions = { - // your configs -} - -export default NextAuth(authOptions) -``` - -### In `getServerSideProps`: - -```js -import { authOptions } from "pages/api/auth/[...nextauth]" -import { unstable_getServerSession } from "next-auth/next" - -export async function getServerSideProps(context) { - const session = await unstable_getServerSession( - context.req, - context.res, - authOptions - ) - - if (!session) { - return { - redirect: { - destination: "/", - permanent: false, - }, - } - } - - return { - props: { - session, - }, - } -} -``` - -### In API Routes: - -```js -import { authOptions } from "pages/api/auth/[...nextauth]" -import { unstable_getServerSession } from "next-auth/next" - -export async function handler(req, res) { - const session = await unstable_getServerSession(req, res, authOptions) - - if (!session) { - res.status(401).json({ message: "You must be logged in." }) - return - } - - return res.json({ - message: "Success", - }) -} -``` - -### In `app/` directory: - -You can also use `unstable_getServerSession` in Next.js' server components: - -```tsx -import { unstable_getServerSession } from "next-auth/next" -import { authOptions } from "pages/api/auth/[...nextauth]" - -export default async function Page() { - const session = await unstable_getServerSession(authOptions) - return
{JSON.stringify(session, null, 2)}
-} -``` - -:::warning -Currently, the underlying Next.js `cookies()` method does [only provides read access](/reference/configuration/auth-config#cookies) to the request cookies. This means that the `expires` value is stripped away from `session` in Server Components. Furthermore, there is a hard expiry on sessions, after which the user will be required to sign in again. (The default expiry is 30 days). -::: - -## Middleware - -You can use a Next.js Middleware with Auth.js to protect your site. - -Next.js 12 has introduced [Middleware](https://nextjs.org/docs/middleware). It is a way to run logic before accessing any page, even when they are static. On platforms like Vercel, Middleware is run at the [Edge](https://nextjs.org/docs/api-reference/edge-runtime). - -If the following options look familiar, this is because they are a subset of [these options](/reference/configuration/auth-config). You can extract these to a common configuration object to reuse them. In the future, we would like to be able to run everything in Middleware. (See [Caveats](#caveats)). - -You can get the `withAuth` middleware function from `next-auth/middleware` either as a default or a named import: - -### Prerequisites - -You must set the same secret in the middleware that you use in NextAuth. The easiest way is to set the [`NEXTAUTH_SECRET`](/reference/configuration/auth-config#nextauth_secret) environment variable. It will be picked up by both the [Auth.js config](/reference/configuration/auth-config), as well as the middleware config. - -Alternatively, you can provide the secret using the [`secret`](#secret) option in the middleware config. - -**We strongly recommend** replacing the `secret` value completely with this `NEXTAUTH_SECRET` environment variable. - -### Basic usage - -The most simple usage is when you want to require authentication for your entire site. You can add a `middleware.js` file with the following: - -```js -export { default } from "next-auth/middleware" -``` - -That's it! Your application is now secured. 🎉 - -If you only want to secure certain pages, export a `config` object with a `matcher`: - -```js -export { default } from "next-auth/middleware" - -export const config = { matcher: ["/dashboard"] } -``` - -Now you will still be able to visit every page, but only `/dashboard` will require authentication. - -If a user is not logged in, the default behavior is to redirect them to the sign-in page. - ---- - -### `callbacks` - -- **Required:** No - -#### Description - -Callbacks are asynchronous functions you can use to control what happens when an action is performed. - -#### Example (default value) - -```js - callbacks: { - authorized({ req , token }) { - if(token) return true // If there is a token, the user is authenticated - } - } -``` - ---- - -### `pages` - -- **Required**: _No_ - -#### Description - -Specify URLs to be used if you want to create custom sign in, and error pages. Pages specified will override the corresponding built-in page. - -:::note -This should match the `pages` configuration that's found in `[...nextauth].ts`. -::: - -#### Example (default value) - -```js -pages: { - signIn: '/api/auth/signin', - error: '/api/auth/error', -} -``` - -See the documentation for the [`pages` option](/reference/configuration/auth-config#pages) for more information. - ---- - -### `secret` - -- **Required**: _No_ - -#### Description - -The same `secret` used in the [Auth.js config](/reference/configuration/auth-config). - -#### Example (default value) - -```js -secret: process.env.NEXTAUTH_SECRET -``` - ---- - -### Advanced usage - -Auth.js Middleware is very flexible, there are multiple ways to use it. - -:::note -If you do not define the options, Auth.js will use the default values for the omitted options. +:::warning WIP +`@auth/nextjs` is work in progress. For now, please use [NextAuth.js](https://next-auth.js.org). ::: - -#### wrap middleware - -```ts title="middleware.ts" -import { withAuth } from "next-auth/middleware" - -export default withAuth( - // `withAuth` augments your `Request` with the user's token. - function middleware(req) { - console.log(req.nextauth.token) - }, - { - callbacks: { - authorized: ({ token }) => token?.role === "admin", - }, - } -) - -export const config = { matcher: ["/admin"] } -``` - -The `middleware` function will only be invoked if the `authorized` callback returns `true`. - ---- - -#### Custom JWT decode method - -If you have a custom jwt decode method set in `[...nextauth].ts`, you must also pass the same `decode` method to `withAuth` in order to read the custom-signed JWT correctly. You may want to extract the encode/decode logic to a separate function for consistency. - -```ts title="/api/auth/[...nextauth].ts" -import type { NextAuthOptions } from "next-auth" -import NextAuth from "next-auth" -import jwt from "jsonwebtoken" - -export const authOptions: NextAuthOptions = { - providers: [...], - jwt: { - async encode({ secret, token }) { - return jwt.sign(token, secret) - }, - async decode({ secret, token }) { - return jwt.verify(token, secret) - }, - }, -} - -export default NextAuth(authOptions) -``` - -And: - -```ts title="middleware.ts" -import withAuth from "next-auth/middleware" -import { authOptions } from "pages/api/auth/[...nextauth]" - -export default withAuth({ - jwt: { decode: authOptions.jwt }, - callbacks: { - authorized: ({ token }) => !!token, - }, -}) -``` - -### Caveats - -- Currently only supports session verification, as parts of the sign-in code need to run in a Node.js environment. In the future, we would like to make sure that Auth.js can fully run at the [Edge](https://nextjs.org/docs/api-reference/edge-runtime) -- Only supports the `"jwt"` [session strategy](/reference/configuration/auth-config#session). We need to wait until databases at the Edge become mature enough to ensure a fast experience. (If you know of an Edge-compatible database, we would like if [you proposed a new Adapter](/guides/adapters/creating-a-database-adapter)) diff --git a/docs/docs/reference/06-adapters/00-overview.md b/docs/docs/reference/06-adapters/00-overview.md index 4ad16c750e..affbb39c28 100644 --- a/docs/docs/reference/06-adapters/00-overview.md +++ b/docs/docs/reference/06-adapters/00-overview.md @@ -1,24 +1,10 @@ --- -title: List of database adapters -sidebar_label: Overview +title: Database Adapters --- -Auth.js comes with a lot of built-in database adapters to suit your needs. Here's the full list. Navigate to an adapter reference page to learn how to integrate with it: -- [Dgraph](/reference/adapters/dgraph) -- [DynamoDB](/reference/adapters/dynamodb) -- [FaunaDB](/reference/adapters/fauna) -- [Firebase](/reference/adapters/firebase) -- [MikroORM](/reference/adapters/mikro-orm) -- [Neo4j](/reference/adapters/neo4j) -- [PouchDB](/reference/adapters/pouchdb) -- [Prisma](/reference/adapters/prisma) -- [Sequelize](/reference/adapters/sequelize) -- [Supabase](/reference/adapters/supabase) -- [TypeORM](/reference/adapters/typeorm) -- [Upstash Redis](/reference/adapters/upstash-redis) -- [Xata](/reference/adapters/xata) +:::warning WIP +`@auth/*-adapter` is work in progress. for the time being, please go to [NextAuth.js Adapters](https://next-auth.js.org/adapters/overview). +::: -In case you want to [create your own custom adapter](/guides/adapters/creating-a-database-adapter) or configure one of the existing adapters, make sure you are familiar with the Auth.js uses when talking to adapters: -- [Database model structure](/reference/adapters/models) diff --git a/docs/docs/reference/01-index.md b/docs/docs/reference/index.md similarity index 55% rename from docs/docs/reference/01-index.md rename to docs/docs/reference/index.md index 891e0969b7..7088294115 100644 --- a/docs/docs/reference/01-index.md +++ b/docs/docs/reference/index.md @@ -1,8 +1,9 @@ --- -title: Reference -sidebar_label: Overview +title: Overview --- +## Core + ## Providers - OAuth/OIDC @@ -14,7 +15,9 @@ sidebar_label: Overview ## Frameworks - Next.js -- SvelteKit 🏗 -- Remix 🏗 -- Nuxt 🏗 -- Gatsby 🏗 +- SvelteKit +- SolidState +- Remix +- Nuxt +- Gatsby +- etc. \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 5c45c5e3f4..68c6ae5266 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -8,13 +8,14 @@ module.exports = { url: "https://authjs.dev", baseUrl: "/", favicon: "img/favicon.ico", + trailingSlash: false, organizationName: "nextauthjs", projectName: "next-auth", // TODO: remove this once ready onBrokenLinks: "log", themeConfig: { prism: { - theme: require("prism-react-renderer/themes/vsDark"), + theme: require("prism-react-renderer/themes/nightOwl"), magicComments: [ { className: "theme-code-block-highlighted-line", @@ -43,13 +44,13 @@ module.exports = { position: "left", }, { - to: "/guides/overview", - activeBasePath: "/guides/", + to: "/guides", + activeBasePath: "/guides", label: "Guides", position: "left", }, { - to: "/reference/index", + to: "/reference", activeBasePath: "/reference", label: "Reference", position: "left", @@ -154,6 +155,7 @@ module.exports = { "@docusaurus/preset-classic", { docs: { + breadcrumbs: false, routeBasePath: "/", sidebarPath: require.resolve("./sidebars.js"), editUrl: "https://github.com/nextauthjs/next-auth/edit/main/docs", @@ -182,7 +184,7 @@ module.exports = { "docusaurus-plugin-typedoc", { ...typedocConfig, - plugin: ["./tyepdoc-custom"], + plugin: ["./tyepdoc"], entryPoints: [ "../packages/core/src/index.ts", "../packages/core/src/adapters.ts", @@ -197,11 +199,6 @@ module.exports = { out: "reference/03-core", watch: process.env.TYPEDOC_WATCH, includeExtension: false, - sidebar: { - categoryLabel: "Core", - position: 2, - // fullNames: true, // REVIEW do we want this? - }, }, ], ], diff --git a/docs/package.json b/docs/package.json index 24b20344d9..cb64a4adc6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,7 @@ "name": "docs", "scripts": { "start": "TYPEDOC_WATCH=true docusaurus start --no-open --port 8000", - "dev": "pnpm providers && pnpm snippets && pnpm start", + "dev": "pnpm start", "build": "pnpm providers && docusaurus build", "docusaurus": "docusaurus", "swizzle": "docusaurus swizzle", diff --git a/docs/sidebars.js b/docs/sidebars.js index 94d11931f5..4b8502d93a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -1,3 +1,5 @@ +// @ts-check +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ module.exports = { gettingStarted: [ { @@ -12,10 +14,64 @@ module.exports = { }, ], reference: [ + "reference/index", { - type: "autogenerated", - dirName: "reference", + type: "category", + label: "@auth/core", + link: { + type: "doc", + id: "reference/core/modules/index", + }, + items: [ + // See: https://github.com/facebook/docusaurus/issues/5689 + // { + // type: "autogenerated", + // dirName: "reference/03-core/modules", + // exclude: ["index"], + // }, + "reference/core/modules/adapters", + "reference/core/modules/jwt", + "reference/core/modules/providers", + "reference/core/modules/providers_github", + ], + }, + { + type: "category", + label: "@auth/nextjs", + link: { + type: "doc", + id: "reference/nextjs/index", + }, + items: [ + "reference/nextjs/client", + { + type: "link", + label: "NextAuth.js (next-auth)", + href: "https://next-auth.js.org", + }, + ], + }, + { + type: "category", + label: "@auth/sveltekit", + link: { + type: "doc", + id: "reference/sveltekit/index", + }, + items: [], + }, + { + type: "category", + label: "Database Adapters", + link: { + type: "doc", + id: "reference/adapters/overview", + }, + items: [], }, + "reference/utilities/client", + "reference/warnings", + "reference/errors", ], concepts: [ { diff --git a/docs/tyepdoc-custom.js b/docs/tyepdoc.js similarity index 100% rename from docs/tyepdoc-custom.js rename to docs/tyepdoc.js diff --git a/package.json b/package.json index 018287f21e..c4da558eb5 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "eslint-plugin-promise": "^6.0.0", "husky": "^7.0.4", "prettier": "2.8.1", - "prettier-plugin-jsdoc": "^0.4.2", "pretty-quick": "^3.1.2", "semver": "7.3.5", "stream-to-array": "2.3.0", @@ -67,6 +66,9 @@ "pnpm": { "overrides": { "undici": "5.11.0" + }, + "patchedDependencies": { + "typedoc-plugin-markdown@3.14.0": "patches/typedoc-plugin-markdown@3.14.0.patch" } } } diff --git a/packages/adapter-mikro-orm/tests/__snapshots__/schema.test.ts.snap b/packages/adapter-mikro-orm/tests/__snapshots__/schema.test.ts.snap index fec629a7a5..1281adf463 100644 --- a/packages/adapter-mikro-orm/tests/__snapshots__/schema.test.ts.snap +++ b/packages/adapter-mikro-orm/tests/__snapshots__/schema.test.ts.snap @@ -3,19 +3,19 @@ exports[`run migrations: createSchemaSQL 1`] = ` "pragma foreign_keys = off; +create table \`verification_token\` (\`token\` text not null, \`expires\` datetime not null, \`identifier\` text not null, primary key (\`token\`)); +create unique index \`verification_token_token_identifier_unique\` on \`verification_token\` (\`token\`, \`identifier\`); + create table \`user\` (\`id\` text not null, \`name\` text null, \`email\` text null, \`email_verified\` datetime null, \`image\` text null, primary key (\`id\`)); create unique index \`user_email_unique\` on \`user\` (\`email\`); -create table \`session\` (\`id\` text not null, \`user_id\` text not null, \`expires\` datetime not null, \`session_token\` text not null, constraint \`session_user_id_foreign\` foreign key(\`user_id\`) references \`user\`(\`id\`) on delete cascade on update cascade, primary key (\`id\`)); -create index \`session_user_id_index\` on \`session\` (\`user_id\`); -create unique index \`session_session_token_unique\` on \`session\` (\`session_token\`); - create table \`account\` (\`id\` text not null, \`user_id\` text not null, \`type\` text not null, \`provider\` text not null, \`provider_account_id\` text not null, \`refresh_token\` text null, \`access_token\` text null, \`expires_at\` integer null, \`token_type\` text null, \`scope\` text null, \`id_token\` text null, \`session_state\` text null, constraint \`account_user_id_foreign\` foreign key(\`user_id\`) references \`user\`(\`id\`) on delete cascade on update cascade, primary key (\`id\`)); create index \`account_user_id_index\` on \`account\` (\`user_id\`); create unique index \`account_provider_provider_account_id_unique\` on \`account\` (\`provider\`, \`provider_account_id\`); -create table \`verification_token\` (\`token\` text not null, \`expires\` datetime not null, \`identifier\` text not null, primary key (\`token\`)); -create unique index \`verification_token_token_identifier_unique\` on \`verification_token\` (\`token\`, \`identifier\`); +create table \`session\` (\`id\` text not null, \`user_id\` text not null, \`expires\` datetime not null, \`session_token\` text not null, constraint \`session_user_id_foreign\` foreign key(\`user_id\`) references \`user\`(\`id\`) on delete cascade on update cascade, primary key (\`id\`)); +create index \`session_user_id_index\` on \`session\` (\`user_id\`); +create unique index \`session_session_token_unique\` on \`session\` (\`session_token\`); pragma foreign_keys = on; " @@ -29,23 +29,7 @@ exports[`run migrations: targetSchema 1`] = ` { "checks": [], "columns": { - "email": { - "autoincrement": false, - "comment": undefined, - "default": undefined, - "enumItems": undefined, - "extra": undefined, - "length": undefined, - "mappedType": "text", - "name": "email", - "nullable": true, - "precision": undefined, - "primary": false, - "scale": undefined, - "type": "text", - "unsigned": false, - }, - "email_verified": { + "expires": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -53,15 +37,15 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": 0, "mappedType": "datetime", - "name": "email_verified", - "nullable": true, + "name": "expires", + "nullable": false, "precision": undefined, "primary": false, "scale": undefined, "type": "datetime", "unsigned": false, }, - "id": { + "identifier": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -69,7 +53,7 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": undefined, "mappedType": "text", - "name": "id", + "name": "identifier", "nullable": false, "precision": undefined, "primary": false, @@ -77,23 +61,7 @@ exports[`run migrations: targetSchema 1`] = ` "type": "text", "unsigned": false, }, - "image": { - "autoincrement": false, - "comment": undefined, - "default": undefined, - "enumItems": undefined, - "extra": undefined, - "length": undefined, - "mappedType": "text", - "name": "image", - "nullable": true, - "precision": undefined, - "primary": false, - "scale": undefined, - "type": "text", - "unsigned": false, - }, - "name": { + "token": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -101,8 +69,8 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": undefined, "mappedType": "text", - "name": "name", - "nullable": true, + "name": "token", + "nullable": false, "precision": undefined, "primary": false, "scale": undefined, @@ -115,16 +83,19 @@ exports[`run migrations: targetSchema 1`] = ` "indexes": [ { "columnNames": [ - "email", + "token", + "identifier", ], - "composite": false, - "keyName": "user_email_unique", + "composite": true, + "expression": undefined, + "keyName": "verification_token_token_identifier_unique", "primary": false, + "type": undefined, "unique": true, }, { "columnNames": [ - "id", + "token", ], "composite": false, "expression": undefined, @@ -134,13 +105,29 @@ exports[`run migrations: targetSchema 1`] = ` "unique": true, }, ], - "name": "user", + "name": "verification_token", "schema": undefined, }, { "checks": [], "columns": { - "expires": { + "email": { + "autoincrement": false, + "comment": undefined, + "default": undefined, + "enumItems": undefined, + "extra": undefined, + "length": undefined, + "mappedType": "text", + "name": "email", + "nullable": true, + "precision": undefined, + "primary": false, + "scale": undefined, + "type": "text", + "unsigned": false, + }, + "email_verified": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -148,8 +135,8 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": 0, "mappedType": "datetime", - "name": "expires", - "nullable": false, + "name": "email_verified", + "nullable": true, "precision": undefined, "primary": false, "scale": undefined, @@ -172,7 +159,7 @@ exports[`run migrations: targetSchema 1`] = ` "type": "text", "unsigned": false, }, - "session_token": { + "image": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -180,15 +167,15 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": undefined, "mappedType": "text", - "name": "session_token", - "nullable": false, + "name": "image", + "nullable": true, "precision": undefined, "primary": false, "scale": undefined, "type": "text", "unsigned": false, }, - "user_id": { + "name": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -196,8 +183,8 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": undefined, "mappedType": "text", - "name": "user_id", - "nullable": false, + "name": "name", + "nullable": true, "precision": undefined, "primary": false, "scale": undefined, @@ -206,37 +193,14 @@ exports[`run migrations: targetSchema 1`] = ` }, }, "comment": undefined, - "foreignKeys": { - "session_user_id_foreign": { - "columnNames": [ - "user_id", - ], - "constraintName": "session_user_id_foreign", - "deleteRule": "cascade", - "localTableName": "session", - "referencedColumnNames": [ - "id", - ], - "referencedTableName": "user", - "updateRule": "cascade", - }, - }, + "foreignKeys": {}, "indexes": [ { "columnNames": [ - "user_id", - ], - "composite": false, - "keyName": "session_user_id_index", - "primary": false, - "unique": false, - }, - { - "columnNames": [ - "session_token", + "email", ], "composite": false, - "keyName": "session_session_token_unique", + "keyName": "user_email_unique", "primary": false, "unique": true, }, @@ -252,7 +216,7 @@ exports[`run migrations: targetSchema 1`] = ` "unique": true, }, ], - "name": "session", + "name": "user", "schema": undefined, }, { @@ -523,7 +487,7 @@ exports[`run migrations: targetSchema 1`] = ` "type": "datetime", "unsigned": false, }, - "identifier": { + "id": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -531,7 +495,7 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": undefined, "mappedType": "text", - "name": "identifier", + "name": "id", "nullable": false, "precision": undefined, "primary": false, @@ -539,7 +503,7 @@ exports[`run migrations: targetSchema 1`] = ` "type": "text", "unsigned": false, }, - "token": { + "session_token": { "autoincrement": false, "comment": undefined, "default": undefined, @@ -547,7 +511,23 @@ exports[`run migrations: targetSchema 1`] = ` "extra": undefined, "length": undefined, "mappedType": "text", - "name": "token", + "name": "session_token", + "nullable": false, + "precision": undefined, + "primary": false, + "scale": undefined, + "type": "text", + "unsigned": false, + }, + "user_id": { + "autoincrement": false, + "comment": undefined, + "default": undefined, + "enumItems": undefined, + "extra": undefined, + "length": undefined, + "mappedType": "text", + "name": "user_id", "nullable": false, "precision": undefined, "primary": false, @@ -557,23 +537,43 @@ exports[`run migrations: targetSchema 1`] = ` }, }, "comment": undefined, - "foreignKeys": {}, + "foreignKeys": { + "session_user_id_foreign": { + "columnNames": [ + "user_id", + ], + "constraintName": "session_user_id_foreign", + "deleteRule": "cascade", + "localTableName": "session", + "referencedColumnNames": [ + "id", + ], + "referencedTableName": "user", + "updateRule": "cascade", + }, + }, "indexes": [ { "columnNames": [ - "token", - "identifier", + "user_id", ], - "composite": true, - "expression": undefined, - "keyName": "verification_token_token_identifier_unique", + "composite": false, + "keyName": "session_user_id_index", + "primary": false, + "unique": false, + }, + { + "columnNames": [ + "session_token", + ], + "composite": false, + "keyName": "session_session_token_unique", "primary": false, - "type": undefined, "unique": true, }, { "columnNames": [ - "token", + "id", ], "composite": false, "expression": undefined, @@ -583,7 +583,7 @@ exports[`run migrations: targetSchema 1`] = ` "unique": true, }, ], - "name": "verification_token", + "name": "session", "schema": undefined, }, ], diff --git a/packages/core/package.json b/packages/core/package.json index 27b532c62f..049f73a5aa 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -61,7 +61,6 @@ }, "scripts": { "build": "pnpm clean && tsc && pnpm css", - "generate-reference": "pnpm typedoc --plugin typedoc-plugin-markdown src/index.ts", "clean": "rm -rf adapters.* index.* jwt lib providers", "css": "node ./scripts/generate-css.js", "lint": "eslint src", diff --git a/packages/core/src/adapters.ts b/packages/core/src/adapters.ts index 9194c31089..758e111078 100644 --- a/packages/core/src/adapters.ts +++ b/packages/core/src/adapters.ts @@ -1,4 +1,57 @@ -import type { Account, Awaitable, User } from "./index.js" +/** + * The `@auth/core/adapters` module contains useful helpers that a database adapter + * can incorporate in order to be compatible with Auth.js. + * You can think of an adapter as a way to normalize database implementation details to a common interface + * that Auth.js can use to interact with the database. + * + * Auth.js supports 2 session strtategies to persist the login state of a user. + * The default is to use a cookie + {@link https://authjs.dev/concepts/session-strategies#jwt JWT} + * based session store (`strategy: "jwt"`), + * but you can also use a database adapter to store the session in a database. + * + * :::info Note + * Auth.js _currently_ does **not** implement {@link https://authjs.dev/concepts/session-strategies#federated-logout federated logout}. + * So even if the session is deleted from the database, the user will still be logged in to the provider. + * See [this discussion](https://github.com/nextauthjs/next-auth/discussions/3938) for more information. + * ::: + * + * ## Installation + * + * ```bash npm2yarn2pnpm + * npm install @auth/core + * ``` + * + * ## Usage + * + * {@link https://authjs.dev/reference/adapters/overview Built-in adapters} already implement this interface, so you likely won't need to + * implement it yourself. If you do, you can use the following example as a + * starting point. + * + * ```ts + * // src/your-adapter.ts + * import { type Adapter } from "@auth/core/adapters" + * + * export function MyAdapter(options: any): Adapter { + * // implement the adapter methods + * } + * + * // src/index.ts + * import { MyAdapter } from "./your-adapter" + * + * const response = Auth({ + * adapter: MyAdapter({ ...adapter options }), + * ... auth options + * }) + * ``` + * + * @module adapters + */ + +import type { Account, Awaitable, User } from "./lib/types" + +// TODO: Discuss if we should expose methods to serialize and deserialize +// the data? Many adapters share this logic, so it could be useful to +// have a common implementation. export interface AdapterUser extends User { id: string @@ -10,11 +63,26 @@ export interface AdapterAccount extends Account { userId: string } +/** + * The session object implementing this interface is + * is used to look up the user in the database. + */ export interface AdapterSession { /** A randomly generated value that is used to get hold of the session. */ sessionToken: string - /** Used to connect the session to a particular user */ + /** Connects the active session to a user in the database */ userId: string + /** + * The absolute date when the session expires. + * + * If a session is accessed prior to its expiry date, + * it will be extended based on the `maxAge` option as defined in by {@linkcode SessionOptions.maxAge}. + * It is never extended more than once in a period defined by {@linkcode SessionOptions.updateAge}. + * + * If a session is accessed past its expiry date, + * it will be removed from the database to clean up inactive sessions. + * + */ expires: Date } @@ -25,39 +93,18 @@ export interface VerificationToken { } /** - * Using a custom adapter you can connect to any database backend or even several different databases. - * Custom adapters created and maintained by our community can be found in the adapters repository. - * Feel free to add a custom adapter from your project to the repository, - * or even become a maintainer of a certain adapter. - * Custom adapters can still be created and used in a project without being added to the repository. - * - * **Required methods** + * Using a custom adapter you can connect to any database backend or even + * several different databases. Custom adapters created and maintained by our + * community can be found in the adapters repository. Feel free to add a custom + * adapter from your project to the repository, or even become a maintainer of a + * certain adapter. Custom adapters can still be created and used in a project + * without being added to the repository. * - * _(These methods are required for all sign in flows)_ - * - `createUser` - * - `getUser` - * - `getUserByEmail` - * - `getUserByAccount` - * - `linkAccount` - * - `createSession` - * - `getSessionAndUser` - * - `updateSession` - * - `deleteSession` - * - `updateUser` + * ## Useful resources * - * _(Required to support email / passwordless sign in)_ - * - * - `createVerificationToken` - * - `useVerificationToken` - * - * **Unimplemented methods** - * - * _(These methods will be required in a future release, but are not yet invoked)_ - * - `deleteUser` - * - `unlinkAccount` - * - * [Adapters Overview](https://next-auth.js.org/adapters/overview) | - * [Create a custom adapter](https://next-auth.js.org/tutorials/creating-a-database-adapter) + * @see [Session strategies](https://authjs.dev/concepts/session-strategies#database) + * @see [Using a database adapter](https://authjs.dev/guides/adapters/using-a-database-adapter) + * @see [Creating a database adapter](https://authjs.dev/guides/adapters/creating-a-database-adapter) */ export type Adapter = DefaultAdapter & (WithVerificationToken extends true @@ -66,8 +113,8 @@ export type Adapter = DefaultAdapter & verificationToken: VerificationToken ) => Awaitable /** - * Return verification token from the database - * and delete it so it cannot be used again. + * Return verification token from the database and delete it so it + * cannot be used again. */ useVerificationToken: (params: { identifier: string @@ -80,7 +127,10 @@ export interface DefaultAdapter { createUser: (user: Omit) => Awaitable getUser: (id: string) => Awaitable getUserByEmail: (email: string) => Awaitable - /** Using the provider id and the id of the user for a specific account, get the user. */ + /** + * Using the provider id and the id of the user for a specific account, get + * the user. + */ getUserByAccount: ( providerAccountId: Pick ) => Awaitable @@ -109,9 +159,8 @@ export interface DefaultAdapter { session: Partial & Pick ) => Awaitable /** - * Deletes a session from the database. - * It is preferred that this method also returns the session - * that is being deleted for logging purposes. + * Deletes a session from the database. It is preferred that this method also + * returns the session that is being deleted for logging purposes. */ deleteSession: ( sessionToken: string @@ -120,8 +169,8 @@ export interface DefaultAdapter { verificationToken: VerificationToken ) => Awaitable /** - * Return verification token from the database - * and delete it so it cannot be used again. + * Return verification token from the database and delete it so it cannot be + * used again. */ useVerificationToken?: (params: { identifier: string diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index dd4c4c621c..098b005d8d 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,3 +1,15 @@ +/** + * ## Installation + * + * ```bash npm2yarn2pnpm + * npm install @auth/core + * ``` + * + * ## Usage + * + * @module index + */ + import { init } from "./lib/init.js" import { assertConfig } from "./lib/assert.js" import { SessionStore } from "./lib/cookie.js" @@ -14,6 +26,8 @@ import type { } from "./lib/types.js" import { UntrustedHost } from "./lib/errors.js" +// Only thing exported from this file should be `AuthHandler` and `AuthOptions` +// TODO Don't re-export, just add `@auth/core/types` exports in package.json and change references these types export * from "./lib/types.js" const configErrorMessage = @@ -239,9 +253,10 @@ async function AuthHandlerInternal< } /** - * The core functionality of Auth.js. - * It receives a standard [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) - * and returns a standard [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response). + * The core functionality of Auth.js. It receives a standard + * [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and + * returns a standard + * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response). */ export async function AuthHandler( request: Request, diff --git a/patches/typedoc-plugin-markdown@3.14.0.patch b/patches/typedoc-plugin-markdown@3.14.0.patch new file mode 100644 index 0000000000..66f0c95b2b --- /dev/null +++ b/patches/typedoc-plugin-markdown@3.14.0.patch @@ -0,0 +1,57 @@ +diff --git a/dist/theme.js b/dist/theme.js +index 1483a4b4ec69583aa3086eac83b2b31ae8bb6777..6b90b17261e14b8a49e52d0885038dbff4b6b503 100644 +--- a/dist/theme.js ++++ b/dist/theme.js +@@ -209,52 +209,6 @@ class MarkdownTheme extends typedoc_1.Theme { + directory: 'modules', + template: this.getReflectionTemplate(), + }, +- { +- kind: [typedoc_1.ReflectionKind.Namespace], +- isLeaf: false, +- directory: 'modules', +- template: this.getReflectionTemplate(), +- }, +- { +- kind: [typedoc_1.ReflectionKind.Enum], +- isLeaf: false, +- directory: 'enums', +- template: this.getReflectionTemplate(), +- }, +- { +- kind: [typedoc_1.ReflectionKind.Class], +- isLeaf: false, +- directory: 'classes', +- template: this.getReflectionTemplate(), +- }, +- { +- kind: [typedoc_1.ReflectionKind.Interface], +- isLeaf: false, +- directory: 'interfaces', +- template: this.getReflectionTemplate(), +- }, +- ...(this.allReflectionsHaveOwnDocument +- ? [ +- { +- kind: [typedoc_1.ReflectionKind.TypeAlias], +- isLeaf: true, +- directory: 'types', +- template: this.getReflectionMemberTemplate(), +- }, +- { +- kind: [typedoc_1.ReflectionKind.Variable], +- isLeaf: true, +- directory: 'variables', +- template: this.getReflectionMemberTemplate(), +- }, +- { +- kind: [typedoc_1.ReflectionKind.Function], +- isLeaf: true, +- directory: 'functions', +- template: this.getReflectionMemberTemplate(), +- }, +- ] +- : []), + ]; + } + onBeginRenderer(event) { \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7256e2c80..7402236d89 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,6 +3,11 @@ lockfileVersion: 5.4 overrides: undici: 5.11.0 +patchedDependencies: + typedoc-plugin-markdown@3.14.0: + hash: 7c3svfnvqamb7naqau6rcwpxme + path: patches/typedoc-plugin-markdown@3.14.0.patch + importers: .: @@ -23,7 +28,6 @@ importers: eslint-plugin-promise: ^6.0.0 husky: ^7.0.4 prettier: 2.8.1 - prettier-plugin-jsdoc: ^0.4.2 pretty-quick: ^3.1.2 semver: 7.3.5 stream-to-array: 2.3.0 @@ -49,14 +53,13 @@ importers: eslint-plugin-promise: 6.0.0_eslint@7.32.0 husky: 7.0.4 prettier: 2.8.1 - prettier-plugin-jsdoc: 0.4.2_prettier@2.8.1 pretty-quick: 3.1.3_prettier@2.8.1 semver: 7.3.5 stream-to-array: 2.3.0 ts-node: 10.5.0_ksn4eycaeggbrckn3ykh37hwf4 turbo: 1.3.1 typedoc: 0.23.22_typescript@4.8.4 - typedoc-plugin-markdown: 3.14.0_typedoc@0.23.22 + typedoc-plugin-markdown: 3.14.0_7c3svfnvqamb7naqau6rcwpxme_typedoc@0.23.22 typescript: 4.8.4 apps/dev: @@ -11942,10 +11945,6 @@ packages: engines: {node: '>=8'} dev: true - /binary-searching/2.0.5: - resolution: {integrity: sha512-v4N2l3RxL+m4zDxyxz3Ne2aTmiPn8ZUpKFpdPtO+ItW1NcTCXA7JeHG5GMBSvoKSkQZ9ycS+EouDVxYB9ufKWA==} - dev: true - /binary/0.3.0: resolution: {integrity: sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==} dependencies: @@ -12450,10 +12449,6 @@ packages: resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} dev: true - /character-entities/2.0.2: - resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} - dev: true - /character-reference-invalid/1.1.4: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: true @@ -14142,12 +14137,6 @@ packages: resolution: {integrity: sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==} dev: true - /decode-named-character-reference/1.0.2: - resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} - dependencies: - character-entities: 2.0.2 - dev: true - /decode-uri-component/0.2.0: resolution: {integrity: sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==} engines: {node: '>=0.10'} @@ -14322,11 +14311,6 @@ packages: engines: {node: '>= 0.6.0'} dev: true - /dequal/2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - dev: true - /destr/1.2.2: resolution: {integrity: sha512-lrbCJwD9saUQrqUfXvl6qoM+QN3W7tLV5pAOs+OqOmopCCz/JkE05MHedJR1xfk4IAnZuJXPVuN5+7jNA2ZCiA==} dev: true @@ -14412,11 +14396,6 @@ packages: engines: {node: '>=0.3.1'} dev: true - /diff/5.1.0: - resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} - engines: {node: '>=0.3.1'} - dev: true - /dir-glob/3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -21004,25 +20983,6 @@ packages: unist-util-visit-parents: 3.1.1 dev: false - /mdast-util-from-markdown/1.2.0: - resolution: {integrity: sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q==} - dependencies: - '@types/mdast': 3.0.10 - '@types/unist': 2.0.6 - decode-named-character-reference: 1.0.2 - mdast-util-to-string: 3.1.0 - micromark: 3.1.0 - micromark-util-decode-numeric-character-reference: 1.0.0 - micromark-util-decode-string: 1.0.2 - micromark-util-normalize-identifier: 1.0.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - unist-util-stringify-position: 3.0.2 - uvu: 0.5.6 - transitivePeerDependencies: - - supports-color - dev: true - /mdast-util-to-hast/10.0.1: resolution: {integrity: sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA==} dependencies: @@ -21044,10 +21004,6 @@ packages: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} dev: true - /mdast-util-to-string/3.1.0: - resolution: {integrity: sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==} - dev: true - /mdn-data/2.0.14: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} dev: true @@ -21152,182 +21108,6 @@ packages: engines: {node: '>= 0.6'} dev: true - /micromark-core-commonmark/1.0.6: - resolution: {integrity: sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==} - dependencies: - decode-named-character-reference: 1.0.2 - micromark-factory-destination: 1.0.0 - micromark-factory-label: 1.0.2 - micromark-factory-space: 1.0.0 - micromark-factory-title: 1.0.2 - micromark-factory-whitespace: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-chunked: 1.0.0 - micromark-util-classify-character: 1.0.0 - micromark-util-html-tag-name: 1.1.0 - micromark-util-normalize-identifier: 1.0.0 - micromark-util-resolve-all: 1.0.0 - micromark-util-subtokenize: 1.0.2 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 - dev: true - - /micromark-factory-destination/1.0.0: - resolution: {integrity: sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw==} - dependencies: - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - dev: true - - /micromark-factory-label/1.0.2: - resolution: {integrity: sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg==} - dependencies: - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 - dev: true - - /micromark-factory-space/1.0.0: - resolution: {integrity: sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew==} - dependencies: - micromark-util-character: 1.1.0 - micromark-util-types: 1.0.2 - dev: true - - /micromark-factory-title/1.0.2: - resolution: {integrity: sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==} - dependencies: - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 - dev: true - - /micromark-factory-whitespace/1.0.0: - resolution: {integrity: sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A==} - dependencies: - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - dev: true - - /micromark-util-character/1.1.0: - resolution: {integrity: sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg==} - dependencies: - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - dev: true - - /micromark-util-chunked/1.0.0: - resolution: {integrity: sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g==} - dependencies: - micromark-util-symbol: 1.0.1 - dev: true - - /micromark-util-classify-character/1.0.0: - resolution: {integrity: sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA==} - dependencies: - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - dev: true - - /micromark-util-combine-extensions/1.0.0: - resolution: {integrity: sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==} - dependencies: - micromark-util-chunked: 1.0.0 - micromark-util-types: 1.0.2 - dev: true - - /micromark-util-decode-numeric-character-reference/1.0.0: - resolution: {integrity: sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w==} - dependencies: - micromark-util-symbol: 1.0.1 - dev: true - - /micromark-util-decode-string/1.0.2: - resolution: {integrity: sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q==} - dependencies: - decode-named-character-reference: 1.0.2 - micromark-util-character: 1.1.0 - micromark-util-decode-numeric-character-reference: 1.0.0 - micromark-util-symbol: 1.0.1 - dev: true - - /micromark-util-encode/1.0.1: - resolution: {integrity: sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA==} - dev: true - - /micromark-util-html-tag-name/1.1.0: - resolution: {integrity: sha512-BKlClMmYROy9UiV03SwNmckkjn8QHVaWkqoAqzivabvdGcwNGMMMH/5szAnywmsTBUzDsU57/mFi0sp4BQO6dA==} - dev: true - - /micromark-util-normalize-identifier/1.0.0: - resolution: {integrity: sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg==} - dependencies: - micromark-util-symbol: 1.0.1 - dev: true - - /micromark-util-resolve-all/1.0.0: - resolution: {integrity: sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw==} - dependencies: - micromark-util-types: 1.0.2 - dev: true - - /micromark-util-sanitize-uri/1.1.0: - resolution: {integrity: sha512-RoxtuSCX6sUNtxhbmsEFQfWzs8VN7cTctmBPvYivo98xb/kDEoTCtJQX5wyzIYEmk/lvNFTat4hL8oW0KndFpg==} - dependencies: - micromark-util-character: 1.1.0 - micromark-util-encode: 1.0.1 - micromark-util-symbol: 1.0.1 - dev: true - - /micromark-util-subtokenize/1.0.2: - resolution: {integrity: sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA==} - dependencies: - micromark-util-chunked: 1.0.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 - dev: true - - /micromark-util-symbol/1.0.1: - resolution: {integrity: sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ==} - dev: true - - /micromark-util-types/1.0.2: - resolution: {integrity: sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w==} - dev: true - - /micromark/3.1.0: - resolution: {integrity: sha512-6Mj0yHLdUZjHnOPgr5xfWIMqMWS12zDN6iws9SLuSz76W8jTtAv24MN4/CL7gJrl5vtxGInkkqDv/JIoRsQOvA==} - dependencies: - '@types/debug': 4.1.7 - debug: 4.3.4 - decode-named-character-reference: 1.0.2 - micromark-core-commonmark: 1.0.6 - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-chunked: 1.0.0 - micromark-util-combine-extensions: 1.0.0 - micromark-util-decode-numeric-character-reference: 1.0.0 - micromark-util-encode: 1.0.1 - micromark-util-normalize-identifier: 1.0.0 - micromark-util-resolve-all: 1.0.0 - micromark-util-sanitize-uri: 1.1.0 - micromark-util-subtokenize: 1.0.2 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 - transitivePeerDependencies: - - supports-color - dev: true - /micromatch/4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -24331,20 +24111,6 @@ packages: engines: {node: '>=4'} dev: true - /prettier-plugin-jsdoc/0.4.2_prettier@2.8.1: - resolution: {integrity: sha512-w2jnAQm3z0GAG0bhzVJeehzDtrhGMSxJjit5ApCc2oxWfc7+jmLAkbtdOXaSpfwZz3IWkk+PiQPeRrLNpbM+Mw==} - engines: {node: '>=12.0.0'} - peerDependencies: - prettier: '>=2.1.2' - dependencies: - binary-searching: 2.0.5 - comment-parser: 1.3.1 - mdast-util-from-markdown: 1.2.0 - prettier: 2.8.1 - transitivePeerDependencies: - - supports-color - dev: true - /prettier-plugin-svelte/2.8.1_sro2v6ld777payjtkjtiuogcxi: resolution: {integrity: sha512-KA3K1J3/wKDnCxW7ZDRA/QL2Q67N7Xs3gOERqJ5X1qFjq1DdnN3K1R29scSKwh+kA8FF67pXbYytUpvN/i3iQw==} peerDependencies: @@ -27712,7 +27478,7 @@ packages: dependencies: is-typedarray: 1.0.0 - /typedoc-plugin-markdown/3.14.0_typedoc@0.23.22: + /typedoc-plugin-markdown/3.14.0_7c3svfnvqamb7naqau6rcwpxme_typedoc@0.23.22: resolution: {integrity: sha512-UyQLkLRkfTFhLdhSf3RRpA3nNInGn+k6sll2vRXjflaMNwQAAiB61SYbisNZTg16t4K1dt1bPQMMGLrxS0GZ0Q==} peerDependencies: typedoc: '>=0.23.0' @@ -27720,6 +27486,7 @@ packages: handlebars: 4.7.7 typedoc: 0.23.22_typescript@4.8.4 dev: true + patched: true /typedoc/0.23.22_typescript@4.8.4: resolution: {integrity: sha512-5sJkjK60xp8A7YpcYniu3+Wf0QcgojEnhzHuCN+CkdpQkKRhOspon/9+sGTkGI8kjVkZs3KHrhltpQyVhRMVfw==} @@ -27950,6 +27717,7 @@ packages: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} hasBin: true + requiresBuild: true dev: true /ulid/2.3.0: @@ -28151,12 +27919,6 @@ packages: '@types/unist': 2.0.6 dev: true - /unist-util-stringify-position/3.0.2: - resolution: {integrity: sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg==} - dependencies: - '@types/unist': 2.0.6 - dev: true - /unist-util-visit-parents/3.1.1: resolution: {integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==} dependencies: @@ -28417,17 +28179,6 @@ packages: hasBin: true dev: false - /uvu/0.5.6: - resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} - engines: {node: '>=8'} - hasBin: true - dependencies: - dequal: 2.0.3 - diff: 5.1.0 - kleur: 4.1.5 - sade: 1.8.1 - dev: true - /v8-compile-cache-lib/3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true