payload 4.0.0-internal.c7d5de4 → 4.0.0-internal.cd69eef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collections/config/client.d.ts +9 -2
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js +7 -0
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +4 -0
- package/dist/config/sanitize.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +3 -5
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/index.bundled.d.ts +3920 -3873
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/endpoints/uploadInstructions.d.ts +3 -0
- package/dist/uploads/endpoints/uploadInstructions.d.ts.map +1 -0
- package/dist/uploads/endpoints/uploadInstructions.js +38 -0
- package/dist/uploads/endpoints/uploadInstructions.js.map +1 -0
- package/dist/uploads/types.d.ts +47 -1
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +5 -4
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/versions/payloadPackageList.d.ts.map +1 -1
- package/dist/versions/payloadPackageList.js +1 -0
- package/dist/versions/payloadPackageList.js.map +1 -1
- package/package.json +2 -2
- package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts +0 -10
- package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts.map +0 -1
- package/dist/fields/hooks/beforeValidate/stripNullRows.js +0 -18
- package/dist/fields/hooks/beforeValidate/stripNullRows.js.map +0 -1
|
@@ -5,10 +5,15 @@ import type { LivePreviewConfig, ServerOnlyLivePreviewProperties, StaticLabel }
|
|
|
5
5
|
import type { ClientField } from '../../fields/config/client.js';
|
|
6
6
|
import type { ClientHierarchyConfig } from '../../hierarchy/types.js';
|
|
7
7
|
import type { Payload } from '../../types/index.js';
|
|
8
|
+
import type { SanitizedUploadConfig } from '../../uploads/types.js';
|
|
8
9
|
import type { SanitizedCollectionConfig } from './types.js';
|
|
9
10
|
export type ServerOnlyCollectionProperties = keyof Pick<SanitizedCollectionConfig, 'access' | 'custom' | 'endpoints' | 'flattenedFields' | 'hooks' | 'indexes' | 'joins' | 'polymorphicJoins' | 'sanitizedIndexes' | 'select'>;
|
|
10
11
|
export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], 'baseFilter' | 'baseListFilter' | 'components' | 'formatDocURL' | 'hidden'>;
|
|
11
|
-
export type ServerOnlyUploadProperties = keyof Pick<SanitizedCollectionConfig['upload'], 'admin' | 'adminThumbnail' | 'externalFileHeaderFilter' | 'handlers' | 'modifyResponseHeaders' | 'withMetadata'>;
|
|
12
|
+
export type ServerOnlyUploadProperties = keyof Pick<SanitizedCollectionConfig['upload'], 'admin' | 'adminThumbnail' | 'externalFileHeaderFilter' | 'handlers' | 'modifyResponseHeaders' | 'uploadInstructions' | 'withMetadata'>;
|
|
13
|
+
type ClientUploadConfig = {
|
|
14
|
+
/** Whether this collection provides separate upload instructions. */
|
|
15
|
+
uploadInstructions?: true;
|
|
16
|
+
} & Omit<SanitizedUploadConfig, 'uploadInstructions'>;
|
|
12
17
|
export type ClientCollectionConfig = {
|
|
13
18
|
admin: {
|
|
14
19
|
description?: StaticDescription;
|
|
@@ -24,7 +29,8 @@ export type ClientCollectionConfig = {
|
|
|
24
29
|
plural: StaticLabel;
|
|
25
30
|
singular: StaticLabel;
|
|
26
31
|
};
|
|
27
|
-
|
|
32
|
+
upload: ClientUploadConfig;
|
|
33
|
+
} & Omit<SanitizedCollectionConfig, 'admin' | 'auth' | 'fields' | 'hierarchy' | 'labels' | 'upload' | ServerOnlyCollectionProperties>;
|
|
28
34
|
export declare const createClientCollectionConfig: ({ collection, defaultIDType, i18n, importMap, }: {
|
|
29
35
|
collection: SanitizedCollectionConfig;
|
|
30
36
|
defaultIDType: Payload['config']['db']['defaultIDType'];
|
|
@@ -37,4 +43,5 @@ export declare const createClientCollectionConfigs: ({ collections, defaultIDTyp
|
|
|
37
43
|
i18n: I18nClient;
|
|
38
44
|
importMap: ImportMap;
|
|
39
45
|
}) => ClientCollectionConfig[];
|
|
46
|
+
export {};
|
|
40
47
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -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,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;
|
|
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,E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'uploadInstructions',
|
|
20
21
|
'withMetadata'
|
|
21
22
|
];
|
|
22
23
|
const serverOnlyCollectionAdminProperties = [
|
|
@@ -150,6 +151,12 @@ export const createClientCollectionConfig = ({ collection, defaultIDType, i18n,
|
|
|
150
151
|
}
|
|
151
152
|
clientCollection.upload = {};
|
|
152
153
|
for(const uploadKey in collection.upload){
|
|
154
|
+
if (uploadKey === 'uploadInstructions') {
|
|
155
|
+
if (collection.upload.uploadInstructions) {
|
|
156
|
+
clientCollection.upload.uploadInstructions = true;
|
|
157
|
+
}
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
153
160
|
if (serverOnlyUploadProperties.includes(uploadKey)) {
|
|
154
161
|
continue;
|
|
155
162
|
}
|
|
@@ -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 { ClientHierarchyConfig } from '../../hierarchy/types.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 | 'select'\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 | 'admin'\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 hierarchy?: ClientHierarchyConfig | false\n labels: {\n plural: StaticLabel\n singular: StaticLabel\n }\n} & Omit<\n SanitizedCollectionConfig,\n 'admin' | 'auth' | 'fields' | 'hierarchy' | '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 'select',\n // `upload`\n // `admin`\n // are all handled separately\n]\n\nconst serverOnlyUploadProperties: Partial<ServerOnlyUploadProperties>[] = [\n 'admin',\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 'hierarchy': {\n if (!collection.hierarchy || typeof collection.hierarchy !== 'object') {\n clientCollection.hierarchy = false\n break\n }\n\n // Strip slugify function as it can't cross server-client boundary\n const { slugify: _slugify, ...clientHierarchy } = collection.hierarchy\n clientCollection.hierarchy = clientHierarchy as ClientHierarchyConfig\n\n break\n }\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","hierarchy","slugify","_slugify","clientHierarchy","labels","plural","singular","upload","uploadKey","imageSizes","map","size","sanitizedSize","generateImageName","createClientCollectionConfigs","collections","clientCollections","Array","length","i"],"mappings":"AAeA,SAASA,kBAAkB,QAAQ,gCAA+B;AA6DlE,MAAMC,iCAA4E;IAChF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAID;AAED,MAAMC,6BAAoE;IACxE;IACA;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,iBAAiBG,KAAK,GAAG,CAAC;gBAE1B,IAAK,MAAMC,YAAYR,WAAWO,KAAK,CAAE;oBACvC,IAAIT,oCAAoC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,OAAO;;wBACHnC,iBAAiB8B,MAAM,AAAQ,CAACC,UAAU,GAC1CnC,WAAWkC,MAAM,CAACC,UAAyC;oBAC/D;gBACF;gBAEA;YAEF;;gBACI/B,gBAAwB,CAACC,IAAI,GAAGL,UAAU,CAACK,IAAuC;QACxF;IACF;IAEA,OAAOD;AACT,EAAC;AAED,OAAO,MAAMqC,gCAAgC,CAAC,EAC5CC,WAAW,EACXzC,aAAa,EACbC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMwC,oBAAoB,IAAIC,MAAMF,YAAYG,MAAM;IAEtD,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,YAAYG,MAAM,EAAEC,IAAK;QAC3C,MAAM9C,aAAa0C,WAAW,CAACI,EAAE;QAEjCH,iBAAiB,CAACG,EAAE,GAAG/C,6BAA6B;YAClDC;YACAC;YACAC;YACAC;QACF;IACF;IAEA,OAAOwC;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 { ClientHierarchyConfig } from '../../hierarchy/types.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 | 'select'\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 | 'admin'\n | 'adminThumbnail'\n | 'externalFileHeaderFilter'\n | 'handlers'\n | 'modifyResponseHeaders'\n | 'uploadInstructions'\n | 'withMetadata'\n>\n\ntype ClientUploadConfig = {\n /** Whether this collection provides separate upload instructions. */\n uploadInstructions?: true\n} & Omit<SanitizedUploadConfig, 'uploadInstructions'>\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 hierarchy?: ClientHierarchyConfig | false\n labels: {\n plural: StaticLabel\n singular: StaticLabel\n }\n upload: ClientUploadConfig\n} & Omit<\n SanitizedCollectionConfig,\n 'admin' | 'auth' | 'fields' | 'hierarchy' | 'labels' | 'upload' | 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 'select',\n // `upload`\n // `admin`\n // are all handled separately\n]\n\nconst serverOnlyUploadProperties: Partial<ServerOnlyUploadProperties>[] = [\n 'admin',\n 'adminThumbnail',\n 'externalFileHeaderFilter',\n 'handlers',\n 'modifyResponseHeaders',\n 'uploadInstructions',\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 'hierarchy': {\n if (!collection.hierarchy || typeof collection.hierarchy !== 'object') {\n clientCollection.hierarchy = false\n break\n }\n\n // Strip slugify function as it can't cross server-client boundary\n const { slugify: _slugify, ...clientHierarchy } = collection.hierarchy\n clientCollection.hierarchy = clientHierarchy as ClientHierarchyConfig\n\n break\n }\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 ClientUploadConfig\n\n for (const uploadKey in collection.upload) {\n if (uploadKey === 'uploadInstructions') {\n if (collection.upload.uploadInstructions) {\n clientCollection.upload.uploadInstructions = true\n }\n continue\n }\n\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","hierarchy","slugify","_slugify","clientHierarchy","labels","plural","singular","upload","uploadKey","uploadInstructions","imageSizes","map","size","sanitizedSize","generateImageName","createClientCollectionConfigs","collections","clientCollections","Array","length","i"],"mappings":"AAeA,SAASA,kBAAkB,QAAQ,gCAA+B;AAoElE,MAAMC,iCAA4E;IAChF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAID;AAED,MAAMC,6BAAoE;IACxE;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,sCAAsF;IAC1F;IACA;IACA;IACA;IACA;CAGD;AAED,OAAO,MAAMC,+BAA+B,CAAC,EA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AAanC,WAAWkC,MAAM,CAAE;oBACzC,IAAIC,cAAc,sBAAsB;wBACtC,IAAInC,WAAWkC,MAAM,CAACE,kBAAkB,EAAE;4BACxChC,iBAAiB8B,MAAM,CAACE,kBAAkB,GAAG;wBAC/C;wBACA;oBACF;oBAEA,IAAIvC,2BAA2BS,QAAQ,CAAC6B,YAAmB;wBACzD;oBACF;oBAEA,IAAIA,cAAc,cAAc;wBAC9B/B,iBAAiB8B,MAAM,CAACG,UAAU,GAAGrC,WAAWkC,MAAM,CAACG,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;;wBACHpC,iBAAiB8B,MAAM,AAAQ,CAACC,UAAU,GAC1CnC,WAAWkC,MAAM,CAACC,UAAyC;oBAC/D;gBACF;gBAEA;YAEF;;gBACI/B,gBAAwB,CAACC,IAAI,GAAGL,UAAU,CAACK,IAAuC;QACxF;IACF;IAEA,OAAOD;AACT,EAAC;AAED,OAAO,MAAMsC,gCAAgC,CAAC,EAC5CC,WAAW,EACX1C,aAAa,EACbC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMyC,oBAAoB,IAAIC,MAAMF,YAAYG,MAAM;IAEtD,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,YAAYG,MAAM,EAAEC,IAAK;QAC3C,MAAM/C,aAAa2C,WAAW,CAACI,EAAE;QAEjCH,iBAAiB,CAACG,EAAE,GAAGhD,6BAA6B;YAClDC;YACAC;YACAC;YACAC;QACF;IACF;IAEA,OAAOyC;AACT,EAAC"}
|
|
@@ -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,MAA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BAAgB,EAAE,OAAO,CAAA;KAC1B,EAAE,CAAA;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA"}
|
|
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,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACnE,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,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,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,EACV,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,e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AAG;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,KAAK,EAAE,cAAc,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,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, 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, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n SharedAdminComponents,\n SharedEditViewComponents,\n SharedEntityViews,\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 {\n HierarchyConfig,\n HierarchyJoinFieldConfig,\n SanitizedHierarchyConfig,\n} from '../../hierarchy/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n GeneratedTypes,\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 WithSelectFn,\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 {\n AfterOperationArg,\n BeforeOperationArg,\n OperationMap,\n} from '../operations/utilities/types.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\n/**\n * The ID type of a given collection (e.g. `string` or `number`), taken from its generated type.\n * Use this instead of the project-wide {@link DefaultDocumentIDType} when the collection slug is\n * known, since each collection can have its own ID type.\n */\nexport type IDTypeForCollectionSlug<TSlug extends CollectionSlug> =\n DataFromCollectionSlug<TSlug>['id']\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\n/**\n * Collection slugs that do not have drafts enabled.\n * Detects collections without drafts by checking for the absence of the `_status` field.\n */\nexport type CollectionsWithoutDrafts = {\n [TSlug in CollectionSlug]: DataFromCollectionSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[CollectionSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on collection configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on collections without drafts.\n */\nexport type DraftFlagFromCollectionSlug<TSlug extends CollectionSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends CollectionsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this collection does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data INPUT (e.g., create operations) - makes all fields optional except system fields\n * When creating a draft, required fields don't need to be provided as validation is skipped\n * The id field is optional since it's auto-generated\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n> &\n Partial<Pick<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\n/**\n * Helper type for draft data OUTPUT (e.g., query results) - makes user fields optional but keeps id required\n * When querying drafts, required fields may be null/undefined as validation is skipped, but system fields like id are always present\n */\nexport type QueryDraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n> &\n Partial<Pick<TData, 'createdAt' | 'deletedAt' | 'sizes' | 'updatedAt'>> &\n Pick<TData, 'id'>\n\nexport type QueryDraftDataFromCollectionSlug<TSlug extends CollectionSlug> =\n QueryDraftDataFromCollection<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<TOperationGeneric extends CollectionSlug = string> = (\n arg: BeforeOperationArg<TOperationGeneric>,\n) =>\n | Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]\n | Promise<Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]>\n | Promise<void>\n | void\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 /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\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 /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\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 /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: 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<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\n | Promise<\n Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\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\n/**\n * Configuration options for folder hierarchy preset.\n * Subset of HierarchyConfig with folder-appropriate defaults applied.\n */\nexport type FoldersConfig = {\n admin?: {\n components?: {\n Icon?: PayloadComponent\n }\n injectSidebarTab?: boolean\n treeLimit?: number\n useHeaderButton?: boolean\n }\n collectionSpecific?:\n | {\n fieldName?: string\n }\n | boolean\n joinField?: HierarchyJoinFieldConfig\n parentFieldName?: string\n slugField?: string\n slugify?: (text: string) => string\n slugPathFieldName?: string\n titlePathFieldName?: string\n}\n\n/**\n * Configuration options for tags hierarchy preset.\n * Same as FoldersConfig but allowHasMany can be overridden.\n */\nexport type TagsConfig = {\n allowHasMany?: boolean\n} & FoldersConfig\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 /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n } & SharedEditViewComponents\n listMenuItems?: CustomComponent[]\n views?: {\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 NoResults?: CustomComponent\n }\n } & SharedEntityViews\n } & Omit<SharedAdminComponents, 'edit' | 'views'>\n /** Extension point to add your custom data. Available in server and client. */\n custom?: CollectionAdminCustom\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 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 * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\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 /**\n * Configuration for bulk operations\n */\n /** Extension point to add your custom data. Server only. */\n custom?: CollectionCustom\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 delete operation for the collection in the admin panel and the API\n */\n disableBulkDelete?: boolean\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 * Enable folder hierarchy preset for this collection.\n * Sets hierarchy with folder defaults: allowHasMany: false, FolderIcon, useHeaderButton: true\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `tags` or `hierarchy`.\n */\n folders?: boolean | FoldersConfig\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 * Enable hierarchical tree structure for this collection\n *\n * Use `true` to enable with defaults (auto-detects parent field)\n * or provide configuration object\n *\n * @example\n * // Enable with defaults\n * hierarchy: true\n *\n * @example\n * // Customize field names and slugify function\n * hierarchy: {\n * parentFieldName: 'parent',\n * slugify: (text) => customSlugify(text),\n * slugPathFieldName: '_breadcrumbPath'\n * }\n */\n hierarchy?: boolean | HierarchyConfig\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<TSlug>[]\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://payloadcms.com/docs/configuration/collections#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 * Enable tags hierarchy preset for this collection.\n * Sets hierarchy with tag defaults: allowHasMany: true, TagIcon\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `folders` or `hierarchy`.\n */\n tags?: boolean | TagsConfig\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 * @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} & Pick<\n WithSelectFn<\n IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n >,\n 'select'\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'\n | 'auth'\n | 'endpoints'\n | 'fields'\n | 'folder'\n | 'folders'\n | 'hierarchy'\n | 'slug'\n | 'tags'\n | 'upload'\n | '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 * Hierarchy configuration (when collection is a hierarchy type like folders or tags)\n */\n hierarchy: false | SanitizedHierarchyConfig\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n joins: SanitizedJoins\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n\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 isPublic: boolean\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type LocalizedMeta = {\n [locale: string]: {\n status: 'draft' | 'published'\n updatedAt: string\n }\n}\n\nexport type TypeWithID = {\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,GAy3BrD,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, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n SharedAdminComponents,\n SharedEditViewComponents,\n SharedEntityViews,\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 {\n HierarchyConfig,\n HierarchyJoinFieldConfig,\n SanitizedHierarchyConfig,\n} from '../../hierarchy/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n GeneratedTypes,\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 WithSelectFn,\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 {\n AfterOperationArg,\n BeforeOperationArg,\n OperationMap,\n} from '../operations/utilities/types.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\n/**\n * The ID type of a given collection (e.g. `string` or `number`), taken from its generated type.\n * Use this instead of the project-wide {@link DefaultDocumentIDType} when the collection slug is\n * known, since each collection can have its own ID type.\n */\nexport type IDTypeForCollectionSlug<TSlug extends CollectionSlug> = DataFromCollectionSlug<TSlug>['id']\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\n/**\n * Collection slugs that do not have drafts enabled.\n * Detects collections without drafts by checking for the absence of the `_status` field.\n */\nexport type CollectionsWithoutDrafts = {\n [TSlug in CollectionSlug]: DataFromCollectionSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[CollectionSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on collection configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on collections without drafts.\n */\nexport type DraftFlagFromCollectionSlug<TSlug extends CollectionSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends CollectionsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this collection does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data INPUT (e.g., create operations) - makes all fields optional except system fields\n * When creating a draft, required fields don't need to be provided as validation is skipped\n * The id field is optional since it's auto-generated\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n> &\n Partial<Pick<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\n/**\n * Helper type for draft data OUTPUT (e.g., query results) - makes user fields optional but keeps id required\n * When querying drafts, required fields may be null/undefined as validation is skipped, but system fields like id are always present\n */\nexport type QueryDraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n> &\n Partial<Pick<TData, 'createdAt' | 'deletedAt' | 'sizes' | 'updatedAt'>> &\n Pick<TData, 'id'>\n\nexport type QueryDraftDataFromCollectionSlug<TSlug extends CollectionSlug> =\n QueryDraftDataFromCollection<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<TOperationGeneric extends CollectionSlug = string> = (\n arg: BeforeOperationArg<TOperationGeneric>,\n) =>\n | Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]\n | Promise<Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]>\n | Promise<void>\n | void\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 /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\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 /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\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 /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: 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<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\n | Promise<\n Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\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\n/**\n * Configuration options for folder hierarchy preset.\n * Subset of HierarchyConfig with folder-appropriate defaults applied.\n */\nexport type FoldersConfig = {\n admin?: {\n components?: {\n Icon?: PayloadComponent\n }\n injectSidebarTab?: boolean\n treeLimit?: number\n useHeaderButton?: boolean\n }\n collectionSpecific?:\n | {\n fieldName?: string\n }\n | boolean\n joinField?: HierarchyJoinFieldConfig\n parentFieldName?: string\n slugField?: string\n slugify?: (text: string) => string\n slugPathFieldName?: string\n titlePathFieldName?: string\n}\n\n/**\n * Configuration options for tags hierarchy preset.\n * Same as FoldersConfig but allowHasMany can be overridden.\n */\nexport type TagsConfig = {\n allowHasMany?: boolean\n} & FoldersConfig\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 /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n } & SharedEditViewComponents\n listMenuItems?: CustomComponent[]\n views?: {\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 NoResults?: CustomComponent\n }\n } & SharedEntityViews\n } & Omit<SharedAdminComponents, 'edit' | 'views'>\n /** Extension point to add your custom data. Available in server and client. */\n custom?: CollectionAdminCustom\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 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 * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\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 /**\n * Configuration for bulk operations\n */\n /** Extension point to add your custom data. Server only. */\n custom?: CollectionCustom\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 delete operation for the collection in the admin panel and the API\n */\n disableBulkDelete?: boolean\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 * Enable folder hierarchy preset for this collection.\n * Sets hierarchy with folder defaults: allowHasMany: false, FolderIcon, useHeaderButton: true\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `tags` or `hierarchy`.\n */\n folders?: boolean | FoldersConfig\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 * Enable hierarchical tree structure for this collection\n *\n * Use `true` to enable with defaults (auto-detects parent field)\n * or provide configuration object\n *\n * @example\n * // Enable with defaults\n * hierarchy: true\n *\n * @example\n * // Customize field names and slugify function\n * hierarchy: {\n * parentFieldName: 'parent',\n * slugify: (text) => customSlugify(text),\n * slugPathFieldName: '_breadcrumbPath'\n * }\n */\n hierarchy?: boolean | HierarchyConfig\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<TSlug>[]\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://payloadcms.com/docs/configuration/collections#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 * Enable tags hierarchy preset for this collection.\n * Sets hierarchy with tag defaults: allowHasMany: true, TagIcon\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `folders` or `hierarchy`.\n */\n tags?: boolean | TagsConfig\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 * @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} & Pick<\n WithSelectFn<\n IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n >,\n 'select'\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'\n | 'auth'\n | 'endpoints'\n | 'fields'\n | 'folder'\n | 'folders'\n | 'hierarchy'\n | 'slug'\n | 'tags'\n | 'upload'\n | '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 * Hierarchy configuration (when collection is a hierarchy type like folders or tags)\n */\n hierarchy: false | SanitizedHierarchyConfig\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n joins: SanitizedJoins\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n\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 isPublic: boolean\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type LocalizedMeta = {\n [locale: string]: {\n status: 'draft' | 'published'\n updatedAt: string\n }\n}\n\nexport type TypeWithID = {\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,GAw3BrD,WAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,MAAM,EAIN,eAAe,EAIhB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,MAAM,EAIN,eAAe,EAIhB,MAAM,YAAY,CAAA;AAkOnB,eAAO,MAAM,cAAc,mBAA0B,MAAM,KAAG,OAAO,CAAC,eAAe,CA8YpF,CAAA"}
|
package/dist/config/sanitize.js
CHANGED
|
@@ -13,6 +13,7 @@ import { getPreferencesCollection, preferencesCollectionSlug } from '../preferen
|
|
|
13
13
|
import { getQueryPresetsConfig, queryPresetsCollectionSlug } from '../query-presets/config.js';
|
|
14
14
|
import { getDefaultJobsCollection, jobsCollectionSlug } from '../queues/config/collection.js';
|
|
15
15
|
import { getJobStatsGlobal } from '../queues/config/global.js';
|
|
16
|
+
import { uploadInstructionsEndpoint } from '../uploads/endpoints/uploadInstructions.js';
|
|
16
17
|
import { flattenAllFields, flattenBlock } from '../utilities/flattenAllFields.js';
|
|
17
18
|
import { hasScheduledPublishEnabled } from '../utilities/getVersionsConfig.js';
|
|
18
19
|
import { validateTimezones } from '../utilities/validateTimezones.js';
|
|
@@ -204,6 +205,9 @@ export const sanitizeConfig = async (incomingConfig)=>{
|
|
|
204
205
|
if (!config.endpoints) {
|
|
205
206
|
config.endpoints = [];
|
|
206
207
|
}
|
|
208
|
+
if (configWithDefaults.collections?.some(({ upload })=>typeof upload === 'object' && upload.uploadInstructions)) {
|
|
209
|
+
config.endpoints.push(uploadInstructionsEndpoint);
|
|
210
|
+
}
|
|
207
211
|
for (const endpoint of authRootEndpoints){
|
|
208
212
|
config.endpoints.push(endpoint);
|
|
209
213
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/sanitize.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport { en } from '@payloadcms/translations/languages/en'\n\nimport type { OrderableJoinInfo } from '../fields/config/sanitizeJoinField.js'\nimport type { CollectionSlug, GlobalSlug, SanitizedCollectionConfig } from '../index.js'\nimport type { SanitizedJobsConfig } from '../queues/config/types/index.js'\nimport type {\n Config,\n DashboardConfig,\n LocalizationConfigWithLabels,\n LocalizationConfigWithNoLabels,\n SanitizedConfig,\n Timezone,\n Widget,\n WidgetInstance,\n} from './types.js'\n\nimport { defaultUserCollection } from '../auth/defaultUser.js'\nimport { authRootEndpoints } from '../auth/endpoints/index.js'\nimport { sanitizeCollection } from '../collections/config/sanitize.js'\nimport { migrationsCollection } from '../database/migrations/migrationsCollection.js'\nimport { DuplicateCollection, InvalidConfiguration } from '../errors/index.js'\nimport { defaultTimezones } from '../fields/baseFields/timezone/defaultTimezones.js'\nimport { sanitizeGlobal } from '../globals/config/sanitize.js'\nimport { resolveHierarchyCollections } from '../hierarchy/resolveHierarchyCollections.js'\nimport { baseBlockFields, formatLabels, sanitizeFields } from '../index.js'\nimport {\n getLockedDocumentsCollection,\n lockedDocumentsCollectionSlug,\n} from '../locked-documents/config.js'\nimport { getPreferencesCollection, preferencesCollectionSlug } from '../preferences/config.js'\nimport { getQueryPresetsConfig, queryPresetsCollectionSlug } from '../query-presets/config.js'\nimport { getDefaultJobsCollection, jobsCollectionSlug } from '../queues/config/collection.js'\nimport { getJobStatsGlobal } from '../queues/config/global.js'\nimport { flattenAllFields, flattenBlock } from '../utilities/flattenAllFields.js'\nimport { hasScheduledPublishEnabled } from '../utilities/getVersionsConfig.js'\nimport { validateTimezones } from '../utilities/validateTimezones.js'\nimport { getSchedulePublishTask } from '../versions/schedule/job.js'\nimport { addDefaultsToConfig } from './defaults.js'\nimport { addOrderableEndpoint, addOrderableFieldsAndHook } from './orderable/index.js'\n\nconst sanitizeAdminConfig = (configToSanitize: Config): Partial<SanitizedConfig> => {\n const sanitizedConfig = { ...configToSanitize }\n\n // default logging level will be 'error' if not provided\n sanitizedConfig.loggingLevels = {\n Forbidden: 'info',\n Locked: 'info',\n MissingFile: 'info',\n NotFound: 'info',\n ValidationError: 'info',\n ...(sanitizedConfig.loggingLevels || {}),\n }\n // add default user collection if none provided\n if (!sanitizedConfig?.admin?.user) {\n const firstCollectionWithAuth = sanitizedConfig.collections!.find(({ auth }) => Boolean(auth))\n\n if (firstCollectionWithAuth) {\n sanitizedConfig.admin!.user = firstCollectionWithAuth.slug\n } else {\n sanitizedConfig.admin!.user = defaultUserCollection.slug\n sanitizedConfig.collections!.push(defaultUserCollection)\n }\n }\n\n const userCollection = sanitizedConfig.collections!.find(\n ({ slug }) => slug === sanitizedConfig.admin!.user,\n )\n\n if (!userCollection || !userCollection.auth) {\n throw new InvalidConfiguration(\n `${sanitizedConfig.admin!.user} is not a valid admin user collection`,\n )\n }\n\n if (sanitizedConfig?.admin?.timezones) {\n if (typeof configToSanitize?.admin?.timezones?.supportedTimezones === 'function') {\n sanitizedConfig.admin.timezones.supportedTimezones =\n configToSanitize.admin.timezones.supportedTimezones({ defaultTimezones })\n }\n\n if (!sanitizedConfig?.admin?.timezones?.supportedTimezones) {\n sanitizedConfig.admin.timezones.supportedTimezones = defaultTimezones\n }\n } else {\n sanitizedConfig.admin!.timezones = {\n supportedTimezones: defaultTimezones,\n }\n }\n\n validateTimezones({\n source: 'admin.timezones.supportedTimezones',\n timezones: sanitizedConfig.admin!.timezones.supportedTimezones as Timezone[],\n })\n\n return sanitizedConfig as unknown as Partial<SanitizedConfig>\n}\n\nconst addDefaultDashboardWidgets = async ({\n config,\n richTextSanitizationPromises,\n validRelationships,\n}: {\n config: Partial<SanitizedConfig>\n richTextSanitizationPromises: Array<(config: SanitizedConfig) => Promise<void>>\n validRelationships: string[]\n}) => {\n const collectionQueryFields: NonNullable<Widget['fields']> = [\n {\n name: 'title',\n type: 'text',\n label: ({ t }) => t('dashboard:widgetTitleLabel'),\n },\n {\n name: 'relatedCollection',\n type: 'select',\n label: ({ t }) => t('general:collection'),\n // Only offer collections that are visible in the admin UI. Collections hidden via a function\n // are kept since they may still be visible for some users.\n options: (config.collections ?? [])\n .filter((collection) => collection.admin?.hidden !== true)\n .map((collection) => ({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })),\n required: true,\n },\n {\n name: 'where',\n type: 'json',\n admin: {\n components: {\n Field: '@payloadcms/ui#QueryPresetsWhereField',\n },\n },\n label: ({ t }) => t('general:filters'),\n },\n {\n name: 'sortField',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/ui#CollectionQuerySortField',\n },\n },\n label: ({ t }) => t('dashboard:widgetSortFieldLabel'),\n },\n {\n name: 'sortDirection',\n type: 'select',\n defaultValue: 'desc',\n label: ({ t }) => t('dashboard:widgetSortDirectionLabel'),\n options: [\n {\n label: ({ t }) => t('general:ascending'),\n value: 'asc',\n },\n {\n label: ({ t }) => t('general:descending'),\n value: 'desc',\n },\n ],\n },\n {\n name: 'limit',\n type: 'number',\n defaultValue: 5,\n label: ({ t }) => t('dashboard:widgetLimitLabel'),\n max: 25,\n min: 1,\n },\n ]\n\n const recentlyViewedFields: NonNullable<Widget['fields']> = [\n {\n name: 'excludedCollections',\n type: 'select',\n admin: {\n components: {\n // Presents an inclusion filter (all collections checked by default) while persisting the\n // inverse as an exclusion list, so collections added later stay visible by default.\n Field: '@payloadcms/ui#RecentlyViewedCollectionsField',\n },\n },\n hasMany: true,\n label: ({ t }) => t('general:collections'),\n // Exclusion list, so an empty value shows every collection and newly added collections are\n // included by default. Hidden collections are never offered as options.\n options: (config.collections ?? [])\n .filter((collection) => collection.admin?.hidden !== true)\n .map((collection) => ({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })),\n },\n ]\n\n const adminConfig: NonNullable<Config['admin']> = config.admin ?? { dashboard: { widgets: [] } }\n const dashboard: DashboardConfig = (adminConfig.dashboard ??= { widgets: [] })\n\n dashboard.widgets.push({\n slug: 'collections',\n Component: '@payloadcms/ui/rsc#CollectionCards',\n minWidth: 'full',\n })\n dashboard.widgets.push({\n slug: 'collection-query',\n Component: '@payloadcms/ui/rsc#CollectionQueryWidget',\n fields: await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: collectionQueryFields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n }),\n minWidth: 'x-small',\n })\n dashboard.widgets.push({\n slug: 'activity',\n Component: '@payloadcms/ui/rsc#RecentlyViewedWidget',\n fields: await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: recentlyViewedFields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n }),\n label: ({ t }) => t('dashboard:widgetRecentlyViewedTitle'),\n minWidth: 'x-small',\n })\n dashboard.defaultLayout ??= [\n {\n widgetSlug: 'collections',\n width: 'full',\n } satisfies WidgetInstance,\n ]\n}\n\nexport const sanitizeConfig = async (incomingConfig: Config): Promise<SanitizedConfig> => {\n const configWithDefaults = addDefaultsToConfig(incomingConfig)\n\n const config: Partial<SanitizedConfig> = sanitizeAdminConfig(configWithDefaults)\n\n if (!config.endpoints) {\n config.endpoints = []\n }\n\n for (const endpoint of authRootEndpoints) {\n config.endpoints.push(endpoint)\n }\n\n if (config.localization && config.localization.locales?.length > 0) {\n // clone localization config so to not break everything\n const firstLocale = config.localization.locales[0]\n if (typeof firstLocale === 'string') {\n config.localization.localeCodes = [\n ...(config.localization as unknown as LocalizationConfigWithNoLabels).locales,\n ]\n\n // is string[], so convert to Locale[]\n config.localization.locales = (\n config.localization as unknown as LocalizationConfigWithNoLabels\n ).locales.map((locale) => ({\n code: locale,\n label: locale,\n rtl: false,\n toString: () => locale,\n }))\n } else {\n // is Locale[], so convert to string[] for localeCodes\n config.localization.localeCodes = config.localization.locales.map((locale) => locale.code)\n\n config.localization.locales = (\n config.localization as LocalizationConfigWithLabels\n ).locales.map((locale) => ({\n ...locale,\n toString: () => locale.code,\n }))\n }\n\n // Default fallback to true if not provided\n config.localization.fallback = config.localization?.fallback ?? true\n }\n\n const i18nConfig: SanitizedConfig['i18n'] = {\n fallbackLanguage: 'en',\n supportedLanguages: {\n en,\n },\n translations: {},\n }\n\n if (incomingConfig?.i18n) {\n i18nConfig.supportedLanguages =\n incomingConfig.i18n?.supportedLanguages || i18nConfig.supportedLanguages\n\n const supportedLangKeys = <AcceptedLanguages[]>Object.keys(i18nConfig.supportedLanguages)\n const fallbackLang = incomingConfig.i18n?.fallbackLanguage || i18nConfig.fallbackLanguage\n\n i18nConfig.fallbackLanguage = supportedLangKeys.includes(fallbackLang)\n ? fallbackLang\n : supportedLangKeys[0]!\n i18nConfig.translations =\n (incomingConfig.i18n?.translations as SanitizedConfig['i18n']['translations']) ||\n i18nConfig.translations\n }\n\n config.i18n = i18nConfig\n\n const richTextSanitizationPromises: Array<(config: SanitizedConfig) => Promise<void>> = []\n\n const schedulePublishCollections: CollectionSlug[] = []\n\n const queryPresetsCollections: CollectionSlug[] = []\n\n const schedulePublishGlobals: GlobalSlug[] = []\n\n const collectionSlugs = new Set<CollectionSlug>()\n\n const validRelationships = [\n ...(config.collections?.map((c) => c.slug) ?? []),\n jobsCollectionSlug,\n lockedDocumentsCollectionSlug,\n preferencesCollectionSlug,\n ]\n\n const dashboardWidgets = config.admin?.dashboard?.widgets ?? ([] as Widget[])\n\n for (const widget of dashboardWidgets) {\n if (widget.fields?.length) {\n widget.fields = await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: widget.fields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n })\n }\n }\n\n /**\n * Blocks sanitization needs to happen before collections, as collection/global join field sanitization needs config.blocks\n * to be populated with the sanitized blocks\n */\n config.blocks = []\n\n if (incomingConfig.blocks?.length) {\n for (const block of incomingConfig.blocks) {\n const sanitizedBlock = block\n\n if (sanitizedBlock._sanitized === true) {\n continue\n }\n sanitizedBlock._sanitized = true\n\n sanitizedBlock.fields = sanitizedBlock.fields.concat(baseBlockFields)\n\n sanitizedBlock.labels = !sanitizedBlock.labels\n ? formatLabels(sanitizedBlock.slug)\n : sanitizedBlock.labels\n\n sanitizedBlock.fields = await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: sanitizedBlock.fields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n const flattenedSanitizedBlock = flattenBlock({ block })\n\n config.blocks.push(flattenedSanitizedBlock)\n }\n }\n\n // Track orderable join fields during sanitization\n const orderableJoins: OrderableJoinInfo[] = []\n\n for (let i = 0; i < config.collections!.length; i++) {\n if (collectionSlugs.has(config.collections![i]!.slug)) {\n throw new DuplicateCollection('slug', config.collections![i]!.slug)\n }\n\n collectionSlugs.add(config.collections![i]!.slug)\n\n const draftsConfig = config.collections![i]?.versions?.drafts\n\n if (typeof draftsConfig === 'object' && draftsConfig.schedulePublish) {\n schedulePublishCollections.push(config.collections![i]!.slug)\n }\n\n if (config.collections![i]!.enableQueryPresets) {\n queryPresetsCollections.push(config.collections![i]!.slug)\n\n if (!validRelationships.includes(queryPresetsCollectionSlug)) {\n validRelationships.push(queryPresetsCollectionSlug)\n }\n }\n\n config.collections![i] = await sanitizeCollection(\n config as unknown as Config,\n config.collections![i]!,\n richTextSanitizationPromises,\n validRelationships,\n orderableJoins,\n )\n }\n\n // Process orderable features after all collections are sanitized\n const fieldsToAdd = new Map<SanitizedCollectionConfig, string[]>()\n const joinFieldPathsByCollection = new Map<string, Map<string, string>>()\n\n // Handle collection.orderable\n for (const collection of config.collections!) {\n if (collection.orderable) {\n const currentFields = fieldsToAdd.get(collection) || []\n fieldsToAdd.set(collection, [...currentFields, '_order'])\n collection.defaultSort = collection.defaultSort ?? '_order'\n }\n }\n\n // Handle orderable join fields (tracked during sanitization)\n for (const joinInfo of orderableJoins) {\n const targetCollection = config.collections!.find(\n (c) => c.slug === joinInfo.targetCollectionSlug,\n )\n if (targetCollection) {\n const currentFields = fieldsToAdd.get(targetCollection) || []\n fieldsToAdd.set(targetCollection, [...currentFields, joinInfo.orderFieldName])\n\n const currentJoinFieldPaths =\n joinFieldPathsByCollection.get(targetCollection.slug) || new Map<string, string>()\n currentJoinFieldPaths.set(joinInfo.orderFieldName, joinInfo.joinFieldOn)\n joinFieldPathsByCollection.set(targetCollection.slug, currentJoinFieldPaths)\n }\n }\n\n // Add fields, hooks, and update flattenedFields\n for (const [collection, orderableFields] of fieldsToAdd) {\n await addOrderableFieldsAndHook(\n collection,\n config as unknown as Config,\n orderableFields,\n joinFieldPathsByCollection,\n )\n // Regenerate flattenedFields since we added new fields\n collection.flattenedFields = flattenAllFields({ fields: collection.fields })\n }\n\n // Add endpoint if any orderable features exist\n if (fieldsToAdd.size > 0) {\n addOrderableEndpoint(config as SanitizedConfig, joinFieldPathsByCollection)\n }\n\n if (config.globals!.length > 0) {\n for (let i = 0; i < config.globals!.length; i++) {\n if (hasScheduledPublishEnabled(config.globals![i]!)) {\n schedulePublishGlobals.push(config.globals![i]!.slug)\n }\n\n config.globals![i] = await sanitizeGlobal(\n config as unknown as Config,\n config.globals![i]!,\n richTextSanitizationPromises,\n validRelationships,\n )\n }\n }\n\n // Resolve hierarchy relationships across collections (also adds sidebar tabs)\n resolveHierarchyCollections(config as unknown as Config)\n\n if (schedulePublishCollections.length || schedulePublishGlobals.length) {\n ;((config.jobs ??= {} as SanitizedJobsConfig).tasks ??= []).push(\n getSchedulePublishTask({\n adminUserSlug: config.admin!.user,\n collections: schedulePublishCollections,\n globals: schedulePublishGlobals,\n }),\n )\n }\n\n ;(config.jobs ??= {} as SanitizedJobsConfig).enabled = Boolean(\n (Array.isArray(configWithDefaults.jobs?.tasks) && configWithDefaults.jobs?.tasks?.length) ||\n (Array.isArray(configWithDefaults.jobs?.workflows) &&\n configWithDefaults.jobs?.workflows?.length),\n )\n\n // Need to add default jobs collection before locked documents collections\n if (config.jobs.enabled) {\n // Check for schedule property in both tasks and workflows\n const hasScheduleProperty =\n (config?.jobs?.tasks?.length && config.jobs.tasks.some((task) => task.schedule)) ||\n (config?.jobs?.workflows?.length &&\n config.jobs.workflows.some((workflow) => workflow.schedule))\n\n if (hasScheduleProperty) {\n config.jobs.scheduling = true\n // Add payload-jobs-stats global for tracking when a job of a specific slug was last run\n ;(config.globals ??= []).push(\n await sanitizeGlobal(\n config as unknown as Config,\n getJobStatsGlobal(config as unknown as Config),\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n\n config.jobs.stats = true\n }\n\n let defaultJobsCollection = getDefaultJobsCollection(config.jobs)\n\n if (typeof config.jobs.jobsCollectionOverrides === 'function') {\n defaultJobsCollection = config.jobs.jobsCollectionOverrides({\n defaultJobsCollection,\n })\n }\n const sanitizedJobsCollection = await sanitizeCollection(\n config as unknown as Config,\n defaultJobsCollection,\n richTextSanitizationPromises,\n validRelationships,\n )\n\n ;(config.collections ??= []).push(sanitizedJobsCollection)\n }\n\n const lockedDocumentsCollection = getLockedDocumentsCollection(config as unknown as Config)\n\n if (lockedDocumentsCollection) {\n configWithDefaults.collections!.push(\n await sanitizeCollection(\n config as unknown as Config,\n lockedDocumentsCollection,\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n }\n\n configWithDefaults.collections!.push(\n await sanitizeCollection(\n config as unknown as Config,\n getPreferencesCollection(config as unknown as Config),\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n\n const migrations = await sanitizeCollection(\n config as unknown as Config,\n migrationsCollection,\n richTextSanitizationPromises,\n validRelationships,\n )\n\n // @ts-expect-error indexSortableFields is only valid for @payloadcms/db-mongodb\n if (config?.db?.indexSortableFields) {\n migrations.indexes = [\n {\n fields: ['batch', 'name'],\n unique: false,\n },\n ]\n }\n configWithDefaults.collections!.push(migrations)\n\n if (queryPresetsCollections.length > 0) {\n configWithDefaults.collections!.push(\n await sanitizeCollection(\n config as unknown as Config,\n getQueryPresetsConfig(config as unknown as Config),\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n }\n\n await addDefaultDashboardWidgets({\n config,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n if (config.serverURL !== '') {\n config.csrf!.push(config.serverURL!)\n }\n\n if (!config.storage) {\n config.storage = []\n }\n\n if (!config.upload) {\n config.upload = { adapters: [] }\n }\n\n config.upload.adapters = Array.from(\n new Set(config.collections!.map((c) => c.upload?.adapter).filter(Boolean) as string[]),\n )\n\n // Pass through the email config as is so adapters don't break\n if (incomingConfig.email) {\n config.email = incomingConfig.email\n }\n\n /*\n Execute richText sanitization\n */\n if (typeof incomingConfig.editor === 'function') {\n config.editor = await incomingConfig.editor({\n config: config as SanitizedConfig,\n isRoot: true,\n parentIsLocalized: false,\n })\n }\n\n const promises: Promise<void>[] = []\n\n for (const sanitizeFunction of richTextSanitizationPromises) {\n promises.push(sanitizeFunction(config as SanitizedConfig))\n }\n\n await Promise.all(promises)\n\n return config as SanitizedConfig\n}\n"],"names":["en","defaultUserCollection","authRootEndpoints","sanitizeCollection","migrationsCollection","DuplicateCollection","InvalidConfiguration","defaultTimezones","sanitizeGlobal","resolveHierarchyCollections","baseBlockFields","formatLabels","sanitizeFields","getLockedDocumentsCollection","lockedDocumentsCollectionSlug","getPreferencesCollection","preferencesCollectionSlug","getQueryPresetsConfig","queryPresetsCollectionSlug","getDefaultJobsCollection","jobsCollectionSlug","getJobStatsGlobal","flattenAllFields","flattenBlock","hasScheduledPublishEnabled","validateTimezones","getSchedulePublishTask","addDefaultsToConfig","addOrderableEndpoint","addOrderableFieldsAndHook","sanitizeAdminConfig","configToSanitize","sanitizedConfig","loggingLevels","Forbidden","Locked","MissingFile","NotFound","ValidationError","admin","user","firstCollectionWithAuth","collections","find","auth","Boolean","slug","push","userCollection","timezones","supportedTimezones","source","addDefaultDashboardWidgets","config","richTextSanitizationPromises","validRelationships","collectionQueryFields","name","type","label","t","options","filter","collection","hidden","map","labels","plural","value","required","components","Field","defaultValue","max","min","recentlyViewedFields","hasMany","adminConfig","dashboard","widgets","Component","minWidth","fields","existingFieldNames","Set","parentIsLocalized","defaultLayout","widgetSlug","width","sanitizeConfig","incomingConfig","configWithDefaults","endpoints","endpoint","localization","locales","length","firstLocale","localeCodes","locale","code","rtl","toString","fallback","i18nConfig","fallbackLanguage","supportedLanguages","translations","i18n","supportedLangKeys","Object","keys","fallbackLang","includes","schedulePublishCollections","queryPresetsCollections","schedulePublishGlobals","collectionSlugs","c","dashboardWidgets","widget","blocks","block","sanitizedBlock","_sanitized","concat","flattenedSanitizedBlock","orderableJoins","i","has","add","draftsConfig","versions","drafts","schedulePublish","enableQueryPresets","fieldsToAdd","Map","joinFieldPathsByCollection","orderable","currentFields","get","set","defaultSort","joinInfo","targetCollection","targetCollectionSlug","orderFieldName","currentJoinFieldPaths","joinFieldOn","orderableFields","flattenedFields","size","globals","jobs","tasks","adminUserSlug","enabled","Array","isArray","workflows","hasScheduleProperty","some","task","schedule","workflow","scheduling","stats","defaultJobsCollection","jobsCollectionOverrides","sanitizedJobsCollection","lockedDocumentsCollection","migrations","db","indexSortableFields","indexes","unique","serverURL","csrf","storage","upload","adapters","from","adapter","email","editor","isRoot","promises","sanitizeFunction","Promise","all"],"mappings":"AAEA,SAASA,EAAE,QAAQ,wCAAuC;AAgB1D,SAASC,qBAAqB,QAAQ,yBAAwB;AAC9D,SAASC,iBAAiB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,CAClC,MAAM5C,mBACJkD,QACApC,sBAAsBoC,SACtBC,8BACAC;IAGN;IAEA,MAAMH,2BAA2B;QAC/BC;QACAC;QACAC;IACF;IAEA,IAAIF,OAAO4H,SAAS,KAAK,IAAI;QAC3B5H,OAAO6H,IAAI,CAAEnI,IAAI,CAACM,OAAO4H,SAAS;IACpC;IAEA,IAAI,CAAC5H,OAAO8H,OAAO,EAAE;QACnB9H,OAAO8H,OAAO,GAAG,EAAE;IACrB;IAEA,IAAI,CAAC9H,OAAO+H,MAAM,EAAE;QAClB/H,OAAO+H,MAAM,GAAG;YAAEC,UAAU,EAAE;QAAC;IACjC;IAEAhI,OAAO+H,MAAM,CAACC,QAAQ,GAAGvB,MAAMwB,IAAI,CACjC,IAAIlG,IAAI/B,OAAOX,WAAW,CAAEuB,GAAG,CAAC,CAACqD,IAAMA,EAAE8D,MAAM,EAAEG,SAASzH,MAAM,CAACjB;IAGnE,8DAA8D;IAC9D,IAAI6C,eAAe8F,KAAK,EAAE;QACxBnI,OAAOmI,KAAK,GAAG9F,eAAe8F,KAAK;IACrC;IAEA;;GAEC,GACD,IAAI,OAAO9F,eAAe+F,MAAM,KAAK,YAAY;QAC/CpI,OAAOoI,MAAM,GAAG,MAAM/F,eAAe+F,MAAM,CAAC;YAC1CpI,QAAQA;YACRqI,QAAQ;YACRrG,mBAAmB;QACrB;IACF;IAEA,MAAMsG,WAA4B,EAAE;IAEpC,KAAK,MAAMC,oBAAoBtI,6BAA8B;QAC3DqI,SAAS5I,IAAI,CAAC6I,iBAAiBvI;IACjC;IAEA,MAAMwI,QAAQC,GAAG,CAACH;IAElB,OAAOtI;AACT,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/config/sanitize.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport { en } from '@payloadcms/translations/languages/en'\n\nimport type { OrderableJoinInfo } from '../fields/config/sanitizeJoinField.js'\nimport type { CollectionSlug, GlobalSlug, SanitizedCollectionConfig } from '../index.js'\nimport type { SanitizedJobsConfig } from '../queues/config/types/index.js'\nimport type {\n Config,\n DashboardConfig,\n LocalizationConfigWithLabels,\n LocalizationConfigWithNoLabels,\n SanitizedConfig,\n Timezone,\n Widget,\n WidgetInstance,\n} from './types.js'\n\nimport { defaultUserCollection } from '../auth/defaultUser.js'\nimport { authRootEndpoints } from '../auth/endpoints/index.js'\nimport { sanitizeCollection } from '../collections/config/sanitize.js'\nimport { migrationsCollection } from '../database/migrations/migrationsCollection.js'\nimport { DuplicateCollection, InvalidConfiguration } from '../errors/index.js'\nimport { defaultTimezones } from '../fields/baseFields/timezone/defaultTimezones.js'\nimport { sanitizeGlobal } from '../globals/config/sanitize.js'\nimport { resolveHierarchyCollections } from '../hierarchy/resolveHierarchyCollections.js'\nimport { baseBlockFields, formatLabels, sanitizeFields } from '../index.js'\nimport {\n getLockedDocumentsCollection,\n lockedDocumentsCollectionSlug,\n} from '../locked-documents/config.js'\nimport { getPreferencesCollection, preferencesCollectionSlug } from '../preferences/config.js'\nimport { getQueryPresetsConfig, queryPresetsCollectionSlug } from '../query-presets/config.js'\nimport { getDefaultJobsCollection, jobsCollectionSlug } from '../queues/config/collection.js'\nimport { getJobStatsGlobal } from '../queues/config/global.js'\nimport { uploadInstructionsEndpoint } from '../uploads/endpoints/uploadInstructions.js'\nimport { flattenAllFields, flattenBlock } from '../utilities/flattenAllFields.js'\nimport { hasScheduledPublishEnabled } from '../utilities/getVersionsConfig.js'\nimport { validateTimezones } from '../utilities/validateTimezones.js'\nimport { getSchedulePublishTask } from '../versions/schedule/job.js'\nimport { addDefaultsToConfig } from './defaults.js'\nimport { addOrderableEndpoint, addOrderableFieldsAndHook } from './orderable/index.js'\n\nconst sanitizeAdminConfig = (configToSanitize: Config): Partial<SanitizedConfig> => {\n const sanitizedConfig = { ...configToSanitize }\n\n // default logging level will be 'error' if not provided\n sanitizedConfig.loggingLevels = {\n Forbidden: 'info',\n Locked: 'info',\n MissingFile: 'info',\n NotFound: 'info',\n ValidationError: 'info',\n ...(sanitizedConfig.loggingLevels || {}),\n }\n // add default user collection if none provided\n if (!sanitizedConfig?.admin?.user) {\n const firstCollectionWithAuth = sanitizedConfig.collections!.find(({ auth }) => Boolean(auth))\n\n if (firstCollectionWithAuth) {\n sanitizedConfig.admin!.user = firstCollectionWithAuth.slug\n } else {\n sanitizedConfig.admin!.user = defaultUserCollection.slug\n sanitizedConfig.collections!.push(defaultUserCollection)\n }\n }\n\n const userCollection = sanitizedConfig.collections!.find(\n ({ slug }) => slug === sanitizedConfig.admin!.user,\n )\n\n if (!userCollection || !userCollection.auth) {\n throw new InvalidConfiguration(\n `${sanitizedConfig.admin!.user} is not a valid admin user collection`,\n )\n }\n\n if (sanitizedConfig?.admin?.timezones) {\n if (typeof configToSanitize?.admin?.timezones?.supportedTimezones === 'function') {\n sanitizedConfig.admin.timezones.supportedTimezones =\n configToSanitize.admin.timezones.supportedTimezones({ defaultTimezones })\n }\n\n if (!sanitizedConfig?.admin?.timezones?.supportedTimezones) {\n sanitizedConfig.admin.timezones.supportedTimezones = defaultTimezones\n }\n } else {\n sanitizedConfig.admin!.timezones = {\n supportedTimezones: defaultTimezones,\n }\n }\n\n validateTimezones({\n source: 'admin.timezones.supportedTimezones',\n timezones: sanitizedConfig.admin!.timezones.supportedTimezones as Timezone[],\n })\n\n return sanitizedConfig as unknown as Partial<SanitizedConfig>\n}\n\nconst addDefaultDashboardWidgets = async ({\n config,\n richTextSanitizationPromises,\n validRelationships,\n}: {\n config: Partial<SanitizedConfig>\n richTextSanitizationPromises: Array<(config: SanitizedConfig) => Promise<void>>\n validRelationships: string[]\n}) => {\n const collectionQueryFields: NonNullable<Widget['fields']> = [\n {\n name: 'title',\n type: 'text',\n label: ({ t }) => t('dashboard:widgetTitleLabel'),\n },\n {\n name: 'relatedCollection',\n type: 'select',\n label: ({ t }) => t('general:collection'),\n // Only offer collections that are visible in the admin UI. Collections hidden via a function\n // are kept since they may still be visible for some users.\n options: (config.collections ?? [])\n .filter((collection) => collection.admin?.hidden !== true)\n .map((collection) => ({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })),\n required: true,\n },\n {\n name: 'where',\n type: 'json',\n admin: {\n components: {\n Field: '@payloadcms/ui#QueryPresetsWhereField',\n },\n },\n label: ({ t }) => t('general:filters'),\n },\n {\n name: 'sortField',\n type: 'text',\n admin: {\n components: {\n Field: '@payloadcms/ui#CollectionQuerySortField',\n },\n },\n label: ({ t }) => t('dashboard:widgetSortFieldLabel'),\n },\n {\n name: 'sortDirection',\n type: 'select',\n defaultValue: 'desc',\n label: ({ t }) => t('dashboard:widgetSortDirectionLabel'),\n options: [\n {\n label: ({ t }) => t('general:ascending'),\n value: 'asc',\n },\n {\n label: ({ t }) => t('general:descending'),\n value: 'desc',\n },\n ],\n },\n {\n name: 'limit',\n type: 'number',\n defaultValue: 5,\n label: ({ t }) => t('dashboard:widgetLimitLabel'),\n max: 25,\n min: 1,\n },\n ]\n\n const recentlyViewedFields: NonNullable<Widget['fields']> = [\n {\n name: 'excludedCollections',\n type: 'select',\n admin: {\n components: {\n // Presents an inclusion filter (all collections checked by default) while persisting the\n // inverse as an exclusion list, so collections added later stay visible by default.\n Field: '@payloadcms/ui#RecentlyViewedCollectionsField',\n },\n },\n hasMany: true,\n label: ({ t }) => t('general:collections'),\n // Exclusion list, so an empty value shows every collection and newly added collections are\n // included by default. Hidden collections are never offered as options.\n options: (config.collections ?? [])\n .filter((collection) => collection.admin?.hidden !== true)\n .map((collection) => ({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })),\n },\n ]\n\n const adminConfig: NonNullable<Config['admin']> = config.admin ?? { dashboard: { widgets: [] } }\n const dashboard: DashboardConfig = (adminConfig.dashboard ??= { widgets: [] })\n\n dashboard.widgets.push({\n slug: 'collections',\n Component: '@payloadcms/ui/rsc#CollectionCards',\n minWidth: 'full',\n })\n dashboard.widgets.push({\n slug: 'collection-query',\n Component: '@payloadcms/ui/rsc#CollectionQueryWidget',\n fields: await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: collectionQueryFields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n }),\n minWidth: 'x-small',\n })\n dashboard.widgets.push({\n slug: 'activity',\n Component: '@payloadcms/ui/rsc#RecentlyViewedWidget',\n fields: await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: recentlyViewedFields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n }),\n label: ({ t }) => t('dashboard:widgetRecentlyViewedTitle'),\n minWidth: 'x-small',\n })\n dashboard.defaultLayout ??= [\n {\n widgetSlug: 'collections',\n width: 'full',\n } satisfies WidgetInstance,\n ]\n}\n\nexport const sanitizeConfig = async (incomingConfig: Config): Promise<SanitizedConfig> => {\n const configWithDefaults = addDefaultsToConfig(incomingConfig)\n\n const config: Partial<SanitizedConfig> = sanitizeAdminConfig(configWithDefaults)\n\n if (!config.endpoints) {\n config.endpoints = []\n }\n\n if (\n configWithDefaults.collections?.some(\n ({ upload }) => typeof upload === 'object' && upload.uploadInstructions,\n )\n ) {\n config.endpoints.push(uploadInstructionsEndpoint)\n }\n\n for (const endpoint of authRootEndpoints) {\n config.endpoints.push(endpoint)\n }\n\n if (config.localization && config.localization.locales?.length > 0) {\n // clone localization config so to not break everything\n const firstLocale = config.localization.locales[0]\n if (typeof firstLocale === 'string') {\n config.localization.localeCodes = [\n ...(config.localization as unknown as LocalizationConfigWithNoLabels).locales,\n ]\n\n // is string[], so convert to Locale[]\n config.localization.locales = (\n config.localization as unknown as LocalizationConfigWithNoLabels\n ).locales.map((locale) => ({\n code: locale,\n label: locale,\n rtl: false,\n toString: () => locale,\n }))\n } else {\n // is Locale[], so convert to string[] for localeCodes\n config.localization.localeCodes = config.localization.locales.map((locale) => locale.code)\n\n config.localization.locales = (\n config.localization as LocalizationConfigWithLabels\n ).locales.map((locale) => ({\n ...locale,\n toString: () => locale.code,\n }))\n }\n\n // Default fallback to true if not provided\n config.localization.fallback = config.localization?.fallback ?? true\n }\n\n const i18nConfig: SanitizedConfig['i18n'] = {\n fallbackLanguage: 'en',\n supportedLanguages: {\n en,\n },\n translations: {},\n }\n\n if (incomingConfig?.i18n) {\n i18nConfig.supportedLanguages =\n incomingConfig.i18n?.supportedLanguages || i18nConfig.supportedLanguages\n\n const supportedLangKeys = <AcceptedLanguages[]>Object.keys(i18nConfig.supportedLanguages)\n const fallbackLang = incomingConfig.i18n?.fallbackLanguage || i18nConfig.fallbackLanguage\n\n i18nConfig.fallbackLanguage = supportedLangKeys.includes(fallbackLang)\n ? fallbackLang\n : supportedLangKeys[0]!\n i18nConfig.translations =\n (incomingConfig.i18n?.translations as SanitizedConfig['i18n']['translations']) ||\n i18nConfig.translations\n }\n\n config.i18n = i18nConfig\n\n const richTextSanitizationPromises: Array<(config: SanitizedConfig) => Promise<void>> = []\n\n const schedulePublishCollections: CollectionSlug[] = []\n\n const queryPresetsCollections: CollectionSlug[] = []\n\n const schedulePublishGlobals: GlobalSlug[] = []\n\n const collectionSlugs = new Set<CollectionSlug>()\n\n const validRelationships = [\n ...(config.collections?.map((c) => c.slug) ?? []),\n jobsCollectionSlug,\n lockedDocumentsCollectionSlug,\n preferencesCollectionSlug,\n ]\n\n const dashboardWidgets = config.admin?.dashboard?.widgets ?? ([] as Widget[])\n\n for (const widget of dashboardWidgets) {\n if (widget.fields?.length) {\n widget.fields = await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: widget.fields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n })\n }\n }\n\n /**\n * Blocks sanitization needs to happen before collections, as collection/global join field sanitization needs config.blocks\n * to be populated with the sanitized blocks\n */\n config.blocks = []\n\n if (incomingConfig.blocks?.length) {\n for (const block of incomingConfig.blocks) {\n const sanitizedBlock = block\n\n if (sanitizedBlock._sanitized === true) {\n continue\n }\n sanitizedBlock._sanitized = true\n\n sanitizedBlock.fields = sanitizedBlock.fields.concat(baseBlockFields)\n\n sanitizedBlock.labels = !sanitizedBlock.labels\n ? formatLabels(sanitizedBlock.slug)\n : sanitizedBlock.labels\n\n sanitizedBlock.fields = await sanitizeFields({\n config: config as unknown as Config,\n existingFieldNames: new Set(),\n fields: sanitizedBlock.fields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n const flattenedSanitizedBlock = flattenBlock({ block })\n\n config.blocks.push(flattenedSanitizedBlock)\n }\n }\n\n // Track orderable join fields during sanitization\n const orderableJoins: OrderableJoinInfo[] = []\n\n for (let i = 0; i < config.collections!.length; i++) {\n if (collectionSlugs.has(config.collections![i]!.slug)) {\n throw new DuplicateCollection('slug', config.collections![i]!.slug)\n }\n\n collectionSlugs.add(config.collections![i]!.slug)\n\n const draftsConfig = config.collections![i]?.versions?.drafts\n\n if (typeof draftsConfig === 'object' && draftsConfig.schedulePublish) {\n schedulePublishCollections.push(config.collections![i]!.slug)\n }\n\n if (config.collections![i]!.enableQueryPresets) {\n queryPresetsCollections.push(config.collections![i]!.slug)\n\n if (!validRelationships.includes(queryPresetsCollectionSlug)) {\n validRelationships.push(queryPresetsCollectionSlug)\n }\n }\n\n config.collections![i] = await sanitizeCollection(\n config as unknown as Config,\n config.collections![i]!,\n richTextSanitizationPromises,\n validRelationships,\n orderableJoins,\n )\n }\n\n // Process orderable features after all collections are sanitized\n const fieldsToAdd = new Map<SanitizedCollectionConfig, string[]>()\n const joinFieldPathsByCollection = new Map<string, Map<string, string>>()\n\n // Handle collection.orderable\n for (const collection of config.collections!) {\n if (collection.orderable) {\n const currentFields = fieldsToAdd.get(collection) || []\n fieldsToAdd.set(collection, [...currentFields, '_order'])\n collection.defaultSort = collection.defaultSort ?? '_order'\n }\n }\n\n // Handle orderable join fields (tracked during sanitization)\n for (const joinInfo of orderableJoins) {\n const targetCollection = config.collections!.find(\n (c) => c.slug === joinInfo.targetCollectionSlug,\n )\n if (targetCollection) {\n const currentFields = fieldsToAdd.get(targetCollection) || []\n fieldsToAdd.set(targetCollection, [...currentFields, joinInfo.orderFieldName])\n\n const currentJoinFieldPaths =\n joinFieldPathsByCollection.get(targetCollection.slug) || new Map<string, string>()\n currentJoinFieldPaths.set(joinInfo.orderFieldName, joinInfo.joinFieldOn)\n joinFieldPathsByCollection.set(targetCollection.slug, currentJoinFieldPaths)\n }\n }\n\n // Add fields, hooks, and update flattenedFields\n for (const [collection, orderableFields] of fieldsToAdd) {\n await addOrderableFieldsAndHook(\n collection,\n config as unknown as Config,\n orderableFields,\n joinFieldPathsByCollection,\n )\n // Regenerate flattenedFields since we added new fields\n collection.flattenedFields = flattenAllFields({ fields: collection.fields })\n }\n\n // Add endpoint if any orderable features exist\n if (fieldsToAdd.size > 0) {\n addOrderableEndpoint(config as SanitizedConfig, joinFieldPathsByCollection)\n }\n\n if (config.globals!.length > 0) {\n for (let i = 0; i < config.globals!.length; i++) {\n if (hasScheduledPublishEnabled(config.globals![i]!)) {\n schedulePublishGlobals.push(config.globals![i]!.slug)\n }\n\n config.globals![i] = await sanitizeGlobal(\n config as unknown as Config,\n config.globals![i]!,\n richTextSanitizationPromises,\n validRelationships,\n )\n }\n }\n\n // Resolve hierarchy relationships across collections (also adds sidebar tabs)\n resolveHierarchyCollections(config as unknown as Config)\n\n if (schedulePublishCollections.length || schedulePublishGlobals.length) {\n ;((config.jobs ??= {} as SanitizedJobsConfig).tasks ??= []).push(\n getSchedulePublishTask({\n adminUserSlug: config.admin!.user,\n collections: schedulePublishCollections,\n globals: schedulePublishGlobals,\n }),\n )\n }\n\n ;(config.jobs ??= {} as SanitizedJobsConfig).enabled = Boolean(\n (Array.isArray(configWithDefaults.jobs?.tasks) && configWithDefaults.jobs?.tasks?.length) ||\n (Array.isArray(configWithDefaults.jobs?.workflows) &&\n configWithDefaults.jobs?.workflows?.length),\n )\n\n // Need to add default jobs collection before locked documents collections\n if (config.jobs.enabled) {\n // Check for schedule property in both tasks and workflows\n const hasScheduleProperty =\n (config?.jobs?.tasks?.length && config.jobs.tasks.some((task) => task.schedule)) ||\n (config?.jobs?.workflows?.length &&\n config.jobs.workflows.some((workflow) => workflow.schedule))\n\n if (hasScheduleProperty) {\n config.jobs.scheduling = true\n // Add payload-jobs-stats global for tracking when a job of a specific slug was last run\n ;(config.globals ??= []).push(\n await sanitizeGlobal(\n config as unknown as Config,\n getJobStatsGlobal(config as unknown as Config),\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n\n config.jobs.stats = true\n }\n\n let defaultJobsCollection = getDefaultJobsCollection(config.jobs)\n\n if (typeof config.jobs.jobsCollectionOverrides === 'function') {\n defaultJobsCollection = config.jobs.jobsCollectionOverrides({\n defaultJobsCollection,\n })\n }\n const sanitizedJobsCollection = await sanitizeCollection(\n config as unknown as Config,\n defaultJobsCollection,\n richTextSanitizationPromises,\n validRelationships,\n )\n\n ;(config.collections ??= []).push(sanitizedJobsCollection)\n }\n\n const lockedDocumentsCollection = getLockedDocumentsCollection(config as unknown as Config)\n\n if (lockedDocumentsCollection) {\n configWithDefaults.collections!.push(\n await sanitizeCollection(\n config as unknown as Config,\n lockedDocumentsCollection,\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n }\n\n configWithDefaults.collections!.push(\n await sanitizeCollection(\n config as unknown as Config,\n getPreferencesCollection(config as unknown as Config),\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n\n const migrations = await sanitizeCollection(\n config as unknown as Config,\n migrationsCollection,\n richTextSanitizationPromises,\n validRelationships,\n )\n\n // @ts-expect-error indexSortableFields is only valid for @payloadcms/db-mongodb\n if (config?.db?.indexSortableFields) {\n migrations.indexes = [\n {\n fields: ['batch', 'name'],\n unique: false,\n },\n ]\n }\n configWithDefaults.collections!.push(migrations)\n\n if (queryPresetsCollections.length > 0) {\n configWithDefaults.collections!.push(\n await sanitizeCollection(\n config as unknown as Config,\n getQueryPresetsConfig(config as unknown as Config),\n richTextSanitizationPromises,\n validRelationships,\n ),\n )\n }\n\n await addDefaultDashboardWidgets({\n config,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n if (config.serverURL !== '') {\n config.csrf!.push(config.serverURL!)\n }\n\n if (!config.storage) {\n config.storage = []\n }\n\n if (!config.upload) {\n config.upload = { adapters: [] }\n }\n\n config.upload.adapters = Array.from(\n new Set(config.collections!.map((c) => c.upload?.adapter).filter(Boolean) as string[]),\n )\n\n // Pass through the email config as is so adapters don't break\n if (incomingConfig.email) {\n config.email = incomingConfig.email\n }\n\n /*\n Execute richText sanitization\n */\n if (typeof incomingConfig.editor === 'function') {\n config.editor = await incomingConfig.editor({\n config: config as SanitizedConfig,\n isRoot: true,\n parentIsLocalized: false,\n })\n }\n\n const promises: Promise<void>[] = []\n\n for (const sanitizeFunction of richTextSanitizationPromises) {\n promises.push(sanitizeFunction(config as SanitizedConfig))\n }\n\n await Promise.all(promises)\n\n return config as SanitizedConfig\n}\n"],"names":["en","defaultUserCollection","authRootEndpoints","sanitizeCollection","migrationsCollection","DuplicateCollection","InvalidConfiguration","defaultTimezones","sanitizeGlobal","resolveHierarchyCollections","baseBlockFields","formatLabels","sanitizeFields","getLockedDocumentsCollection","lockedDocumentsCollectionSlug","getPreferencesCollection","preferencesCollectionSlug","getQueryPresetsConfig","queryPresetsCollectionSlug","getDefaultJobsCollection","jobsCollectionSlug","getJobStatsGlobal","uploadInstructionsEndpoint","flattenAllFields","flattenBlock","hasScheduledPublishEnabled","validateTimezones","getSchedulePublishTask","addDefaultsToConfig","addOrderableEndpoint","addOrderableFieldsAndHook","sanitizeAdminConfig","configToSanitize","sanitizedConfig","loggingLevels","Forbidden","Locked","MissingFile","NotFound","ValidationError","admin","user","firstCollectionWithAuth","collections","find","auth","Boolean","slug","push","userCollection","timezones","supportedTimezones","source","addDefaultDashboardWidgets","config","richTextSanitizationPromises","validRelationships","collectionQueryFields","name","type","label","t","options","filter","collection","hidden","map","labels","plural","value","required","components","Field","defaultValue","max","min","recentlyViewedFields","hasMany","adminConfig","dashboard","widgets","Component","minWidth","fields","existingFieldNames","Set","parentIsLocalized","defaultLayout","widgetSlug","width","sanitizeConfig","incomingConfig","configWithDefaults","endpoints","some","upload","uploadInstructions","endpoint","localization","locales","length","firstLocale","localeCodes","locale","code","rtl","toString","fallback","i18nConfig","fallbackLanguage","supportedLanguages","translations","i18n","supportedLangKeys","Object","keys","fallbackLang","includes","schedulePublishCollections","queryPresetsCollections","schedulePublishGlobals","collectionSlugs","c","dashboardWidgets","widget","blocks","block","sanitizedBlock","_sanitized","concat","flattenedSanitizedBlock","orderableJoins","i","has","add","draftsConfig","versions","drafts","schedulePublish","enableQueryPresets","fieldsToAdd","Map","joinFieldPathsByCollection","orderable","currentFields","get","set","defaultSort","joinInfo","targetCollection","targetCollectionSlug","orderFieldName","currentJoinFieldPaths","joinFieldOn","orderableFields","flattenedFields","size","globals","jobs","tasks","adminUserSlug","enabled","Array","isArray","workflows","hasScheduleProperty","task","schedule","workflow","scheduling","stats","defaultJobsCollection","jobsCollectionOverrides","sanitizedJobsCollection","lockedDocumentsCollection","migrations","db","indexSortableFields","indexes","unique","serverURL","csrf","storage","adapters","from","adapter","email","editor","isRoot","promises","sanitizeFunction","Promise","all"],"mappings":"AAEA,SAASA,EAAE,QAAQ,wCAAuC;AAgB1D,SAASC,qBAAqB,QAAQ,yBAAwB;AAC9D,SAASC,iBAAiB,QAAQ,6BAA4B;AAC9D,SAASC,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,qBAAoB;AAC9E,SAASC,gBAAgB,QAAQ,oDAAmD;AACpF,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,2BAA2B,QAAQ,8CAA6C;AACzF,SAASC,eAAe,EAAEC,YAAY,EAAEC,cAAc,QAAQ,cAAa;AAC3E,SACEC,4BAA4B,EAC5BC,6BAA6B,QACxB,gCAA+B;AACtC,SAASC,wBAAwB,EAAEC,yBAAyB,QAAQ,2BAA0B;AAC9F,SAASC,qBAAqB,EAAEC,0BAA0B,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