payload 3.0.0-beta.85 → 3.0.0-beta.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/fields/Array.d.ts +12 -8
- package/dist/admin/fields/Array.d.ts.map +1 -1
- package/dist/admin/fields/Array.js.map +1 -1
- package/dist/admin/fields/Blocks.d.ts +12 -8
- package/dist/admin/fields/Blocks.d.ts.map +1 -1
- package/dist/admin/fields/Blocks.js.map +1 -1
- package/dist/admin/fields/Checkbox.d.ts +12 -8
- package/dist/admin/fields/Checkbox.d.ts.map +1 -1
- package/dist/admin/fields/Checkbox.js.map +1 -1
- package/dist/admin/fields/Code.d.ts +12 -8
- package/dist/admin/fields/Code.d.ts.map +1 -1
- package/dist/admin/fields/Code.js.map +1 -1
- package/dist/admin/fields/Collapsible.d.ts +12 -9
- package/dist/admin/fields/Collapsible.d.ts.map +1 -1
- package/dist/admin/fields/Collapsible.js.map +1 -1
- package/dist/admin/fields/Date.d.ts +12 -8
- package/dist/admin/fields/Date.d.ts.map +1 -1
- package/dist/admin/fields/Date.js.map +1 -1
- package/dist/admin/fields/Email.d.ts +12 -8
- package/dist/admin/fields/Email.d.ts.map +1 -1
- package/dist/admin/fields/Email.js.map +1 -1
- package/dist/admin/fields/Group.d.ts +12 -9
- package/dist/admin/fields/Group.d.ts.map +1 -1
- package/dist/admin/fields/Group.js.map +1 -1
- package/dist/admin/fields/Hidden.d.ts +1 -5
- package/dist/admin/fields/Hidden.d.ts.map +1 -1
- package/dist/admin/fields/Hidden.js.map +1 -1
- package/dist/admin/fields/JSON.d.ts +12 -8
- package/dist/admin/fields/JSON.d.ts.map +1 -1
- package/dist/admin/fields/JSON.js.map +1 -1
- package/dist/admin/fields/Number.d.ts +12 -8
- package/dist/admin/fields/Number.d.ts.map +1 -1
- package/dist/admin/fields/Number.js.map +1 -1
- package/dist/admin/fields/Point.d.ts +12 -8
- package/dist/admin/fields/Point.d.ts.map +1 -1
- package/dist/admin/fields/Point.js.map +1 -1
- package/dist/admin/fields/Radio.d.ts +12 -8
- package/dist/admin/fields/Radio.d.ts.map +1 -1
- package/dist/admin/fields/Radio.js.map +1 -1
- package/dist/admin/fields/Relationship.d.ts +12 -8
- package/dist/admin/fields/Relationship.d.ts.map +1 -1
- package/dist/admin/fields/Relationship.js.map +1 -1
- package/dist/admin/fields/RichText.d.ts +12 -8
- package/dist/admin/fields/RichText.d.ts.map +1 -1
- package/dist/admin/fields/RichText.js.map +1 -1
- package/dist/admin/fields/Row.d.ts +13 -10
- package/dist/admin/fields/Row.d.ts.map +1 -1
- package/dist/admin/fields/Row.js.map +1 -1
- package/dist/admin/fields/Select.d.ts +12 -8
- package/dist/admin/fields/Select.d.ts.map +1 -1
- package/dist/admin/fields/Select.js.map +1 -1
- package/dist/admin/fields/Tabs.d.ts +11 -9
- package/dist/admin/fields/Tabs.d.ts.map +1 -1
- package/dist/admin/fields/Tabs.js.map +1 -1
- package/dist/admin/fields/Text.d.ts +12 -8
- package/dist/admin/fields/Text.d.ts.map +1 -1
- package/dist/admin/fields/Text.js.map +1 -1
- package/dist/admin/fields/Textarea.d.ts +12 -8
- package/dist/admin/fields/Textarea.d.ts.map +1 -1
- package/dist/admin/fields/Textarea.js.map +1 -1
- package/dist/admin/fields/Upload.d.ts +12 -8
- package/dist/admin/fields/Upload.d.ts.map +1 -1
- package/dist/admin/fields/Upload.js.map +1 -1
- package/dist/admin/forms/Description.d.ts +24 -0
- package/dist/admin/forms/Description.d.ts.map +1 -0
- package/dist/admin/forms/Description.js +3 -0
- package/dist/admin/forms/Description.js.map +1 -0
- package/dist/admin/forms/Error.d.ts +12 -5
- package/dist/admin/forms/Error.d.ts.map +1 -1
- package/dist/admin/forms/Error.js.map +1 -1
- package/dist/admin/forms/Field.d.ts +12 -10
- package/dist/admin/forms/Field.d.ts.map +1 -1
- package/dist/admin/forms/Field.js +0 -1
- package/dist/admin/forms/Field.js.map +1 -1
- package/dist/admin/forms/Label.d.ts +13 -6
- package/dist/admin/forms/Label.d.ts.map +1 -1
- package/dist/admin/forms/Label.js.map +1 -1
- package/dist/admin/types.d.ts +32 -26
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/collections/config/client.d.ts +2 -2
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js.map +1 -1
- package/dist/config/types.d.ts +8 -8
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/config/types.d.ts +49 -48
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +6 -2
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/configToJSONSchema.spec.js +160 -0
- package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
- package/dist/utilities/flattenTopLevelFields.d.ts +2 -2
- package/dist/utilities/flattenTopLevelFields.d.ts.map +1 -1
- package/dist/utilities/flattenTopLevelFields.js.map +1 -1
- package/package.json +2 -2
- package/dist/admin/forms/FieldDescription.d.ts +0 -17
- package/dist/admin/forms/FieldDescription.d.ts.map +0 -1
- package/dist/admin/forms/FieldDescription.js +0 -3
- package/dist/admin/forms/FieldDescription.js.map +0 -1
package/dist/config/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n DefaultTranslationsObject,\n I18nClient,\n I18nOptions,\n TFunction,\n} from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { DestinationStream, 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 { DocumentTabConfig, RichTextAdapter } from '../admin/types.js'\nimport type { AdminViewConfig, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { Permissions } from '../auth/index.js'\nimport type {\n AddToImportMap,\n ImportMap,\n Imports,\n InternalImportMap,\n} from '../bin/generateImportMap/index.js'\nimport type {\n AfterErrorHook,\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 { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload, TypedUser } from '../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> = RawPayloadComponent<TComponentServerProps, TComponentClientProps> | false | 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?: TComponentClientProps | object\n exportName?: string\n path: string\n serverProps?: TComponentServerProps | object\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 Component: React.FC<TComponentClientProps | TComponentServerProps>\n clientProps?: TComponentClientProps\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\nexport type Plugin = (config: Config) => Config | Promise<Config>\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 Use the `useLivePreview` hook to get started in React applications.\n */\n url?:\n | ((args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n payload: Payload\n }) => Promise<string> | string)\n | string\n}\n\nexport type OGImageConfig = {\n alt?: string\n height?: number | string\n type?: string\n url: string\n width?: number | string\n}\n\nexport type OpenGraphConfig = {\n description?: string\n images?: OGImageConfig | OGImageConfig[]\n siteName?: string\n title?: string\n}\n\nexport type IconConfig = {\n color?: string\n /**\n * @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority\n */\n fetchPriority?: 'auto' | 'high' | 'low'\n media?: string\n /** defaults to rel=\"icon\" */\n rel?: string\n sizes?: string\n type?: string\n /**\n * URL of the icon to use. You can use a relative path from the public folder (see https://nextjs.org/docs/app/building-your-application/optimizing/static-assets) or an absolute URL.\n */\n url: string\n}\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 * Overrides the auto-generated <meta name=\"description\"> of admin pages\n * @example `\"This is my custom CMS built with Payload.\"`\n */\n description?: string\n /**\n * Icons to be rendered by devices and browsers.\n *\n * For example browser tabs, phone home screens, and search engine results.\n */\n icons?: IconConfig[]\n /**\n * Overrides the auto-generated <meta name=\"keywords\"> of admin pages\n * @example `\"CMS, Payload, Custom\"`\n */\n keywords?: string\n /**\n * Metadata to be rendered as `og` meta tags in the head of the Admin Panel.\n *\n * For example when sharing the Admin Panel on social media or through messaging services.\n */\n openGraph?: OpenGraphConfig\n /**\n * Overrides the auto-generated <title> of admin pages\n * @example `\"My Admin Panel\"`\n */\n title?: string\n /**\n * String to append to the auto-generated <title> of admin pages\n * @example `\" - Custom CMS\"`\n */\n titleSuffix?: string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, '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) => Promise<null | string> | null | string\n\nexport type GraphQLInfo = {\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n collections: {\n [slug: string]: Collection\n }\n globals: Globals\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 * 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 previously instantiated logger instance. Must conform to the PayloadLogger interface which uses Pino\n * This allows you to bring your own logger instance and let payload use it\n */\n logger?: PayloadLogger\n\n loggerDestination?: DestinationStream\n /**\n * Specify options for the built-in Pino logger that Payload uses for internal logging.\n *\n * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n */\n loggerOptions?: LoggerOptions\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 = Where | boolean\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?: number | string\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 (or \"all\") */\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\nexport type EditViewComponent = PayloadComponent<ServerSideEditViewProps>\n\nexport type EditViewConfig = {\n meta?: MetaConfig\n} & (\n | {\n Component: EditViewComponent\n path?: string\n }\n | {\n actions?: CustomComponent[]\n }\n | {\n path?: string\n /**\n * Add a new Edit View to the admin panel\n * i.e. you can render a custom view that has no tab, if desired\n * Or override a specific properties of an existing one\n * i.e. you can customize the `Default` view tab label, if desired\n */\n tab?: DocumentTabConfig\n }\n)\n\nexport type ServerProps = {\n [key: string]: unknown\n i18n: I18nClient\n locale?: Locale\n params?: { [key: string]: string | string[] | undefined }\n payload: Payload\n permissions?: Permissions\n searchParams?: { [key: string]: string | string[] | undefined }\n user?: TypedUser\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 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\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 /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale` */\n fallback?: boolean\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 = ({ t }: { t: TFunction }) => 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 | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | string,\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\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 /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?:\n | 'default'\n | 'gravatar'\n | {\n Component: PayloadComponent<never>\n }\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/components\n */\n components?: {\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\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 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 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 /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: PayloadComponent<{ children?: React.ReactNode }, { children?: React.ReactNode }>[]\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 Account?: AdminViewConfig\n /** Replace the admin homepage */\n Dashboard?: AdminViewConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\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 * as well as an entry in the componentMap if the type of the\n * dependency is 'component'\n */\n dependencies?: AdminDependencies\n /** If set to true, the entire Admin panel will be disabled. */\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 *\n * By default, this is 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?: Array<\n (props: {\n addToImportMap: AddToImportMap\n baseDir: string\n config: SanitizedConfig\n importMap: InternalImportMap\n imports: Imports\n }) => void\n >\n }\n livePreview?: {\n collections?: string[]\n globals?: string[]\n } & LivePreviewConfig\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 account?: string\n /** The route for the create first user page. */\n createFirstUser?: string\n /** The route for the forgot password page. */\n forgot?: string\n /** The route the user will be redirected to after being inactive for too long. */\n inactivity?: string\n /** The route for the login page. */\n login?: string\n /** The route for the logout page. */\n logout?: string\n /** The route for the reset password page. */\n reset?: string\n /** The route for the unauthorized page. */\n unauthorized?: string\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 /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\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 * 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\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n\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 * @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 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 /**\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 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 * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: LocalizationConfig | false\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 /** 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 /** Control the routing structure that Payload binds itself to. */\n routes?: {\n /** The route for the admin panel.\n * @example \"/my-admin\"\n * @default \"/admin\"\n */\n admin?: string\n /** @default \"/api\" */\n api?: string\n /** @default \"/graphql\" */\n graphQL?: string\n /** @default \"/graphql-playground\" */\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 * 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<(args: { jsonSchema: JSONSchema4 }) => JSONSchema4>\n }\n /**\n * Customize the handling of incoming file uploads for collections that have uploads enabled.\n */\n upload?: ExpressFileUploadOptions\n}\n\nexport type SanitizedConfig = {\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 localization: SanitizedLocalizationConfig | false\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 } & ExpressFileUploadOptions\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 'collections' | 'editor' | 'endpoint' | 'globals' | 'i18n' | 'localization' | 'upload'\n>\n\nexport type EditConfig =\n | {\n [key: string]: EditViewConfig\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 api?: Partial<EditViewConfig>\n default?: Partial<EditViewConfig>\n livePreview?: Partial<EditViewConfig>\n root?: never\n version?: Partial<EditViewConfig>\n versions?: Partial<EditViewConfig>\n // TODO: uncomment these as they are built\n // references?: EditView\n // relationships?: EditView\n }\n | {\n api?: never\n default?: never\n livePreview?: never\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 */\n root: Partial<EditViewConfig>\n version?: never\n versions?: never\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":"AA0ZA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n DefaultTranslationsObject,\n I18nClient,\n I18nOptions,\n TFunction,\n} from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { DestinationStream, 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 { DocumentTabConfig, RichTextAdapter } from '../admin/types.js'\nimport type { AdminViewConfig, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { Permissions } from '../auth/index.js'\nimport type {\n AddToImportMap,\n ImportMap,\n Imports,\n InternalImportMap,\n} from '../bin/generateImportMap/index.js'\nimport type {\n AfterErrorHook,\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 { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload, TypedUser } from '../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> = RawPayloadComponent<TComponentServerProps, TComponentClientProps> | false | 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?: TComponentClientProps | object\n exportName?: string\n path: string\n serverProps?: TComponentServerProps | object\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 Component: React.FC<TComponentClientProps | TComponentServerProps>\n clientProps?: TComponentClientProps\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\nexport type Plugin = (config: Config) => Config | Promise<Config>\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 Use the `useLivePreview` hook to get started in React applications.\n */\n url?:\n | ((args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n payload: Payload\n }) => Promise<string> | string)\n | string\n}\n\nexport type OGImageConfig = {\n alt?: string\n height?: number | string\n type?: string\n url: string\n width?: number | string\n}\n\nexport type OpenGraphConfig = {\n description?: string\n images?: OGImageConfig | OGImageConfig[]\n siteName?: string\n title?: string\n}\n\nexport type IconConfig = {\n color?: string\n /**\n * @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority\n */\n fetchPriority?: 'auto' | 'high' | 'low'\n media?: string\n /** defaults to rel=\"icon\" */\n rel?: string\n sizes?: string\n type?: string\n /**\n * URL of the icon to use. You can use a relative path from the public folder (see https://nextjs.org/docs/app/building-your-application/optimizing/static-assets) or an absolute URL.\n */\n url: string\n}\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 * Overrides the auto-generated <meta name=\"description\"> of admin pages\n * @example `\"This is my custom CMS built with Payload.\"`\n */\n description?: string\n /**\n * Icons to be rendered by devices and browsers.\n *\n * For example browser tabs, phone home screens, and search engine results.\n */\n icons?: IconConfig[]\n /**\n * Overrides the auto-generated <meta name=\"keywords\"> of admin pages\n * @example `\"CMS, Payload, Custom\"`\n */\n keywords?: string\n /**\n * Metadata to be rendered as `og` meta tags in the head of the Admin Panel.\n *\n * For example when sharing the Admin Panel on social media or through messaging services.\n */\n openGraph?: OpenGraphConfig\n /**\n * Overrides the auto-generated <title> of admin pages\n * @example `\"My Admin Panel\"`\n */\n title?: string\n /**\n * String to append to the auto-generated <title> of admin pages\n * @example `\" - Custom CMS\"`\n */\n titleSuffix?: string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, '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) => Promise<null | string> | null | string\n\nexport type GraphQLInfo = {\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n collections: {\n [slug: string]: Collection\n }\n globals: Globals\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 * 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 previously instantiated logger instance. Must conform to the PayloadLogger interface which uses Pino\n * This allows you to bring your own logger instance and let payload use it\n */\n logger?: PayloadLogger\n\n loggerDestination?: DestinationStream\n /**\n * Specify options for the built-in Pino logger that Payload uses for internal logging.\n *\n * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n */\n loggerOptions?: LoggerOptions\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 = Where | boolean\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?: number | string\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 (or \"all\") */\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\nexport type EditViewComponent = PayloadComponent<ServerSideEditViewProps>\n\nexport type EditViewConfig = {\n meta?: MetaConfig\n} & (\n | {\n Component: EditViewComponent\n path?: string\n }\n | {\n actions?: CustomComponent[]\n }\n | {\n path?: string\n /**\n * Add a new Edit View to the admin panel\n * i.e. you can render a custom view that has no tab, if desired\n * Or override a specific properties of an existing one\n * i.e. you can customize the `Default` view tab label, if desired\n */\n tab?: DocumentTabConfig\n }\n)\n\nexport type ServerProps = {\n readonly i18n: I18nClient\n readonly locale?: Locale\n readonly params?: { [key: string]: string | string[] | undefined }\n readonly payload: Payload\n readonly permissions?: Permissions\n readonly [key: string]: unknown\n readonly searchParams?: { [key: string]: string | string[] | undefined }\n readonly user?: TypedUser\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 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\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 /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale` */\n fallback?: boolean\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 = ({ t }: { t: TFunction }) => 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 | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | string,\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\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 /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?:\n | 'default'\n | 'gravatar'\n | {\n Component: PayloadComponent<never>\n }\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/components\n */\n components?: {\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\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 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 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 /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: PayloadComponent<{ children?: React.ReactNode }, { children?: React.ReactNode }>[]\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 Account?: AdminViewConfig\n /** Replace the admin homepage */\n Dashboard?: AdminViewConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\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 * as well as an entry in the componentMap if the type of the\n * dependency is 'component'\n */\n dependencies?: AdminDependencies\n /** If set to true, the entire Admin panel will be disabled. */\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 *\n * By default, this is 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?: Array<\n (props: {\n addToImportMap: AddToImportMap\n baseDir: string\n config: SanitizedConfig\n importMap: InternalImportMap\n imports: Imports\n }) => void\n >\n }\n livePreview?: {\n collections?: string[]\n globals?: string[]\n } & LivePreviewConfig\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 account?: string\n /** The route for the create first user page. */\n createFirstUser?: string\n /** The route for the forgot password page. */\n forgot?: string\n /** The route the user will be redirected to after being inactive for too long. */\n inactivity?: string\n /** The route for the login page. */\n login?: string\n /** The route for the logout page. */\n logout?: string\n /** The route for the reset password page. */\n reset?: string\n /** The route for the unauthorized page. */\n unauthorized?: string\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 /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\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 * 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\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n\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 * @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 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 /**\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 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 * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: LocalizationConfig | false\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 /** 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 /** Control the routing structure that Payload binds itself to. */\n routes?: {\n /** The route for the admin panel.\n * @example \"/my-admin\"\n * @default \"/admin\"\n */\n admin?: string\n /** @default \"/api\" */\n api?: string\n /** @default \"/graphql\" */\n graphQL?: string\n /** @default \"/graphql-playground\" */\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 * 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<(args: { jsonSchema: JSONSchema4 }) => JSONSchema4>\n }\n /**\n * Customize the handling of incoming file uploads for collections that have uploads enabled.\n */\n upload?: ExpressFileUploadOptions\n}\n\nexport type SanitizedConfig = {\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 localization: SanitizedLocalizationConfig | false\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 } & ExpressFileUploadOptions\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 'collections' | 'editor' | 'endpoint' | 'globals' | 'i18n' | 'localization' | 'upload'\n>\n\nexport type EditConfig =\n | {\n [key: string]: EditViewConfig\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 api?: Partial<EditViewConfig>\n default?: Partial<EditViewConfig>\n livePreview?: Partial<EditViewConfig>\n root?: never\n version?: Partial<EditViewConfig>\n versions?: Partial<EditViewConfig>\n // TODO: uncomment these as they are built\n // references?: EditView\n // relationships?: EditView\n }\n | {\n api?: never\n default?: never\n livePreview?: never\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 */\n root: Partial<EditViewConfig>\n version?: never\n versions?: never\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":"AA0ZA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/exports/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,wBAAwB,GACzB,MAAM,2BAA2B,CAAA;AAElC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,SAAS,EACT,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/exports/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,wBAAwB,GACzB,MAAM,2BAA2B,CAAA;AAElC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,SAAS,EACT,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/shared.ts"],"sourcesContent":["export { parsePayloadComponent } from '../bin/generateImportMap/parsePayloadComponent.js'\nexport { defaults as collectionDefaults } from '../collections/config/defaults.js'\nexport { serverProps } from '../config/types.js'\n\nexport {\n fieldAffectsData,\n fieldHasMaxDepth,\n fieldHasSubFields,\n fieldIsArrayType,\n fieldIsBlockType,\n fieldIsGroupType,\n fieldIsLocalized,\n fieldIsPresentationalOnly,\n fieldIsSidebar,\n fieldSupportsMany,\n optionIsObject,\n optionIsValue,\n optionsAreObjects,\n tabHasName,\n valueIsValueWithRelation,\n} from '../fields/config/types.js'\n\nexport * from '../fields/validations.js'\nexport { validOperators } from '../types/constants.js'\n\nexport { formatFilesize } from '../uploads/formatFilesize.js'\n\nexport { isImage } from '../uploads/isImage.js'\n\nexport {\n deepCopyObject,\n deepCopyObjectComplex,\n deepCopyObjectSimple,\n} from '../utilities/deepCopyObject.js'\nexport {\n deepMerge,\n deepMergeWithCombinedArrays,\n deepMergeWithReactComponents,\n deepMergeWithSourceArrays,\n} from '../utilities/deepMerge.js'\n\nexport { fieldSchemaToJSON } from '../utilities/fieldSchemaToJSON.js'\n\nexport { getDataByPath } from '../utilities/getDataByPath.js'\
|
|
1
|
+
{"version":3,"sources":["../../src/exports/shared.ts"],"sourcesContent":["export { parsePayloadComponent } from '../bin/generateImportMap/parsePayloadComponent.js'\nexport { defaults as collectionDefaults } from '../collections/config/defaults.js'\nexport { serverProps } from '../config/types.js'\n\nexport {\n fieldAffectsData,\n fieldHasMaxDepth,\n fieldHasSubFields,\n fieldIsArrayType,\n fieldIsBlockType,\n fieldIsGroupType,\n fieldIsLocalized,\n fieldIsPresentationalOnly,\n fieldIsSidebar,\n fieldSupportsMany,\n optionIsObject,\n optionIsValue,\n optionsAreObjects,\n tabHasName,\n valueIsValueWithRelation,\n} from '../fields/config/types.js'\n\nexport * from '../fields/validations.js'\nexport { validOperators } from '../types/constants.js'\n\nexport { formatFilesize } from '../uploads/formatFilesize.js'\n\nexport { isImage } from '../uploads/isImage.js'\n\nexport {\n deepCopyObject,\n deepCopyObjectComplex,\n deepCopyObjectSimple,\n} from '../utilities/deepCopyObject.js'\nexport {\n deepMerge,\n deepMergeWithCombinedArrays,\n deepMergeWithReactComponents,\n deepMergeWithSourceArrays,\n} from '../utilities/deepMerge.js'\n\nexport { fieldSchemaToJSON } from '../utilities/fieldSchemaToJSON.js'\n\nexport { getDataByPath } from '../utilities/getDataByPath.js'\nexport { getSiblingData } from '../utilities/getSiblingData.js'\n\nexport { getUniqueListBy } from '../utilities/getUniqueListBy.js'\n\nexport { isNumber } from '../utilities/isNumber.js'\n\nexport {\n isReactClientComponent,\n isReactComponentOrFunction,\n isReactServerComponentOrFunction,\n} from '../utilities/isReactComponent.js'\n\nexport { reduceFieldsToValues } from '../utilities/reduceFieldsToValues.js'\n\nexport { setsAreEqual } from '../utilities/setsAreEqual.js'\n\nexport { default as toKebabCase } from '../utilities/toKebabCase.js'\n\nexport { unflatten } from '../utilities/unflatten.js'\n\nexport { wait } from '../utilities/wait.js'\n\nexport { default as wordBoundariesRegex } from '../utilities/wordBoundariesRegex.js'\n\nexport { versionDefaults } from '../versions/defaults.js'\nexport { deepMergeSimple } from '@payloadcms/translations/utilities'\n"],"names":["parsePayloadComponent","defaults","collectionDefaults","serverProps","fieldAffectsData","fieldHasMaxDepth","fieldHasSubFields","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","fieldIsLocalized","fieldIsPresentationalOnly","fieldIsSidebar","fieldSupportsMany","optionIsObject","optionIsValue","optionsAreObjects","tabHasName","valueIsValueWithRelation","validOperators","formatFilesize","isImage","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","fieldSchemaToJSON","getDataByPath","getSiblingData","getUniqueListBy","isNumber","isReactClientComponent","isReactComponentOrFunction","isReactServerComponentOrFunction","reduceFieldsToValues","setsAreEqual","default","toKebabCase","unflatten","wait","wordBoundariesRegex","versionDefaults","deepMergeSimple"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oDAAmD;AACzF,SAASC,YAAYC,kBAAkB,QAAQ,oCAAmC;AAClF,SAASC,WAAW,QAAQ,qBAAoB;AAEhD,SACEC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,yBAAyB,EACzBC,cAAc,EACdC,iBAAiB,EACjBC,cAAc,EACdC,aAAa,EACbC,iBAAiB,EACjBC,UAAU,EACVC,wBAAwB,QACnB,4BAA2B;AAElC,cAAc,2BAA0B;AACxC,SAASC,cAAc,QAAQ,wBAAuB;AAEtD,SAASC,cAAc,QAAQ,+BAA8B;AAE7D,SAASC,OAAO,QAAQ,wBAAuB;AAE/C,SACEC,cAAc,EACdC,qBAAqB,EACrBC,oBAAoB,QACf,iCAAgC;AACvC,SACEC,SAAS,EACTC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,yBAAyB,QACpB,4BAA2B;AAElC,SAASC,iBAAiB,QAAQ,oCAAmC;AAErE,SAASC,aAAa,QAAQ,gCAA+B;AAC7D,SAASC,cAAc,QAAQ,iCAAgC;AAE/D,SAASC,eAAe,QAAQ,kCAAiC;AAEjE,SAASC,QAAQ,QAAQ,2BAA0B;AAEnD,SACEC,sBAAsB,EACtBC,0BAA0B,EAC1BC,gCAAgC,QAC3B,mCAAkC;AAEzC,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,SAASC,YAAY,QAAQ,+BAA8B;AAE3D,SAASC,WAAWC,WAAW,QAAQ,8BAA6B;AAEpE,SAASC,SAAS,QAAQ,4BAA2B;AAErD,SAASC,IAAI,QAAQ,uBAAsB;AAE3C,SAASH,WAAWI,mBAAmB,QAAQ,sCAAqC;AAEpF,SAASC,eAAe,QAAQ,0BAAyB;AACzD,SAASC,eAAe,QAAQ,qCAAoC"}
|
|
@@ -3,8 +3,7 @@ import type { JSONSchema4 } from 'json-schema';
|
|
|
3
3
|
import type { CSSProperties } from 'react';
|
|
4
4
|
import type { DeepUndefinable } from 'ts-essentials';
|
|
5
5
|
import type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js';
|
|
6
|
-
import type {
|
|
7
|
-
import type { ClientTab, ConditionalDateProps, Description, DescriptionComponent, LabelComponent, MappedComponent, RowLabelComponent, StaticDescription } from '../../admin/types.js';
|
|
6
|
+
import type { ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, ArrayFieldProps, BlockFieldErrorClientComponent, BlockFieldErrorServerComponent, BlockFieldProps, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, CheckboxFieldProps, ClientTab, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CodeFieldProps, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, CollapsibleFieldProps, ConditionalDateProps, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DateFieldProps, Description, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, EmailFieldProps, FieldDescriptionClientComponent, FieldDescriptionServerComponent, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, GroupFieldProps, HiddenFieldProps, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, JSONFieldProps, MappedComponent, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, NumberFieldProps, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, PointFieldProps, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RadioFieldProps, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RelationshipFieldProps, RichTextFieldProps, RowFieldProps, RowLabelComponent, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, SelectFieldProps, StaticDescription, TabsFieldProps, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextareaFieldProps, UploadFieldErrorClientComponent, UploadFieldErrorServerComponent, UploadFieldLabelClientComponent, UploadFieldLabelServerComponent, UploadFieldProps } from '../../admin/types.js';
|
|
8
7
|
import type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js';
|
|
9
8
|
import type { CustomComponent, LabelFunction, PayloadComponent, StaticLabel } from '../../config/types.js';
|
|
10
9
|
import type { DBIdentifierName } from '../../database/types.js';
|
|
@@ -114,7 +113,7 @@ type Admin = {
|
|
|
114
113
|
className?: string;
|
|
115
114
|
components?: {
|
|
116
115
|
Cell?: CustomComponent;
|
|
117
|
-
Description?:
|
|
116
|
+
Description?: CustomComponent<FieldDescriptionClientComponent | FieldDescriptionServerComponent>;
|
|
118
117
|
Field?: CustomComponent;
|
|
119
118
|
/**
|
|
120
119
|
* The Filter component has to be a client component
|
|
@@ -285,8 +284,8 @@ export type NumberField = {
|
|
|
285
284
|
/** Set this property to a string that will be used for browser autocomplete. */
|
|
286
285
|
autoComplete?: string;
|
|
287
286
|
components?: {
|
|
288
|
-
Error?:
|
|
289
|
-
Label?:
|
|
287
|
+
Error?: CustomComponent<NumberFieldErrorClientComponent | NumberFieldErrorServerComponent>;
|
|
288
|
+
Label?: CustomComponent<NumberFieldLabelClientComponent | NumberFieldLabelServerComponent>;
|
|
290
289
|
afterInput?: CustomComponent[];
|
|
291
290
|
beforeInput?: CustomComponent[];
|
|
292
291
|
} & Admin['components'];
|
|
@@ -330,8 +329,8 @@ export type TextField = {
|
|
|
330
329
|
admin?: {
|
|
331
330
|
autoComplete?: string;
|
|
332
331
|
components?: {
|
|
333
|
-
Error?:
|
|
334
|
-
Label?:
|
|
332
|
+
Error?: CustomComponent<TextFieldErrorClientComponent | TextFieldErrorServerComponent>;
|
|
333
|
+
Label?: CustomComponent<TextFieldLabelClientComponent | TextFieldLabelServerComponent>;
|
|
335
334
|
afterInput?: CustomComponent[];
|
|
336
335
|
beforeInput?: CustomComponent[];
|
|
337
336
|
} & Admin['components'];
|
|
@@ -371,8 +370,8 @@ export type EmailField = {
|
|
|
371
370
|
admin?: {
|
|
372
371
|
autoComplete?: string;
|
|
373
372
|
components?: {
|
|
374
|
-
Error?:
|
|
375
|
-
Label?:
|
|
373
|
+
Error?: CustomComponent<EmailFieldErrorClientComponent | EmailFieldErrorServerComponent>;
|
|
374
|
+
Label?: CustomComponent<EmailFieldLabelClientComponent | EmailFieldLabelServerComponent>;
|
|
376
375
|
afterInput?: CustomComponent[];
|
|
377
376
|
beforeInput?: CustomComponent[];
|
|
378
377
|
} & Admin['components'];
|
|
@@ -394,8 +393,8 @@ export type EmailFieldClient = {
|
|
|
394
393
|
export type TextareaField = {
|
|
395
394
|
admin?: {
|
|
396
395
|
components?: {
|
|
397
|
-
Error?:
|
|
398
|
-
Label?:
|
|
396
|
+
Error?: CustomComponent<TextareaFieldErrorClientComponent | TextareaFieldErrorServerComponent>;
|
|
397
|
+
Label?: CustomComponent<TextareaFieldLabelClientComponent | TextareaFieldLabelServerComponent>;
|
|
399
398
|
afterInput?: CustomComponent[];
|
|
400
399
|
beforeInput?: CustomComponent[];
|
|
401
400
|
} & Admin['components'];
|
|
@@ -421,8 +420,8 @@ export type TextareaFieldClient = {
|
|
|
421
420
|
export type CheckboxField = {
|
|
422
421
|
admin?: {
|
|
423
422
|
components?: {
|
|
424
|
-
Error?:
|
|
425
|
-
Label?:
|
|
423
|
+
Error?: CustomComponent<CheckboxFieldErrorClientComponent | CheckboxFieldErrorServerComponent>;
|
|
424
|
+
Label?: CustomComponent<CheckboxFieldLabelClientComponent | CheckboxFieldLabelServerComponent>;
|
|
426
425
|
afterInput?: CustomComponent[];
|
|
427
426
|
beforeInput?: CustomComponent[];
|
|
428
427
|
} & Admin['components'];
|
|
@@ -443,8 +442,8 @@ export type CheckboxFieldClient = {
|
|
|
443
442
|
export type DateField = {
|
|
444
443
|
admin?: {
|
|
445
444
|
components?: {
|
|
446
|
-
Error?:
|
|
447
|
-
Label?:
|
|
445
|
+
Error?: CustomComponent<DateFieldErrorClientComponent | DateFieldErrorServerComponent>;
|
|
446
|
+
Label?: CustomComponent<DateFieldLabelClientComponent | DateFieldLabelServerComponent>;
|
|
448
447
|
afterInput?: CustomComponent[];
|
|
449
448
|
beforeInput?: CustomComponent[];
|
|
450
449
|
} & Admin['components'];
|
|
@@ -467,7 +466,7 @@ export type DateFieldClient = {
|
|
|
467
466
|
export type GroupField = {
|
|
468
467
|
admin?: {
|
|
469
468
|
components?: {
|
|
470
|
-
Label?:
|
|
469
|
+
Label?: CustomComponent<GroupFieldLabelClientComponent | GroupFieldLabelServerComponent>;
|
|
471
470
|
} & Admin['components'];
|
|
472
471
|
hideGutter?: boolean;
|
|
473
472
|
} & Admin;
|
|
@@ -505,7 +504,7 @@ export type CollapsibleField = {
|
|
|
505
504
|
} & ({
|
|
506
505
|
admin: {
|
|
507
506
|
components: {
|
|
508
|
-
Label?:
|
|
507
|
+
Label?: CustomComponent<CollapsibleFieldLabelClientComponent | CollapsibleFieldLabelServerComponent>;
|
|
509
508
|
RowLabel: RowLabelComponent;
|
|
510
509
|
} & Admin['components'];
|
|
511
510
|
initCollapsed?: boolean;
|
|
@@ -514,7 +513,7 @@ export type CollapsibleField = {
|
|
|
514
513
|
} | {
|
|
515
514
|
admin?: {
|
|
516
515
|
components?: {
|
|
517
|
-
Label?:
|
|
516
|
+
Label?: CustomComponent<CollapsibleFieldLabelClientComponent | CollapsibleFieldLabelServerComponent>;
|
|
518
517
|
} & Admin['components'];
|
|
519
518
|
initCollapsed?: boolean;
|
|
520
519
|
} & Admin;
|
|
@@ -620,8 +619,8 @@ Pick<UIField, 'label' | 'name' | 'type'>;
|
|
|
620
619
|
export type UploadField = {
|
|
621
620
|
admin?: {
|
|
622
621
|
components?: {
|
|
623
|
-
Error?:
|
|
624
|
-
Label?:
|
|
622
|
+
Error?: CustomComponent<UploadFieldErrorClientComponent | UploadFieldErrorServerComponent>;
|
|
623
|
+
Label?: CustomComponent<UploadFieldLabelClientComponent | UploadFieldLabelServerComponent>;
|
|
625
624
|
} & Admin['components'];
|
|
626
625
|
};
|
|
627
626
|
displayPreview?: boolean;
|
|
@@ -647,8 +646,8 @@ export type UploadFieldClient = {
|
|
|
647
646
|
export type CodeField = {
|
|
648
647
|
admin?: {
|
|
649
648
|
components?: {
|
|
650
|
-
Error?:
|
|
651
|
-
Label?:
|
|
649
|
+
Error?: CustomComponent<CodeFieldErrorClientComponent | CodeFieldErrorServerComponent>;
|
|
650
|
+
Label?: CustomComponent<CodeFieldLabelClientComponent | CodeFieldLabelServerComponent>;
|
|
652
651
|
afterInput?: CustomComponent[];
|
|
653
652
|
beforeInput?: CustomComponent[];
|
|
654
653
|
} & Admin['components'];
|
|
@@ -673,8 +672,8 @@ export type CodeFieldClient = {
|
|
|
673
672
|
export type JSONField = {
|
|
674
673
|
admin?: {
|
|
675
674
|
components?: {
|
|
676
|
-
Error?:
|
|
677
|
-
Label?:
|
|
675
|
+
Error?: CustomComponent<JSONFieldErrorClientComponent | JSONFieldErrorServerComponent>;
|
|
676
|
+
Label?: CustomComponent<JSONFieldLabelClientComponent | JSONFieldLabelServerComponent>;
|
|
678
677
|
afterInput?: CustomComponent[];
|
|
679
678
|
beforeInput?: CustomComponent[];
|
|
680
679
|
} & Admin['components'];
|
|
@@ -701,8 +700,8 @@ export type JSONFieldClient = {
|
|
|
701
700
|
export type SelectField = {
|
|
702
701
|
admin?: {
|
|
703
702
|
components?: {
|
|
704
|
-
Error?:
|
|
705
|
-
Label?:
|
|
703
|
+
Error?: CustomComponent<SelectFieldErrorClientComponent | SelectFieldErrorServerComponent>;
|
|
704
|
+
Label?: CustomComponent<SelectFieldLabelClientComponent | SelectFieldLabelServerComponent>;
|
|
706
705
|
afterInput?: CustomComponent[];
|
|
707
706
|
beforeInput?: CustomComponent[];
|
|
708
707
|
} & Admin['components'];
|
|
@@ -772,8 +771,8 @@ type SharedRelationshipPropertiesClient = FieldBaseClient & Pick<SharedRelations
|
|
|
772
771
|
type RelationshipAdmin = {
|
|
773
772
|
allowCreate?: boolean;
|
|
774
773
|
components?: {
|
|
775
|
-
Error?:
|
|
776
|
-
Label?:
|
|
774
|
+
Error?: CustomComponent<RelationshipFieldErrorClientComponent | RelationshipFieldErrorServerComponent>;
|
|
775
|
+
Label?: CustomComponent<RelationshipFieldLabelClientComponent | RelationshipFieldLabelServerComponent>;
|
|
777
776
|
} & Admin['components'];
|
|
778
777
|
isSortable?: boolean;
|
|
779
778
|
} & Admin;
|
|
@@ -816,8 +815,8 @@ export type RelationshipValue = (number | string)[] | ValueWithRelation | ValueW
|
|
|
816
815
|
export type RichTextField<TValue extends object = any, TAdapterProps = any, TExtraProperties = object> = {
|
|
817
816
|
admin?: {
|
|
818
817
|
components?: {
|
|
819
|
-
Error?:
|
|
820
|
-
Label?:
|
|
818
|
+
Error?: CustomComponent;
|
|
819
|
+
Label?: CustomComponent;
|
|
821
820
|
} & Admin['components'];
|
|
822
821
|
} & Admin;
|
|
823
822
|
editor?: RichTextAdapter<TValue, TAdapterProps, TExtraProperties> | RichTextAdapterProvider<TValue, TAdapterProps, TExtraProperties>;
|
|
@@ -835,14 +834,15 @@ export type RichTextFieldClient<TValue extends object = any, TAdapterProps = any
|
|
|
835
834
|
Error?: MappedComponent;
|
|
836
835
|
Label?: MappedComponent;
|
|
837
836
|
} & AdminClient['components'];
|
|
837
|
+
placeholder?: Record<string, string> | string;
|
|
838
838
|
} & AdminClient;
|
|
839
839
|
richTextComponentMap?: Map<string, any>;
|
|
840
840
|
} & FieldBaseClient & Pick<RichTextField<TValue, TAdapterProps, TExtraProperties>, 'maxDepth' | 'type'> & TExtraProperties;
|
|
841
841
|
export type ArrayField = {
|
|
842
842
|
admin?: {
|
|
843
843
|
components?: {
|
|
844
|
-
Error?:
|
|
845
|
-
Label?:
|
|
844
|
+
Error?: CustomComponent<ArrayFieldErrorClientComponent | ArrayFieldErrorServerComponent>;
|
|
845
|
+
Label?: CustomComponent<ArrayFieldLabelClientComponent | ArrayFieldLabelServerComponent>;
|
|
846
846
|
RowLabel?: RowLabelComponent;
|
|
847
847
|
} & Admin['components'];
|
|
848
848
|
initCollapsed?: boolean;
|
|
@@ -883,8 +883,8 @@ export type ArrayFieldClient = {
|
|
|
883
883
|
export type RadioField = {
|
|
884
884
|
admin?: {
|
|
885
885
|
components?: {
|
|
886
|
-
Error?:
|
|
887
|
-
Label?:
|
|
886
|
+
Error?: CustomComponent<RadioFieldErrorClientComponent | RadioFieldErrorServerComponent>;
|
|
887
|
+
Label?: CustomComponent<RadioFieldLabelClientComponent | RadioFieldLabelServerComponent>;
|
|
888
888
|
} & Admin['components'];
|
|
889
889
|
layout?: 'horizontal' | 'vertical';
|
|
890
890
|
} & Admin;
|
|
@@ -962,7 +962,7 @@ export type ClientBlock = {
|
|
|
962
962
|
export type BlockField = {
|
|
963
963
|
admin?: {
|
|
964
964
|
components?: {
|
|
965
|
-
Error?:
|
|
965
|
+
Error?: CustomComponent<BlockFieldErrorClientComponent | BlockFieldErrorServerComponent>;
|
|
966
966
|
} & Admin['components'];
|
|
967
967
|
initCollapsed?: boolean;
|
|
968
968
|
/**
|
|
@@ -990,8 +990,8 @@ export type BlockFieldClient = {
|
|
|
990
990
|
export type PointField = {
|
|
991
991
|
admin?: {
|
|
992
992
|
components?: {
|
|
993
|
-
Error?:
|
|
994
|
-
Label?:
|
|
993
|
+
Error?: CustomComponent<PointFieldErrorClientComponent | PointFieldErrorServerComponent>;
|
|
994
|
+
Label?: CustomComponent<PointFieldLabelClientComponent | PointFieldLabelServerComponent>;
|
|
995
995
|
afterInput?: CustomComponent[];
|
|
996
996
|
beforeInput?: CustomComponent[];
|
|
997
997
|
} & Admin['components'];
|
|
@@ -1013,6 +1013,7 @@ export type PointFieldClient = {
|
|
|
1013
1013
|
} & FieldBaseClient & Pick<PointField, 'type'>;
|
|
1014
1014
|
export type Field = ArrayField | BlockField | CheckboxField | CodeField | CollapsibleField | DateField | EmailField | GroupField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | RowField | SelectField | TabsField | TextField | TextareaField | UIField | UploadField;
|
|
1015
1015
|
export type ClientField = ArrayFieldClient | BlockFieldClient | CheckboxFieldClient | CodeFieldClient | CollapsibleFieldClient | DateFieldClient | EmailFieldClient | GroupFieldClient | JSONFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | RowFieldClient | SelectFieldClient | TabsFieldClient | TextFieldClient | TextareaFieldClient | UIFieldClient | UploadFieldClient;
|
|
1016
|
+
export type ClientFieldProps = ArrayFieldProps | BlockFieldProps | CheckboxFieldProps | CodeFieldProps | CollapsibleFieldProps | DateFieldProps | EmailFieldProps | GroupFieldProps | HiddenFieldProps | JSONFieldProps | NumberFieldProps | PointFieldProps | RadioFieldProps | RelationshipFieldProps | RichTextFieldProps | RowFieldProps | SelectFieldProps | TabsFieldProps | TextareaFieldProps | UploadFieldProps;
|
|
1016
1017
|
type ExtractFieldTypes<T> = T extends {
|
|
1017
1018
|
type: infer U;
|
|
1018
1019
|
} ? U : never;
|
|
@@ -1035,23 +1036,23 @@ export type FieldWithMany = RelationshipField | SelectField;
|
|
|
1035
1036
|
export type FieldWithManyClient = RelationshipFieldClient | SelectFieldClient;
|
|
1036
1037
|
export type FieldWithMaxDepth = RelationshipField | UploadField;
|
|
1037
1038
|
export type FieldWithMaxDepthClient = RelationshipFieldClient | UploadFieldClient;
|
|
1038
|
-
export declare function fieldHasSubFields<
|
|
1039
|
-
export declare function fieldIsArrayType<
|
|
1040
|
-
export declare function fieldIsBlockType<
|
|
1041
|
-
export declare function fieldIsGroupType<
|
|
1039
|
+
export declare function fieldHasSubFields<TField extends ClientField | Field>(field: TField): field is TField & (TField extends ClientField ? FieldWithSubFieldsClient : FieldWithSubFields);
|
|
1040
|
+
export declare function fieldIsArrayType<TField extends ClientField | Field>(field: TField): field is TField & (TField extends ClientField ? ArrayFieldClient : ArrayField);
|
|
1041
|
+
export declare function fieldIsBlockType<TField extends ClientField | Field>(field: TField): field is TField & (TField extends ClientField ? BlockFieldClient : BlockField);
|
|
1042
|
+
export declare function fieldIsGroupType<TField extends ClientField | Field>(field: TField): field is TField & (TField extends ClientField ? GroupFieldClient : GroupField);
|
|
1042
1043
|
export declare function optionIsObject(option: Option): option is OptionObject;
|
|
1043
1044
|
export declare function optionsAreObjects(options: Option[]): options is OptionObject[];
|
|
1044
1045
|
export declare function optionIsValue(option: Option): option is string;
|
|
1045
|
-
export declare function fieldSupportsMany<
|
|
1046
|
-
export declare function fieldHasMaxDepth<
|
|
1047
|
-
export declare function fieldIsPresentationalOnly<
|
|
1048
|
-
export declare function fieldIsSidebar<
|
|
1046
|
+
export declare function fieldSupportsMany<TField extends ClientField | Field>(field: TField): field is TField & (TField extends ClientField ? FieldWithManyClient : FieldWithMany);
|
|
1047
|
+
export declare function fieldHasMaxDepth<TField extends ClientField | Field>(field: TField): field is TField & (TField extends ClientField ? FieldWithMaxDepthClient : FieldWithMaxDepth);
|
|
1048
|
+
export declare function fieldIsPresentationalOnly<TField extends ClientField | Field | TabAsField | TabAsFieldClient>(field: TField): field is TField & (TField extends ClientField | TabAsFieldClient ? UIFieldClient : UIField);
|
|
1049
|
+
export declare function fieldIsSidebar<TField extends ClientField | Field | TabAsField | TabAsFieldClient>(field: TField): field is {
|
|
1049
1050
|
admin: {
|
|
1050
1051
|
position: 'sidebar';
|
|
1051
1052
|
};
|
|
1052
|
-
} &
|
|
1053
|
-
export declare function fieldAffectsData<
|
|
1054
|
-
export declare function tabHasName<
|
|
1053
|
+
} & TField;
|
|
1054
|
+
export declare function fieldAffectsData<TField extends ClientField | Field | TabAsField | TabAsFieldClient>(field: TField): field is TField & (TField extends ClientField | TabAsFieldClient ? FieldAffectingDataClient : FieldAffectingData);
|
|
1055
|
+
export declare function tabHasName<TField extends ClientTab | Tab>(tab: TField): tab is NamedTab & TField;
|
|
1055
1056
|
export declare function fieldIsLocalized(field: Field | Tab): boolean;
|
|
1056
1057
|
export type HookName = 'afterChange' | 'afterRead' | 'beforeChange' | 'beforeRead' | 'beforeValidate';
|
|
1057
1058
|
export {};
|