diff --git a/packages/next-drupal/src/next-drupal-base.ts b/packages/next-drupal/src/next-drupal-base.ts index 2feb82c5..5d9db158 100644 --- a/packages/next-drupal/src/next-drupal-base.ts +++ b/packages/next-drupal/src/next-drupal-base.ts @@ -30,6 +30,9 @@ const DEFAULT_HEADERS = { Accept: "application/json", } +/** + * The base class for NextDrupal clients. + */ export class NextDrupalBase { accessToken?: NextDrupalBaseOptions["accessToken"] @@ -173,6 +176,13 @@ export class NextDrupalBase { return this._token } + /** + * Fetches a resource from the given input URL or path. + * + * @param {RequestInfo} input The input URL or path. + * @param {FetchOptions} init The fetch options. + * @returns {Promise} The fetch response. + */ async fetch( input: RequestInfo, { withAuth, ...init }: FetchOptions = {} @@ -215,6 +225,12 @@ export class NextDrupalBase { return await fetch(input, init) } + /** + * Gets the authorization header value based on the provided auth configuration. + * + * @param {NextDrupalAuth} auth The auth configuration. + * @returns {Promise} The authorization header value. + */ async getAuthorizationHeader(auth: NextDrupalAuth) { let header: string @@ -250,6 +266,13 @@ export class NextDrupalBase { return header } + /** + * Builds a URL with the given path and search parameters. + * + * @param {string} path The URL path. + * @param {EndpointSearchParams} searchParams The search parameters. + * @returns {URL} The constructed URL. + */ buildUrl(path: string, searchParams?: EndpointSearchParams): URL { const url = new URL(path, this.baseUrl) @@ -269,7 +292,15 @@ export class NextDrupalBase { return url } - // async so subclasses can query for endpoint discovery. + /** + * Builds an endpoint URL with the given options. + * + * @param {Object} options The options for building the endpoint. + * @param {string} options.locale The locale. + * @param {string} options.path The path. + * @param {EndpointSearchParams} options.searchParams The search parameters. + * @returns {Promise} The constructed endpoint URL. + */ async buildEndpoint({ locale = "", path = "", @@ -291,6 +322,16 @@ export class NextDrupalBase { ).toString() } + /** + * Constructs a path from the given segment and options. + * + * @param {string | string[]} segment The path segment. + * @param {Object} options The options for constructing the path. + * @param {Locale} options.locale The locale. + * @param {Locale} options.defaultLocale The default locale. + * @param {PathPrefix} options.pathPrefix The path prefix. + * @returns {string} The constructed path. + */ constructPathFromSegment( segment: string | string[], options: { @@ -338,6 +379,15 @@ export class NextDrupalBase { }) } + /** + * Adds a locale prefix to the given path. + * + * @param {string} path The path. + * @param {Object} options The options for adding the locale prefix. + * @param {Locale} options.locale The locale. + * @param {Locale} options.defaultLocale The default locale. + * @returns {string} The path with the locale prefix. + */ addLocalePrefix( path: string, options: { locale?: Locale; defaultLocale?: Locale } = {} @@ -356,6 +406,12 @@ export class NextDrupalBase { return `${localePrefix}${path}` } + /** + * Gets an access token using the provided client ID and secret. + * + * @param {NextDrupalAuthClientIdSecret} clientIdSecret The client ID and secret. + * @returns {Promise} The access token. + */ async getAccessToken( clientIdSecret?: NextDrupalAuthClientIdSecret ): Promise { @@ -435,6 +491,12 @@ export class NextDrupalBase { return result } + /** + * Validates the draft URL using the provided search parameters. + * + * @param {URLSearchParams} searchParams The search parameters. + * @returns {Promise} The validation response. + */ async validateDraftUrl(searchParams: URLSearchParams): Promise { const path = searchParams.get("path") @@ -468,10 +530,22 @@ export class NextDrupalBase { return response } + /** + * Logs a debug message if debug mode is enabled. + * + * @param {string} message The debug message. + */ debug(message) { this.isDebugEnabled && this.logger.debug(message) } + /** + * Throws an error if the response contains JSON:API errors. + * + * @param {Response} response The fetch response. + * @param {string} messagePrefix The error message prefix. + * @throws {JsonApiErrors} The JSON:API errors. + */ async throwIfJsonErrors(response: Response, messagePrefix = "") { if (!response?.ok) { const errors = await this.getErrorsFromResponse(response) @@ -479,6 +553,12 @@ export class NextDrupalBase { } } + /** + * Extracts errors from the fetch response. + * + * @param {Response} response The fetch response. + * @returns {Promise} The extracted errors. + */ async getErrorsFromResponse(response: Response) { const type = response.headers.get("content-type") let error: JsonApiResponse | { message: string } @@ -506,6 +586,12 @@ export class NextDrupalBase { } } +/** + * Checks if the provided auth configuration is basic auth. + * + * @param {NextDrupalAuth} auth The auth configuration. + * @returns {boolean} True if the auth configuration is basic auth, false otherwise. + */ export function isBasicAuth( auth: NextDrupalAuth ): auth is NextDrupalAuthUsernamePassword { @@ -515,6 +601,12 @@ export function isBasicAuth( ) } +/** + * Checks if the provided auth configuration is access token auth. + * + * @param {NextDrupalAuth} auth The auth configuration. + * @returns {boolean} True if the auth configuration is access token auth, false otherwise. + */ export function isAccessTokenAuth( auth: NextDrupalAuth ): auth is NextDrupalAuthAccessToken { @@ -524,6 +616,12 @@ export function isAccessTokenAuth( ) } +/** + * Checks if the provided auth configuration is client ID and secret auth. + * + * @param {NextDrupalAuth} auth The auth configuration. + * @returns {boolean} True if the auth configuration is client ID and secret auth, false otherwise. + */ export function isClientIdSecretAuth( auth: NextDrupalAuth ): auth is NextDrupalAuthClientIdSecret { diff --git a/packages/next-drupal/src/next-drupal-pages.ts b/packages/next-drupal/src/next-drupal-pages.ts index fd0af89a..e37d4916 100644 --- a/packages/next-drupal/src/next-drupal-pages.ts +++ b/packages/next-drupal/src/next-drupal-pages.ts @@ -27,6 +27,10 @@ import type { NextApiResponse, } from "next" +/** + * The NextDrupalPages class extends the NextDrupal class and provides methods + * for interacting with a Drupal backend in the context of Next.js pages. + */ export class NextDrupalPages extends NextDrupal { private serializer: DrupalClientOptions["serializer"] @@ -59,6 +63,13 @@ export class NextDrupalPages extends NextDrupal { ) => this.serializer.deserialize(body, options) } + /** + * Gets the entry point for a given resource type. + * + * @param {string} resourceType The resource type. + * @param {Locale} locale The locale. + * @returns {Promise} The entry point URL. + */ async getEntryForResourceType( resourceType: string, locale?: Locale @@ -74,6 +85,14 @@ export class NextDrupalPages extends NextDrupal { return new DrupalMenuTree(links, parent) } + /** + * Gets a resource from the context. + * + * @param {string | DrupalTranslatedPath} input The input path or translated path. + * @param {GetStaticPropsContext} context The static props context. + * @param {Object} options Options for the request. + * @returns {Promise} The fetched resource. + */ async getResourceFromContext( input: string | DrupalTranslatedPath, context: GetStaticPropsContext, @@ -157,6 +176,14 @@ export class NextDrupalPages extends NextDrupal { return resource } + /** + * Gets a collection of resources from the context. + * + * @param {string} type The type of the resources. + * @param {GetStaticPropsContext} context The static props context. + * @param {Object} options Options for the request. + * @returns {Promise} The fetched collection of resources. + */ async getResourceCollectionFromContext( type: string, context: GetStaticPropsContext, @@ -177,6 +204,14 @@ export class NextDrupalPages extends NextDrupal { }) } + /** + * Gets a search index from the context. + * + * @param {string} name The name of the search index. + * @param {GetStaticPropsContext} context The static props context. + * @param {Object} options Options for the request. + * @returns {Promise} The fetched search index. + */ async getSearchIndexFromContext( name: string, context: GetStaticPropsContext, @@ -189,6 +224,13 @@ export class NextDrupalPages extends NextDrupal { }) } + /** + * Translates a path from the context. + * + * @param {GetStaticPropsContext} context The static props context. + * @param {Object} options Options for the request. + * @returns {Promise} The translated path. + */ async translatePathFromContext( context: GetStaticPropsContext, options?: { @@ -208,6 +250,13 @@ export class NextDrupalPages extends NextDrupal { }) } + /** + * Gets the path from the context. + * + * @param {GetStaticPropsContext} context The static props context. + * @param {Object} options Options for the request. + * @returns {string} The constructed path. + */ getPathFromContext( context: GetStaticPropsContext, options?: { @@ -223,6 +272,14 @@ export class NextDrupalPages extends NextDrupal { getPathsFromContext = this.getStaticPathsFromContext + /** + * Gets static paths from the context. + * + * @param {string | string[]} types The types of the resources. + * @param {GetStaticPathsContext} context The static paths context. + * @param {Object} options Options for the request. + * @returns {Promise["paths"]>} The fetched static paths. + */ async getStaticPathsFromContext( types: string | string[], context: GetStaticPathsContext, @@ -291,6 +348,13 @@ export class NextDrupalPages extends NextDrupal { return paths.flat() } + /** + * Builds static paths from resources. + * + * @param {Object[]} resources The resources. + * @param {Object} options Options for the request. + * @returns {Object[]} The built static paths. + */ buildStaticPathsFromResources( resources: { path: DrupalPathAlias @@ -313,6 +377,13 @@ export class NextDrupalPages extends NextDrupal { : [] } + /** + * Builds static paths parameters from paths. + * + * @param {string[]} paths The paths. + * @param {Object} options Options for the request. + * @returns {Object[]} The built static paths parameters. + */ buildStaticPathsParamsFromPaths( paths: string[], options?: { pathPrefix?: PathPrefix; locale?: Locale } @@ -342,6 +413,13 @@ export class NextDrupalPages extends NextDrupal { }) } + /** + * Handles preview mode. + * + * @param {NextApiRequest} request The API request. + * @param {NextApiResponse} response The API response. + * @param {Object} options Options for the request. + */ async preview( request: NextApiRequest, response: NextApiResponse, @@ -411,6 +489,12 @@ export class NextDrupalPages extends NextDrupal { } } + /** + * Disables preview mode. + * + * @param {NextApiRequest} request The API request. + * @param {NextApiResponse} response The API response. + */ async previewDisable(request: NextApiRequest, response: NextApiResponse) { // Disable both preview and draft modes. response.clearPreviewData() @@ -427,6 +511,13 @@ export class NextDrupalPages extends NextDrupal { response.end() } + /** + * Gets the authentication configuration from the context and options. + * + * @param {GetStaticPropsContext} context The static props context. + * @param {JsonApiWithAuthOption} options Options for the request. + * @returns {NextDrupalAuth} The authentication configuration. + */ getAuthFromContextAndOptions( context: GetStaticPropsContext, options: JsonApiWithAuthOption diff --git a/packages/next-drupal/src/next-drupal.ts b/packages/next-drupal/src/next-drupal.ts index 1c837c7c..2041ebb5 100644 --- a/packages/next-drupal/src/next-drupal.ts +++ b/packages/next-drupal/src/next-drupal.ts @@ -44,6 +44,10 @@ export function useJsonaDeserialize() { } } +/** + * The NextDrupal class extends the NextDrupalBase class and provides methods + * for interacting with a Drupal backend. + */ export class NextDrupal extends NextDrupalBase { cache?: NextDrupalOptions["cache"] @@ -86,6 +90,14 @@ export class NextDrupal extends NextDrupalBase { } } + /** + * Creates a new resource of the specified type. + * + * @param {string} type The type of the resource. + * @param {JsonApiCreateResourceBody} body The body of the resource. + * @param {JsonApiOptions} options Options for the request. + * @returns {Promise} The created resource. + */ async createResource( type: string, body: JsonApiCreateResourceBody, @@ -126,6 +138,14 @@ export class NextDrupal extends NextDrupalBase { : /* c8 ignore next */ json } + /** + * Creates a new file resource for the specified media type. + * + * @param {string} type The type of the media. + * @param {JsonApiCreateFileResourceBody} body The body of the file resource. + * @param {JsonApiOptions} options Options for the request. + * @returns {Promise} The created file resource. + */ async createFileResource( type: string, body: JsonApiCreateFileResourceBody, @@ -170,6 +190,15 @@ export class NextDrupal extends NextDrupalBase { return options.deserialize ? this.deserialize(json) : json } + /** + * Updates an existing resource of the specified type. + * + * @param {string} type The type of the resource. + * @param {string} uuid The UUID of the resource. + * @param {JsonApiUpdateResourceBody} body The body of the resource. + * @param {JsonApiOptions} options Options for the request. + * @returns {Promise} The updated resource. + */ async updateResource( type: string, uuid: string, @@ -213,6 +242,14 @@ export class NextDrupal extends NextDrupalBase { : /* c8 ignore next */ json } + /** + * Deletes an existing resource of the specified type. + * + * @param {string} type The type of the resource. + * @param {string} uuid The UUID of the resource. + * @param {JsonApiOptions} options Options for the request. + * @returns {Promise} True if the resource was deleted, false otherwise. + */ async deleteResource( type: string, uuid: string, @@ -246,6 +283,14 @@ export class NextDrupal extends NextDrupalBase { return response.status === 204 } + /** + * Fetches a resource of the specified type by its UUID. + * + * @param {string} type The type of the resource. + * @param {string} uuid The UUID of the resource. + * @param {JsonApiOptions & JsonApiWithCacheOptions & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise} The fetched resource. + */ async getResource( type: string, uuid: string, @@ -301,6 +346,13 @@ export class NextDrupal extends NextDrupalBase { return options.deserialize ? this.deserialize(json) : json } + /** + * Fetches a resource of the specified type by its path. + * + * @param {string} path The path of the resource. + * @param {JsonApiOptions & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise} The fetched resource. + */ async getResourceByPath( path: string, options?: { @@ -410,6 +462,13 @@ export class NextDrupal extends NextDrupalBase { return options.deserialize ? this.deserialize(data) : data } + /** + * Fetches a collection of resources of the specified type. + * + * @param {string} type The type of the resources. + * @param {JsonApiOptions & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise} The fetched collection of resources. + */ async getResourceCollection( type: string, options?: { @@ -447,6 +506,13 @@ export class NextDrupal extends NextDrupalBase { return options.deserialize ? this.deserialize(json) : json } + /** + * Fetches path segments for a collection of resources of the specified types. + * + * @param {string | string[]} types The types of the resources. + * @param {JsonApiOptions & JsonApiWithAuthOption & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise<{ path: string, type: string, locale: Locale, segments: string[] }[]>} The fetched path segments. + */ async getResourceCollectionPathSegments( types: string | string[], options?: { @@ -555,6 +621,13 @@ export class NextDrupal extends NextDrupalBase { return paths.flat(2) } + /** + * Translates a path to a DrupalTranslatedPath object. + * + * @param {string} path The path to translate. + * @param {JsonApiWithAuthOption & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise} The translated path. + */ async translatePath( path: string, options?: JsonApiWithAuthOption & JsonApiWithNextFetchOptions @@ -586,6 +659,13 @@ export class NextDrupal extends NextDrupalBase { return await response.json() } + /** + * Fetches the JSON:API index. + * + * @param {Locale} locale The locale for the request. + * @param {JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise} The JSON:API index. + */ async getIndex( locale?: Locale, options?: JsonApiWithNextFetchOptions @@ -610,6 +690,12 @@ export class NextDrupal extends NextDrupalBase { return await response.json() } + /** + * Builds an endpoint URL for the specified parameters. + * + * @param {Parameters[0] & { resourceType?: string }} params The parameters for the endpoint. + * @returns {Promise} The built endpoint URL. + */ async buildEndpoint({ locale = "", resourceType = "", @@ -647,6 +733,13 @@ export class NextDrupal extends NextDrupalBase { ).toString() } + /** + * Fetches the endpoint URL for the specified resource type. + * + * @param {string} type The type of the resource. + * @param {Locale} locale The locale for the request. + * @returns {Promise} The fetched endpoint URL. + */ async fetchResourceEndpoint(type: string, locale?: Locale): Promise { const index = await this.getIndex(locale) @@ -670,6 +763,13 @@ export class NextDrupal extends NextDrupalBase { return url } + /** + * Fetches a menu by its name. + * + * @param {string} menuName The name of the menu. + * @param {JsonApiOptions & JsonApiWithCacheOptions & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise<{ items: T[], tree: T[] }>} The fetched menu. + */ async getMenu( menuName: string, options?: JsonApiOptions & @@ -735,6 +835,13 @@ export class NextDrupal extends NextDrupalBase { return menu } + /** + * Fetches a view by its name. + * + * @param {string} name The name of the view. + * @param {JsonApiOptions & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise>} The fetched view. + */ async getView( name: string, options?: JsonApiOptions & JsonApiWithNextFetchOptions @@ -776,6 +883,13 @@ export class NextDrupal extends NextDrupalBase { } } + /** + * Fetches a search index by its name. + * + * @param {string} name The name of the search index. + * @param {JsonApiOptions & JsonApiWithNextFetchOptions} options Options for the request. + * @returns {Promise} The fetched search index. + */ async getSearchIndex( name: string, options?: JsonApiOptions & JsonApiWithNextFetchOptions @@ -810,16 +924,24 @@ export class NextDrupal extends NextDrupalBase { return options.deserialize ? this.deserialize(json) : json } + /** + * Deserializes the response body. + * + * @param {any} body The response body. + * @param {any} options Options for deserialization. + * @returns {any} The deserialized response body. + */ deserialize(body, options?) { if (!body) return null return this.deserializer(body, options) } - // Error handling. - // If throwJsonApiErrors is enabled, we show errors in the Next.js overlay. - // Otherwise, we log the errors even if debugging is turned off. - // In production, errors are always logged never thrown. + /** + * Logs or throws an error based on the throwJsonApiErrors flag. + * + * @param {Error} error The error to log or throw. + */ logOrThrowError(error: Error) { if (!this.throwJsonApiErrors) { this.logger.error(error) diff --git a/packages/next-drupal/src/types/next-drupal-base.ts b/packages/next-drupal/src/types/next-drupal-base.ts index 53ed464e..873005de 100644 --- a/packages/next-drupal/src/types/next-drupal-base.ts +++ b/packages/next-drupal/src/types/next-drupal-base.ts @@ -61,7 +61,7 @@ export type NextDrupalBaseOptions = { /** * Set custom headers for the fetcher. * - * * **Default value**: { "Content-Type": "application/vnd.api+json", Accept: "application/vnd.api+json" } + * * **Default value**: `{ "Content-Type": "application/vnd.api+json", Accept: "application/vnd.api+json" }` * * **Required**: *No* * * [Documentation](https://next-drupal.org/docs/client/configuration#headers) diff --git a/www/config/docs.ts b/www/config/docs.ts index 1bdbed9d..86275016 100644 --- a/www/config/docs.ts +++ b/www/config/docs.ts @@ -117,6 +117,15 @@ export const docsConfig: DocsConfig = { }, ], }, + { + title: "API", + items: [ + { + title: "API Reference", + href: "/docs/api/globals", + }, + ], + }, { title: "Reference", items: [ diff --git a/www/content/docs/api/README.mdx b/www/content/docs/api/README.mdx new file mode 100644 index 00000000..c5dc3e26 --- /dev/null +++ b/www/content/docs/api/README.mdx @@ -0,0 +1,66 @@ +
+ Next.js for drupal +

Next.js for Drupal

+

Next-generation front-end for your Drupal site.

+
+ +## Demo + +https://demo.next-drupal.org + +## Documentation + +https://next-drupal.org + +## Deploy to Vercel + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fchapter-three%2Fnext-drupal-basic-starter&env=NEXT_PUBLIC_DRUPAL_BASE_URL,NEXT_IMAGE_DOMAIN&envDescription=Learn%20more%20about%20environment%20variables&envLink=https%3A%2F%2Fnext-drupal.org%2Fdocs%2Fenvironment-variables&project-name=next-drupal&demo-title=Next.js%20for%20Drupal&demo-description=A%20next-generation%20front-end%20for%20your%20Drupal%20site.&demo-url=https%3A%2F%2Fdemo.next-drupal.org&demo-image=https%3A%2F%2Fnext-drupal.org%2Fimages%2Fdemo-screenshot.jpg) + +## Example + +A page with all "Article" nodes. + +```jsx +import { DrupalClient } from "next-drupal" + +const drupal = new DrupalClient("https://cms.next-drupal.org") + +export default function BlogPage({ articles }) { + return ( +
+ {articles?.length + ? nodes.map((node) => ( +
+

{node.title}

+
+ )) + : null} +
+ ) +} + +export async function getStaticProps(context) { + const articles = await drupal.getResourceCollectionFromContext( + "node--article", + context + ) + + return { + props: { + articles, + }, + } +} +``` + +## Supporting organizations + +Development sponsored by [Chapter Three](https://chapterthree.com) + +## Contributing + +If you're interested in contributing to Next.js for Drupal, please read the [contributing guidelines](https://github.com/chapter-three/next-drupal/blob/main/CONTRIBUTING.md) before submitting a pull request. diff --git a/www/content/docs/api/classes/JsonApiErrors.mdx b/www/content/docs/api/classes/JsonApiErrors.mdx new file mode 100644 index 00000000..ea6f29e3 --- /dev/null +++ b/www/content/docs/api/classes/JsonApiErrors.mdx @@ -0,0 +1,181 @@ +[next-drupal](../globals.mdx) / JsonApiErrors + +# Class: JsonApiErrors + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:16](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L16) + +## Extends + +- `Error` + +## Constructors + +### new JsonApiErrors() + +> **new JsonApiErrors**(`errors`, `statusCode`, `messagePrefix`): [`JsonApiErrors`](JsonApiErrors.mdx) + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:20](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L20) + +#### Parameters + +##### errors + +`string` | [`JsonApiError`](../interfaces/JsonApiError.mdx)[] + +##### statusCode + +`number` + +##### messagePrefix + +`string` = `""` + +#### Returns + +[`JsonApiErrors`](JsonApiErrors.mdx) + +#### Overrides + +`Error.constructor` + +## Properties + +### errors + +> **errors**: `string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[] + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:17](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L17) + +--- + +### message + +> **message**: `string` + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077 + +#### Inherited from + +`Error.message` + +--- + +### name + +> **name**: `string` + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076 + +#### Inherited from + +`Error.name` + +--- + +### stack? + +> `optional` **stack**: `string` + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078 + +#### Inherited from + +`Error.stack` + +--- + +### statusCode + +> **statusCode**: `number` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:18](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L18) + +--- + +### prepareStackTrace()? + +> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` + +Defined in: node_modules/@types/node/globals.d.ts:28 + +Optional override for formatting stack traces + +#### Parameters + +##### err + +`Error` + +##### stackTraces + +`CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +`Error.prepareStackTrace` + +--- + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +Defined in: node_modules/@types/node/globals.d.ts:30 + +#### Inherited from + +`Error.stackTraceLimit` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` + +Defined in: node_modules/@types/node/globals.d.ts:21 + +Create .stack property on a target object + +#### Parameters + +##### targetObject + +`object` + +##### constructorOpt? + +`Function` + +#### Returns + +`void` + +#### Inherited from + +`Error.captureStackTrace` + +--- + +### formatMessage() + +> `static` **formatMessage**(`errors`): `string` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:34](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L34) + +#### Parameters + +##### errors + +`string` | [`JsonApiError`](../interfaces/JsonApiError.mdx)[] + +#### Returns + +`string` diff --git a/www/content/docs/api/classes/NextDrupal.mdx b/www/content/docs/api/classes/NextDrupal.mdx new file mode 100644 index 00000000..f27d1d22 --- /dev/null +++ b/www/content/docs/api/classes/NextDrupal.mdx @@ -0,0 +1,1226 @@ +[next-drupal](../globals.mdx) / NextDrupal + +# Class: NextDrupal + +Defined in: [packages/next-drupal/src/next-drupal.ts:51](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L51) + +The NextDrupal class extends the NextDrupalBase class and provides methods +for interacting with a Drupal backend. + +## Extends + +- [`NextDrupalBase`](NextDrupalBase.mdx) + +## Extended by + +- [`NextDrupalPages`](NextDrupalPages.mdx) + +## Constructors + +### new NextDrupal() + +> **new NextDrupal**(`baseUrl`, `options`): [`NextDrupal`](NextDrupal.mdx) + +Defined in: [packages/next-drupal/src/next-drupal.ts:68](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L68) + +Instantiates a new NextDrupal. + +const client = new NextDrupal(baseUrl) + +#### Parameters + +##### baseUrl + +`string` + +The baseUrl of your Drupal site. Do not add the /jsonapi suffix. + +##### options + +[`NextDrupalOptions`](../type-aliases/NextDrupalOptions.mdx) = `{}` + +Options for NextDrupal. + +#### Returns + +[`NextDrupal`](NextDrupal.mdx) + +#### Overrides + +[`NextDrupalBase`](NextDrupalBase.mdx).[`constructor`](NextDrupalBase.mdx#constructors) + +## Properties + +### accessToken? + +> `optional` **accessToken**: [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L37) + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`accessToken`](NextDrupalBase.mdx#accesstoken) + +--- + +### baseUrl + +> **baseUrl**: `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:39](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L39) + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`baseUrl`](NextDrupalBase.mdx#baseurl-1) + +--- + +### cache? + +> `optional` **cache**: [`DataCache`](../interfaces/DataCache.mdx) + +Defined in: [packages/next-drupal/src/next-drupal.ts:52](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L52) + +--- + +### deserializer + +> **deserializer**: [`JsonDeserializer`](../type-aliases/JsonDeserializer.mdx) + +Defined in: [packages/next-drupal/src/next-drupal.ts:54](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L54) + +--- + +### fetcher()? + +> `optional` **fetcher**: (`input`, `init`?) => `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:41](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L41) + +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +##### input + +`RequestInfo` | `URL` + +##### init? + +`RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`fetcher`](NextDrupalBase.mdx#fetcher) + +--- + +### frontPage + +> **frontPage**: `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:43](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L43) + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`frontPage`](NextDrupalBase.mdx#frontpage) + +--- + +### isDebugEnabled + +> **isDebugEnabled**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:45](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L45) + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`isDebugEnabled`](NextDrupalBase.mdx#isdebugenabled) + +--- + +### logger + +> **logger**: [`Logger`](../interfaces/Logger.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:47](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L47) + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`logger`](NextDrupalBase.mdx#logger) + +--- + +### throwJsonApiErrors + +> **throwJsonApiErrors**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal.ts:56](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L56) + +--- + +### useDefaultEndpoints + +> **useDefaultEndpoints**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal.ts:58](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L58) + +--- + +### withAuth + +> **withAuth**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:49](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L49) + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`withAuth`](NextDrupalBase.mdx#withauth) + +## Accessors + +### apiPrefix + +#### Get Signature + +> **get** **apiPrefix**(): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:109](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L109) + +##### Returns + +`string` + +#### Set Signature + +> **set** **apiPrefix**(`apiPrefix`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:102](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L102) + +##### Parameters + +###### apiPrefix + +`string` + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`apiPrefix`](NextDrupalBase.mdx#apiprefix) + +--- + +### auth + +#### Get Signature + +> **get** **auth**(): [`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:158](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L158) + +##### Returns + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +#### Set Signature + +> **set** **auth**(`auth`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:113](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L113) + +##### Parameters + +###### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`auth`](NextDrupalBase.mdx#auth) + +--- + +### headers + +#### Get Signature + +> **get** **headers**(): `HeadersInit` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:166](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L166) + +##### Returns + +`HeadersInit` + +#### Set Signature + +> **set** **headers**(`headers`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:162](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L162) + +##### Parameters + +###### headers + +`HeadersInit` + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`headers`](NextDrupalBase.mdx#headers) + +--- + +### token + +#### Get Signature + +> **get** **token**(): [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:175](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L175) + +##### Returns + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### Set Signature + +> **set** **token**(`token`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:170](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L170) + +##### Parameters + +###### token + +[`AccessToken`](../interfaces/AccessToken.mdx) + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`token`](NextDrupalBase.mdx#token) + +## Methods + +### addLocalePrefix() + +> **addLocalePrefix**(`path`, `options`): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:391](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L391) + +Adds a locale prefix to the given path. + +#### Parameters + +##### path + +`string` + +The path. + +##### options + +The options for adding the locale prefix. + +###### defaultLocale + +`string` + +The default locale. + +###### locale + +`string` + +The locale. + +#### Returns + +`string` + +The path with the locale prefix. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`addLocalePrefix`](NextDrupalBase.mdx#addlocaleprefix) + +--- + +### buildEndpoint() + +> **buildEndpoint**(`params`): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:699](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L699) + +Builds an endpoint URL for the specified parameters. + +#### Parameters + +##### params + +`object` & `object` = `{}` + +The parameters for the endpoint. + +#### Returns + +`Promise`\<`string`\> + +The built endpoint URL. + +#### Overrides + +[`NextDrupalBase`](NextDrupalBase.mdx).[`buildEndpoint`](NextDrupalBase.mdx#buildendpoint) + +--- + +### buildUrl() + +> **buildUrl**(`path`, `searchParams`?): `URL` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:276](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L276) + +Builds a URL with the given path and search parameters. + +#### Parameters + +##### path + +`string` + +The URL path. + +##### searchParams? + +[`EndpointSearchParams`](../type-aliases/EndpointSearchParams.mdx) + +The search parameters. + +#### Returns + +`URL` + +The constructed URL. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`buildUrl`](NextDrupalBase.mdx#buildurl) + +--- + +### constructPathFromSegment() + +> **constructPathFromSegment**(`segment`, `options`): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:335](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L335) + +Constructs a path from the given segment and options. + +#### Parameters + +##### segment + +The path segment. + +`string` | `string`[] + +##### options + +The options for constructing the path. + +###### defaultLocale + +`string` + +The default locale. + +###### locale + +`string` + +The locale. + +###### pathPrefix + +`string` + +The path prefix. + +#### Returns + +`string` + +The constructed path. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`constructPathFromSegment`](NextDrupalBase.mdx#constructpathfromsegment) + +--- + +### createFileResource() + +> **createFileResource**\<`T`\>(`type`, `body`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:149](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L149) + +Creates a new file resource for the specified media type. + +#### Type Parameters + +• **T** = [`DrupalFile`](../interfaces/DrupalFile.mdx) + +#### Parameters + +##### type + +`string` + +The type of the media. + +##### body + +[`JsonApiCreateFileResourceBody`](../interfaces/JsonApiCreateFileResourceBody.mdx) + +The body of the file resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The created file resource. + +--- + +### createResource() + +> **createResource**\<`T`\>(`type`, `body`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:101](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L101) + +Creates a new resource of the specified type. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### body + +[`JsonApiCreateResourceBody`](../interfaces/JsonApiCreateResourceBody.mdx) + +The body of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The created resource. + +--- + +### debug() + +> **debug**(`message`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:538](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L538) + +Logs a debug message if debug mode is enabled. + +#### Parameters + +##### message + +`any` + +The debug message. + +#### Returns + +`void` + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`debug`](NextDrupalBase.mdx#debug) + +--- + +### deleteResource() + +> **deleteResource**(`type`, `uuid`, `options`?): `Promise`\<`boolean`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:253](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L253) + +Deletes an existing resource of the specified type. + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### uuid + +`string` + +The UUID of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`boolean`\> + +True if the resource was deleted, false otherwise. + +--- + +### deserialize() + +> **deserialize**(`body`, `options`?): `TJsonaModel` \| `TJsonaModel`[] + +Defined in: [packages/next-drupal/src/next-drupal.ts:934](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L934) + +Deserializes the response body. + +#### Parameters + +##### body + +`any` + +The response body. + +##### options? + +`any` + +Options for deserialization. + +#### Returns + +`TJsonaModel` \| `TJsonaModel`[] + +The deserialized response body. + +--- + +### fetch() + +> **fetch**(`input`, `init`): `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:186](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L186) + +Fetches a resource from the given input URL or path. + +#### Parameters + +##### input + +`RequestInfo` + +The input URL or path. + +##### init + +[`FetchOptions`](../interfaces/FetchOptions.mdx) = `{}` + +The fetch options. + +#### Returns + +`Promise`\<`Response`\> + +The fetch response. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`fetch`](NextDrupalBase.mdx#fetch) + +--- + +### fetchResourceEndpoint() + +> **fetchResourceEndpoint**(`type`, `locale`?): `Promise`\<`URL`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:743](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L743) + +Fetches the endpoint URL for the specified resource type. + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### locale? + +`string` + +The locale for the request. + +#### Returns + +`Promise`\<`URL`\> + +The fetched endpoint URL. + +--- + +### getAccessToken() + +> **getAccessToken**(`clientIdSecret`?): `Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:415](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L415) + +Gets an access token using the provided client ID and secret. + +#### Parameters + +##### clientIdSecret? + +[`NextDrupalAuthClientIdSecret`](../interfaces/NextDrupalAuthClientIdSecret.mdx) + +The client ID and secret. + +#### Returns + +`Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +The access token. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`getAccessToken`](NextDrupalBase.mdx#getaccesstoken) + +--- + +### getAuthorizationHeader() + +> **getAuthorizationHeader**(`auth`): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:234](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L234) + +Gets the authorization header value based on the provided auth configuration. + +#### Parameters + +##### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The auth configuration. + +#### Returns + +`Promise`\<`string`\> + +The authorization header value. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`getAuthorizationHeader`](NextDrupalBase.mdx#getauthorizationheader) + +--- + +### getErrorsFromResponse() + +> **getErrorsFromResponse**(`response`): `Promise`\<`string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[]\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:562](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L562) + +Extracts errors from the fetch response. + +#### Parameters + +##### response + +`Response` + +The fetch response. + +#### Returns + +`Promise`\<`string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[]\> + +The extracted errors. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`getErrorsFromResponse`](NextDrupalBase.mdx#geterrorsfromresponse) + +--- + +### getIndex() + +> **getIndex**(`locale`?, `options`?): `Promise`\<[`JsonApiResponse`](../interfaces/JsonApiResponse.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:669](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L669) + +Fetches the JSON:API index. + +#### Parameters + +##### locale? + +`string` + +The locale for the request. + +##### options? + +[`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`JsonApiResponse`](../interfaces/JsonApiResponse.mdx)\> + +The JSON:API index. + +--- + +### getMenu() + +> **getMenu**\<`T`\>(`menuName`, `options`?): `Promise`\<\{ `items`: `T`[]; `tree`: `T`[]; \}\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:773](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L773) + +Fetches a menu by its name. + +#### Type Parameters + +• **T** = [`DrupalMenuItem`](../interfaces/DrupalMenuItem.mdx) + +#### Parameters + +##### menuName + +`string` + +The name of the menu. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithCacheOptions`](../type-aliases/JsonApiWithCacheOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<\{ `items`: `T`[]; `tree`: `T`[]; \}\> + +The fetched menu. + +--- + +### getResource() + +> **getResource**\<`T`\>(`type`, `uuid`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:294](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L294) + +Fetches a resource of the specified type by its UUID. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### uuid + +`string` + +The UUID of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithCacheOptions`](../type-aliases/JsonApiWithCacheOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched resource. + +--- + +### getResourceByPath() + +> **getResourceByPath**\<`T`\>(`path`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:356](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L356) + +Fetches a resource of the specified type by its path. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### path + +`string` + +The path of the resource. + +##### options? + +`object` & [`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched resource. + +--- + +### getResourceCollection() + +> **getResourceCollection**\<`T`\>(`type`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:472](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L472) + +Fetches a collection of resources of the specified type. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +#### Parameters + +##### type + +`string` + +The type of the resources. + +##### options? + +`object` & [`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched collection of resources. + +--- + +### getResourceCollectionPathSegments() + +> **getResourceCollectionPathSegments**(`types`, `options`?): `Promise`\<`object`[]\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:516](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L516) + +Fetches path segments for a collection of resources of the specified types. + +#### Parameters + +##### types + +The types of the resources. + +`string` | `string`[] + +##### options? + +`object` & [`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) & JsonApiWithNextFetchOptions & (\{ locales: string\[\]; defaultLocale: string; \} \| \{ locales?: undefined; defaultLocale?: never; \}) + +Options for the request. + +#### Returns + +`Promise`\<`object`[]\> + +The fetched path segments. + +--- + +### getSearchIndex() + +> **getSearchIndex**\<`T`\>(`name`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:893](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L893) + +Fetches a search index by its name. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +#### Parameters + +##### name + +`string` + +The name of the search index. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched search index. + +--- + +### getView() + +> **getView**\<`T`\>(`name`, `options`?): `Promise`\<[`DrupalView`](../interfaces/DrupalView.mdx)\<`T`\>\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:845](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L845) + +Fetches a view by its name. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### name + +`string` + +The name of the view. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`DrupalView`](../interfaces/DrupalView.mdx)\<`T`\>\> + +The fetched view. + +--- + +### logOrThrowError() + +> **logOrThrowError**(`error`): `void` + +Defined in: [packages/next-drupal/src/next-drupal.ts:945](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L945) + +Logs or throws an error based on the throwJsonApiErrors flag. + +#### Parameters + +##### error + +`Error` + +The error to log or throw. + +#### Returns + +`void` + +--- + +### throwIfJsonErrors() + +> **throwIfJsonErrors**(`response`, `messagePrefix`): `Promise`\<`void`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:549](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L549) + +Throws an error if the response contains JSON:API errors. + +#### Parameters + +##### response + +`Response` + +The fetch response. + +##### messagePrefix + +`string` = `""` + +The error message prefix. + +#### Returns + +`Promise`\<`void`\> + +#### Throws + +The JSON:API errors. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`throwIfJsonErrors`](NextDrupalBase.mdx#throwifjsonerrors) + +--- + +### translatePath() + +> **translatePath**(`path`, `options`?): `Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:631](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L631) + +Translates a path to a DrupalTranslatedPath object. + +#### Parameters + +##### path + +`string` + +The path to translate. + +##### options? + +[`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +The translated path. + +--- + +### updateResource() + +> **updateResource**\<`T`\>(`type`, `uuid`, `body`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:202](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L202) + +Updates an existing resource of the specified type. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### uuid + +`string` + +The UUID of the resource. + +##### body + +[`JsonApiUpdateResourceBody`](../interfaces/JsonApiUpdateResourceBody.mdx) + +The body of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The updated resource. + +--- + +### validateDraftUrl() + +> **validateDraftUrl**(`searchParams`): `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:500](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L500) + +Validates the draft URL using the provided search parameters. + +#### Parameters + +##### searchParams + +`URLSearchParams` + +The search parameters. + +#### Returns + +`Promise`\<`Response`\> + +The validation response. + +#### Inherited from + +[`NextDrupalBase`](NextDrupalBase.mdx).[`validateDraftUrl`](NextDrupalBase.mdx#validatedrafturl) diff --git a/www/content/docs/api/classes/NextDrupalBase.mdx b/www/content/docs/api/classes/NextDrupalBase.mdx new file mode 100644 index 00000000..572afd32 --- /dev/null +++ b/www/content/docs/api/classes/NextDrupalBase.mdx @@ -0,0 +1,569 @@ +[next-drupal](../globals.mdx) / NextDrupalBase + +# Class: NextDrupalBase + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:36](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L36) + +The base class for NextDrupal clients. + +## Extended by + +- [`NextDrupal`](NextDrupal.mdx) + +## Constructors + +### new NextDrupalBase() + +> **new NextDrupalBase**(`baseUrl`, `options`): [`NextDrupalBase`](NextDrupalBase.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:71](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L71) + +Instantiates a new NextDrupalBase. + +const client = new NextDrupalBase(baseUrl) + +#### Parameters + +##### baseUrl + +`string` + +The baseUrl of your Drupal site. Do not add the /jsonapi suffix. + +##### options + +[`NextDrupalBaseOptions`](../type-aliases/NextDrupalBaseOptions.mdx) = `{}` + +Options for NextDrupalBase. + +#### Returns + +[`NextDrupalBase`](NextDrupalBase.mdx) + +## Properties + +### accessToken? + +> `optional` **accessToken**: [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L37) + +--- + +### baseUrl + +> **baseUrl**: `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:39](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L39) + +--- + +### fetcher()? + +> `optional` **fetcher**: (`input`, `init`?) => `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:41](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L41) + +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +##### input + +`RequestInfo` | `URL` + +##### init? + +`RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +--- + +### frontPage + +> **frontPage**: `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:43](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L43) + +--- + +### isDebugEnabled + +> **isDebugEnabled**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:45](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L45) + +--- + +### logger + +> **logger**: [`Logger`](../interfaces/Logger.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:47](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L47) + +--- + +### withAuth + +> **withAuth**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:49](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L49) + +## Accessors + +### apiPrefix + +#### Get Signature + +> **get** **apiPrefix**(): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:109](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L109) + +##### Returns + +`string` + +#### Set Signature + +> **set** **apiPrefix**(`apiPrefix`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:102](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L102) + +##### Parameters + +###### apiPrefix + +`string` + +##### Returns + +`void` + +--- + +### auth + +#### Get Signature + +> **get** **auth**(): [`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:158](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L158) + +##### Returns + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +#### Set Signature + +> **set** **auth**(`auth`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:113](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L113) + +##### Parameters + +###### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +##### Returns + +`void` + +--- + +### headers + +#### Get Signature + +> **get** **headers**(): `HeadersInit` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:166](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L166) + +##### Returns + +`HeadersInit` + +#### Set Signature + +> **set** **headers**(`headers`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:162](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L162) + +##### Parameters + +###### headers + +`HeadersInit` + +##### Returns + +`void` + +--- + +### token + +#### Get Signature + +> **get** **token**(): [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:175](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L175) + +##### Returns + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### Set Signature + +> **set** **token**(`token`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:170](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L170) + +##### Parameters + +###### token + +[`AccessToken`](../interfaces/AccessToken.mdx) + +##### Returns + +`void` + +## Methods + +### addLocalePrefix() + +> **addLocalePrefix**(`path`, `options`): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:391](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L391) + +Adds a locale prefix to the given path. + +#### Parameters + +##### path + +`string` + +The path. + +##### options + +The options for adding the locale prefix. + +###### defaultLocale + +`string` + +The default locale. + +###### locale + +`string` + +The locale. + +#### Returns + +`string` + +The path with the locale prefix. + +--- + +### buildEndpoint() + +> **buildEndpoint**(`options`): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:304](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L304) + +Builds an endpoint URL with the given options. + +#### Parameters + +##### options + +The options for building the endpoint. + +###### locale + +`string` = `""` + +The locale. + +###### path + +`string` = `""` + +The path. + +###### searchParams + +[`EndpointSearchParams`](../type-aliases/EndpointSearchParams.mdx) + +The search parameters. + +#### Returns + +`Promise`\<`string`\> + +The constructed endpoint URL. + +--- + +### buildUrl() + +> **buildUrl**(`path`, `searchParams`?): `URL` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:276](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L276) + +Builds a URL with the given path and search parameters. + +#### Parameters + +##### path + +`string` + +The URL path. + +##### searchParams? + +[`EndpointSearchParams`](../type-aliases/EndpointSearchParams.mdx) + +The search parameters. + +#### Returns + +`URL` + +The constructed URL. + +--- + +### constructPathFromSegment() + +> **constructPathFromSegment**(`segment`, `options`): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:335](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L335) + +Constructs a path from the given segment and options. + +#### Parameters + +##### segment + +The path segment. + +`string` | `string`[] + +##### options + +The options for constructing the path. + +###### defaultLocale + +`string` + +The default locale. + +###### locale + +`string` + +The locale. + +###### pathPrefix + +`string` + +The path prefix. + +#### Returns + +`string` + +The constructed path. + +--- + +### debug() + +> **debug**(`message`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:538](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L538) + +Logs a debug message if debug mode is enabled. + +#### Parameters + +##### message + +`any` + +The debug message. + +#### Returns + +`void` + +--- + +### fetch() + +> **fetch**(`input`, `init`): `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:186](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L186) + +Fetches a resource from the given input URL or path. + +#### Parameters + +##### input + +`RequestInfo` + +The input URL or path. + +##### init + +[`FetchOptions`](../interfaces/FetchOptions.mdx) = `{}` + +The fetch options. + +#### Returns + +`Promise`\<`Response`\> + +The fetch response. + +--- + +### getAccessToken() + +> **getAccessToken**(`clientIdSecret`?): `Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:415](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L415) + +Gets an access token using the provided client ID and secret. + +#### Parameters + +##### clientIdSecret? + +[`NextDrupalAuthClientIdSecret`](../interfaces/NextDrupalAuthClientIdSecret.mdx) + +The client ID and secret. + +#### Returns + +`Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +The access token. + +--- + +### getAuthorizationHeader() + +> **getAuthorizationHeader**(`auth`): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:234](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L234) + +Gets the authorization header value based on the provided auth configuration. + +#### Parameters + +##### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The auth configuration. + +#### Returns + +`Promise`\<`string`\> + +The authorization header value. + +--- + +### getErrorsFromResponse() + +> **getErrorsFromResponse**(`response`): `Promise`\<`string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[]\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:562](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L562) + +Extracts errors from the fetch response. + +#### Parameters + +##### response + +`Response` + +The fetch response. + +#### Returns + +`Promise`\<`string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[]\> + +The extracted errors. + +--- + +### throwIfJsonErrors() + +> **throwIfJsonErrors**(`response`, `messagePrefix`): `Promise`\<`void`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:549](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L549) + +Throws an error if the response contains JSON:API errors. + +#### Parameters + +##### response + +`Response` + +The fetch response. + +##### messagePrefix + +`string` = `""` + +The error message prefix. + +#### Returns + +`Promise`\<`void`\> + +#### Throws + +The JSON:API errors. + +--- + +### validateDraftUrl() + +> **validateDraftUrl**(`searchParams`): `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:500](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L500) + +Validates the draft URL using the provided search parameters. + +#### Parameters + +##### searchParams + +`URLSearchParams` + +The search parameters. + +#### Returns + +`Promise`\<`Response`\> + +The validation response. diff --git a/www/content/docs/api/classes/NextDrupalPages.mdx b/www/content/docs/api/classes/NextDrupalPages.mdx new file mode 100644 index 00000000..991baf27 --- /dev/null +++ b/www/content/docs/api/classes/NextDrupalPages.mdx @@ -0,0 +1,1774 @@ +[next-drupal](../globals.mdx) / NextDrupalPages + +# Class: NextDrupalPages + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:34](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L34) + +The NextDrupalPages class extends the NextDrupal class and provides methods +for interacting with a Drupal backend in the context of Next.js pages. + +## Extends + +- [`NextDrupal`](NextDrupal.mdx) + +## Constructors + +### new NextDrupalPages() + +> **new NextDrupalPages**(`baseUrl`, `options`): [`NextDrupalPages`](NextDrupalPages.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:45](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L45) + +Instantiates a new NextDrupalPages. + +const client = new NextDrupalPages(baseUrl) + +#### Parameters + +##### baseUrl + +`string` + +The baseUrl of your Drupal site. Do not add the /jsonapi suffix. + +##### options + +[`DrupalClientOptions`](../type-aliases/DrupalClientOptions.mdx) = `{}` + +Options for the client. See Experiment_DrupalClientOptions. + +#### Returns + +[`NextDrupalPages`](NextDrupalPages.mdx) + +#### Overrides + +[`NextDrupal`](NextDrupal.mdx).[`constructor`](NextDrupal.mdx#constructors) + +## Properties + +### accessToken? + +> `optional` **accessToken**: [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L37) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`accessToken`](NextDrupal.mdx#accesstoken) + +--- + +### baseUrl + +> **baseUrl**: `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:39](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L39) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`baseUrl`](NextDrupal.mdx#baseurl-1) + +--- + +### cache? + +> `optional` **cache**: [`DataCache`](../interfaces/DataCache.mdx) + +Defined in: [packages/next-drupal/src/next-drupal.ts:52](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L52) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`cache`](NextDrupal.mdx#cache) + +--- + +### deserializer + +> **deserializer**: [`JsonDeserializer`](../type-aliases/JsonDeserializer.mdx) + +Defined in: [packages/next-drupal/src/next-drupal.ts:54](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L54) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`deserializer`](NextDrupal.mdx#deserializer) + +--- + +### fetcher()? + +> `optional` **fetcher**: (`input`, `init`?) => `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:41](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L41) + +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +##### input + +`RequestInfo` | `URL` + +##### init? + +`RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`fetcher`](NextDrupal.mdx#fetcher) + +--- + +### frontPage + +> **frontPage**: `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:43](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L43) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`frontPage`](NextDrupal.mdx#frontpage) + +--- + +### getPathsFromContext() + +> **getPathsFromContext**: (`types`, `context`, `options`?) => `Promise`\<(`string` \| \{ `locale`: `string`; `params`: \{ `slug`: `string`[]; \}; \})[]\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:273](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L273) + +Gets static paths from the context. + +#### Parameters + +##### types + +The types of the resources. + +`string` | `string`[] + +##### context + +`GetStaticPathsContext` + +The static paths context. + +##### options? + +`object` & [`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) + +Options for the request. + +#### Returns + +`Promise`\<(`string` \| \{ `locale`: `string`; `params`: \{ `slug`: `string`[]; \}; \})[]\> + +The fetched static paths. + +--- + +### isDebugEnabled + +> **isDebugEnabled**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:45](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L45) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`isDebugEnabled`](NextDrupal.mdx#isdebugenabled) + +--- + +### logger + +> **logger**: [`Logger`](../interfaces/Logger.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:47](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L47) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`logger`](NextDrupal.mdx#logger) + +--- + +### throwJsonApiErrors + +> **throwJsonApiErrors**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal.ts:56](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L56) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`throwJsonApiErrors`](NextDrupal.mdx#throwjsonapierrors) + +--- + +### useDefaultEndpoints + +> **useDefaultEndpoints**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal.ts:58](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L58) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`useDefaultEndpoints`](NextDrupal.mdx#usedefaultendpoints) + +--- + +### withAuth + +> **withAuth**: `boolean` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:49](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L49) + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`withAuth`](NextDrupal.mdx#withauth) + +## Accessors + +### apiPrefix + +#### Get Signature + +> **get** **apiPrefix**(): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:109](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L109) + +##### Returns + +`string` + +#### Set Signature + +> **set** **apiPrefix**(`apiPrefix`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:102](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L102) + +##### Parameters + +###### apiPrefix + +`string` + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`apiPrefix`](NextDrupal.mdx#apiprefix) + +--- + +### auth + +#### Get Signature + +> **get** **auth**(): [`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:158](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L158) + +##### Returns + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +#### Set Signature + +> **set** **auth**(`auth`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:113](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L113) + +##### Parameters + +###### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`auth`](NextDrupal.mdx#auth) + +--- + +### headers + +#### Get Signature + +> **get** **headers**(): `HeadersInit` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:166](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L166) + +##### Returns + +`HeadersInit` + +#### Set Signature + +> **set** **headers**(`headers`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:162](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L162) + +##### Parameters + +###### headers + +`HeadersInit` + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`headers`](NextDrupal.mdx#headers) + +--- + +### token + +#### Get Signature + +> **get** **token**(): [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:175](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L175) + +##### Returns + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### Set Signature + +> **set** **token**(`token`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:170](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L170) + +##### Parameters + +###### token + +[`AccessToken`](../interfaces/AccessToken.mdx) + +##### Returns + +`void` + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`token`](NextDrupal.mdx#token) + +## Methods + +### addLocalePrefix() + +> **addLocalePrefix**(`path`, `options`): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:391](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L391) + +Adds a locale prefix to the given path. + +#### Parameters + +##### path + +`string` + +The path. + +##### options + +The options for adding the locale prefix. + +###### defaultLocale + +`string` + +The default locale. + +###### locale + +`string` + +The locale. + +#### Returns + +`string` + +The path with the locale prefix. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`addLocalePrefix`](NextDrupal.mdx#addlocaleprefix) + +--- + +### buildEndpoint() + +> **buildEndpoint**(`params`): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:699](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L699) + +Builds an endpoint URL for the specified parameters. + +#### Parameters + +##### params + +`object` & `object` = `{}` + +The parameters for the endpoint. + +#### Returns + +`Promise`\<`string`\> + +The built endpoint URL. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`buildEndpoint`](NextDrupal.mdx#buildendpoint) + +--- + +### buildMenuTree() + +> **buildMenuTree**(`links`, `parent`): `DrupalMenuTree` + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:84](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L84) + +#### Parameters + +##### links + +[`DrupalMenuItem`](../interfaces/DrupalMenuItem.mdx)[] + +##### parent + +`string` = `""` + +#### Returns + +`DrupalMenuTree` + +--- + +### buildStaticPathsFromResources() + +> **buildStaticPathsFromResources**(`resources`, `options`?): `object`[] + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:358](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L358) + +Builds static paths from resources. + +#### Parameters + +##### resources + +`object`[] + +The resources. + +##### options? + +Options for the request. + +###### locale + +`string` + +###### pathPrefix + +`string` + +#### Returns + +`object`[] + +The built static paths. + +--- + +### buildStaticPathsParamsFromPaths() + +> **buildStaticPathsParamsFromPaths**(`paths`, `options`?): `object`[] + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:387](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L387) + +Builds static paths parameters from paths. + +#### Parameters + +##### paths + +`string`[] + +The paths. + +##### options? + +Options for the request. + +###### locale + +`string` + +###### pathPrefix + +`string` + +#### Returns + +`object`[] + +The built static paths parameters. + +--- + +### buildUrl() + +> **buildUrl**(`path`, `searchParams`?): `URL` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:276](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L276) + +Builds a URL with the given path and search parameters. + +#### Parameters + +##### path + +`string` + +The URL path. + +##### searchParams? + +[`EndpointSearchParams`](../type-aliases/EndpointSearchParams.mdx) + +The search parameters. + +#### Returns + +`URL` + +The constructed URL. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`buildUrl`](NextDrupal.mdx#buildurl) + +--- + +### constructPathFromSegment() + +> **constructPathFromSegment**(`segment`, `options`): `string` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:335](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L335) + +Constructs a path from the given segment and options. + +#### Parameters + +##### segment + +The path segment. + +`string` | `string`[] + +##### options + +The options for constructing the path. + +###### defaultLocale + +`string` + +The default locale. + +###### locale + +`string` + +The locale. + +###### pathPrefix + +`string` + +The path prefix. + +#### Returns + +`string` + +The constructed path. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`constructPathFromSegment`](NextDrupal.mdx#constructpathfromsegment) + +--- + +### createFileResource() + +> **createFileResource**\<`T`\>(`type`, `body`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:149](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L149) + +Creates a new file resource for the specified media type. + +#### Type Parameters + +• **T** = [`DrupalFile`](../interfaces/DrupalFile.mdx) + +#### Parameters + +##### type + +`string` + +The type of the media. + +##### body + +[`JsonApiCreateFileResourceBody`](../interfaces/JsonApiCreateFileResourceBody.mdx) + +The body of the file resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The created file resource. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`createFileResource`](NextDrupal.mdx#createfileresource) + +--- + +### createResource() + +> **createResource**\<`T`\>(`type`, `body`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:101](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L101) + +Creates a new resource of the specified type. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### body + +[`JsonApiCreateResourceBody`](../interfaces/JsonApiCreateResourceBody.mdx) + +The body of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The created resource. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`createResource`](NextDrupal.mdx#createresource) + +--- + +### debug() + +> **debug**(`message`): `void` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:538](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L538) + +Logs a debug message if debug mode is enabled. + +#### Parameters + +##### message + +`any` + +The debug message. + +#### Returns + +`void` + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`debug`](NextDrupal.mdx#debug) + +--- + +### deleteResource() + +> **deleteResource**(`type`, `uuid`, `options`?): `Promise`\<`boolean`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:253](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L253) + +Deletes an existing resource of the specified type. + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### uuid + +`string` + +The UUID of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`boolean`\> + +True if the resource was deleted, false otherwise. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`deleteResource`](NextDrupal.mdx#deleteresource) + +--- + +### deserialize() + +> **deserialize**(`body`, `options`?): `TJsonaModel` \| `TJsonaModel`[] + +Defined in: [packages/next-drupal/src/next-drupal.ts:934](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L934) + +Deserializes the response body. + +#### Parameters + +##### body + +`any` + +The response body. + +##### options? + +`any` + +Options for deserialization. + +#### Returns + +`TJsonaModel` \| `TJsonaModel`[] + +The deserialized response body. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`deserialize`](NextDrupal.mdx#deserialize) + +--- + +### fetch() + +> **fetch**(`input`, `init`): `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:186](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L186) + +Fetches a resource from the given input URL or path. + +#### Parameters + +##### input + +`RequestInfo` + +The input URL or path. + +##### init + +[`FetchOptions`](../interfaces/FetchOptions.mdx) = `{}` + +The fetch options. + +#### Returns + +`Promise`\<`Response`\> + +The fetch response. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`fetch`](NextDrupal.mdx#fetch) + +--- + +### fetchResourceEndpoint() + +> **fetchResourceEndpoint**(`type`, `locale`?): `Promise`\<`URL`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:743](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L743) + +Fetches the endpoint URL for the specified resource type. + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### locale? + +`string` + +The locale for the request. + +#### Returns + +`Promise`\<`URL`\> + +The fetched endpoint URL. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`fetchResourceEndpoint`](NextDrupal.mdx#fetchresourceendpoint) + +--- + +### getAccessToken() + +> **getAccessToken**(`clientIdSecret`?): `Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:415](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L415) + +Gets an access token using the provided client ID and secret. + +#### Parameters + +##### clientIdSecret? + +[`NextDrupalAuthClientIdSecret`](../interfaces/NextDrupalAuthClientIdSecret.mdx) + +The client ID and secret. + +#### Returns + +`Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +The access token. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getAccessToken`](NextDrupal.mdx#getaccesstoken) + +--- + +### getAuthFromContextAndOptions() + +> **getAuthFromContextAndOptions**(`context`, `options`): `boolean` \| [`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:521](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L521) + +Gets the authentication configuration from the context and options. + +#### Parameters + +##### context + +`GetStaticPropsContext` + +The static props context. + +##### options + +[`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) + +Options for the request. + +#### Returns + +`boolean` \| [`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The authentication configuration. + +--- + +### getAuthorizationHeader() + +> **getAuthorizationHeader**(`auth`): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:234](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L234) + +Gets the authorization header value based on the provided auth configuration. + +#### Parameters + +##### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The auth configuration. + +#### Returns + +`Promise`\<`string`\> + +The authorization header value. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getAuthorizationHeader`](NextDrupal.mdx#getauthorizationheader) + +--- + +### getEntryForResourceType() + +> **getEntryForResourceType**(`resourceType`, `locale`?): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:73](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L73) + +Gets the entry point for a given resource type. + +#### Parameters + +##### resourceType + +`string` + +The resource type. + +##### locale? + +`string` + +The locale. + +#### Returns + +`Promise`\<`string`\> + +The entry point URL. + +--- + +### getErrorsFromResponse() + +> **getErrorsFromResponse**(`response`): `Promise`\<`string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[]\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:562](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L562) + +Extracts errors from the fetch response. + +#### Parameters + +##### response + +`Response` + +The fetch response. + +#### Returns + +`Promise`\<`string` \| [`JsonApiError`](../interfaces/JsonApiError.mdx)[]\> + +The extracted errors. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getErrorsFromResponse`](NextDrupal.mdx#geterrorsfromresponse) + +--- + +### getIndex() + +> **getIndex**(`locale`?, `options`?): `Promise`\<[`JsonApiResponse`](../interfaces/JsonApiResponse.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:669](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L669) + +Fetches the JSON:API index. + +#### Parameters + +##### locale? + +`string` + +The locale for the request. + +##### options? + +[`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`JsonApiResponse`](../interfaces/JsonApiResponse.mdx)\> + +The JSON:API index. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getIndex`](NextDrupal.mdx#getindex) + +--- + +### getMenu() + +> **getMenu**\<`T`\>(`menuName`, `options`?): `Promise`\<\{ `items`: `T`[]; `tree`: `T`[]; \}\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:773](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L773) + +Fetches a menu by its name. + +#### Type Parameters + +• **T** = [`DrupalMenuItem`](../interfaces/DrupalMenuItem.mdx) + +#### Parameters + +##### menuName + +`string` + +The name of the menu. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithCacheOptions`](../type-aliases/JsonApiWithCacheOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<\{ `items`: `T`[]; `tree`: `T`[]; \}\> + +The fetched menu. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getMenu`](NextDrupal.mdx#getmenu) + +--- + +### getPathFromContext() + +> **getPathFromContext**(`context`, `options`?): `string` + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:260](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L260) + +Gets the path from the context. + +#### Parameters + +##### context + +`GetStaticPropsContext` + +The static props context. + +##### options? + +Options for the request. + +###### pathPrefix + +`string` + +#### Returns + +`string` + +The constructed path. + +--- + +### getResource() + +> **getResource**\<`T`\>(`type`, `uuid`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:294](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L294) + +Fetches a resource of the specified type by its UUID. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### uuid + +`string` + +The UUID of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithCacheOptions`](../type-aliases/JsonApiWithCacheOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched resource. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getResource`](NextDrupal.mdx#getresource) + +--- + +### getResourceByPath() + +> **getResourceByPath**\<`T`\>(`path`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:356](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L356) + +Fetches a resource of the specified type by its path. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### path + +`string` + +The path of the resource. + +##### options? + +`object` & [`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched resource. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getResourceByPath`](NextDrupal.mdx#getresourcebypath) + +--- + +### getResourceCollection() + +> **getResourceCollection**\<`T`\>(`type`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:472](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L472) + +Fetches a collection of resources of the specified type. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +#### Parameters + +##### type + +`string` + +The type of the resources. + +##### options? + +`object` & [`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched collection of resources. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getResourceCollection`](NextDrupal.mdx#getresourcecollection) + +--- + +### getResourceCollectionFromContext() + +> **getResourceCollectionFromContext**\<`T`\>(`type`, `context`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:187](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L187) + +Gets a collection of resources from the context. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +#### Parameters + +##### type + +`string` + +The type of the resources. + +##### context + +`GetStaticPropsContext` + +The static props context. + +##### options? + +`object` & [`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched collection of resources. + +--- + +### getResourceCollectionPathSegments() + +> **getResourceCollectionPathSegments**(`types`, `options`?): `Promise`\<`object`[]\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:516](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L516) + +Fetches path segments for a collection of resources of the specified types. + +#### Parameters + +##### types + +The types of the resources. + +`string` | `string`[] + +##### options? + +`object` & [`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) & JsonApiWithNextFetchOptions & (\{ locales: string\[\]; defaultLocale: string; \} \| \{ locales?: undefined; defaultLocale?: never; \}) + +Options for the request. + +#### Returns + +`Promise`\<`object`[]\> + +The fetched path segments. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getResourceCollectionPathSegments`](NextDrupal.mdx#getresourcecollectionpathsegments) + +--- + +### getResourceFromContext() + +> **getResourceFromContext**\<`T`\>(`input`, `context`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:96](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L96) + +Gets a resource from the context. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### input + +The input path or translated path. + +`string` | [`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx) + +##### context + +`GetStaticPropsContext` + +The static props context. + +##### options? + +`object` & [`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched resource. + +--- + +### getSearchIndex() + +> **getSearchIndex**\<`T`\>(`name`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:893](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L893) + +Fetches a search index by its name. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +#### Parameters + +##### name + +`string` + +The name of the search index. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched search index. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getSearchIndex`](NextDrupal.mdx#getsearchindex) + +--- + +### getSearchIndexFromContext() + +> **getSearchIndexFromContext**\<`T`\>(`name`, `context`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:215](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L215) + +Gets a search index from the context. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +#### Parameters + +##### name + +`string` + +The name of the search index. + +##### context + +`GetStaticPropsContext` + +The static props context. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The fetched search index. + +--- + +### getStaticPathsFromContext() + +> **getStaticPathsFromContext**(`types`, `context`, `options`?): `Promise`\<(`string` \| \{ `locale`: `string`; `params`: \{ `slug`: `string`[]; \}; \})[]\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:283](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L283) + +Gets static paths from the context. + +#### Parameters + +##### types + +The types of the resources. + +`string` | `string`[] + +##### context + +`GetStaticPathsContext` + +The static paths context. + +##### options? + +`object` & [`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) + +Options for the request. + +#### Returns + +`Promise`\<(`string` \| \{ `locale`: `string`; `params`: \{ `slug`: `string`[]; \}; \})[]\> + +The fetched static paths. + +--- + +### getView() + +> **getView**\<`T`\>(`name`, `options`?): `Promise`\<[`DrupalView`](../interfaces/DrupalView.mdx)\<`T`\>\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:845](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L845) + +Fetches a view by its name. + +#### Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### name + +`string` + +The name of the view. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`DrupalView`](../interfaces/DrupalView.mdx)\<`T`\>\> + +The fetched view. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`getView`](NextDrupal.mdx#getview) + +--- + +### logOrThrowError() + +> **logOrThrowError**(`error`): `void` + +Defined in: [packages/next-drupal/src/next-drupal.ts:945](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L945) + +Logs or throws an error based on the throwJsonApiErrors flag. + +#### Parameters + +##### error + +`Error` + +The error to log or throw. + +#### Returns + +`void` + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`logOrThrowError`](NextDrupal.mdx#logorthrowerror) + +--- + +### preview() + +> **preview**(`request`, `response`, `options`?): `Promise`\<`void` \| `NextApiResponse`\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:423](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L423) + +Handles preview mode. + +#### Parameters + +##### request + +`NextApiRequest` + +The API request. + +##### response + +`NextApiResponse` + +The API response. + +##### options? + +Options for the request. + +###### enable + +`boolean` + +#### Returns + +`Promise`\<`void` \| `NextApiResponse`\> + +--- + +### previewDisable() + +> **previewDisable**(`request`, `response`): `Promise`\<`void`\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:498](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L498) + +Disables preview mode. + +#### Parameters + +##### request + +`NextApiRequest` + +The API request. + +##### response + +`NextApiResponse` + +The API response. + +#### Returns + +`Promise`\<`void`\> + +--- + +### throwIfJsonErrors() + +> **throwIfJsonErrors**(`response`, `messagePrefix`): `Promise`\<`void`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:549](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L549) + +Throws an error if the response contains JSON:API errors. + +#### Parameters + +##### response + +`Response` + +The fetch response. + +##### messagePrefix + +`string` = `""` + +The error message prefix. + +#### Returns + +`Promise`\<`void`\> + +#### Throws + +The JSON:API errors. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`throwIfJsonErrors`](NextDrupal.mdx#throwifjsonerrors) + +--- + +### translatePath() + +> **translatePath**(`path`, `options`?): `Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:631](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L631) + +Translates a path to a DrupalTranslatedPath object. + +#### Parameters + +##### path + +`string` + +The path to translate. + +##### options? + +[`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) & [`JsonApiWithNextFetchOptions`](../type-aliases/JsonApiWithNextFetchOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +The translated path. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`translatePath`](NextDrupal.mdx#translatepath) + +--- + +### translatePathFromContext() + +> **translatePathFromContext**(`context`, `options`?): `Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +Defined in: [packages/next-drupal/src/next-drupal-pages.ts:234](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-pages.ts#L234) + +Translates a path from the context. + +#### Parameters + +##### context + +`GetStaticPropsContext` + +The static props context. + +##### options? + +`object` & [`JsonApiWithAuthOption`](../type-aliases/JsonApiWithAuthOption.mdx) + +Options for the request. + +#### Returns + +`Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +The translated path. + +--- + +### updateResource() + +> **updateResource**\<`T`\>(`type`, `uuid`, `body`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/next-drupal.ts:202](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L202) + +Updates an existing resource of the specified type. + +#### Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +#### Parameters + +##### type + +`string` + +The type of the resource. + +##### uuid + +`string` + +The UUID of the resource. + +##### body + +[`JsonApiUpdateResourceBody`](../interfaces/JsonApiUpdateResourceBody.mdx) + +The body of the resource. + +##### options? + +[`JsonApiOptions`](../type-aliases/JsonApiOptions.mdx) + +Options for the request. + +#### Returns + +`Promise`\<`T`\> + +The updated resource. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`updateResource`](NextDrupal.mdx#updateresource) + +--- + +### validateDraftUrl() + +> **validateDraftUrl**(`searchParams`): `Promise`\<`Response`\> + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:500](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L500) + +Validates the draft URL using the provided search parameters. + +#### Parameters + +##### searchParams + +`URLSearchParams` + +The search parameters. + +#### Returns + +`Promise`\<`Response`\> + +The validation response. + +#### Inherited from + +[`NextDrupal`](NextDrupal.mdx).[`validateDraftUrl`](NextDrupal.mdx#validatedrafturl) diff --git a/www/content/docs/api/functions/DrupalPreview.mdx b/www/content/docs/api/functions/DrupalPreview.mdx new file mode 100644 index 00000000..22a88cea --- /dev/null +++ b/www/content/docs/api/functions/DrupalPreview.mdx @@ -0,0 +1,31 @@ +[next-drupal](../globals.mdx) / DrupalPreview + +# Function: DrupalPreview() + +> **DrupalPreview**(`options`?): (`request`, `response`) => `Promise`\<`void` \| `NextApiResponse`\> + +Defined in: [packages/next-drupal/src/deprecated/preview.ts:12](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/preview.ts#L12) + +## Parameters + +### options? + +`PreviewOptions` + +## Returns + +`Function` + +### Parameters + +#### request + +`any` + +#### response + +`any` + +### Returns + +`Promise`\<`void` \| `NextApiResponse`\> diff --git a/www/content/docs/api/functions/PreviewHandler.mdx b/www/content/docs/api/functions/PreviewHandler.mdx new file mode 100644 index 00000000..fcfe3e7d --- /dev/null +++ b/www/content/docs/api/functions/PreviewHandler.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / PreviewHandler + +# Function: PreviewHandler() + +> **PreviewHandler**(`request`?, `response`?, `options`?): `Promise`\<`void` \| `NextApiResponse`\> + +Defined in: [packages/next-drupal/src/deprecated/preview.ts:16](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/preview.ts#L16) + +## Parameters + +### request? + +`NextApiRequest` + +### response? + +`NextApiResponse` + +### options? + +`PreviewOptions` + +## Returns + +`Promise`\<`void` \| `NextApiResponse`\> diff --git a/www/content/docs/api/functions/buildUrl.mdx b/www/content/docs/api/functions/buildUrl.mdx new file mode 100644 index 00000000..8bc19de5 --- /dev/null +++ b/www/content/docs/api/functions/buildUrl.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / buildUrl + +# Function: buildUrl() + +> **buildUrl**(`path`, `params`?): `URL` + +Defined in: [packages/next-drupal/src/deprecated/utils.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/utils.ts#L61) + +## Parameters + +### path + +`string` + +### params? + +`string` | `Record`\<`string`, `string`\> | `URLSearchParams` + +## Returns + +`URL` diff --git a/www/content/docs/api/functions/deserialize.mdx b/www/content/docs/api/functions/deserialize.mdx new file mode 100644 index 00000000..54d92778 --- /dev/null +++ b/www/content/docs/api/functions/deserialize.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / deserialize + +# Function: deserialize() + +> **deserialize**(`body`, `options`?): `TJsonaModel` \| `TJsonaModel`[] + +Defined in: [packages/next-drupal/src/deprecated/utils.ts:11](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/utils.ts#L11) + +## Parameters + +### body + +`any` + +### options? + +`any` + +## Returns + +`TJsonaModel` \| `TJsonaModel`[] diff --git a/www/content/docs/api/functions/getAccessToken.mdx b/www/content/docs/api/functions/getAccessToken.mdx new file mode 100644 index 00000000..8562a992 --- /dev/null +++ b/www/content/docs/api/functions/getAccessToken.mdx @@ -0,0 +1,11 @@ +[next-drupal](../globals.mdx) / getAccessToken + +# Function: getAccessToken() + +> **getAccessToken**(): `Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> + +Defined in: [packages/next-drupal/src/deprecated/get-access-token.ts:6](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-access-token.ts#L6) + +## Returns + +`Promise`\<[`AccessToken`](../interfaces/AccessToken.mdx)\> diff --git a/www/content/docs/api/functions/getJsonApiIndex.mdx b/www/content/docs/api/functions/getJsonApiIndex.mdx new file mode 100644 index 00000000..c9e00c77 --- /dev/null +++ b/www/content/docs/api/functions/getJsonApiIndex.mdx @@ -0,0 +1,23 @@ +[next-drupal](../globals.mdx) / getJsonApiIndex + +# Function: getJsonApiIndex() + +> **getJsonApiIndex**(`locale`?, `options`?): `Promise`\<\{ `links`: \{\}; \}\> + +Defined in: [packages/next-drupal/src/deprecated/utils.ts:26](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/utils.ts#L26) + +## Parameters + +### locale? + +`string` + +### options? + +#### accessToken + +[`AccessToken`](../interfaces/AccessToken.mdx) + +## Returns + +`Promise`\<\{ `links`: \{\}; \}\> diff --git a/www/content/docs/api/functions/getJsonApiPathForResourceType.mdx b/www/content/docs/api/functions/getJsonApiPathForResourceType.mdx new file mode 100644 index 00000000..179a20a8 --- /dev/null +++ b/www/content/docs/api/functions/getJsonApiPathForResourceType.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / getJsonApiPathForResourceType + +# Function: getJsonApiPathForResourceType() + +> **getJsonApiPathForResourceType**(`type`, `locale`?): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/deprecated/utils.ts:17](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/utils.ts#L17) + +## Parameters + +### type + +`string` + +### locale? + +`string` + +## Returns + +`Promise`\<`string`\> diff --git a/www/content/docs/api/functions/getMenu.mdx b/www/content/docs/api/functions/getMenu.mdx new file mode 100644 index 00000000..44b4fa42 --- /dev/null +++ b/www/content/docs/api/functions/getMenu.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / getMenu + +# Function: getMenu() + +> **getMenu**\<`T`\>(`name`, `options`?): `Promise`\<\{ `items`: `T`[]; `tree`: `T`[]; \}\> + +Defined in: [packages/next-drupal/src/deprecated/get-menu.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-menu.ts#L5) + +## Type Parameters + +• **T** _extends_ [`DrupalMenuItem`](../interfaces/DrupalMenuItem.mdx) + +## Parameters + +### name + +`string` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<\{ `items`: `T`[]; `tree`: `T`[]; \}\> diff --git a/www/content/docs/api/functions/getPathsFromContext.mdx b/www/content/docs/api/functions/getPathsFromContext.mdx new file mode 100644 index 00000000..f7fa8418 --- /dev/null +++ b/www/content/docs/api/functions/getPathsFromContext.mdx @@ -0,0 +1,31 @@ +[next-drupal](../globals.mdx) / getPathsFromContext + +# Function: getPathsFromContext() + +> **getPathsFromContext**(`types`, `context`, `options`): `Promise`\<`GetStaticPathsResult`\[`"paths"`\]\> + +Defined in: [packages/next-drupal/src/deprecated/get-paths.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-paths.ts#L5) + +## Parameters + +### types + +`string` | `string`[] + +### context + +`GetStaticPathsContext` + +### options + +#### accessToken + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### params + +[`JsonApiParams`](../type-aliases/JsonApiParams.mdx) + +## Returns + +`Promise`\<`GetStaticPathsResult`\[`"paths"`\]\> diff --git a/www/content/docs/api/functions/getResource.mdx b/www/content/docs/api/functions/getResource.mdx new file mode 100644 index 00000000..4ff2f832 --- /dev/null +++ b/www/content/docs/api/functions/getResource.mdx @@ -0,0 +1,29 @@ +[next-drupal](../globals.mdx) / getResource + +# Function: getResource() + +> **getResource**\<`T`\>(`type`, `uuid`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-resource.ts:166](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-resource.ts#L166) + +## Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +## Parameters + +### type + +`string` + +### uuid + +`string` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getResourceByPath.mdx b/www/content/docs/api/functions/getResourceByPath.mdx new file mode 100644 index 00000000..8c302ef7 --- /dev/null +++ b/www/content/docs/api/functions/getResourceByPath.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / getResourceByPath + +# Function: getResourceByPath() + +> **getResourceByPath**\<`T`\>(`path`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-resource.ts:68](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-resource.ts#L68) + +## Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +## Parameters + +### path + +`string` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getResourceCollection.mdx b/www/content/docs/api/functions/getResourceCollection.mdx new file mode 100644 index 00000000..b9822394 --- /dev/null +++ b/www/content/docs/api/functions/getResourceCollection.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / getResourceCollection + +# Function: getResourceCollection() + +> **getResourceCollection**\<`T`\>(`type`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-resource-collection.ts:11](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-resource-collection.ts#L11) + +## Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +## Parameters + +### type + +`string` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getResourceCollectionFromContext.mdx b/www/content/docs/api/functions/getResourceCollectionFromContext.mdx new file mode 100644 index 00000000..c779f9e1 --- /dev/null +++ b/www/content/docs/api/functions/getResourceCollectionFromContext.mdx @@ -0,0 +1,35 @@ +[next-drupal](../globals.mdx) / getResourceCollectionFromContext + +# Function: getResourceCollectionFromContext() + +> **getResourceCollectionFromContext**\<`T`\>(`type`, `context`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-resource-collection.ts:49](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-resource-collection.ts#L49) + +## Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +## Parameters + +### type + +`string` + +### context + +`GetStaticPropsContext` + +### options? + +#### deserialize + +`boolean` + +#### params + +[`JsonApiParams`](../type-aliases/JsonApiParams.mdx) + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getResourceFromContext.mdx b/www/content/docs/api/functions/getResourceFromContext.mdx new file mode 100644 index 00000000..aa9852eb --- /dev/null +++ b/www/content/docs/api/functions/getResourceFromContext.mdx @@ -0,0 +1,47 @@ +[next-drupal](../globals.mdx) / getResourceFromContext + +# Function: getResourceFromContext() + +> **getResourceFromContext**\<`T`\>(`type`, `context`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-resource.ts:13](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-resource.ts#L13) + +## Type Parameters + +• **T** _extends_ [`JsonApiResource`](../interfaces/JsonApiResource.mdx) + +## Parameters + +### type + +`string` + +### context + +`GetStaticPropsContext` + +### options? + +#### accessToken + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### deserialize + +`boolean` + +#### isVersionable + +`boolean` + +#### params + +[`JsonApiParams`](../type-aliases/JsonApiParams.mdx) + +#### prefix + +`string` + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getResourcePreviewUrl.mdx b/www/content/docs/api/functions/getResourcePreviewUrl.mdx new file mode 100644 index 00000000..560a85ef --- /dev/null +++ b/www/content/docs/api/functions/getResourcePreviewUrl.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / getResourcePreviewUrl + +# Function: getResourcePreviewUrl() + +> **getResourcePreviewUrl**(`slug`, `options`?): `Promise`\<`any`\> + +Defined in: [packages/next-drupal/src/deprecated/preview.ts:67](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/preview.ts#L67) + +## Parameters + +### slug + +`string` + +### options? + +`GetResourcePreviewUrlOptions` + +## Returns + +`Promise`\<`any`\> diff --git a/www/content/docs/api/functions/getResourceTypeFromContext.mdx b/www/content/docs/api/functions/getResourceTypeFromContext.mdx new file mode 100644 index 00000000..fb760d18 --- /dev/null +++ b/www/content/docs/api/functions/getResourceTypeFromContext.mdx @@ -0,0 +1,27 @@ +[next-drupal](../globals.mdx) / getResourceTypeFromContext + +# Function: getResourceTypeFromContext() + +> **getResourceTypeFromContext**(`context`, `options`?): `Promise`\<`string`\> + +Defined in: [packages/next-drupal/src/deprecated/get-resource-type.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-resource-type.ts#L5) + +## Parameters + +### context + +`GetStaticPropsContext` + +### options? + +#### accessToken + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### prefix + +`string` + +## Returns + +`Promise`\<`string`\> diff --git a/www/content/docs/api/functions/getSearchIndex.mdx b/www/content/docs/api/functions/getSearchIndex.mdx new file mode 100644 index 00000000..63003ed2 --- /dev/null +++ b/www/content/docs/api/functions/getSearchIndex.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / getSearchIndex + +# Function: getSearchIndex() + +> **getSearchIndex**\<`T`\>(`name`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-search-index.ts:6](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-search-index.ts#L6) + +## Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +## Parameters + +### name + +`string` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getSearchIndexFromContext.mdx b/www/content/docs/api/functions/getSearchIndexFromContext.mdx new file mode 100644 index 00000000..cbbb358a --- /dev/null +++ b/www/content/docs/api/functions/getSearchIndexFromContext.mdx @@ -0,0 +1,29 @@ +[next-drupal](../globals.mdx) / getSearchIndexFromContext + +# Function: getSearchIndexFromContext() + +> **getSearchIndexFromContext**\<`T`\>(`name`, `context`, `options`?): `Promise`\<`T`\> + +Defined in: [packages/next-drupal/src/deprecated/get-search-index.ts:38](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-search-index.ts#L38) + +## Type Parameters + +• **T** = [`JsonApiResource`](../interfaces/JsonApiResource.mdx)[] + +## Parameters + +### name + +`string` + +### context + +`GetStaticPropsContext` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<`T`\> diff --git a/www/content/docs/api/functions/getView.mdx b/www/content/docs/api/functions/getView.mdx new file mode 100644 index 00000000..c2f79954 --- /dev/null +++ b/www/content/docs/api/functions/getView.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / getView + +# Function: getView() + +> **getView**\<`T`\>(`name`, `options`?): `Promise`\<\{ `links`: \{ \[key in "next" \| "prev" \| "self"\]?: \{ href: "string" \} \}; `meta`: `Record`\<`string`, `any`\>; `results`: `T`; \}\> + +Defined in: [packages/next-drupal/src/deprecated/get-view.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/get-view.ts#L5) + +## Type Parameters + +• **T** + +## Parameters + +### name + +`string` + +### options? + +`object` & [`JsonApiWithLocaleOptions`](../type-aliases/JsonApiWithLocaleOptions.mdx) + +## Returns + +`Promise`\<\{ `links`: \{ \[key in "next" \| "prev" \| "self"\]?: \{ href: "string" \} \}; `meta`: `Record`\<`string`, `any`\>; `results`: `T`; \}\> diff --git a/www/content/docs/api/functions/isAccessTokenAuth.mdx b/www/content/docs/api/functions/isAccessTokenAuth.mdx new file mode 100644 index 00000000..a491cdc6 --- /dev/null +++ b/www/content/docs/api/functions/isAccessTokenAuth.mdx @@ -0,0 +1,23 @@ +[next-drupal](../globals.mdx) / isAccessTokenAuth + +# Function: isAccessTokenAuth() + +> **isAccessTokenAuth**(`auth`): `auth is AccessToken` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:610](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L610) + +Checks if the provided auth configuration is access token auth. + +## Parameters + +### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The auth configuration. + +## Returns + +`auth is AccessToken` + +True if the auth configuration is access token auth, false otherwise. diff --git a/www/content/docs/api/functions/isBasicAuth.mdx b/www/content/docs/api/functions/isBasicAuth.mdx new file mode 100644 index 00000000..0f33ef98 --- /dev/null +++ b/www/content/docs/api/functions/isBasicAuth.mdx @@ -0,0 +1,23 @@ +[next-drupal](../globals.mdx) / isBasicAuth + +# Function: isBasicAuth() + +> **isBasicAuth**(`auth`): `auth is NextDrupalAuthUsernamePassword` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:595](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L595) + +Checks if the provided auth configuration is basic auth. + +## Parameters + +### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The auth configuration. + +## Returns + +`auth is NextDrupalAuthUsernamePassword` + +True if the auth configuration is basic auth, false otherwise. diff --git a/www/content/docs/api/functions/isClientIdSecretAuth.mdx b/www/content/docs/api/functions/isClientIdSecretAuth.mdx new file mode 100644 index 00000000..594507ec --- /dev/null +++ b/www/content/docs/api/functions/isClientIdSecretAuth.mdx @@ -0,0 +1,23 @@ +[next-drupal](../globals.mdx) / isClientIdSecretAuth + +# Function: isClientIdSecretAuth() + +> **isClientIdSecretAuth**(`auth`): `auth is NextDrupalAuthClientIdSecret` + +Defined in: [packages/next-drupal/src/next-drupal-base.ts:625](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal-base.ts#L625) + +Checks if the provided auth configuration is client ID and secret auth. + +## Parameters + +### auth + +[`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +The auth configuration. + +## Returns + +`auth is NextDrupalAuthClientIdSecret` + +True if the auth configuration is client ID and secret auth, false otherwise. diff --git a/www/content/docs/api/functions/syncDrupalPreviewRoutes.mdx b/www/content/docs/api/functions/syncDrupalPreviewRoutes.mdx new file mode 100644 index 00000000..42549e2d --- /dev/null +++ b/www/content/docs/api/functions/syncDrupalPreviewRoutes.mdx @@ -0,0 +1,17 @@ +[next-drupal](../globals.mdx) / syncDrupalPreviewRoutes + +# Function: syncDrupalPreviewRoutes() + +> **syncDrupalPreviewRoutes**(`path`): `void` + +Defined in: [packages/next-drupal/src/deprecated/utils.ts:128](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/utils.ts#L128) + +## Parameters + +### path + +`any` + +## Returns + +`void` diff --git a/www/content/docs/api/functions/translatePath.mdx b/www/content/docs/api/functions/translatePath.mdx new file mode 100644 index 00000000..d14f7b30 --- /dev/null +++ b/www/content/docs/api/functions/translatePath.mdx @@ -0,0 +1,23 @@ +[next-drupal](../globals.mdx) / translatePath + +# Function: translatePath() + +> **translatePath**(`path`, `options`?): `Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +Defined in: [packages/next-drupal/src/deprecated/translate-path.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/translate-path.ts#L5) + +## Parameters + +### path + +`string` + +### options? + +#### accessToken + +[`AccessToken`](../interfaces/AccessToken.mdx) + +## Returns + +`Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> diff --git a/www/content/docs/api/functions/translatePathFromContext.mdx b/www/content/docs/api/functions/translatePathFromContext.mdx new file mode 100644 index 00000000..4f742614 --- /dev/null +++ b/www/content/docs/api/functions/translatePathFromContext.mdx @@ -0,0 +1,27 @@ +[next-drupal](../globals.mdx) / translatePathFromContext + +# Function: translatePathFromContext() + +> **translatePathFromContext**(`context`, `options`?): `Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> + +Defined in: [packages/next-drupal/src/deprecated/translate-path.ts:28](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated/translate-path.ts#L28) + +## Parameters + +### context + +`GetStaticPropsContext` + +### options? + +#### accessToken + +[`AccessToken`](../interfaces/AccessToken.mdx) + +#### prefix + +`string` + +## Returns + +`Promise`\<[`DrupalTranslatedPath`](../interfaces/DrupalTranslatedPath.mdx)\> diff --git a/www/content/docs/api/functions/useJsonaDeserialize.mdx b/www/content/docs/api/functions/useJsonaDeserialize.mdx new file mode 100644 index 00000000..d80c02ab --- /dev/null +++ b/www/content/docs/api/functions/useJsonaDeserialize.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / useJsonaDeserialize + +# Function: useJsonaDeserialize() + +> **useJsonaDeserialize**(): (`body`, `options`) => `TJsonaModel` \| `TJsonaModel`[] + +Defined in: [packages/next-drupal/src/next-drupal.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/next-drupal.ts#L37) + +## Returns + +`Function` + +### Parameters + +#### body + +`Record`\<`string`, `unknown`\> + +#### options + +`Record`\<`string`, `unknown`\> + +### Returns + +`TJsonaModel` \| `TJsonaModel`[] diff --git a/www/content/docs/api/globals.mdx b/www/content/docs/api/globals.mdx new file mode 100644 index 00000000..a4cdd416 --- /dev/null +++ b/www/content/docs/api/globals.mdx @@ -0,0 +1,103 @@ +# next-drupal + +## Classes + +- [JsonApiErrors](classes/JsonApiErrors.mdx) +- [NextDrupal](classes/NextDrupal.mdx) +- [NextDrupalBase](classes/NextDrupalBase.mdx) +- [NextDrupalPages](classes/NextDrupalPages.mdx) + +## Interfaces + +- [AccessToken](interfaces/AccessToken.mdx) +- [DataCache](interfaces/DataCache.mdx) +- [DrupalBlock](interfaces/DrupalBlock.mdx) +- [DrupalFile](interfaces/DrupalFile.mdx) +- [DrupalFileMeta](interfaces/DrupalFileMeta.mdx) +- [DrupalMedia](interfaces/DrupalMedia.mdx) +- [DrupalMenuItem](interfaces/DrupalMenuItem.mdx) +- [DrupalNode](interfaces/DrupalNode.mdx) +- [DrupalParagraph](interfaces/DrupalParagraph.mdx) +- [DrupalSearchApiFacet](interfaces/DrupalSearchApiFacet.mdx) +- [DrupalSearchApiJsonApiResponse](interfaces/DrupalSearchApiJsonApiResponse.mdx) +- [DrupalTaxonomyTerm](interfaces/DrupalTaxonomyTerm.mdx) +- [DrupalTranslatedPath](interfaces/DrupalTranslatedPath.mdx) +- [DrupalUser](interfaces/DrupalUser.mdx) +- [DrupalView](interfaces/DrupalView.mdx) +- [FetchOptions](interfaces/FetchOptions.mdx) +- [JsonApiCreateFileResourceBody](interfaces/JsonApiCreateFileResourceBody.mdx) +- [JsonApiCreateResourceBody](interfaces/JsonApiCreateResourceBody.mdx) +- [JsonApiError](interfaces/JsonApiError.mdx) +- [JsonApiLinks](interfaces/JsonApiLinks.mdx) +- [JsonApiResource](interfaces/JsonApiResource.mdx) +- [JsonApiResourceBodyRelationship](interfaces/JsonApiResourceBodyRelationship.mdx) +- [JsonApiResourceWithPath](interfaces/JsonApiResourceWithPath.mdx) +- [JsonApiResponse](interfaces/JsonApiResponse.mdx) +- [JsonApiUpdateResourceBody](interfaces/JsonApiUpdateResourceBody.mdx) +- [Logger](interfaces/Logger.mdx) +- [NextDrupalAuthClientIdSecret](interfaces/NextDrupalAuthClientIdSecret.mdx) +- [NextDrupalAuthUsernamePassword](interfaces/NextDrupalAuthUsernamePassword.mdx) +- [Serializer](interfaces/Serializer.mdx) + +## Type Aliases + +- [AccessTokenScope](type-aliases/AccessTokenScope.mdx) +- [BaseUrl](type-aliases/BaseUrl.mdx) +- [DrupalClientAuth](type-aliases/DrupalClientAuth.mdx) +- [DrupalClientAuthAccessToken](type-aliases/DrupalClientAuthAccessToken.mdx) +- [DrupalClientAuthClientIdSecret](type-aliases/DrupalClientAuthClientIdSecret.mdx) +- [DrupalClientAuthUsernamePassword](type-aliases/DrupalClientAuthUsernamePassword.mdx) +- [DrupalClientOptions](type-aliases/DrupalClientOptions.mdx) +- [DrupalMenuItemId](type-aliases/DrupalMenuItemId.mdx) +- [DrupalMenuLinkContent](type-aliases/DrupalMenuLinkContent.mdx) +- [DrupalPathAlias](type-aliases/DrupalPathAlias.mdx) +- [EndpointSearchParams](type-aliases/EndpointSearchParams.mdx) +- [Fetcher](type-aliases/Fetcher.mdx) +- [JsonApiOptions](type-aliases/JsonApiOptions.mdx) +- [JsonApiParams](type-aliases/JsonApiParams.mdx) +- [JsonApiWithAuthOption](type-aliases/JsonApiWithAuthOption.mdx) +- [JsonApiWithCacheOptions](type-aliases/JsonApiWithCacheOptions.mdx) +- [JsonApiWithLocaleOptions](type-aliases/JsonApiWithLocaleOptions.mdx) +- [JsonApiWithNextFetchOptions](type-aliases/JsonApiWithNextFetchOptions.mdx) +- [JsonDeserializer](type-aliases/JsonDeserializer.mdx) +- [Locale](type-aliases/Locale.mdx) +- [NextDrupalAuth](type-aliases/NextDrupalAuth.mdx) +- [NextDrupalAuthAccessToken](type-aliases/NextDrupalAuthAccessToken.mdx) +- [NextDrupalBaseOptions](type-aliases/NextDrupalBaseOptions.mdx) +- [NextDrupalOptions](type-aliases/NextDrupalOptions.mdx) +- [PathPrefix](type-aliases/PathPrefix.mdx) + +## Variables + +- [DRAFT_DATA_COOKIE_NAME](variables/DRAFT_DATA_COOKIE_NAME.mdx) +- [DRAFT_MODE_COOKIE_NAME](variables/DRAFT_MODE_COOKIE_NAME.mdx) +- [DrupalClient](variables/DrupalClient.mdx) + +## Functions + +- [buildUrl](functions/buildUrl.mdx) +- [deserialize](functions/deserialize.mdx) +- [DrupalPreview](functions/DrupalPreview.mdx) +- [getAccessToken](functions/getAccessToken.mdx) +- [getJsonApiIndex](functions/getJsonApiIndex.mdx) +- [getJsonApiPathForResourceType](functions/getJsonApiPathForResourceType.mdx) +- [getMenu](functions/getMenu.mdx) +- [getPathsFromContext](functions/getPathsFromContext.mdx) +- [getResource](functions/getResource.mdx) +- [getResourceByPath](functions/getResourceByPath.mdx) +- [getResourceCollection](functions/getResourceCollection.mdx) +- [getResourceCollectionFromContext](functions/getResourceCollectionFromContext.mdx) +- [getResourceFromContext](functions/getResourceFromContext.mdx) +- [getResourcePreviewUrl](functions/getResourcePreviewUrl.mdx) +- [getResourceTypeFromContext](functions/getResourceTypeFromContext.mdx) +- [getSearchIndex](functions/getSearchIndex.mdx) +- [getSearchIndexFromContext](functions/getSearchIndexFromContext.mdx) +- [getView](functions/getView.mdx) +- [isAccessTokenAuth](functions/isAccessTokenAuth.mdx) +- [isBasicAuth](functions/isBasicAuth.mdx) +- [isClientIdSecretAuth](functions/isClientIdSecretAuth.mdx) +- [PreviewHandler](functions/PreviewHandler.mdx) +- [syncDrupalPreviewRoutes](functions/syncDrupalPreviewRoutes.mdx) +- [translatePath](functions/translatePath.mdx) +- [translatePathFromContext](functions/translatePathFromContext.mdx) +- [useJsonaDeserialize](functions/useJsonaDeserialize.mdx) diff --git a/www/content/docs/api/interfaces/AccessToken.mdx b/www/content/docs/api/interfaces/AccessToken.mdx new file mode 100644 index 00000000..0e397504 --- /dev/null +++ b/www/content/docs/api/interfaces/AccessToken.mdx @@ -0,0 +1,37 @@ +[next-drupal](../globals.mdx) / AccessToken + +# Interface: AccessToken + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:113](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L113) + +## Properties + +### access_token + +> **access_token**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:115](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L115) + +--- + +### expires_in + +> **expires_in**: `number` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:116](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L116) + +--- + +### refresh_token? + +> `optional` **refresh_token**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:117](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L117) + +--- + +### token_type + +> **token_type**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:114](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L114) diff --git a/www/content/docs/api/interfaces/DataCache.mdx b/www/content/docs/api/interfaces/DataCache.mdx new file mode 100644 index 00000000..7b618b1f --- /dev/null +++ b/www/content/docs/api/interfaces/DataCache.mdx @@ -0,0 +1,67 @@ +[next-drupal](../globals.mdx) / DataCache + +# Interface: DataCache + +Defined in: [packages/next-drupal/src/types/next-drupal.ts:51](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal.ts#L51) + +## Methods + +### del()? + +> `optional` **del**(`keys`): `Promise`\<`unknown`\> + +Defined in: [packages/next-drupal/src/types/next-drupal.ts:56](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal.ts#L56) + +#### Parameters + +##### keys + +`any` + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### get() + +> **get**(`key`): `Promise`\<`unknown`\> + +Defined in: [packages/next-drupal/src/types/next-drupal.ts:52](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal.ts#L52) + +#### Parameters + +##### key + +`any` + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### set() + +> **set**(`key`, `value`, `ttl`?): `Promise`\<`unknown`\> + +Defined in: [packages/next-drupal/src/types/next-drupal.ts:54](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal.ts#L54) + +#### Parameters + +##### key + +`any` + +##### value + +`any` + +##### ttl? + +`number` + +#### Returns + +`Promise`\<`unknown`\> diff --git a/www/content/docs/api/interfaces/DrupalBlock.mdx b/www/content/docs/api/interfaces/DrupalBlock.mdx new file mode 100644 index 00000000..32484fc3 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalBlock.mdx @@ -0,0 +1,69 @@ +[next-drupal](../globals.mdx) / DrupalBlock + +# Interface: DrupalBlock + +Defined in: [packages/next-drupal/src/types/drupal.ts:7](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L7) + +## Extends + +- [`JsonApiResource`](JsonApiResource.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`id`](JsonApiResource.mdx#id) + +--- + +### info + +> **info**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:8](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L8) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`langcode`](JsonApiResource.mdx#langcode) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`status`](JsonApiResource.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`type`](JsonApiResource.mdx#type) diff --git a/www/content/docs/api/interfaces/DrupalFile.mdx b/www/content/docs/api/interfaces/DrupalFile.mdx new file mode 100644 index 00000000..5f6fd581 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalFile.mdx @@ -0,0 +1,133 @@ +[next-drupal](../globals.mdx) / DrupalFile + +# Interface: DrupalFile + +Defined in: [packages/next-drupal/src/types/drupal.ts:11](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L11) + +## Extends + +- [`JsonApiResource`](JsonApiResource.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### changed + +> **changed**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:13](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L13) + +--- + +### created + +> **created**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:14](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L14) + +--- + +### drupal_internal\_\_fid + +> **drupal_internal\_\_fid**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:12](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L12) + +--- + +### filemime + +> **filemime**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:21](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L21) + +--- + +### filename + +> **filename**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:15](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L15) + +--- + +### filesize + +> **filesize**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:20](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L20) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`id`](JsonApiResource.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`langcode`](JsonApiResource.mdx#langcode) + +--- + +### resourceIdObjMeta? + +> `optional` **resourceIdObjMeta**: [`DrupalFileMeta`](DrupalFileMeta.mdx) + +Defined in: [packages/next-drupal/src/types/drupal.ts:22](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L22) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`status`](JsonApiResource.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`type`](JsonApiResource.mdx#type) + +--- + +### uri + +> **uri**: `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:16](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L16) + +#### url + +> **url**: `string` + +#### value + +> **value**: `string` diff --git a/www/content/docs/api/interfaces/DrupalFileMeta.mdx b/www/content/docs/api/interfaces/DrupalFileMeta.mdx new file mode 100644 index 00000000..aec68e6c --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalFileMeta.mdx @@ -0,0 +1,37 @@ +[next-drupal](../globals.mdx) / DrupalFileMeta + +# Interface: DrupalFileMeta + +Defined in: [packages/next-drupal/src/types/drupal.ts:25](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L25) + +## Properties + +### alt? + +> `optional` **alt**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:26](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L26) + +--- + +### height + +> **height**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:29](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L29) + +--- + +### title? + +> `optional` **title**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:27](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L27) + +--- + +### width + +> **width**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:28](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L28) diff --git a/www/content/docs/api/interfaces/DrupalMedia.mdx b/www/content/docs/api/interfaces/DrupalMedia.mdx new file mode 100644 index 00000000..a75d6ed8 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalMedia.mdx @@ -0,0 +1,101 @@ +[next-drupal](../globals.mdx) / DrupalMedia + +# Interface: DrupalMedia + +Defined in: [packages/next-drupal/src/types/drupal.ts:32](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L32) + +## Extends + +- [`JsonApiResource`](JsonApiResource.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### changed + +> **changed**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:35](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L35) + +--- + +### created + +> **created**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:36](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L36) + +--- + +### drupal_internal\_\_mid + +> **drupal_internal\_\_mid**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:33](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L33) + +--- + +### drupal_internal\_\_vid + +> **drupal_internal\_\_vid**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:34](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L34) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`id`](JsonApiResource.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`langcode`](JsonApiResource.mdx#langcode) + +--- + +### name + +> **name**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L37) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`status`](JsonApiResource.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`type`](JsonApiResource.mdx#type) diff --git a/www/content/docs/api/interfaces/DrupalMenuItem.mdx b/www/content/docs/api/interfaces/DrupalMenuItem.mdx new file mode 100644 index 00000000..c1c7c099 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalMenuItem.mdx @@ -0,0 +1,133 @@ +[next-drupal](../globals.mdx) / DrupalMenuItem + +# Interface: DrupalMenuItem + +Defined in: [packages/next-drupal/src/types/drupal.ts:40](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L40) + +## Properties + +### description + +> **description**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:41](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L41) + +--- + +### enabled + +> **enabled**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:42](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L42) + +--- + +### expanded + +> **expanded**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:43](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L43) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:44](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L44) + +--- + +### items? + +> `optional` **items**: [`DrupalMenuItem`](DrupalMenuItem.mdx)[] + +Defined in: [packages/next-drupal/src/types/drupal.ts:58](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L58) + +--- + +### menu_name + +> **menu_name**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:45](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L45) + +--- + +### meta + +> **meta**: `Record`\<`string`, `unknown`\> + +Defined in: [packages/next-drupal/src/types/drupal.ts:46](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L46) + +--- + +### options + +> **options**: `Record`\<`string`, `unknown`\> + +Defined in: [packages/next-drupal/src/types/drupal.ts:47](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L47) + +--- + +### parent + +> **parent**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:48](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L48) + +--- + +### provider + +> **provider**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:49](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L49) + +--- + +### route + +> **route**: `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:50](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L50) + +#### name + +> **name**: `string` + +#### parameters + +> **parameters**: `Record`\<`string`, `unknown`\> + +--- + +### title + +> **title**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:54](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L54) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:55](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L55) + +--- + +### url + +> **url**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:56](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L56) + +--- + +### weight + +> **weight**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:57](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L57) diff --git a/www/content/docs/api/interfaces/DrupalNode.mdx b/www/content/docs/api/interfaces/DrupalNode.mdx new file mode 100644 index 00000000..b4bf84bf --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalNode.mdx @@ -0,0 +1,129 @@ +[next-drupal](../globals.mdx) / DrupalNode + +# Interface: DrupalNode + +Defined in: [packages/next-drupal/src/types/drupal.ts:63](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L63) + +## Extends + +- [`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### changed + +> **changed**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:66](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L66) + +--- + +### created + +> **created**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:67](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L67) + +--- + +### default_langcode + +> **default_langcode**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:69](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L69) + +--- + +### drupal_internal\_\_nid + +> **drupal_internal\_\_nid**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:64](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L64) + +--- + +### drupal_internal\_\_vid + +> **drupal_internal\_\_vid**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:65](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L65) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`id`](JsonApiResourceWithPath.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`langcode`](JsonApiResourceWithPath.mdx#langcode) + +--- + +### path + +> **path**: [`DrupalPathAlias`](../type-aliases/DrupalPathAlias.mdx) + +Defined in: [packages/next-drupal/src/types/resource.ts:66](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L66) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`path`](JsonApiResourceWithPath.mdx#path) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`status`](JsonApiResourceWithPath.mdx#status) + +--- + +### sticky + +> **sticky**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:70](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L70) + +--- + +### title + +> **title**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:68](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L68) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`type`](JsonApiResourceWithPath.mdx#type) diff --git a/www/content/docs/api/interfaces/DrupalParagraph.mdx b/www/content/docs/api/interfaces/DrupalParagraph.mdx new file mode 100644 index 00000000..4d7dc970 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalParagraph.mdx @@ -0,0 +1,77 @@ +[next-drupal](../globals.mdx) / DrupalParagraph + +# Interface: DrupalParagraph + +Defined in: [packages/next-drupal/src/types/drupal.ts:73](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L73) + +## Extends + +- [`JsonApiResource`](JsonApiResource.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### drupal_internal\_\_id + +> **drupal_internal\_\_id**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:74](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L74) + +--- + +### drupal_internal\_\_revision_id + +> **drupal_internal\_\_revision_id**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:75](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L75) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`id`](JsonApiResource.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`langcode`](JsonApiResource.mdx#langcode) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`status`](JsonApiResource.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`type`](JsonApiResource.mdx#type) diff --git a/www/content/docs/api/interfaces/DrupalSearchApiFacet.mdx b/www/content/docs/api/interfaces/DrupalSearchApiFacet.mdx new file mode 100644 index 00000000..97f4cada --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalSearchApiFacet.mdx @@ -0,0 +1,61 @@ +[next-drupal](../globals.mdx) / DrupalSearchApiFacet + +# Interface: DrupalSearchApiFacet + +Defined in: [packages/next-drupal/src/types/drupal.ts:90](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L90) + +## Properties + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:91](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L91) + +--- + +### label? + +> `optional` **label**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:92](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L92) + +--- + +### path? + +> `optional` **path**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:93](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L93) + +--- + +### terms? + +> `optional` **terms**: `object`[] + +Defined in: [packages/next-drupal/src/types/drupal.ts:94](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L94) + +#### url + +> **url**: `string` + +#### values + +> **values**: `object` + +##### values.active? + +> `optional` **active**: `boolean` + +##### values.count? + +> `optional` **count**: `number` + +##### values.label + +> **label**: `string` + +##### values.value + +> **value**: `string` diff --git a/www/content/docs/api/interfaces/DrupalSearchApiJsonApiResponse.mdx b/www/content/docs/api/interfaces/DrupalSearchApiJsonApiResponse.mdx new file mode 100644 index 00000000..20ac6c73 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalSearchApiJsonApiResponse.mdx @@ -0,0 +1,105 @@ +[next-drupal](../globals.mdx) / DrupalSearchApiJsonApiResponse + +# Interface: DrupalSearchApiJsonApiResponse + +Defined in: [packages/next-drupal/src/types/drupal.ts:84](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L84) + +## Extends + +- [`JsonApiResponse`](JsonApiResponse.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### data + +> **data**: `Record`\<`string`, `any`\>[] + +Defined in: [packages/next-drupal/src/types/resource.ts:12](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L12) + +#### Inherited from + +[`JsonApiResponse`](JsonApiResponse.mdx).[`data`](JsonApiResponse.mdx#data) + +--- + +### errors + +> **errors**: [`JsonApiError`](JsonApiError.mdx)[] + +Defined in: [packages/next-drupal/src/types/resource.ts:13](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L13) + +#### Inherited from + +[`JsonApiResponse`](JsonApiResponse.mdx).[`errors`](JsonApiResponse.mdx#errors) + +--- + +### included? + +> `optional` **included**: `Record`\<`string`, `any`\>[] + +Defined in: [packages/next-drupal/src/types/resource.ts:19](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L19) + +#### Inherited from + +[`JsonApiResponse`](JsonApiResponse.mdx).[`included`](JsonApiResponse.mdx#included) + +--- + +### jsonapi? + +> `optional` **jsonapi**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:8](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L8) + +#### meta + +> **meta**: `Record`\<`string`, `any`\>[] + +#### version + +> **version**: `string` + +#### Inherited from + +[`JsonApiResponse`](JsonApiResponse.mdx).[`jsonapi`](JsonApiResponse.mdx#jsonapi) + +--- + +### links? + +> `optional` **links**: [`JsonApiLinks`](JsonApiLinks.mdx) + +Defined in: [packages/next-drupal/src/types/resource.ts:18](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L18) + +#### Inherited from + +[`JsonApiResponse`](JsonApiResponse.mdx).[`links`](JsonApiResponse.mdx#links) + +--- + +### meta + +> **meta**: `object` & `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:85](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L85) + +#### Type declaration + +##### count + +> **count**: `number` + +#### Type declaration + +##### facets? + +> `optional` **facets**: [`DrupalSearchApiFacet`](DrupalSearchApiFacet.mdx)[] + +#### Overrides + +[`JsonApiResponse`](JsonApiResponse.mdx).[`meta`](JsonApiResponse.mdx#meta) diff --git a/www/content/docs/api/interfaces/DrupalTaxonomyTerm.mdx b/www/content/docs/api/interfaces/DrupalTaxonomyTerm.mdx new file mode 100644 index 00000000..534b76df --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalTaxonomyTerm.mdx @@ -0,0 +1,121 @@ +[next-drupal](../globals.mdx) / DrupalTaxonomyTerm + +# Interface: DrupalTaxonomyTerm + +Defined in: [packages/next-drupal/src/types/drupal.ts:105](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L105) + +## Extends + +- [`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### changed + +> **changed**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:107](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L107) + +--- + +### default_langcode + +> **default_langcode**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:108](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L108) + +--- + +### description + +> **description**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:110](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L110) + +--- + +### drupal_internal\_\_tid + +> **drupal_internal\_\_tid**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:106](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L106) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`id`](JsonApiResourceWithPath.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`langcode`](JsonApiResourceWithPath.mdx#langcode) + +--- + +### name + +> **name**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:109](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L109) + +--- + +### path + +> **path**: [`DrupalPathAlias`](../type-aliases/DrupalPathAlias.mdx) + +Defined in: [packages/next-drupal/src/types/resource.ts:66](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L66) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`path`](JsonApiResourceWithPath.mdx#path) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`status`](JsonApiResourceWithPath.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`type`](JsonApiResourceWithPath.mdx#type) + +--- + +### weight + +> **weight**: `number` + +Defined in: [packages/next-drupal/src/types/drupal.ts:111](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L111) diff --git a/www/content/docs/api/interfaces/DrupalTranslatedPath.mdx b/www/content/docs/api/interfaces/DrupalTranslatedPath.mdx new file mode 100644 index 00000000..617e954c --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalTranslatedPath.mdx @@ -0,0 +1,121 @@ +[next-drupal](../globals.mdx) / DrupalTranslatedPath + +# Interface: DrupalTranslatedPath + +Defined in: [packages/next-drupal/src/types/drupal.ts:114](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L114) + +## Properties + +### entity + +> **entity**: `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:117](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L117) + +#### bundle + +> **bundle**: `string` + +#### canonical + +> **canonical**: `string` + +#### id + +> **id**: `string` + +#### langcode? + +> `optional` **langcode**: `string` + +#### path? + +> `optional` **path**: `string` + +#### type + +> **type**: `string` + +#### uuid + +> **uuid**: `string` + +--- + +### isHomePath + +> **isHomePath**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:116](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L116) + +--- + +### jsonapi? + +> `optional` **jsonapi**: `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:127](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L127) + +#### basePath + +> **basePath**: `string` + +#### entryPoint + +> **entryPoint**: `string` + +#### individual + +> **individual**: `string` + +#### pathPrefix + +> **pathPrefix**: `string` + +#### resourceName + +> **resourceName**: `string` + +--- + +### label? + +> `optional` **label**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:126](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L126) + +--- + +### meta? + +> `optional` **meta**: `Record`\<`string`, `unknown`\> + +Defined in: [packages/next-drupal/src/types/drupal.ts:134](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L134) + +--- + +### redirect? + +> `optional` **redirect**: `object`[] + +Defined in: [packages/next-drupal/src/types/drupal.ts:135](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L135) + +#### from + +> **from**: `string` + +#### status + +> **status**: `string` + +#### to + +> **to**: `string` + +--- + +### resolved + +> **resolved**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:115](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L115) diff --git a/www/content/docs/api/interfaces/DrupalUser.mdx b/www/content/docs/api/interfaces/DrupalUser.mdx new file mode 100644 index 00000000..43835270 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalUser.mdx @@ -0,0 +1,113 @@ +[next-drupal](../globals.mdx) / DrupalUser + +# Interface: DrupalUser + +Defined in: [packages/next-drupal/src/types/drupal.ts:142](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L142) + +## Extends + +- [`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### changed + +> **changed**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:144](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L144) + +--- + +### created + +> **created**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:145](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L145) + +--- + +### default_langcode + +> **default_langcode**: `boolean` + +Defined in: [packages/next-drupal/src/types/drupal.ts:146](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L146) + +--- + +### drupal_internal\_\_uid + +> **drupal_internal\_\_uid**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:143](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L143) + +--- + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`id`](JsonApiResourceWithPath.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`langcode`](JsonApiResourceWithPath.mdx#langcode) + +--- + +### name + +> **name**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:147](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L147) + +--- + +### path + +> **path**: [`DrupalPathAlias`](../type-aliases/DrupalPathAlias.mdx) + +Defined in: [packages/next-drupal/src/types/resource.ts:66](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L66) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`path`](JsonApiResourceWithPath.mdx#path) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`status`](JsonApiResourceWithPath.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx).[`type`](JsonApiResourceWithPath.mdx#type) diff --git a/www/content/docs/api/interfaces/DrupalView.mdx b/www/content/docs/api/interfaces/DrupalView.mdx new file mode 100644 index 00000000..25dec530 --- /dev/null +++ b/www/content/docs/api/interfaces/DrupalView.mdx @@ -0,0 +1,49 @@ +[next-drupal](../globals.mdx) / DrupalView + +# Interface: DrupalView\ + +Defined in: [packages/next-drupal/src/types/drupal.ts:151](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L151) + +## Type Parameters + +• **T** = `Record`\<`string`, `any`\>[] + +## Properties + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:152](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L152) + +--- + +### links + +> **links**: [`JsonApiLinks`](JsonApiLinks.mdx) + +Defined in: [packages/next-drupal/src/types/drupal.ts:155](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L155) + +--- + +### meta + +> **meta**: `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:154](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L154) + +#### Index Signature + +\[`key`: `string`\]: `any` + +#### count + +> **count**: `number` + +--- + +### results + +> **results**: `T` + +Defined in: [packages/next-drupal/src/types/drupal.ts:153](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L153) diff --git a/www/content/docs/api/interfaces/FetchOptions.mdx b/www/content/docs/api/interfaces/FetchOptions.mdx new file mode 100644 index 00000000..16f3b1d8 --- /dev/null +++ b/www/content/docs/api/interfaces/FetchOptions.mdx @@ -0,0 +1,223 @@ +[next-drupal](../globals.mdx) / FetchOptions + +# Interface: FetchOptions + +Defined in: [packages/next-drupal/src/types/options.ts:9](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L9) + +## Extends + +- `RequestInit` + +## Properties + +### body? + +> `optional` **body**: `BodyInit` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1673 + +A BodyInit object or null to set request's body. + +#### Inherited from + +`RequestInit.body` + +--- + +### cache? + +> `optional` **cache**: `RequestCache` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1675 + +A string indicating how the request will interact with the browser's cache to set request's cache. + +#### Inherited from + +`RequestInit.cache` + +--- + +### credentials? + +> `optional` **credentials**: `RequestCredentials` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1677 + +A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. + +#### Inherited from + +`RequestInit.credentials` + +--- + +### headers? + +> `optional` **headers**: `HeadersInit` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1679 + +A Headers object, an object literal, or an array of two-item arrays to set request's headers. + +#### Inherited from + +`RequestInit.headers` + +--- + +### integrity? + +> `optional` **integrity**: `string` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1681 + +A cryptographic hash of the resource to be fetched by request. Sets request's integrity. + +#### Inherited from + +`RequestInit.integrity` + +--- + +### keepalive? + +> `optional` **keepalive**: `boolean` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1683 + +A boolean to set request's keepalive. + +#### Inherited from + +`RequestInit.keepalive` + +--- + +### method? + +> `optional` **method**: `string` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1685 + +A string to set request's method. + +#### Inherited from + +`RequestInit.method` + +--- + +### mode? + +> `optional` **mode**: `RequestMode` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1687 + +A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. + +#### Inherited from + +`RequestInit.mode` + +--- + +### next? + +> `optional` **next**: `NextFetchRequestConfig` + +Defined in: node_modules/next/types/global.d.ts:59 + +#### Inherited from + +`RequestInit.next` + +--- + +### priority? + +> `optional` **priority**: `RequestPriority` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1688 + +#### Inherited from + +`RequestInit.priority` + +--- + +### redirect? + +> `optional` **redirect**: `RequestRedirect` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1690 + +A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. + +#### Inherited from + +`RequestInit.redirect` + +--- + +### referrer? + +> `optional` **referrer**: `string` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1692 + +A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. + +#### Inherited from + +`RequestInit.referrer` + +--- + +### referrerPolicy? + +> `optional` **referrerPolicy**: `ReferrerPolicy` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1694 + +A referrer policy to set request's referrerPolicy. + +#### Inherited from + +`RequestInit.referrerPolicy` + +--- + +### signal? + +> `optional` **signal**: `AbortSignal` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1696 + +An AbortSignal to set request's signal. + +#### Inherited from + +`RequestInit.signal` + +--- + +### window? + +> `optional` **window**: `null` + +Defined in: node_modules/typescript/lib/lib.dom.d.ts:1698 + +Can only be null. Used to disassociate request from any Window. + +#### Inherited from + +`RequestInit.window` + +--- + +### withAuth? + +> `optional` **withAuth**: `boolean` \| [`NextDrupalAuth`](../type-aliases/NextDrupalAuth.mdx) + +Defined in: [packages/next-drupal/src/types/options.ts:10](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L10) diff --git a/www/content/docs/api/interfaces/JsonApiCreateFileResourceBody.mdx b/www/content/docs/api/interfaces/JsonApiCreateFileResourceBody.mdx new file mode 100644 index 00000000..735cfe5e --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiCreateFileResourceBody.mdx @@ -0,0 +1,37 @@ +[next-drupal](../globals.mdx) / JsonApiCreateFileResourceBody + +# Interface: JsonApiCreateFileResourceBody + +Defined in: [packages/next-drupal/src/types/resource.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L37) + +## Properties + +### data + +> **data**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:38](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L38) + +#### attributes + +> **attributes**: `object` + +##### attributes.field + +> **field**: `string` + +##### attributes.file + +> **file**: `Buffer` + +##### attributes.filename + +> **filename**: `string` + +##### attributes.type + +> **type**: `string` + +#### type? + +> `optional` **type**: `string` diff --git a/www/content/docs/api/interfaces/JsonApiCreateResourceBody.mdx b/www/content/docs/api/interfaces/JsonApiCreateResourceBody.mdx new file mode 100644 index 00000000..662a34f5 --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiCreateResourceBody.mdx @@ -0,0 +1,25 @@ +[next-drupal](../globals.mdx) / JsonApiCreateResourceBody + +# Interface: JsonApiCreateResourceBody + +Defined in: [packages/next-drupal/src/types/resource.ts:29](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L29) + +## Properties + +### data + +> **data**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:30](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L30) + +#### attributes? + +> `optional` **attributes**: `Record`\<`string`, `any`\> + +#### relationships? + +> `optional` **relationships**: `Record`\<`string`, [`JsonApiResourceBodyRelationship`](JsonApiResourceBodyRelationship.mdx)\> + +#### type? + +> `optional` **type**: `string` diff --git a/www/content/docs/api/interfaces/JsonApiError.mdx b/www/content/docs/api/interfaces/JsonApiError.mdx new file mode 100644 index 00000000..5e1d23fb --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiError.mdx @@ -0,0 +1,53 @@ +[next-drupal](../globals.mdx) / JsonApiError + +# Interface: JsonApiError + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:2](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L2) + +## Properties + +### code? + +> `optional` **code**: `string` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L5) + +--- + +### detail? + +> `optional` **detail**: `string` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:7](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L7) + +--- + +### id? + +> `optional` **id**: `string` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:3](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L3) + +--- + +### links? + +> `optional` **links**: [`JsonApiLinks`](JsonApiLinks.mdx) + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:8](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L8) + +--- + +### status? + +> `optional` **status**: `string` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:4](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L4) + +--- + +### title? + +> `optional` **title**: `string` + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:6](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L6) diff --git a/www/content/docs/api/interfaces/JsonApiLinks.mdx b/www/content/docs/api/interfaces/JsonApiLinks.mdx new file mode 100644 index 00000000..4968ad6e --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiLinks.mdx @@ -0,0 +1,9 @@ +[next-drupal](../globals.mdx) / JsonApiLinks + +# Interface: JsonApiLinks + +Defined in: [packages/next-drupal/src/jsonapi-errors.ts:12](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/jsonapi-errors.ts#L12) + +## Indexable + +\[`key`: `string`\]: `string` \| `Record`\<`string`, `string`\> diff --git a/www/content/docs/api/interfaces/JsonApiResource.mdx b/www/content/docs/api/interfaces/JsonApiResource.mdx new file mode 100644 index 00000000..07aa776f --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiResource.mdx @@ -0,0 +1,53 @@ +[next-drupal](../globals.mdx) / JsonApiResource + +# Interface: JsonApiResource + +Defined in: [packages/next-drupal/src/types/resource.ts:58](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L58) + +## Extends + +- `Record`\<`string`, `any`\> + +## Extended by + +- [`DrupalBlock`](DrupalBlock.mdx) +- [`DrupalFile`](DrupalFile.mdx) +- [`DrupalMedia`](DrupalMedia.mdx) +- [`DrupalParagraph`](DrupalParagraph.mdx) +- [`JsonApiResourceWithPath`](JsonApiResourceWithPath.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) diff --git a/www/content/docs/api/interfaces/JsonApiResourceBodyRelationship.mdx b/www/content/docs/api/interfaces/JsonApiResourceBodyRelationship.mdx new file mode 100644 index 00000000..9131be89 --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiResourceBodyRelationship.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / JsonApiResourceBodyRelationship + +# Interface: JsonApiResourceBodyRelationship + +Defined in: [packages/next-drupal/src/types/resource.ts:22](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L22) + +## Properties + +### data + +> **data**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:23](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L23) + +#### id + +> **id**: `string` + +#### type + +> **type**: `string` diff --git a/www/content/docs/api/interfaces/JsonApiResourceWithPath.mdx b/www/content/docs/api/interfaces/JsonApiResourceWithPath.mdx new file mode 100644 index 00000000..d89c178f --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiResourceWithPath.mdx @@ -0,0 +1,75 @@ +[next-drupal](../globals.mdx) / JsonApiResourceWithPath + +# Interface: JsonApiResourceWithPath + +Defined in: [packages/next-drupal/src/types/resource.ts:65](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L65) + +## Extends + +- [`JsonApiResource`](JsonApiResource.mdx) + +## Extended by + +- [`DrupalNode`](DrupalNode.mdx) +- [`DrupalTaxonomyTerm`](DrupalTaxonomyTerm.mdx) +- [`DrupalUser`](DrupalUser.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### id + +> **id**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:59](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L59) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`id`](JsonApiResource.mdx#id) + +--- + +### langcode + +> **langcode**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L61) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`langcode`](JsonApiResource.mdx#langcode) + +--- + +### path + +> **path**: [`DrupalPathAlias`](../type-aliases/DrupalPathAlias.mdx) + +Defined in: [packages/next-drupal/src/types/resource.ts:66](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L66) + +--- + +### status + +> **status**: `boolean` + +Defined in: [packages/next-drupal/src/types/resource.ts:62](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L62) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`status`](JsonApiResource.mdx#status) + +--- + +### type + +> **type**: `string` + +Defined in: [packages/next-drupal/src/types/resource.ts:60](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L60) + +#### Inherited from + +[`JsonApiResource`](JsonApiResource.mdx).[`type`](JsonApiResource.mdx#type) diff --git a/www/content/docs/api/interfaces/JsonApiResponse.mdx b/www/content/docs/api/interfaces/JsonApiResponse.mdx new file mode 100644 index 00000000..00bdf14f --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiResponse.mdx @@ -0,0 +1,81 @@ +[next-drupal](../globals.mdx) / JsonApiResponse + +# Interface: JsonApiResponse + +Defined in: [packages/next-drupal/src/types/resource.ts:7](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L7) + +## Extends + +- `Record`\<`string`, `any`\> + +## Extended by + +- [`DrupalSearchApiJsonApiResponse`](DrupalSearchApiJsonApiResponse.mdx) + +## Indexable + +\[`key`: `string`\]: `any` + +## Properties + +### data + +> **data**: `Record`\<`string`, `any`\>[] + +Defined in: [packages/next-drupal/src/types/resource.ts:12](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L12) + +--- + +### errors + +> **errors**: [`JsonApiError`](JsonApiError.mdx)[] + +Defined in: [packages/next-drupal/src/types/resource.ts:13](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L13) + +--- + +### included? + +> `optional` **included**: `Record`\<`string`, `any`\>[] + +Defined in: [packages/next-drupal/src/types/resource.ts:19](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L19) + +--- + +### jsonapi? + +> `optional` **jsonapi**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:8](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L8) + +#### meta + +> **meta**: `Record`\<`string`, `any`\>[] + +#### version + +> **version**: `string` + +--- + +### links? + +> `optional` **links**: [`JsonApiLinks`](JsonApiLinks.mdx) + +Defined in: [packages/next-drupal/src/types/resource.ts:18](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L18) + +--- + +### meta + +> **meta**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:14](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L14) + +#### Index Signature + +\[`key`: `string`\]: `any` + +#### count + +> **count**: `number` diff --git a/www/content/docs/api/interfaces/JsonApiUpdateResourceBody.mdx b/www/content/docs/api/interfaces/JsonApiUpdateResourceBody.mdx new file mode 100644 index 00000000..7f627e64 --- /dev/null +++ b/www/content/docs/api/interfaces/JsonApiUpdateResourceBody.mdx @@ -0,0 +1,29 @@ +[next-drupal](../globals.mdx) / JsonApiUpdateResourceBody + +# Interface: JsonApiUpdateResourceBody + +Defined in: [packages/next-drupal/src/types/resource.ts:49](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L49) + +## Properties + +### data + +> **data**: `object` + +Defined in: [packages/next-drupal/src/types/resource.ts:50](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/resource.ts#L50) + +#### attributes? + +> `optional` **attributes**: `Record`\<`string`, `any`\> + +#### id? + +> `optional` **id**: `string` + +#### relationships? + +> `optional` **relationships**: `Record`\<`string`, [`JsonApiResourceBodyRelationship`](JsonApiResourceBodyRelationship.mdx)\> + +#### type? + +> `optional` **type**: `string` diff --git a/www/content/docs/api/interfaces/Logger.mdx b/www/content/docs/api/interfaces/Logger.mdx new file mode 100644 index 00000000..38775618 --- /dev/null +++ b/www/content/docs/api/interfaces/Logger.mdx @@ -0,0 +1,77 @@ +[next-drupal](../globals.mdx) / Logger + +# Interface: Logger + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:124](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L124) + +## Methods + +### debug() + +> **debug**(`message`): `void` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:127](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L127) + +#### Parameters + +##### message + +`any` + +#### Returns + +`void` + +--- + +### error() + +> **error**(`message`): `void` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:131](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L131) + +#### Parameters + +##### message + +`any` + +#### Returns + +`void` + +--- + +### log() + +> **log**(`message`): `void` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:125](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L125) + +#### Parameters + +##### message + +`any` + +#### Returns + +`void` + +--- + +### warn() + +> **warn**(`message`): `void` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:129](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L129) + +#### Parameters + +##### message + +`any` + +#### Returns + +`void` diff --git a/www/content/docs/api/interfaces/NextDrupalAuthClientIdSecret.mdx b/www/content/docs/api/interfaces/NextDrupalAuthClientIdSecret.mdx new file mode 100644 index 00000000..0c936502 --- /dev/null +++ b/www/content/docs/api/interfaces/NextDrupalAuthClientIdSecret.mdx @@ -0,0 +1,37 @@ +[next-drupal](../globals.mdx) / NextDrupalAuthClientIdSecret + +# Interface: NextDrupalAuthClientIdSecret + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:101](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L101) + +## Properties + +### clientId + +> **clientId**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:102](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L102) + +--- + +### clientSecret + +> **clientSecret**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:103](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L103) + +--- + +### scope? + +> `optional` **scope**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:105](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L105) + +--- + +### url? + +> `optional` **url**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:104](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L104) diff --git a/www/content/docs/api/interfaces/NextDrupalAuthUsernamePassword.mdx b/www/content/docs/api/interfaces/NextDrupalAuthUsernamePassword.mdx new file mode 100644 index 00000000..56cd85b2 --- /dev/null +++ b/www/content/docs/api/interfaces/NextDrupalAuthUsernamePassword.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / NextDrupalAuthUsernamePassword + +# Interface: NextDrupalAuthUsernamePassword + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:108](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L108) + +## Properties + +### password + +> **password**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:110](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L110) + +--- + +### username + +> **username**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:109](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L109) diff --git a/www/content/docs/api/interfaces/Serializer.mdx b/www/content/docs/api/interfaces/Serializer.mdx new file mode 100644 index 00000000..850fbdc1 --- /dev/null +++ b/www/content/docs/api/interfaces/Serializer.mdx @@ -0,0 +1,13 @@ +[next-drupal](../globals.mdx) / Serializer + +# Interface: Serializer + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:39](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L39) + +## Properties + +### deserialize + +> **deserialize**: [`JsonDeserializer`](../type-aliases/JsonDeserializer.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:40](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L40) diff --git a/www/content/docs/api/type-aliases/AccessTokenScope.mdx b/www/content/docs/api/type-aliases/AccessTokenScope.mdx new file mode 100644 index 00000000..1d9eefa5 --- /dev/null +++ b/www/content/docs/api/type-aliases/AccessTokenScope.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / AccessTokenScope + +# Type Alias: AccessTokenScope + +> **AccessTokenScope**: `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:120](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L120) diff --git a/www/content/docs/api/type-aliases/BaseUrl.mdx b/www/content/docs/api/type-aliases/BaseUrl.mdx new file mode 100644 index 00000000..5f0347ed --- /dev/null +++ b/www/content/docs/api/type-aliases/BaseUrl.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / BaseUrl + +# Type Alias: BaseUrl + +> **BaseUrl**: `string` + +Defined in: [packages/next-drupal/src/types/options.ts:3](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L3) diff --git a/www/content/docs/api/type-aliases/DrupalClientAuth.mdx b/www/content/docs/api/type-aliases/DrupalClientAuth.mdx new file mode 100644 index 00000000..50a4485e --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalClientAuth.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalClientAuth + +# Type Alias: DrupalClientAuth + +> **DrupalClientAuth**: [`NextDrupalAuth`](NextDrupalAuth.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:31](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L31) diff --git a/www/content/docs/api/type-aliases/DrupalClientAuthAccessToken.mdx b/www/content/docs/api/type-aliases/DrupalClientAuthAccessToken.mdx new file mode 100644 index 00000000..b30ed940 --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalClientAuthAccessToken.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalClientAuthAccessToken + +# Type Alias: DrupalClientAuthAccessToken + +> **DrupalClientAuthAccessToken**: [`NextDrupalAuthAccessToken`](NextDrupalAuthAccessToken.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L37) diff --git a/www/content/docs/api/type-aliases/DrupalClientAuthClientIdSecret.mdx b/www/content/docs/api/type-aliases/DrupalClientAuthClientIdSecret.mdx new file mode 100644 index 00000000..1cf7ca4f --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalClientAuthClientIdSecret.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalClientAuthClientIdSecret + +# Type Alias: DrupalClientAuthClientIdSecret + +> **DrupalClientAuthClientIdSecret**: [`NextDrupalAuthClientIdSecret`](../interfaces/NextDrupalAuthClientIdSecret.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:35](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L35) diff --git a/www/content/docs/api/type-aliases/DrupalClientAuthUsernamePassword.mdx b/www/content/docs/api/type-aliases/DrupalClientAuthUsernamePassword.mdx new file mode 100644 index 00000000..f14937ef --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalClientAuthUsernamePassword.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalClientAuthUsernamePassword + +# Type Alias: DrupalClientAuthUsernamePassword + +> **DrupalClientAuthUsernamePassword**: [`NextDrupalAuthUsernamePassword`](../interfaces/NextDrupalAuthUsernamePassword.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:33](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L33) diff --git a/www/content/docs/api/type-aliases/DrupalClientOptions.mdx b/www/content/docs/api/type-aliases/DrupalClientOptions.mdx new file mode 100644 index 00000000..afa92fcf --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalClientOptions.mdx @@ -0,0 +1,31 @@ +[next-drupal](../globals.mdx) / DrupalClientOptions + +# Type Alias: DrupalClientOptions + +> **DrupalClientOptions**: [`NextDrupalOptions`](NextDrupalOptions.mdx) & `object` + +Defined in: [packages/next-drupal/src/types/next-drupal-pages.ts:9](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-pages.ts#L9) + +## Type declaration + +### serializer? + +> `optional` **serializer**: [`Serializer`](../interfaces/Serializer.mdx) + +Override the default data serializer. You can use this to add your own JSON:API data deserializer. + +- **Default value**: `jsona` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#serializer) + +### useDefaultResourceTypeEntry? + +> `optional` **useDefaultResourceTypeEntry**: `boolean` + +By default, the client will make a request to JSON:API to retrieve the endpoint url. You can turn this off and use the default endpoint based on the resource name. + +- **Default value**: `false` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/configuration#usedefaultresourcetypeentry) diff --git a/www/content/docs/api/type-aliases/DrupalMenuItemId.mdx b/www/content/docs/api/type-aliases/DrupalMenuItemId.mdx new file mode 100644 index 00000000..a08dd58f --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalMenuItemId.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalMenuItemId + +# Type Alias: DrupalMenuItemId + +> **DrupalMenuItemId**: `string` + +Defined in: [packages/next-drupal/src/types/drupal.ts:61](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L61) diff --git a/www/content/docs/api/type-aliases/DrupalMenuLinkContent.mdx b/www/content/docs/api/type-aliases/DrupalMenuLinkContent.mdx new file mode 100644 index 00000000..6772ba1d --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalMenuLinkContent.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalMenuLinkContent + +# Type Alias: DrupalMenuLinkContent + +> **DrupalMenuLinkContent**: [`DrupalMenuItem`](../interfaces/DrupalMenuItem.mdx) + +Defined in: [packages/next-drupal/src/types/deprecated.ts:6](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/deprecated.ts#L6) diff --git a/www/content/docs/api/type-aliases/DrupalPathAlias.mdx b/www/content/docs/api/type-aliases/DrupalPathAlias.mdx new file mode 100644 index 00000000..8ebeb2ea --- /dev/null +++ b/www/content/docs/api/type-aliases/DrupalPathAlias.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / DrupalPathAlias + +# Type Alias: DrupalPathAlias + +> **DrupalPathAlias**: `object` + +Defined in: [packages/next-drupal/src/types/drupal.ts:78](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/drupal.ts#L78) + +## Type declaration + +### alias + +> **alias**: `string` + +### langcode + +> **langcode**: `string` + +### pid + +> **pid**: `number` diff --git a/www/content/docs/api/type-aliases/EndpointSearchParams.mdx b/www/content/docs/api/type-aliases/EndpointSearchParams.mdx new file mode 100644 index 00000000..38849b45 --- /dev/null +++ b/www/content/docs/api/type-aliases/EndpointSearchParams.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / EndpointSearchParams + +# Type Alias: EndpointSearchParams + +> **EndpointSearchParams**: `string` \| `Record`\<`string`, `string`\> \| `URLSearchParams` \| [`JsonApiParams`](JsonApiParams.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:134](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L134) diff --git a/www/content/docs/api/type-aliases/Fetcher.mdx b/www/content/docs/api/type-aliases/Fetcher.mdx new file mode 100644 index 00000000..3779c779 --- /dev/null +++ b/www/content/docs/api/type-aliases/Fetcher.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / Fetcher + +# Type Alias: Fetcher + +> **Fetcher**: `WindowOrWorkerGlobalScope`\[`"fetch"`\] + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:122](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L122) diff --git a/www/content/docs/api/type-aliases/JsonApiOptions.mdx b/www/content/docs/api/type-aliases/JsonApiOptions.mdx new file mode 100644 index 00000000..1f1aeee0 --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonApiOptions.mdx @@ -0,0 +1,17 @@ +[next-drupal](../globals.mdx) / JsonApiOptions + +# Type Alias: JsonApiOptions + +> **JsonApiOptions**: `object` & [`JsonApiWithAuthOption`](JsonApiWithAuthOption.mdx) & \{ `defaultLocale`: [`Locale`](Locale.mdx); `locale`: [`Locale`](Locale.mdx); \} \| \{ `defaultLocale`: `never`; `locale`: `undefined`; \} + +Defined in: [packages/next-drupal/src/types/options.ts:13](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L13) + +## Type declaration + +### deserialize? + +> `optional` **deserialize**: `boolean` + +### params? + +> `optional` **params**: [`JsonApiParams`](JsonApiParams.mdx) diff --git a/www/content/docs/api/type-aliases/JsonApiParams.mdx b/www/content/docs/api/type-aliases/JsonApiParams.mdx new file mode 100644 index 00000000..9d491e1c --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonApiParams.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / JsonApiParams + +# Type Alias: JsonApiParams + +> **JsonApiParams**: `Record`\<`string`, `any`\> + +Defined in: [packages/next-drupal/src/types/options.ts:42](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L42) diff --git a/www/content/docs/api/type-aliases/JsonApiWithAuthOption.mdx b/www/content/docs/api/type-aliases/JsonApiWithAuthOption.mdx new file mode 100644 index 00000000..675cef62 --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonApiWithAuthOption.mdx @@ -0,0 +1,13 @@ +[next-drupal](../globals.mdx) / JsonApiWithAuthOption + +# Type Alias: JsonApiWithAuthOption + +> **JsonApiWithAuthOption**: `object` + +Defined in: [packages/next-drupal/src/types/options.ts:28](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L28) + +## Type declaration + +### withAuth? + +> `optional` **withAuth**: `boolean` \| [`NextDrupalAuth`](NextDrupalAuth.mdx) diff --git a/www/content/docs/api/type-aliases/JsonApiWithCacheOptions.mdx b/www/content/docs/api/type-aliases/JsonApiWithCacheOptions.mdx new file mode 100644 index 00000000..602092cd --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonApiWithCacheOptions.mdx @@ -0,0 +1,17 @@ +[next-drupal](../globals.mdx) / JsonApiWithCacheOptions + +# Type Alias: JsonApiWithCacheOptions + +> **JsonApiWithCacheOptions**: `object` + +Defined in: [packages/next-drupal/src/types/options.ts:32](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L32) + +## Type declaration + +### cacheKey? + +> `optional` **cacheKey**: `string` + +### withCache? + +> `optional` **withCache**: `boolean` diff --git a/www/content/docs/api/type-aliases/JsonApiWithLocaleOptions.mdx b/www/content/docs/api/type-aliases/JsonApiWithLocaleOptions.mdx new file mode 100644 index 00000000..8cbb2e6e --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonApiWithLocaleOptions.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / JsonApiWithLocaleOptions + +# Type Alias: JsonApiWithLocaleOptions + +> **JsonApiWithLocaleOptions**: `Omit`\<[`JsonApiOptions`](JsonApiOptions.mdx), `"withAuth"`\> + +Defined in: [packages/next-drupal/src/types/deprecated.ts:4](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/deprecated.ts#L4) diff --git a/www/content/docs/api/type-aliases/JsonApiWithNextFetchOptions.mdx b/www/content/docs/api/type-aliases/JsonApiWithNextFetchOptions.mdx new file mode 100644 index 00000000..ad685a44 --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonApiWithNextFetchOptions.mdx @@ -0,0 +1,13 @@ +[next-drupal](../globals.mdx) / JsonApiWithNextFetchOptions + +# Type Alias: JsonApiWithNextFetchOptions + +> **JsonApiWithNextFetchOptions**: `object` + +Defined in: [packages/next-drupal/src/types/options.ts:37](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L37) + +## Type declaration + +### next? + +> `optional` **next**: `NextFetchRequestConfig` diff --git a/www/content/docs/api/type-aliases/JsonDeserializer.mdx b/www/content/docs/api/type-aliases/JsonDeserializer.mdx new file mode 100644 index 00000000..e861fc0b --- /dev/null +++ b/www/content/docs/api/type-aliases/JsonDeserializer.mdx @@ -0,0 +1,21 @@ +[next-drupal](../globals.mdx) / JsonDeserializer + +# Type Alias: JsonDeserializer() + +> **JsonDeserializer**: (`body`, `options`?) => `TJsonaModel` \| `TJsonaModel`[] + +Defined in: [packages/next-drupal/src/types/next-drupal.ts:46](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal.ts#L46) + +## Parameters + +### body + +`Record`\<`string`, `unknown`\> + +### options? + +`Record`\<`string`, `unknown`\> + +## Returns + +`TJsonaModel` \| `TJsonaModel`[] diff --git a/www/content/docs/api/type-aliases/Locale.mdx b/www/content/docs/api/type-aliases/Locale.mdx new file mode 100644 index 00000000..94c6fd36 --- /dev/null +++ b/www/content/docs/api/type-aliases/Locale.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / Locale + +# Type Alias: Locale + +> **Locale**: `string` + +Defined in: [packages/next-drupal/src/types/options.ts:5](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L5) diff --git a/www/content/docs/api/type-aliases/NextDrupalAuth.mdx b/www/content/docs/api/type-aliases/NextDrupalAuth.mdx new file mode 100644 index 00000000..72c84ad5 --- /dev/null +++ b/www/content/docs/api/type-aliases/NextDrupalAuth.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / NextDrupalAuth + +# Type Alias: NextDrupalAuth + +> **NextDrupalAuth**: [`NextDrupalAuthAccessToken`](NextDrupalAuthAccessToken.mdx) \| [`NextDrupalAuthClientIdSecret`](../interfaces/NextDrupalAuthClientIdSecret.mdx) \| [`NextDrupalAuthUsernamePassword`](../interfaces/NextDrupalAuthUsernamePassword.mdx) \| () => `string` \| `string` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:92](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L92) diff --git a/www/content/docs/api/type-aliases/NextDrupalAuthAccessToken.mdx b/www/content/docs/api/type-aliases/NextDrupalAuthAccessToken.mdx new file mode 100644 index 00000000..2e964f9d --- /dev/null +++ b/www/content/docs/api/type-aliases/NextDrupalAuthAccessToken.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / NextDrupalAuthAccessToken + +# Type Alias: NextDrupalAuthAccessToken + +> **NextDrupalAuthAccessToken**: [`AccessToken`](../interfaces/AccessToken.mdx) + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:99](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L99) diff --git a/www/content/docs/api/type-aliases/NextDrupalBaseOptions.mdx b/www/content/docs/api/type-aliases/NextDrupalBaseOptions.mdx new file mode 100644 index 00000000..a22ce3de --- /dev/null +++ b/www/content/docs/api/type-aliases/NextDrupalBaseOptions.mdx @@ -0,0 +1,105 @@ +[next-drupal](../globals.mdx) / NextDrupalBaseOptions + +# Type Alias: NextDrupalBaseOptions + +> **NextDrupalBaseOptions**: `object` + +Defined in: [packages/next-drupal/src/types/next-drupal-base.ts:3](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal-base.ts#L3) + +## Type declaration + +### accessToken? + +> `optional` **accessToken**: [`AccessToken`](../interfaces/AccessToken.mdx) + +A long-lived access token you can set for the client. + +- **Default value**: `null` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#accesstoken) + +### apiPrefix? + +> `optional` **apiPrefix**: `string` + +Set the JSON:API prefix. + +- **Default value**: `/jsonapi` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#apiprefix) + +### auth? + +> `optional` **auth**: [`NextDrupalAuth`](NextDrupalAuth.mdx) + +Override the default auth. You can use this to implement your own authentication mechanism. + +[Documentation](https://next-drupal.org/docs/client/configuration#auth) + +### debug? + +> `optional` **debug**: `boolean` + +Set debug to true to enable debug messages. + +- **Default value**: `false` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#debug) + +### fetcher? + +> `optional` **fetcher**: [`Fetcher`](Fetcher.mdx) + +Override the default fetcher. Use this to add your own fetcher ex. axios. + +- **Default value**: `fetch` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#fetcher) + +### frontPage? + +> `optional` **frontPage**: `string` + +Set the default frontPage. + +- **Default value**: `/home` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#frontpage) + +### headers? + +> `optional` **headers**: `HeadersInit` + +Set custom headers for the fetcher. + +- **Default value**: `{ "Content-Type": "application/vnd.api+json", Accept: "application/vnd.api+json" }` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#headers) + +### logger? + +> `optional` **logger**: [`Logger`](../interfaces/Logger.mdx) + +Override the default logger. You can use this to send logs to a third-party service. + +- **Default value**: `console` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#logger) + +### withAuth? + +> `optional` **withAuth**: `boolean` + +Set whether the client should use authenticated requests by default. + +- **Default value**: `true` +- **Required**: \*_No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#withauth) diff --git a/www/content/docs/api/type-aliases/NextDrupalOptions.mdx b/www/content/docs/api/type-aliases/NextDrupalOptions.mdx new file mode 100644 index 00000000..a9cfe116 --- /dev/null +++ b/www/content/docs/api/type-aliases/NextDrupalOptions.mdx @@ -0,0 +1,53 @@ +[next-drupal](../globals.mdx) / NextDrupalOptions + +# Type Alias: NextDrupalOptions + +> **NextDrupalOptions**: [`NextDrupalBaseOptions`](NextDrupalBaseOptions.mdx) & `object` + +Defined in: [packages/next-drupal/src/types/next-drupal.ts:4](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/next-drupal.ts#L4) + +## Type declaration + +### cache? + +> `optional` **cache**: [`DataCache`](../interfaces/DataCache.mdx) + +Override the default cache. + +- **Default value**: `node-cache` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#cache) + +### deserializer? + +> `optional` **deserializer**: [`JsonDeserializer`](JsonDeserializer.mdx) + +Override the default data deserializer. You can use this to add your own JSON:API data deserializer. + +- **Default value**: `(new jsona()).deserialize` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#deserializer) + +### throwJsonApiErrors? + +> `optional` **throwJsonApiErrors**: `boolean` + +If set to true, JSON:API errors are thrown in non-production environments. The errors are shown in the Next.js overlay. + +**Default value**: `true` +**Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#throwjsonapierrors) + +### useDefaultEndpoints? + +> `optional` **useDefaultEndpoints**: `boolean` + +By default, the resource endpoint will be based on the resource name. If you turn this off, a JSON:API request will retrieve the resource's endpoint url. + +- **Default value**: `true` +- **Required**: _No_ + +[Documentation](https://next-drupal.org/docs/client/configuration#usedefaultendpoints) diff --git a/www/content/docs/api/type-aliases/PathPrefix.mdx b/www/content/docs/api/type-aliases/PathPrefix.mdx new file mode 100644 index 00000000..e359d3c8 --- /dev/null +++ b/www/content/docs/api/type-aliases/PathPrefix.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / PathPrefix + +# Type Alias: PathPrefix + +> **PathPrefix**: `string` + +Defined in: [packages/next-drupal/src/types/options.ts:7](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/types/options.ts#L7) diff --git a/www/content/docs/api/variables/DRAFT_DATA_COOKIE_NAME.mdx b/www/content/docs/api/variables/DRAFT_DATA_COOKIE_NAME.mdx new file mode 100644 index 00000000..ce4061bd --- /dev/null +++ b/www/content/docs/api/variables/DRAFT_DATA_COOKIE_NAME.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DRAFT_DATA_COOKIE_NAME + +# Variable: DRAFT_DATA_COOKIE_NAME + +> `const` **DRAFT_DATA_COOKIE_NAME**: `"next_drupal_draft_data"` = `"next_drupal_draft_data"` + +Defined in: [packages/next-drupal/src/draft-constants.ts:1](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/draft-constants.ts#L1) diff --git a/www/content/docs/api/variables/DRAFT_MODE_COOKIE_NAME.mdx b/www/content/docs/api/variables/DRAFT_MODE_COOKIE_NAME.mdx new file mode 100644 index 00000000..4e0f3595 --- /dev/null +++ b/www/content/docs/api/variables/DRAFT_MODE_COOKIE_NAME.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DRAFT_MODE_COOKIE_NAME + +# Variable: DRAFT_MODE_COOKIE_NAME + +> `const` **DRAFT_MODE_COOKIE_NAME**: `"__prerender_bypass"` = `"__prerender_bypass"` + +Defined in: [packages/next-drupal/src/draft-constants.ts:4](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/draft-constants.ts#L4) diff --git a/www/content/docs/api/variables/DrupalClient.mdx b/www/content/docs/api/variables/DrupalClient.mdx new file mode 100644 index 00000000..2a048e89 --- /dev/null +++ b/www/content/docs/api/variables/DrupalClient.mdx @@ -0,0 +1,7 @@ +[next-drupal](../globals.mdx) / DrupalClient + +# Variable: DrupalClient + +> `const` **DrupalClient**: _typeof_ [`NextDrupalPages`](../classes/NextDrupalPages.mdx) = `NextDrupalPages` + +Defined in: [packages/next-drupal/src/deprecated.ts:2](https://github.com/chapter-three/next-drupal/blob/b814feb907442ea504825c35810c973aeb865442/packages/next-drupal/src/deprecated.ts#L2) diff --git a/www/next.config.js b/www/next.config.js index 47b3c7b7..3d9e3363 100644 --- a/www/next.config.js +++ b/www/next.config.js @@ -102,6 +102,11 @@ module.exports = { destination: "/learn/on-demand-revalidation", permanent: true, }, + { + source: "/docs/api/:path*.mdx", + destination: "/docs/api/:path*", + permanent: true, + }, ] }, } diff --git a/www/package.json b/www/package.json index 6834ba16..1b11886a 100644 --- a/www/package.json +++ b/www/package.json @@ -6,9 +6,10 @@ "main": "index.js", "license": "MIT", "scripts": { - "dev": "next dev -p 4444", - "build": "next build", - "preview": "next build && next start -p 4444" + "dev": "typedoc --tsconfig tsconfig.docs.json && next dev -p 4444", + "build": "typedoc --tsconfig tsconfig.docs.json && next build", + "preview": "typedoc --tsconfig tsconfig.docs.json && next build && next start -p 4444", + "generate:api-docs": "typedoc --tsconfig tsconfig.docs.json" }, "dependencies": { "@docsearch/react": "^3.6.0", @@ -23,7 +24,9 @@ "prism-react-renderer": "^1.3.5", "react": "^18.2.0", "react-dom": "^18.2.0", - "sharp": "^0.30.7" + "sharp": "^0.30.7", + "typedoc": "^0.27", + "typedoc-plugin-markdown": "^4.4" }, "devDependencies": { "@mapbox/rehype-prism": "^0.8.0", @@ -39,4 +42,4 @@ "tailwindcss": "^3.4.3", "typescript": "^5.4.5" } -} +} \ No newline at end of file diff --git a/www/tsconfig.docs.json b/www/tsconfig.docs.json new file mode 100644 index 00000000..d4dc75ac --- /dev/null +++ b/www/tsconfig.docs.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es2020", + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": ["../packages/next-drupal/src/**/*"], + "exclude": ["node_modules"] +} diff --git a/www/typedoc.json b/www/typedoc.json new file mode 100644 index 00000000..05db124c --- /dev/null +++ b/www/typedoc.json @@ -0,0 +1,7 @@ +{ + "plugin": ["typedoc-plugin-markdown"], + "entryPoints": ["../packages/next-drupal/src/index.ts"], + "out": "content/docs/api", + "fileExtension": ".mdx", + "hidePageHeader": true +} diff --git a/yarn.lock b/yarn.lock index c11557a7..e72e619e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1648,6 +1648,15 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== +"@gerrit0/mini-shiki@^1.24.0": + version "1.26.1" + resolved "https://registry.yarnpkg.com/@gerrit0/mini-shiki/-/mini-shiki-1.26.1.tgz#b59884bd6013976ca66dec197492a1387fdbea52" + integrity sha512-gHFUvv9f1fU2Piou/5Y7Sx5moYxcERbC7CXc6rkDLQTUBg5Dgg9L4u29/nHqfoQ3Y9R0h0BcOhd14uOEZIBP7Q== + dependencies: + "@shikijs/engine-oniguruma" "^1.26.1" + "@shikijs/types" "^1.26.1" + "@shikijs/vscode-textmate" "^10.0.1" + "@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0": version "9.3.0" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" @@ -2549,6 +2558,27 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.2.tgz#053f1540703faa81dea2966b768ee5581c66aeda" integrity sha512-hw437iINopmQuxWPSUEvqE56NCPsiU8N4AYtfHmJFckclktzK9YQJieD3XkDCDH4OjL+C7zgPUh73R/nrcHrqw== +"@shikijs/engine-oniguruma@^1.26.1": + version "1.26.2" + resolved "https://registry.yarnpkg.com/@shikijs/engine-oniguruma/-/engine-oniguruma-1.26.2.tgz#a8a37ef33624dee783e79f7756ef1d0a2b907639" + integrity sha512-mlN7Qrs+w60nKrd7at7XkXSwz6728Pe34taDmHrG6LRHjzCqQ+ysg+/AT6/D2LMk0s2lsr71DjpI73430QP4/w== + dependencies: + "@shikijs/types" "1.26.2" + "@shikijs/vscode-textmate" "^10.0.1" + +"@shikijs/types@1.26.2", "@shikijs/types@^1.26.1": + version "1.26.2" + resolved "https://registry.yarnpkg.com/@shikijs/types/-/types-1.26.2.tgz#6180cdb5023d21dfe2d2bd784afdfab4e2bce776" + integrity sha512-PO2jucx2FIdlLBPYbIUlMtWSLs5ulcRcuV93cR3T65lkK5SJP4MGBRt9kmWGXiQc0f7+FHj/0BEawditZcI/fQ== + dependencies: + "@shikijs/vscode-textmate" "^10.0.1" + "@types/hast" "^3.0.4" + +"@shikijs/vscode-textmate@^10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz#d06d45b67ac5e9b0088e3f67ebd3f25c6c3d711a" + integrity sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg== + "@sideway/address@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" @@ -2867,6 +2897,13 @@ dependencies: "@types/unist" "^2" +"@types/hast@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa" + integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ== + dependencies: + "@types/unist" "*" + "@types/hoist-non-react-statics@^3.3.1": version "3.3.5" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz#dab7867ef789d87e2b4b0003c9d65c49cc44a494" @@ -2996,6 +3033,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/unist@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" + integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q== + "@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": version "2.0.10" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc" @@ -5238,7 +5280,7 @@ enquirer@~2.3.6: dependencies: ansi-colors "^4.1.1" -entities@^4.2.0, entities@^4.5.0: +entities@^4.2.0, entities@^4.4.0, entities@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== @@ -8465,6 +8507,13 @@ lines-and-columns@~2.0.3: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-2.0.4.tgz#d00318855905d2660d8c0822e3f5a4715855fc42" integrity sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A== +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== + dependencies: + uc.micro "^2.0.0" + lint-staged@^15.2.2: version "15.2.2" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.2.tgz#ad7cbb5b3ab70e043fa05bff82a09ed286bc4c5f" @@ -8757,6 +8806,11 @@ lru-cache@^7.5.1, lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== +lunr@^2.3.9: + version "2.3.9" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" + integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== + lz-string@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" @@ -8861,6 +8915,18 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== +markdown-it@^14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== + dependencies: + argparse "^2.0.1" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" + mdast-squeeze-paragraphs@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" @@ -8940,6 +9006,11 @@ mdurl@^1.0.0: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + memoize-one@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-4.1.0.tgz#a2387c58c03fff27ca390c31b764a79addf3f906" @@ -9084,6 +9155,13 @@ minimatch@^9.0.0, minimatch@^9.0.1, minimatch@^9.0.3, minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -10606,6 +10684,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + punycode@^2.1.0, punycode@^2.1.1: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -11778,7 +11861,16 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11882,7 +11974,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11910,6 +12002,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -12572,11 +12671,32 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typedoc-plugin-markdown@^4.4: + version "4.4.1" + resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.4.1.tgz#f57266fa6916cb3837a9c84f59f3aaced309be9a" + integrity sha512-fx23nSCvewI9IR8lzIYtzDphETcgTDuxKcmHKGD4lo36oexC+B1k4NaCOY58Snqb4OlE8OXDAGVcQXYYuLRCNw== + +typedoc@^0.27: + version "0.27.6" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.27.6.tgz#7e8d067bd5386b7908afcb12c9054a83e8bb326b" + integrity sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw== + dependencies: + "@gerrit0/mini-shiki" "^1.24.0" + lunr "^2.3.9" + markdown-it "^14.1.0" + minimatch "^9.0.5" + yaml "^2.6.1" + "typescript@>=3 < 6", typescript@^5.4.5: version "5.4.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== + uglify-js@^3.1.4: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" @@ -13157,7 +13277,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -13184,6 +13304,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -13313,6 +13442,11 @@ yaml@^2.0.0-1, yaml@^2.3.4, yaml@^2.4.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.1.tgz#2e57e0b5e995292c25c75d2658f0664765210eed" integrity sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg== +yaml@^2.6.1: + version "2.7.0" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" + integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== + yargs-parser@21.1.1, yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"