payload 3.0.0-beta.32 → 3.0.0-beta.33

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.
Files changed (43) hide show
  1. package/dist/bin/loader/ignores.d.ts +2 -0
  2. package/dist/bin/loader/ignores.d.ts.map +1 -0
  3. package/dist/bin/loader/ignores.js +5 -0
  4. package/dist/bin/loader/ignores.js.map +1 -0
  5. package/dist/bin/loader/index.d.ts.map +1 -1
  6. package/dist/bin/loader/index.js +10 -6
  7. package/dist/bin/loader/index.js.map +1 -1
  8. package/dist/collections/config/client.d.ts +21 -0
  9. package/dist/collections/config/client.d.ts.map +1 -1
  10. package/dist/collections/config/schema.d.ts.map +1 -1
  11. package/dist/collections/config/schema.js +5 -1
  12. package/dist/collections/config/schema.js.map +1 -1
  13. package/dist/collections/config/types.d.ts +5 -1
  14. package/dist/collections/config/types.d.ts.map +1 -1
  15. package/dist/collections/config/types.js.map +1 -1
  16. package/dist/config/defaults.d.ts.map +1 -1
  17. package/dist/config/defaults.js +1 -0
  18. package/dist/config/defaults.js.map +1 -1
  19. package/dist/config/schema.d.ts.map +1 -1
  20. package/dist/config/schema.js +5 -2
  21. package/dist/config/schema.js.map +1 -1
  22. package/dist/config/shared/openGraphSchema.d.ts +3 -0
  23. package/dist/config/shared/openGraphSchema.d.ts.map +1 -0
  24. package/dist/config/shared/openGraphSchema.js +16 -0
  25. package/dist/config/shared/openGraphSchema.js.map +1 -0
  26. package/dist/config/types.d.ts +69 -21
  27. package/dist/config/types.d.ts.map +1 -1
  28. package/dist/config/types.js.map +1 -1
  29. package/dist/globals/config/schema.d.ts.map +1 -1
  30. package/dist/globals/config/schema.js +5 -0
  31. package/dist/globals/config/schema.js.map +1 -1
  32. package/dist/globals/config/types.d.ts +5 -1
  33. package/dist/globals/config/types.d.ts.map +1 -1
  34. package/dist/globals/config/types.js.map +1 -1
  35. package/dist/uploads/getExternalFile.js +1 -1
  36. package/dist/uploads/getExternalFile.js.map +1 -1
  37. package/dist/uploads/types.d.ts +0 -3
  38. package/dist/uploads/types.d.ts.map +1 -1
  39. package/dist/uploads/types.js.map +1 -1
  40. package/dist/utilities/isReactComponent.d.ts.map +1 -1
  41. package/dist/utilities/isReactComponent.js +23 -4
  42. package/dist/utilities/isReactComponent.js.map +1 -1
  43. package/package.json +3 -7
@@ -2,7 +2,6 @@
2
2
  import type { DefaultTranslationsObject, I18nClient, I18nOptions, TFunction } from '@payloadcms/translations';
3
3
  import type { Options as ExpressFileUploadOptions } from 'express-fileupload';
4
4
  import type GraphQL from 'graphql';
5
- import type { Metadata as NextMetadata } from 'next';
6
5
  import type { DestinationStream, LoggerOptions } from 'pino';
7
6
  import type React from 'react';
8
7
  import type { default as sharp } from 'sharp';
@@ -53,6 +52,73 @@ export type LivePreviewConfig = {
53
52
  payload: Payload;
54
53
  }) => Promise<string> | string) | string;
55
54
  };
55
+ export type OGImageConfig = {
56
+ alt?: string;
57
+ height?: number | string;
58
+ type?: string;
59
+ url: string;
60
+ width?: number | string;
61
+ };
62
+ export type OpenGraphConfig = {
63
+ description?: string;
64
+ images?: OGImageConfig | OGImageConfig[];
65
+ siteName?: string;
66
+ title?: string;
67
+ };
68
+ export type IconConfig = {
69
+ color?: string;
70
+ /**
71
+ * @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority
72
+ */
73
+ fetchPriority?: 'auto' | 'high' | 'low';
74
+ media?: string;
75
+ /** defaults to rel="icon" */
76
+ rel?: string;
77
+ sizes?: string;
78
+ type?: string;
79
+ url: string;
80
+ };
81
+ export type MetaConfig = {
82
+ /**
83
+ * When `static`, a pre-made image will be used for all pages.
84
+ * When `dynamic`, a unique image will be generated for each page based on page content and given overrides.
85
+ * When `off`, no Open Graph images will be generated and the `/api/og` endpoint will be disabled. You can still provide custom images using the `openGraph.images` property.
86
+ * @default 'dynamic'
87
+ */
88
+ defaultOGImageType?: 'dynamic' | 'off' | 'static';
89
+ /**
90
+ * Overrides the auto-generated <meta name="description"> of admin pages
91
+ * @example `"This is my custom CMS built with Payload."`
92
+ */
93
+ description?: string;
94
+ /**
95
+ * Icons to be rendered by devices and browsers.
96
+ *
97
+ * For example browser tabs, phone home screens, and search engine results.
98
+ */
99
+ icons?: IconConfig;
100
+ /**
101
+ * Overrides the auto-generated <meta name="keywords"> of admin pages
102
+ * @example `"CMS, Payload, Custom"`
103
+ */
104
+ keywords?: string;
105
+ /**
106
+ * Metadata to be rendered as `og` meta tags in the head of the Admin Panel.
107
+ *
108
+ * For example when sharing the Admin Panel on social media or through messaging services.
109
+ */
110
+ openGraph?: OpenGraphConfig;
111
+ /**
112
+ * Overrides the auto-generated <title> of admin pages
113
+ * @example `"My Admin Panel"`
114
+ */
115
+ title?: string;
116
+ /**
117
+ * String to append to the auto-generated <title> of admin pages
118
+ * @example `" - Custom CMS"`
119
+ */
120
+ titleSuffix?: string;
121
+ };
56
122
  export type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>;
57
123
  type GeneratePreviewURLOptions = {
58
124
  locale: string;
@@ -208,6 +274,7 @@ export type EditViewConfig = {
208
274
  */
209
275
  export type EditView = EditViewComponent | EditViewConfig;
210
276
  export type ServerProps = {
277
+ [key: string]: unknown;
211
278
  i18n: I18nClient;
212
279
  locale?: Locale;
213
280
  params?: {
@@ -392,26 +459,7 @@ export type Config = {
392
459
  globals?: string[];
393
460
  };
394
461
  /** Base meta data to use for the Admin Panel. Included properties are titleSuffix, ogImage, and favicon. */
395
- meta?: {
396
- /**
397
- * An array of Next.js metadata objects that represent icons to be used by devices and browsers.
398
- *
399
- * For example browser tabs, phone home screens, and search engine results.
400
- * @reference https://nextjs.org/docs/app/api-reference/functions/generate-metadata#icons
401
- */
402
- icons?: NextMetadata['icons'];
403
- /**
404
- * Public path to an image
405
- *
406
- * This image may be displayed as preview when the link is shared on social media
407
- */
408
- ogImage?: string;
409
- /**
410
- * String to append to the <title> of admin pages
411
- * @example `" - My Brand"`
412
- */
413
- titleSuffix?: string;
414
- };
462
+ meta?: MetaConfig;
415
463
  routes?: {
416
464
  /** The route for the account page. */
417
465
  account?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,UAAU,EACV,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,MAAM,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAC9F,O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B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;AAE3F,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n DefaultTranslationsObject,\n I18nClient,\n I18nOptions,\n TFunction,\n} from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { Metadata as NextMetadata } from 'next'\nimport type { DestinationStream, LoggerOptions } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { RichTextAdapterProvider } from '../admin/RichText.js'\nimport type { DocumentTab, RichTextAdapter } from '../admin/types.js'\nimport type { AdminView, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { Permissions } from '../auth/index.js'\nimport type {\n AfterErrorHook,\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { GeneratedTypes, Payload } from '../index.js'\nimport type { PayloadRequest, PayloadRequestWithData, 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\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 collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n payload: Payload\n }) => Promise<string> | string)\n | string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n req: PayloadRequestWithData\n token: null | string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => Promise<null | string> | null | string\n\nexport type GraphQLInfo = {\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n collections: {\n [slug: 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 * 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<TData = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: TData\n /** ID of the resource being accessed */\n id?: number | string\n /** If true, the request is for a static file */\n isReadingStaticFile?: boolean\n /** The original request that requires an access check */\n req: PayloadRequestWithData\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<TData = any> = (args: AccessArgs<TData>) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint = {\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n\n /**\n * Middleware that will be called when the path/method matches\n *\n * Compatible with Web Request/Response Model\n */\n handler: PayloadHandler\n /** HTTP method (or \"all\") */\n method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n /**\n * Pattern that should match the path of the incoming request\n *\n * Compatible with the Express router\n */\n path: string\n /**\n * Please add \"root\" routes under the /api folder in the Payload Project.\n * https://nextjs.org/docs/app/api-reference/file-conventions/route\n *\n * @deprecated in 3.0\n */\n root?: never\n}\n\nexport type EditViewComponent = 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?: CustomComponent[]\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 ServerProps = {\n i18n: I18nClient\n locale?: Locale\n params?: { [key: string]: string | string[] | undefined }\n payload: Payload\n permissions?: Permissions\n searchParams?: { [key: string]: string | string[] | undefined }\n user?: GeneratedTypes['user']\n}\n\nexport const serverProps: (keyof ServerProps)[] = [\n 'payload',\n 'i18n',\n 'locale',\n 'params',\n 'permissions',\n 'searchParams',\n 'permissions',\n]\n\nexport type CustomComponent<TAdditionalProps extends any = any> = React.ComponentType<\n TAdditionalProps & Partial<ServerProps>\n>\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 LabelFunction = ({ t }: { t: TFunction }) => string\n\nexport type SharpDependency = (\n input?:\n | ArrayBuffer\n | Buffer\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | string,\n options?: sharp.SharpOptions,\n) => sharp.Sharp\n\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 /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?: 'default' | 'gravatar' | React.ComponentType<any>\n\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/components\n */\n components?: {\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: CustomComponent[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: CustomComponent[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: CustomComponent[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: CustomComponent[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: CustomComponent[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: CustomComponent[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: CustomComponent[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: CustomComponent\n /** Replace the logo on the login page */\n Logo?: CustomComponent\n }\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: 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 /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n dateFormat?: string\n /** If set to true, the entire Admin panel will be disabled. */\n disable?: boolean\n livePreview?: LivePreviewConfig & {\n collections?: string[]\n globals?: string[]\n }\n /** Base meta data to use for the Admin Panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: {\n /**\n * An array of Next.js metadata objects that represent icons to be used by devices and browsers.\n *\n * For example browser tabs, phone home screens, and search engine results.\n * @reference https://nextjs.org/docs/app/api-reference/functions/generate-metadata#icons\n */\n icons?: NextMetadata['icons']\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 routes?: {\n /** The route for the account page. */\n account?: string\n /** The route for the create first user page. */\n createFirstUser?: string\n /** The route for the forgot password page. */\n forgot?: string\n /** The route the user will be redirected to after being inactive for too long. */\n inactivity?: string\n /** The route for the login page. */\n login?: string\n /** The route for the logout page. */\n logout?: string\n /** The route for the unauthorized page. */\n unauthorized?: string\n }\n /** The slug of a Collection that you want to be used to log in to the Admin dashboard. */\n user?: string\n }\n /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\n /**\n * Manage the datamodel of your application\n *\n * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n */\n collections?: CollectionConfig[]\n /**\n * 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. Server only. */\n custom?: Record<string, any>\n\n /** Pass in a database adapter for use on this project. */\n db: DatabaseAdapterResult\n /** Enable to expose more detailed error information. */\n debug?: boolean\n /**\n * If a user does not specify `depth` while requesting a resource, this depth will be used.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 2\n */\n defaultDepth?: number\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @default 40000\n */\n defaultMaxTextLength?: number\n /** Default richtext editor to use for richText fields */\n editor: RichTextAdapterProvider<any, any, any>\n /**\n * Email Adapter\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailAdapter | Promise<EmailAdapter>\n /** Custom REST endpoints */\n endpoints?: Endpoint[]\n /**\n * @see https://payloadcms.com/docs/configuration/globals#global-configs\n */\n globals?: GlobalConfig[]\n /**\n * Manage the GraphQL API\n *\n * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n *\n * @see https://payloadcms.com/docs/graphql/overview\n */\n graphQL?: {\n disable?: boolean\n disablePlaygroundInProduction?: boolean\n maxComplexity?: number\n /**\n * Function that returns an object containing keys to custom GraphQL mutations\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n mutations?: GraphQLExtension\n /**\n * Function that returns an object containing keys to custom GraphQL queries\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n queries?: GraphQLExtension\n /**\n * Filepath to write the generated schema to\n */\n schemaOutputFile?: string\n }\n /**\n * Tap into Payload-wide hooks.\n *\n * @see https://payloadcms.com/docs/hooks/overview\n */\n hooks?: {\n afterError?: AfterErrorHook\n }\n /** i18n config settings */\n i18n?: I18nOptions<{} | DefaultTranslationsObject> // loosen the type here to allow for custom translations\n /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n indexSortableFields?: boolean\n /**\n * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: LocalizationConfig | false\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 10\n */\n maxDepth?: number\n /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n onInit?: (payload: Payload) => Promise<void> | void\n /**\n * An array of Payload plugins.\n *\n * @see https://payloadcms.com/docs/plugins/overview\n */\n plugins?: Plugin[]\n /** Control the routing structure that Payload binds itself to. */\n routes?: {\n /** @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?:\n | {\n /**\n * @internal internal use only to allow for multiple declarations within a monorepo and suppress the \"Duplicate identifier GeneratedTypes\" error\n *\n * Adds a @ts-ignore flag above the GeneratedTypes interface declaration\n *\n * @default false\n */\n ignoreTSError?: boolean\n }\n | false\n /** 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' | 'editor' | 'endpoint' | 'globals' | 'i18n' | 'localization' | 'upload'\n> & {\n collections: SanitizedCollectionConfig[]\n /** Default richtext editor to use for richText fields */\n editor: RichTextAdapter<any, any, any>\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n i18n: Required<I18nOptions>\n localization: SanitizedLocalizationConfig | false\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n upload: ExpressFileUploadOptions & {\n /**\n * Deduped list of adapters used in the project\n */\n adapters: 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 = CustomComponent\n\nexport type EntityDescriptionFunction = ({ t }: { t: TFunction }) => string\n\nexport type EntityDescription = EntityDescriptionFunction | Record<string, string> | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"rangeMappings":";;;;;;;;","mappings":"AAyQA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
1
+ {"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n DefaultTranslationsObject,\n I18nClient,\n I18nOptions,\n TFunction,\n} from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { Metadata as NextMetadata } from 'next'\nimport type { DestinationStream, LoggerOptions } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { RichTextAdapterProvider } from '../admin/RichText.js'\nimport type { DocumentTab, RichTextAdapter } from '../admin/types.js'\nimport type { AdminView, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { Permissions } from '../auth/index.js'\nimport type {\n AfterErrorHook,\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { GeneratedTypes, Payload } from '../index.js'\nimport type { PayloadRequest, PayloadRequestWithData, 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\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 collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n payload: Payload\n }) => Promise<string> | string)\n | string\n}\n\nexport type OGImageConfig = {\n alt?: string\n height?: number | string\n type?: string\n url: string\n width?: number | string\n}\n\nexport type OpenGraphConfig = {\n description?: string\n images?: OGImageConfig | OGImageConfig[]\n siteName?: string\n title?: string\n}\n\nexport type IconConfig = {\n color?: string\n /**\n * @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority\n */\n fetchPriority?: 'auto' | 'high' | 'low'\n media?: string\n /** defaults to rel=\"icon\" */\n rel?: string\n sizes?: string\n type?: string\n url: string\n}\n\nexport type MetaConfig = {\n /**\n * When `static`, a pre-made image will be used for all pages.\n * When `dynamic`, a unique image will be generated for each page based on page content and given overrides.\n * When `off`, no Open Graph images will be generated and the `/api/og` endpoint will be disabled. You can still provide custom images using the `openGraph.images` property.\n * @default 'dynamic'\n */\n defaultOGImageType?: 'dynamic' | 'off' | 'static'\n /**\n * Overrides the auto-generated <meta name=\"description\"> of admin pages\n * @example `\"This is my custom CMS built with Payload.\"`\n */\n description?: string\n /**\n * Icons to be rendered by devices and browsers.\n *\n * For example browser tabs, phone home screens, and search engine results.\n */\n icons?: IconConfig\n /**\n * Overrides the auto-generated <meta name=\"keywords\"> of admin pages\n * @example `\"CMS, Payload, Custom\"`\n */\n keywords?: string\n /**\n * Metadata to be rendered as `og` meta tags in the head of the Admin Panel.\n *\n * For example when sharing the Admin Panel on social media or through messaging services.\n */\n openGraph?: OpenGraphConfig\n /**\n * Overrides the auto-generated <title> of admin pages\n * @example `\"My Admin Panel\"`\n */\n title?: string\n /**\n * String to append to the auto-generated <title> of admin pages\n * @example `\" - Custom CMS\"`\n */\n titleSuffix?: string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n req: PayloadRequestWithData\n token: null | string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => Promise<null | string> | null | string\n\nexport type GraphQLInfo = {\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n collections: {\n [slug: 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 * 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<TData = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: TData\n /** ID of the resource being accessed */\n id?: number | string\n /** If true, the request is for a static file */\n isReadingStaticFile?: boolean\n /** The original request that requires an access check */\n req: PayloadRequestWithData\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<TData = any> = (args: AccessArgs<TData>) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint = {\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n\n /**\n * Middleware that will be called when the path/method matches\n *\n * Compatible with Web Request/Response Model\n */\n handler: PayloadHandler\n /** HTTP method (or \"all\") */\n method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n /**\n * Pattern that should match the path of the incoming request\n *\n * Compatible with the Express router\n */\n path: string\n /**\n * Please add \"root\" routes under the /api folder in the Payload Project.\n * https://nextjs.org/docs/app/api-reference/file-conventions/route\n *\n * @deprecated in 3.0\n */\n root?: never\n}\n\nexport type EditViewComponent = 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?: CustomComponent[]\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 ServerProps = {\n [key: string]: unknown\n i18n: I18nClient\n locale?: Locale\n params?: { [key: string]: string | string[] | undefined }\n payload: Payload\n permissions?: Permissions\n searchParams?: { [key: string]: string | string[] | undefined }\n user?: GeneratedTypes['user']\n}\n\nexport const serverProps: (keyof ServerProps)[] = [\n 'payload',\n 'i18n',\n 'locale',\n 'params',\n 'permissions',\n 'searchParams',\n 'permissions',\n]\n\nexport type CustomComponent<TAdditionalProps extends any = any> = React.ComponentType<\n TAdditionalProps & Partial<ServerProps>\n>\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 LabelFunction = ({ t }: { t: TFunction }) => string\n\nexport type SharpDependency = (\n input?:\n | ArrayBuffer\n | Buffer\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | string,\n options?: sharp.SharpOptions,\n) => sharp.Sharp\n\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 /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?: 'default' | 'gravatar' | React.ComponentType<any>\n\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/components\n */\n components?: {\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: CustomComponent[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: CustomComponent[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: CustomComponent[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: CustomComponent[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: CustomComponent[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: CustomComponent[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: CustomComponent[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: CustomComponent\n /** Replace the logo on the login page */\n Logo?: CustomComponent\n }\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: 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 /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n dateFormat?: string\n /** If set to true, the entire Admin panel will be disabled. */\n disable?: boolean\n livePreview?: LivePreviewConfig & {\n collections?: string[]\n globals?: string[]\n }\n /** Base meta data to use for the Admin Panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: MetaConfig\n routes?: {\n /** The route for the account page. */\n account?: string\n /** The route for the create first user page. */\n createFirstUser?: string\n /** The route for the forgot password page. */\n forgot?: string\n /** The route the user will be redirected to after being inactive for too long. */\n inactivity?: string\n /** The route for the login page. */\n login?: string\n /** The route for the logout page. */\n logout?: string\n /** The route for the unauthorized page. */\n unauthorized?: string\n }\n /** The slug of a Collection that you want to be used to log in to the Admin dashboard. */\n user?: string\n }\n /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\n /**\n * Manage the datamodel of your application\n *\n * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n */\n collections?: CollectionConfig[]\n /**\n * 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. Server only. */\n custom?: Record<string, any>\n\n /** Pass in a database adapter for use on this project. */\n db: DatabaseAdapterResult\n /** Enable to expose more detailed error information. */\n debug?: boolean\n /**\n * If a user does not specify `depth` while requesting a resource, this depth will be used.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 2\n */\n defaultDepth?: number\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @default 40000\n */\n defaultMaxTextLength?: number\n /** Default richtext editor to use for richText fields */\n editor: RichTextAdapterProvider<any, any, any>\n /**\n * Email Adapter\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailAdapter | Promise<EmailAdapter>\n /** Custom REST endpoints */\n endpoints?: Endpoint[]\n /**\n * @see https://payloadcms.com/docs/configuration/globals#global-configs\n */\n globals?: GlobalConfig[]\n /**\n * Manage the GraphQL API\n *\n * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n *\n * @see https://payloadcms.com/docs/graphql/overview\n */\n graphQL?: {\n disable?: boolean\n disablePlaygroundInProduction?: boolean\n maxComplexity?: number\n /**\n * Function that returns an object containing keys to custom GraphQL mutations\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n mutations?: GraphQLExtension\n /**\n * Function that returns an object containing keys to custom GraphQL queries\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n queries?: GraphQLExtension\n /**\n * Filepath to write the generated schema to\n */\n schemaOutputFile?: string\n }\n /**\n * Tap into Payload-wide hooks.\n *\n * @see https://payloadcms.com/docs/hooks/overview\n */\n hooks?: {\n afterError?: AfterErrorHook\n }\n /** i18n config settings */\n i18n?: I18nOptions<{} | DefaultTranslationsObject> // loosen the type here to allow for custom translations\n /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n indexSortableFields?: boolean\n /**\n * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: LocalizationConfig | false\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 10\n */\n maxDepth?: number\n /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n onInit?: (payload: Payload) => Promise<void> | void\n /**\n * An array of Payload plugins.\n *\n * @see https://payloadcms.com/docs/plugins/overview\n */\n plugins?: Plugin[]\n /** Control the routing structure that Payload binds itself to. */\n routes?: {\n /** @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?:\n | {\n /**\n * @internal internal use only to allow for multiple declarations within a monorepo and suppress the \"Duplicate identifier GeneratedTypes\" error\n *\n * Adds a @ts-ignore flag above the GeneratedTypes interface declaration\n *\n * @default false\n */\n ignoreTSError?: boolean\n }\n | false\n /** 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' | 'editor' | 'endpoint' | 'globals' | 'i18n' | 'localization' | 'upload'\n> & {\n collections: SanitizedCollectionConfig[]\n /** Default richtext editor to use for richText fields */\n editor: RichTextAdapter<any, any, any>\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n i18n: Required<I18nOptions>\n localization: SanitizedLocalizationConfig | false\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n upload: ExpressFileUploadOptions & {\n /**\n * Deduped list of adapters used in the project\n */\n adapters: 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 = CustomComponent\n\nexport type EntityDescriptionFunction = ({ t }: { t: TFunction }) => string\n\nexport type EntityDescription = EntityDescriptionFunction | Record<string, string> | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"rangeMappings":";;;;;;;;","mappings":"AAiVA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/globals/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AASrB,QAAA,MAAM,YAAY,uBAsFN,CAAA;AAEZ,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/globals/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAUrB,QAAA,MAAM,YAAY,uBA0FN,CAAA;AAEZ,eAAe,YAAY,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import joi from 'joi';
2
2
  import { endpointsSchema } from '../../config/schema.js';
3
3
  import { componentSchema, customViewSchema, livePreviewSchema } from '../../config/shared/componentSchema.js';
4
+ import { openGraphSchema } from '../../config/shared/openGraphSchema.js';
4
5
  const globalSchema = joi.object().keys({
5
6
  slug: joi.string().required(),
6
7
  access: joi.object({
@@ -37,6 +38,10 @@ const globalSchema = joi.object().keys({
37
38
  hidden: joi.alternatives().try(joi.boolean(), joi.func()),
38
39
  hideAPIURL: joi.boolean(),
39
40
  livePreview: joi.object(livePreviewSchema),
41
+ meta: joi.object({
42
+ description: joi.string(),
43
+ openGraph: openGraphSchema
44
+ }),
40
45
  preview: joi.func()
41
46
  }),
42
47
  custom: joi.object().pattern(joi.string(), joi.any()),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/globals/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { endpointsSchema } from '../../config/schema.js'\nimport {\n componentSchema,\n customViewSchema,\n livePreviewSchema,\n} from '../../config/shared/componentSchema.js'\n\nconst globalSchema = joi\n .object()\n .keys({\n slug: joi.string().required(),\n access: joi.object({\n read: joi.func(),\n readVersions: joi.func(),\n update: joi.func(),\n }),\n admin: joi.object({\n components: joi.object({\n elements: joi.object({\n Description: componentSchema,\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n }),\n views: joi.object({\n Edit: joi.alternatives().try(\n componentSchema,\n joi.object({\n API: joi.alternatives().try(componentSchema, customViewSchema),\n Default: joi.alternatives().try(componentSchema, customViewSchema),\n Preview: joi.alternatives().try(componentSchema, customViewSchema),\n Version: joi.alternatives().try(componentSchema, customViewSchema),\n Versions: joi.alternatives().try(componentSchema, customViewSchema),\n // Relationships\n // References\n }),\n ),\n }),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n description: joi\n .alternatives()\n .try(joi.func(), joi.object().pattern(joi.string(), [joi.string()]), joi.string()),\n group: joi\n .alternatives()\n .try(joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n hidden: joi.alternatives().try(joi.boolean(), joi.func()),\n hideAPIURL: joi.boolean(),\n livePreview: joi.object(livePreviewSchema),\n preview: joi.func(),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dbName: joi.alternatives().try(joi.string(), joi.func()),\n endpoints: endpointsSchema,\n fields: joi.array(),\n graphQL: joi.alternatives().try(\n joi.object().keys({\n name: joi.string(),\n }),\n joi.boolean(),\n ),\n hooks: joi.object({\n afterChange: joi.array().items(joi.func()),\n afterRead: joi.array().items(joi.func()),\n beforeChange: joi.array().items(joi.func()),\n beforeRead: joi.array().items(joi.func()),\n beforeValidate: joi.array().items(joi.func()),\n }),\n label: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n typescript: joi.object().keys({\n interface: joi.string(),\n }),\n versions: joi.alternatives().try(\n joi.object({\n drafts: joi.alternatives().try(\n joi.object({\n autosave: joi.alternatives().try(\n joi.boolean(),\n joi.object({\n interval: joi.number(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n max: joi.number(),\n }),\n joi.boolean(),\n ),\n })\n .unknown()\n\nexport default globalSchema\n"],"names":["joi","endpointsSchema","componentSchema","customViewSchema","livePreviewSchema","globalSchema","object","keys","slug","string","required","access","read","func","readVersions","update","admin","components","elements","Description","PreviewButton","PublishButton","SaveButton","SaveDraftButton","views","Edit","alternatives","try","API","Default","Preview","Version","Versions","custom","pattern","any","description","group","hidden","boolean","hideAPIURL","livePreview","preview","dbName","endpoints","fields","array","graphQL","name","hooks","afterChange","items","afterRead","beforeChange","beforeRead","beforeValidate","label","typescript","interface","versions","drafts","autosave","interval","number","max","unknown"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SACEC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,yCAAwC;AAE/C,MAAMC,eAAeL,IAClBM,MAAM,GACNC,IAAI,CAAC;IACJC,MAAMR,IAAIS,MAAM,GAAGC,QAAQ;IAC3BC,QAAQX,IAAIM,MAAM,CAAC;QACjBM,MAAMZ,IAAIa,IAAI;QACdC,cAAcd,IAAIa,IAAI;QACtBE,QAAQf,IAAIa,IAAI;IAClB;IACAG,OAAOhB,IAAIM,MAAM,CAAC;QAChBW,YAAYjB,IAAIM,MAAM,CAAC;YACrBY,UAAUlB,IAAIM,MAAM,CAAC;gBACnBa,aAAajB;gBACbkB,eAAelB;gBACfmB,eAAenB;gBACfoB,YAAYpB;gBACZqB,iBAAiBrB;YACnB;YACAsB,OAAOxB,IAAIM,MAAM,CAAC;gBAChBmB,MAAMzB,IAAI0B,YAAY,GAAGC,GAAG,CAC1BzB,iBACAF,IAAIM,MAAM,CAAC;oBACTsB,KAAK5B,IAAI0B,YAAY,GAAGC,GAAG,CAACzB,iBAAiBC;oBAC7C0B,SAAS7B,IAAI0B,YAAY,GAAGC,GAAG,CAACzB,iBAAiBC;oBACjD2B,SAAS9B,IAAI0B,YAAY,GAAGC,GAAG,CAACzB,iBAAiBC;oBACjD4B,SAAS/B,IAAI0B,YAAY,GAAGC,GAAG,CAACzB,iBAAiBC;oBACjD6B,UAAUhC,IAAI0B,YAAY,GAAGC,GAAG,CAACzB,iBAAiBC;gBAGpD;YAEJ;QACF;QACA8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AAIa,IAAI;QACtC0C,gBAAgBvD,IAAI8C,KAAK,GAAGK,KAAK,CAACnD,IAAIa,IAAI;IAC5C;IACA2C,OAAOxD,IACJ0B,YAAY,GACZC,GAAG,CAAC3B,IAAIa,IAAI,IAAIb,IAAIS,MAAM,IAAIT,IAAIM,MAAM,GAAG4B,OAAO,CAAClC,IAAIS,MAAM,IAAI;QAACT,IAAIS,MAAM;KAAG;IAClFgD,YAAYzD,IAAIM,MAAM,GAAGC,IAAI,CAAC;QAC5BmD,WAAW1D,IAAIS,MAAM;IACvB;IACAkD,UAAU3D,IAAI0B,YAAY,GAAGC,GAAG,CAC9B3B,IAAIM,MAAM,CAAC;QACTsD,QAAQ5D,IAAI0B,YAAY,GAAGC,GAAG,CAC5B3B,IAAIM,MAAM,CAAC;YACTuD,UAAU7D,IAAI0B,YAAY,GAAGC,GAAG,CAC9B3B,IAAIuC,OAAO,IACXvC,IAAIM,MAAM,CAAC;gBACTwD,UAAU9D,IAAI+D,MAAM;YACtB;QAEJ,IACA/D,IAAIuC,OAAO;QAEbyB,KAAKhE,IAAI+D,MAAM;IACjB,IACA/D,IAAIuC,OAAO;AAEf,GACC0B,OAAO;AAEV,eAAe5D,aAAY"}
1
+ {"version":3,"sources":["../../../src/globals/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { endpointsSchema } from '../../config/schema.js'\nimport {\n componentSchema,\n customViewSchema,\n livePreviewSchema,\n} from '../../config/shared/componentSchema.js'\nimport { openGraphSchema } from '../../config/shared/openGraphSchema.js'\n\nconst globalSchema = joi\n .object()\n .keys({\n slug: joi.string().required(),\n access: joi.object({\n read: joi.func(),\n readVersions: joi.func(),\n update: joi.func(),\n }),\n admin: joi.object({\n components: joi.object({\n elements: joi.object({\n Description: componentSchema,\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n }),\n views: joi.object({\n Edit: joi.alternatives().try(\n componentSchema,\n joi.object({\n API: joi.alternatives().try(componentSchema, customViewSchema),\n Default: joi.alternatives().try(componentSchema, customViewSchema),\n Preview: joi.alternatives().try(componentSchema, customViewSchema),\n Version: joi.alternatives().try(componentSchema, customViewSchema),\n Versions: joi.alternatives().try(componentSchema, customViewSchema),\n // Relationships\n // References\n }),\n ),\n }),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n description: joi\n .alternatives()\n .try(joi.func(), joi.object().pattern(joi.string(), [joi.string()]), joi.string()),\n group: joi\n .alternatives()\n .try(joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n hidden: joi.alternatives().try(joi.boolean(), joi.func()),\n hideAPIURL: joi.boolean(),\n livePreview: joi.object(livePreviewSchema),\n meta: joi.object({\n description: joi.string(),\n openGraph: openGraphSchema,\n }),\n preview: joi.func(),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dbName: joi.alternatives().try(joi.string(), joi.func()),\n endpoints: endpointsSchema,\n fields: joi.array(),\n graphQL: joi.alternatives().try(\n joi.object().keys({\n name: joi.string(),\n }),\n joi.boolean(),\n ),\n hooks: joi.object({\n afterChange: joi.array().items(joi.func()),\n afterRead: joi.array().items(joi.func()),\n beforeChange: joi.array().items(joi.func()),\n beforeRead: joi.array().items(joi.func()),\n beforeValidate: joi.array().items(joi.func()),\n }),\n label: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n typescript: joi.object().keys({\n interface: joi.string(),\n }),\n versions: joi.alternatives().try(\n joi.object({\n drafts: joi.alternatives().try(\n joi.object({\n autosave: joi.alternatives().try(\n joi.boolean(),\n joi.object({\n interval: joi.number(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n max: joi.number(),\n }),\n joi.boolean(),\n ),\n })\n .unknown()\n\nexport default globalSchema\n"],"names":["joi","endpointsSchema","componentSchema","customViewSchema","livePreviewSchema","openGraphSchema","globalSchema","object","keys","slug","string","required","access","read","func","readVersions","update","admin","components","elements","Description","PreviewButton","PublishButton","SaveButton","SaveDraftButton","views","Edit","alternatives","try","API","Default","Preview","Version","Versions","custom","pattern","any","description","group","hidden","boolean","hideAPIURL","livePreview","meta","openGraph","preview","dbName","endpoints","fields","array","graphQL","name","hooks","afterChange","items","afterRead","beforeChange","beforeRead","beforeValidate","label","typescript","interface","versions","drafts","autosave","interval","number","max","unknown"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SACEC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,yCAAwC;AAC/C,SAASC,eAAe,QAAQ,yCAAwC;AAExE,MAAMC,eAAeN,IAClBO,MAAM,GACNC,IAAI,CAAC;IACJC,MAAMT,IAAIU,MAAM,GAAGC,QAAQ;IAC3BC,QAAQZ,IAAIO,MAAM,CAAC;QACjBM,MAAMb,IAAIc,IAAI;QACdC,cAAcf,IAAIc,IAAI;QACtBE,QAAQhB,IAAIc,IAAI;IAClB;IACAG,OAAOjB,IAAIO,MAAM,CAAC;QAChBW,YAAYlB,IAAIO,MAAM,CAAC;YACrBY,UAAUnB,IAAIO,MAAM,CAAC;gBACnBa,aAAalB;gBACbmB,eAAenB;gBACfoB,eAAepB;gBACfqB,YAAYrB;gBACZsB,iBAAiBtB;YACnB;YACAuB,OAAOzB,IAAIO,MAAM,CAAC;gBAChBmB,MAAM1B,IAAI2B,YAAY,GAAGC,GAAG,CAC1B1B,iBACAF,IAAIO,MAAM,CAAC;oBACTsB,KAAK7B,IAAI2B,YAAY,GAAGC,GAAG,CAAC1B,iBAAiBC;oBAC7C2B,SAAS9B,IAAI2B,YAAY,GAAGC,GAAG,CAAC1B,iBAAiBC;oBACjD4B,SAAS/B,IAAI2B,YAAY,GAAGC,GAAG,CAAC1B,iBAAiBC;oBACjD6B,SAAShC,IAAI2B,YAAY,GAAGC,GAAG,CAAC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AI;QACvCyC,WAAWvD,IAAIiD,KAAK,GAAGK,KAAK,CAACtD,IAAIc,IAAI;QACrC0C,cAAcxD,IAAIiD,KAAK,GAAGK,KAAK,CAACtD,IAAIc,IAAI;QACxC2C,YAAYzD,IAAIiD,KAAK,GAAGK,KAAK,CAACtD,IAAIc,IAAI;QACtC4C,gBAAgB1D,IAAIiD,KAAK,GAAGK,KAAK,CAACtD,IAAIc,IAAI;IAC5C;IACA6C,OAAO3D,IACJ2B,YAAY,GACZC,GAAG,CAAC5B,IAAIc,IAAI,IAAId,IAAIU,MAAM,IAAIV,IAAIO,MAAM,GAAG4B,OAAO,CAACnC,IAAIU,MAAM,IAAI;QAACV,IAAIU,MAAM;KAAG;IAClFkD,YAAY5D,IAAIO,MAAM,GAAGC,IAAI,CAAC;QAC5BqD,WAAW7D,IAAIU,MAAM;IACvB;IACAoD,UAAU9D,IAAI2B,YAAY,GAAGC,GAAG,CAC9B5B,IAAIO,MAAM,CAAC;QACTwD,QAAQ/D,IAAI2B,YAAY,GAAGC,GAAG,CAC5B5B,IAAIO,MAAM,CAAC;YACTyD,UAAUhE,IAAI2B,YAAY,GAAGC,GAAG,CAC9B5B,IAAIwC,OAAO,IACXxC,IAAIO,MAAM,CAAC;gBACT0D,UAAUjE,IAAIkE,MAAM;YACtB;QAEJ,IACAlE,IAAIwC,OAAO;QAEb2B,KAAKnE,IAAIkE,MAAM;IACjB,IACAlE,IAAIwC,OAAO;AAEf,GACC4B,OAAO;AAEV,eAAe9D,aAAY"}
@@ -1,7 +1,7 @@
1
1
  import type { GraphQLNonNull, GraphQLObjectType } from 'graphql';
2
2
  import type { DeepRequired } from 'ts-essentials';
3
3
  import type { CustomPreviewButton, CustomPublishButton, CustomSaveButton, CustomSaveDraftButton } from '../../admin/types.js';
4
- import type { Access, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LivePreviewConfig } from '../../config/types.js';
4
+ import type { Access, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LivePreviewConfig, OpenGraphConfig } from '../../config/types.js';
5
5
  import type { DBIdentifierName } from '../../database/types.js';
6
6
  import type { Field } from '../../fields/config/types.js';
7
7
  import type { PayloadRequestWithData, RequestContext } from '../../types/index.js';
@@ -110,6 +110,10 @@ export type GlobalAdminOptions = {
110
110
  * Live preview options
111
111
  */
112
112
  livePreview?: LivePreviewConfig;
113
+ meta?: {
114
+ description?: string;
115
+ openGraph?: OpenGraphConfig;
116
+ };
113
117
  /**
114
118
  * Function to generate custom preview URL
115
119
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/globals/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAE9F,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,C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CAAA;CACV,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["import type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LivePreviewConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { PayloadRequestWithData, RequestContext } from '../../types/index.js'\nimport type { Where } from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n previousDoc: any\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n query?: Where\n req: PayloadRequestWithData\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n elements?: {\n Description?: EntityDescriptionComponent\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Place globals into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequestWithData['user'] }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\nexport type GlobalConfig = {\n access?: {\n read?: Access\n readDrafts?: Access\n readVersions?: Access\n update?: Access\n }\n admin?: GlobalAdminOptions\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n graphQL?:\n | {\n name?: string\n }\n | false\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n label?: Record<string, string> | string\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: IncomingGlobalVersions | boolean\n}\n\nexport interface SanitizedGlobalConfig\n extends Omit<DeepRequired<GlobalConfig>, 'endpoints' | 'fields' | 'versions'> {\n endpoints: Endpoint[] | false\n fields: Field[]\n versions: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"rangeMappings":"","mappings":"AA0LA,WAWC"}
1
+ {"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["import type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LivePreviewConfig,\n OpenGraphConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { PayloadRequestWithData, RequestContext } from '../../types/index.js'\nimport type { Where } from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n previousDoc: any\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n query?: Where\n req: PayloadRequestWithData\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n elements?: {\n Description?: EntityDescriptionComponent\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Place globals into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequestWithData['user'] }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: {\n description?: string\n openGraph?: OpenGraphConfig\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\nexport type GlobalConfig = {\n access?: {\n read?: Access\n readDrafts?: Access\n readVersions?: Access\n update?: Access\n }\n admin?: GlobalAdminOptions\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n graphQL?:\n | {\n name?: string\n }\n | false\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n label?: Record<string, string> | string\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: IncomingGlobalVersions | boolean\n}\n\nexport interface SanitizedGlobalConfig\n extends Omit<DeepRequired<GlobalConfig>, 'endpoints' | 'fields' | 'versions'> {\n endpoints: Endpoint[] | false\n fields: Field[]\n versions: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"rangeMappings":"","mappings":"AA+LA,WAWC"}
@@ -8,7 +8,7 @@ export const getExternalFile = async ({ data, req, uploadConfig })=>{
8
8
  fileURL = `${baseUrl}${url}`;
9
9
  }
10
10
  const headers = uploadConfig.externalFileHeaderFilter ? uploadConfig.externalFileHeaderFilter(Object.fromEntries(new Headers(req.headers))) : {
11
- cookie: req.headers.get('cookie')
11
+ cookie: req.headers?.get('cookie')
12
12
  };
13
13
  const res = await fetch(fileURL, {
14
14
  credentials: 'include',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/uploads/getExternalFile.ts"],"sourcesContent":["import type { PayloadRequestWithData } from '../types/index.js'\nimport type { File, FileData, UploadConfig } from './types.js'\n\nimport { APIError } from '../errors/index.js'\n\ntype Args = {\n data: FileData\n req: PayloadRequestWithData\n uploadConfig: UploadConfig\n}\nexport const getExternalFile = async ({ data, req, uploadConfig }: Args): Promise<File> => {\n const { filename, url } = data\n\n if (typeof url === 'string') {\n let fileURL = url\n if (!url.startsWith('http')) {\n const baseUrl = req.headers.get('origin') || `${req.protocol}://${req.headers.get('host')}`\n fileURL = `${baseUrl}${url}`\n }\n\n const headers = uploadConfig.externalFileHeaderFilter\n ? uploadConfig.externalFileHeaderFilter(Object.fromEntries(new Headers(req.headers)))\n : { cookie: req.headers.get('cookie') }\n\n const res = await fetch(fileURL, {\n credentials: 'include',\n headers,\n method: 'GET',\n })\n\n if (!res.ok) throw new APIError(`Failed to fetch file from ${fileURL}`, res.status)\n\n const data = await res.arrayBuffer()\n\n return {\n name: filename,\n data: Buffer.from(data),\n mimetype: res.headers.get('content-type') || undefined,\n size: Number(res.headers.get('content-length')) || 0,\n }\n }\n\n throw new APIError('Invalid file url', 400)\n}\n"],"names":["APIError","getExternalFile","data","req","uploadConfig","filename","url","fileURL","startsWith","baseUrl","headers","get","protocol","externalFileHeaderFilter","Object","fromEntries","Headers","cookie","res","fetch","credentials","method","ok","status","arrayBuffer","name","Buffer","from","mimetype","undefined","size","Number"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,qBAAoB;AAO7C,OAAO,MAAMC,kBAAkB,OAAO,EAAEC,IAAI,EAAEC,GAAG,EAAEC,YAAY,EAAQ;IACrE,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGJ;IAE1B,IAAI,OAAOI,QAAQ,UAAU;QAC3B,IAAIC,UAAUD;QACd,IAAI,CAACA,IAAIE,UAAU,CAAC,SAAS;YAC3B,MAAMC,UAAUN,IAAIO,OAAO,CAACC,GAAG,CAAC,aAAa,CAAC,EAAER,IAAIS,QAAQ,CAAC,GAAG,EAAET,IAAIO,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC;YAC3FJ,UAAU,CAAC,EAAEE,QAAQ,EAAEH,IAAI,CAAC;QAC9B;QAEA,MAAMI,UAAUN,aAAaS,wBAAwB,GACjDT,aAAaS,wBAAwB,CAACC,OAAOC,WAAW,CAAC,IAAIC,QAAQb,IAAIO,OAAO,MAChF;YAAEO,QAAQd,IAAIO,OAAO,CAACC,GAAG,CAAC;QAAU;QAExC,MAAMO,MAAM,MAAMC,MAAMZ,SAAS;YAC/Ba,aAAa;YACbV;YACAW,QAAQ;QACV;QAEA,IAAI,CAACH,IAAII,EAAE,EAAE,MAAM,IAAItB,SAAS,CAAC,0BAA0B,EAAEO,QAAQ,CAAC,EAAEW,IAAIK,MAAM;QAElF,MAAMrB,OAAO,MAAMgB,IAAIM,WAAW;QAElC,OAAO;YACLC,MAAMpB;YACNH,MAAMwB,OAAOC,IAAI,CAACzB;YAClB0B,UAAUV,IAAIR,OAAO,CAACC,GAAG,CAAC,mBAAmBkB;YAC7CC,MAAMC,OAAOb,IAAIR,OAAO,CAACC,GAAG,CAAC,sBAAsB;QACrD;IACF;IAEA,MAAM,IAAIX,SAAS,oBAAoB;AACzC,EAAC"}
1
+ {"version":3,"sources":["../../src/uploads/getExternalFile.ts"],"sourcesContent":["import type { PayloadRequestWithData } from '../types/index.js'\nimport type { File, FileData, UploadConfig } from './types.js'\n\nimport { APIError } from '../errors/index.js'\n\ntype Args = {\n data: FileData\n req: PayloadRequestWithData\n uploadConfig: UploadConfig\n}\nexport const getExternalFile = async ({ data, req, uploadConfig }: Args): Promise<File> => {\n const { filename, url } = data\n\n if (typeof url === 'string') {\n let fileURL = url\n if (!url.startsWith('http')) {\n const baseUrl = req.headers.get('origin') || `${req.protocol}://${req.headers.get('host')}`\n fileURL = `${baseUrl}${url}`\n }\n\n const headers = uploadConfig.externalFileHeaderFilter\n ? uploadConfig.externalFileHeaderFilter(Object.fromEntries(new Headers(req.headers)))\n : { cookie: req.headers?.get('cookie') }\n\n const res = await fetch(fileURL, {\n credentials: 'include',\n headers,\n method: 'GET',\n })\n\n if (!res.ok) throw new APIError(`Failed to fetch file from ${fileURL}`, res.status)\n\n const data = await res.arrayBuffer()\n\n return {\n name: filename,\n data: Buffer.from(data),\n mimetype: res.headers.get('content-type') || undefined,\n size: Number(res.headers.get('content-length')) || 0,\n }\n }\n\n throw new APIError('Invalid file url', 400)\n}\n"],"names":["APIError","getExternalFile","data","req","uploadConfig","filename","url","fileURL","startsWith","baseUrl","headers","get","protocol","externalFileHeaderFilter","Object","fromEntries","Headers","cookie","res","fetch","credentials","method","ok","status","arrayBuffer","name","Buffer","from","mimetype","undefined","size","Number"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,qBAAoB;AAO7C,OAAO,MAAMC,kBAAkB,OAAO,EAAEC,IAAI,EAAEC,GAAG,EAAEC,YAAY,EAAQ;IACrE,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGJ;IAE1B,IAAI,OAAOI,QAAQ,UAAU;QAC3B,IAAIC,UAAUD;QACd,IAAI,CAACA,IAAIE,UAAU,CAAC,SAAS;YAC3B,MAAMC,UAAUN,IAAIO,OAAO,CAACC,GAAG,CAAC,aAAa,CAAC,EAAER,IAAIS,QAAQ,CAAC,GAAG,EAAET,IAAIO,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC;YAC3FJ,UAAU,CAAC,EAAEE,QAAQ,EAAEH,IAAI,CAAC;QAC9B;QAEA,MAAMI,UAAUN,aAAaS,wBAAwB,GACjDT,aAAaS,wBAAwB,CAACC,OAAOC,WAAW,CAAC,IAAIC,QAAQb,IAAIO,OAAO,MAChF;YAAEO,QAAQd,IAAIO,OAAO,EAAEC,IAAI;QAAU;QAEzC,MAAMO,MAAM,MAAMC,MAAMZ,SAAS;YAC/Ba,aAAa;YACbV;YACAW,QAAQ;QACV;QAEA,IAAI,CAACH,IAAII,EAAE,EAAE,MAAM,IAAItB,SAAS,CAAC,0BAA0B,EAAEO,QAAQ,CAAC,EAAEW,IAAIK,MAAM;QAElF,MAAMrB,OAAO,MAAMgB,IAAIM,WAAW;QAElC,OAAO;YACLC,MAAMpB;YACNH,MAAMwB,OAAOC,IAAI,CAACzB;YAClB0B,UAAUV,IAAIR,OAAO,CAACC,GAAG,CAAC,mBAAmBkB;YAC7CC,MAAMC,OAAOb,IAAIR,OAAO,CAACC,GAAG,CAAC,sBAAsB;QACrD;IACF;IAEA,MAAM,IAAIX,SAAS,oBAAoB;AACzC,EAAC"}
@@ -1,6 +1,4 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
- import type express from 'express';
3
- import type serveStatic from 'serve-static';
4
2
  import type { ResizeOptions, Sharp } from 'sharp';
5
3
  import type { TypeWithID } from '../collections/config/types.js';
6
4
  import type { PayloadRequestWithData } from '../types/index.js';
@@ -97,7 +95,6 @@ export type UploadConfig = {
97
95
  mimeTypes?: string[];
98
96
  resizeOptions?: ResizeOptions;
99
97
  staticDir?: string;
100
- staticOptions?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>;
101
98
  trimOptions?: ImageUploadTrimOptions;
102
99
  };
103
100
  export type SanitizedUploadConfig = UploadConfig & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/uploads/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,WAAW,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;I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,sBAAsB,EAC3B,IAAI,EAAE;QAAE,GAAG,EAAE,UAAU,CAAC;QAAC,MAAM,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KACxE,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAA;IACpC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,sBAAsB,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type express from 'express'\nimport type serveStatic from 'serve-static'\nimport type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { PayloadRequestWithData } from '../types/index.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp toFormat() function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type ImageSize = Omit<ResizeOptions, 'withoutEnlargement'> & {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n}\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter to use for uploads.\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - If a React component, register a function that generates the thumbnail URL using the `useAdminThumbnail` hook.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n crop?: boolean\n disableLocalStorage?: boolean\n /**\n * Accepts existing headers and can filter/modify them.\n *\n * Useful for adding custom headers to fetch from external providers.\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n filesRequiredOnCreate?: boolean\n focalPoint?: boolean\n /** Options for original upload file only. For sizes, set each formatOptions individually. */\n formatOptions?: ImageUploadFormatOptions\n handlers?: ((\n req: PayloadRequestWithData,\n args: { doc: TypeWithID; params: { collection: string; filename: string } },\n ) => Promise<Response> | Response)[]\n imageSizes?: ImageSize[]\n mimeTypes?: string[]\n resizeOptions?: ResizeOptions\n staticDir?: string\n staticOptions?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>\n trimOptions?: ImageUploadTrimOptions\n}\n\nexport type SanitizedUploadConfig = UploadConfig & {\n staticDir: UploadConfig['staticDir']\n}\n\nexport type File = {\n data: Buffer\n mimetype: string\n name: string\n size: number\n}\n\nexport type FileToSave = {\n buffer: Buffer\n path: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAsHA,WAGC"}
1
+ {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { PayloadRequestWithData } from '../types/index.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp toFormat() function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type ImageSize = Omit<ResizeOptions, 'withoutEnlargement'> & {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n}\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter to use for uploads.\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - If a React component, register a function that generates the thumbnail URL using the `useAdminThumbnail` hook.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n crop?: boolean\n disableLocalStorage?: boolean\n /**\n * Accepts existing headers and can filter/modify them.\n *\n * Useful for adding custom headers to fetch from external providers.\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n filesRequiredOnCreate?: boolean\n focalPoint?: boolean\n /** Options for original upload file only. For sizes, set each formatOptions individually. */\n formatOptions?: ImageUploadFormatOptions\n handlers?: ((\n req: PayloadRequestWithData,\n args: { doc: TypeWithID; params: { collection: string; filename: string } },\n ) => Promise<Response> | Response)[]\n imageSizes?: ImageSize[]\n mimeTypes?: string[]\n resizeOptions?: ResizeOptions\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n}\n\nexport type SanitizedUploadConfig = UploadConfig & {\n staticDir: UploadConfig['staticDir']\n}\n\nexport type File = {\n data: Buffer\n mimetype: string\n name: string\n size: number\n}\n\nexport type FileToSave = {\n buffer: Buffer\n path: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAmHA,WAGC"}
@@ -1 +1 @@
1
- {"version":3,"file":"isReactComponent.d.ts","sourceRoot":"","sources":["../../src/utilities/isReactComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,wBAAgB,gCAAgC,CAAC,CAAC,SAAS,GAAG,EAC5D,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAUhB;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,GAAG,EAClD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAGhB;AAED,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,GAAG,EACtD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAEhB"}
1
+ {"version":3,"file":"isReactComponent.d.ts","sourceRoot":"","sources":["../../src/utilities/isReactComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B,wBAAgB,gCAAgC,CAAC,CAAC,SAAS,GAAG,EAC5D,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAahB;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,GAAG,EAClD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAKhB;AAED,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,GAAG,EACtD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAEhB"}
@@ -1,12 +1,31 @@
1
1
  import { isPlainObject } from './isPlainObject.js';
2
- export function isReactServerComponentOrFunction(component) {
2
+ /*
3
+ For reference: console.log output of [ClientComponent, RSC] array, tested in Turbo and Webpack (14.3.0-canary.37)
4
+
5
+ Both component functions async:
6
+
7
+ Turbo: [ [Function (anonymous)], [AsyncFunction: ExampleServer] ]
8
+ Webpack: [ {}, [AsyncFunction: ExampleServer] ]
9
+
10
+
11
+ Both component functions non-async:
12
+
13
+ Turbo: [ [Function (anonymous)], [Function: ExampleServer] ]
14
+ Webpack: [ {}, [Function: ExampleServer] ]
15
+
16
+ */ export function isReactServerComponentOrFunction(component) {
3
17
  const isClassComponent = typeof component === 'function' && component.prototype && typeof component.prototype.render === 'function';
4
18
  const isFunctionalComponent = typeof component === 'function' && (!component.prototype || !component.prototype.render);
5
- return isClassComponent || isFunctionalComponent;
19
+ // Anonymous functions are Client Components in Turbopack. RSCs should have a name
20
+ const isAnonymousFunction = typeof component === 'function' && component.name === '';
21
+ return (isClassComponent || isFunctionalComponent) && !isAnonymousFunction;
6
22
  }
7
23
  export function isReactClientComponent(component) {
8
- // Do this to test for client components (`use client` directive) bc they import as empty objects
9
- return typeof component === 'object' && !isPlainObject(component);
24
+ const isClientComponentWebpack = typeof component === 'object' && !isPlainObject(component) // In Webpack, client components are {}
25
+ ;
26
+ const isClientComponentTurbo = typeof component === 'function' && component.name === '' // Anonymous functions are Client Components in Turbopack
27
+ ;
28
+ return isClientComponentWebpack || isClientComponentTurbo;
10
29
  }
11
30
  export function isReactComponentOrFunction(component) {
12
31
  return isReactServerComponentOrFunction(component) || isReactClientComponent(component);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/isReactComponent.ts"],"sourcesContent":["import type React from 'react'\n\nimport { isPlainObject } from './isPlainObject.js'\n\nexport function isReactServerComponentOrFunction<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n const isClassComponent =\n typeof component === 'function' &&\n component.prototype &&\n typeof component.prototype.render === 'function'\n\n const isFunctionalComponent =\n typeof component === 'function' && (!component.prototype || !component.prototype.render)\n\n return isClassComponent || isFunctionalComponent\n}\n\nexport function isReactClientComponent<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n // Do this to test for client components (`use client` directive) bc they import as empty objects\n return typeof component === 'object' && !isPlainObject(component)\n}\n\nexport function isReactComponentOrFunction<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n return isReactServerComponentOrFunction(component) || isReactClientComponent(component)\n}\n"],"names":["isPlainObject","isReactServerComponentOrFunction","component","isClassComponent","prototype","render","isFunctionalComponent","isReactClientComponent","isReactComponentOrFunction"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,aAAa,QAAQ,qBAAoB;AAElD,OAAO,SAASC,iCACdC,SAAoC;IAEpC,MAAMC,mBACJ,OAAOD,cAAc,cACrBA,UAAUE,SAAS,IACnB,OAAOF,UAAUE,SAAS,CAACC,MAAM,KAAK;IAExC,MAAMC,wBACJ,OAAOJ,cAAc,cAAe,CAAA,CAACA,UAAUE,SAAS,IAAI,CAACF,UAAUE,SAAS,CAACC,MAAM,AAAD;IAExF,OAAOF,oBAAoBG;AAC7B;AAEA,OAAO,SAASC,uBACdL,SAAoC;IAEpC,iGAAiG;IACjG,OAAO,OAAOA,cAAc,YAAY,CAACF,cAAcE;AACzD;AAEA,OAAO,SAASM,2BACdN,SAAoC;IAEpC,OAAOD,iCAAiCC,cAAcK,uBAAuBL;AAC/E"}
1
+ {"version":3,"sources":["../../src/utilities/isReactComponent.ts"],"sourcesContent":["import type React from 'react'\n\nimport { isPlainObject } from './isPlainObject.js'\n\n/*\nFor reference: console.log output of [ClientComponent, RSC] array, tested in Turbo and Webpack (14.3.0-canary.37)\n\nBoth component functions async:\n\nTurbo: [ [Function (anonymous)], [AsyncFunction: ExampleServer] ]\nWebpack: [ {}, [AsyncFunction: ExampleServer] ]\n\n\nBoth component functions non-async:\n\nTurbo: [ [Function (anonymous)], [Function: ExampleServer] ]\nWebpack: [ {}, [Function: ExampleServer] ]\n\n */\n\nexport function isReactServerComponentOrFunction<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n const isClassComponent =\n typeof component === 'function' &&\n component.prototype &&\n typeof component.prototype.render === 'function'\n\n const isFunctionalComponent =\n typeof component === 'function' && (!component.prototype || !component.prototype.render)\n\n // Anonymous functions are Client Components in Turbopack. RSCs should have a name\n const isAnonymousFunction = typeof component === 'function' && component.name === ''\n\n return (isClassComponent || isFunctionalComponent) && !isAnonymousFunction\n}\n\nexport function isReactClientComponent<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n const isClientComponentWebpack = typeof component === 'object' && !isPlainObject(component) // In Webpack, client components are {}\n const isClientComponentTurbo = typeof component === 'function' && component.name === '' // Anonymous functions are Client Components in Turbopack\n\n return isClientComponentWebpack || isClientComponentTurbo\n}\n\nexport function isReactComponentOrFunction<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n return isReactServerComponentOrFunction(component) || isReactClientComponent(component)\n}\n"],"names":["isPlainObject","isReactServerComponentOrFunction","component","isClassComponent","prototype","render","isFunctionalComponent","isAnonymousFunction","name","isReactClientComponent","isClientComponentWebpack","isClientComponentTurbo","isReactComponentOrFunction"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,aAAa,QAAQ,qBAAoB;AAElD;;;;;;;;;;;;;;CAcC,GAED,OAAO,SAASC,iCACdC,SAAoC;IAEpC,MAAMC,mBACJ,OAAOD,cAAc,cACrBA,UAAUE,SAAS,IACnB,OAAOF,UAAUE,SAAS,CAACC,MAAM,KAAK;IAExC,MAAMC,wBACJ,OAAOJ,cAAc,cAAe,CAAA,CAACA,UAAUE,SAAS,IAAI,CAACF,UAAUE,SAAS,CAACC,MAAM,AAAD;IAExF,kFAAkF;IAClF,MAAME,sBAAsB,OAAOL,cAAc,cAAcA,UAAUM,IAAI,KAAK;IAElF,OAAO,AAACL,CAAAA,oBAAoBG,qBAAoB,KAAM,CAACC;AACzD;AAEA,OAAO,SAASE,uBACdP,SAAoC;IAEpC,MAAMQ,2BAA2B,OAAOR,cAAc,YAAY,CAACF,cAAcE,WAAW,uCAAuC;;IACnI,MAAMS,yBAAyB,OAAOT,cAAc,cAAcA,UAAUM,IAAI,KAAK,GAAG,yDAAyD;;IAEjJ,OAAOE,4BAA4BC;AACrC;AAEA,OAAO,SAASC,2BACdV,SAAoC;IAEpC,OAAOD,iCAAiCC,cAAcO,uBAAuBP;AAC/E"}