payload 3.66.0 → 3.67.0-internal.1ea538b
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/auth/operations/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/forgotPassword.js +7 -12
- package/dist/auth/operations/forgotPassword.js.map +1 -1
- package/dist/auth/operations/login.d.ts.map +1 -1
- package/dist/auth/operations/login.js +7 -12
- package/dist/auth/operations/login.js.map +1 -1
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js +7 -12
- package/dist/auth/operations/refresh.js.map +1 -1
- package/dist/auth/operations/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/resetPassword.js +7 -12
- package/dist/auth/operations/resetPassword.js.map +1 -1
- package/dist/auth/operations/unlock.d.ts.map +1 -1
- package/dist/auth/operations/unlock.js +14 -1
- package/dist/auth/operations/unlock.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +2 -0
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/types.d.ts +7 -19
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/operations/count.d.ts.map +1 -1
- package/dist/collections/operations/count.js +7 -12
- package/dist/collections/operations/count.js.map +1 -1
- package/dist/collections/operations/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/countVersions.js +7 -12
- package/dist/collections/operations/countVersions.js.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +10 -14
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +9 -13
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js +9 -13
- package/dist/collections/operations/deleteByID.js.map +1 -1
- package/dist/collections/operations/find.d.ts.map +1 -1
- package/dist/collections/operations/find.js +9 -13
- package/dist/collections/operations/find.js.map +1 -1
- package/dist/collections/operations/findByID.d.ts.map +1 -1
- package/dist/collections/operations/findByID.js +22 -26
- package/dist/collections/operations/findByID.js.map +1 -1
- package/dist/collections/operations/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/findDistinct.js +7 -12
- package/dist/collections/operations/findDistinct.js.map +1 -1
- package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.js +20 -1
- package/dist/collections/operations/findVersionByID.js.map +1 -1
- package/dist/collections/operations/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/findVersions.js +24 -5
- package/dist/collections/operations/findVersions.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js +9 -13
- package/dist/collections/operations/restoreVersion.js.map +1 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +9 -13
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +7 -12
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/collections/operations/utilities/buildAfterOperation.d.ts +6 -0
- package/dist/collections/operations/utilities/buildAfterOperation.d.ts.map +1 -0
- package/dist/collections/operations/{utils.js → utilities/buildAfterOperation.js} +1 -1
- package/dist/collections/operations/utilities/buildAfterOperation.js.map +1 -0
- package/dist/collections/operations/utilities/buildBeforeOperation.d.ts +47 -0
- package/dist/collections/operations/utilities/buildBeforeOperation.d.ts.map +1 -0
- package/dist/collections/operations/utilities/buildBeforeOperation.js +25 -0
- package/dist/collections/operations/utilities/buildBeforeOperation.js.map +1 -0
- package/dist/collections/operations/utilities/types.d.ts +216 -0
- package/dist/collections/operations/utilities/types.d.ts.map +1 -0
- package/dist/collections/operations/utilities/types.js +23 -0
- package/dist/collections/operations/utilities/types.js.map +1 -0
- package/dist/collections/operations/utilities/update.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.js +4 -2
- package/dist/collections/operations/utilities/update.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +2 -2
- package/dist/config/sanitize.js.map +1 -1
- package/dist/exports/shared.d.ts +1 -0
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +1 -0
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/generateSlug.js +2 -2
- package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
- package/dist/fields/config/types.d.ts +2 -0
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/globals/config/types.d.ts +1 -1
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- package/dist/globals/operations/findOne.js +4 -3
- package/dist/globals/operations/findOne.js.map +1 -1
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +3 -2
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/index.bundled.d.ts +200 -119
- package/dist/utilities/getVersionsConfig.d.ts +37 -0
- package/dist/utilities/getVersionsConfig.d.ts.map +1 -0
- package/dist/utilities/getVersionsConfig.js +44 -0
- package/dist/utilities/getVersionsConfig.js.map +1 -0
- package/dist/versions/buildCollectionFields.d.ts.map +1 -1
- package/dist/versions/buildCollectionFields.js +3 -2
- package/dist/versions/buildCollectionFields.js.map +1 -1
- package/dist/versions/buildGlobalFields.d.ts.map +1 -1
- package/dist/versions/buildGlobalFields.js +3 -2
- package/dist/versions/buildGlobalFields.js.map +1 -1
- package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
- package/dist/versions/getLatestCollectionVersion.js +3 -1
- package/dist/versions/getLatestCollectionVersion.js.map +1 -1
- package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
- package/dist/versions/getLatestGlobalVersion.js +3 -2
- package/dist/versions/getLatestGlobalVersion.js.map +1 -1
- package/dist/versions/saveVersion.d.ts.map +1 -1
- package/dist/versions/saveVersion.js +2 -1
- package/dist/versions/saveVersion.js.map +1 -1
- package/package.json +2 -2
- package/dist/collections/operations/utils.d.ts +0 -105
- package/dist/collections/operations/utils.d.ts.map +0 -1
- package/dist/collections/operations/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/sanitize.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from '../../config/types.js'\nimport type {\n CollectionConfig,\n SanitizedCollectionConfig,\n SanitizedJoin,\n SanitizedJoins,\n} from './types.js'\n\nimport { authCollectionEndpoints } from '../../auth/endpoints/index.js'\nimport { getBaseAuthFields } from '../../auth/getAuthFields.js'\nimport { TimestampsRequired } from '../../errors/TimestampsRequired.js'\nimport { sanitizeFields } from '../../fields/config/sanitize.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport { mergeBaseFields } from '../../fields/mergeBaseFields.js'\nimport { uploadCollectionEndpoints } from '../../uploads/endpoints/index.js'\nimport { getBaseUploadFields } from '../../uploads/getBaseFields.js'\nimport { flattenAllFields } from '../../utilities/flattenAllFields.js'\nimport { formatLabels } from '../../utilities/formatLabels.js'\nimport { baseVersionFields } from '../../versions/baseFields.js'\nimport { versionDefaults } from '../../versions/defaults.js'\nimport { defaultCollectionEndpoints } from '../endpoints/index.js'\nimport {\n addDefaultsToAuthConfig,\n addDefaultsToCollectionConfig,\n addDefaultsToLoginWithUsernameConfig,\n} from './defaults.js'\nimport { sanitizeCompoundIndexes } from './sanitizeCompoundIndexes.js'\nimport { validateUseAsTitle } from './useAsTitle.js'\n\nexport const sanitizeCollection = async (\n config: Config,\n collection: CollectionConfig,\n /**\n * If this property is set, RichText fields won't be sanitized immediately. Instead, they will be added to this array as promises\n * so that you can sanitize them together, after the config has been sanitized.\n */\n richTextSanitizationPromises?: Array<(config: SanitizedConfig) => Promise<void>>,\n _validRelationships?: string[],\n): Promise<SanitizedCollectionConfig> => {\n if (collection._sanitized) {\n return collection as SanitizedCollectionConfig\n }\n\n collection._sanitized = true\n\n // /////////////////////////////////\n // Make copy of collection config\n // /////////////////////////////////\n\n const sanitized: CollectionConfig = addDefaultsToCollectionConfig(collection)\n\n // /////////////////////////////////\n // Sanitize fields\n // /////////////////////////////////\n\n const validRelationships = _validRelationships ?? config.collections!.map((c) => c.slug) ?? []\n\n const joins: SanitizedJoins = {}\n\n const polymorphicJoins: SanitizedJoin[] = []\n\n sanitized.fields = await sanitizeFields({\n collectionConfig: sanitized,\n config,\n fields: sanitized.fields,\n joinPath: '',\n joins,\n parentIsLocalized: false,\n polymorphicJoins,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n if (sanitized.endpoints !== false) {\n if (!sanitized.endpoints) {\n sanitized.endpoints = []\n }\n\n if (sanitized.auth) {\n for (const endpoint of authCollectionEndpoints) {\n sanitized.endpoints.push(endpoint)\n }\n }\n\n if (sanitized.upload) {\n for (const endpoint of uploadCollectionEndpoints) {\n sanitized.endpoints.push(endpoint)\n }\n }\n\n for (const endpoint of defaultCollectionEndpoints) {\n sanitized.endpoints.push(endpoint)\n }\n }\n\n if (sanitized.timestamps !== false) {\n // add default timestamps fields only as needed\n let hasUpdatedAt: boolean | null = null\n let hasCreatedAt: boolean | null = null\n let hasDeletedAt: boolean | null = null\n\n sanitized.fields.some((field) => {\n if (fieldAffectsData(field)) {\n if (field.name === 'updatedAt') {\n hasUpdatedAt = true\n }\n\n if (field.name === 'createdAt') {\n hasCreatedAt = true\n }\n\n if (field.name === 'deletedAt') {\n hasDeletedAt = true\n }\n }\n\n return hasCreatedAt && hasUpdatedAt && (!sanitized.trash || hasDeletedAt)\n })\n\n if (!hasUpdatedAt) {\n sanitized.fields.push({\n name: 'updatedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n index: true,\n label: ({ t }) => t('general:updatedAt'),\n })\n }\n\n if (!hasCreatedAt) {\n sanitized.fields.push({\n name: 'createdAt',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n // The default sort for list view is createdAt. Thus, enabling indexing by default, is a major performance improvement, especially for large or a large amount of collections.\n type: 'date',\n index: true,\n label: ({ t }) => t('general:createdAt'),\n })\n }\n\n if (sanitized.trash && !hasDeletedAt) {\n sanitized.fields.push({\n name: 'deletedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n index: true,\n label: ({ t }) => t('general:deletedAt'),\n })\n }\n }\n\n const defaultLabels = formatLabels(sanitized.slug)\n\n sanitized.labels = {\n plural: sanitized.labels?.plural || defaultLabels.plural,\n singular: sanitized.labels?.singular || defaultLabels.singular,\n }\n\n if (sanitized.versions) {\n if (sanitized.versions === true) {\n sanitized.versions = { drafts: false, maxPerDoc: 100 }\n }\n\n if (sanitized.timestamps === false) {\n throw new TimestampsRequired(collection)\n }\n\n sanitized.versions.maxPerDoc =\n typeof sanitized.versions.maxPerDoc === 'number' ? sanitized.versions.maxPerDoc : 100\n\n if (sanitized.versions.drafts) {\n if (sanitized.versions.drafts === true) {\n sanitized.versions.drafts = {\n autosave: false,\n validate: false,\n }\n }\n\n if (sanitized.versions.drafts.autosave === true) {\n sanitized.versions.drafts.autosave = {\n interval: versionDefaults.autosaveInterval,\n }\n }\n\n if (sanitized.versions.drafts.validate === undefined) {\n sanitized.versions.drafts.validate = false\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, baseVersionFields)\n }\n }\n\n if (sanitized.folders === true) {\n sanitized.folders = {\n browseByFolder: true,\n }\n } else if (sanitized.folders) {\n sanitized.folders.browseByFolder = sanitized.folders.browseByFolder ?? true\n }\n\n if (sanitized.upload) {\n if (sanitized.upload === true) {\n sanitized.upload = {}\n }\n\n sanitized.upload.cacheTags = sanitized.upload?.cacheTags ?? true\n sanitized.upload.bulkUpload = sanitized.upload?.bulkUpload ?? true\n sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug\n sanitized.admin!.useAsTitle =\n sanitized.admin?.useAsTitle && sanitized.admin.useAsTitle !== 'id'\n ? sanitized.admin.useAsTitle\n : 'filename'\n\n const uploadFields = getBaseUploadFields({\n collection: sanitized,\n config,\n })\n\n sanitized.fields = mergeBaseFields(sanitized.fields, uploadFields)\n }\n\n if (sanitized.auth) {\n sanitized.auth = addDefaultsToAuthConfig(\n typeof sanitized.auth === 'boolean' ? {} : sanitized.auth,\n )\n\n // disable duplicate for auth enabled collections by default\n sanitized.disableDuplicate = sanitized.disableDuplicate ?? true\n\n if (sanitized.auth.loginWithUsername) {\n if (sanitized.auth.loginWithUsername === true) {\n sanitized.auth.loginWithUsername = addDefaultsToLoginWithUsernameConfig({})\n } else {\n const loginWithUsernameWithDefaults = addDefaultsToLoginWithUsernameConfig(\n sanitized.auth.loginWithUsername,\n )\n\n // if allowEmailLogin is false, requireUsername must be true\n if (loginWithUsernameWithDefaults.allowEmailLogin === false) {\n loginWithUsernameWithDefaults.requireUsername = true\n }\n sanitized.auth.loginWithUsername = loginWithUsernameWithDefaults\n }\n } else {\n sanitized.auth.loginWithUsername = false\n }\n\n if (!collection?.admin?.useAsTitle) {\n sanitized.admin!.useAsTitle = sanitized.auth.loginWithUsername ? 'username' : 'email'\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, getBaseAuthFields(sanitized.auth))\n }\n\n if (collection?.admin?.pagination?.limits?.length) {\n sanitized.admin!.pagination!.limits = collection.admin.pagination.limits\n }\n\n validateUseAsTitle(sanitized)\n\n const sanitizedConfig = sanitized as SanitizedCollectionConfig\n\n sanitizedConfig.joins = joins\n sanitizedConfig.polymorphicJoins = polymorphicJoins\n\n sanitizedConfig.flattenedFields = flattenAllFields({ fields: sanitizedConfig.fields })\n\n sanitizedConfig.sanitizedIndexes = sanitizeCompoundIndexes({\n fields: sanitizedConfig.flattenedFields,\n indexes: sanitizedConfig.indexes,\n })\n\n return sanitizedConfig\n}\n"],"names":["authCollectionEndpoints","getBaseAuthFields","TimestampsRequired","sanitizeFields","fieldAffectsData","mergeBaseFields","uploadCollectionEndpoints","getBaseUploadFields","flattenAllFields","formatLabels","baseVersionFields","versionDefaults","defaultCollectionEndpoints","addDefaultsToAuthConfig","addDefaultsToCollectionConfig","addDefaultsToLoginWithUsernameConfig","sanitizeCompoundIndexes","validateUseAsTitle","sanitizeCollection","config","collection","richTextSanitizationPromises","_validRelationships","_sanitized","sanitized","validRelationships","collections","map","c","slug","joins","polymorphicJoins","fields","collectionConfig","joinPath","parentIsLocalized","endpoints","auth","endpoint","push","upload","timestamps","hasUpdatedAt","hasCreatedAt","hasDeletedAt","some","field","name","trash","type","admin","disableBulkEdit","hidden","index","label","t","defaultLabels","labels","plural","singular","versions","drafts","maxPerDoc","autosave","validate","interval","autosaveInterval","undefined","folders","browseByFolder","cacheTags","bulkUpload","staticDir","useAsTitle","uploadFields","disableDuplicate","loginWithUsername","loginWithUsernameWithDefaults","allowEmailLogin","requireUsername","pagination","limits","length","sanitizedConfig","flattenedFields","sanitizedIndexes","indexes"],"mappings":"AAQA,SAASA,uBAAuB,QAAQ,gCAA+B;AACvE,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,cAAc,QAAQ,kCAAiC;AAChE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SAASC,yBAAyB,QAAQ,mCAAkC;AAC5E,SAASC,mBAAmB,QAAQ,iCAAgC;AACpE,SAASC,gBAAgB,QAAQ,sCAAqC;AACtE,SAASC,YAAY,QAAQ,kCAAiC;AAC9D,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,0BAA0B,QAAQ,wBAAuB;AAClE,SACEC,uBAAuB,EACvBC,6BAA6B,EAC7BC,oCAAoC,QAC/B,gBAAe;AACtB,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE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,CAAEuB,UAAU,GAAGjD,UAAUa,IAAI,CAACuC,iBAAiB,GAAG,aAAa;QAChF;QAEApD,UAAUQ,MAAM,GAAG3B,gBAAgBmB,UAAUQ,MAAM,EAAE/B,kBAAkBuB,UAAUa,IAAI;IACvF;IAEA,IAAIjB,YAAY8B,OAAO8B,YAAYC,QAAQC,QAAQ;QACjD1D,UAAU0B,KAAK,CAAE8B,UAAU,CAAEC,MAAM,GAAG7D,WAAW8B,KAAK,CAAC8B,UAAU,CAACC,MAAM;IAC1E;IAEAhE,mBAAmBO;IAEnB,MAAM2D,kBAAkB3D;IAExB2D,gBAAgBrD,KAAK,GAAGA;IACxBqD,gBAAgBpD,gBAAgB,GAAGA;IAEnCoD,gBAAgBC,eAAe,GAAG5E,iBAAiB;QAAEwB,QAAQmD,gBAAgBnD,MAAM;IAAC;IAEpFmD,gBAAgBE,gBAAgB,GAAGrE,wBAAwB;QACzDgB,QAAQmD,gBAAgBC,eAAe;QACvCE,SAASH,gBAAgBG,OAAO;IAClC;IAEA,OAAOH;AACT,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/sanitize.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from '../../config/types.js'\nimport type {\n CollectionConfig,\n SanitizedCollectionConfig,\n SanitizedJoin,\n SanitizedJoins,\n} from './types.js'\n\nimport { authCollectionEndpoints } from '../../auth/endpoints/index.js'\nimport { getBaseAuthFields } from '../../auth/getAuthFields.js'\nimport { TimestampsRequired } from '../../errors/TimestampsRequired.js'\nimport { sanitizeFields } from '../../fields/config/sanitize.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport { mergeBaseFields } from '../../fields/mergeBaseFields.js'\nimport { uploadCollectionEndpoints } from '../../uploads/endpoints/index.js'\nimport { getBaseUploadFields } from '../../uploads/getBaseFields.js'\nimport { flattenAllFields } from '../../utilities/flattenAllFields.js'\nimport { formatLabels } from '../../utilities/formatLabels.js'\nimport { baseVersionFields } from '../../versions/baseFields.js'\nimport { versionDefaults } from '../../versions/defaults.js'\nimport { defaultCollectionEndpoints } from '../endpoints/index.js'\nimport {\n addDefaultsToAuthConfig,\n addDefaultsToCollectionConfig,\n addDefaultsToLoginWithUsernameConfig,\n} from './defaults.js'\nimport { sanitizeCompoundIndexes } from './sanitizeCompoundIndexes.js'\nimport { validateUseAsTitle } from './useAsTitle.js'\n\nexport const sanitizeCollection = async (\n config: Config,\n collection: CollectionConfig,\n /**\n * If this property is set, RichText fields won't be sanitized immediately. Instead, they will be added to this array as promises\n * so that you can sanitize them together, after the config has been sanitized.\n */\n richTextSanitizationPromises?: Array<(config: SanitizedConfig) => Promise<void>>,\n _validRelationships?: string[],\n): Promise<SanitizedCollectionConfig> => {\n if (collection._sanitized) {\n return collection as SanitizedCollectionConfig\n }\n\n collection._sanitized = true\n\n // /////////////////////////////////\n // Make copy of collection config\n // /////////////////////////////////\n\n const sanitized: CollectionConfig = addDefaultsToCollectionConfig(collection)\n\n // /////////////////////////////////\n // Sanitize fields\n // /////////////////////////////////\n\n const validRelationships = _validRelationships ?? config.collections!.map((c) => c.slug) ?? []\n\n const joins: SanitizedJoins = {}\n\n const polymorphicJoins: SanitizedJoin[] = []\n\n sanitized.fields = await sanitizeFields({\n collectionConfig: sanitized,\n config,\n fields: sanitized.fields,\n joinPath: '',\n joins,\n parentIsLocalized: false,\n polymorphicJoins,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n if (sanitized.endpoints !== false) {\n if (!sanitized.endpoints) {\n sanitized.endpoints = []\n }\n\n if (sanitized.auth) {\n for (const endpoint of authCollectionEndpoints) {\n sanitized.endpoints.push(endpoint)\n }\n }\n\n if (sanitized.upload) {\n for (const endpoint of uploadCollectionEndpoints) {\n sanitized.endpoints.push(endpoint)\n }\n }\n\n for (const endpoint of defaultCollectionEndpoints) {\n sanitized.endpoints.push(endpoint)\n }\n }\n\n if (sanitized.timestamps !== false) {\n // add default timestamps fields only as needed\n let hasUpdatedAt: boolean | null = null\n let hasCreatedAt: boolean | null = null\n let hasDeletedAt: boolean | null = null\n\n sanitized.fields.some((field) => {\n if (fieldAffectsData(field)) {\n if (field.name === 'updatedAt') {\n hasUpdatedAt = true\n }\n\n if (field.name === 'createdAt') {\n hasCreatedAt = true\n }\n\n if (field.name === 'deletedAt') {\n hasDeletedAt = true\n }\n }\n\n return hasCreatedAt && hasUpdatedAt && (!sanitized.trash || hasDeletedAt)\n })\n\n if (!hasUpdatedAt) {\n sanitized.fields.push({\n name: 'updatedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n index: true,\n label: ({ t }) => t('general:updatedAt'),\n })\n }\n\n if (!hasCreatedAt) {\n sanitized.fields.push({\n name: 'createdAt',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n // The default sort for list view is createdAt. Thus, enabling indexing by default, is a major performance improvement, especially for large or a large amount of collections.\n type: 'date',\n index: true,\n label: ({ t }) => t('general:createdAt'),\n })\n }\n\n if (sanitized.trash && !hasDeletedAt) {\n sanitized.fields.push({\n name: 'deletedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n index: true,\n label: ({ t }) => t('general:deletedAt'),\n })\n }\n }\n\n const defaultLabels = formatLabels(sanitized.slug)\n\n sanitized.labels = {\n plural: sanitized.labels?.plural || defaultLabels.plural,\n singular: sanitized.labels?.singular || defaultLabels.singular,\n }\n\n if (sanitized.versions) {\n if (sanitized.versions === true) {\n sanitized.versions = { drafts: false, maxPerDoc: 100 }\n }\n\n if (sanitized.timestamps === false) {\n throw new TimestampsRequired(collection)\n }\n\n sanitized.versions.maxPerDoc =\n typeof sanitized.versions.maxPerDoc === 'number' ? sanitized.versions.maxPerDoc : 100\n\n if (sanitized.versions.drafts) {\n if (sanitized.versions.drafts === true) {\n sanitized.versions.drafts = {\n autosave: false,\n validate: false,\n }\n }\n\n if (sanitized.versions.drafts.autosave === true) {\n sanitized.versions.drafts.autosave = {\n interval: versionDefaults.autosaveInterval,\n }\n }\n\n if (sanitized.versions.drafts.validate === undefined) {\n sanitized.versions.drafts.validate = false\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, baseVersionFields)\n }\n } else {\n delete sanitized.versions\n }\n\n if (sanitized.folders === true) {\n sanitized.folders = {\n browseByFolder: true,\n }\n } else if (sanitized.folders) {\n sanitized.folders.browseByFolder = sanitized.folders.browseByFolder ?? true\n }\n\n if (sanitized.upload) {\n if (sanitized.upload === true) {\n sanitized.upload = {}\n }\n\n sanitized.upload.cacheTags = sanitized.upload?.cacheTags ?? true\n sanitized.upload.bulkUpload = sanitized.upload?.bulkUpload ?? true\n sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug\n sanitized.admin!.useAsTitle =\n sanitized.admin?.useAsTitle && sanitized.admin.useAsTitle !== 'id'\n ? sanitized.admin.useAsTitle\n : 'filename'\n\n const uploadFields = getBaseUploadFields({\n collection: sanitized,\n config,\n })\n\n sanitized.fields = mergeBaseFields(sanitized.fields, uploadFields)\n }\n\n if (sanitized.auth) {\n sanitized.auth = addDefaultsToAuthConfig(\n typeof sanitized.auth === 'boolean' ? {} : sanitized.auth,\n )\n\n // disable duplicate for auth enabled collections by default\n sanitized.disableDuplicate = sanitized.disableDuplicate ?? true\n\n if (sanitized.auth.loginWithUsername) {\n if (sanitized.auth.loginWithUsername === true) {\n sanitized.auth.loginWithUsername = addDefaultsToLoginWithUsernameConfig({})\n } else {\n const loginWithUsernameWithDefaults = addDefaultsToLoginWithUsernameConfig(\n sanitized.auth.loginWithUsername,\n )\n\n // if allowEmailLogin is false, requireUsername must be true\n if (loginWithUsernameWithDefaults.allowEmailLogin === false) {\n loginWithUsernameWithDefaults.requireUsername = true\n }\n sanitized.auth.loginWithUsername = loginWithUsernameWithDefaults\n }\n } else {\n sanitized.auth.loginWithUsername = false\n }\n\n if (!collection?.admin?.useAsTitle) {\n sanitized.admin!.useAsTitle = sanitized.auth.loginWithUsername ? 'username' : 'email'\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, getBaseAuthFields(sanitized.auth))\n }\n\n if (collection?.admin?.pagination?.limits?.length) {\n sanitized.admin!.pagination!.limits = collection.admin.pagination.limits\n }\n\n validateUseAsTitle(sanitized)\n\n const sanitizedConfig = sanitized as SanitizedCollectionConfig\n\n sanitizedConfig.joins = joins\n sanitizedConfig.polymorphicJoins = polymorphicJoins\n\n sanitizedConfig.flattenedFields = flattenAllFields({ fields: sanitizedConfig.fields })\n\n sanitizedConfig.sanitizedIndexes = sanitizeCompoundIndexes({\n fields: sanitizedConfig.flattenedFields,\n indexes: sanitizedConfig.indexes,\n })\n\n return sanitizedConfig\n}\n"],"names":["authCollectionEndpoints","getBaseAuthFields","TimestampsRequired","sanitizeFields","fieldAffectsData","mergeBaseFields","uploadCollectionEndpoints","getBaseUploadFields","flattenAllFields","formatLabels","baseVersionFields","versionDefaults","defaultCollectionEndpoints","addDefaultsToAuthConfig","addDefaultsToCollectionConfig","addDefaultsToLoginWithUsernameConfig","sanitizeCompoundIndexes","validateUseAsTitle","sanitizeCollection","config","collection","richTextSanitizationPromises","_validRelationships","_sanitized","sanitized","validRelationships","collections","map","c","slug","joins","polymorphicJoins","fields","collectionConfig","joinPath","parentIsLocalized","endpoints","auth","endpoint","push","upload","timestamps","hasUpdatedAt","hasCreatedAt","hasDeletedAt","some","field","name","trash","type","admin","disableBulkEdit","hidden","index","label","t","defaultLabels","labels","plural","singular","versions","drafts","maxPerDoc","autosave","validate","interval","autosaveInterval","undefined","folders","browseByFolder","cacheTags","bulkUpload","staticDir","useAsTitle","uploadFields","disableDuplicate","loginWithUsername","loginWithUsernameWithDefaults","allowEmailLogin","requireUsername","pagination","limits","length","sanitizedConfig","flattenedFields","sanitizedIndexes","indexes"],"mappings":"AAQA,SAASA,uBAAuB,QAAQ,gCAA+B;AACvE,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,cAAc,QAAQ,kCAAiC;AAChE,SAASC,gBAAgB,QAAQ,+BAA8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,CAACuC,iBAAiB,KAAK,MAAM;gBAC7CpD,UAAUa,IAAI,CAACuC,iBAAiB,GAAG7D,qCAAqC,CAAC;YAC3E,OAAO;gBACL,MAAM8D,gCAAgC9D,qCACpCS,UAAUa,IAAI,CAACuC,iBAAiB;gBAGlC,4DAA4D;gBAC5D,IAAIC,8BAA8BC,eAAe,KAAK,OAAO;oBAC3DD,8BAA8BE,eAAe,GAAG;gBAClD;gBACAvD,UAAUa,IAAI,CAACuC,iBAAiB,GAAGC;YACrC;QACF,OAAO;YACLrD,UAAUa,IAAI,CAACuC,iBAAiB,GAAG;QACrC;QAEA,IAAI,CAACxD,YAAY8B,OAAOuB,YAAY;YAClCjD,UAAU0B,KAAK,CAAEuB,UAAU,GAAGjD,UAAUa,IAAI,CAACuC,iBAAiB,GAAG,aAAa;QAChF;QAEApD,UAAUQ,MAAM,GAAG3B,gBAAgBmB,UAAUQ,MAAM,EAAE/B,kBAAkBuB,UAAUa,IAAI;IACvF;IAEA,IAAIjB,YAAY8B,OAAO8B,YAAYC,QAAQC,QAAQ;QACjD1D,UAAU0B,KAAK,CAAE8B,UAAU,CAAEC,MAAM,GAAG7D,WAAW8B,KAAK,CAAC8B,UAAU,CAACC,MAAM;IAC1E;IAEAhE,mBAAmBO;IAEnB,MAAM2D,kBAAkB3D;IAExB2D,gBAAgBrD,KAAK,GAAGA;IACxBqD,gBAAgBpD,gBAAgB,GAAGA;IAEnCoD,gBAAgBC,eAAe,GAAG5E,iBAAiB;QAAEwB,QAAQmD,gBAAgBnD,MAAM;IAAC;IAEpFmD,gBAAgBE,gBAAgB,GAAGrE,wBAAwB;QACzDgB,QAAQmD,gBAAgBC,eAAe;QACvCE,SAASH,gBAAgBG,OAAO;IAClC;IAEA,OAAOH;AACT,EAAC"}
|
|
@@ -12,33 +12,21 @@ import type { CollectionAdminCustom, CollectionCustom, CollectionSlug, JsonObjec
|
|
|
12
12
|
import type { PayloadRequest, SelectIncludeType, SelectType, Sort, TransformCollectionWithSelect, Where } from '../../types/index.js';
|
|
13
13
|
import type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js';
|
|
14
14
|
import type { IncomingCollectionVersions, SanitizedCollectionVersions } from '../../versions/types.js';
|
|
15
|
-
import type { AfterOperationArg,
|
|
15
|
+
import type { AfterOperationArg, BeforeOperationArg, OperationMap } from '../operations/utilities/types.js';
|
|
16
16
|
export type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug];
|
|
17
17
|
export type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug];
|
|
18
18
|
export type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> = TypedAuthOperations[TSlug];
|
|
19
|
-
export type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | '
|
|
19
|
+
export type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'>;
|
|
20
20
|
export type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> = RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>;
|
|
21
21
|
/**
|
|
22
22
|
* Helper type for draft data - makes all fields optional except auto-generated ones
|
|
23
23
|
* When creating a draft, required fields don't need to be provided as validation is skipped
|
|
24
24
|
*/
|
|
25
|
-
export type DraftDataFromCollection<TData extends JsonObject> = Partial<MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | '
|
|
25
|
+
export type DraftDataFromCollection<TData extends JsonObject> = Partial<MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'>>;
|
|
26
26
|
export type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<DataFromCollectionSlug<TSlug>>;
|
|
27
27
|
export type HookOperationType = 'autosave' | 'count' | 'countVersions' | 'create' | 'delete' | 'forgotPassword' | 'login' | 'read' | 'readDistinct' | 'refresh' | 'resetPassword' | 'restoreVersion' | 'update';
|
|
28
28
|
type CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>;
|
|
29
|
-
export type BeforeOperationHook = (
|
|
30
|
-
args?: any;
|
|
31
|
-
/**
|
|
32
|
-
* The collection which this hook is being run on
|
|
33
|
-
*/
|
|
34
|
-
collection: SanitizedCollectionConfig;
|
|
35
|
-
context: RequestContext;
|
|
36
|
-
/**
|
|
37
|
-
* Hook operation being performed
|
|
38
|
-
*/
|
|
39
|
-
operation: HookOperationType;
|
|
40
|
-
req: PayloadRequest;
|
|
41
|
-
}) => any;
|
|
29
|
+
export type BeforeOperationHook<TOperationGeneric extends CollectionSlug = string> = (arg: BeforeOperationArg<TOperationGeneric>) => Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0] | Promise<Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]> | Promise<void> | void;
|
|
42
30
|
export type BeforeValidateHook<T extends TypeWithID = any> = (args: {
|
|
43
31
|
/** The collection which this hook is being run on */
|
|
44
32
|
collection: SanitizedCollectionConfig;
|
|
@@ -122,7 +110,7 @@ export type AfterDeleteHook<T extends TypeWithID = any> = (args: {
|
|
|
122
110
|
id: number | string;
|
|
123
111
|
req: PayloadRequest;
|
|
124
112
|
}) => any;
|
|
125
|
-
export type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (arg: AfterOperationArg<TOperationGeneric>) => Awaited<ReturnType<
|
|
113
|
+
export type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (arg: AfterOperationArg<TOperationGeneric>) => Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>> | Promise<Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>>;
|
|
126
114
|
export type BeforeLoginHook<T extends TypeWithID = any> = (args: {
|
|
127
115
|
/** The collection which this hook is being run on */
|
|
128
116
|
collection: SanitizedCollectionConfig;
|
|
@@ -471,7 +459,7 @@ export type CollectionConfig<TSlug extends CollectionSlug = any> = {
|
|
|
471
459
|
beforeChange?: BeforeChangeHook[];
|
|
472
460
|
beforeDelete?: BeforeDeleteHook[];
|
|
473
461
|
beforeLogin?: BeforeLoginHook[];
|
|
474
|
-
beforeOperation?: BeforeOperationHook[];
|
|
462
|
+
beforeOperation?: BeforeOperationHook<TSlug>[];
|
|
475
463
|
beforeRead?: BeforeReadHook[];
|
|
476
464
|
beforeValidate?: BeforeValidateHook[];
|
|
477
465
|
/**
|
|
@@ -613,7 +601,7 @@ export interface SanitizedCollectionConfig extends Omit<DeepRequired<CollectionC
|
|
|
613
601
|
sanitizedIndexes: SanitizedCompoundIndex[];
|
|
614
602
|
slug: CollectionSlug;
|
|
615
603
|
upload: SanitizedUploadConfig;
|
|
616
|
-
versions
|
|
604
|
+
versions?: SanitizedCollectionVersions;
|
|
617
605
|
}
|
|
618
606
|
export type Collection = {
|
|
619
607
|
config: SanitizedCollectionConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,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,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV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A;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;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, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type { CollectionFoldersConfiguration } from '../../folders/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data - makes all fields optional except auto-generated ones\n * When creating a draft, required fields don't need to be provided as validation is skipped\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /**\n * The collection which this hook is being run on\n */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Inject custom components before the document controls\n */\n beforeDocumentControls?: CustomComponent[]\n /**\n * Inject custom components within the 3-dot menu dropdown\n */\n editMenuItems?: CustomComponent[]\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace, modify, or add new \"document\" views.\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\n edit?: EditConfig\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: 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 /**\n * Performance opt-in. If true, will use the [Select API](https://payloadcms.com/docs/queries/select) when\n * loading the list view to query only the active columns, as opposed to the entire documents.\n * If your cells require specific fields that may be unselected, such as within hooks, etc.,\n * use `forceSelect` in conjunction with this property.\n *\n * @experimental This is an experimental feature and may change in the future. Use at your own risk.\n */\n enableListViewSelectAPI?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * @description Enable grouping by a field in the list view.\n * Uses `payload.findDistinct` under the hood to populate the group-by options.\n *\n * @experimental This option is currently in beta and may change in future releases. Use at your own risk.\n */\n groupBy?: boolean\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @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 /** 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 edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enables folders for this collection\n */\n folders?: boolean | CollectionFoldersConfiguration\n /**\n * Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks\n */\n forceSelect?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://observablehq.com/@dgreensp/implementing-fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @experimental This is a beta feature and its behavior may be refined in future releases.\n * @default false\n */\n trash?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'\n > {\n admin: CollectionAdminOptions\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n folders: CollectionFoldersConfiguration | false\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n 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,GAkxBrD,WAQC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload, ViewTypes } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type { CollectionFoldersConfiguration } from '../../folders/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type {\n AfterOperationArg,\n BeforeOperationArg,\n OperationMap,\n} from '../operations/utilities/types.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data - makes all fields optional except auto-generated ones\n * When creating a draft, required fields don't need to be provided as validation is skipped\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'>\n>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\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 previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<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\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Inject custom components before the document controls\n */\n beforeDocumentControls?: CustomComponent[]\n /**\n * Inject custom components within the 3-dot menu dropdown\n */\n editMenuItems?: CustomComponent[]\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace, modify, or add new \"document\" views.\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\n edit?: EditConfig\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: 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 /**\n * Performance opt-in. If true, will use the [Select API](https://payloadcms.com/docs/queries/select) when\n * loading the list view to query only the active columns, as opposed to the entire documents.\n * If your cells require specific fields that may be unselected, such as within hooks, etc.,\n * use `forceSelect` in conjunction with this property.\n *\n * @experimental This is an experimental feature and may change in the future. Use at your own risk.\n */\n enableListViewSelectAPI?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * @description Enable grouping by a field in the list view.\n * Uses `payload.findDistinct` under the hood to populate the group-by options.\n *\n * @experimental This option is currently in beta and may change in future releases. Use at your own risk.\n */\n groupBy?: boolean\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @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 /** 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 edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enables folders for this collection\n */\n folders?: boolean | CollectionFoldersConfiguration\n /**\n * Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks\n */\n forceSelect?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook<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://observablehq.com/@dgreensp/implementing-fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @experimental This is a beta feature and its behavior may be refined in future releases.\n * @default false\n */\n trash?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'\n > {\n admin: CollectionAdminOptions\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n folders: CollectionFoldersConfiguration | false\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions?: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n 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,GA4wBrD,WAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/count.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/count.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAWpD,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAGD,eAAO,MAAM,cAAc,GAAU,KAAK,SAAS,cAAc,gBACjD,SAAS,KACtB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAuF/B,CAAA"}
|
|
@@ -4,7 +4,8 @@ import { validateQueryPaths } from '../../database/queryValidation/validateQuery
|
|
|
4
4
|
import { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js';
|
|
5
5
|
import { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js';
|
|
6
6
|
import { killTransaction } from '../../utilities/killTransaction.js';
|
|
7
|
-
import { buildAfterOperation } from './
|
|
7
|
+
import { buildAfterOperation } from './utilities/buildAfterOperation.js';
|
|
8
|
+
import { buildBeforeOperation } from './utilities/buildBeforeOperation.js';
|
|
8
9
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
10
|
export const countOperation = async (incomingArgs)=>{
|
|
10
11
|
let args = incomingArgs;
|
|
@@ -12,17 +13,11 @@ export const countOperation = async (incomingArgs)=>{
|
|
|
12
13
|
// /////////////////////////////////////
|
|
13
14
|
// beforeOperation - Collection
|
|
14
15
|
// /////////////////////////////////////
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
context: args.req.context,
|
|
21
|
-
operation: 'count',
|
|
22
|
-
req: args.req
|
|
23
|
-
}) || args;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
16
|
+
args = await buildBeforeOperation({
|
|
17
|
+
args,
|
|
18
|
+
collection: args.collection.config,
|
|
19
|
+
operation: 'count'
|
|
20
|
+
});
|
|
26
21
|
const { collection: { config: collectionConfig }, disableErrors, overrideAccess, req, trash = false, where } = args;
|
|
27
22
|
const { payload } = req;
|
|
28
23
|
// /////////////////////////////////////
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/operations/count.ts"],"sourcesContent":["import type { AccessResult } from '../../config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { Collection } from '../config/types.js'\n\nimport { executeAccess } from '../../auth/executeAccess.js'\nimport { combineQueries } from '../../database/combineQueries.js'\nimport { validateQueryPaths } from '../../database/queryValidation/validateQueryPaths.js'\nimport { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js'\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { buildAfterOperation } from './
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/operations/count.ts"],"sourcesContent":["import type { AccessResult } from '../../config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { Collection } from '../config/types.js'\n\nimport { executeAccess } from '../../auth/executeAccess.js'\nimport { combineQueries } from '../../database/combineQueries.js'\nimport { validateQueryPaths } from '../../database/queryValidation/validateQueryPaths.js'\nimport { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js'\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { buildAfterOperation } from './utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from './utilities/buildBeforeOperation.js'\n\nexport type Arguments = {\n collection: Collection\n disableErrors?: boolean\n overrideAccess?: boolean\n req?: PayloadRequest\n trash?: boolean\n where?: Where\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const countOperation = async <TSlug extends CollectionSlug>(\n incomingArgs: Arguments,\n): Promise<{ totalDocs: number }> => {\n let args = incomingArgs\n\n try {\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'count',\n })\n\n const {\n collection: { config: collectionConfig },\n disableErrors,\n overrideAccess,\n req,\n trash = false,\n where,\n } = args\n\n const { payload } = req!\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n let accessResult: AccessResult\n\n if (!overrideAccess) {\n accessResult = await executeAccess({ disableErrors, req: req! }, collectionConfig.access.read)\n\n // If errors are disabled, and access returns false, return empty results\n if (accessResult === false) {\n return {\n totalDocs: 0,\n }\n }\n }\n\n let result: { totalDocs: number }\n\n let fullWhere = combineQueries(where!, accessResult!)\n sanitizeWhereQuery({ fields: collectionConfig.flattenedFields, payload, where: fullWhere })\n\n // Exclude trashed documents when trash: false\n fullWhere = appendNonTrashedFilter({\n enableTrash: collectionConfig.trash,\n trash,\n where: fullWhere,\n })\n\n await validateQueryPaths({\n collectionConfig,\n overrideAccess: overrideAccess!,\n req: req!,\n where: where!,\n })\n\n result = await payload.db.count({\n collection: collectionConfig.slug,\n req,\n where: fullWhere,\n })\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: collectionConfig,\n operation: 'count',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req!)\n throw error\n }\n}\n"],"names":["executeAccess","combineQueries","validateQueryPaths","sanitizeWhereQuery","appendNonTrashedFilter","killTransaction","buildAfterOperation","buildBeforeOperation","countOperation","incomingArgs","args","collection","config","operation","collectionConfig","disableErrors","overrideAccess","req","trash","where","payload","accessResult","access","read","totalDocs","result","fullWhere","fields","flattenedFields","enableTrash","db","count","slug","error"],"m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AOA;QACT;QAEAM,SAAS,MAAML,QAAQU,EAAE,CAACC,KAAK,CAAC;YAC9BpB,YAAYG,iBAAiBkB,IAAI;YACjCf;YACAE,OAAOO;QACT;QAEA,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCD,SAAS,MAAMnB,oBAAoB;YACjCI;YACAC,YAAYG;YACZD,WAAW;YACXY;QACF;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,OAAOA;IACT,EAAE,OAAOQ,OAAgB;QACvB,MAAM5B,gBAAgBK,KAAKO,GAAG;QAC9B,MAAMgB;IACR;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/countVersions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAMpD,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/countVersions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAMpD,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKlF,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAGD,eAAO,MAAM,sBAAsB,GAAU,KAAK,SAAS,cAAc,gBACzD,SAAS,KACtB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAuF/B,CAAA"}
|
|
@@ -4,7 +4,8 @@ import { validateQueryPaths } from '../../database/queryValidation/validateQuery
|
|
|
4
4
|
import { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js';
|
|
5
5
|
import { buildVersionCollectionFields } from '../../index.js';
|
|
6
6
|
import { killTransaction } from '../../utilities/killTransaction.js';
|
|
7
|
-
import { buildAfterOperation } from './
|
|
7
|
+
import { buildAfterOperation } from './utilities/buildAfterOperation.js';
|
|
8
|
+
import { buildBeforeOperation } from './utilities/buildBeforeOperation.js';
|
|
8
9
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
10
|
export const countVersionsOperation = async (incomingArgs)=>{
|
|
10
11
|
let args = incomingArgs;
|
|
@@ -12,17 +13,11 @@ export const countVersionsOperation = async (incomingArgs)=>{
|
|
|
12
13
|
// /////////////////////////////////////
|
|
13
14
|
// beforeOperation - Collection
|
|
14
15
|
// /////////////////////////////////////
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
context: args.req.context,
|
|
21
|
-
operation: 'countVersions',
|
|
22
|
-
req: args.req
|
|
23
|
-
}) || args;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
16
|
+
args = await buildBeforeOperation({
|
|
17
|
+
args,
|
|
18
|
+
collection: args.collection.config,
|
|
19
|
+
operation: 'countVersions'
|
|
20
|
+
});
|
|
26
21
|
const { collection: { config: collectionConfig }, disableErrors, overrideAccess, req, where } = args;
|
|
27
22
|
const { locale, payload } = req;
|
|
28
23
|
// /////////////////////////////////////
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/operations/countVersions.ts"],"sourcesContent":["import type { AccessResult } from '../../config/types.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { Collection } from '../config/types.js'\n\nimport { executeAccess } from '../../auth/executeAccess.js'\nimport { combineQueries } from '../../database/combineQueries.js'\nimport { validateQueryPaths } from '../../database/queryValidation/validateQueryPaths.js'\nimport { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js'\nimport { buildVersionCollectionFields, type CollectionSlug } from '../../index.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { buildAfterOperation } from './
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/operations/countVersions.ts"],"sourcesContent":["import type { AccessResult } from '../../config/types.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { Collection } from '../config/types.js'\n\nimport { executeAccess } from '../../auth/executeAccess.js'\nimport { combineQueries } from '../../database/combineQueries.js'\nimport { validateQueryPaths } from '../../database/queryValidation/validateQueryPaths.js'\nimport { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js'\nimport { buildVersionCollectionFields, type CollectionSlug } from '../../index.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { buildAfterOperation } from './utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from './utilities/buildBeforeOperation.js'\n\nexport type Arguments = {\n collection: Collection\n disableErrors?: boolean\n overrideAccess?: boolean\n req?: PayloadRequest\n where?: Where\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const countVersionsOperation = async <TSlug extends CollectionSlug>(\n incomingArgs: Arguments,\n): Promise<{ totalDocs: number }> => {\n let args = incomingArgs\n\n try {\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'countVersions',\n })\n\n const {\n collection: { config: collectionConfig },\n disableErrors,\n overrideAccess,\n req,\n where,\n } = args\n\n const { locale, payload } = req!\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n let accessResult: AccessResult\n\n if (!overrideAccess) {\n accessResult = await executeAccess(\n { disableErrors, req: req! },\n collectionConfig.access.readVersions,\n )\n\n // If errors are disabled, and access returns false, return empty results\n if (accessResult === false) {\n return {\n totalDocs: 0,\n }\n }\n }\n\n let result: { totalDocs: number }\n\n const fullWhere = combineQueries(where!, accessResult!)\n\n const versionFields = buildVersionCollectionFields(payload.config, collectionConfig, true)\n\n sanitizeWhereQuery({ fields: versionFields, payload, where: fullWhere })\n\n await validateQueryPaths({\n collectionConfig,\n overrideAccess: overrideAccess!,\n req: req!,\n versionFields,\n where: where!,\n })\n\n result = await payload.db.countVersions({\n collection: collectionConfig.slug,\n locale: locale!,\n req,\n where: fullWhere,\n })\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: collectionConfig,\n operation: 'countVersions',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req!)\n throw error\n }\n}\n"],"names":["executeAccess","combineQueries","validateQueryPaths","sanitizeWhereQuery","buildVersionCollectionFields","killTransaction","buildAfterOperation","buildBeforeOperation","countVersionsOperation","incomingArgs","args","collection","config","operation","collectionConfig","disableErrors","overrideAccess","req","where","locale","payload","accessResult","access","readVersions","totalDocs","result","fullWhere","versionFields","fields","db","countVersions","slug","error"],"mappings":"AAIA,SAASA,aAAa,QAAQ,8BAA6B;AAC3D,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,kBAAkB,QAAQ,uDAAsD;AACzF,SAASC,kBAAkB,QAAQ,uCAAsC;AACzE,SAASC,4BAA4B,QAA6B,iBAAgB;AAClF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,mBAAmB,QAAQ,qCAAoC;AACxE,SAASC,oBAAoB,QAAQ,sCAAqC;AAU1E,6DAA6D;AAC7D,OAAO,MAAMC,yBAAyB,OACpCC;IAEA,IAAIC,OAAOD;IAEX,IAAI;QACF,wCAAwC;QACxC,+BAA+B;QAC/B,wCAAwC;QAExCC,OAAO,MAAMH,qBAAqB;YAChCG;YACAC,YAAYD,KAAKC,UAAU,CAACC,MAAM;YAClCC,WAAW;QACb;QAEA,MAAM,EACJF,YAAY,EAAEC,QAAQE,gBAAgB,EAAE,EACxCC,aAAa,EACbC,cAAc,EACdC,GAAG,EACHC,KAAK,EACN,GAAGR;QAEJ,MAAM,EAAES,MAAM,EAAEC,OAAO,EAAE,GAAGH;QAE5B,wCAAwC;QACxC,SAAS;QACT,wCAAwC;QAExC,IAAII;QAEJ,IAAI,CAACL,gBAAgB;YACnBK,eAAe,MAAMrB,cACnB;gBAAEe;gBAAeE,KAAKA;YAAK,GAC3BH,iBAAiBQ,MAAM,CAACC,YAAY;YAGtC,yEAAyE;YACzE,IAAIF,iBAAiB,OAAO;gBAC1B,OAAO;oBACLG,WAAW;gBACb;YACF;QACF;QAEA,IAAIC;QAEJ,MAAMC,YAAYzB,eAAeiB,OAAQG;QAEzC,MAAMM,gBAAgBvB,6BAA6BgB,QAAQR,MAAM,EAAEE,kBAAkB;QAErFX,mBAAmB;YAAEyB,QAAQD;YAAeP;YAASF,OAAOQ;QAAU;QAEtE,MAAMxB,mBAAmB;YACvBY;YACAE,gBAAgBA;YAChBC,KAAKA;YACLU;YACAT,OAAOA;QACT;QAEAO,SAAS,MAAML,QAAQS,EAAE,CAACC,aAAa,CAAC;YACtCnB,YAAYG,iBAAiBiB,IAAI;YACjCZ,QAAQA;YACRF;YACAC,OAAOQ;QACT;QAEA,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCD,SAAS,MAAMnB,oBAAoB;YACjCI;YACAC,YAAYG;YACZD,WAAW;YACXY;QACF;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,OAAOA;IACT,EAAE,OAAOO,OAAgB;QACvB,MAAM3B,gBAAgBK,KAAKO,GAAG;QAC9B,MAAMe;IACR;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/create.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EA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AAE,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,gBAEjC,SAAS,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAqVvD,CAAA"}
|
|
@@ -13,11 +13,13 @@ import { generateFileData } from '../../uploads/generateFileData.js';
|
|
|
13
13
|
import { unlinkTempFiles } from '../../uploads/unlinkTempFiles.js';
|
|
14
14
|
import { uploadFiles } from '../../uploads/uploadFiles.js';
|
|
15
15
|
import { commitTransaction } from '../../utilities/commitTransaction.js';
|
|
16
|
+
import { hasDraftsEnabled, hasDraftValidationEnabled } from '../../utilities/getVersionsConfig.js';
|
|
16
17
|
import { initTransaction } from '../../utilities/initTransaction.js';
|
|
17
18
|
import { killTransaction } from '../../utilities/killTransaction.js';
|
|
18
19
|
import { sanitizeInternalFields } from '../../utilities/sanitizeInternalFields.js';
|
|
19
20
|
import { sanitizeSelect } from '../../utilities/sanitizeSelect.js';
|
|
20
|
-
import { buildAfterOperation } from './
|
|
21
|
+
import { buildAfterOperation } from './utilities/buildAfterOperation.js';
|
|
22
|
+
import { buildBeforeOperation } from './utilities/buildBeforeOperation.js';
|
|
21
23
|
export const createOperation = async (incomingArgs)=>{
|
|
22
24
|
let args = incomingArgs;
|
|
23
25
|
try {
|
|
@@ -32,23 +34,17 @@ export const createOperation = async (incomingArgs)=>{
|
|
|
32
34
|
// /////////////////////////////////////
|
|
33
35
|
// beforeOperation - Collection
|
|
34
36
|
// /////////////////////////////////////
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
context: args.req.context,
|
|
41
|
-
operation: 'create',
|
|
42
|
-
req: args.req
|
|
43
|
-
}) || args;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
37
|
+
args = await buildBeforeOperation({
|
|
38
|
+
args,
|
|
39
|
+
collection: args.collection.config,
|
|
40
|
+
operation: 'create'
|
|
41
|
+
});
|
|
46
42
|
if (args.publishSpecificLocale) {
|
|
47
43
|
args.req.locale = args.publishSpecificLocale;
|
|
48
44
|
}
|
|
49
45
|
const { autosave = false, collection: { config: collectionConfig }, collection, depth, disableVerificationEmail, draft = false, duplicateFromID, overrideAccess, overwriteExistingFiles = false, populate, publishSpecificLocale, req: { fallbackLocale, locale, payload, payload: { config } }, req, select: incomingSelect, selectedLocales, showHiddenFields } = args;
|
|
50
46
|
let { data } = args;
|
|
51
|
-
const isSavingDraft = Boolean(draft && collectionConfig
|
|
47
|
+
const isSavingDraft = Boolean(draft && hasDraftsEnabled(collectionConfig));
|
|
52
48
|
let duplicatedFromDocWithLocales = {};
|
|
53
49
|
let duplicatedFromDoc = {};
|
|
54
50
|
if (duplicateFromID) {
|
|
@@ -143,7 +139,7 @@ export const createOperation = async (incomingArgs)=>{
|
|
|
143
139
|
operation: 'create',
|
|
144
140
|
overrideAccess,
|
|
145
141
|
req,
|
|
146
|
-
skipValidation: isSavingDraft &&
|
|
142
|
+
skipValidation: isSavingDraft && !hasDraftValidationEnabled(collectionConfig)
|
|
147
143
|
});
|
|
148
144
|
// /////////////////////////////////////
|
|
149
145
|
// Write files to local storage
|