payload 3.0.0-alpha.49 → 3.0.0-alpha.50
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/components.d.ts +14 -0
- package/components.js +71 -0
- package/dist/admin/elements/Cell.d.ts +6 -6
- package/dist/admin/elements/Cell.d.ts.map +1 -1
- package/dist/admin/elements/Cell.js.map +1 -1
- package/dist/admin/elements/PreviewButton.d.ts +1 -8
- package/dist/admin/elements/PreviewButton.d.ts.map +1 -1
- package/dist/admin/elements/PreviewButton.js.map +1 -1
- package/dist/admin/elements/PublishButton.d.ts +1 -10
- package/dist/admin/elements/PublishButton.d.ts.map +1 -1
- package/dist/admin/elements/PublishButton.js.map +1 -1
- package/dist/admin/elements/SaveButton.d.ts +1 -7
- package/dist/admin/elements/SaveButton.d.ts.map +1 -1
- package/dist/admin/elements/SaveButton.js.map +1 -1
- package/dist/admin/elements/SaveDraftButton.d.ts +1 -8
- package/dist/admin/elements/SaveDraftButton.d.ts.map +1 -1
- package/dist/admin/elements/SaveDraftButton.js.map +1 -1
- package/dist/admin/forms/FieldDescription.d.ts +9 -6
- package/dist/admin/forms/FieldDescription.d.ts.map +1 -1
- package/dist/admin/forms/FieldDescription.js.map +1 -1
- package/dist/admin/forms/Form.d.ts +1 -2
- package/dist/admin/forms/Form.d.ts.map +1 -1
- package/dist/admin/forms/Form.js.map +1 -1
- package/dist/admin/forms/Label.d.ts +2 -0
- 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 +7 -11
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/types.d.ts +8 -0
- package/dist/admin/views/types.d.ts.map +1 -1
- package/dist/admin/views/types.js.map +1 -1
- package/dist/auth/executeAccess.d.ts +1 -1
- package/dist/auth/executeAccess.d.ts.map +1 -1
- package/dist/auth/executeAccess.js.map +1 -1
- package/dist/auth/getAccessResults.d.ts.map +1 -1
- package/dist/auth/getAccessResults.js +7 -2
- package/dist/auth/getAccessResults.js.map +1 -1
- package/dist/auth/strategies/apiKey.js.map +1 -1
- package/dist/bin/migrate.d.ts +1 -1
- package/dist/bin/migrate.d.ts.map +1 -1
- package/dist/bin/migrate.js.map +1 -1
- package/dist/collections/config/client.d.ts +42 -42
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js +1 -0
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/sanitize.js +1 -1
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/types.d.ts +6 -6
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/operations/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/duplicate.js +82 -100
- package/dist/collections/operations/duplicate.js.map +1 -1
- package/dist/collections/operations/local/create.d.ts +1 -1
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js.map +1 -1
- package/dist/collections/operations/utils.d.ts +1 -1
- package/dist/collections/operations/utils.d.ts.map +1 -1
- package/dist/collections/operations/utils.js.map +1 -1
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js.map +1 -1
- package/dist/config/types.d.ts +3 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.d.ts.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.js +2 -1
- package/dist/database/queryValidation/validateSearchParams.js.map +1 -1
- package/dist/exports/types.d.ts +1 -1
- package/dist/exports/types.d.ts.map +1 -1
- package/dist/exports/types.js.map +1 -1
- package/dist/exports/utilities.d.ts +1 -0
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +1 -0
- package/dist/exports/utilities.js.map +1 -1
- package/dist/fields/baseFields/baseIDField.d.ts.map +1 -1
- package/dist/fields/baseFields/baseIDField.js +11 -3
- package/dist/fields/baseFields/baseIDField.js.map +1 -1
- package/dist/fields/config/client.d.ts +5 -0
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/schema.d.ts.map +1 -1
- package/dist/fields/config/schema.js +10 -2
- package/dist/fields/config/schema.js.map +1 -1
- package/dist/fields/config/types.d.ts +14 -2
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/getDefaultValue.d.ts +1 -1
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/getDefaultValue.js +6 -1
- package/dist/fields/getDefaultValue.js.map +1 -1
- package/dist/fields/hooks/afterChange/index.d.ts +4 -0
- package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/index.js +4 -1
- package/dist/fields/hooks/afterChange/index.js.map +1 -1
- package/dist/fields/hooks/afterRead/index.d.ts +9 -0
- package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/index.js +9 -1
- package/dist/fields/hooks/afterRead/index.js.map +1 -1
- package/dist/fields/hooks/beforeChange/beforeDuplicate.d.ts +3 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.d.ts.map +1 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.js +6 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.js.map +1 -0
- package/dist/fields/hooks/beforeChange/index.d.ts +11 -1
- package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/index.js +14 -2
- package/dist/fields/hooks/beforeChange/index.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts +3 -2
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +46 -20
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts +11 -2
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.js +9 -1
- package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts +9 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.js +8 -2
- package/dist/fields/hooks/beforeValidate/index.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts +1 -2
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +1 -30
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +1 -2
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.js +1 -2
- package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
- package/dist/fields/setDefaultBeforeDuplicate.d.ts.map +1 -1
- package/dist/fields/setDefaultBeforeDuplicate.js +1 -0
- package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +5 -4
- package/dist/fields/validations.js.map +1 -1
- package/dist/globals/config/types.d.ts +6 -6
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/preferences/operations/delete.d.ts.map +1 -1
- package/dist/preferences/operations/delete.js +4 -5
- package/dist/preferences/operations/delete.js.map +1 -1
- package/dist/preferences/requestHandlers/delete.d.ts +1 -1
- package/dist/preferences/requestHandlers/delete.d.ts.map +1 -1
- package/dist/preferences/requestHandlers/delete.js.map +1 -1
- package/dist/preferences/requestHandlers/findOne.d.ts +1 -1
- package/dist/preferences/requestHandlers/findOne.d.ts.map +1 -1
- package/dist/preferences/requestHandlers/findOne.js.map +1 -1
- package/dist/preferences/requestHandlers/update.d.ts +1 -1
- package/dist/preferences/requestHandlers/update.d.ts.map +1 -1
- package/dist/preferences/requestHandlers/update.js.map +1 -1
- package/dist/translations/getLocalI18n.d.ts +2 -2
- package/dist/translations/getLocalI18n.d.ts.map +1 -1
- package/dist/translations/getLocalI18n.js +1 -1
- package/dist/translations/getLocalI18n.js.map +1 -1
- package/dist/uploads/canResizeImage.js +2 -1
- package/dist/uploads/canResizeImage.js.map +1 -1
- package/dist/uploads/generateFileData.js +2 -2
- package/dist/uploads/generateFileData.js.map +1 -1
- package/dist/uploads/getBaseFields.d.ts +2 -2
- package/dist/uploads/getBaseFields.d.ts.map +1 -1
- package/dist/uploads/getBaseFields.js +51 -8
- package/dist/uploads/getBaseFields.js.map +1 -1
- package/dist/uploads/getImageSize.d.ts.map +1 -1
- package/dist/uploads/getImageSize.js +5 -12
- package/dist/uploads/getImageSize.js.map +1 -1
- package/dist/uploads/types.d.ts +1 -1
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/createLocalReq.d.ts +1 -1
- package/dist/utilities/createLocalReq.d.ts.map +1 -1
- package/dist/utilities/createLocalReq.js +2 -2
- package/dist/utilities/createLocalReq.js.map +1 -1
- package/dist/utilities/fieldSchemaToJSON.d.ts +1 -1
- package/dist/utilities/fieldSchemaToJSON.d.ts.map +1 -1
- package/dist/utilities/fieldSchemaToJSON.js.map +1 -1
- package/dist/utilities/isReactComponent.d.ts +4 -0
- package/dist/utilities/isReactComponent.d.ts.map +1 -0
- package/dist/utilities/isReactComponent.js +11 -0
- package/dist/utilities/isReactComponent.js.map +1 -0
- package/graphql.d.ts +3 -0
- package/graphql.js +27 -0
- package/package.json +6 -10
- package/src/index.ts +474 -0
- package/types.d.ts +1 -1
- package/utilities.d.ts +1 -0
- package/utilities.js +1 -0
- package/.release-it.js +0 -51
package/dist/config/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type { I18nOptions } from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { Transporter } from 'nodemailer'\nimport type SMTPConnection from 'nodemailer/lib/smtp-connection'\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 { DocumentTab, RichTextAdapter } from '../admin/types.js'\nimport type { AdminView, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { User } from '../auth/types.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 { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\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\ntype Email = {\n fromAddress: string\n fromName: string\n logMockCredentials?: boolean\n}\n\n// eslint-disable-next-line no-use-before-define\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 data: Record<string, any>\n documentInfo: any // TODO: remove or populate this\n locale: Locale\n }) => Promise<string> | string)\n | string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n token: string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => Promise<null | string> | null | string\n\nexport type EmailTransport = Email & {\n transport: Transporter\n transportOptions?: SMTPConnection.Options\n}\n\nexport type EmailTransportOptions = Email & {\n transport?: Transporter\n transportOptions: SMTPConnection.Options\n}\n\nexport type EmailOptions = Email | EmailTransport | EmailTransportOptions\n\n/**\n * type guard for EmailOptions\n * @param emailConfig\n */\nexport function hasTransport(emailConfig: EmailOptions): emailConfig is EmailTransport {\n return (emailConfig as EmailTransport).transport !== undefined\n}\n\n/**\n * type guard for EmailOptions\n * @param emailConfig\n */\nexport function hasTransportOptions(\n emailConfig: EmailOptions,\n): emailConfig is EmailTransportOptions {\n return (emailConfig as EmailTransportOptions).transportOptions !== undefined\n}\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: number | string | symbol]: 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 /**\n * Configuration for Payload's email functionality\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailOptions\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 /**\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<T = any, U = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: T\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<U>\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<T = any, U = any> = (\n args: AccessArgs<T, U>,\n) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the 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<U = User> = {\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 = React.ComponentType<ServerSideEditViewProps>\n\nexport type EditViewConfig =\n | {\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?: DocumentTab\n path?: string\n }\n | {\n Component: EditViewComponent\n path: string\n }\n | {\n actions?: React.ComponentType<any>[]\n }\n\n/**\n * Override existing views\n * i.e. Dashboard, Account, API, LivePreview, etc.\n * Path is not available here\n * All Tab properties become optional\n * i.e. you can change just the label, if desired\n */\nexport type EditView = EditViewComponent | EditViewConfig\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 BaseLocalizationConfig & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n locales: string[]\n }\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n BaseLocalizationConfig & {\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 }\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n LocalizationConfigWithLabels & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n localeCodes: string[]\n }\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\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\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 when visiting the admin dashboard. */\n autoLogin?:\n | {\n /**\n * The email address of the user to login as\n *\n */\n email: string\n /** The password of the user to login as */\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 }\n | false\n\n /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?: 'default' | 'gravatar' | React.ComponentType<any>\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?: React.ComponentType<any>\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: React.ComponentType<any>[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: React.ComponentType<any>[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: React.ComponentType<any>[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: React.ComponentType<any>[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: React.ComponentType<any>[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: React.ComponentType<any>[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: React.ComponentType<any>[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: React.ComponentType<any>\n /** Replace the logo on the login page */\n Logo?: React.ComponentType<any>\n }\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: React.ComponentType<any>\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: React.ComponentType<{ 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]: AdminView\n /** Replace the account screen */\n Account?: AdminView\n /** Replace the admin homepage */\n Dashboard?: AdminView\n }\n }\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 /** If set to true, the entire Admin panel will be disabled. */\n disable?: boolean\n /** The route the user will be redirected to after being inactive for too long. */\n inactivityRoute?: string\n livePreview?: LivePreviewConfig & {\n collections?: string[]\n globals?: string[]\n }\n /** The route for the logout page. */\n logoutRoute?: string\n /** Base meta data to use for the Admin panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: {\n /**\n * Public path to an icon\n *\n * This image may be displayed in the browser next to the title of the page\n */\n favicon?: string\n /**\n * Public path to an image\n *\n * This image may be displayed as preview when the link is shared on social media\n */\n ogImage?: string\n /**\n * String to append to the <title> of admin pages\n * @example `\" - My Brand\"`\n */\n titleSuffix?: string\n }\n /** The slug of a Collection that you want 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 * Replace the built-in components with custom ones\n */\n components?: { [key: string]: (() => JSX.Element) | JSX.Element }\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?: '*' | 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. */\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: RichTextAdapter<any, any, any>\n /**\n * Email configuration options. This value is overridden by `email` in Payload.init if passed.\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailOptions\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 /**\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\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 /** @default \"/admin\" */\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 /** Disable declare block in generated types file */\n declare?: false\n /** Filename to write the generated types to */\n outputFile?: string\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 = Omit<\n DeepRequired<Config>,\n 'collections' | 'endpoint' | 'globals' | 'localization'\n> & {\n collections: SanitizedCollectionConfig[]\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n localization: SanitizedLocalizationConfig | false\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n}\n\nexport type EditConfig =\n | (\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 API?: EditViewComponent | Partial<EditViewConfig>\n Default?: EditViewComponent | Partial<EditViewConfig>\n LivePreview?: EditViewComponent | Partial<EditViewConfig>\n Version?: EditViewComponent | Partial<EditViewConfig>\n Versions?: EditViewComponent | Partial<EditViewConfig>\n // TODO: uncomment these as they are built\n // References?: EditView\n // Relationships?: EditView\n }\n | {\n [key: string]: EditViewConfig\n }\n )\n | EditViewComponent\n\nexport type EntityDescription =\n | (() => string)\n | React.ComponentType<any>\n | Record<string, string>\n | string\n"],"names":["hasTransport","emailConfig","transport","undefined","hasTransportOptions","transportOptions"],"mappings":"AAgGA;;;CAGC,GACD,OAAO,SAASA,aAAaC,WAAyB;IACpD,OAAO,AAACA,YAA+BC,SAAS,KAAKC;AACvD;AAEA;;;CAGC,GACD,OAAO,SAASC,oBACdH,WAAyB;IAEzB,OAAO,AAACA,YAAsCI,gBAAgB,KAAKF;AACrE"}
|
|
1
|
+
{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type { I18nOptions } from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { Transporter } from 'nodemailer'\nimport type SMTPConnection from 'nodemailer/lib/smtp-connection'\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 { DocumentTab, RichTextAdapter } from '../admin/types.js'\nimport type { AdminView, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { User } from '../auth/types.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 { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\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\ntype Email = {\n fromAddress: string\n fromName: string\n logMockCredentials?: boolean\n}\n\n// eslint-disable-next-line no-use-before-define\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 data: Record<string, any>\n documentInfo: any // TODO: remove or populate this\n locale: Locale\n }) => Promise<string> | string)\n | string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n token: string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => Promise<null | string> | null | string\n\nexport type EmailTransport = Email & {\n transport: Transporter\n transportOptions?: SMTPConnection.Options\n}\n\nexport type EmailTransportOptions = Email & {\n transport?: Transporter\n transportOptions: SMTPConnection.Options\n}\n\nexport type EmailOptions = Email | EmailTransport | EmailTransportOptions\n\n/**\n * type guard for EmailOptions\n * @param emailConfig\n */\nexport function hasTransport(emailConfig: EmailOptions): emailConfig is EmailTransport {\n return (emailConfig as EmailTransport).transport !== undefined\n}\n\n/**\n * type guard for EmailOptions\n * @param emailConfig\n */\nexport function hasTransportOptions(\n emailConfig: EmailOptions,\n): emailConfig is EmailTransportOptions {\n return (emailConfig as EmailTransportOptions).transportOptions !== undefined\n}\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: number | string | symbol]: 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 /**\n * Configuration for Payload's email functionality\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailOptions\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 /**\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<T = any, U = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: T\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<U>\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<T = any, U = any> = (\n args: AccessArgs<T, U>,\n) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the 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<U = User> = {\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 = React.ComponentType<ServerSideEditViewProps>\n\nexport type EditViewConfig =\n | {\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?: DocumentTab\n path?: string\n }\n | {\n Component: EditViewComponent\n path: string\n }\n | {\n actions?: React.ComponentType<any>[]\n }\n\n/**\n * Override existing views\n * i.e. Dashboard, Account, API, LivePreview, etc.\n * Path is not available here\n * All Tab properties become optional\n * i.e. you can change just the label, if desired\n */\nexport type EditView = EditViewComponent | EditViewConfig\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 BaseLocalizationConfig & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n locales: string[]\n }\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n BaseLocalizationConfig & {\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 }\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n LocalizationConfigWithLabels & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n localeCodes: string[]\n }\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\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\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 when visiting the admin dashboard. */\n autoLogin?:\n | {\n /**\n * The email address of the user to login as\n *\n */\n email: string\n /** The password of the user to login as */\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 }\n | false\n\n /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?: 'default' | 'gravatar' | React.ComponentType<any>\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?: React.ComponentType<any>\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: React.ComponentType<any>[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: React.ComponentType<any>[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: React.ComponentType<any>[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: React.ComponentType<any>[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: React.ComponentType<any>[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: React.ComponentType<any>[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: React.ComponentType<any>[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: React.ComponentType<any>\n /** Replace the logo on the login page */\n Logo?: React.ComponentType<any>\n }\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: React.ComponentType<any>\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: React.ComponentType<{ 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]: AdminView\n /** Replace the account screen */\n Account?: AdminView\n /** Replace the admin homepage */\n Dashboard?: AdminView\n }\n }\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 /** If set to true, the entire Admin panel will be disabled. */\n disable?: boolean\n /** The route the user will be redirected to after being inactive for too long. */\n inactivityRoute?: string\n livePreview?: LivePreviewConfig & {\n collections?: string[]\n globals?: string[]\n }\n /** The route for the logout page. */\n logoutRoute?: string\n /** Base meta data to use for the Admin panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: {\n /**\n * Public path to an icon\n *\n * This image may be displayed in the browser next to the title of the page\n */\n favicon?: string\n /**\n * Public path to an image\n *\n * This image may be displayed as preview when the link is shared on social media\n */\n ogImage?: string\n /**\n * String to append to the <title> of admin pages\n * @example `\" - My Brand\"`\n */\n titleSuffix?: string\n }\n /** The slug of a Collection that you want 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 * Replace the built-in components with custom ones\n */\n components?: { [key: string]: (() => JSX.Element) | JSX.Element }\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?: '*' | 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. */\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: RichTextAdapter<any, any, any>\n /**\n * Email configuration options. This value is overridden by `email` in Payload.init if passed.\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailOptions\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 /**\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\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 /** @default \"/admin\" */\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 /** Disable declare block in generated types file */\n declare?: false\n /** Filename to write the generated types to */\n outputFile?: string\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 = Omit<\n DeepRequired<Config>,\n 'collections' | 'endpoint' | 'globals' | 'localization'\n> & {\n collections: SanitizedCollectionConfig[]\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n localization: SanitizedLocalizationConfig | false\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n}\n\nexport type EditConfig =\n | (\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 API?: EditViewComponent | Partial<EditViewConfig>\n Default?: EditViewComponent | Partial<EditViewConfig>\n LivePreview?: EditViewComponent | Partial<EditViewConfig>\n Version?: EditViewComponent | Partial<EditViewConfig>\n Versions?: EditViewComponent | Partial<EditViewConfig>\n // TODO: uncomment these as they are built\n // References?: EditView\n // Relationships?: EditView\n }\n | {\n [key: string]: EditViewConfig\n }\n )\n | EditViewComponent\n\nexport type EntityDescriptionComponent = React.ComponentType<any>\n\nexport type EntityDescriptionFunction = () => string\n\nexport type EntityDescription =\n | EntityDescriptionComponent\n | EntityDescriptionFunction\n | Record<string, string>\n | string\n"],"names":["hasTransport","emailConfig","transport","undefined","hasTransportOptions","transportOptions"],"mappings":"AAgGA;;;CAGC,GACD,OAAO,SAASA,aAAaC,WAAyB;IACpD,OAAO,AAACA,YAA+BC,SAAS,KAAKC;AACvD;AAEA;;;CAGC,GACD,OAAO,SAASC,oBACdH,WAAyB;IAEzB,OAAO,AAACA,YAAsCI,gBAAgB,KAAKF;AACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateSearchParams.d.ts","sourceRoot":"","sources":["../../../src/database/queryValidation/validateSearchParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"validateSearchParams.d.ts","sourceRoot":"","sources":["../../../src/database/queryValidation/validateSearchParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAA;AAQ7D,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC1B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,cAAc,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,GAAG,EAAE,OAAO,CAAA;IACZ,aAAa,CAAC,EAAE,KAAK,EAAE,CAAA;CACxB,CAAA;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,IAAI,EAAE,YAAY,EAClB,QAAQ,EACR,GAAG,EACH,GAAG,EACH,aAAa,GACd,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuItB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fieldAffectsData } from '../../fields/config/types.js';
|
|
2
2
|
import { getEntityPolicies } from '../../utilities/getEntityPolicies.js';
|
|
3
|
+
import isolateObjectProperty from '../../utilities/isolateObjectProperty.js';
|
|
3
4
|
import { getLocalizedPaths } from '../getLocalizedPaths.js';
|
|
4
5
|
import { validateQueryPaths } from './validateQueryPaths.js';
|
|
5
6
|
/**
|
|
@@ -56,7 +57,7 @@ import { validateQueryPaths } from './validateQueryPaths.js';
|
|
|
56
57
|
operations: [
|
|
57
58
|
'read'
|
|
58
59
|
],
|
|
59
|
-
req
|
|
60
|
+
req: isolateObjectProperty(req, 'transactionID')
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
if ([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/database/queryValidation/validateSearchParams.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { EntityPolicies, PathToQuery } from './types.js'\n\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport { getEntityPolicies } from '../../utilities/getEntityPolicies.js'\nimport { getLocalizedPaths } from '../getLocalizedPaths.js'\nimport { validateQueryPaths } from './validateQueryPaths.js'\n\ntype Args = {\n collectionConfig?: SanitizedCollectionConfig\n errors: { path: string }[]\n fields: Field[]\n globalConfig?: SanitizedGlobalConfig\n operator: string\n overrideAccess: boolean\n path: string\n policies: EntityPolicies\n req: PayloadRequest\n val: unknown\n versionFields?: Field[]\n}\n\n/**\n * Validate the Payload key / value / operator\n */\nexport async function validateSearchParam({\n collectionConfig,\n errors,\n fields,\n globalConfig,\n operator,\n overrideAccess,\n path: incomingPath,\n policies,\n req,\n val,\n versionFields,\n}: Args): Promise<void> {\n // Replace GraphQL nested field double underscore formatting\n let sanitizedPath\n if (incomingPath === '_id') {\n sanitizedPath = 'id'\n } else {\n sanitizedPath = incomingPath.replace(/__/g, '.')\n }\n let paths: PathToQuery[] = []\n const { slug } = collectionConfig || globalConfig\n\n if (globalConfig && !policies.globals[slug]) {\n // eslint-disable-next-line no-param-reassign\n globalConfig.fields = fields\n\n // eslint-disable-next-line no-param-reassign\n policies.globals[slug] = await getEntityPolicies({\n type: 'global',\n entity: globalConfig,\n operations: ['read'],\n req,\n })\n }\n\n if (sanitizedPath !== 'id') {\n paths = await getLocalizedPaths({\n collectionSlug: collectionConfig?.slug,\n fields,\n globalSlug: globalConfig?.slug,\n incomingPath: sanitizedPath,\n locale: req.locale,\n overrideAccess,\n payload: req.payload,\n })\n }\n const promises = []\n promises.push(\n ...paths.map(async ({ collectionSlug, field, invalid, path }, i) => {\n if (invalid) {\n errors.push({ path })\n return\n }\n\n if (!overrideAccess && fieldAffectsData(field)) {\n if (collectionSlug) {\n if (!policies.collections[collectionSlug]) {\n // eslint-disable-next-line no-param-reassign\n policies.collections[collectionSlug] = await getEntityPolicies({\n type: 'collection',\n entity: req.payload.collections[collectionSlug].config,\n operations: ['read'],\n req,\n })\n }\n\n if (\n ['hash', 'salt'].includes(incomingPath) &&\n collectionConfig.auth &&\n !collectionConfig.auth?.disableLocalStrategy\n ) {\n errors.push({ path: incomingPath })\n }\n }\n let fieldPath = path\n // remove locale from end of path\n if (path.endsWith(`.${req.locale}`)) {\n fieldPath = path.slice(0, -(req.locale.length + 1))\n }\n // remove \".value\" from ends of polymorphic relationship paths\n if (field.type === 'relationship' && Array.isArray(field.relationTo)) {\n fieldPath = fieldPath.replace('.value', '')\n }\n const entityType: 'collections' | 'globals' = globalConfig ? 'globals' : 'collections'\n const entitySlug = collectionSlug || globalConfig.slug\n const segments = fieldPath.split('.')\n\n let fieldAccess\n if (versionFields) {\n fieldAccess = policies[entityType][entitySlug]\n if (segments[0] === 'parent' || segments[0] === 'version') {\n segments.shift()\n }\n } else {\n fieldAccess = policies[entityType][entitySlug].fields\n }\n\n segments.forEach((segment) => {\n if (fieldAccess[segment]) {\n if ('fields' in fieldAccess[segment]) {\n fieldAccess = fieldAccess[segment].fields\n } else if ('blocks' in fieldAccess[segment]) {\n fieldAccess = fieldAccess[segment]\n } else {\n fieldAccess = fieldAccess[segment]\n }\n }\n })\n\n if (!fieldAccess?.read?.permission) {\n errors.push({ path: fieldPath })\n }\n }\n\n if (i > 1) {\n // Remove top collection and reverse array\n // to work backwards from top\n const pathsToQuery = paths.slice(1).reverse()\n\n pathsToQuery.forEach(\n ({ collectionSlug: pathCollectionSlug, path: subPath }, pathToQueryIndex) => {\n // On the \"deepest\" collection,\n // validate query of the relationship\n if (pathToQueryIndex === 0) {\n promises.push(\n validateQueryPaths({\n collectionConfig: req.payload.collections[pathCollectionSlug].config,\n errors,\n globalConfig: undefined,\n overrideAccess,\n policies,\n req,\n where: {\n [subPath]: {\n [operator]: val,\n },\n },\n }),\n )\n }\n },\n )\n }\n }),\n )\n await Promise.all(promises)\n}\n"],"names":["fieldAffectsData","getEntityPolicies","getLocalizedPaths","validateQueryPaths","validateSearchParam","collectionConfig","errors","fields","globalConfig","operator","overrideAccess","path","incomingPath","policies","req","val","versionFields","sanitizedPath","replace","paths","slug","globals","type","entity","operations","collectionSlug","globalSlug","locale","payload","promises","push","map","field","invalid","i","collections","config","includes","auth","disableLocalStrategy","fieldPath","endsWith","slice","length","Array","isArray","relationTo","entityType","entitySlug","segments","split","fieldAccess","shift","forEach","segment","read","permission","pathsToQuery","reverse","pathCollectionSlug","subPath","pathToQueryIndex","undefined","where","Promise","all"],"mappings":"AAMA,SAASA,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,iBAAiB,QAAQ,0BAAyB;AAC3D,SAASC,kBAAkB,QAAQ,0BAAyB;AAgB5D;;CAEC,GACD,OAAO,eAAeC,oBAAoB,EACxCC,gBAAgB,EAChBC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,QAAQ,EACRC,cAAc,EACdC,MAAMC,YAAY,EAClBC,QAAQ,EACRC,GAAG,EACHC,GAAG,EACHC,aAAa,EACR;IACL,4DAA4D;IAC5D,IAAIC;IACJ,IAAIL,iBAAiB,OAAO;QAC1BK,gBAAgB;IAClB,OAAO;QACLA,gBAAgBL,aAAaM,OAAO,CAAC,OAAO;IAC9C;IACA,IAAIC,QAAuB,EAAE;IAC7B,MAAM,EAAEC,IAAI,EAAE,GAAGf,oBAAoBG;IAErC,IAAIA,gBAAgB,CAACK,SAASQ,OAAO,CAACD,KAAK,EAAE;QAC3C,6CAA6C;QAC7CZ,aAAaD,MAAM,GAAGA;QAEtB,6CAA6C;QAC7CM,SAASQ,OAAO,CAACD,KAAK,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../../src/database/queryValidation/validateSearchParams.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { EntityPolicies, PathToQuery } from './types.js'\n\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport { getEntityPolicies } from '../../utilities/getEntityPolicies.js'\nimport isolateObjectProperty from '../../utilities/isolateObjectProperty.js'\nimport { getLocalizedPaths } from '../getLocalizedPaths.js'\nimport { validateQueryPaths } from './validateQueryPaths.js'\n\ntype Args = {\n collectionConfig?: SanitizedCollectionConfig\n errors: { path: string }[]\n fields: Field[]\n globalConfig?: SanitizedGlobalConfig\n operator: string\n overrideAccess: boolean\n path: string\n policies: EntityPolicies\n req: PayloadRequest\n val: unknown\n versionFields?: Field[]\n}\n\n/**\n * Validate the Payload key / value / operator\n */\nexport async function validateSearchParam({\n collectionConfig,\n errors,\n fields,\n globalConfig,\n operator,\n overrideAccess,\n path: incomingPath,\n policies,\n req,\n val,\n versionFields,\n}: Args): Promise<void> {\n // Replace GraphQL nested field double underscore formatting\n let sanitizedPath\n if (incomingPath === '_id') {\n sanitizedPath = 'id'\n } else {\n sanitizedPath = incomingPath.replace(/__/g, '.')\n }\n let paths: PathToQuery[] = []\n const { slug } = collectionConfig || globalConfig\n\n if (globalConfig && !policies.globals[slug]) {\n // eslint-disable-next-line no-param-reassign\n globalConfig.fields = fields\n\n // eslint-disable-next-line no-param-reassign\n policies.globals[slug] = await getEntityPolicies({\n type: 'global',\n entity: globalConfig,\n operations: ['read'],\n req,\n })\n }\n\n if (sanitizedPath !== 'id') {\n paths = await getLocalizedPaths({\n collectionSlug: collectionConfig?.slug,\n fields,\n globalSlug: globalConfig?.slug,\n incomingPath: sanitizedPath,\n locale: req.locale,\n overrideAccess,\n payload: req.payload,\n })\n }\n const promises = []\n promises.push(\n ...paths.map(async ({ collectionSlug, field, invalid, path }, i) => {\n if (invalid) {\n errors.push({ path })\n return\n }\n\n if (!overrideAccess && fieldAffectsData(field)) {\n if (collectionSlug) {\n if (!policies.collections[collectionSlug]) {\n // eslint-disable-next-line no-param-reassign\n policies.collections[collectionSlug] = await getEntityPolicies({\n type: 'collection',\n entity: req.payload.collections[collectionSlug].config,\n operations: ['read'],\n req: isolateObjectProperty(req, 'transactionID'),\n })\n }\n\n if (\n ['hash', 'salt'].includes(incomingPath) &&\n collectionConfig.auth &&\n !collectionConfig.auth?.disableLocalStrategy\n ) {\n errors.push({ path: incomingPath })\n }\n }\n let fieldPath = path\n // remove locale from end of path\n if (path.endsWith(`.${req.locale}`)) {\n fieldPath = path.slice(0, -(req.locale.length + 1))\n }\n // remove \".value\" from ends of polymorphic relationship paths\n if (field.type === 'relationship' && Array.isArray(field.relationTo)) {\n fieldPath = fieldPath.replace('.value', '')\n }\n const entityType: 'collections' | 'globals' = globalConfig ? 'globals' : 'collections'\n const entitySlug = collectionSlug || globalConfig.slug\n const segments = fieldPath.split('.')\n\n let fieldAccess\n if (versionFields) {\n fieldAccess = policies[entityType][entitySlug]\n if (segments[0] === 'parent' || segments[0] === 'version') {\n segments.shift()\n }\n } else {\n fieldAccess = policies[entityType][entitySlug].fields\n }\n\n segments.forEach((segment) => {\n if (fieldAccess[segment]) {\n if ('fields' in fieldAccess[segment]) {\n fieldAccess = fieldAccess[segment].fields\n } else if ('blocks' in fieldAccess[segment]) {\n fieldAccess = fieldAccess[segment]\n } else {\n fieldAccess = fieldAccess[segment]\n }\n }\n })\n\n if (!fieldAccess?.read?.permission) {\n errors.push({ path: fieldPath })\n }\n }\n\n if (i > 1) {\n // Remove top collection and reverse array\n // to work backwards from top\n const pathsToQuery = paths.slice(1).reverse()\n\n pathsToQuery.forEach(\n ({ collectionSlug: pathCollectionSlug, path: subPath }, pathToQueryIndex) => {\n // On the \"deepest\" collection,\n // validate query of the relationship\n if (pathToQueryIndex === 0) {\n promises.push(\n validateQueryPaths({\n collectionConfig: req.payload.collections[pathCollectionSlug].config,\n errors,\n globalConfig: undefined,\n overrideAccess,\n policies,\n req,\n where: {\n [subPath]: {\n [operator]: val,\n },\n },\n }),\n )\n }\n },\n )\n }\n }),\n )\n await Promise.all(promises)\n}\n"],"names":["fieldAffectsData","getEntityPolicies","isolateObjectProperty","getLocalizedPaths","validateQueryPaths","validateSearchParam","collectionConfig","errors","fields","globalConfig","operator","overrideAccess","path","incomingPath","policies","req","val","versionFields","sanitizedPath","replace","paths","slug","globals","type","entity","operations","collectionSlug","globalSlug","locale","payload","promises","push","map","field","invalid","i","collections","config","includes","auth","disableLocalStrategy","fieldPath","endsWith","slice","length","Array","isArray","relationTo","entityType","entitySlug","segments","split","fieldAccess","shift","forEach","segment","read","permission","pathsToQuery","reverse","pathCollectionSlug","subPath","pathToQueryIndex","undefined","where","Promise","all"],"mappings":"AAMA,SAASA,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,OAAOC,2BAA2B,2CAA0C;AAC5E,SAASC,iBAAiB,QAAQ,0BAAyB;AAC3D,SAASC,kBAAkB,QAAQ,0BAAyB;AAgB5D;;CAEC,GACD,OAAO,eAAeC,oBAAoB,EACxCC,gBAAgB,EAChBC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,QAAQ,EACRC,cAAc,EACdC,MAAMC,YAAY,EAClBC,QAAQ,EACRC,GAAG,EACHC,GAAG,EACHC,aAAa,EACR;IACL,4DAA4D;IAC5D,IAAIC;IACJ,IAAIL,iBAAiB,OAAO;QAC1BK,gBAAgB;IAClB,OAAO;QACLA,gBAAgBL,aAAaM,OAAO,CAAC,OAAO;IAC9C;IACA,IAAIC,QAAuB,EAAE;IAC7B,MAAM,EAAEC,IAAI,EAAE,GAAGf,oBAAoBG;IAErC,IAAIA,gBAAgB,CAACK,SAASQ,OAAO,CAACD,KAAK,EAAE;QAC3C,6CAA6C;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B,CAAC,EAAE5B,gBAAgBkC,kBAAkB,EAAEhD,MAAMiD,OAAO,EAAE,EAAEC;gBACtD,+BAA+B;gBAC/B,qCAAqC;gBACrC,IAAIA,qBAAqB,GAAG;oBAC1BhC,SAASC,IAAI,CACX3B,mBAAmB;wBACjBE,kBAAkBS,IAAIc,OAAO,CAACO,WAAW,CAACwB,mBAAmB,CAACvB,MAAM;wBACpE9B;wBACAE,cAAcsD;wBACdpD;wBACAG;wBACAC;wBACAiD,OAAO;4BACL,CAACH,QAAQ,EAAE;gCACT,CAACnD,SAAS,EAAEM;4BACd;wBACF;oBACF;gBAEJ;YACF;QAEJ;IACF;IAEF,MAAMiD,QAAQC,GAAG,CAACpC;AACpB"}
|
package/dist/exports/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { CollapsedPreferences, DocumentPreferences, FieldsPreferences, Insi
|
|
|
7
7
|
export type { ClientCollectionConfig } from './../collections/config/client.js';
|
|
8
8
|
export type { AfterChangeHook as CollectionAfterChangeHook, AfterDeleteHook as CollectionAfterDeleteHook, AfterErrorHook as CollectionAfterErrorHook, AfterForgotPasswordHook as CollectionAfterForgotPasswordHook, AfterLoginHook as CollectionAfterLoginHook, AfterOperationHook as CollectionAfterOperationHook, AfterReadHook as CollectionAfterReadHook, BeforeChangeHook as CollectionBeforeChangeHook, BeforeDeleteHook as CollectionBeforeDeleteHook, BeforeLoginHook as CollectionBeforeLoginHook, BeforeOperationHook as CollectionBeforeOperationHook, BeforeReadHook as CollectionBeforeReadHook, BeforeValidateHook as CollectionBeforeValidateHook, Collection, CollectionConfig, SanitizedCollectionConfig, TypeWithID, TypeWithTimestamps, } from './../collections/config/types.js';
|
|
9
9
|
export type { ClientConfig } from './../config/client.js';
|
|
10
|
-
export type { Access, AccessArgs, EditViewComponent, SanitizedConfig } from './../config/types.js';
|
|
10
|
+
export type { Access, AccessArgs, EditViewComponent, EntityDescription, EntityDescriptionComponent, EntityDescriptionFunction, SanitizedConfig, } from './../config/types.js';
|
|
11
11
|
export type { ClientFieldConfig } from './../fields/config/client.js';
|
|
12
12
|
export type { ArrayField, Block, BlockField, CheckboxField, ClientValidate, CodeField, CollapsibleField, Condition, DateField, EmailField, Field, FieldAccess, FieldAffectingData, FieldBase, FieldHook, FieldHookArgs, FieldPresentationalOnly, FieldWithMany, FieldWithMaxDepth, FieldWithPath, FieldWithSubFields, FilterOptions, FilterOptionsProps, GroupField, HookName, JSONField, Labels, NamedTab, NonPresentationalField, NumberField, Option, OptionObject, PointField, PolymorphicRelationshipField, RadioField, RelationshipField, RelationshipValue, RichTextField, RowAdmin, RowField, SelectField, SingleRelationshipField, Tab, TabAsField, TabsAdmin, TabsField, TextField, TextareaField, UIField, UnnamedTab, UploadField, Validate, ValidateOptions, ValueWithRelation, } from './../fields/config/types.js';
|
|
13
13
|
export { fieldAffectsData, fieldHasMaxDepth, fieldHasSubFields, fieldIsArrayType, fieldIsBlockType, fieldIsGroupType, fieldIsLocalized, fieldIsPresentationalOnly, fieldSupportsMany, optionIsObject, optionIsValue, optionsAreObjects, tabHasName, valueIsValueWithRelation, } from './../fields/config/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,qBAAqB,CAAA;AAExC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAEhC,YAAY,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE/E,YAAY,EACV,eAAe,IAAI,yBAAyB,EAC5C,eA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,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,wBAAwB,GACzB,MAAM,6BAA6B,CAAA;AAEpC,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEvE,YAAY,EACV,eAAe,IAAI,qBAAqB,EACxC,aAAa,IAAI,mBAAmB,EACpC,gBAAgB,IAAI,sBAAsB,EAC1C,cAAc,IAAI,oBAAoB,EACtC,kBAAkB,IAAI,wBAAwB,EAC9C,YAAY,EACZ,qBAAqB,GACtB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export * from './../types/index.js'\nexport type * from '../admin/types.js'\nexport type * from '../uploads/types.js'\n\nexport type { DocumentPermissions, FieldPermissions } from '../auth/index.js'\nexport type { MeOperationResult } from '../auth/operations/me.js'\n\nexport type {\n CollapsedPreferences,\n DocumentPreferences,\n FieldsPreferences,\n InsideFieldsPreferences,\n PreferenceRequest,\n PreferenceUpdateRequest,\n TabsPreferences,\n} from '../preferences/types.js'\n\nexport type { ClientCollectionConfig } from './../collections/config/client.js'\n\nexport type {\n AfterChangeHook as CollectionAfterChangeHook,\n AfterDeleteHook as CollectionAfterDeleteHook,\n AfterErrorHook as CollectionAfterErrorHook,\n AfterForgotPasswordHook as CollectionAfterForgotPasswordHook,\n AfterLoginHook as CollectionAfterLoginHook,\n AfterOperationHook as CollectionAfterOperationHook,\n AfterReadHook as CollectionAfterReadHook,\n BeforeChangeHook as CollectionBeforeChangeHook,\n BeforeDeleteHook as CollectionBeforeDeleteHook,\n BeforeLoginHook as CollectionBeforeLoginHook,\n BeforeOperationHook as CollectionBeforeOperationHook,\n BeforeReadHook as CollectionBeforeReadHook,\n BeforeValidateHook as CollectionBeforeValidateHook,\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n TypeWithID,\n TypeWithTimestamps,\n} from './../collections/config/types.js'\n\nexport type { ClientConfig } from './../config/client.js'\nexport type {
|
|
1
|
+
{"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export * from './../types/index.js'\nexport type * from '../admin/types.js'\nexport type * from '../uploads/types.js'\n\nexport type { DocumentPermissions, FieldPermissions } from '../auth/index.js'\nexport type { MeOperationResult } from '../auth/operations/me.js'\n\nexport type {\n CollapsedPreferences,\n DocumentPreferences,\n FieldsPreferences,\n InsideFieldsPreferences,\n PreferenceRequest,\n PreferenceUpdateRequest,\n TabsPreferences,\n} from '../preferences/types.js'\n\nexport type { ClientCollectionConfig } from './../collections/config/client.js'\n\nexport type {\n AfterChangeHook as CollectionAfterChangeHook,\n AfterDeleteHook as CollectionAfterDeleteHook,\n AfterErrorHook as CollectionAfterErrorHook,\n AfterForgotPasswordHook as CollectionAfterForgotPasswordHook,\n AfterLoginHook as CollectionAfterLoginHook,\n AfterOperationHook as CollectionAfterOperationHook,\n AfterReadHook as CollectionAfterReadHook,\n BeforeChangeHook as CollectionBeforeChangeHook,\n BeforeDeleteHook as CollectionBeforeDeleteHook,\n BeforeLoginHook as CollectionBeforeLoginHook,\n BeforeOperationHook as CollectionBeforeOperationHook,\n BeforeReadHook as CollectionBeforeReadHook,\n BeforeValidateHook as CollectionBeforeValidateHook,\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n TypeWithID,\n TypeWithTimestamps,\n} from './../collections/config/types.js'\n\nexport type { ClientConfig } from './../config/client.js'\nexport type {\n Access,\n AccessArgs,\n EditViewComponent,\n EntityDescription,\n EntityDescriptionComponent,\n EntityDescriptionFunction,\n SanitizedConfig,\n} from './../config/types.js'\nexport type { ClientFieldConfig } from './../fields/config/client.js'\nexport type {\n ArrayField,\n Block,\n BlockField,\n CheckboxField,\n ClientValidate,\n CodeField,\n CollapsibleField,\n Condition,\n DateField,\n EmailField,\n Field,\n FieldAccess,\n FieldAffectingData,\n FieldBase,\n FieldHook,\n FieldHookArgs,\n FieldPresentationalOnly,\n FieldWithMany,\n FieldWithMaxDepth,\n FieldWithPath,\n FieldWithSubFields,\n FilterOptions,\n FilterOptionsProps,\n GroupField,\n HookName,\n JSONField,\n Labels,\n NamedTab,\n NonPresentationalField,\n NumberField,\n Option,\n OptionObject,\n PointField,\n PolymorphicRelationshipField,\n RadioField,\n RelationshipField,\n RelationshipValue,\n RichTextField,\n RowAdmin,\n RowField,\n SelectField,\n SingleRelationshipField,\n Tab,\n TabAsField,\n TabsAdmin,\n TabsField,\n TextField,\n TextareaField,\n UIField,\n UnnamedTab,\n UploadField,\n Validate,\n ValidateOptions,\n ValueWithRelation,\n} from './../fields/config/types.js'\n\nexport {\n fieldAffectsData,\n fieldHasMaxDepth,\n fieldHasSubFields,\n fieldIsArrayType,\n fieldIsBlockType,\n fieldIsGroupType,\n fieldIsLocalized,\n fieldIsPresentationalOnly,\n fieldSupportsMany,\n optionIsObject,\n optionIsValue,\n optionsAreObjects,\n tabHasName,\n valueIsValueWithRelation,\n} from './../fields/config/types.js'\n\nexport type { ClientGlobalConfig } from './../globals/config/client.js'\n\nexport type {\n AfterChangeHook as GlobalAfterChangeHook,\n AfterReadHook as GlobalAfterReadHook,\n BeforeChangeHook as GlobalBeforeChangeHook,\n BeforeReadHook as GlobalBeforeReadHook,\n BeforeValidateHook as GlobalBeforeValidateHook,\n GlobalConfig,\n SanitizedGlobalConfig,\n} from './../globals/config/types.js'\n\nexport { validOperators } from './../types/constants.js'\n"],"names":["fieldAffectsData","fieldHasMaxDepth","fieldHasSubFields","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","fieldIsLocalized","fieldIsPresentationalOnly","fieldSupportsMany","optionIsObject","optionIsValue","optionsAreObjects","tabHasName","valueIsValueWithRelation","validOperators"],"mappings":"AAAA,cAAc,sBAAqB;AA4GnC,SACEA,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,yBAAyB,EACzBC,iBAAiB,EACjBC,cAAc,EACdC,aAAa,EACbC,iBAAiB,EACjBC,UAAU,EACVC,wBAAwB,QACnB,8BAA6B;AAcpC,SAASC,cAAc,QAAQ,0BAAyB"}
|
|
@@ -21,6 +21,7 @@ export { default as getUniqueListBy } from '../utilities/getUniqueListBy.js';
|
|
|
21
21
|
export { isEntityHidden } from '../utilities/isEntityHidden.js';
|
|
22
22
|
export { isNumber } from '../utilities/isNumber.js';
|
|
23
23
|
export { isPlainObject } from '../utilities/isPlainObject.js';
|
|
24
|
+
export { isPlainFunction, isReactComponent } from '../utilities/isReactComponent.js';
|
|
24
25
|
export { isValidID } from '../utilities/isValidID.js';
|
|
25
26
|
export { default as isolateObjectProperty } from '../utilities/isolateObjectProperty.js';
|
|
26
27
|
export { mapAsync } from '../utilities/mapAsync.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/exports/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAClF,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,6CAA6C,CAAA;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,8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C,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qCAAqC,CAAA"}
|
|
@@ -21,6 +21,7 @@ export { default as getUniqueListBy } from '../utilities/getUniqueListBy.js';
|
|
|
21
21
|
export { isEntityHidden } from '../utilities/isEntityHidden.js';
|
|
22
22
|
export { isNumber } from '../utilities/isNumber.js';
|
|
23
23
|
export { isPlainObject } from '../utilities/isPlainObject.js';
|
|
24
|
+
export { isPlainFunction, isReactComponent } from '../utilities/isReactComponent.js';
|
|
24
25
|
export { isValidID } from '../utilities/isValidID.js';
|
|
25
26
|
export { default as isolateObjectProperty } from '../utilities/isolateObjectProperty.js';
|
|
26
27
|
export { mapAsync } from '../utilities/mapAsync.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/utilities.ts"],"sourcesContent":["export { getDataLoader } from '../collections/dataloader.js'\nexport { default as getDefaultValue } from '../fields/getDefaultValue.js'\nexport { promise as afterReadPromise } from '../fields/hooks/afterRead/promise.js'\nexport { traverseFields as afterReadTraverseFields } from '../fields/hooks/afterRead/traverseFields.js'\nexport { extractTranslations } from '../translations/extractTranslations.js'\n\nexport { formatFilesize } from '../uploads/formatFilesize.js'\n\nexport { default as isImage } from '../uploads/isImage.js'\n\nexport { combineMerge } from '../utilities/combineMerge.js'\nexport {\n configToJSONSchema,\n entityToJSONSchema,\n fieldsToJSONSchema,\n withNullableJSONSchemaType,\n} from '../utilities/configToJSONSchema.js'\nexport { createArrayFromCommaDelineated } from '../utilities/createArrayFromCommaDelineated.js'\nexport { createLocalReq } from '../utilities/createLocalReq.js'\nexport { deepCopyObject } from '../utilities/deepCopyObject.js'\nexport { deepMerge } from '../utilities/deepMerge.js'\n\nexport { fieldSchemaToJSON } from '../utilities/fieldSchemaToJSON.js'\nexport { default as flattenTopLevelFields } from '../utilities/flattenTopLevelFields.js'\n\nexport { formatLabels, formatNames, toWords } from '../utilities/formatLabels.js'\n\nexport { getCollectionIDFieldTypes } from '../utilities/getCollectionIDFieldTypes.js'\nexport { getIDType } from '../utilities/getIDType.js'\nexport { getObjectDotNotation } from '../utilities/getObjectDotNotation.js'\nexport { default as getUniqueListBy } from '../utilities/getUniqueListBy.js'\nexport { isEntityHidden } from '../utilities/isEntityHidden.js'\n\nexport { isNumber } from '../utilities/isNumber.js'\n\nexport { isPlainObject } from '../utilities/isPlainObject.js'\n\nexport { isValidID } from '../utilities/isValidID.js'\nexport { default as isolateObjectProperty } from '../utilities/isolateObjectProperty.js'\nexport { mapAsync } from '../utilities/mapAsync.js'\n\nexport { mergeListSearchAndWhere } from '../utilities/mergeListSearchAndWhere.js'\nexport { setsAreEqual } from '../utilities/setsAreEqual.js'\nexport { default as toKebabCase } from '../utilities/toKebabCase.js'\nexport { wait } from '../utilities/wait.js'\nexport { default as wordBoundariesRegex } from '../utilities/wordBoundariesRegex.js'\n"],"names":["getDataLoader","default","getDefaultValue","promise","afterReadPromise","traverseFields","afterReadTraverseFields","extractTranslations","formatFilesize","isImage","combineMerge","configToJSONSchema","entityToJSONSchema","fieldsToJSONSchema","withNullableJSONSchemaType","createArrayFromCommaDelineated","createLocalReq","deepCopyObject","deepMerge","fieldSchemaToJSON","flattenTopLevelFields","formatLabels","formatNames","toWords","getCollectionIDFieldTypes","getIDType","getObjectDotNotation","getUniqueListBy","isEntityHidden","isNumber","isPlainObject","isValidID","isolateObjectProperty","mapAsync","mergeListSearchAndWhere","setsAreEqual","toKebabCase","wait","wordBoundariesRegex"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,WAAWC,eAAe,QAAQ,+BAA8B;AACzE,SAASC,WAAWC,gBAAgB,QAAQ,uCAAsC;AAClF,SAASC,kBAAkBC,uBAAuB,QAAQ,8CAA6C;AACvG,SAASC,mBAAmB,QAAQ,yCAAwC;AAE5E,SAASC,cAAc,QAAQ,+BAA8B;AAE7D,SAASP,WAAWQ,OAAO,QAAQ,wBAAuB;AAE1D,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,kBAAkB,EAClBC,0BAA0B,QACrB,qCAAoC;AAC3C,SAASC,8BAA8B,QAAQ,iDAAgD;AAC/F,SAASC,cAAc,QAAQ,iCAAgC;AAC/D,SAASC,cAAc,QAAQ,iCAAgC;AAC/D,SAASC,SAAS,QAAQ,4BAA2B;AAErD,SAASC,iBAAiB,QAAQ,oCAAmC;AACrE,SAASlB,WAAWmB,qBAAqB,QAAQ,wCAAuC;AAExF,SAASC,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,+BAA8B;AAEjF,SAASC,yBAAyB,QAAQ,4CAA2C;AACrF,SAASC,SAAS,QAAQ,4BAA2B;AACrD,SAASC,oBAAoB,QAAQ,uCAAsC;AAC3E,SAASzB,WAAW0B,eAAe,QAAQ,kCAAiC;AAC5E,SAASC,cAAc,QAAQ,iCAAgC;AAE/D,SAASC,QAAQ,QAAQ,2BAA0B;AAEnD,SAASC,aAAa,QAAQ,gCAA+B;
|
|
1
|
+
{"version":3,"sources":["../../src/exports/utilities.ts"],"sourcesContent":["export { getDataLoader } from '../collections/dataloader.js'\nexport { default as getDefaultValue } from '../fields/getDefaultValue.js'\nexport { promise as afterReadPromise } from '../fields/hooks/afterRead/promise.js'\nexport { traverseFields as afterReadTraverseFields } from '../fields/hooks/afterRead/traverseFields.js'\nexport { extractTranslations } from '../translations/extractTranslations.js'\n\nexport { formatFilesize } from '../uploads/formatFilesize.js'\n\nexport { default as isImage } from '../uploads/isImage.js'\n\nexport { combineMerge } from '../utilities/combineMerge.js'\nexport {\n configToJSONSchema,\n entityToJSONSchema,\n fieldsToJSONSchema,\n withNullableJSONSchemaType,\n} from '../utilities/configToJSONSchema.js'\nexport { createArrayFromCommaDelineated } from '../utilities/createArrayFromCommaDelineated.js'\nexport { createLocalReq } from '../utilities/createLocalReq.js'\nexport { deepCopyObject } from '../utilities/deepCopyObject.js'\nexport { deepMerge } from '../utilities/deepMerge.js'\n\nexport { fieldSchemaToJSON } from '../utilities/fieldSchemaToJSON.js'\nexport { default as flattenTopLevelFields } from '../utilities/flattenTopLevelFields.js'\n\nexport { formatLabels, formatNames, toWords } from '../utilities/formatLabels.js'\n\nexport { getCollectionIDFieldTypes } from '../utilities/getCollectionIDFieldTypes.js'\nexport { getIDType } from '../utilities/getIDType.js'\nexport { getObjectDotNotation } from '../utilities/getObjectDotNotation.js'\nexport { default as getUniqueListBy } from '../utilities/getUniqueListBy.js'\nexport { isEntityHidden } from '../utilities/isEntityHidden.js'\n\nexport { isNumber } from '../utilities/isNumber.js'\n\nexport { isPlainObject } from '../utilities/isPlainObject.js'\nexport { isPlainFunction, isReactComponent } from '../utilities/isReactComponent.js'\n\nexport { isValidID } from '../utilities/isValidID.js'\nexport { default as isolateObjectProperty } from '../utilities/isolateObjectProperty.js'\nexport { mapAsync } from '../utilities/mapAsync.js'\n\nexport { mergeListSearchAndWhere } from '../utilities/mergeListSearchAndWhere.js'\nexport { setsAreEqual } from '../utilities/setsAreEqual.js'\nexport { default as toKebabCase } from '../utilities/toKebabCase.js'\nexport { wait } from '../utilities/wait.js'\nexport { default as wordBoundariesRegex } from '../utilities/wordBoundariesRegex.js'\n"],"names":["getDataLoader","default","getDefaultValue","promise","afterReadPromise","traverseFields","afterReadTraverseFields","extractTranslations","formatFilesize","isImage","combineMerge","configToJSONSchema","entityToJSONSchema","fieldsToJSONSchema","withNullableJSONSchemaType","createArrayFromCommaDelineated","createLocalReq","deepCopyObject","deepMerge","fieldSchemaToJSON","flattenTopLevelFields","formatLabels","formatNames","toWords","getCollectionIDFieldTypes","getIDType","getObjectDotNotation","getUniqueListBy","isEntityHidden","isNumber","isPlainObject","isPlainFunction","isReactComponent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,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SAASpC,WAAWqC,WAAW,QAAQ,8BAA6B;AACpE,SAASC,IAAI,QAAQ,uBAAsB;AAC3C,SAAStC,WAAWuC,mBAAmB,QAAQ,sCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseIDField.d.ts","sourceRoot":"","sources":["../../../src/fields/baseFields/baseIDField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"baseIDField.d.ts","sourceRoot":"","sources":["../../../src/fields/baseFields/baseIDField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAK/C,eAAO,MAAM,WAAW,EAAE,KAsBzB,CAAA"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import ObjectIdImport from 'bson-objectid';
|
|
2
2
|
const ObjectId = ObjectIdImport.default || ObjectIdImport;
|
|
3
|
-
const generateID = ({ operation, value })=>(operation !== 'create' ? value : false) || new ObjectId().toHexString();
|
|
4
3
|
export const baseIDField = {
|
|
5
4
|
name: 'id',
|
|
6
5
|
type: 'text',
|
|
7
6
|
admin: {
|
|
8
|
-
|
|
7
|
+
hidden: true
|
|
9
8
|
},
|
|
9
|
+
defaultValue: ()=>new ObjectId().toHexString(),
|
|
10
10
|
hooks: {
|
|
11
11
|
beforeChange: [
|
|
12
|
-
|
|
12
|
+
({ operation, value })=>{
|
|
13
|
+
// If creating new doc, need to disregard any
|
|
14
|
+
// ids that have been passed in because they will cause
|
|
15
|
+
// primary key unique conflicts in relational DBs
|
|
16
|
+
if (!value || operation === 'create' && value) {
|
|
17
|
+
return new ObjectId().toHexString();
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
13
21
|
]
|
|
14
22
|
},
|
|
15
23
|
label: 'ID'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/fields/baseFields/baseIDField.ts"],"sourcesContent":["import ObjectIdImport from 'bson-objectid'\n\nimport type { Field
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/baseFields/baseIDField.ts"],"sourcesContent":["import ObjectIdImport from 'bson-objectid'\n\nimport type { Field } from '../config/types.js'\n\nconst ObjectId = (ObjectIdImport.default ||\n ObjectIdImport) as unknown as typeof ObjectIdImport.default\n\nexport const baseIDField: Field = {\n name: 'id',\n type: 'text',\n admin: {\n hidden: true,\n },\n defaultValue: () => new ObjectId().toHexString(),\n hooks: {\n beforeChange: [\n ({ operation, value }) => {\n // If creating new doc, need to disregard any\n // ids that have been passed in because they will cause\n // primary key unique conflicts in relational DBs\n if (!value || (operation === 'create' && value)) {\n return new ObjectId().toHexString()\n }\n\n return value\n },\n ],\n },\n label: 'ID',\n}\n"],"names":["ObjectIdImport","ObjectId","default","baseIDField","name","type","admin","hidden","defaultValue","toHexString","hooks","beforeChange","operation","value","label"],"mappings":"AAAA,OAAOA,oBAAoB,gBAAe;AAI1C,MAAMC,WAAYD,eAAeE,OAAO,IACtCF;AAEF,OAAO,MAAMG,cAAqB;IAChCC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,QAAQ;IACV;IACAC,cAAc,IAAM,IAAIP,WAAWQ,WAAW;IAC9CC,OAAO;QACLC,cAAc;YACZ,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAE;gBACnB,6CAA6C;gBAC7C,uDAAuD;gBACvD,iDAAiD;gBACjD,IAAI,CAACA,SAAUD,cAAc,YAAYC,OAAQ;oBAC/C,OAAO,IAAIZ,WAAWQ,WAAW;gBACnC;gBAEA,OAAOI;YACT;SACD;IACH;IACAC,OAAO;AACT,EAAC"}
|
|
@@ -912,6 +912,11 @@ export declare const createClientFieldConfig: (f: Field) => {
|
|
|
912
912
|
readOnly?: boolean;
|
|
913
913
|
style?: import("react").CSSProperties;
|
|
914
914
|
width?: string;
|
|
915
|
+
} & {
|
|
916
|
+
components?: {
|
|
917
|
+
Error?: import("react").ComponentType<import("packages/payload/src/admin/types.js").ErrorProps>;
|
|
918
|
+
Label?: import("react").ComponentType<import("packages/payload/src/admin/types.js").LabelProps>;
|
|
919
|
+
};
|
|
915
920
|
};
|
|
916
921
|
custom?: Record<string, any>;
|
|
917
922
|
defaultValue?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/fields/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAEpE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC,CAAA;AAE7F,MAAM,MAAM,yBAAyB,GACjC,QAAQ,GACR,eAAe,GACf,OAAO,GACP,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC,CAAA;AAE3E,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CACrD,SAAS,CAAC,OAAO,CAAC,EAClB,YAAY,GAAG,WAAW,GAAG,aAAa,CAC3C,CAAA;AAED,eAAO,MAAM,uBAAuB,MAAO,KAAK
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/fields/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAEpE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC,CAAA;AAE7F,MAAM,MAAM,yBAAyB,GACjC,QAAQ,GACR,eAAe,GACf,OAAO,GACP,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC,CAAA;AAE3E,MAAM,MAAM,8BAA8B,GAAG,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D/C,CAAA;AAED,eAAO,MAAM,wBAAwB,WAAY,KAAK,EAAE,KAAG,KAAK,EAC3B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/fields/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAIrB,eAAO,MAAM,wBAAwB,uBAOvB,CAAA;AAEd,eAAO,MAAM,eAAe,uBAe1B,CAAA;AAEF,eAAO,MAAM,SAAS,uBA+BV,CAAA;AAEZ,eAAO,MAAM,OAAO,uBAKlB,CAAA;AAEF,eAAO,MAAM,IAAI,uBAsBf,CAAA;AAEF,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/fields/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAIrB,eAAO,MAAM,wBAAwB,uBAOvB,CAAA;AAEd,eAAO,MAAM,eAAe,uBAe1B,CAAA;AAEF,eAAO,MAAM,SAAS,uBA+BV,CAAA;AAEZ,eAAO,MAAM,OAAO,uBAKlB,CAAA;AAEF,eAAO,MAAM,IAAI,uBAsBf,CAAA;AAEF,eAAO,MAAM,MAAM,uBAgCjB,CAAA;AAEF,eAAO,MAAM,QAAQ,uBAiBnB,CAAA;AAEF,eAAO,MAAM,KAAK,uBAgBhB,CAAA;AAEF,eAAO,MAAM,IAAI,uBAYf,CAAA;AAEF,eAAO,MAAM,IAAI,uBAWf,CAAA;AAEF,eAAO,MAAM,MAAM,uBA8BjB,CAAA;AAEF,eAAO,MAAM,KAAK,uBA2BhB,CAAA;AAEF,eAAO,MAAM,GAAG,uBAId,CAAA;AAEF,eAAO,MAAM,WAAW,uBAKtB,CAAA;AAeF,eAAO,MAAM,IAAI,uBAQf,CAAA;AAEF,eAAO,MAAM,KAAK,uBAShB,CAAA;AAEF,eAAO,MAAM,KAAK,uBAyBhB,CAAA;AAEF,eAAO,MAAM,MAAM,uBAajB,CAAA;AAEF,eAAO,MAAM,QAAQ,uBAYnB,CAAA;AAEF,eAAO,MAAM,KAAK,uBAYhB,CAAA;AAEF,eAAO,MAAM,YAAY,uBA+BvB,CAAA;AAEF,eAAO,MAAM,MAAM,uBAsCjB,CAAA;AAEF,eAAO,MAAM,QAAQ,uBAqBnB,CAAA;AAEF,eAAO,MAAM,IAAI,uBAyBf,CAAA;AAEF,eAAO,MAAM,EAAE,uBAoBb,CAAA;AAEF,QAAA,MAAM,WAAW,6BAyBH,CAAA;AAEd,eAAe,WAAW,CAAA"}
|
|
@@ -102,7 +102,10 @@ export const number = baseField.keys({
|
|
|
102
102
|
placeholder: joi.string(),
|
|
103
103
|
step: joi.number()
|
|
104
104
|
}),
|
|
105
|
-
defaultValue: joi.alternatives().try(joi.number(), joi.func()),
|
|
105
|
+
defaultValue: joi.alternatives().try(joi.number(), joi.func(), joi.array().when('hasMany', {
|
|
106
|
+
not: true,
|
|
107
|
+
then: joi.forbidden()
|
|
108
|
+
})),
|
|
106
109
|
hasMany: joi.boolean().default(false),
|
|
107
110
|
max: joi.number(),
|
|
108
111
|
maxRows: joi.number().when('hasMany', {
|
|
@@ -404,7 +407,12 @@ export const blocks = baseField.keys({
|
|
|
404
407
|
export const richText = baseField.keys({
|
|
405
408
|
name: joi.string().required(),
|
|
406
409
|
type: joi.string().valid('richText').required(),
|
|
407
|
-
admin: baseAdminFields.
|
|
410
|
+
admin: baseAdminFields.keys({
|
|
411
|
+
components: baseAdminComponentFields.keys({
|
|
412
|
+
Error: componentSchema,
|
|
413
|
+
Label: componentSchema
|
|
414
|
+
})
|
|
415
|
+
}),
|
|
408
416
|
defaultValue: joi.alternatives().try(joi.array().items(joi.object()), joi.func(), joi.object()),
|
|
409
417
|
editor: joi.object().keys({
|
|
410
418
|
CellComponent: componentSchema.optional(),
|