payload 3.57.0-internal.1d2ebbc → 3.57.0-internal.266049e

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 (70) hide show
  1. package/dist/admin/elements/Cell.d.ts +1 -0
  2. package/dist/admin/elements/Cell.d.ts.map +1 -1
  3. package/dist/admin/elements/Cell.js.map +1 -1
  4. package/dist/admin/forms/Form.d.ts +12 -0
  5. package/dist/admin/forms/Form.d.ts.map +1 -1
  6. package/dist/admin/forms/Form.js.map +1 -1
  7. package/dist/auth/crypto.d.ts.map +1 -1
  8. package/dist/auth/crypto.js +3 -11
  9. package/dist/auth/crypto.js.map +1 -1
  10. package/dist/auth/strategies/apiKey.js +2 -2
  11. package/dist/auth/strategies/apiKey.js.map +1 -1
  12. package/dist/collections/config/client.d.ts +2 -2
  13. package/dist/collections/config/client.d.ts.map +1 -1
  14. package/dist/collections/config/client.js +2 -1
  15. package/dist/collections/config/client.js.map +1 -1
  16. package/dist/collections/config/types.d.ts +22 -1
  17. package/dist/collections/config/types.d.ts.map +1 -1
  18. package/dist/collections/config/types.js.map +1 -1
  19. package/dist/config/types.d.ts +8 -4
  20. package/dist/config/types.d.ts.map +1 -1
  21. package/dist/config/types.js.map +1 -1
  22. package/dist/exports/i18n/ta.d.ts +2 -0
  23. package/dist/exports/i18n/ta.d.ts.map +1 -0
  24. package/dist/exports/i18n/ta.js +3 -0
  25. package/dist/exports/i18n/ta.js.map +1 -0
  26. package/dist/exports/shared.d.ts +1 -0
  27. package/dist/exports/shared.d.ts.map +1 -1
  28. package/dist/exports/shared.js +1 -0
  29. package/dist/exports/shared.js.map +1 -1
  30. package/dist/fields/config/sanitize.d.ts +3 -1
  31. package/dist/fields/config/sanitize.d.ts.map +1 -1
  32. package/dist/fields/config/sanitize.js +37 -2
  33. package/dist/fields/config/sanitize.js.map +1 -1
  34. package/dist/fields/config/types.d.ts +39 -1
  35. package/dist/fields/config/types.d.ts.map +1 -1
  36. package/dist/fields/config/types.js.map +1 -1
  37. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts +3 -1
  38. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
  39. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js +80 -15
  40. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js.map +1 -1
  41. package/dist/fields/hooks/beforeChange/promise.d.ts +1 -1
  42. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  43. package/dist/fields/hooks/beforeChange/promise.js +45 -7
  44. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  45. package/dist/fields/validations.d.ts +23 -0
  46. package/dist/fields/validations.d.ts.map +1 -1
  47. package/dist/fields/validations.js +59 -2
  48. package/dist/fields/validations.js.map +1 -1
  49. package/dist/fields/validations.spec.js +233 -1
  50. package/dist/fields/validations.spec.js.map +1 -1
  51. package/dist/folders/createFolderCollection.d.ts.map +1 -1
  52. package/dist/folders/createFolderCollection.js +1 -2
  53. package/dist/folders/createFolderCollection.js.map +1 -1
  54. package/dist/folders/utils/getFoldersAndDocumentsFromJoin.d.ts.map +1 -1
  55. package/dist/folders/utils/getFoldersAndDocumentsFromJoin.js +5 -0
  56. package/dist/folders/utils/getFoldersAndDocumentsFromJoin.js.map +1 -1
  57. package/dist/globals/config/sanitize.d.ts.map +1 -1
  58. package/dist/globals/config/sanitize.js +1 -0
  59. package/dist/globals/config/sanitize.js.map +1 -1
  60. package/dist/globals/config/types.d.ts.map +1 -1
  61. package/dist/globals/config/types.js.map +1 -1
  62. package/dist/index.d.ts +1 -1
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +1 -1
  65. package/dist/index.js.map +1 -1
  66. package/dist/utilities/appendUploadSelectFields.d.ts +11 -0
  67. package/dist/utilities/appendUploadSelectFields.d.ts.map +1 -0
  68. package/dist/utilities/appendUploadSelectFields.js +35 -0
  69. package/dist/utilities/appendUploadSelectFields.js.map +1 -0
  70. package/package.json +2 -2
@@ -18,6 +18,7 @@ export type DefaultCellComponentProps<TField extends ClientField = ClientField,
18
18
  customCellProps?: Record<string, any>;
19
19
  field: TField;
20
20
  link?: boolean;
21
+ linkURL?: string;
21
22
  onClick?: (args: {
22
23
  cellData: unknown;
23
24
  collectionSlug: SanitizedCollectionConfig['slug'];
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/admin/elements/Cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,KAAK,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEzC,MAAM,MAAM,yBAAyB,CACnC,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,SAAS,GAAG,SAAS,IACnB;IACF,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,SAAS,GAC1C,MAAM,SAAS,uBAAuB,GACpC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GACrC,MAAM,SAAS,iBAAiB,GAC9B,MAAM,CAAC,SAAS,CAAC,SAAS,IAAI,GAC5B,MAAM,EAAE,GACR,MAAM,GACR,MAAM,SAA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,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QACf,QAAQ,EAAE,OAAO,CAAA;QACjB,cAAc,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;QACjD,OAAO,EAAE,OAAO,CAAA;KACjB,KAAK,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,+BAA+B,CACzC,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,SAAS,GAAG,GAAG,IACb;IACF,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,IAAI,CAAC,yBAAyB,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/elements/Cell.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\n\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type {\n ArrayFieldClient,\n BlocksFieldClient,\n CheckboxFieldClient,\n ClientField,\n CodeFieldClient,\n DateFieldClient,\n EmailFieldClient,\n Field,\n GroupFieldClient,\n JSONFieldClient,\n NumberFieldClient,\n PointFieldClient,\n RadioFieldClient,\n RelationshipFieldClient,\n SelectFieldClient,\n TextareaFieldClient,\n TextFieldClient,\n UploadFieldClient,\n} from '../../fields/config/types.js'\nimport type { Payload } from '../../types/index.js'\nimport type { ViewTypes } from '../types.js'\n\nexport type RowData = Record<string, any>\n\nexport type DefaultCellComponentProps<\n TField extends ClientField = ClientField,\n TCellData = undefined,\n> = {\n readonly cellData: TCellData extends undefined\n ? TField extends RelationshipFieldClient\n ? number | Record<string, any> | string\n : TField extends NumberFieldClient\n ? TField['hasMany'] extends true\n ? number[]\n : number\n : TField extends TextFieldClient\n ? TField['hasMany'] extends true\n ? string[]\n : string\n : TField extends\n | CodeFieldClient\n | EmailFieldClient\n | JSONFieldClient\n | RadioFieldClient\n | TextareaFieldClient\n ? string\n : TField extends BlocksFieldClient\n ? {\n [key: string]: any\n blockType: string\n }[]\n : TField extends CheckboxFieldClient\n ? boolean\n : TField extends DateFieldClient\n ? Date | number | string\n : TField extends GroupFieldClient\n ? Record<string, any>\n : TField extends UploadFieldClient\n ? File | string\n : TField extends ArrayFieldClient\n ? Record<string, unknown>[]\n : TField extends SelectFieldClient\n ? TField['hasMany'] extends true\n ? string[]\n : string\n : TField extends PointFieldClient\n ? { x: number; y: number }\n : any\n : TCellData\n className?: string\n collectionSlug: SanitizedCollectionConfig['slug']\n columnIndex?: number\n customCellProps?: Record<string, any>\n field: TField\n link?: boolean\n onClick?: (args: {\n cellData: unknown\n collectionSlug: SanitizedCollectionConfig['slug']\n rowData: RowData\n }) => void\n rowData: RowData\n viewType?: ViewTypes\n}\n\nexport type DefaultServerCellComponentProps<\n TField extends ClientField = ClientField,\n TCellData = any,\n> = {\n collectionConfig: SanitizedCollectionConfig\n field: Field\n i18n: I18nClient\n payload: Payload\n} & Omit<DefaultCellComponentProps<TField, TCellData>, 'field'>\n"],"names":[],"mappings":"AAwFA,WAQ+D"}
1
+ {"version":3,"sources":["../../../src/admin/elements/Cell.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\n\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type {\n ArrayFieldClient,\n BlocksFieldClient,\n CheckboxFieldClient,\n ClientField,\n CodeFieldClient,\n DateFieldClient,\n EmailFieldClient,\n Field,\n GroupFieldClient,\n JSONFieldClient,\n NumberFieldClient,\n PointFieldClient,\n RadioFieldClient,\n RelationshipFieldClient,\n SelectFieldClient,\n TextareaFieldClient,\n TextFieldClient,\n UploadFieldClient,\n} from '../../fields/config/types.js'\nimport type { Payload } from '../../types/index.js'\nimport type { ViewTypes } from '../types.js'\n\nexport type RowData = Record<string, any>\n\nexport type DefaultCellComponentProps<\n TField extends ClientField = ClientField,\n TCellData = undefined,\n> = {\n readonly cellData: TCellData extends undefined\n ? TField extends RelationshipFieldClient\n ? number | Record<string, any> | string\n : TField extends NumberFieldClient\n ? TField['hasMany'] extends true\n ? number[]\n : number\n : TField extends TextFieldClient\n ? TField['hasMany'] extends true\n ? string[]\n : string\n : TField extends\n | CodeFieldClient\n | EmailFieldClient\n | JSONFieldClient\n | RadioFieldClient\n | TextareaFieldClient\n ? string\n : TField extends BlocksFieldClient\n ? {\n [key: string]: any\n blockType: string\n }[]\n : TField extends CheckboxFieldClient\n ? boolean\n : TField extends DateFieldClient\n ? Date | number | string\n : TField extends GroupFieldClient\n ? Record<string, any>\n : TField extends UploadFieldClient\n ? File | string\n : TField extends ArrayFieldClient\n ? Record<string, unknown>[]\n : TField extends SelectFieldClient\n ? TField['hasMany'] extends true\n ? string[]\n : string\n : TField extends PointFieldClient\n ? { x: number; y: number }\n : any\n : TCellData\n className?: string\n collectionSlug: SanitizedCollectionConfig['slug']\n columnIndex?: number\n customCellProps?: Record<string, any>\n field: TField\n link?: boolean\n linkURL?: string\n onClick?: (args: {\n cellData: unknown\n collectionSlug: SanitizedCollectionConfig['slug']\n rowData: RowData\n }) => void\n rowData: RowData\n viewType?: ViewTypes\n}\n\nexport type DefaultServerCellComponentProps<\n TField extends ClientField = ClientField,\n TCellData = any,\n> = {\n collectionConfig: SanitizedCollectionConfig\n field: Field\n i18n: I18nClient\n payload: Payload\n} & Omit<DefaultCellComponentProps<TField, TCellData>, 'field'>\n"],"names":[],"mappings":"AAyFA,WAQ+D"}
@@ -29,6 +29,12 @@ export type FieldState = {
29
29
  * See `mergeServerFormState` for more details.
30
30
  */
31
31
  addedByServer?: boolean;
32
+ /**
33
+ * If the field is a `blocks` field, this will contain the slugs of blocks that are allowed, based on the result of `field.filterOptions`.
34
+ * If this is undefined, all blocks are allowed.
35
+ * If this is an empty array, no blocks are allowed.
36
+ */
37
+ blocksFilterOptions?: string[];
32
38
  customComponents?: {
33
39
  /**
34
40
  * This is used by UI fields, as they can have arbitrary components defined if used
@@ -117,6 +123,12 @@ export type BuildFormStateArgs = {
117
123
  */
118
124
  renderAllFields?: boolean;
119
125
  req: PayloadRequest;
126
+ /**
127
+ * If true, will return a fresh URL for live preview based on the current form state.
128
+ * Note: this will run on every form state event, so if your `livePreview.url` function is long running or expensive,
129
+ * ensure it caches itself as needed.
130
+ */
131
+ returnLivePreviewURL?: boolean;
120
132
  returnLockStatus?: boolean;
121
133
  schemaPath: string;
122
134
  select?: SelectType;
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE7E,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,aAAa,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB,CAAC,EAAE;QACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;KAC3B,CAAA;IACD,EAAE,EAAE,MAAM,CAAA;IAC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;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,CACA;IACE,cAAc,EAAE,MAAM,CAAA;IAGtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GACD;IACE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;CACnB,CACJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Form.ts"],"sourcesContent":["import { type SupportedLanguages } from '@payloadcms/translations'\n\nimport type { SanitizedDocumentPermissions } from '../../auth/types.js'\nimport type { Field, Option, Validate } from '../../fields/config/types.js'\nimport type { TypedLocale } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { PayloadRequest, SelectType, Where } from '../../types/index.js'\n\nexport type Data = {\n [key: string]: any\n}\n\nexport type Row = {\n addedByServer?: FieldState['addedByServer']\n blockType?: string\n collapsed?: boolean\n customComponents?: {\n RowLabel?: React.ReactNode\n }\n id: string\n isLoading?: boolean\n lastRenderedPath?: string\n}\n\nexport type FilterOptionsResult = {\n [relation: string]: boolean | Where\n}\n\nexport type FieldState = {\n /**\n * This is used to determine if the field was added by the server.\n * This ensures the field is not ignored by the client when merging form state.\n * This can happen because the current local state is treated as the source of truth.\n * See `mergeServerFormState` for more details.\n */\n addedByServer?: boolean\n customComponents?: {\n /**\n * This is used by UI fields, as they can have arbitrary components defined if used\n * as a vessel to bring in custom components.\n */\n [key: string]: React.ReactNode | React.ReactNode[] | undefined\n AfterInput?: React.ReactNode\n BeforeInput?: React.ReactNode\n Description?: React.ReactNode\n Error?: React.ReactNode\n Field?: React.ReactNode\n Label?: React.ReactNode\n }\n disableFormData?: boolean\n errorMessage?: string\n errorPaths?: string[]\n /**\n * The fieldSchema may be part of the form state if `includeSchema: true` is passed to buildFormState.\n * This will never be in the form state of the client.\n */\n fieldSchema?: Field\n filterOptions?: FilterOptionsResult\n initialValue?: unknown\n /**\n * Every time a field is changed locally, this flag is set to true. Prevents form state from server from overwriting local changes.\n * After merging server form state, this flag is reset.\n *\n * @experimental This property is experimental and may change in the future. Use at your own discretion.\n */\n isModified?: boolean\n /**\n * The path of the field when its custom components were last rendered.\n * This is used to denote if a field has been rendered, and if so,\n * what path it was rendered under last.\n *\n * If this path is undefined, or, if it is different\n * from the current path of a given field, the field's components will be re-rendered.\n */\n lastRenderedPath?: string\n passesCondition?: boolean\n rows?: Row[]\n /**\n * The result of running `field.filterOptions` on select fields.\n */\n selectFilterOptions?: Option[]\n valid?: boolean\n validate?: Validate\n value?: unknown\n}\n\nexport type FieldStateWithoutComponents = Omit<FieldState, 'customComponents'>\n\nexport type FormState = {\n [path: string]: FieldState\n}\n\nexport type FormStateWithoutComponents = {\n [path: string]: FieldStateWithoutComponents\n}\n\nexport type BuildFormStateArgs = {\n data?: Data\n docPermissions: SanitizedDocumentPermissions | undefined\n docPreferences: DocumentPreferences\n /**\n * In case `formState` is not the top-level, document form state, this can be passed to\n * provide the top-level form state.\n */\n documentFormState?: FormState\n fallbackLocale?: false | TypedLocale\n formState?: FormState\n id?: number | string\n initialBlockData?: Data\n initialBlockFormState?: FormState\n /*\n If not i18n was passed, the language can be passed to init i18n\n */\n language?: keyof SupportedLanguages\n locale?: string\n /**\n * If true, will not render RSCs and instead return a simple string in their place.\n * This is useful for environments that lack RSC support, such as Jest.\n * Form state can still be built, but any server components will be omitted.\n * @default false\n */\n mockRSCs?: boolean\n operation?: 'create' | 'update'\n readOnly?: boolean\n /**\n * If true, will render field components within their state object.\n * Performance optimization: Setting to `false` ensures that only fields that have changed paths will re-render, e.g. new array rows, etc.\n * For example, you only need to render ALL fields on initial render, not on every onChange.\n */\n renderAllFields?: boolean\n req: PayloadRequest\n returnLockStatus?: boolean\n schemaPath: string\n select?: SelectType\n /**\n * When true, sets `user: true` when calling `getClientConfig`.\n * This will retrieve the client config in its entirety, even when unauthenticated.\n * For example, the create-first-user view needs the entire config, but there is no user yet.\n *\n * @experimental This property is experimental and may change in the future. Use at your own discretion.\n */\n skipClientConfigAuth?: boolean\n skipValidation?: boolean\n updateLastEdited?: boolean\n} & (\n | {\n collectionSlug: string\n // Do not type it as never. This still makes it so that either collectionSlug or globalSlug is required, but makes it easier to provide both collectionSlug and globalSlug if it's\n // unclear which one is actually available.\n globalSlug?: string\n }\n | {\n collectionSlug?: string\n globalSlug: string\n }\n)\n"],"names":[],"mappings":"AAgGA,WA2DC"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Form.ts"],"sourcesContent":["import { type SupportedLanguages } from '@payloadcms/translations'\n\nimport type { SanitizedDocumentPermissions } from '../../auth/types.js'\nimport type { Field, Option, Validate } from '../../fields/config/types.js'\nimport type { TypedLocale } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { PayloadRequest, SelectType, Where } from '../../types/index.js'\n\nexport type Data = {\n [key: string]: any\n}\n\nexport type Row = {\n addedByServer?: FieldState['addedByServer']\n blockType?: string\n collapsed?: boolean\n customComponents?: {\n RowLabel?: React.ReactNode\n }\n id: string\n isLoading?: boolean\n lastRenderedPath?: string\n}\n\nexport type FilterOptionsResult = {\n [relation: string]: boolean | Where\n}\n\nexport type FieldState = {\n /**\n * This is used to determine if the field was added by the server.\n * This ensures the field is not ignored by the client when merging form state.\n * This can happen because the current local state is treated as the source of truth.\n * See `mergeServerFormState` for more details.\n */\n addedByServer?: boolean\n /**\n * If the field is a `blocks` field, this will contain the slugs of blocks that are allowed, based on the result of `field.filterOptions`.\n * If this is undefined, all blocks are allowed.\n * If this is an empty array, no blocks are allowed.\n */\n blocksFilterOptions?: string[]\n customComponents?: {\n /**\n * This is used by UI fields, as they can have arbitrary components defined if used\n * as a vessel to bring in custom components.\n */\n [key: string]: React.ReactNode | React.ReactNode[] | undefined\n AfterInput?: React.ReactNode\n BeforeInput?: React.ReactNode\n Description?: React.ReactNode\n Error?: React.ReactNode\n Field?: React.ReactNode\n Label?: React.ReactNode\n }\n disableFormData?: boolean\n errorMessage?: string\n errorPaths?: string[]\n /**\n * The fieldSchema may be part of the form state if `includeSchema: true` is passed to buildFormState.\n * This will never be in the form state of the client.\n */\n fieldSchema?: Field\n filterOptions?: FilterOptionsResult\n initialValue?: unknown\n /**\n * Every time a field is changed locally, this flag is set to true. Prevents form state from server from overwriting local changes.\n * After merging server form state, this flag is reset.\n *\n * @experimental This property is experimental and may change in the future. Use at your own discretion.\n */\n isModified?: boolean\n /**\n * The path of the field when its custom components were last rendered.\n * This is used to denote if a field has been rendered, and if so,\n * what path it was rendered under last.\n *\n * If this path is undefined, or, if it is different\n * from the current path of a given field, the field's components will be re-rendered.\n */\n lastRenderedPath?: string\n passesCondition?: boolean\n rows?: Row[]\n /**\n * The result of running `field.filterOptions` on select fields.\n */\n selectFilterOptions?: Option[]\n valid?: boolean\n validate?: Validate\n value?: unknown\n}\n\nexport type FieldStateWithoutComponents = Omit<FieldState, 'customComponents'>\n\nexport type FormState = {\n [path: string]: FieldState\n}\n\nexport type FormStateWithoutComponents = {\n [path: string]: FieldStateWithoutComponents\n}\n\nexport type BuildFormStateArgs = {\n data?: Data\n docPermissions: SanitizedDocumentPermissions | undefined\n docPreferences: DocumentPreferences\n /**\n * In case `formState` is not the top-level, document form state, this can be passed to\n * provide the top-level form state.\n */\n documentFormState?: FormState\n fallbackLocale?: false | TypedLocale\n formState?: FormState\n id?: number | string\n initialBlockData?: Data\n initialBlockFormState?: FormState\n /*\n If not i18n was passed, the language can be passed to init i18n\n */\n language?: keyof SupportedLanguages\n locale?: string\n /**\n * If true, will not render RSCs and instead return a simple string in their place.\n * This is useful for environments that lack RSC support, such as Jest.\n * Form state can still be built, but any server components will be omitted.\n * @default false\n */\n mockRSCs?: boolean\n operation?: 'create' | 'update'\n readOnly?: boolean\n /**\n * If true, will render field components within their state object.\n * Performance optimization: Setting to `false` ensures that only fields that have changed paths will re-render, e.g. new array rows, etc.\n * For example, you only need to render ALL fields on initial render, not on every onChange.\n */\n renderAllFields?: boolean\n req: PayloadRequest\n /**\n * If true, will return a fresh URL for live preview based on the current form state.\n * Note: this will run on every form state event, so if your `livePreview.url` function is long running or expensive,\n * ensure it caches itself as needed.\n */\n returnLivePreviewURL?: boolean\n returnLockStatus?: boolean\n schemaPath: string\n select?: SelectType\n /**\n * When true, sets `user: true` when calling `getClientConfig`.\n * This will retrieve the client config in its entirety, even when unauthenticated.\n * For example, the create-first-user view needs the entire config, but there is no user yet.\n *\n * @experimental This property is experimental and may change in the future. Use at your own discretion.\n */\n skipClientConfigAuth?: boolean\n skipValidation?: boolean\n updateLastEdited?: boolean\n} & (\n | {\n collectionSlug: string\n // Do not type it as never. This still makes it so that either collectionSlug or globalSlug is required, but makes it easier to provide both collectionSlug and globalSlug if it's\n // unclear which one is actually available.\n globalSlug?: string\n }\n | {\n collectionSlug?: string\n globalSlug: string\n }\n)\n"],"names":[],"mappings":"AAsGA,WAiEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/auth/crypto.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY5C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW5C"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/auth/crypto.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU5C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS5C"}
@@ -5,13 +5,9 @@ export function encrypt(text) {
5
5
  // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
6
6
  const secret = this.secret;
7
7
  const cipher = crypto.createCipheriv(algorithm, secret, iv);
8
- const encrypted = Buffer.concat([
9
- cipher.update(text),
10
- cipher.final()
11
- ]);
8
+ const encrypted = cipher.update(text, 'utf8', 'hex') + cipher.final('hex');
12
9
  const ivString = iv.toString('hex');
13
- const encryptedString = encrypted.toString('hex');
14
- return `${ivString}${encryptedString}`;
10
+ return `${ivString}${encrypted}`;
15
11
  }
16
12
  export function decrypt(hash) {
17
13
  const iv = hash.slice(0, 32);
@@ -19,11 +15,7 @@ export function decrypt(hash) {
19
15
  // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
20
16
  const secret = this.secret;
21
17
  const decipher = crypto.createDecipheriv(algorithm, secret, Buffer.from(iv, 'hex'));
22
- const decrypted = Buffer.concat([
23
- decipher.update(Buffer.from(content, 'hex')),
24
- decipher.final()
25
- ]);
26
- return decrypted.toString();
18
+ return decipher.update(content, 'hex', 'utf8') + decipher.final('utf8');
27
19
  }
28
20
 
29
21
  //# sourceMappingURL=crypto.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/crypto.ts"],"sourcesContent":["import crypto from 'crypto'\n\nconst algorithm = 'aes-256-ctr'\n\nexport function encrypt(text: string): string {\n const iv = crypto.randomBytes(16)\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n const secret = this.secret\n const cipher = crypto.createCipheriv(algorithm, secret, iv)\n\n const encrypted = Buffer.concat([cipher.update(text), cipher.final()])\n\n const ivString = iv.toString('hex')\n const encryptedString = encrypted.toString('hex')\n\n return `${ivString}${encryptedString}`\n}\n\nexport function decrypt(hash: string): string {\n const iv = hash.slice(0, 32)\n const content = hash.slice(32)\n\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n const secret = this.secret\n const decipher = crypto.createDecipheriv(algorithm, secret, Buffer.from(iv, 'hex'))\n\n const decrypted = Buffer.concat([decipher.update(Buffer.from(content, 'hex')), decipher.final()])\n\n return decrypted.toString()\n}\n"],"names":["crypto","algorithm","encrypt","text","iv","randomBytes","secret","cipher","createCipheriv","encrypted","Buffer","concat","update","final","ivString","toString","encryptedString","decrypt","hash","slice","content","decipher","createDecipheriv","from","decrypted"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAE3B,MAAMC,YAAY;AAElB,OAAO,SAASC,QAAQC,IAAY;IAClC,MAAMC,KAAKJ,OAAOK,WAAW,CAAC;IAC9B,oFAAoF;IACpF,MAAMC,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMC,SAASP,OAAOQ,cAAc,CAACP,WAAWK,QAAQF;IAExD,MAAMK,YAAYC,OAAOC,MAAM,CAAC;QAACJ,OAAOK,MAAM,CAACT;QAAOI,OAAOM,KAAK;KAAG;IAErE,MAAMC,WAAWV,GAAGW,QAAQ,CAAC;IAC7B,MAAMC,kBAAkBP,UAAUM,QAAQ,CAAC;IAE3C,OAAO,GAAGD,WAAWE,iBAAiB;AACxC;AAEA,OAAO,SAASC,QAAQC,IAAY;IAClC,MAAMd,KAAKc,KAAKC,KAAK,CAAC,GAAG;IACzB,MAAMC,UAAUF,KAAKC,KAAK,CAAC;IAE3B,oFAAoF;IACpF,MAAMb,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMe,WAAWrB,OAAOsB,gBAAgB,CAACrB,WAAWK,QAAQI,OAAOa,IAAI,CAACnB,IAAI;IAE5E,MAAMoB,YAAYd,OAAOC,MAAM,CAAC;QAACU,SAAST,MAAM,CAACF,OAAOa,IAAI,CAACH,SAAS;QAASC,SAASR,KAAK;KAAG;IAEhG,OAAOW,UAAUT,QAAQ;AAC3B"}
1
+ {"version":3,"sources":["../../src/auth/crypto.ts"],"sourcesContent":["import crypto from 'crypto'\n\nconst algorithm = 'aes-256-ctr'\n\nexport function encrypt(text: string): string {\n const iv = crypto.randomBytes(16)\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n const secret = this.secret\n const cipher = crypto.createCipheriv(algorithm, secret, iv)\n\n const encrypted = cipher.update(text, 'utf8', 'hex') + cipher.final('hex')\n const ivString = iv.toString('hex')\n\n return `${ivString}${encrypted}`\n}\n\nexport function decrypt(hash: string): string {\n const iv = hash.slice(0, 32)\n const content = hash.slice(32)\n\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n const secret = this.secret\n const decipher = crypto.createDecipheriv(algorithm, secret, Buffer.from(iv, 'hex'))\n\n return decipher.update(content, 'hex', 'utf8') + decipher.final('utf8')\n}\n"],"names":["crypto","algorithm","encrypt","text","iv","randomBytes","secret","cipher","createCipheriv","encrypted","update","final","ivString","toString","decrypt","hash","slice","content","decipher","createDecipheriv","Buffer","from"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAE3B,MAAMC,YAAY;AAElB,OAAO,SAASC,QAAQC,IAAY;IAClC,MAAMC,KAAKJ,OAAOK,WAAW,CAAC;IAC9B,oFAAoF;IACpF,MAAMC,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMC,SAASP,OAAOQ,cAAc,CAACP,WAAWK,QAAQF;IAExD,MAAMK,YAAYF,OAAOG,MAAM,CAACP,MAAM,QAAQ,SAASI,OAAOI,KAAK,CAAC;IACpE,MAAMC,WAAWR,GAAGS,QAAQ,CAAC;IAE7B,OAAO,GAAGD,WAAWH,WAAW;AAClC;AAEA,OAAO,SAASK,QAAQC,IAAY;IAClC,MAAMX,KAAKW,KAAKC,KAAK,CAAC,GAAG;IACzB,MAAMC,UAAUF,KAAKC,KAAK,CAAC;IAE3B,oFAAoF;IACpF,MAAMV,SAAS,IAAI,CAACA,MAAM;IAC1B,MAAMY,WAAWlB,OAAOmB,gBAAgB,CAAClB,WAAWK,QAAQc,OAAOC,IAAI,CAACjB,IAAI;IAE5E,OAAOc,SAASR,MAAM,CAACO,SAAS,OAAO,UAAUC,SAASP,KAAK,CAAC;AAClE"}
@@ -1,5 +1,5 @@
1
1
  import crypto from 'crypto';
2
- export const APIKeyAuthentication = (collectionConfig)=>async ({ headers, payload })=>{
2
+ export const APIKeyAuthentication = (collectionConfig)=>async ({ headers, isGraphQL = false, payload })=>{
3
3
  const authHeader = headers.get('Authorization');
4
4
  if (authHeader?.startsWith(`${collectionConfig.slug} API-Key `)) {
5
5
  const apiKey = authHeader.replace(`${collectionConfig.slug} API-Key `, '');
@@ -37,7 +37,7 @@ export const APIKeyAuthentication = (collectionConfig)=>async ({ headers, payloa
37
37
  }
38
38
  const userQuery = await payload.find({
39
39
  collection: collectionConfig.slug,
40
- depth: collectionConfig.auth.depth,
40
+ depth: isGraphQL ? 0 : collectionConfig.auth.depth,
41
41
  limit: 1,
42
42
  overrideAccess: true,
43
43
  pagination: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/strategies/apiKey.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { Where } from '../../types/index.js'\nimport type { AuthStrategyFunction } from '../index.js'\n\nexport const APIKeyAuthentication =\n (collectionConfig: SanitizedCollectionConfig): AuthStrategyFunction =>\n async ({ headers, payload }) => {\n const authHeader = headers.get('Authorization')\n\n if (authHeader?.startsWith(`${collectionConfig.slug} API-Key `)) {\n const apiKey = authHeader.replace(`${collectionConfig.slug} API-Key `, '')\n\n // TODO: V4 remove extra algorithm check\n // api keys saved prior to v3.46.0 will have sha1\n const sha1APIKeyIndex = crypto.createHmac('sha1', payload.secret).update(apiKey).digest('hex')\n const sha256APIKeyIndex = crypto\n .createHmac('sha256', payload.secret)\n .update(apiKey)\n .digest('hex')\n\n const apiKeyConstraints = [\n {\n apiKeyIndex: {\n equals: sha1APIKeyIndex,\n },\n },\n {\n apiKeyIndex: {\n equals: sha256APIKeyIndex,\n },\n },\n ]\n\n try {\n const where: Where = {}\n if (collectionConfig.auth?.verify) {\n where.and = [\n {\n or: apiKeyConstraints,\n },\n {\n _verified: {\n not_equals: false,\n },\n },\n ]\n } else {\n where.or = apiKeyConstraints\n }\n\n const userQuery = await payload.find({\n collection: collectionConfig.slug,\n depth: collectionConfig.auth.depth,\n limit: 1,\n overrideAccess: true,\n pagination: false,\n where,\n })\n\n if (userQuery.docs && userQuery.docs.length > 0) {\n const user = userQuery.docs[0]\n user!.collection = collectionConfig.slug\n user!._strategy = 'api-key'\n\n return {\n user: user as TypedUser,\n }\n }\n } catch (ignore) {\n return { user: null }\n }\n }\n\n return { user: null }\n }\n"],"names":["crypto","APIKeyAuthentication","collectionConfig","headers","payload","authHeader","get","startsWith","slug","apiKey","replace","sha1APIKeyIndex","createHmac","secret","update","digest","sha256APIKeyIndex","apiKeyConstraints","apiKeyIndex","equals","where","auth","verify","and","or","_verified","not_equals","userQuery","find","collection","depth","limit","overrideAccess","pagination","docs","length","user","_strategy","ignore"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAO3B,OAAO,MAAMC,uBACX,CAACC,mBACD,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAE;QACzB,MAAMC,aAAaF,QAAQG,GAAG,CAAC;QAE/B,IAAID,YAAYE,WAAW,GAAGL,iBAAiBM,IAAI,CAAC,SAAS,CAAC,GAAG;YAC/D,MAAMC,SAASJ,WAAWK,OAAO,CAAC,GAAGR,iBAAiBM,IAAI,CAAC,SAAS,CAAC,EAAE;YAEvE,wCAAwC;YACxC,iDAAiD;YACjD,MAAMG,kBAAkBX,OAAOY,UAAU,CAAC,QAAQR,QAAQS,MAAM,EAAEC,MAAM,CAACL,QAAQM,MAAM,CAAC;YACxF,MAAMC,oBAAoBhB,OACvBY,UAAU,CAAC,UAAUR,QAAQS,MAAM,EACnCC,MAAM,CAACL,QACPM,MAAM,CAAC;YAEV,MAAME,oBAAoB;gBACxB;oBACEC,aAAa;wBACXC,QAAQR;oBACV;gBACF;gBACA;oBACEO,aAAa;wBACXC,QAAQH;oBACV;gBACF;aACD;YAED,IAAI;gBACF,MAAMI,QAAe,CAAC;gBACtB,IAAIlB,iBAAiBmB,IAAI,EAAEC,QAAQ;oBACjCF,MAAMG,GAAG,GAAG;wBACV;4BACEC,IAAIP;wBACN;wBACA;4BACEQ,WAAW;gCACTC,YAAY;4BACd;wBACF;qBACD;gBACH,OAAO;oBACLN,MAAMI,EAAE,GAAGP;gBACb;gBAEA,MAAMU,YAAY,MAAMvB,QAAQwB,IAAI,CAAC;oBACnCC,YAAY3B,iBAAiBM,IAAI;oBACjCsB,OAAO5B,iBAAiBmB,IAAI,CAACS,KAAK;oBAClCC,OAAO;oBACPC,gBAAgB;oBAChBC,YAAY;oBACZb;gBACF;gBAEA,IAAIO,UAAUO,IAAI,IAAIP,UAAUO,IAAI,CAACC,MAAM,GAAG,GAAG;oBAC/C,MAAMC,OAAOT,UAAUO,IAAI,CAAC,EAAE;oBAC9BE,KAAMP,UAAU,GAAG3B,iBAAiBM,IAAI;oBACxC4B,KAAMC,SAAS,GAAG;oBAElB,OAAO;wBACLD,MAAMA;oBACR;gBACF;YACF,EAAE,OAAOE,QAAQ;gBACf,OAAO;oBAAEF,MAAM;gBAAK;YACtB;QACF;QAEA,OAAO;YAAEA,MAAM;QAAK;IACtB,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/strategies/apiKey.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { Where } from '../../types/index.js'\nimport type { AuthStrategyFunction } from '../index.js'\n\nexport const APIKeyAuthentication =\n (collectionConfig: SanitizedCollectionConfig): AuthStrategyFunction =>\n async ({ headers, isGraphQL = false, payload }) => {\n const authHeader = headers.get('Authorization')\n\n if (authHeader?.startsWith(`${collectionConfig.slug} API-Key `)) {\n const apiKey = authHeader.replace(`${collectionConfig.slug} API-Key `, '')\n\n // TODO: V4 remove extra algorithm check\n // api keys saved prior to v3.46.0 will have sha1\n const sha1APIKeyIndex = crypto.createHmac('sha1', payload.secret).update(apiKey).digest('hex')\n const sha256APIKeyIndex = crypto\n .createHmac('sha256', payload.secret)\n .update(apiKey)\n .digest('hex')\n\n const apiKeyConstraints = [\n {\n apiKeyIndex: {\n equals: sha1APIKeyIndex,\n },\n },\n {\n apiKeyIndex: {\n equals: sha256APIKeyIndex,\n },\n },\n ]\n\n try {\n const where: Where = {}\n if (collectionConfig.auth?.verify) {\n where.and = [\n {\n or: apiKeyConstraints,\n },\n {\n _verified: {\n not_equals: false,\n },\n },\n ]\n } else {\n where.or = apiKeyConstraints\n }\n\n const userQuery = await payload.find({\n collection: collectionConfig.slug,\n depth: isGraphQL ? 0 : collectionConfig.auth.depth,\n limit: 1,\n overrideAccess: true,\n pagination: false,\n where,\n })\n\n if (userQuery.docs && userQuery.docs.length > 0) {\n const user = userQuery.docs[0]\n user!.collection = collectionConfig.slug\n user!._strategy = 'api-key'\n\n return {\n user: user as TypedUser,\n }\n }\n } catch (ignore) {\n return { user: null }\n }\n }\n\n return { user: null }\n }\n"],"names":["crypto","APIKeyAuthentication","collectionConfig","headers","isGraphQL","payload","authHeader","get","startsWith","slug","apiKey","replace","sha1APIKeyIndex","createHmac","secret","update","digest","sha256APIKeyIndex","apiKeyConstraints","apiKeyIndex","equals","where","auth","verify","and","or","_verified","not_equals","userQuery","find","collection","depth","limit","overrideAccess","pagination","docs","length","user","_strategy","ignore"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAO3B,OAAO,MAAMC,uBACX,CAACC,mBACD,OAAO,EAAEC,OAAO,EAAEC,YAAY,KAAK,EAAEC,OAAO,EAAE;QAC5C,MAAMC,aAAaH,QAAQI,GAAG,CAAC;QAE/B,IAAID,YAAYE,WAAW,GAAGN,iBAAiBO,IAAI,CAAC,SAAS,CAAC,GAAG;YAC/D,MAAMC,SAASJ,WAAWK,OAAO,CAAC,GAAGT,iBAAiBO,IAAI,CAAC,SAAS,CAAC,EAAE;YAEvE,wCAAwC;YACxC,iDAAiD;YACjD,MAAMG,kBAAkBZ,OAAOa,UAAU,CAAC,QAAQR,QAAQS,MAAM,EAAEC,MAAM,CAACL,QAAQM,MAAM,CAAC;YACxF,MAAMC,oBAAoBjB,OACvBa,UAAU,CAAC,UAAUR,QAAQS,MAAM,EACnCC,MAAM,CAACL,QACPM,MAAM,CAAC;YAEV,MAAME,oBAAoB;gBACxB;oBACEC,aAAa;wBACXC,QAAQR;oBACV;gBACF;gBACA;oBACEO,aAAa;wBACXC,QAAQH;oBACV;gBACF;aACD;YAED,IAAI;gBACF,MAAMI,QAAe,CAAC;gBACtB,IAAInB,iBAAiBoB,IAAI,EAAEC,QAAQ;oBACjCF,MAAMG,GAAG,GAAG;wBACV;4BACEC,IAAIP;wBACN;wBACA;4BACEQ,WAAW;gCACTC,YAAY;4BACd;wBACF;qBACD;gBACH,OAAO;oBACLN,MAAMI,EAAE,GAAGP;gBACb;gBAEA,MAAMU,YAAY,MAAMvB,QAAQwB,IAAI,CAAC;oBACnCC,YAAY5B,iBAAiBO,IAAI;oBACjCsB,OAAO3B,YAAY,IAAIF,iBAAiBoB,IAAI,CAACS,KAAK;oBAClDC,OAAO;oBACPC,gBAAgB;oBAChBC,YAAY;oBACZb;gBACF;gBAEA,IAAIO,UAAUO,IAAI,IAAIP,UAAUO,IAAI,CAACC,MAAM,GAAG,GAAG;oBAC/C,MAAMC,OAAOT,UAAUO,IAAI,CAAC,EAAE;oBAC9BE,KAAMP,UAAU,GAAG5B,iBAAiBO,IAAI;oBACxC4B,KAAMC,SAAS,GAAG;oBAElB,OAAO;wBACLD,MAAMA;oBACR;gBACF;YACF,EAAE,OAAOE,QAAQ;gBACf,OAAO;oBAAEF,MAAM;gBAAK;YACtB;QACF;QAEA,OAAO;YAAEA,MAAM;QAAK;IACtB,EAAC"}
@@ -6,14 +6,14 @@ import type { ClientField } from '../../fields/config/client.js';
6
6
  import type { Payload } from '../../types/index.js';
7
7
  import type { SanitizedCollectionConfig } from './types.js';
8
8
  export type ServerOnlyCollectionProperties = keyof Pick<SanitizedCollectionConfig, 'access' | 'custom' | 'endpoints' | 'flattenedFields' | 'hooks' | 'indexes' | 'joins' | 'polymorphicJoins' | 'sanitizedIndexes'>;
9
- export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], 'baseFilter' | 'baseListFilter' | 'components' | 'hidden'>;
9
+ export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], 'baseFilter' | 'baseListFilter' | 'components' | 'formatDocURL' | 'hidden'>;
10
10
  export type ServerOnlyUploadProperties = keyof Pick<SanitizedCollectionConfig['upload'], 'adminThumbnail' | 'externalFileHeaderFilter' | 'handlers' | 'modifyResponseHeaders' | 'withMetadata'>;
11
11
  export type ClientCollectionConfig = {
12
12
  admin: {
13
13
  description?: StaticDescription;
14
14
  livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>;
15
15
  preview?: boolean;
16
- } & Omit<SanitizedCollectionConfig['admin'], 'components' | 'description' | 'joins' | 'livePreview' | 'preview' | ServerOnlyCollectionAdminProperties>;
16
+ } & Omit<SanitizedCollectionConfig['admin'], 'components' | 'description' | 'formatDocURL' | 'joins' | 'livePreview' | 'preview' | ServerOnlyCollectionAdminProperties>;
17
17
  auth?: {
18
18
  verify?: true;
19
19
  } & Omit<SanitizedCollectionConfig['auth'], 'forgotPassword' | 'strategies' | 'verify'>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,0BAA0B,CAAA;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAI3D,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CACrD,yBAAyB,EACvB,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,iBAAiB,GACjB,OAAO,GACP,SAAS,GACT,OAAO,GACP,kBAAkB,GAClB,kBAAkB,CAC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AAS,CAAA;CACrB,KAAG,sBAAsB,EAezB,CAAA"}
@@ -21,7 +21,8 @@ const serverOnlyCollectionAdminProperties = [
21
21
  'hidden',
22
22
  'baseFilter',
23
23
  'baseListFilter',
24
- 'components'
24
+ 'components',
25
+ 'formatDocURL'
25
26
  ];
26
27
  export const createClientCollectionConfig = ({ collection, defaultIDType, i18n, importMap })=>{
27
28
  const clientCollection = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/config/client.ts"],"sourcesContent":["import type { I18nClient, TFunction } from '@payloadcms/translations'\n\nimport type { StaticDescription } from '../../admin/types.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type {\n LivePreviewConfig,\n ServerOnlyLivePreviewProperties,\n StaticLabel,\n} from '../../config/types.js'\nimport type { ClientField } from '../../fields/config/client.js'\nimport type { Payload } from '../../types/index.js'\nimport type { SanitizedUploadConfig } from '../../uploads/types.js'\nimport type { SanitizedCollectionConfig } from './types.js'\n\nimport { createClientFields } from '../../fields/config/client.js'\n\nexport type ServerOnlyCollectionProperties = keyof Pick<\n SanitizedCollectionConfig,\n | 'access'\n | 'custom'\n | 'endpoints'\n | 'flattenedFields'\n | 'hooks'\n | 'indexes'\n | 'joins'\n | 'polymorphicJoins'\n | 'sanitizedIndexes'\n>\n\nexport type ServerOnlyCollectionAdminProperties = keyof Pick<\n SanitizedCollectionConfig['admin'],\n 'baseFilter' | 'baseListFilter' | 'components' | 'hidden'\n>\n\nexport type ServerOnlyUploadProperties = keyof Pick<\n SanitizedCollectionConfig['upload'],\n | 'adminThumbnail'\n | 'externalFileHeaderFilter'\n | 'handlers'\n | 'modifyResponseHeaders'\n | 'withMetadata'\n>\n\nexport type ClientCollectionConfig = {\n admin: {\n description?: StaticDescription\n livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>\n preview?: boolean\n } & Omit<\n SanitizedCollectionConfig['admin'],\n | 'components'\n | 'description'\n | 'joins'\n | 'livePreview'\n | 'preview'\n | ServerOnlyCollectionAdminProperties\n >\n auth?: { verify?: true } & Omit<\n SanitizedCollectionConfig['auth'],\n 'forgotPassword' | 'strategies' | 'verify'\n >\n fields: ClientField[]\n labels: {\n plural: StaticLabel\n singular: StaticLabel\n }\n} & Omit<\n SanitizedCollectionConfig,\n 'admin' | 'auth' | 'fields' | 'labels' | ServerOnlyCollectionProperties\n>\n\nconst serverOnlyCollectionProperties: Partial<ServerOnlyCollectionProperties>[] = [\n 'hooks',\n 'access',\n 'endpoints',\n 'custom',\n 'joins',\n 'polymorphicJoins',\n 'flattenedFields',\n 'indexes',\n 'sanitizedIndexes',\n // `upload`\n // `admin`\n // are all handled separately\n]\n\nconst serverOnlyUploadProperties: Partial<ServerOnlyUploadProperties>[] = [\n 'adminThumbnail',\n 'externalFileHeaderFilter',\n 'handlers',\n 'modifyResponseHeaders',\n 'withMetadata',\n]\n\nconst serverOnlyCollectionAdminProperties: Partial<ServerOnlyCollectionAdminProperties>[] = [\n 'hidden',\n 'baseFilter',\n 'baseListFilter',\n 'components',\n // 'preview' is handled separately\n // `livePreview` is handled separately\n]\n\nexport const createClientCollectionConfig = ({\n collection,\n defaultIDType,\n i18n,\n importMap,\n}: {\n collection: SanitizedCollectionConfig\n defaultIDType: Payload['config']['db']['defaultIDType']\n i18n: I18nClient\n importMap: ImportMap\n}): ClientCollectionConfig => {\n const clientCollection = {} as Partial<ClientCollectionConfig>\n\n for (const key in collection) {\n if (serverOnlyCollectionProperties.includes(key as any)) {\n continue\n }\n switch (key) {\n case 'admin':\n if (!collection.admin) {\n break\n }\n\n clientCollection.admin = {} as ClientCollectionConfig['admin']\n\n for (const adminKey in collection.admin) {\n if (serverOnlyCollectionAdminProperties.includes(adminKey as any)) {\n continue\n }\n\n switch (adminKey) {\n case 'description':\n if (\n typeof collection.admin.description === 'string' ||\n typeof collection.admin.description === 'object'\n ) {\n if (collection.admin.description) {\n clientCollection.admin.description = collection.admin.description\n }\n } else if (typeof collection.admin.description === 'function') {\n const description = collection.admin.description({ t: i18n.t as TFunction })\n\n if (description) {\n clientCollection.admin.description = description\n }\n }\n break\n\n case 'livePreview':\n clientCollection.admin.livePreview = {}\n\n if (collection.admin.livePreview?.breakpoints) {\n clientCollection.admin.livePreview.breakpoints =\n collection.admin.livePreview.breakpoints\n }\n\n break\n\n case 'preview':\n if (collection.admin.preview) {\n clientCollection.admin.preview = true\n }\n\n break\n\n default:\n ;(clientCollection as any).admin[adminKey] =\n collection.admin[adminKey as keyof SanitizedCollectionConfig['admin']]\n }\n }\n\n break\n\n case 'auth':\n if (!collection.auth) {\n break\n }\n\n clientCollection.auth = {} as { verify?: true } & SanitizedCollectionConfig['auth']\n\n if (collection.auth.cookies) {\n clientCollection.auth.cookies = collection.auth.cookies\n }\n\n if (collection.auth.depth !== undefined) {\n // Check for undefined as it can be a number (0)\n clientCollection.auth.depth = collection.auth.depth\n }\n\n if (collection.auth.disableLocalStrategy) {\n clientCollection.auth.disableLocalStrategy = collection.auth.disableLocalStrategy\n }\n\n if (collection.auth.lockTime !== undefined) {\n // Check for undefined as it can be a number (0)\n clientCollection.auth.lockTime = collection.auth.lockTime\n }\n\n if (collection.auth.loginWithUsername) {\n clientCollection.auth.loginWithUsername = collection.auth.loginWithUsername\n }\n\n if (collection.auth.maxLoginAttempts !== undefined) {\n // Check for undefined as it can be a number (0)\n clientCollection.auth.maxLoginAttempts = collection.auth.maxLoginAttempts\n }\n\n if (collection.auth.removeTokenFromResponses) {\n clientCollection.auth.removeTokenFromResponses = collection.auth.removeTokenFromResponses\n }\n\n if (collection.auth.useAPIKey) {\n clientCollection.auth.useAPIKey = collection.auth.useAPIKey\n }\n\n if (collection.auth.tokenExpiration) {\n clientCollection.auth.tokenExpiration = collection.auth.tokenExpiration\n }\n\n if (collection.auth.verify) {\n clientCollection.auth.verify = true\n }\n\n break\n\n case 'fields':\n clientCollection.fields = createClientFields({\n defaultIDType,\n fields: collection.fields,\n i18n,\n importMap,\n })\n\n break\n\n case 'labels':\n clientCollection.labels = {\n plural:\n typeof collection.labels.plural === 'function'\n ? collection.labels.plural({ i18n, t: i18n.t as TFunction })\n : collection.labels.plural,\n singular:\n typeof collection.labels.singular === 'function'\n ? collection.labels.singular({ i18n, t: i18n.t as TFunction })\n : collection.labels.singular,\n }\n\n break\n\n case 'upload':\n if (!collection.upload) {\n break\n }\n\n clientCollection.upload = {} as SanitizedUploadConfig\n\n for (const uploadKey in collection.upload) {\n if (serverOnlyUploadProperties.includes(uploadKey as any)) {\n continue\n }\n\n if (uploadKey === 'imageSizes') {\n clientCollection.upload.imageSizes = collection.upload.imageSizes?.map((size) => {\n const sanitizedSize = { ...size }\n if ('generateImageName' in sanitizedSize) {\n delete sanitizedSize.generateImageName\n }\n return sanitizedSize\n })\n } else {\n ;(clientCollection.upload as any)[uploadKey] =\n collection.upload[uploadKey as keyof SanitizedUploadConfig]\n }\n }\n\n break\n\n default:\n ;(clientCollection as any)[key] = collection[key as keyof SanitizedCollectionConfig]\n }\n }\n\n return clientCollection as ClientCollectionConfig\n}\n\nexport const createClientCollectionConfigs = ({\n collections,\n defaultIDType,\n i18n,\n importMap,\n}: {\n collections: SanitizedCollectionConfig[]\n defaultIDType: Payload['config']['db']['defaultIDType']\n i18n: I18nClient\n importMap: ImportMap\n}): ClientCollectionConfig[] => {\n const clientCollections = new Array(collections.length)\n\n for (let i = 0; i < collections.length; i++) {\n const collection = collections[i]!\n\n clientCollections[i] = createClientCollectionConfig({\n collection,\n defaultIDType,\n i18n,\n importMap,\n })\n }\n\n return clientCollections\n}\n"],"names":["createClientFields","serverOnlyCollectionProperties","serverOnlyUploadProperties","serverOnlyCollectionAdminProperties","createClientCollectionConfig","collection","defaultIDType","i18n","importMap","clientCollection","key","includes","admin","adminKey","description","t","livePreview","breakpoints","preview","auth","cookies","depth","undefined","disableLocalStrategy","lockTime","loginWithUsername","maxLoginAttempts","removeTokenFromResponses","useAPIKey","tokenExpiration","verify","fields","labels","plural","singular","upload","uploadKey","imageSizes","map","size","sanitizedSize","generateImageName","createClientCollectionConfigs","collections","clientCollections","Array","length","i"],"mappings":"AAcA,SAASA,kBAAkB,QAAQ,gCAA+B;AAyDlE,MAAMC,iCAA4E;IAChF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAID;AAED,MAAMC,6BAAoE;IACxE;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,sCAAsF;IAC1F;IACA;IACA;IACA;CAGD;AAED,OAAO,MAAMC,+BAA+B,CAAC,EAC3CC,UAAU,EACVC,aAAa,EACbC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMC,mBAAmB,CAAC;IAE1B,IAAK,MAAMC,OAAOL,WAAY;QAC5B,IAAIJ,+BAA+BU,QAAQ,CAACD,MAAa;YACvD;QACF;QACA,OAAQA;YACN,KAAK;gBACH,IAAI,CAACL,WAAWO,KAAK,EAAE;oBACrB;gBACF;gBAEAH,iBAAiBG,KAAK,GAAG,CAAC;gBAE1B,IAAK,MAAMC,YAAYR,WAAWO,KAAK,CAAE;oBACvC,IAAIT,oCAAoCQ,QAAQ,CAACE,WAAkB;wBACjE;oBACF;oBAEA,OAAQA;wBACN,KAAK;4BACH,IACE,OAAOR,WAAWO,KAAK,CAACE,WAAW,KAAK,YACxC,OAAOT,WAAWO,KAAK,CAACE,WAAW,KAAK,UACxC;gCACA,IAAIT,WAAWO,KAAK,CAACE,WAAW,EAAE;oCAChCL,iBAAiBG,KAAK,CAACE,WAAW,GAAGT,WAAWO,KAAK,CAACE,WAAW;gCACnE;4BACF,OAAO,IAAI,OAAOT,WAAWO,KAAK,CAACE,WAAW,KAAK,YAAY;gCAC7D,MAAMA,cAAcT,WAAWO,KAAK,CAACE,WAAW,CAAC;oCAAEC,GAAGR,KAAKQ,CAAC;gCAAc;gCAE1E,IAAID,aAAa;oCACfL,iBAAiBG,KAAK,CAACE,WAAW,GAAGA;gCACvC;4BACF;4BACA;wBAEF,KAAK;4BACHL,iBAAiBG,KAAK,CAACI,WAAW,GAAG,CAAC;4BAEtC,IAAIX,WAAW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aAAa/B,WAAW8B,MAAM,CAAE;oBACzC,IAAIjC,2BAA2BS,QAAQ,CAACyB,YAAmB;wBACzD;oBACF;oBAEA,IAAIA,cAAc,cAAc;wBAC9B3B,iBAAiB0B,MAAM,CAACE,UAAU,GAAGhC,WAAW8B,MAAM,CAACE,UAAU,EAAEC,IAAI,CAACC;4BACtE,MAAMC,gBAAgB;gCAAE,GAAGD,IAAI;4BAAC;4BAChC,IAAI,uBAAuBC,eAAe;gCACxC,OAAOA,cAAcC,iBAAiB;4BACxC;4BACA,OAAOD;wBACT;oBACF,OAAO;;wBACH/B,iBAAiB0B,MAAM,AAAQ,CAACC,UAAU,GAC1C/B,WAAW8B,MAAM,CAACC,UAAyC;oBAC/D;gBACF;gBAEA;YAEF;;gBACI3B,gBAAwB,CAACC,IAAI,GAAGL,UAAU,CAACK,IAAuC;QACxF;IACF;IAEA,OAAOD;AACT,EAAC;AAED,OAAO,MAAMiC,gCAAgC,CAAC,EAC5CC,WAAW,EACXrC,aAAa,EACbC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMoC,oBAAoB,IAAIC,MAAMF,YAAYG,MAAM;IAEtD,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,YAAYG,MAAM,EAAEC,IAAK;QAC3C,MAAM1C,aAAasC,WAAW,CAACI,EAAE;QAEjCH,iBAAiB,CAACG,EAAE,GAAG3C,6BAA6B;YAClDC;YACAC;YACAC;YACAC;QACF;IACF;IAEA,OAAOoC;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../src/collections/config/client.ts"],"sourcesContent":["import type { I18nClient, TFunction } from '@payloadcms/translations'\n\nimport type { StaticDescription } from '../../admin/types.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type {\n LivePreviewConfig,\n ServerOnlyLivePreviewProperties,\n StaticLabel,\n} from '../../config/types.js'\nimport type { ClientField } from '../../fields/config/client.js'\nimport type { Payload } from '../../types/index.js'\nimport type { SanitizedUploadConfig } from '../../uploads/types.js'\nimport type { SanitizedCollectionConfig } from './types.js'\n\nimport { createClientFields } from '../../fields/config/client.js'\n\nexport type ServerOnlyCollectionProperties = keyof Pick<\n SanitizedCollectionConfig,\n | 'access'\n | 'custom'\n | 'endpoints'\n | 'flattenedFields'\n | 'hooks'\n | 'indexes'\n | 'joins'\n | 'polymorphicJoins'\n | 'sanitizedIndexes'\n>\n\nexport type ServerOnlyCollectionAdminProperties = keyof Pick<\n SanitizedCollectionConfig['admin'],\n 'baseFilter' | 'baseListFilter' | 'components' | 'formatDocURL' | 'hidden'\n>\n\nexport type ServerOnlyUploadProperties = keyof Pick<\n SanitizedCollectionConfig['upload'],\n | 'adminThumbnail'\n | 'externalFileHeaderFilter'\n | 'handlers'\n | 'modifyResponseHeaders'\n | 'withMetadata'\n>\n\nexport type ClientCollectionConfig = {\n admin: {\n description?: StaticDescription\n livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>\n preview?: boolean\n } & Omit<\n SanitizedCollectionConfig['admin'],\n | 'components'\n | 'description'\n | 'formatDocURL'\n | 'joins'\n | 'livePreview'\n | 'preview'\n | ServerOnlyCollectionAdminProperties\n >\n auth?: { verify?: true } & Omit<\n SanitizedCollectionConfig['auth'],\n 'forgotPassword' | 'strategies' | 'verify'\n >\n fields: ClientField[]\n labels: {\n plural: StaticLabel\n singular: StaticLabel\n }\n} & Omit<\n SanitizedCollectionConfig,\n 'admin' | 'auth' | 'fields' | 'labels' | ServerOnlyCollectionProperties\n>\n\nconst serverOnlyCollectionProperties: Partial<ServerOnlyCollectionProperties>[] = [\n 'hooks',\n 'access',\n 'endpoints',\n 'custom',\n 'joins',\n 'polymorphicJoins',\n 'flattenedFields',\n 'indexes',\n 'sanitizedIndexes',\n // `upload`\n // `admin`\n // are all handled separately\n]\n\nconst serverOnlyUploadProperties: Partial<ServerOnlyUploadProperties>[] = [\n 'adminThumbnail',\n 'externalFileHeaderFilter',\n 'handlers',\n 'modifyResponseHeaders',\n 'withMetadata',\n]\n\nconst serverOnlyCollectionAdminProperties: Partial<ServerOnlyCollectionAdminProperties>[] = [\n 'hidden',\n 'baseFilter',\n 'baseListFilter',\n 'components',\n 'formatDocURL',\n // 'preview' is handled separately\n // `livePreview` is handled separately\n]\n\nexport const createClientCollectionConfig = ({\n collection,\n defaultIDType,\n i18n,\n importMap,\n}: {\n collection: SanitizedCollectionConfig\n defaultIDType: Payload['config']['db']['defaultIDType']\n i18n: I18nClient\n importMap: ImportMap\n}): ClientCollectionConfig => {\n const clientCollection = {} as Partial<ClientCollectionConfig>\n\n for (const key in collection) {\n if (serverOnlyCollectionProperties.includes(key as any)) {\n continue\n }\n switch (key) {\n case 'admin':\n if (!collection.admin) {\n break\n }\n\n clientCollection.admin = {} as ClientCollectionConfig['admin']\n\n for (const adminKey in collection.admin) {\n if (serverOnlyCollectionAdminProperties.includes(adminKey as any)) {\n continue\n }\n\n switch (adminKey) {\n case 'description':\n if (\n typeof collection.admin.description === 'string' ||\n typeof collection.admin.description === 'object'\n ) {\n if (collection.admin.description) {\n clientCollection.admin.description = collection.admin.description\n }\n } else if (typeof collection.admin.description === 'function') {\n const description = collection.admin.description({ t: i18n.t as TFunction })\n\n if (description) {\n clientCollection.admin.description = description\n }\n }\n break\n\n case 'livePreview':\n clientCollection.admin.livePreview = {}\n\n if (collection.admin.livePreview?.breakpoints) {\n clientCollection.admin.livePreview.breakpoints =\n collection.admin.livePreview.breakpoints\n }\n\n break\n\n case 'preview':\n if (collection.admin.preview) {\n clientCollection.admin.preview = true\n }\n\n break\n\n default:\n ;(clientCollection as any).admin[adminKey] =\n collection.admin[adminKey as keyof SanitizedCollectionConfig['admin']]\n }\n }\n\n break\n\n case 'auth':\n if (!collection.auth) {\n break\n }\n\n clientCollection.auth = {} as { verify?: true } & SanitizedCollectionConfig['auth']\n\n if (collection.auth.cookies) {\n clientCollection.auth.cookies = collection.auth.cookies\n }\n\n if (collection.auth.depth !== undefined) {\n // Check for undefined as it can be a number (0)\n clientCollection.auth.depth = collection.auth.depth\n }\n\n if (collection.auth.disableLocalStrategy) {\n clientCollection.auth.disableLocalStrategy = collection.auth.disableLocalStrategy\n }\n\n if (collection.auth.lockTime !== undefined) {\n // Check for undefined as it can be a number (0)\n clientCollection.auth.lockTime = collection.auth.lockTime\n }\n\n if (collection.auth.loginWithUsername) {\n clientCollection.auth.loginWithUsername = collection.auth.loginWithUsername\n }\n\n if (collection.auth.maxLoginAttempts !== undefined) {\n // Check for undefined as it can be a number (0)\n clientCollection.auth.maxLoginAttempts = collection.auth.maxLoginAttempts\n }\n\n if (collection.auth.removeTokenFromResponses) {\n clientCollection.auth.removeTokenFromResponses = collection.auth.removeTokenFromResponses\n }\n\n if (collection.auth.useAPIKey) {\n clientCollection.auth.useAPIKey = collection.auth.useAPIKey\n }\n\n if (collection.auth.tokenExpiration) {\n clientCollection.auth.tokenExpiration = collection.auth.tokenExpiration\n }\n\n if (collection.auth.verify) {\n clientCollection.auth.verify = true\n }\n\n break\n\n case 'fields':\n clientCollection.fields = createClientFields({\n defaultIDType,\n fields: collection.fields,\n i18n,\n importMap,\n })\n\n break\n\n case 'labels':\n clientCollection.labels = {\n plural:\n typeof collection.labels.plural === 'function'\n ? collection.labels.plural({ i18n, t: i18n.t as TFunction })\n : collection.labels.plural,\n singular:\n typeof collection.labels.singular === 'function'\n ? collection.labels.singular({ i18n, t: i18n.t as TFunction })\n : collection.labels.singular,\n }\n\n break\n\n case 'upload':\n if (!collection.upload) {\n break\n }\n\n clientCollection.upload = {} as SanitizedUploadConfig\n\n for (const uploadKey in collection.upload) {\n if (serverOnlyUploadProperties.includes(uploadKey as any)) {\n continue\n }\n\n if (uploadKey === 'imageSizes') {\n clientCollection.upload.imageSizes = collection.upload.imageSizes?.map((size) => {\n const sanitizedSize = { ...size }\n if ('generateImageName' in sanitizedSize) {\n delete sanitizedSize.generateImageName\n }\n return sanitizedSize\n })\n } else {\n ;(clientCollection.upload as any)[uploadKey] =\n collection.upload[uploadKey as keyof SanitizedUploadConfig]\n }\n }\n\n break\n\n default:\n ;(clientCollection as any)[key] = collection[key as keyof SanitizedCollectionConfig]\n }\n }\n\n return clientCollection as ClientCollectionConfig\n}\n\nexport const createClientCollectionConfigs = ({\n collections,\n defaultIDType,\n i18n,\n importMap,\n}: {\n collections: SanitizedCollectionConfig[]\n defaultIDType: Payload['config']['db']['defaultIDType']\n i18n: I18nClient\n importMap: ImportMap\n}): ClientCollectionConfig[] => {\n const clientCollections = new Array(collections.length)\n\n for (let i = 0; i < collections.length; i++) {\n const collection = collections[i]!\n\n clientCollections[i] = createClientCollectionConfig({\n collection,\n defaultIDType,\n i18n,\n importMap,\n })\n }\n\n return clientCollections\n}\n"],"names":["createClientFields","serverOnlyCollectionProperties","serverOnlyUploadProperties","serverOnlyCollectionAdminProperties","createClientCollectionConfig","collection","defaultIDType","i18n","importMap","clientCollection","key","includes","admin","adminKey","description","t","livePreview","breakpoints","preview","auth","cookies","depth","undefined","disableLocalStrategy","lockTime","loginWithUsername","maxLoginAttempts","removeTokenFromResponses","useAPIKey","tokenExpiration","verify","fields","labels","plural","singular","upload","uploadKey","imageSizes","map","size","sanitizedSize","generateImageName","createClientCollectionConfigs","collections","clientCollections","Array","length","i"],"mappings":"AAcA,SAASA,kBAAkB,QAAQ,gCAA+B;AA0DlE,MAAMC,iCAA4E;IAChF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAID;AAED,MAAMC,6BAAoE;IACxE;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,sCAAsF;IAC1F;IACA;IACA;IACA;IACA;CAGD;AAED,OAAO,MAAMC,+BAA+B,CAAC,EAC3CC,UAAU,EACVC,aAAa,EACbC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMC,mBAAmB,CAAC;IAE1B,IAAK,MAAMC,OAAOL,WAAY;QAC5B,IAAIJ,+BAA+BU,QAAQ,CAACD,MAAa;YACvD;QACF;QACA,OAAQA;YACN,KAAK;gBACH,IAAI,CAACL,WAAWO,KAAK,EAAE;oBACrB;gBACF;gBAEAH,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;IAEA,OAAOD;AACT,EAAC;AAED,OAAO,MAAMiC,gCAAgC,CAAC,EAC5CC,WAAW,EACXrC,aAAa,EACbC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMoC,oBAAoB,IAAIC,MAAMF,YAAYG,MAAM;IAEtD,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,YAAYG,MAAM,EAAEC,IAAK;QAC3C,MAAM1C,aAAasC,WAAW,CAACI,EAAE;QAEjCH,iBAAiB,CAACG,EAAE,GAAG3C,6BAA6B;YAClDC;YACAC;YACAC;YACAC;QACF;IACF;IAEA,OAAOoC;AACT,EAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql';
2
2
  import type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials';
3
- import type { CustomUpload } from '../../admin/types.js';
3
+ import type { CustomUpload, ViewTypes } from '../../admin/types.js';
4
4
  import type { Arguments as MeArguments } from '../../auth/operations/me.js';
5
5
  import type { Arguments as RefreshArguments, Result as RefreshResult } from '../../auth/operations/refresh.js';
6
6
  import type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js';
@@ -301,6 +301,27 @@ export type CollectionAdminOptions = {
301
301
  enableListViewSelectAPI?: boolean;
302
302
  enableRichTextLink?: boolean;
303
303
  enableRichTextRelationship?: boolean;
304
+ /**
305
+ * Function to format the URL for document links in the list view.
306
+ * Return null to disable linking for that document.
307
+ * Return a string to customize the link destination.
308
+ * If not provided, uses the default admin edit URL.
309
+ */
310
+ formatDocURL?: (args: {
311
+ collectionSlug: string;
312
+ /**
313
+ * The default URL that would normally be used for this document link.
314
+ * You can return this as-is, modify it, or completely replace it.
315
+ */
316
+ defaultURL: string;
317
+ doc: Record<string, unknown>;
318
+ req: PayloadRequest;
319
+ /**
320
+ * The current view context where the link is being generated.
321
+ * Most relevant values for document linking are 'list' and 'trash'.
322
+ */
323
+ viewType?: ViewTypes;
324
+ }) => null | string;
304
325
  /**
305
326
  * Specify a navigational group for collections in the admin sidebar.
306
327
  * - Provide a string to place the entity in a custom group.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,KAAK,EACV,SAAS,IAAI,gBAAgB,EAC7B,MAAM,IAAI,aAAa,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EACV,KAAK,EACL,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,WAAW,EACZ,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAA;AAC5E,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACZ,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB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,OAAO,CAAA;KAC1B,EAAE,CAAA;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type { CollectionFoldersConfiguration } from '../../folders/types.js'\nimport type {\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /**\n * The collection which this hook is being run on\n */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Inject custom components before the document controls\n */\n beforeDocumentControls?: CustomComponent[]\n /**\n * Inject custom components within the 3-dot menu dropdown\n */\n editMenuItems?: CustomComponent[]\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace, modify, or add new \"document\" views.\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\n edit?: EditConfig\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n /**\n * Performance opt-in. If true, will use the [Select API](https://payloadcms.com/docs/queries/select) when\n * loading the list view to query only the active columns, as opposed to the entire documents.\n * If your cells require specific fields that may be unselected, such as within hooks, etc.,\n * use `forceSelect` in conjunction with this property.\n *\n * @experimental This is an experimental feature and may change in the future. Use at your own discretion.\n */\n enableListViewSelectAPI?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * @description Enable grouping by a field in the list view.\n * Uses `payload.findDistinct` under the hood to populate the group-by options.\n *\n * @experimental This option is currently in beta and may change in future releases. Use at your own discretion.\n */\n groupBy?: boolean\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => boolean | Promise<boolean>\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * Disable the bulk edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enables folders for this collection\n */\n folders?: boolean | CollectionFoldersConfiguration\n /**\n * Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks\n */\n forceSelect?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://observablehq.com/@dgreensp/implementing-fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @experimental This is a beta feature and its behavior may be refined in future releases.\n * @default false\n */\n trash?: boolean\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 /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'\n > {\n admin: CollectionAdminOptions\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n folders: CollectionFoldersConfiguration | false\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n deletedAt?: null | string\n docId?: any\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n deletedAt?: null | string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAuuBrD,WAQC"}
1
+ {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload, ViewTypes } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type { CollectionFoldersConfiguration } from '../../folders/types.js'\nimport type {\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /**\n * The collection which this hook is being run on\n */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Inject custom components before the document controls\n */\n beforeDocumentControls?: CustomComponent[]\n /**\n * Inject custom components within the 3-dot menu dropdown\n */\n editMenuItems?: CustomComponent[]\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace, modify, or add new \"document\" views.\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\n edit?: EditConfig\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n /**\n * Performance opt-in. If true, will use the [Select API](https://payloadcms.com/docs/queries/select) when\n * loading the list view to query only the active columns, as opposed to the entire documents.\n * If your cells require specific fields that may be unselected, such as within hooks, etc.,\n * use `forceSelect` in conjunction with this property.\n *\n * @experimental This is an experimental feature and may change in the future. Use at your own discretion.\n */\n enableListViewSelectAPI?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * @description Enable grouping by a field in the list view.\n * Uses `payload.findDistinct` under the hood to populate the group-by options.\n *\n * @experimental This option is currently in beta and may change in future releases. Use at your own discretion.\n */\n groupBy?: boolean\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => boolean | Promise<boolean>\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * Disable the bulk edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enables folders for this collection\n */\n folders?: boolean | CollectionFoldersConfiguration\n /**\n * Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks\n */\n forceSelect?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://observablehq.com/@dgreensp/implementing-fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @experimental This is a beta feature and its behavior may be refined in future releases.\n * @default false\n */\n trash?: boolean\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 /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'\n > {\n admin: CollectionAdminOptions\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n folders: CollectionFoldersConfiguration | false\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n deletedAt?: null | string\n docId?: any\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n deletedAt?: null | string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GA4vBrD,WAQC"}
@@ -69,10 +69,14 @@ export type LivePreviewConfig = {
69
69
  width: number | string;
70
70
  }[];
71
71
  /**
72
- The URL of the frontend application. This will be rendered within an `iframe` as its `src`.
73
- Payload will send a `window.postMessage()` to this URL with the document data in real-time.
74
- The frontend application is responsible for receiving the message and updating the UI accordingly.
75
- Use the `useLivePreview` hook to get started in React applications.
72
+ * The URL of the frontend application. This will be rendered within an `iframe` as its `src`.
73
+ * Payload will send a `window.postMessage()` to this URL with the document data in real-time.
74
+ * The frontend application is responsible for receiving the message and updating the UI accordingly.
75
+ * Use the `useLivePreview` hook to get started in React applications.
76
+ *
77
+ * Note: this function may run often if autosave is enabled with a small interval.
78
+ * For performance, avoid long-running tasks or expensive operations within this function,
79
+ * or if you need to do something more complex, cache your function as needed.
76
80
  */
77
81
  url?: ((args: {
78
82
  collectionConfig?: SanitizedCollectionConfig;