{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n  DefaultTranslationKeys,\n  DefaultTranslationsObject,\n  I18n,\n  I18nClient,\n  I18nOptions,\n  TFunction,\n} from '@payloadcms/translations'\nimport type { BusboyConfig } from 'busboy'\nimport type GraphQL from 'graphql'\nimport type { GraphQLFormattedError } from 'graphql'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { Metadata } from 'next'\nimport type { DestinationStream, Level, LoggerOptions } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { RichTextAdapterProvider } from '../admin/RichText.js'\nimport type {\n  DocumentSubViewTypes,\n  DocumentTabConfig,\n  DocumentViewServerProps,\n  RichTextAdapter,\n} from '../admin/types.js'\nimport type { AdminViewConfig, ViewTypes, VisibleEntities } from '../admin/views/index.js'\nimport type { SanitizedPermissions } from '../auth/index.js'\nimport type {\n  AddToImportMap,\n  ImportMap,\n  Imports,\n  InternalImportMap,\n} from '../bin/generateImportMap/index.js'\nimport type {\n  Collection,\n  CollectionConfig,\n  SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { ErrorName } from '../errors/types.js'\nimport type { RootFoldersConfiguration } from '../folders/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type {\n  Block,\n  ClientField,\n  DataFromWidgetSlug,\n  DefaultDocumentIDType,\n  Field,\n  FlattenedBlock,\n  JobsConfig,\n  KVAdapterResult,\n  Payload,\n  RegisteredPlugins,\n  RequestContext,\n  SelectField,\n  TypedUser,\n  TypedWidget,\n  WidgetSlug,\n} from '../index.js'\nimport type { QueryPreset, QueryPresetConstraints } from '../query-presets/types.js'\nimport type { SanitizedJobsConfig } from '../queues/config/types/index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\n\n/**\n * The string path pointing to the React component. If one of the generics is `never`, you effectively mark it as a server-only or client-only component.\n *\n * If it is `false` an empty component will be rendered.\n */\nexport type PayloadComponent<\n  TComponentServerProps extends never | object = Record<string, any>,\n  TComponentClientProps extends never | object = Record<string, any>,\n> = false | RawPayloadComponent<TComponentServerProps, TComponentClientProps> | string\n\n// We need the actual object as its own type, otherwise the infers for the PayloadClientReactComponent / PayloadServerReactComponent will not work due to the string union.\n// We also NEED to actually use those generics for this to work, thus they are part of the props.\nexport type RawPayloadComponent<\n  TComponentServerProps extends never | object = Record<string, any>,\n  TComponentClientProps extends never | object = Record<string, any>,\n> = {\n  clientProps?: object | TComponentClientProps\n  exportName?: string\n  path: string\n  serverProps?: object | TComponentServerProps\n}\n\nexport type PayloadComponentProps<TPayloadComponent> =\n  TPayloadComponent extends RawPayloadComponent<\n    infer TComponentServerProps,\n    infer TComponentClientProps\n  >\n    ? TComponentClientProps | TComponentServerProps\n    : never\n\nexport type PayloadClientComponentProps<TPayloadComponent> =\n  TPayloadComponent extends RawPayloadComponent<infer _, infer TComponentClientProps>\n    ? TComponentClientProps\n    : never\n\nexport type PayloadServerComponentProps<TPayloadComponent> =\n  TPayloadComponent extends RawPayloadComponent<infer TComponentServerProps, infer _>\n    ? TComponentServerProps\n    : never\n\nexport type PayloadReactComponent<TPayloadComponent> = React.FC<\n  PayloadComponentProps<TPayloadComponent>\n>\n\n// This also ensures that if never is passed to TComponentClientProps, this entire type will be never.\n// => TypeScript will now ensure that users cannot even define the typed Server Components if the PayloadComponent is marked as\n// Client-Only (marked as Client-Only = TComponentServerProps is never)\nexport type PayloadClientReactComponent<TPayloadComponent> =\n  TPayloadComponent extends RawPayloadComponent<infer _, infer TComponentClientProps>\n    ? TComponentClientProps extends never\n      ? never\n      : React.FC<TComponentClientProps>\n    : never\n\nexport type PayloadServerReactComponent<TPayloadComponent> =\n  TPayloadComponent extends RawPayloadComponent<infer TComponentServerProps, infer _>\n    ? TComponentServerProps extends never\n      ? never\n      : React.FC<TComponentServerProps>\n    : never\n\nexport type ResolvedComponent<\n  TComponentServerProps extends never | object,\n  TComponentClientProps extends never | object,\n> = {\n  clientProps?: TComponentClientProps\n  Component: React.FC<TComponentClientProps | TComponentServerProps>\n  serverProps?: TComponentServerProps\n}\n\nexport type BinScriptConfig = {\n  key: string\n  scriptPath: string\n}\n\nexport type BinScript = (config: SanitizedConfig) => Promise<void> | void\n\ntype Prettify<T> = {\n  [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n/**\n * @experimental The plugin API (`order`, `slug`, `options`) may change before being declared stable.\n */\nexport type Plugin = ((config: Config) => Config | Promise<Config>) & {\n  /** @experimental Plugin options exposed for cross-plugin mutation. */\n  options?: Record<string, unknown>\n  /** @experimental Execution order - lower values run first. Defaults to 0. */\n  order?: number\n  /** @experimental Unique identifier for cross-plugin discovery via `config.plugins`. */\n  slug?: string\n}\n\n/**\n * A map of plugin slugs to Plugin instances, built from `config.plugins`.\n * Registered slugs (via `RegisteredPlugins` module augmentation) return typed options.\n *\n * @experimental\n */\nexport type PluginsMap = {\n  [K in keyof RegisteredPlugins]: ({ options: RegisteredPlugins[K] } & Plugin) | undefined\n} & Record<string, Plugin | undefined>\n\nexport type LivePreviewURLType = null | string | undefined\n\nexport type LivePreviewConfig = {\n  /**\n   Device breakpoints to use for the `iframe` of the Live Preview window.\n   Options are displayed in the Live Preview toolbar.\n   The `responsive` breakpoint is included by default.\n   */\n  breakpoints?: {\n    height: number | string\n    label: string\n    name: string\n    width: number | string\n  }[]\n  /**\n   * The URL of the frontend application. This will be rendered within an `iframe` as its `src`.\n   * Payload will send a `window.postMessage()` to this URL with the document data in real-time.\n   * The frontend application is responsible for receiving the message and updating the UI accordingly.\n   * @see https://payloadcms.com/docs/live-preview/frontend\n   *\n   * To conditionally render Live Preview, use a function that returns `undefined` or `null`.\n   *\n   * Note: this function may run often if autosave is enabled with a small interval.\n   * For performance, avoid long-running tasks or expensive operations within this function,\n   * or if you need to do something more complex, cache your function as needed.\n   */\n  url?:\n    | ((args: {\n        collectionConfig?: SanitizedCollectionConfig\n        data: Record<string, any>\n        globalConfig?: SanitizedGlobalConfig\n        locale: Locale\n        /**\n         * @deprecated\n         * Use `req.payload` instead. This will be removed in the next major version.\n         */\n        payload: Payload\n        req: PayloadRequest\n      }) => LivePreviewURLType | Promise<LivePreviewURLType>)\n    | LivePreviewURLType\n}\n\nexport type RootLivePreviewConfig = {\n  collections?: string[]\n  globals?: string[]\n} & LivePreviewConfig\n\nexport type OGImageConfig = {\n  alt?: string\n  height?: number | string\n  type?: string\n  url: string\n  width?: number | string\n}\n\n/**\n * @todo find a way to remove the deep clone here.\n * It can probably be removed after the `DeepRequired` from `Config` to `SanitizedConfig` is removed.\n * Same with `CollectionConfig` to `SanitizedCollectionConfig`.\n */\ntype DeepClone<T> = T extends object ? { [K in keyof T]: DeepClone<T[K]> } : T\n\nexport type MetaConfig = {\n  /**\n   * When `static`, a pre-made image will be used for all pages.\n   * When `dynamic`, a unique image will be generated for each page based on page content and given overrides.\n   * When `off`, no Open Graph images will be generated and the `/api/og` endpoint will be disabled. You can still provide custom images using the `openGraph.images` property.\n   * @default 'dynamic'\n   */\n  defaultOGImageType?: 'dynamic' | 'off' | 'static'\n  /**\n   * String to append to the auto-generated <title> of admin pages\n   * @example `\" - Custom CMS\"`\n   */\n  titleSuffix?: string\n} & DeepClone<Metadata>\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<RootLivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n  locale: string\n  req: PayloadRequest\n  token: null | string\n}\n\nexport type GeneratePreviewURL = (\n  doc: Record<string, unknown>,\n  options: GeneratePreviewURLOptions,\n) => null | Promise<null | string> | string\n\nexport type GraphQLInfo = {\n  collections: {\n    [slug: string]: Collection\n  }\n  globals: Globals\n  Mutation: {\n    fields: Record<string, any>\n    name: string\n  }\n  Query: {\n    fields: Record<string, any>\n    name: string\n  }\n  types: {\n    arrayTypes: Record<string, GraphQL.GraphQLType>\n    blockInputTypes: Record<string, GraphQL.GraphQLInputObjectType>\n    blockTypes: Record<string, GraphQL.GraphQLObjectType>\n    fallbackLocaleInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n    groupTypes: Record<string, GraphQL.GraphQLObjectType>\n    localeInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n    tabTypes: Record<string, GraphQL.GraphQLObjectType>\n  }\n}\nexport type GraphQLExtension = (\n  graphQL: typeof GraphQL,\n  context: {\n    config: SanitizedConfig\n  } & GraphQLInfo,\n) => Record<string, unknown>\n\nexport type InitOptions = {\n  /**\n   * Sometimes, with the local API, you might need to pass a config file directly, for example, serverless on Vercel\n   * The passed config should match the config file, and if it doesn't, there could be mismatches between the admin UI\n   * and the backend functionality\n   */\n  config: Promise<SanitizedConfig> | SanitizedConfig\n  /**\n   * If set to `true`, payload will initialize crons for things like autorunning jobs on initialization.\n   *\n   * @default false\n   */\n  cron?: boolean\n\n  /**\n   * Disable connect to the database on init\n   */\n  disableDBConnect?: boolean\n\n  /**\n   * Disable running of the `onInit` function\n   */\n  disableOnInit?: boolean\n\n  importMap?: ImportMap\n\n  /**\n   * A function that is called immediately following startup that receives the Payload instance as it's only argument.\n   */\n  onInit?: (payload: Payload) => Promise<void> | void\n}\n\n/**\n * This result is calculated on the server\n * and then sent to the client allowing the dashboard to show accessible data and actions.\n *\n * If the result is `true`, the user has access.\n * If the result is an object, it is interpreted as a MongoDB query.\n *\n * @example `{ createdBy: { equals: id } }`\n *\n * @example `{ tenant: { in: tenantIds } }`\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type AccessResult = boolean | Where\n\nexport type AccessArgs<TData = any> = {\n  /**\n   * The relevant resource that is being accessed.\n   *\n   * `data` is null when a list is requested\n   */\n  data?: TData\n  /** ID of the resource being accessed */\n  id?: DefaultDocumentIDType\n  /** If true, the request is for a static file */\n  isReadingStaticFile?: boolean\n  /** The original request that requires an access check */\n  req: PayloadRequest\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<TData = any> = (args: AccessArgs<TData>) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint = {\n  /** Extension point to add your custom data. */\n  custom?: Record<string, any>\n\n  /**\n   * Middleware that will be called when the path/method matches\n   *\n   * Compatible with Web Request/Response Model\n   */\n  handler: PayloadHandler\n  /** HTTP method */\n  method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n  /**\n   * Pattern that should match the path of the incoming request\n   *\n   * Compatible with the Express router\n   */\n  path: string\n  /**\n   * Please add \"root\" routes under the /api folder in the Payload Project.\n   * https://nextjs.org/docs/app/api-reference/file-conventions/route\n   *\n   * @deprecated in 3.0\n   */\n  root?: never\n}\n\n/**\n * @deprecated\n * This type will be renamed in v4.\n * Use `DocumentViewComponent` instead.\n */\nexport type EditViewComponent = DocumentViewComponent\n\nexport type DocumentViewComponent = PayloadComponent<DocumentViewServerProps>\n\n/**\n * @deprecated\n * This type will be renamed in v4.\n * Use `DocumentViewConfig` instead.\n */\nexport type EditViewConfig = DocumentViewConfig\n\ntype BaseDocumentViewConfig = {\n  actions?: CustomComponent[]\n  meta?: MetaConfig\n  tab?: DocumentTabConfig\n}\n\n/*\n  If your view does not originate from a \"known\" key, e.g. `myCustomView`, then it is considered a \"custom\" view and can accept a `path`, etc.\n  To render just a tab component without an accompanying view, you can omit the `path` and `Component` properties altogether.\n*/\nexport type CustomDocumentViewConfig =\n  | ({\n      Component: DocumentViewComponent\n      path: `/${string}`\n    } & BaseDocumentViewConfig)\n  | ({\n      Component?: DocumentViewComponent\n      path?: never\n    } & BaseDocumentViewConfig)\n\n/*\n  If your view does originates from a \"known\" key, e.g. `api`, then it is considered a \"default\" view and cannot accept a `path`, etc.\n*/\nexport type DefaultDocumentViewConfig = {\n  Component?: DocumentViewComponent\n} & BaseDocumentViewConfig\n\nexport type DocumentViewConfig = CustomDocumentViewConfig | DefaultDocumentViewConfig\n\nexport type Params = { [key: string]: string | string[] | undefined }\n\nexport type ServerProps = {\n  readonly documentSubViewType?: DocumentSubViewTypes\n  readonly i18n: I18nClient\n  readonly id?: number | string\n  readonly locale?: Locale\n  readonly params?: Params\n  readonly payload: Payload\n  readonly permissions?: SanitizedPermissions\n  readonly searchParams?: Params\n  readonly user?: TypedUser\n  readonly viewType?: ViewTypes\n  readonly visibleEntities?: VisibleEntities\n}\n\nexport const serverProps: (keyof ServerProps)[] = [\n  'payload',\n  'i18n',\n  'locale',\n  'params',\n  'permissions',\n  'searchParams',\n  'permissions',\n]\n\nexport type Timezone = {\n  label: string\n  value: string\n}\n\ntype SupportedTimezonesFn = (args: { defaultTimezones: Timezone[] }) => Timezone[]\n\nexport type TimezonesConfig = {\n  /**\n   * The default timezone to use for the admin panel.\n   */\n  defaultTimezone?: string\n  /**\n   * Provide your own list of supported timezones for the admin panel\n   *\n   * Values should be IANA timezone names, eg. `America/New_York`\n   *\n   * We use `@date-fns/tz` to handle timezones\n   */\n  supportedTimezones?: SupportedTimezonesFn | Timezone[]\n}\n\ntype SanitizedTimezoneConfig = {\n  supportedTimezones: Timezone[]\n} & Omit<TimezonesConfig, 'supportedTimezones'>\n\nexport type CustomComponent<TAdditionalProps extends object = Record<string, any>> =\n  PayloadComponent<ServerProps & TAdditionalProps, TAdditionalProps>\n\nexport type Locale = {\n  /**\n   * value of supported locale\n   * @example \"en\"\n   */\n  code: string\n  /**\n   * Code of another locale to use when reading documents with fallback, if not specified defaultLocale is used\n   */\n  fallbackLocale?: string | string[]\n  /**\n   * label of supported locale\n   * @example \"English\"\n   */\n  label: Record<string, string> | string\n  /**\n   * if true, defaults textAligmnent on text fields to RTL\n   */\n  rtl?: boolean\n}\n\nexport type BaseLocalizationConfig = {\n  /**\n   * Locale for users that have not expressed their preference for a specific locale\n   * @example `\"en\"`\n   */\n  defaultLocale: string\n  /**\n   * Change the locale used by the default Publish button.\n   * If set to `all`, all locales will be published.\n   * If set to `active`, only the locale currently being edited will be published.\n   * The non-default option will be available via the secondary button.\n   * @default 'all'\n   */\n  defaultLocalePublishOption?: 'active' | 'all'\n  /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale`\n   *\n   * If false, then no requests will fallback unless a fallbackLocale is specified in the request.\n   * @default true\n   */\n  fallback?: boolean\n  /**\n   * Define a function to filter the locales made available in Payload admin UI\n   * based on user.\n   */\n  filterAvailableLocales?: (args: {\n    locales: Locale[]\n    req: PayloadRequest\n  }) => Locale[] | Promise<Locale[]>\n}\n\nexport type LocalizationConfigWithNoLabels = Prettify<\n  {\n    /**\n     * List of supported locales\n     * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n     */\n    locales: string[]\n  } & BaseLocalizationConfig\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n  {\n    /**\n     * List of supported locales with labels\n     * @example {\n     *  label: 'English',\n     *  value: 'en',\n     *  rtl: false\n     * }\n     */\n    locales: Locale[]\n  } & BaseLocalizationConfig\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n  {\n    /**\n     * List of supported locales\n     * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n     */\n    localeCodes: string[]\n  } & LocalizationConfigWithLabels\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n  LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\n\nexport type LabelFunction<TTranslationKeys = DefaultTranslationKeys> = (args: {\n  i18n: I18nClient\n  t: TFunction<TTranslationKeys>\n}) => string\n\nexport type StaticLabel = Record<string, string> | string\n\nexport type SharpDependency = (\n  input?:\n    | ArrayBuffer\n    | Buffer\n    | Float32Array\n    | Float64Array\n    | Int8Array\n    | Int16Array\n    | Int32Array\n    | string\n    | Uint8Array\n    | Uint8ClampedArray\n    | Uint16Array\n    | Uint32Array,\n  options?: sharp.SharpOptions,\n) => sharp.Sharp\n\nexport type CORSConfig = {\n  headers?: string[]\n  origins: '*' | string[]\n}\n\nexport type AdminFunction = {\n  args?: object\n  path: string\n  type: 'function'\n}\n\nexport type AdminComponent = {\n  clientProps?: object\n  path: string\n  serverProps?: object\n  type: 'component'\n}\n\nexport interface AdminDependencies {\n  [key: string]: AdminComponent | AdminFunction\n}\n\nexport type FetchAPIFileUploadOptions = {\n  /**\n   * Returns a HTTP 413 when the file is bigger than the size limit if `true`.\n   * Otherwise, it will add a `truncated = true` to the resulting file structure.\n   * @default false\n   */\n  abortOnLimit?: boolean | undefined\n  /**\n   * Automatically creates the directory path specified in `.mv(filePathName)`\n   * @default false\n   */\n  createParentPath?: boolean | undefined\n  /**\n   * Turn on/off upload process logging. Can be useful for troubleshooting.\n   * @default false\n   */\n  debug?: boolean | undefined\n  /**\n   * User defined limit handler which will be invoked if the file is bigger than configured limits.\n   * @default false\n   */\n  limitHandler?: ((args: { request: Request; size: number }) => void) | boolean | undefined\n  /**\n   * By default, `req.body` and `req.files` are flattened like this:\n   * `{'name': 'John', 'hobbies[0]': 'Cinema', 'hobbies[1]': 'Bike'}\n   *\n   * When this option is enabled they are parsed in order to be nested like this:\n   * `{'name': 'John', 'hobbies': ['Cinema', 'Bike']}`\n   * @default false\n   */\n  parseNested?: boolean | undefined\n  /**\n   * Preserves filename extension when using `safeFileNames` option.\n   * If set to `true`, will default to an extension length of `3`.\n   * If set to `number`, this will be the max allowable extension length.\n   * If an extension is smaller than the extension length, it remains untouched. If the extension is longer,\n   * it is shifted.\n   * @default false\n   *\n   * @example\n   * // true\n   * app.use(fileUpload({ safeFileNames: true, preserveExtension: true }));\n   * // myFileName.ext --> myFileName.ext\n   *\n   * @example\n   * // max extension length 2, extension shifted\n   * app.use(fileUpload({ safeFileNames: true, preserveExtension: 2 }));\n   * // myFileName.ext --> myFileNamee.xt\n   */\n  preserveExtension?: boolean | number | undefined\n  /**\n   * Response which will be send to client if file size limit exceeded when `abortOnLimit` set to `true`.\n   * @default 'File size limit has been reached'\n   */\n  responseOnLimit?: string | undefined\n  /**\n   * Strips characters from the upload's filename.\n   * You can use custom regex to determine what to strip.\n   * If set to `true`, non-alphanumeric characters _except_ dashes and underscores will be stripped.\n   * This option is off by default.\n   * @default false\n   *\n   * @example\n   * // strip slashes from file names\n   * app.use(fileUpload({ safeFileNames: /\\\\/g }))\n   *\n   * @example\n   * app.use(fileUpload({ safeFileNames: true }))\n   */\n  safeFileNames?: boolean | RegExp | undefined\n  /**\n   * Path to store temporary files.\n   * Used along with the `useTempFiles` option. By default this module uses `'tmp'` folder\n   * in the current working directory.\n   * You can use trailing slash, but it is not necessary.\n   * @default 'tmp'\n   */\n  tempFileDir?: string | undefined\n  /**\n   * This defines how long to wait for data before aborting. Set to `0` if you want to turn off timeout checks.\n   * @default 60_000\n   */\n  uploadTimeout?: number | undefined\n  /**\n   * Applies uri decoding to file names if set `true`.\n   * @default false\n   */\n  uriDecodeFileNames?: boolean | undefined\n  /**\n   * By default this module uploads files into RAM.\n   * Setting this option to `true` turns on using temporary files instead of utilising RAM.\n   * This avoids memory overflow issues when uploading large files or in case of uploading\n   * lots of files at same time.\n   * @default false\n   */\n  useTempFiles?: boolean | undefined\n} & Partial<BusboyConfig>\n\nexport type ErrorResult = {\n  data?: any\n  errors: {\n    data?: Record<string, unknown>\n    field?: string\n    message?: string\n    name?: string\n  }[]\n  stack?: string\n}\n\nexport type AfterErrorResult = {\n  graphqlResult?: GraphQLFormattedError\n  response?: Partial<ErrorResult> & Record<string, unknown>\n  status?: number\n} | void\n\nexport type AfterErrorHookArgs = {\n  /** The Collection that the hook is operating on. This will be undefined if the hook is executed from a non-collection endpoint or GraphQL. */\n  collection?: SanitizedCollectionConfig\n  /** \tCustom context passed between hooks */\n  context: RequestContext\n  /** The error that occurred. */\n  error: Error\n  /** The GraphQL result object, available if the hook is executed within a GraphQL context. */\n  graphqlResult?: GraphQLFormattedError\n  /** The Request object containing the currently authenticated user. */\n  req: PayloadRequest\n  /** The formatted error result object, available if the hook is executed from a REST context. */\n  result?: ErrorResult\n}\n\nexport type ImportMapGenerators = Array<\n  (props: {\n    addToImportMap: AddToImportMap\n    baseDir: string\n    config: SanitizedConfig\n    importMap: InternalImportMap\n    imports: Imports\n  }) => void\n>\n\nexport type AfterErrorHook = (\n  args: AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type WidgetWidth = 'full' | 'large' | 'medium' | 'small' | 'x-large' | 'x-small'\n\nexport type Widget = {\n  Component: PayloadComponent\n  fields?: Field[]\n  /**\n   * Human-friendly label for the widget.\n   * Supports i18n by passing an object with locale keys, or a function with `t` for translations.\n   * If not provided, the label will be auto-generated from the slug.\n   */\n  label?: LabelFunction | StaticLabel\n  maxWidth?: WidgetWidth\n  minWidth?: WidgetWidth\n  slug: string\n  // Maybe:\n  // ImageURL?: string // similar to Block\n}\n\n/**\n * Client-side widget type with resolved label (no functions).\n */\nexport type ClientWidget = {\n  fields?: ClientField[]\n  label?: StaticLabel\n  maxWidth?: WidgetWidth\n  minWidth?: WidgetWidth\n  slug: string\n}\n\nexport type WidgetInstance<TSlug extends WidgetSlug = WidgetSlug> = TSlug extends WidgetSlug\n  ? {\n      data?: DataFromWidgetSlug<TSlug> extends Record<string, unknown>\n        ? DataFromWidgetSlug<TSlug>\n        : Record<string, unknown>\n      widgetSlug: TSlug\n      width: [\n        Extract<\n          TypedWidget[TSlug] extends { width: infer TWidth } ? TWidth : WidgetWidth,\n          WidgetWidth\n        >,\n      ] extends [never]\n        ? WidgetWidth\n        : Extract<\n            TypedWidget[TSlug] extends { width: infer TWidth } ? TWidth : WidgetWidth,\n            WidgetWidth\n          >\n    }\n  : never\n\nexport type DashboardConfig = {\n  defaultLayout?:\n    | ((args: { req: PayloadRequest }) => Array<WidgetInstance> | Promise<Array<WidgetInstance>>)\n    | Array<WidgetInstance>\n  widgets: Array<Widget>\n}\n\nexport type SanitizedDashboardConfig = {\n  widgets: Array<Omit<Widget, 'Component'>>\n}\n\n/**\n * This is the central configuration\n *\n * @see https://payloadcms.com/docs/configuration/overview\n */\nexport type Config = {\n  /** Configure admin dashboard */\n  admin?: {\n    /** Automatically log in as a user */\n    autoLogin?:\n      | {\n          /**\n           * The email address of the user to login as\n           */\n          email?: string\n          /** The password of the user to login as. This is only needed if `prefillOnly` is set to true */\n          password?: string\n          /**\n           * If set to true, the login credentials will be prefilled but the user will still need to click the login button.\n           *\n           * @default false\n           */\n          prefillOnly?: boolean\n          /** The username of the user to login as */\n          username?: string\n        }\n      | false\n    /**\n     * Automatically refresh user tokens for users logged into the dashboard\n     *\n     * @default false\n     */\n    autoRefresh?: boolean\n    /** Set account profile picture. Options: gravatar, default or a custom React component. */\n    avatar?:\n      | 'default'\n      | 'gravatar'\n      | {\n          Component: PayloadComponent\n        }\n\n    /**\n     * Add extra and/or replace built-in components with custom components\n     *\n     * @see https://payloadcms.com/docs/custom-components/overview\n     */\n    components?: {\n      /**\n       * Add custom components to the top right of the Admin Panel\n       */\n      actions?: CustomComponent[]\n      /**\n       * Add custom components after the collection overview\n       */\n      afterDashboard?: CustomComponent[]\n      /**\n       * Add custom components after the email/password field\n       */\n      afterLogin?: CustomComponent[]\n      /**\n       * Add custom components after the navigation section\n       */\n      afterNav?: CustomComponent[]\n      /**\n       * Add custom components after the navigation links\n       */\n      afterNavLinks?: CustomComponent[]\n      /**\n       * Add custom components before the collection overview\n       */\n      beforeDashboard?: CustomComponent[]\n      /**\n       * Add custom components before the email/password field\n       */\n      beforeLogin?: CustomComponent[]\n      /**\n       * Add custom components before the navigation section\n       */\n      beforeNav?: CustomComponent[]\n      /**\n       * Add custom components before the navigation links\n       */\n      beforeNavLinks?: CustomComponent[]\n      /** Replace graphical components */\n      graphics?: {\n        /** Replace the icon in the navigation */\n        Icon?: CustomComponent\n        /** Replace the logo on the login page */\n        Logo?: CustomComponent\n      }\n      /**\n       * Add custom header to top of page globally\n       */\n      header?: CustomComponent[]\n      /** Replace logout related components */\n      logout?: {\n        /** Replace the logout button  */\n        Button?: CustomComponent\n      }\n      /**\n       * Replace the navigation with a custom component\n       */\n      Nav?: CustomComponent\n      /**\n       * Wrap the admin dashboard in custom context providers\n       */\n      providers?: PayloadComponent<{ children?: React.ReactNode }, { children?: React.ReactNode }>[]\n      /**\n       * Add custom menu items to the navigation menu accessible via the gear icon.\n       * These components will be rendered in a popup menu above the logout button.\n       */\n      settingsMenu?: CustomComponent[]\n      /**\n       * Replace or modify top-level admin routes, or add new ones:\n       * + `Account` - `/admin/account`\n       * + `Dashboard` - `/admin`\n       * + `:path` - `/admin/:path`\n       */\n      views?: {\n        /** Add custom admin views */\n        [key: string]: AdminViewConfig\n        /** Replace the account screen */\n        // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n        account?: AdminViewConfig\n        /** Replace the admin homepage */\n        // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n        dashboard?: AdminViewConfig\n      }\n    }\n    /** Extension point to add your custom data. Available in server and client. */\n    custom?: Record<string, any>\n    /**\n     * Customize the dashboard widgets\n     * @experimental This prop is subject to change in future releases.\n     */\n    dashboard?: DashboardConfig\n    /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n    dateFormat?: string\n    /**\n     * Each entry in this map generates an entry in the importMap.\n     */\n    dependencies?: AdminDependencies\n    /**\n     * @deprecated\n     * This option is deprecated and will be removed in v4.\n     * To disable the admin panel itself, delete your `/app/(payload)/admin` directory.\n     * To disable all REST API and GraphQL endpoints, delete your `/app/(payload)/api` directory.\n     * Note: If you've modified the default paths via `admin.routes`, delete those directories instead.\n     */\n    disable?: boolean\n    importMap?: {\n      /**\n       * Automatically generate component map during development\n       * @default true\n       */\n      autoGenerate?: boolean\n      /**\n       * The base directory for component paths starting with /.\n       * @default process.cwd()\n       **/\n      baseDir?: string\n      /**\n       * You can use generators to add custom components to the component import map.\n       * This allows you to import custom components in the admin panel.\n       */\n      generators?: ImportMapGenerators\n      /**\n       * If Payload cannot find the import map file location automatically,\n       * you can manually provide it here.\n       */\n      importMapFile?: string\n    }\n    /**\n     * Live Preview options.\n     *\n     * @see https://payloadcms.com/docs/live-preview/overview\n     */\n    livePreview?: RootLivePreviewConfig\n    /** Base meta data to use for the Admin Panel. Included properties are titleSuffix, ogImage, and favicon. */\n    meta?: MetaConfig\n    routes?: {\n      /** The route for the account page.\n       *\n       * @default '/account'\n       */\n      account?: `/${string}`\n      /** The route for the browse by folder view.\n       *\n       * @default '/browse-by-folder'\n       */\n      browseByFolder?: `/${string}`\n      /** The route for the create first user page.\n       *\n       * @default '/create-first-user'\n       */\n      createFirstUser?: `/${string}`\n      /** The route for the forgot password page.\n       *\n       * @default '/forgot'\n       */\n      forgot?: `/${string}`\n      /** The route the user will be redirected to after being inactive for too long.\n       *\n       * @default '/logout-inactivity'\n       */\n      inactivity?: `/${string}`\n      /** The route for the login page.\n       *\n       * @default '/login'\n       */\n      login?: `/${string}`\n      /** The route for the logout page.\n       *\n       * @default '/logout'\n       */\n      logout?: `/${string}`\n      /** The route for the reset password page.\n       *\n       * @default '/reset'\n       */\n      reset?: `/${string}`\n      /** The route for the unauthorized page.\n       *\n       * @default '/unauthorized'\n       */\n      unauthorized?: `/${string}`\n    }\n    /**\n     * Suppresses React hydration mismatch warnings during the hydration of the root <html> tag.\n     * Useful in scenarios where the server-rendered HTML might intentionally differ from the client-rendered DOM.\n     * @default false\n     */\n    suppressHydrationWarning?: boolean\n    /**\n     * Restrict the Admin Panel theme to use only one of your choice\n     *\n     * @default 'all' // The theme can be configured by users\n     */\n    theme?: 'all' | 'dark' | 'light'\n    /**\n     * Configure timezone related settings for the admin panel.\n     */\n    timezones?: TimezonesConfig\n    /**\n     * Configure toast message behavior and appearance in the admin panel.\n     * Currently using [Sonner](https://sonner.emilkowal.ski) for toast notifications.\n     *\n     * @experimental This property is experimental and may change in future releases. Use at your own risk.\n     */\n    toast?: {\n      /**\n       * Time in milliseconds until the toast automatically closes.\n       * @default 4000\n       */\n      duration?: number\n      /**\n       * If `true`, will expand the message stack so that all messages are shown simultaneously without user interaction.\n       * Otherwise only the latest notification can be read until the user hovers the stack.\n       * @default false\n       */\n      expand?: boolean\n      /**\n       * The maximum number of toasts that can be visible on the screen at once.\n       * @default 5\n       */\n      limit?: number\n      /**\n       * The position of the toast on the screen.\n       * @default 'bottom-right'\n       */\n      position?:\n        | 'bottom-center'\n        | 'bottom-left'\n        | 'bottom-right'\n        | 'top-center'\n        | 'top-left'\n        | 'top-right'\n    }\n    /** The slug of a Collection that you want to be used to log in to the Admin dashboard. */\n    user?: string\n  }\n\n  /**\n   * Configure authentication-related Payload-wide settings.\n   */\n  auth?: {\n    /**\n     * Define which JWT identification methods you'd like to support for Payload's local auth strategy, as well as the order that they're retrieved in.\n     * Defaults to ['JWT', 'Bearer', 'cookie]\n     */\n    jwtOrder: ('Bearer' | 'cookie' | 'JWT')[]\n  }\n  /** Custom Payload bin scripts can be injected via the config. */\n  bin?: BinScriptConfig[]\n  blocks?: Block[]\n  /**\n   * Pass additional options to the parser used to process `multipart/form-data` requests.\n   * For example, a PATCH request containing HTML form data.\n   * For example, you may want to increase the `limits` imposed by the parser.\n   * Currently using @link {https://www.npmjs.com/package/busboy|busboy} under the hood.\n   *\n   * @experimental This property is experimental and may change in future releases. Use at your own risk.\n   */\n  bodyParser?: Partial<BusboyConfig>\n  /**\n   * Manage the datamodel of your application\n   *\n   * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n   */\n  collections?: CollectionConfig[]\n  /**\n   * Compatibility flags for prior Payload versions\n   */\n  compatibility?: {\n    /**\n     * By default, Payload will remove the `localized: true` property\n     * from fields if a parent field is localized. Set this property\n     * to `true` only if you have an existing Payload database from pre-3.0\n     * that you would like to maintain without migrating. This is only\n     * relevant for MongoDB databases.\n     *\n     * @todo Remove in v4\n     */\n    allowLocalizedWithinLocalized: true\n  }\n  /**\n   * Prefix a string to all cookies that Payload sets.\n   *\n   * @default \"payload\"\n   */\n  cookiePrefix?: string\n  /** Either a whitelist array of URLS to allow CORS requests from, or a wildcard string ('*') to accept incoming requests from any domain. */\n  cors?: '*' | CORSConfig | string[]\n  /** A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. */\n  csrf?: string[]\n  /** Extension point to add your custom data. Server only. */\n  custom?: Record<string, any>\n  /** Pass in a database adapter for use on this project. */\n  db: DatabaseAdapterResult\n  /** Enable to expose more detailed error information. */\n  debug?: boolean\n  /**\n   * If a user does not specify `depth` while requesting a resource, this depth will be used.\n   *\n   * @see https://payloadcms.com/docs/getting-started/concepts#depth\n   *\n   * @default 2\n   */\n  defaultDepth?: number\n  /**\n   * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n   *\n   * @default 40000\n   */\n  defaultMaxTextLength?: number\n  /** Default richtext editor to use for richText fields */\n  editor?: RichTextAdapterProvider<any, any, any>\n  /**\n   * Email Adapter\n   *\n   * @see https://payloadcms.com/docs/email/overview\n   */\n  email?: EmailAdapter | Promise<EmailAdapter>\n  /** Custom REST endpoints */\n  endpoints?: Endpoint[]\n  /**\n   * Experimental features may be unstable or change in future versions.\n   */\n  experimental?: {\n    /**\n     * Enable per-locale status for documents.\n     *\n     * Requires:\n     * - `localization` enabled\n     * - `versions.drafts` enabled\n     * - `versions.drafts.localizeStatus` set at collection or global level\n     *\n     * @experimental\n     */\n    localizeStatus?: boolean\n  }\n  /**\n   * Options for folder view within the admin panel\n   *\n   * @experimental This feature may change in minor versions until it is fully stable\n   */\n  folders?: false | RootFoldersConfiguration\n  /**\n   * @see https://payloadcms.com/docs/configuration/globals#global-configs\n   */\n  globals?: GlobalConfig[]\n  /**\n   * Manage the GraphQL API\n   *\n   * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n   *\n   * @see https://payloadcms.com/docs/graphql/overview\n   */\n  graphQL?: {\n    disable?: boolean\n    /**\n     * Disable introspection queries in production.\n     *\n     * @default true\n     */\n    disableIntrospectionInProduction?: boolean\n    /**\n     * Disable the GraphQL Playground in production.\n     *\n     * @default true\n     */\n    disablePlaygroundInProduction?: boolean\n    maxComplexity?: number\n    /**\n     * Function that returns an object containing keys to custom GraphQL mutations\n     *\n     * @see https://payloadcms.com/docs/graphql/extending\n     */\n    mutations?: GraphQLExtension\n    /**\n     * Function that returns an object containing keys to custom GraphQL queries\n     *\n     * @see https://payloadcms.com/docs/graphql/extending\n     */\n    queries?: GraphQLExtension\n    /**\n     * Filepath to write the generated schema to\n     */\n    schemaOutputFile?: string\n    /**\n     * Function that returns an array of validation rules to apply to the GraphQL schema\n     *\n     * @see https://payloadcms.com/docs/graphql/overview#custom-validation-rules\n     */\n    validationRules?: (args: GraphQL.ExecutionArgs) => GraphQL.ValidationRule[]\n  }\n  /**\n   * Tap into Payload-wide hooks.\n   *\n   * @see https://payloadcms.com/docs/hooks/overview\n   */\n  hooks?: {\n    afterError?: AfterErrorHook[]\n  }\n  /** i18n config settings */\n  // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n  i18n?: I18nOptions<{} | DefaultTranslationsObject> // loosen the type here to allow for custom translations\n  /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n  indexSortableFields?: boolean\n  /**\n   * @experimental There may be frequent breaking changes to this API\n   */\n  jobs?: JobsConfig\n  /**\n   * Pass in a KV adapter for use on this project.\n   * @default `DatabaseKVAdapter` from:\n   * ```ts\n   * import { createDatabaseKVAdapter } from 'payload'\n   * createDatabaseKVAdapter()\n   * ```\n   */\n  kv?: KVAdapterResult\n  /**\n   * Translate your content to different languages/locales.\n   *\n   * @default false // disable localization\n   */\n  localization?: false | LocalizationConfig\n  /**\n   * Logger options, logger options with a destination stream, or an instantiated logger instance.\n   *\n   * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n   *\n   * ```ts\n   * // Logger options only\n   * logger: {\n   *   level: 'info',\n   * }\n   *\n   * // Logger options with destination stream\n   * logger: {\n   *  options: {\n   *   level: 'info',\n   *  },\n   *  destination: process.stdout\n   * },\n   *\n   * // Logger instance\n   * logger: pino({ name: 'my-logger' })\n   *\n   * ```\n   */\n  logger?: 'sync' | { destination?: DestinationStream; options: LoggerOptions } | PayloadLogger\n\n  /**\n   * Override the log level of errors for Payload's error handler or disable logging with `false`.\n   * Levels can be any of the following: 'trace', 'debug', 'info', 'warn', 'error', 'fatal' or false.\n   *\n   * Default levels:\n   * {\n  `*   APIError: 'error',\n  `*   AuthenticationError: 'error',\n  `*   ErrorDeletingFile: 'error',\n  `*   FileRetrievalError: 'error',\n  `*   FileUploadError: 'error',\n  `*   Forbidden: 'info',\n  `*   Locked: 'info',\n  `*   LockedAuth: 'error',\n  `*   MissingFile: 'info',\n  `*   NotFound: 'info',\n  `*   QueryError: 'error',\n  `*   ValidationError: 'info',\n   * }\n   */\n  loggingLevels?: Partial<Record<ErrorName, false | Level>>\n\n  /**\n   * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n   *\n   * @see https://payloadcms.com/docs/getting-started/concepts#depth\n   *\n   * @default 10\n   */\n  maxDepth?: number\n\n  /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n  onInit?: (payload: Payload) => Promise<void> | void\n  /**\n   * An array of Payload plugins.\n   *\n   * @see https://payloadcms.com/docs/plugins/overview\n   */\n  plugins?: Plugin[]\n  /**\n   * Allow you to save and share filters, columns, and sort orders for your collections.\n   * @see https://payloadcms.com/docs/query-presets/overview\n   */\n  queryPresets?: {\n    /**\n     * Define collection-level access control that applies to all presets globally.\n     * This is separate from document-level access (constraints) which users can configure per-preset.\n     */\n    access: {\n      create?: Access<QueryPreset>\n      delete?: Access<QueryPreset>\n      read?: Access<QueryPreset>\n      update?: Access<QueryPreset>\n    }\n    /**\n     * Define custom document-level access control options for presets.\n     *\n     * Payload provides sensible defaults (Only Me, Everyone, Specific Users), but you can\n     * add custom constraints for more complex patterns like RBAC.\n     *\n     * @example\n     * ```ts\n     * constraints: {\n     *   read: [\n     *     {\n     *       label: 'Specific Roles',\n     *       value: 'specificRoles',\n     *       fields: [\n     *         {\n     *           name: 'roles',\n     *           type: 'select',\n     *           hasMany: true,\n     *           options: [\n     *             { label: 'Admin', value: 'admin' },\n     *             { label: 'User', value: 'user' },\n     *           ],\n     *         },\n     *       ],\n     *       access: ({ req: { user } }) => ({\n     *         'access.read.roles': { in: [user?.roles] },\n     *       }),\n     *     },\n     *   ],\n     * }\n     * ```\n     *\n     * @see https://payloadcms.com/docs/query-presets/overview#custom-access-control\n     */\n    constraints: {\n      create?: QueryPresetConstraints\n      delete?: QueryPresetConstraints\n      read?: QueryPresetConstraints\n      update?: QueryPresetConstraints\n    }\n    /**\n     * Used to dynamically filter which constraints are available based on the current user, document data,\n     * or other criteria.\n     *\n     * Some examples of this might include:\n     *\n     * - Ensuring that only \"admins\" are allowed to make a preset available to \"everyone\"\n     * - Preventing the \"onlyMe\" option from being selected based on a hypothetical \"disablePrivatePresets\" checkbox\n     *\n     * When a user lacks the permission to set a constraint, the option will either be hidden from them, or disabled if it is already saved to that preset.\n     *\n     * @see https://payloadcms.com/docs/query-presets/overview#constraint-access-control\n     */\n    filterConstraints?: SelectField['filterOptions']\n    labels?: CollectionConfig['labels']\n  }\n  /**\n   * Control the routing structure that Payload binds itself to.\n   * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n   */\n  routes?: {\n    /**\n     * The route for the admin panel.\n     * @example \"/my-admin\" or \"/\"\n     * @default \"/admin\"\n     * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n     */\n    admin?: string\n    /**\n     * The base route for all REST API endpoints.\n     * @default \"/api\"\n     * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n     */\n    api?: string\n    /**\n     * The base route for all GraphQL endpoints.\n     * @default \"/graphql\"\n     * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n     */\n    graphQL?: string\n    /**\n     * The route for the GraphQL Playground.\n     * @default \"/graphql-playground\"\n     * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n     */\n    graphQLPlayground?: string\n  }\n  /** Secure string that Payload will use for any encryption workflows */\n  secret: string\n  /**\n   * Define the absolute URL of your app including the protocol, for example `https://example.org`.\n   * No paths allowed, only protocol, domain and (optionally) port.\n   *\n   * @see https://payloadcms.com/docs/configuration/overview#options\n   */\n  serverURL?: string\n  /**\n   * Pass in a local copy of Sharp if you'd like to use it.\n   *\n   */\n  sharp?: SharpDependency\n  /** Send anonymous telemetry data about general usage. */\n  telemetry?: boolean\n  /** Control how typescript interfaces are generated from your collections. */\n  typescript?: {\n    /**\n     * Automatically generate types during development\n     * @default true\n     */\n    autoGenerate?: boolean\n\n    /** Disable declare block in generated types file */\n    declare?:\n      | {\n          /**\n           * @internal internal use only to allow for multiple declarations within a monorepo and suppress the \"Duplicate identifier GeneratedTypes\" error\n           *\n           * Adds a @ts-ignore flag above the GeneratedTypes interface declaration\n           *\n           * @default false\n           */\n          ignoreTSError?: boolean\n        }\n      | false\n\n    /** Filename to write the generated types to */\n    outputFile?: string\n\n    /**\n     * Post-process the generated TypeScript types string before writing to file.\n     * Useful for plugins that need to inject generic types that JSON Schema cannot express.\n     *\n     * Functions are applied in order after the built-in Select generics are added.\n     *\n     * @example\n     * ```ts\n     * postProcess: [\n     *   ({ compiledTypes, config }) => {\n     *     const genericType = `export type MyGeneric<T> = { value: T };`\n     *     return compiledTypes.replace(/(\\/\\*[\\s\\S]*?\\*\\/\\n)/, `$1\\n${genericType}\\n`)\n     *   },\n     * ]\n     * ```\n     */\n    postProcess?: Array<(args: { compiledTypes: string; config: SanitizedConfig }) => string>\n\n    /**\n     * Allows you to modify the base JSON schema that is generated during generate:types. This JSON schema will be used\n     * to generate the TypeScript interfaces.\n     */\n    schema?: Array<\n      (args: {\n        collectionIDFieldTypes: {\n          [key: string]: 'number' | 'string'\n        }\n        config: SanitizedConfig\n        i18n: I18n\n        jsonSchema: JSONSchema4\n      }) => JSONSchema4\n    >\n\n    /**\n     * Enable strict type safety for draft operations. When enabled, the `draft` parameter is forbidden\n     * on collections without drafts, and query results with `draft: true` type required fields as optional.\n     * This prevents invalid draft usage at compile time and ensures type correctness across all Local API operations.\n     *\n     * @default false\n     * @todo Remove in v4. Strict draft types will become the default behavior.\n     */\n    strictDraftTypes?: boolean\n  }\n  /**\n   * Customize the handling of incoming file uploads for collections that have uploads enabled.\n   */\n  upload?: FetchAPIFileUploadOptions\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport type SanitizedConfig = {\n  admin: {\n    timezones: SanitizedTimezoneConfig\n  } & DeepRequired<Config['admin']>\n  blocks?: FlattenedBlock[]\n  collections: SanitizedCollectionConfig[]\n  /** Default richtext editor to use for richText fields */\n  editor?: RichTextAdapter<any, any, any>\n  endpoints: Endpoint[]\n  globals: SanitizedGlobalConfig[]\n  i18n: Required<I18nOptions>\n  jobs: SanitizedJobsConfig\n  localization: false | SanitizedLocalizationConfig\n  paths: {\n    config: string\n    configDir: string\n    rawConfig: string\n  }\n  upload: {\n    /**\n     * Deduped list of adapters used in the project\n     */\n    adapters: string[]\n  } & FetchAPIFileUploadOptions\n} & Omit<\n  // TODO: DeepRequired breaks certain, advanced TypeScript types / certain type information is lost. We should remove it when possible.\n  // E.g. in packages/ui/src/graphics/Account/index.tsx in getComponent, if avatar.Component is casted to what it's supposed to be,\n  // the result type is different\n  DeepRequired<Config>,\n  | 'admin'\n  | 'blocks'\n  | 'collections'\n  | 'editor'\n  | 'endpoint'\n  | 'globals'\n  | 'i18n'\n  | 'jobs'\n  | 'localization'\n  | 'upload'\n>\n\nexport type EditConfig = EditConfigWithoutRoot | EditConfigWithRoot\n\n/**\n * Replace or modify _all_ nested document views and routes, including the document header, controls, and tabs. This cannot be used in conjunction with other nested views.\n * + `root` - `/admin/collections/:collection/:id/**\\/*`\n * @link https://payloadcms.com/docs/custom-components/document-views#document-root\n */\nexport type EditConfigWithRoot = {\n  api?: never\n  default?: never\n  livePreview?: never\n  root: DefaultDocumentViewConfig\n  version?: never\n  versions?: never\n}\n\ntype KnownEditKeys = 'api' | 'default' | 'livePreview' | 'root' | 'version' | 'versions'\n\n/**\n * Replace or modify individual nested routes, or add new ones:\n * + `default` - `/admin/collections/:collection/:id`\n * + `api` - `/admin/collections/:collection/:id/api`\n * + `livePreview` - `/admin/collections/:collection/:id/preview`\n * + `references` - `/admin/collections/:collection/:id/references`\n * + `relationships` - `/admin/collections/:collection/:id/relationships`\n * + `versions` - `/admin/collections/:collection/:id/versions`\n * + `version` - `/admin/collections/:collection/:id/versions/:version`\n * + `customView` - `/admin/collections/:collection/:id/:path`\n *\n * To override the entire Edit View including all nested views, use the `root` key.\n *\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\nexport type EditConfigWithoutRoot = {\n  [K in Exclude<string, KnownEditKeys>]: CustomDocumentViewConfig\n} & {\n  api?: DefaultDocumentViewConfig\n  default?: DefaultDocumentViewConfig\n  livePreview?: DefaultDocumentViewConfig\n  root?: never\n  version?: DefaultDocumentViewConfig\n  versions?: DefaultDocumentViewConfig\n}\n\nexport type EntityDescriptionComponent = CustomComponent\n\nexport type EntityDescriptionFunction = ({ t }: { t: TFunction }) => string\n\nexport type EntityDescription = EntityDescriptionFunction | Record<string, string> | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"mappings":"AAocA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}