payload 3.71.0-internal-debug.cd77e5d → 3.71.0-internal-debug.dea9d74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/admin/forms/Form.d.ts +2 -2
  2. package/dist/admin/forms/Form.d.ts.map +1 -1
  3. package/dist/admin/forms/Form.js.map +1 -1
  4. package/dist/collections/operations/create.d.ts.map +1 -1
  5. package/dist/collections/operations/create.js +2 -1
  6. package/dist/collections/operations/create.js.map +1 -1
  7. package/dist/config/types.d.ts +6 -1
  8. package/dist/config/types.d.ts.map +1 -1
  9. package/dist/config/types.js.map +1 -1
  10. package/dist/exports/internal.d.ts +9 -0
  11. package/dist/exports/internal.d.ts.map +1 -1
  12. package/dist/exports/internal.js.map +1 -1
  13. package/dist/fields/config/types.d.ts +1 -1
  14. package/dist/fields/config/types.d.ts.map +1 -1
  15. package/dist/fields/config/types.js.map +1 -1
  16. package/dist/fields/getFieldPaths.d.ts +6 -6
  17. package/dist/fields/getFieldPaths.d.ts.map +1 -1
  18. package/dist/fields/getFieldPaths.js +7 -22
  19. package/dist/fields/getFieldPaths.js.map +1 -1
  20. package/dist/fields/hooks/afterChange/promise.js +1 -1
  21. package/dist/fields/hooks/afterChange/promise.js.map +1 -1
  22. package/dist/fields/hooks/afterRead/promise.js +1 -1
  23. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  24. package/dist/fields/hooks/beforeChange/promise.js +1 -1
  25. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  26. package/dist/fields/hooks/beforeDuplicate/promise.js +1 -1
  27. package/dist/fields/hooks/beforeDuplicate/promise.js.map +1 -1
  28. package/dist/fields/hooks/beforeValidate/promise.js +1 -1
  29. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  30. package/dist/index.bundled.d.ts +57 -34
  31. package/dist/index.d.ts +28 -30
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/utilities/formatErrors.js.map +1 -1
  36. package/dist/utilities/handleEndpoints.d.ts.map +1 -1
  37. package/dist/utilities/handleEndpoints.js +11 -9
  38. package/dist/utilities/handleEndpoints.js.map +1 -1
  39. package/dist/utilities/headersWithCors.d.ts.map +1 -1
  40. package/dist/utilities/headersWithCors.js +20 -13
  41. package/dist/utilities/headersWithCors.js.map +1 -1
  42. package/dist/versions/saveVersion.d.ts +8 -1
  43. package/dist/versions/saveVersion.d.ts.map +1 -1
  44. package/dist/versions/saveVersion.js +6 -2
  45. package/dist/versions/saveVersion.js.map +1 -1
  46. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/fields/hooks/beforeValidate/promise.ts"],"sourcesContent":["import type { RichTextAdapter } from '../../../admin/RichText.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { JsonObject, JsonValue, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, TabAsField } from '../../config/types.js'\n\nimport { MissingEditorProp } from '../../../errors/index.js'\nimport { fieldAffectsData, tabHasName, valueIsValueWithRelation } from '../../config/types.js'\nimport { getFieldPathsModified as getFieldPaths } from '../../getFieldPaths.js'\nimport { getExistingRowDoc } from '../beforeChange/getExistingRowDoc.js'\nimport { getFallbackValue } from './getFallbackValue.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args<T> = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: T\n /**\n * The original data (not modified by any hooks)\n */\n doc: T\n field: Field | TabAsField\n fieldIndex: number\n global: null | SanitizedGlobalConfig\n id?: number | string\n operation: 'create' | 'update'\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n /**\n * The original siblingData (not modified by any hooks)\n */\n siblingDoc: JsonObject\n siblingFields?: (Field | TabAsField)[]\n}\n\n// This function is responsible for the following actions, in order:\n// - Sanitize incoming data\n// - Execute field hooks\n// - Execute field access control\n// - Merge original document data into incoming data\n// - Compute default values for undefined fields\n\nexport const promise = async <T>({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n field,\n fieldIndex,\n global,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingFields,\n}: Args<T>): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const pathSegments = path ? path.split('.') : []\n const schemaPathSegments = schemaPath ? schemaPath.split('.') : []\n const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : []\n\n if (fieldAffectsData(field)) {\n if (field.name === 'id') {\n if (field.type === 'number' && typeof siblingData[field.name] === 'string') {\n const value = siblingData[field.name] as string\n\n siblingData[field.name] = parseFloat(value)\n }\n\n if (\n field.type === 'text' &&\n typeof siblingData[field.name]?.toString === 'function' &&\n typeof siblingData[field.name] !== 'string'\n ) {\n siblingData[field.name] = siblingData[field.name].toString()\n }\n }\n\n // Sanitize incoming data\n switch (field.type) {\n case 'array':\n case 'blocks': {\n // Handle cases of arrays being intentionally set to 0\n if (siblingData[field.name] === '0' || siblingData[field.name] === 0) {\n siblingData[field.name] = []\n }\n\n break\n }\n\n case 'checkbox': {\n if (siblingData[field.name] === 'true') {\n siblingData[field.name] = true\n }\n if (siblingData[field.name] === 'false') {\n siblingData[field.name] = false\n }\n if (siblingData[field.name] === '') {\n siblingData[field.name] = false\n }\n\n break\n }\n\n case 'number': {\n if (typeof siblingData[field.name] === 'string') {\n const value = siblingData[field.name] as string\n const trimmed = value.trim()\n siblingData[field.name] = trimmed.length === 0 ? null : parseFloat(trimmed)\n }\n\n break\n }\n\n case 'point': {\n if (Array.isArray(siblingData[field.name])) {\n siblingData[field.name] = (siblingData[field.name] as string[]).map((coordinate, i) => {\n if (typeof coordinate === 'string') {\n const value = siblingData[field.name][i] as string\n const trimmed = value.trim()\n return trimmed.length === 0 ? null : parseFloat(trimmed)\n }\n return coordinate\n })\n }\n\n break\n }\n case 'relationship':\n case 'upload': {\n if (\n siblingData[field.name] === '' ||\n siblingData[field.name] === 'none' ||\n siblingData[field.name] === 'null' ||\n siblingData[field.name] === null\n ) {\n if (field.hasMany === true) {\n siblingData[field.name] = []\n } else {\n siblingData[field.name] = null\n }\n }\n\n const value = siblingData[field.name]\n\n if (Array.isArray(field.relationTo)) {\n if (Array.isArray(value)) {\n value.forEach((relatedDoc: { relationTo: string; value: JsonValue }, i) => {\n const relatedCollection = req.payload.collections?.[relatedDoc.relationTo]?.config\n\n if (\n typeof relatedDoc.value === 'object' &&\n relatedDoc.value &&\n 'id' in relatedDoc.value\n ) {\n relatedDoc.value = relatedDoc.value.id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name][i] = {\n ...relatedDoc,\n value: parseFloat(relatedDoc.value as string),\n }\n }\n }\n })\n }\n if (field.hasMany !== true && valueIsValueWithRelation(value)) {\n const relatedCollection = req.payload.collections?.[value.relationTo]?.config\n\n if (typeof value.value === 'object' && value.value && 'id' in value.value) {\n value.value = (value.value as TypeWithID).id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name] = { ...value, value: parseFloat(value.value as string) }\n }\n }\n }\n } else {\n if (Array.isArray(value)) {\n value.forEach((relatedDoc: unknown, i) => {\n const relatedCollection = Array.isArray(field.relationTo)\n ? undefined\n : req.payload.collections?.[field.relationTo]?.config\n\n if (typeof relatedDoc === 'object' && relatedDoc && 'id' in relatedDoc) {\n value[i] = relatedDoc.id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name][i] = parseFloat(relatedDoc as string)\n }\n }\n })\n }\n if (field.hasMany !== true && value) {\n const relatedCollection = req.payload.collections?.[field.relationTo]?.config\n\n if (typeof value === 'object' && value && 'id' in value) {\n siblingData[field.name] = value.id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name] = parseFloat(value as string)\n }\n }\n }\n }\n break\n }\n case 'richText': {\n if (typeof siblingData[field.name] === 'string') {\n try {\n const richTextJSON = JSON.parse(siblingData[field.name] as string)\n siblingData[field.name] = richTextJSON\n } catch {\n // Disregard this data as it is not valid.\n // Will be reported to user by field validation\n }\n }\n\n break\n }\n\n default: {\n break\n }\n }\n\n // ensure the fallback value is only computed one time\n // either here or when access control returns false\n const fallbackResult: { executed: boolean; value: unknown } = {\n executed: false,\n value: undefined,\n }\n if (typeof siblingData[field.name!] === 'undefined') {\n fallbackResult.value = await getFallbackValue({ field, req, siblingDoc })\n fallbackResult.executed = true\n }\n\n // Execute hooks\n if ('hooks' in field && field.hooks?.beforeValidate) {\n for (const hook of field.hooks.beforeValidate) {\n const hookedValue = await hook({\n blockData,\n collection,\n context,\n data: data as Partial<T>,\n field,\n global,\n indexPath: indexPathSegments,\n operation,\n originalDoc: doc,\n overrideAccess,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingFields: siblingFields!,\n value:\n typeof siblingData[field.name] === 'undefined'\n ? fallbackResult.value\n : siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n // Execute access control\n if (field.access && field.access[operation]) {\n const result = overrideAccess\n ? true\n : await field.access[operation]({\n id,\n blockData,\n data: data as Partial<T>,\n doc,\n req,\n siblingData,\n })\n\n if (!result) {\n delete siblingData[field.name!]\n }\n }\n\n if (typeof siblingData[field.name!] === 'undefined') {\n siblingData[field.name!] = !fallbackResult.executed\n ? await getFallbackValue({ field, req, siblingDoc })\n : fallbackResult.value\n }\n }\n\n // Traverse subfields\n switch (field.type) {\n case 'array': {\n const rows = siblingData[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n promises.push(\n traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath,\n req,\n siblingData: row as JsonObject,\n siblingDoc: getExistingRowDoc(row as JsonObject, siblingDoc[field.name]),\n }),\n )\n })\n\n await Promise.all(promises)\n }\n break\n }\n\n case 'blocks': {\n const rows = siblingData[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n const rowSiblingDoc = getExistingRowDoc(row as JsonObject, siblingDoc[field.name])\n const blockTypeToMatch = (row as JsonObject).blockType || rowSiblingDoc.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n ((field.blockReferences ?? field.blocks).find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n if (block) {\n ;(row as JsonObject).blockType = blockTypeToMatch\n\n promises.push(\n traverseFields({\n id,\n blockData: row,\n collection,\n context,\n data,\n doc,\n fields: block.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath + '.' + block.slug,\n req,\n siblingData: row as JsonObject,\n siblingDoc: rowSiblingDoc,\n }),\n )\n }\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'collapsible':\n case 'row': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n })\n\n break\n }\n\n case 'group': {\n let groupSiblingData = siblingData\n let groupSiblingDoc = siblingDoc\n\n const isNamedGroup = fieldAffectsData(field)\n\n if (isNamedGroup) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n groupSiblingData = siblingData[field.name] as Record<string, unknown>\n groupSiblingDoc = siblingDoc[field.name] as Record<string, unknown>\n }\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: isNamedGroup ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedGroup ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: groupSiblingData,\n siblingDoc: groupSiblingDoc,\n })\n\n break\n }\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof field?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n const editor: RichTextAdapter = field?.editor\n\n if (editor?.hooks?.beforeValidate?.length) {\n for (const hook of editor.hooks.beforeValidate) {\n const hookedValue = await hook({\n collection,\n context,\n data: data as Partial<T>,\n field,\n global,\n indexPath: indexPathSegments,\n operation,\n originalDoc: doc,\n overrideAccess,\n parentIsLocalized,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingData[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n break\n }\n\n case 'tab': {\n let tabSiblingData\n let tabSiblingDoc\n\n const isNamedTab = tabHasName(field)\n\n if (isNamedTab) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n tabSiblingData = siblingData[field.name] as Record<string, unknown>\n tabSiblingDoc = siblingDoc[field.name] as Record<string, unknown>\n } else {\n tabSiblingData = siblingData\n tabSiblingDoc = siblingDoc\n }\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: isNamedTab ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedTab ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: tabSiblingData,\n siblingDoc: tabSiblingDoc,\n })\n\n break\n }\n\n case 'tabs': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n global,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n}\n"],"names":["MissingEditorProp","fieldAffectsData","tabHasName","valueIsValueWithRelation","getFieldPathsModified","getFieldPaths","getExistingRowDoc","getFallbackValue","traverseFields","promise","id","blockData","collection","context","data","doc","field","fieldIndex","global","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingFields","indexPath","path","schemaPath","index","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","name","type","value","parseFloat","toString","trimmed","trim","length","Array","isArray","coordinate","i","hasMany","relationTo","forEach","relatedDoc","relatedCollection","payload","collections","config","fields","relationshipIDField","find","collectionField","undefined","richTextJSON","JSON","parse","fallbackResult","executed","hooks","beforeValidate","hook","hookedValue","originalDoc","previousSiblingDoc","previousValue","access","result","rows","promises","row","rowIndex","push","localized","Promise","all","rowSiblingDoc","blockTypeToMatch","blockType","block","blocks","blockReferences","curBlock","slug","groupSiblingData","groupSiblingDoc","isNamedGroup","editor","Error","tabSiblingData","tabSiblingDoc","isNamedTab","tabs","tab"],"mappings":"AAOA,SAASA,iBAAiB,QAAQ,2BAA0B;AAC5D,SAASC,gBAAgB,EAAEC,UAAU,EAAEC,wBAAwB,QAAQ,wBAAuB;AAC9F,SAASC,yBAAyBC,aAAa,QAAQ,yBAAwB;AAC/E,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,gBAAgB,QAAQ,wBAAuB;AACxD,SAASC,cAAc,QAAQ,sBAAqB;AAiCpD,oEAAoE;AACpE,2BAA2B;AAC3B,wBAAwB;AACxB,iCAAiC;AACjC,oDAAoD;AACpD,gDAAgD;AAEhD,OAAO,MAAMC,UAAU,OAAU,EAC/BC,EAAE,EACFC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,WAAW,EACXC,UAAU,EACVC,aAAa,EACL;IACR,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAG1B,cAAc;QACpDW;QACAgB,OAAOf;QACPI;QACAE;QACAC;IACF;IAEA,MAAMS,eAAeH,OAAOA,KAAKI,KAAK,CAAC,OAAO,EAAE;IAChD,MAAMC,qBAAqBJ,aAAaA,WAAW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e;oBACnBE;oBACAC;oBACAC;oBACAC;oBACAC;oBACAC;oBACA8C,QAAQ7C,MAAMwF,IAAI,CAACjE,GAAG,CAAC,CAACkE,MAAS,CAAA;4BAAE,GAAGA,GAAG;4BAAE/D,MAAM;wBAAM,CAAA;oBACvDxB;oBACAC;oBACAC;oBACAC,iBAAiBQ;oBACjBP;oBACAC,YAAYO;oBACZN,kBAAkBO;oBAClBN;oBACAC;oBACAC;gBACF;gBAEA;YACF;QAEA;YAAS;gBACP;YACF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/fields/hooks/beforeValidate/promise.ts"],"sourcesContent":["import type { RichTextAdapter } from '../../../admin/RichText.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { JsonObject, JsonValue, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, TabAsField } from '../../config/types.js'\n\nimport { MissingEditorProp } from '../../../errors/index.js'\nimport { fieldAffectsData, tabHasName, valueIsValueWithRelation } from '../../config/types.js'\nimport { getFieldPaths } from '../../getFieldPaths.js'\nimport { getExistingRowDoc } from '../beforeChange/getExistingRowDoc.js'\nimport { getFallbackValue } from './getFallbackValue.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args<T> = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: T\n /**\n * The original data (not modified by any hooks)\n */\n doc: T\n field: Field | TabAsField\n fieldIndex: number\n global: null | SanitizedGlobalConfig\n id?: number | string\n operation: 'create' | 'update'\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n /**\n * The original siblingData (not modified by any hooks)\n */\n siblingDoc: JsonObject\n siblingFields?: (Field | TabAsField)[]\n}\n\n// This function is responsible for the following actions, in order:\n// - Sanitize incoming data\n// - Execute field hooks\n// - Execute field access control\n// - Merge original document data into incoming data\n// - Compute default values for undefined fields\n\nexport const promise = async <T>({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n field,\n fieldIndex,\n global,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingFields,\n}: Args<T>): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const pathSegments = path ? path.split('.') : []\n const schemaPathSegments = schemaPath ? schemaPath.split('.') : []\n const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : []\n\n if (fieldAffectsData(field)) {\n if (field.name === 'id') {\n if (field.type === 'number' && typeof siblingData[field.name] === 'string') {\n const value = siblingData[field.name] as string\n\n siblingData[field.name] = parseFloat(value)\n }\n\n if (\n field.type === 'text' &&\n typeof siblingData[field.name]?.toString === 'function' &&\n typeof siblingData[field.name] !== 'string'\n ) {\n siblingData[field.name] = siblingData[field.name].toString()\n }\n }\n\n // Sanitize incoming data\n switch (field.type) {\n case 'array':\n case 'blocks': {\n // Handle cases of arrays being intentionally set to 0\n if (siblingData[field.name] === '0' || siblingData[field.name] === 0) {\n siblingData[field.name] = []\n }\n\n break\n }\n\n case 'checkbox': {\n if (siblingData[field.name] === 'true') {\n siblingData[field.name] = true\n }\n if (siblingData[field.name] === 'false') {\n siblingData[field.name] = false\n }\n if (siblingData[field.name] === '') {\n siblingData[field.name] = false\n }\n\n break\n }\n\n case 'number': {\n if (typeof siblingData[field.name] === 'string') {\n const value = siblingData[field.name] as string\n const trimmed = value.trim()\n siblingData[field.name] = trimmed.length === 0 ? null : parseFloat(trimmed)\n }\n\n break\n }\n\n case 'point': {\n if (Array.isArray(siblingData[field.name])) {\n siblingData[field.name] = (siblingData[field.name] as string[]).map((coordinate, i) => {\n if (typeof coordinate === 'string') {\n const value = siblingData[field.name][i] as string\n const trimmed = value.trim()\n return trimmed.length === 0 ? null : parseFloat(trimmed)\n }\n return coordinate\n })\n }\n\n break\n }\n case 'relationship':\n case 'upload': {\n if (\n siblingData[field.name] === '' ||\n siblingData[field.name] === 'none' ||\n siblingData[field.name] === 'null' ||\n siblingData[field.name] === null\n ) {\n if (field.hasMany === true) {\n siblingData[field.name] = []\n } else {\n siblingData[field.name] = null\n }\n }\n\n const value = siblingData[field.name]\n\n if (Array.isArray(field.relationTo)) {\n if (Array.isArray(value)) {\n value.forEach((relatedDoc: { relationTo: string; value: JsonValue }, i) => {\n const relatedCollection = req.payload.collections?.[relatedDoc.relationTo]?.config\n\n if (\n typeof relatedDoc.value === 'object' &&\n relatedDoc.value &&\n 'id' in relatedDoc.value\n ) {\n relatedDoc.value = relatedDoc.value.id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name][i] = {\n ...relatedDoc,\n value: parseFloat(relatedDoc.value as string),\n }\n }\n }\n })\n }\n if (field.hasMany !== true && valueIsValueWithRelation(value)) {\n const relatedCollection = req.payload.collections?.[value.relationTo]?.config\n\n if (typeof value.value === 'object' && value.value && 'id' in value.value) {\n value.value = (value.value as TypeWithID).id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name] = { ...value, value: parseFloat(value.value as string) }\n }\n }\n }\n } else {\n if (Array.isArray(value)) {\n value.forEach((relatedDoc: unknown, i) => {\n const relatedCollection = Array.isArray(field.relationTo)\n ? undefined\n : req.payload.collections?.[field.relationTo]?.config\n\n if (typeof relatedDoc === 'object' && relatedDoc && 'id' in relatedDoc) {\n value[i] = relatedDoc.id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name][i] = parseFloat(relatedDoc as string)\n }\n }\n })\n }\n if (field.hasMany !== true && value) {\n const relatedCollection = req.payload.collections?.[field.relationTo]?.config\n\n if (typeof value === 'object' && value && 'id' in value) {\n siblingData[field.name] = value.id\n }\n\n if (relatedCollection?.fields) {\n const relationshipIDField = relatedCollection.fields.find(\n (collectionField) =>\n fieldAffectsData(collectionField) && collectionField.name === 'id',\n )\n if (relationshipIDField?.type === 'number') {\n siblingData[field.name] = parseFloat(value as string)\n }\n }\n }\n }\n break\n }\n case 'richText': {\n if (typeof siblingData[field.name] === 'string') {\n try {\n const richTextJSON = JSON.parse(siblingData[field.name] as string)\n siblingData[field.name] = richTextJSON\n } catch {\n // Disregard this data as it is not valid.\n // Will be reported to user by field validation\n }\n }\n\n break\n }\n\n default: {\n break\n }\n }\n\n // ensure the fallback value is only computed one time\n // either here or when access control returns false\n const fallbackResult: { executed: boolean; value: unknown } = {\n executed: false,\n value: undefined,\n }\n if (typeof siblingData[field.name!] === 'undefined') {\n fallbackResult.value = await getFallbackValue({ field, req, siblingDoc })\n fallbackResult.executed = true\n }\n\n // Execute hooks\n if ('hooks' in field && field.hooks?.beforeValidate) {\n for (const hook of field.hooks.beforeValidate) {\n const hookedValue = await hook({\n blockData,\n collection,\n context,\n data: data as Partial<T>,\n field,\n global,\n indexPath: indexPathSegments,\n operation,\n originalDoc: doc,\n overrideAccess,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingFields: siblingFields!,\n value:\n typeof siblingData[field.name] === 'undefined'\n ? fallbackResult.value\n : siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n // Execute access control\n if (field.access && field.access[operation]) {\n const result = overrideAccess\n ? true\n : await field.access[operation]({\n id,\n blockData,\n data: data as Partial<T>,\n doc,\n req,\n siblingData,\n })\n\n if (!result) {\n delete siblingData[field.name!]\n }\n }\n\n if (typeof siblingData[field.name!] === 'undefined') {\n siblingData[field.name!] = !fallbackResult.executed\n ? await getFallbackValue({ field, req, siblingDoc })\n : fallbackResult.value\n }\n }\n\n // Traverse subfields\n switch (field.type) {\n case 'array': {\n const rows = siblingData[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n promises.push(\n traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath,\n req,\n siblingData: row as JsonObject,\n siblingDoc: getExistingRowDoc(row as JsonObject, siblingDoc[field.name]),\n }),\n )\n })\n\n await Promise.all(promises)\n }\n break\n }\n\n case 'blocks': {\n const rows = siblingData[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n const rowSiblingDoc = getExistingRowDoc(row as JsonObject, siblingDoc[field.name])\n const blockTypeToMatch = (row as JsonObject).blockType || rowSiblingDoc.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n ((field.blockReferences ?? field.blocks).find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n if (block) {\n ;(row as JsonObject).blockType = blockTypeToMatch\n\n promises.push(\n traverseFields({\n id,\n blockData: row,\n collection,\n context,\n data,\n doc,\n fields: block.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath + '.' + block.slug,\n req,\n siblingData: row as JsonObject,\n siblingDoc: rowSiblingDoc,\n }),\n )\n }\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'collapsible':\n case 'row': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n })\n\n break\n }\n\n case 'group': {\n let groupSiblingData = siblingData\n let groupSiblingDoc = siblingDoc\n\n const isNamedGroup = fieldAffectsData(field)\n\n if (isNamedGroup) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n groupSiblingData = siblingData[field.name] as Record<string, unknown>\n groupSiblingDoc = siblingDoc[field.name] as Record<string, unknown>\n }\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: isNamedGroup ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedGroup ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: groupSiblingData,\n siblingDoc: groupSiblingDoc,\n })\n\n break\n }\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof field?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n const editor: RichTextAdapter = field?.editor\n\n if (editor?.hooks?.beforeValidate?.length) {\n for (const hook of editor.hooks.beforeValidate) {\n const hookedValue = await hook({\n collection,\n context,\n data: data as Partial<T>,\n field,\n global,\n indexPath: indexPathSegments,\n operation,\n originalDoc: doc,\n overrideAccess,\n parentIsLocalized,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingData[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n break\n }\n\n case 'tab': {\n let tabSiblingData\n let tabSiblingDoc\n\n const isNamedTab = tabHasName(field)\n\n if (isNamedTab) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n tabSiblingData = siblingData[field.name] as Record<string, unknown>\n tabSiblingDoc = siblingDoc[field.name] as Record<string, unknown>\n } else {\n tabSiblingData = siblingData\n tabSiblingDoc = siblingDoc\n }\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.fields,\n global,\n operation,\n overrideAccess,\n parentIndexPath: isNamedTab ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedTab ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: tabSiblingData,\n siblingDoc: tabSiblingDoc,\n })\n\n break\n }\n\n case 'tabs': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n global,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n}\n"],"names":["MissingEditorProp","fieldAffectsData","tabHasName","valueIsValueWithRelation","getFieldPaths","getExistingRowDoc","getFallbackValue","traverseFields","promise","id","blockData","collection","context","data","doc","field","fieldIndex","global","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingFields","indexPath","path","schemaPath","index","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","name","type","value","parseFloat","toString","trimmed","trim","length","Array","isArray","coordinate","i","hasMany","relationTo","forEach","relatedDoc","relatedCollection","payload","collections","config","fields","relationshipIDField","find","collectionField","undefined","richTextJSON","JSON","parse","fallbackResult","executed","hooks","beforeValidate","hook","hookedValue","originalDoc","previousSiblingDoc","previousValue","access","result","rows","promises","row","rowIndex","push","localized","Promise","all","rowSiblingDoc","blockTypeToMatch","blockType","block","blocks","blockReferences","curBlock","slug","groupSiblingData","groupSiblingDoc","isNamedGroup","editor","Error","tabSiblingData","tabSiblingDoc","isNamedTab","tabs","tab"],"mappings":"AAOA,SAASA,iBAAiB,QAAQ,2BAA0B;AAC5D,SAASC,gBAAgB,EAAEC,UAAU,EAAEC,wBAAwB,QAAQ,wBAAuB;AAC9F,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,gBAAgB,QAAQ,wBAAuB;AACxD,SAASC,cAAc,QAAQ,sBAAqB;AAiCpD,oEAAoE;AACpE,2BAA2B;AAC3B,wBAAwB;AACxB,iCAAiC;AACjC,oDAAoD;AACpD,gDAAgD;AAEhD,OAAO,MAAMC,UAAU,OAAU,EAC/BC,EAAE,EACFC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,WAAW,EACXC,UAAU,EACVC,aAAa,EACL;IACR,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAG1B,cAAc;QACpDW;QACAgB,OAAOf;QACPI;QACAE;QACAC;IACF;IAEA,MAAMS,eAAeH,OAAOA,KAAKI,KAAK,CAAC,OAAO,EAAE;IAChD,MAAMC,qBAAqBJ,aAAaA,WAAWG,KAAK,CAAC,OAAO,EAAE;IAClE,MAAME,oBAAoBP,YAAYA,UAAUK,KAAK,CAAC,KAAKG,MAAM,CAACC,UAAUC,IAAIC,UAAU,E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;4BAAE,GAAGA,GAAG;4BAAE/D,MAAM;wBAAM,CAAA;oBACvDxB;oBACAC;oBACAC;oBACAC,iBAAiBQ;oBACjBP;oBACAC,YAAYO;oBACZN,kBAAkBO;oBAClBN;oBACAC;oBACAC;gBACF;gBAEA;YACF;QAEA;YAAS;gBACP;YACF;IACF;AACF,EAAC"}
@@ -5563,7 +5563,12 @@ type FetchAPIFileUploadOptions = {
5563
5563
  } & Partial<BusboyConfig>;
5564
5564
  type ErrorResult = {
5565
5565
  data?: any;
5566
- errors: unknown[];
5566
+ errors: {
5567
+ data?: Record<string, unknown>;
5568
+ field?: string;
5569
+ message?: string;
5570
+ name?: string;
5571
+ }[];
5567
5572
  stack?: string;
5568
5573
  };
5569
5574
  type AfterErrorResult = {
@@ -6420,7 +6425,7 @@ type FieldState = {
6420
6425
  * The fieldSchema may be part of the form state if `includeSchema: true` is passed to buildFormState.
6421
6426
  * This will never be in the form state of the client.
6422
6427
  */
6423
- fieldSchema?: Field;
6428
+ fieldSchema?: Field | TabAsField;
6424
6429
  filterOptions?: FilterOptionsResult;
6425
6430
  initialValue?: unknown;
6426
6431
  /**
@@ -11200,6 +11205,20 @@ declare class Cron {
11200
11205
  private _calculatePreviousRun;
11201
11206
  }
11202
11207
 
11208
+ /**
11209
+ * Modules exported here are not part of the public API and are subject to change without notice and without a major version bump.
11210
+ */
11211
+
11212
+ /**
11213
+ * Returns `TType[TDesiredKey]` if it exists, otherwise `TType[TFallbackKey]`.
11214
+ *
11215
+ * @see test "ResolveFallback pattern allows generic indexing" in test/types/types.spec.ts.
11216
+ * Read the comment in this test before modifying this type. We *have* to use `infer` here, not `extends keyof`.
11217
+ *
11218
+ * @internal - for internal use only
11219
+ */
11220
+ type ResolveFallback<TType, TDesiredKey extends string, TFallbackKey extends keyof TType> = TType extends Record<TDesiredKey, infer TValue> ? TValue : TType[TFallbackKey];
11221
+
11203
11222
  type KVStoreValue = NonNullable<unknown>;
11204
11223
  interface KVAdapter {
11205
11224
  /**
@@ -12680,10 +12699,17 @@ type Args<T extends JsonObject = JsonObject> = {
12680
12699
  payload: Payload;
12681
12700
  publishSpecificLocale?: string;
12682
12701
  req?: PayloadRequest;
12702
+ returning?: boolean;
12683
12703
  select?: SelectType;
12684
12704
  snapshot?: any;
12685
12705
  };
12686
- declare const saveVersion: <TData extends JsonObject = JsonObject>({ id, autosave, collection, docWithLocales, draft, global, operation, payload, publishSpecificLocale, req, select, snapshot, }: Args<TData>) => Promise<JsonObject>;
12706
+ declare function saveVersion<TData extends JsonObject = JsonObject>(args: {
12707
+ returning: false;
12708
+ } & Args<TData>): Promise<null>;
12709
+ declare function saveVersion<TData extends JsonObject = JsonObject>(args: {
12710
+ returning: true;
12711
+ } & Args<TData>): Promise<JsonObject>;
12712
+ declare function saveVersion<TData extends JsonObject = JsonObject>(args: Omit<Args<TData>, 'returning'>): Promise<JsonObject>;
12687
12713
 
12688
12714
  type SchedulePublishTaskInput = {
12689
12715
  doc?: {
@@ -12708,7 +12734,10 @@ type SchedulePublishTaskInput = {
12708
12734
  */
12709
12735
  declare function deepMergeSimple<T = object>(obj1: object, obj2: object): T;
12710
12736
 
12711
- interface GeneratedTypes {
12737
+ /**
12738
+ * Untyped, base GeneratedTypes interface.
12739
+ */
12740
+ interface BaseGeneratedTypes {
12712
12741
  authUntyped: {
12713
12742
  [slug: string]: {
12714
12743
  forgotPassword: {
@@ -12767,41 +12796,35 @@ interface GeneratedTypes {
12767
12796
  localeUntyped: null | string;
12768
12797
  userUntyped: UntypedUser;
12769
12798
  }
12770
- type ResolveCollectionType<T> = 'collections' extends keyof T ? T['collections'] : T['collectionsUntyped'];
12771
- type ResolveBlockType<T> = 'blocks' extends keyof T ? T['blocks'] : T['blocksUntyped'];
12772
- type ResolveCollectionSelectType<T> = 'collectionsSelect' extends keyof T ? T['collectionsSelect'] : T['collectionsSelectUntyped'];
12773
- type ResolveCollectionJoinsType<T> = 'collectionsJoins' extends keyof T ? T['collectionsJoins'] : T['collectionsJoinsUntyped'];
12774
- type ResolveGlobalType<T> = 'globals' extends keyof T ? T['globals'] : T['globalsUntyped'];
12775
- type ResolveGlobalSelectType<T> = 'globalsSelect' extends keyof T ? T['globalsSelect'] : T['globalsSelectUntyped'];
12776
- type TypedCollection = ResolveCollectionType<GeneratedTypes>;
12777
- type TypedBlock = ResolveBlockType<GeneratedTypes>;
12778
- type TypedUploadCollection = NonNever<{
12779
- [K in keyof TypedCollection]: 'filename' | 'filesize' | 'mimeType' | 'url' extends keyof TypedCollection[K] ? TypedCollection[K] : never;
12799
+ /**
12800
+ * Typed GeneratedTypes interface. This interface will be module-augmented by the `payload-types.ts` file.
12801
+ */
12802
+ interface GeneratedTypes extends BaseGeneratedTypes {
12803
+ }
12804
+ type TypedCollection<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'collections', 'collectionsUntyped'>;
12805
+ type TypedBlock = ResolveFallback<GeneratedTypes, 'blocks', 'blocksUntyped'>;
12806
+ type TypedUploadCollection<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = NonNever<{
12807
+ [TCollectionSlug in keyof TypedCollection<TGeneratedTypes>]: 'filename' | 'filesize' | 'mimeType' | 'url' extends keyof TypedCollection<TGeneratedTypes>[TCollectionSlug] ? TypedCollection<TGeneratedTypes>[TCollectionSlug] : never;
12780
12808
  }>;
12781
- type TypedCollectionSelect = ResolveCollectionSelectType<GeneratedTypes>;
12782
- type TypedCollectionJoins = ResolveCollectionJoinsType<GeneratedTypes>;
12783
- type TypedGlobal = ResolveGlobalType<GeneratedTypes>;
12784
- type TypedGlobalSelect = ResolveGlobalSelectType<GeneratedTypes>;
12809
+ type TypedCollectionSelect<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'collectionsSelect', 'collectionsSelectUntyped'>;
12810
+ type TypedCollectionJoins<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'collectionsJoins', 'collectionsJoinsUntyped'>;
12811
+ type TypedGlobal<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'globals', 'globalsUntyped'>;
12812
+ type TypedGlobalSelect<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'globalsSelect', 'globalsSelectUntyped'>;
12785
12813
  type StringKeyOf<T> = Extract<keyof T, string>;
12786
- type CollectionSlug = StringKeyOf<TypedCollection>;
12814
+ type CollectionSlug<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = StringKeyOf<TypedCollection<TGeneratedTypes>>;
12787
12815
  type BlockSlug = StringKeyOf<TypedBlock>;
12788
- type UploadCollectionSlug = StringKeyOf<TypedUploadCollection>;
12789
- type ResolveDbType<T> = 'db' extends keyof T ? T['db'] : T['dbUntyped'];
12790
- type DefaultDocumentIDType = ResolveDbType<GeneratedTypes>['defaultIDType'];
12791
- type GlobalSlug = StringKeyOf<TypedGlobal>;
12792
- type ResolveLocaleType<T> = 'locale' extends keyof T ? T['locale'] : T['localeUntyped'];
12793
- type ResolveFallbackLocaleType<T> = 'fallbackLocale' extends keyof T ? T['fallbackLocale'] : T['fallbackLocaleUntyped'];
12794
- type ResolveUserType<T> = 'user' extends keyof T ? T['user'] : T['userUntyped'];
12795
- type TypedLocale = ResolveLocaleType<GeneratedTypes>;
12796
- type TypedFallbackLocale = ResolveFallbackLocaleType<GeneratedTypes>;
12816
+ type UploadCollectionSlug<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = StringKeyOf<TypedUploadCollection<TGeneratedTypes>>;
12817
+ type DefaultDocumentIDType = ResolveFallback<GeneratedTypes, 'db', 'dbUntyped'>['defaultIDType'];
12818
+ type GlobalSlug<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = StringKeyOf<TypedGlobal<TGeneratedTypes>>;
12819
+ type TypedLocale<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'locale', 'localeUntyped'>;
12820
+ type TypedFallbackLocale = ResolveFallback<GeneratedTypes, 'fallbackLocale', 'fallbackLocaleUntyped'>;
12797
12821
  /**
12798
12822
  * @todo rename to `User` in 4.0
12799
12823
  */
12800
- type TypedUser = ResolveUserType<GeneratedTypes>;
12801
- type ResolveAuthOperationsType<T> = 'auth' extends keyof T ? T['auth'] : T['authUntyped'];
12802
- type TypedAuthOperations = ResolveAuthOperationsType<GeneratedTypes>;
12803
- type ResolveJobOperationsType<T> = 'jobs' extends keyof T ? T['jobs'] : T['jobsUntyped'];
12804
- type TypedJobs = ResolveJobOperationsType<GeneratedTypes>;
12824
+ type TypedUser = ResolveFallback<GeneratedTypes, 'user', 'userUntyped'>;
12825
+ type TypedAuthOperations<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'auth', 'authUntyped'>;
12826
+ type AuthCollectionSlug<TGeneratedTypes extends BaseGeneratedTypes> = StringKeyOf<TypedAuthOperations<TGeneratedTypes>>;
12827
+ type TypedJobs = ResolveFallback<GeneratedTypes, 'jobs', 'jobsUntyped'>;
12805
12828
  type HasPayloadJobsType = 'collections' extends keyof GeneratedTypes ? 'payload-jobs' extends keyof TypedCollection ? true : false : false;
12806
12829
  /**
12807
12830
  * Represents a job in the `payload-jobs` collection, referencing a queued workflow or task (= Job).
@@ -13082,4 +13105,4 @@ interface GlobalAdminCustom extends Record<string, any> {
13082
13105
  }
13083
13106
 
13084
13107
  export { APIError, APIErrorName, Action, AuthenticationError, BasePayload, DatabaseKVAdapter, DiffMethod, DuplicateCollection, DuplicateFieldName, DuplicateGlobal, EntityType, ErrorDeletingFile, FileRetrievalError, FileUploadError, Forbidden, InMemoryKVAdapter, InvalidConfiguration, InvalidFieldName, InvalidFieldRelationship, JWTAuthentication, JobCancelledError, Locked, LockedAuth, MissingCollectionLabel, MissingEditorProp, MissingFieldInputOptions, MissingFieldType, MissingFile, NotFound, QueryError, UnauthorizedError, UnverifiedEmail, ValidationError, ValidationErrorName, _internal_jobSystemGlobals, _internal_resetJobSystemGlobals, _internal_safeFetchGlobal, accessOperation, addDataAndFileToRequest, addLocalesToRequestFromData, traverseFields$4 as afterChangeTraverseFields, promise as afterReadPromise, traverseFields$3 as afterReadTraverseFields, appendVersionToQueryKey, apiKeyFields as baseAPIKeyFields, accountLockFields as baseAccountLockFields, baseAuthFields, baseBlockFields, emailFieldConfig as baseEmailField, baseIDField, sessionsFieldConfig as baseSessionsField, usernameFieldConfig as baseUsernameField, verificationFields as baseVerificationFields, traverseFields$2 as beforeChangeTraverseFields, traverseFields$1 as beforeValidateTraverseFields, buildConfig, buildVersionCollectionFields, buildVersionCompoundIndexes, buildVersionGlobalFields, canAccessAdmin, checkDependencies, checkLoginPermission, combineQueries, commitTransaction, configToJSONSchema, countOperation, countRunnableOrActiveJobsForQueue, createArrayFromCommaDelineated, createClientCollectionConfig, createClientCollectionConfigs, createClientConfig, createClientField, createClientFields, createClientGlobalConfig, createClientGlobalConfigs, createDatabaseAdapter, createDataloaderCacheKey, createLocalReq, createMigration, createOperation, createPayloadRequest, createUnauthenticatedClientConfig, databaseKVAdapter, deepCopyObject, deepCopyObjectComplex, deepCopyObjectSimple, deepMergeSimple, deepMergeWithCombinedArrays, deepMergeWithReactComponents, deepMergeWithSourceArrays, initialized as default, defaultBeginTransaction, defaultLoggerOptions, defaults, deleteByIDOperation, deleteCollectionVersions, deleteOperation, docAccessOperation$1 as docAccessOperation, docAccessOperation as docAccessOperationGlobal, docHasTimestamps, duplicateOperation, enforceMaxVersions, entityToJSONSchema, executeAccess, executeAuthStrategies, extractAccessFromPermission, extractJWT, fieldsToJSONSchema, findByIDOperation, findMigrationDir, findOneOperation, findOperation, findUp, findUpSync, findVersionByIDOperation$1 as findVersionByIDOperation, findVersionByIDOperation as findVersionByIDOperationGlobal, findVersionsOperation$1 as findVersionsOperation, findVersionsOperation as findVersionsOperationGlobal, flattenAllFields, flattenTopLevelFields, flattenWhereToOperators, forgotPasswordOperation, formatErrors, formatLabels, formatNames, genImportMapIterateFields, generateCookie, generateExpiredPayloadCookie, generateImportMap, generatePayloadCookie, getAccessResults, getBlockSelect, getCollectionIDFieldTypes, getCookieExpiration, getCurrentDate, getDataLoader, getDefaultValue, getDependencies, getFieldByPath, getFieldsToSign, getFileByPath, getFolderData, getLatestCollectionVersion, getLatestGlobalVersion, getLocalI18n, getLocalizedPaths, getLoginOptions, getMigrations, getObjectDotNotation, getPayload, getPredefinedMigration, getQueryDraftsSort, getRequestLanguage, handleEndpoints, hasWhereAccessResult, headersWithCors, importHandlerPath, inMemoryKVAdapter, incrementLoginAttempts, initOperation, initTransaction, isEntityHidden, isPlainObject, isValidID, isolateObjectProperty, jobAfterRead, jwtSign, killTransaction, logError, loginOperation, logoutOperation, mapAsync, meOperation, mergeHeaders, migrate, migrate$1 as migrateCLI, migrateDown, migrateRefresh, migrateReset, migrateStatus, migrationTemplate, migrationsCollection, parseCookies, parseDocumentID, pathExistsAndIsAccessible, pathExistsAndIsAccessibleSync, readMigrationFiles, refreshOperation, registerFirstUserOperation, reload, resetLoginAttempts, resetPasswordOperation, restoreVersionOperation$1 as restoreVersionOperation, restoreVersionOperation as restoreVersionOperationGlobal, sanitizeConfig, sanitizeFallbackLocale, sanitizeFields, sanitizeJoinParams, sanitizeLocales, sanitizePopulateParam, sanitizeSelectParam, saveVersion, serverOnlyAdminConfigProperties, serverOnlyConfigProperties, serverProps, slugField, sortableFieldTypes, stripUnselectedFields, toWords, traverseFields, unlockOperation, updateByIDOperation, updateOperation$1 as updateOperation, updateOperation as updateOperationGlobal, validateBlocksFilterOptions, validateQueryPaths, validateSearchParam, validations, verifyEmailOperation, versionDefaults, withNullableJSONSchemaType, writeMigrationIndex };
13085
- export type { Access, AccessArgs, AccessResult, AdminClient, AdminComponent, AdminDependencies, AdminFunction, AdminViewClientProps, AdminViewComponent, AdminViewConfig, AdminViewServerProps as AdminViewProps, AdminViewServerProps, AdminViewServerPropsOnly, AfterErrorHook$1 as AfterErrorHook, AfterErrorHookArgs, AfterErrorResult, AfterFolderListClientProps, AfterFolderListServerProps, AfterFolderListServerPropsOnly, AfterFolderListTableClientProps, AfterFolderListTableServerProps, AfterFolderListTableServerPropsOnly, AfterListClientProps, AfterListServerProps, AfterListServerPropsOnly, AfterListTableClientProps, AfterListTableServerProps, AfterListTableServerPropsOnly, AllOperations, AllowList, ApplyDisableErrors, ArrayField, ArrayFieldClient, ArrayFieldClientComponent, ArrayFieldClientProps, ArrayFieldDescriptionClientComponent, ArrayFieldDescriptionServerComponent, ArrayFieldDiffClientComponent, ArrayFieldDiffServerComponent, ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, ArrayFieldServerComponent, ArrayFieldServerProps, ArrayFieldValidation, Auth, AuthCollection, AuthOperations, AuthOperationsFromCollectionSlug, AuthStrategy, AuthStrategyFunction, AuthStrategyFunctionArgs, AuthStrategyResult, BaseDatabaseAdapter, BaseFilter, BaseJob, BaseListFilter, BaseLocalizationConfig, BaseValidateOptions, BaseVersionField, BeforeDocumentControlsClientProps, BeforeDocumentControlsServerProps, BeforeDocumentControlsServerPropsOnly, BeforeFolderListClientProps, BeforeFolderListServerProps, BeforeFolderListServerPropsOnly, BeforeFolderListTableClientProps, BeforeFolderListTableServerProps, BeforeFolderListTableServerPropsOnly, BeforeListClientProps, BeforeListServerProps, BeforeListServerPropsOnly, BeforeListTableClientProps, BeforeListTableServerProps, BeforeListTableServerPropsOnly, BeginTransaction, BinScript, BinScriptConfig, Block, BlockJSX, BlockPermissions, BlockRowLabelClientComponent, BlockRowLabelServerComponent, BlockSlug, BlocksField, BlocksFieldClient, BlocksFieldClientComponent, BlocksFieldClientProps, BlocksFieldDescriptionClientComponent, BlocksFieldDescriptionServerComponent, BlocksFieldDiffClientComponent, BlocksFieldDiffServerComponent, BlocksFieldErrorClientComponent, BlocksFieldErrorServerComponent, BlocksFieldLabelClientComponent, BlocksFieldLabelServerComponent, BlocksFieldServerComponent, BlocksFieldServerProps, BlocksFieldValidation, BlocksPermissions, BuildCollectionFolderViewResult, BuildFormStateArgs, BuildTableStateArgs, BulkOperationResult, CORSConfig, CheckboxField, CheckboxFieldClient, CheckboxFieldClientComponent, CheckboxFieldClientProps, CheckboxFieldDescriptionClientComponent, CheckboxFieldDescriptionServerComponent, CheckboxFieldDiffClientComponent, CheckboxFieldDiffServerComponent, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, CheckboxFieldServerComponent, CheckboxFieldServerProps, CheckboxFieldValidation, ClientBlock, ClientCollectionConfig, ClientComponentProps, ClientConfig, ClientField, ClientFieldBase, ClientFieldProps, ClientFieldSchemaMap, ClientFieldWithOptionalType, ClientGlobalConfig, DocumentViewClientProps as ClientSideEditViewProps, ClientTab, ClientUser, ClientWidget, CodeField, CodeFieldClient, CodeFieldClientComponent, CodeFieldClientProps, CodeFieldDescriptionClientComponent, CodeFieldDescriptionServerComponent, CodeFieldDiffClientComponent, CodeFieldDiffServerComponent, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CodeFieldServerComponent, CodeFieldServerProps, CodeFieldValidation, CollapsedPreferences, CollapsibleField, CollapsibleFieldClient, CollapsibleFieldClientComponent, CollapsibleFieldClientProps, CollapsibleFieldDescriptionClientComponent, CollapsibleFieldDescriptionServerComponent, CollapsibleFieldDiffClientComponent, CollapsibleFieldDiffServerComponent, CollapsibleFieldErrorClientComponent, CollapsibleFieldErrorServerComponent, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, CollapsibleFieldServerComponent, CollapsibleFieldServerProps, Collection, CollectionAdminCustom, CollectionAdminOptions, AfterChangeHook as CollectionAfterChangeHook, AfterDeleteHook as CollectionAfterDeleteHook, AfterErrorHook as CollectionAfterErrorHook, AfterForgotPasswordHook as CollectionAfterForgotPasswordHook, AfterLoginHook as CollectionAfterLoginHook, AfterLogoutHook as CollectionAfterLogoutHook, AfterMeHook as CollectionAfterMeHook, AfterOperationHook as CollectionAfterOperationHook, AfterReadHook as CollectionAfterReadHook, AfterRefreshHook as CollectionAfterRefreshHook, BeforeChangeHook as CollectionBeforeChangeHook, BeforeDeleteHook as CollectionBeforeDeleteHook, BeforeLoginHook as CollectionBeforeLoginHook, BeforeOperationHook as CollectionBeforeOperationHook, BeforeReadHook as CollectionBeforeReadHook, BeforeValidateHook as CollectionBeforeValidateHook, CollectionConfig, CollectionCustom, MeHook as CollectionMeHook, CollectionPermission, CollectionPreferences, RefreshHook as CollectionRefreshHook, CollectionSlug, Column, ColumnPreference, CommitTransaction, CompoundIndex, Condition, ConditionalDateProps, Config, ConfirmPasswordFieldValidation, Connect, Count, CountArgs, CountGlobalVersionArgs, CountGlobalVersions, CountVersions, Create, CreateArgs, CreateClientConfigArgs, CreateGlobal, CreateGlobalArgs, CreateGlobalVersion, CreateGlobalVersionArgs, CreateMigration, CreateVersion, CreateVersionArgs, CustomComponent, CustomDocumentViewConfig, CustomPayloadRequestProperties, CustomComponent as CustomPreviewButton, CustomComponent as CustomPublishButton, CustomComponent as CustomSaveButton, CustomComponent as CustomSaveDraftButton, CustomUpload, CustomVersionParser, DBIdentifierName, DashboardConfig, Data, DataFromCollectionSlug, DataFromGlobalSlug, DatabaseAdapter, DatabaseAdapterResult as DatabaseAdapterObj, DatabaseKVAdapterOptions, DateField, DateFieldClient, DateFieldClientComponent, DateFieldClientProps, DateFieldDescriptionClientComponent, DateFieldDescriptionServerComponent, DateFieldDiffClientComponent, DateFieldDiffServerComponent, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DateFieldServerComponent, DateFieldServerProps, DateFieldValidation, DayPickerProps, DefaultCellComponentProps, DefaultDocumentIDType, DefaultDocumentViewConfig, DefaultServerCellComponentProps, DefaultServerFunctionArgs, DefaultValue, DeleteMany, DeleteManyArgs, DeleteOne, DeleteOneArgs, DeleteVersions, DeleteVersionsArgs, Description, DescriptionFunction, Destroy, Document, DocumentEvent, DocumentPermissions, DocumentPreferences, DocumentSlots, DocumentSubViewTypes, DocumentTabClientProps, DocumentTabComponent, DocumentTabCondition, DocumentTabConfig, DocumentTabServerProps as DocumentTabProps, DocumentTabServerProps, DocumentTabServerPropsOnly, DocumentViewClientProps, DocumentViewComponent, DocumentViewConfig, DocumentViewServerProps, DocumentViewServerPropsOnly, DraftTransformCollectionWithSelect, EditConfig, EditConfigWithRoot, EditConfigWithoutRoot, EditMenuItemsClientProps, EditMenuItemsServerProps, EditMenuItemsServerPropsOnly, EditViewComponent, EditViewConfig, EditViewProps, EmailAdapter, EmailField, EmailFieldClient, EmailFieldClientComponent, EmailFieldClientProps, EmailFieldDescriptionClientComponent, EmailFieldDescriptionServerComponent, EmailFieldDiffClientComponent, EmailFieldDiffServerComponent, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, EmailFieldServerComponent, EmailFieldServerProps, EmailFieldValidation, Endpoint, EntityDescription, EntityDescriptionComponent, EntityDescriptionFunction, EntityPolicies, ErrorResult, FetchAPIFileUploadOptions, Field, FieldAccess, FieldAffectingData, FieldAffectingDataClient, FieldBase, FieldBaseClient, FieldClientComponent, FieldCustom, FieldDescriptionClientComponent, FieldDescriptionClientProps, FieldDescriptionServerComponent, FieldDescriptionServerProps, FieldDiffClientComponent, FieldDiffClientProps, FieldDiffServerComponent, FieldDiffServerProps, FieldErrorClientComponent, FieldErrorClientProps, FieldErrorServerComponent, FieldErrorServerProps, FieldHook, FieldHookArgs, FieldLabelClientComponent, FieldLabelClientProps, FieldLabelServerComponent, FieldLabelServerProps, FieldPaths, FieldPermissions, FieldPresentationalOnly, FieldPresentationalOnlyClient, FieldRow, FieldSchemaMap, FieldServerComponent, FieldState, FieldTypes, FieldWithMany, FieldWithManyClient, FieldWithMaxDepth, FieldWithMaxDepthClient, FieldWithPath, FieldWithPathClient, FieldWithSubFields, FieldWithSubFieldsClient, FieldsPermissions, FieldsPreferences, File$1 as File, FileAllowList, FileData, FileSize, FileSizeImproved, FileSizes, FileToSave, FilterOptions, FilterOptionsProps, FilterOptionsResult, Find, FindArgs, FindDistinct, FindGlobal, FindGlobalArgs, FindGlobalVersions, FindGlobalVersionsArgs, FindOne, FindOneArgs, FindVersions, FindVersionsArgs, FlattenedArrayField, FlattenedBlock, FlattenedBlocksField, FlattenedField$1 as FlattenedField, FlattenedGroupField, FlattenedJoinField, FlattenedTabAsField, FolderListViewClientProps, FolderListViewServerProps, FolderListViewServerPropsOnly, FolderListViewSlotSharedClientProps, FolderListViewSlots, FolderSortKeys, FieldState as FormField, FieldStateWithoutComponents as FormFieldWithoutComponents, FormState, FormStateWithoutComponents, GenerateImageName, GeneratePreviewURL, GenerateSchema, GeneratedTypes, GenericDescriptionProps, GenericErrorProps, GenericLabelProps, GetAdminThumbnail, GetFolderResultsComponentAndDataArgs, GlobalAdminCustom, GlobalAdminOptions, AfterChangeHook$1 as GlobalAfterChangeHook, AfterReadHook$1 as GlobalAfterReadHook, BeforeChangeHook$1 as GlobalBeforeChangeHook, BeforeOperationHook$1 as GlobalBeforeOperationHook, BeforeReadHook$1 as GlobalBeforeReadHook, BeforeValidateHook$1 as GlobalBeforeValidateHook, GlobalConfig, GlobalCustom, GlobalPermission, GlobalSlug, GraphQLExtension, GraphQLInfo, GroupField, GroupFieldClient, GroupFieldClientComponent, GroupFieldClientProps, GroupFieldDescriptionClientComponent, GroupFieldDescriptionServerComponent, GroupFieldDiffClientComponent, GroupFieldDiffServerComponent, GroupFieldErrorClientComponent, GroupFieldErrorServerComponent, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, GroupFieldServerComponent, GroupFieldServerProps, HiddenFieldProps, HookName, HookOperationType, IfAny, ImageSize, ImageUploadFormatOptions, ImageUploadTrimOptions, ImportMap, ImportMapGenerators, IncomingAuthType, Init, InitOptions, InitPageResult, InsideFieldsPreferences, IsAny, JSONField, JSONFieldClient, JSONFieldClientComponent, JSONFieldClientProps, JSONFieldDescriptionClientComponent, JSONFieldDescriptionServerComponent, JSONFieldDiffClientComponent, JSONFieldDiffServerComponent, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, JSONFieldServerComponent, JSONFieldServerProps, JSONFieldValidation, Job, JobLog, JobTaskStatus, JobsConfig, JoinField, JoinFieldClient, JoinFieldClientComponent, JoinFieldClientProps, JoinFieldDescriptionClientComponent, JoinFieldDescriptionServerComponent, JoinFieldDiffClientComponent, JoinFieldDiffServerComponent, JoinFieldErrorClientComponent, JoinFieldErrorServerComponent, JoinFieldLabelClientComponent, JoinFieldLabelServerComponent, JoinFieldServerComponent, JoinFieldServerProps, JoinQuery, JsonArray, JsonObject, JsonValue, KVAdapter, KVAdapterResult, KVStoreValue, LabelFunction, Labels, LabelsClient, LanguageOptions, CollectionPreferences as ListPreferences, ListQuery, ListViewClientProps, ListViewServerProps, ListViewServerPropsOnly, ListViewSlotSharedClientProps, ListViewSlots, LivePreviewConfig, LivePreviewURLType, Locale, LocalizationConfig, LocalizationConfigWithLabels, LocalizationConfigWithNoLabels, LoginWithUsernameOptions, MappedClientComponent, MappedEmptyComponent, MappedServerComponent, MaybePromise, MeOperationResult, MetaConfig, Migration, MigrationData, MigrationTemplateArgs, NamedGroupField, NamedGroupFieldClient, NamedTab, NavGroupPreferences, NavPreferences, NonPresentationalField, NonPresentationalFieldClient, NumberField, NumberFieldClient, NumberFieldClientComponent, NumberFieldClientProps, NumberFieldDescriptionClientComponent, NumberFieldDescriptionServerComponent, NumberFieldDiffClientComponent, NumberFieldDiffServerComponent, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, NumberFieldManyValidation, NumberFieldServerComponent, NumberFieldServerProps, NumberFieldSingleValidation, NumberFieldValidation, OGImageConfig, Operation, Operator, Option, OptionLabel, OptionObject, OrderableEndpointBody, PaginatedDistinctDocs, PaginatedDocs, Params, PasswordFieldValidation, PathToQuery, Payload, PayloadClientComponentProps, PayloadClientReactComponent, PayloadComponent, PayloadComponentProps, EmailAdapter as PayloadEmailAdapter, PayloadHandler, PayloadReactComponent, PayloadRequest, PayloadServerAction, PayloadServerComponentProps, PayloadServerReactComponent, Permission, Permissions, PickPreserveOptional, Plugin, PointField, PointFieldClient, PointFieldClientComponent, PointFieldClientProps, PointFieldDescriptionClientComponent, PointFieldDescriptionServerComponent, PointFieldDiffClientComponent, PointFieldDiffServerComponent, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, PointFieldServerComponent, PointFieldServerProps, PointFieldValidation, PolymorphicRelationshipField, PolymorphicRelationshipFieldClient, PopulateType, PreferenceRequest, PreferenceUpdateRequest, PreviewButtonClientProps, PreviewButtonServerProps, PreviewButtonServerPropsOnly, ProbedImageSize, PublishButtonClientProps, PublishButtonServerProps, PublishButtonServerPropsOnly, QueryDrafts, QueryDraftsArgs, QueryPreset, RadioField, RadioFieldClient, RadioFieldClientComponent, RadioFieldClientProps, RadioFieldDescriptionClientComponent, RadioFieldDescriptionServerComponent, RadioFieldDiffClientComponent, RadioFieldDiffServerComponent, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RadioFieldServerComponent, RadioFieldServerProps, RadioFieldValidation, RawPayloadComponent, RelationshipField, RelationshipFieldClient, RelationshipFieldClientComponent, RelationshipFieldClientProps, RelationshipFieldDescriptionClientComponent, RelationshipFieldDescriptionServerComponent, RelationshipFieldDiffClientComponent, RelationshipFieldDiffServerComponent, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RelationshipFieldManyValidation, RelationshipFieldServerComponent, RelationshipFieldServerProps, RelationshipFieldSingleValidation, RelationshipFieldValidation, RelationshipValue, RenderConfigArgs, RenderDocumentVersionsProperties, RenderEntityConfigArgs, RenderFieldConfigArgs, RenderRootConfigArgs, RenderedField, ReplaceAny, RequestContext, RequiredDataFromCollection, RequiredDataFromCollectionSlug, ResolvedComponent, ResolvedFilterOptions, RichTextAdapter, RichTextAdapterProvider, RichTextField, RichTextFieldClient, RichTextFieldClientComponent, RichTextFieldClientProps, RichTextFieldDescriptionClientComponent, RichTextFieldDescriptionServerComponent, RichTextFieldDiffClientComponent, RichTextFieldDiffServerComponent, RichTextFieldErrorClientComponent, RichTextFieldErrorServerComponent, RichTextFieldLabelClientComponent, RichTextFieldLabelServerComponent, RichTextFieldServerComponent, RichTextFieldServerProps, RichTextFieldValidation, RichTextHooks, RollbackTransaction, RootLivePreviewConfig, Row, RowField, RowFieldClient, RowFieldClientComponent, RowFieldClientProps, RowFieldDescriptionClientComponent, RowFieldDescriptionServerComponent, RowFieldDiffClientComponent, RowFieldDiffServerComponent, RowFieldErrorClientComponent, RowFieldErrorServerComponent, RowFieldLabelClientComponent, RowFieldLabelServerComponent, RowFieldServerComponent, RowFieldServerProps, RowLabel, RowLabelComponent, RunInlineTaskFunction, RunJobAccess, RunJobAccessArgs, RunTaskFunction, RunTaskFunctions, RunningJob, SanitizedBlockPermissions, SanitizedBlocksPermissions, SanitizedCollectionConfig, SanitizedCollectionPermission, SanitizedCompoundIndex, SanitizedConfig, SanitizedDashboardConfig, SanitizedDocumentPermissions, SanitizedFieldPermissions, SanitizedFieldsPermissions, SanitizedGlobalConfig, SanitizedGlobalPermission, SanitizedJoins, SanitizedLabelProps, SanitizedLocalizationConfig, SanitizedPermissions, SanitizedUploadConfig, SaveButtonClientProps, SaveButtonServerProps, SaveButtonServerPropsOnly, SaveDraftButtonClientProps, SaveDraftButtonServerProps, SaveDraftButtonServerPropsOnly, SchedulePublish, SchedulePublishTaskInput, SelectExcludeType, SelectField, SelectFieldClient, SelectFieldClientComponent, SelectFieldClientProps, SelectFieldDescriptionClientComponent, SelectFieldDescriptionServerComponent, SelectFieldDiffClientComponent, SelectFieldDiffServerComponent, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, SelectFieldManyValidation, SelectFieldServerComponent, SelectFieldServerProps, SelectFieldSingleValidation, SelectFieldValidation, SelectIncludeType, SelectMode, SelectType, SendEmailOptions, ServerComponentProps, ServerFieldBase, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, ServerOnlyCollectionAdminProperties, ServerOnlyCollectionProperties, ServerOnlyFieldAdminProperties, ServerOnlyFieldProperties, ServerOnlyGlobalAdminProperties, ServerOnlyGlobalProperties, ServerOnlyLivePreviewProperties, ServerOnlyUploadProperties, ServerProps, ServerPropsFromView, DocumentViewServerProps as ServerSideEditViewProps, SharedProps, SharpDependency, SingleRelationshipField, SingleRelationshipFieldClient, SingleTaskStatus, SlugField, SlugFieldClientProps, SlugifyServerFunctionArgs, Sort, StaticDescription, StaticLabel, StringKeyOf, Tab, TabAsField, TabAsFieldClient, TabsField, TabsFieldClient, TabsFieldClientComponent, TabsFieldClientProps, TabsFieldDescriptionClientComponent, TabsFieldDescriptionServerComponent, TabsFieldDiffClientComponent, TabsFieldDiffServerComponent, TabsFieldErrorClientComponent, TabsFieldErrorServerComponent, TabsFieldLabelClientComponent, TabsFieldLabelServerComponent, TabsFieldServerComponent, TabsFieldServerProps, TabsPreferences, TaskConfig, TaskHandler, TaskHandlerArgs, TaskHandlerResult, TaskHandlerResults, TaskInput, TaskOutput, TaskType, TextField, TextFieldClient, TextFieldClientComponent, TextFieldClientProps, TextFieldDescriptionClientComponent, TextFieldDescriptionServerComponent, TextFieldDiffClientComponent, TextFieldDiffServerComponent, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, TextFieldManyValidation, TextFieldServerComponent, TextFieldServerProps, TextFieldSingleValidation, TextFieldValidation, TextareaField, TextareaFieldClient, TextareaFieldClientComponent, TextareaFieldClientProps, TextareaFieldDescriptionClientComponent, TextareaFieldDescriptionServerComponent, TextareaFieldDiffClientComponent, TextareaFieldDiffServerComponent, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextareaFieldServerComponent, TextareaFieldServerProps, TextareaFieldValidation, TimePickerProps, Timezone, TimezonesConfig, Transaction, TransformCollectionWithSelect, TransformDataWithSelect, TransformGlobalWithSelect, TraverseFieldsCallback, TypeWithID, TypeWithTimestamps, TypeWithVersion, TypedAuthOperations, TypedBlock, TypedCollection, TypedCollectionJoins, TypedCollectionSelect, TypedFallbackLocale, TypedGlobal, TypedGlobalSelect, TypedJobs, TypedLocale, TypedUploadCollection, TypedUser, UIField, UIFieldClient, UIFieldClientComponent, UIFieldClientProps, UIFieldDiffClientComponent, UIFieldDiffServerComponent, UIFieldServerComponent, UIFieldServerProps, UnauthenticatedClientConfig, UnnamedGroupField, UnnamedGroupFieldClient, UnnamedTab, UntypedUser, UpdateGlobal, UpdateGlobalArgs, UpdateGlobalVersion, UpdateGlobalVersionArgs, UpdateJobs, UpdateJobsArgs, UpdateMany, UpdateManyArgs, UpdateOne, UpdateOneArgs, UpdateVersion, UpdateVersionArgs, UploadCollectionSlug, UploadConfig, UploadEdits, UploadField, UploadFieldClient, UploadFieldClientComponent, UploadFieldClientProps, UploadFieldDescriptionClientComponent, UploadFieldDescriptionServerComponent, UploadFieldDiffClientComponent, UploadFieldDiffServerComponent, UploadFieldErrorClientComponent, UploadFieldErrorServerComponent, UploadFieldLabelClientComponent, UploadFieldLabelServerComponent, UploadFieldManyValidation, UploadFieldServerComponent, UploadFieldServerProps, UploadFieldSingleValidation, UploadFieldValidation, Upsert, UpsertArgs, UntypedUser as User, UserSession, UsernameFieldValidation, Validate, ValidateOptions, ValidationFieldError, ValueWithRelation, VerifyConfig, VersionField, VersionOperations, VersionTab, ViewDescriptionClientProps, ViewDescriptionServerProps, ViewDescriptionServerPropsOnly, ViewTypes, VisibleEntities, Where, WhereField, Widget, WidgetInstance, WidgetServerProps, WidgetWidth, WithServerSidePropsComponent, WithServerSidePropsComponentProps, WorkflowConfig, WorkflowHandler, WorkflowTypes, checkFileRestrictionsParams };
13108
+ export type { Access, AccessArgs, AccessResult, AdminClient, AdminComponent, AdminDependencies, AdminFunction, AdminViewClientProps, AdminViewComponent, AdminViewConfig, AdminViewServerProps as AdminViewProps, AdminViewServerProps, AdminViewServerPropsOnly, AfterErrorHook$1 as AfterErrorHook, AfterErrorHookArgs, AfterErrorResult, AfterFolderListClientProps, AfterFolderListServerProps, AfterFolderListServerPropsOnly, AfterFolderListTableClientProps, AfterFolderListTableServerProps, AfterFolderListTableServerPropsOnly, AfterListClientProps, AfterListServerProps, AfterListServerPropsOnly, AfterListTableClientProps, AfterListTableServerProps, AfterListTableServerPropsOnly, AllOperations, AllowList, ApplyDisableErrors, ArrayField, ArrayFieldClient, ArrayFieldClientComponent, ArrayFieldClientProps, ArrayFieldDescriptionClientComponent, ArrayFieldDescriptionServerComponent, ArrayFieldDiffClientComponent, ArrayFieldDiffServerComponent, ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, ArrayFieldServerComponent, ArrayFieldServerProps, ArrayFieldValidation, Auth, AuthCollection, AuthCollectionSlug, AuthOperations, AuthOperationsFromCollectionSlug, AuthStrategy, AuthStrategyFunction, AuthStrategyFunctionArgs, AuthStrategyResult, BaseDatabaseAdapter, BaseFilter, BaseGeneratedTypes, BaseJob, BaseListFilter, BaseLocalizationConfig, BaseValidateOptions, BaseVersionField, BeforeDocumentControlsClientProps, BeforeDocumentControlsServerProps, BeforeDocumentControlsServerPropsOnly, BeforeFolderListClientProps, BeforeFolderListServerProps, BeforeFolderListServerPropsOnly, BeforeFolderListTableClientProps, BeforeFolderListTableServerProps, BeforeFolderListTableServerPropsOnly, BeforeListClientProps, BeforeListServerProps, BeforeListServerPropsOnly, BeforeListTableClientProps, BeforeListTableServerProps, BeforeListTableServerPropsOnly, BeginTransaction, BinScript, BinScriptConfig, Block, BlockJSX, BlockPermissions, BlockRowLabelClientComponent, BlockRowLabelServerComponent, BlockSlug, BlocksField, BlocksFieldClient, BlocksFieldClientComponent, BlocksFieldClientProps, BlocksFieldDescriptionClientComponent, BlocksFieldDescriptionServerComponent, BlocksFieldDiffClientComponent, BlocksFieldDiffServerComponent, BlocksFieldErrorClientComponent, BlocksFieldErrorServerComponent, BlocksFieldLabelClientComponent, BlocksFieldLabelServerComponent, BlocksFieldServerComponent, BlocksFieldServerProps, BlocksFieldValidation, BlocksPermissions, BuildCollectionFolderViewResult, BuildFormStateArgs, BuildTableStateArgs, BulkOperationResult, CORSConfig, CheckboxField, CheckboxFieldClient, CheckboxFieldClientComponent, CheckboxFieldClientProps, CheckboxFieldDescriptionClientComponent, CheckboxFieldDescriptionServerComponent, CheckboxFieldDiffClientComponent, CheckboxFieldDiffServerComponent, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, CheckboxFieldServerComponent, CheckboxFieldServerProps, CheckboxFieldValidation, ClientBlock, ClientCollectionConfig, ClientComponentProps, ClientConfig, ClientField, ClientFieldBase, ClientFieldProps, ClientFieldSchemaMap, ClientFieldWithOptionalType, ClientGlobalConfig, DocumentViewClientProps as ClientSideEditViewProps, ClientTab, ClientUser, ClientWidget, CodeField, CodeFieldClient, CodeFieldClientComponent, CodeFieldClientProps, CodeFieldDescriptionClientComponent, CodeFieldDescriptionServerComponent, CodeFieldDiffClientComponent, CodeFieldDiffServerComponent, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CodeFieldServerComponent, CodeFieldServerProps, CodeFieldValidation, CollapsedPreferences, CollapsibleField, CollapsibleFieldClient, CollapsibleFieldClientComponent, CollapsibleFieldClientProps, CollapsibleFieldDescriptionClientComponent, CollapsibleFieldDescriptionServerComponent, CollapsibleFieldDiffClientComponent, CollapsibleFieldDiffServerComponent, CollapsibleFieldErrorClientComponent, CollapsibleFieldErrorServerComponent, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, CollapsibleFieldServerComponent, CollapsibleFieldServerProps, Collection, CollectionAdminCustom, CollectionAdminOptions, AfterChangeHook as CollectionAfterChangeHook, AfterDeleteHook as CollectionAfterDeleteHook, AfterErrorHook as CollectionAfterErrorHook, AfterForgotPasswordHook as CollectionAfterForgotPasswordHook, AfterLoginHook as CollectionAfterLoginHook, AfterLogoutHook as CollectionAfterLogoutHook, AfterMeHook as CollectionAfterMeHook, AfterOperationHook as CollectionAfterOperationHook, AfterReadHook as CollectionAfterReadHook, AfterRefreshHook as CollectionAfterRefreshHook, BeforeChangeHook as CollectionBeforeChangeHook, BeforeDeleteHook as CollectionBeforeDeleteHook, BeforeLoginHook as CollectionBeforeLoginHook, BeforeOperationHook as CollectionBeforeOperationHook, BeforeReadHook as CollectionBeforeReadHook, BeforeValidateHook as CollectionBeforeValidateHook, CollectionConfig, CollectionCustom, MeHook as CollectionMeHook, CollectionPermission, CollectionPreferences, RefreshHook as CollectionRefreshHook, CollectionSlug, Column, ColumnPreference, CommitTransaction, CompoundIndex, Condition, ConditionalDateProps, Config, ConfirmPasswordFieldValidation, Connect, Count, CountArgs, CountGlobalVersionArgs, CountGlobalVersions, CountVersions, Create, CreateArgs, CreateClientConfigArgs, CreateGlobal, CreateGlobalArgs, CreateGlobalVersion, CreateGlobalVersionArgs, CreateMigration, CreateVersion, CreateVersionArgs, CustomComponent, CustomDocumentViewConfig, CustomPayloadRequestProperties, CustomComponent as CustomPreviewButton, CustomComponent as CustomPublishButton, CustomComponent as CustomSaveButton, CustomComponent as CustomSaveDraftButton, CustomUpload, CustomVersionParser, DBIdentifierName, DashboardConfig, Data, DataFromCollectionSlug, DataFromGlobalSlug, DatabaseAdapter, DatabaseAdapterResult as DatabaseAdapterObj, DatabaseKVAdapterOptions, DateField, DateFieldClient, DateFieldClientComponent, DateFieldClientProps, DateFieldDescriptionClientComponent, DateFieldDescriptionServerComponent, DateFieldDiffClientComponent, DateFieldDiffServerComponent, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DateFieldServerComponent, DateFieldServerProps, DateFieldValidation, DayPickerProps, DefaultCellComponentProps, DefaultDocumentIDType, DefaultDocumentViewConfig, DefaultServerCellComponentProps, DefaultServerFunctionArgs, DefaultValue, DeleteMany, DeleteManyArgs, DeleteOne, DeleteOneArgs, DeleteVersions, DeleteVersionsArgs, Description, DescriptionFunction, Destroy, Document, DocumentEvent, DocumentPermissions, DocumentPreferences, DocumentSlots, DocumentSubViewTypes, DocumentTabClientProps, DocumentTabComponent, DocumentTabCondition, DocumentTabConfig, DocumentTabServerProps as DocumentTabProps, DocumentTabServerProps, DocumentTabServerPropsOnly, DocumentViewClientProps, DocumentViewComponent, DocumentViewConfig, DocumentViewServerProps, DocumentViewServerPropsOnly, DraftTransformCollectionWithSelect, EditConfig, EditConfigWithRoot, EditConfigWithoutRoot, EditMenuItemsClientProps, EditMenuItemsServerProps, EditMenuItemsServerPropsOnly, EditViewComponent, EditViewConfig, EditViewProps, EmailAdapter, EmailField, EmailFieldClient, EmailFieldClientComponent, EmailFieldClientProps, EmailFieldDescriptionClientComponent, EmailFieldDescriptionServerComponent, EmailFieldDiffClientComponent, EmailFieldDiffServerComponent, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, EmailFieldServerComponent, EmailFieldServerProps, EmailFieldValidation, Endpoint, EntityDescription, EntityDescriptionComponent, EntityDescriptionFunction, EntityPolicies, ErrorResult, FetchAPIFileUploadOptions, Field, FieldAccess, FieldAffectingData, FieldAffectingDataClient, FieldBase, FieldBaseClient, FieldClientComponent, FieldCustom, FieldDescriptionClientComponent, FieldDescriptionClientProps, FieldDescriptionServerComponent, FieldDescriptionServerProps, FieldDiffClientComponent, FieldDiffClientProps, FieldDiffServerComponent, FieldDiffServerProps, FieldErrorClientComponent, FieldErrorClientProps, FieldErrorServerComponent, FieldErrorServerProps, FieldHook, FieldHookArgs, FieldLabelClientComponent, FieldLabelClientProps, FieldLabelServerComponent, FieldLabelServerProps, FieldPaths, FieldPermissions, FieldPresentationalOnly, FieldPresentationalOnlyClient, FieldRow, FieldSchemaMap, FieldServerComponent, FieldState, FieldTypes, FieldWithMany, FieldWithManyClient, FieldWithMaxDepth, FieldWithMaxDepthClient, FieldWithPath, FieldWithPathClient, FieldWithSubFields, FieldWithSubFieldsClient, FieldsPermissions, FieldsPreferences, File$1 as File, FileAllowList, FileData, FileSize, FileSizeImproved, FileSizes, FileToSave, FilterOptions, FilterOptionsProps, FilterOptionsResult, Find, FindArgs, FindDistinct, FindGlobal, FindGlobalArgs, FindGlobalVersions, FindGlobalVersionsArgs, FindOne, FindOneArgs, FindVersions, FindVersionsArgs, FlattenedArrayField, FlattenedBlock, FlattenedBlocksField, FlattenedField$1 as FlattenedField, FlattenedGroupField, FlattenedJoinField, FlattenedTabAsField, FolderListViewClientProps, FolderListViewServerProps, FolderListViewServerPropsOnly, FolderListViewSlotSharedClientProps, FolderListViewSlots, FolderSortKeys, FieldState as FormField, FieldStateWithoutComponents as FormFieldWithoutComponents, FormState, FormStateWithoutComponents, GenerateImageName, GeneratePreviewURL, GenerateSchema, GeneratedTypes, GenericDescriptionProps, GenericErrorProps, GenericLabelProps, GetAdminThumbnail, GetFolderResultsComponentAndDataArgs, GlobalAdminCustom, GlobalAdminOptions, AfterChangeHook$1 as GlobalAfterChangeHook, AfterReadHook$1 as GlobalAfterReadHook, BeforeChangeHook$1 as GlobalBeforeChangeHook, BeforeOperationHook$1 as GlobalBeforeOperationHook, BeforeReadHook$1 as GlobalBeforeReadHook, BeforeValidateHook$1 as GlobalBeforeValidateHook, GlobalConfig, GlobalCustom, GlobalPermission, GlobalSlug, GraphQLExtension, GraphQLInfo, GroupField, GroupFieldClient, GroupFieldClientComponent, GroupFieldClientProps, GroupFieldDescriptionClientComponent, GroupFieldDescriptionServerComponent, GroupFieldDiffClientComponent, GroupFieldDiffServerComponent, GroupFieldErrorClientComponent, GroupFieldErrorServerComponent, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, GroupFieldServerComponent, GroupFieldServerProps, HiddenFieldProps, HookName, HookOperationType, IfAny, ImageSize, ImageUploadFormatOptions, ImageUploadTrimOptions, ImportMap, ImportMapGenerators, IncomingAuthType, Init, InitOptions, InitPageResult, InsideFieldsPreferences, IsAny, JSONField, JSONFieldClient, JSONFieldClientComponent, JSONFieldClientProps, JSONFieldDescriptionClientComponent, JSONFieldDescriptionServerComponent, JSONFieldDiffClientComponent, JSONFieldDiffServerComponent, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, JSONFieldServerComponent, JSONFieldServerProps, JSONFieldValidation, Job, JobLog, JobTaskStatus, JobsConfig, JoinField, JoinFieldClient, JoinFieldClientComponent, JoinFieldClientProps, JoinFieldDescriptionClientComponent, JoinFieldDescriptionServerComponent, JoinFieldDiffClientComponent, JoinFieldDiffServerComponent, JoinFieldErrorClientComponent, JoinFieldErrorServerComponent, JoinFieldLabelClientComponent, JoinFieldLabelServerComponent, JoinFieldServerComponent, JoinFieldServerProps, JoinQuery, JsonArray, JsonObject, JsonValue, KVAdapter, KVAdapterResult, KVStoreValue, LabelFunction, Labels, LabelsClient, LanguageOptions, CollectionPreferences as ListPreferences, ListQuery, ListViewClientProps, ListViewServerProps, ListViewServerPropsOnly, ListViewSlotSharedClientProps, ListViewSlots, LivePreviewConfig, LivePreviewURLType, Locale, LocalizationConfig, LocalizationConfigWithLabels, LocalizationConfigWithNoLabels, LoginWithUsernameOptions, MappedClientComponent, MappedEmptyComponent, MappedServerComponent, MaybePromise, MeOperationResult, MetaConfig, Migration, MigrationData, MigrationTemplateArgs, NamedGroupField, NamedGroupFieldClient, NamedTab, NavGroupPreferences, NavPreferences, NonPresentationalField, NonPresentationalFieldClient, NumberField, NumberFieldClient, NumberFieldClientComponent, NumberFieldClientProps, NumberFieldDescriptionClientComponent, NumberFieldDescriptionServerComponent, NumberFieldDiffClientComponent, NumberFieldDiffServerComponent, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, NumberFieldManyValidation, NumberFieldServerComponent, NumberFieldServerProps, NumberFieldSingleValidation, NumberFieldValidation, OGImageConfig, Operation, Operator, Option, OptionLabel, OptionObject, OrderableEndpointBody, PaginatedDistinctDocs, PaginatedDocs, Params, PasswordFieldValidation, PathToQuery, Payload, PayloadClientComponentProps, PayloadClientReactComponent, PayloadComponent, PayloadComponentProps, EmailAdapter as PayloadEmailAdapter, PayloadHandler, PayloadReactComponent, PayloadRequest, PayloadServerAction, PayloadServerComponentProps, PayloadServerReactComponent, Permission, Permissions, PickPreserveOptional, Plugin, PointField, PointFieldClient, PointFieldClientComponent, PointFieldClientProps, PointFieldDescriptionClientComponent, PointFieldDescriptionServerComponent, PointFieldDiffClientComponent, PointFieldDiffServerComponent, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, PointFieldServerComponent, PointFieldServerProps, PointFieldValidation, PolymorphicRelationshipField, PolymorphicRelationshipFieldClient, PopulateType, PreferenceRequest, PreferenceUpdateRequest, PreviewButtonClientProps, PreviewButtonServerProps, PreviewButtonServerPropsOnly, ProbedImageSize, PublishButtonClientProps, PublishButtonServerProps, PublishButtonServerPropsOnly, QueryDrafts, QueryDraftsArgs, QueryPreset, RadioField, RadioFieldClient, RadioFieldClientComponent, RadioFieldClientProps, RadioFieldDescriptionClientComponent, RadioFieldDescriptionServerComponent, RadioFieldDiffClientComponent, RadioFieldDiffServerComponent, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RadioFieldServerComponent, RadioFieldServerProps, RadioFieldValidation, RawPayloadComponent, RelationshipField, RelationshipFieldClient, RelationshipFieldClientComponent, RelationshipFieldClientProps, RelationshipFieldDescriptionClientComponent, RelationshipFieldDescriptionServerComponent, RelationshipFieldDiffClientComponent, RelationshipFieldDiffServerComponent, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RelationshipFieldManyValidation, RelationshipFieldServerComponent, RelationshipFieldServerProps, RelationshipFieldSingleValidation, RelationshipFieldValidation, RelationshipValue, RenderConfigArgs, RenderDocumentVersionsProperties, RenderEntityConfigArgs, RenderFieldConfigArgs, RenderRootConfigArgs, RenderedField, ReplaceAny, RequestContext, RequiredDataFromCollection, RequiredDataFromCollectionSlug, ResolvedComponent, ResolvedFilterOptions, RichTextAdapter, RichTextAdapterProvider, RichTextField, RichTextFieldClient, RichTextFieldClientComponent, RichTextFieldClientProps, RichTextFieldDescriptionClientComponent, RichTextFieldDescriptionServerComponent, RichTextFieldDiffClientComponent, RichTextFieldDiffServerComponent, RichTextFieldErrorClientComponent, RichTextFieldErrorServerComponent, RichTextFieldLabelClientComponent, RichTextFieldLabelServerComponent, RichTextFieldServerComponent, RichTextFieldServerProps, RichTextFieldValidation, RichTextHooks, RollbackTransaction, RootLivePreviewConfig, Row, RowField, RowFieldClient, RowFieldClientComponent, RowFieldClientProps, RowFieldDescriptionClientComponent, RowFieldDescriptionServerComponent, RowFieldDiffClientComponent, RowFieldDiffServerComponent, RowFieldErrorClientComponent, RowFieldErrorServerComponent, RowFieldLabelClientComponent, RowFieldLabelServerComponent, RowFieldServerComponent, RowFieldServerProps, RowLabel, RowLabelComponent, RunInlineTaskFunction, RunJobAccess, RunJobAccessArgs, RunTaskFunction, RunTaskFunctions, RunningJob, SanitizedBlockPermissions, SanitizedBlocksPermissions, SanitizedCollectionConfig, SanitizedCollectionPermission, SanitizedCompoundIndex, SanitizedConfig, SanitizedDashboardConfig, SanitizedDocumentPermissions, SanitizedFieldPermissions, SanitizedFieldsPermissions, SanitizedGlobalConfig, SanitizedGlobalPermission, SanitizedJoins, SanitizedLabelProps, SanitizedLocalizationConfig, SanitizedPermissions, SanitizedUploadConfig, SaveButtonClientProps, SaveButtonServerProps, SaveButtonServerPropsOnly, SaveDraftButtonClientProps, SaveDraftButtonServerProps, SaveDraftButtonServerPropsOnly, SchedulePublish, SchedulePublishTaskInput, SelectExcludeType, SelectField, SelectFieldClient, SelectFieldClientComponent, SelectFieldClientProps, SelectFieldDescriptionClientComponent, SelectFieldDescriptionServerComponent, SelectFieldDiffClientComponent, SelectFieldDiffServerComponent, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, SelectFieldManyValidation, SelectFieldServerComponent, SelectFieldServerProps, SelectFieldSingleValidation, SelectFieldValidation, SelectIncludeType, SelectMode, SelectType, SendEmailOptions, ServerComponentProps, ServerFieldBase, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, ServerOnlyCollectionAdminProperties, ServerOnlyCollectionProperties, ServerOnlyFieldAdminProperties, ServerOnlyFieldProperties, ServerOnlyGlobalAdminProperties, ServerOnlyGlobalProperties, ServerOnlyLivePreviewProperties, ServerOnlyUploadProperties, ServerProps, ServerPropsFromView, DocumentViewServerProps as ServerSideEditViewProps, SharedProps, SharpDependency, SingleRelationshipField, SingleRelationshipFieldClient, SingleTaskStatus, SlugField, SlugFieldClientProps, SlugifyServerFunctionArgs, Sort, StaticDescription, StaticLabel, StringKeyOf, Tab, TabAsField, TabAsFieldClient, TabsField, TabsFieldClient, TabsFieldClientComponent, TabsFieldClientProps, TabsFieldDescriptionClientComponent, TabsFieldDescriptionServerComponent, TabsFieldDiffClientComponent, TabsFieldDiffServerComponent, TabsFieldErrorClientComponent, TabsFieldErrorServerComponent, TabsFieldLabelClientComponent, TabsFieldLabelServerComponent, TabsFieldServerComponent, TabsFieldServerProps, TabsPreferences, TaskConfig, TaskHandler, TaskHandlerArgs, TaskHandlerResult, TaskHandlerResults, TaskInput, TaskOutput, TaskType, TextField, TextFieldClient, TextFieldClientComponent, TextFieldClientProps, TextFieldDescriptionClientComponent, TextFieldDescriptionServerComponent, TextFieldDiffClientComponent, TextFieldDiffServerComponent, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, TextFieldManyValidation, TextFieldServerComponent, TextFieldServerProps, TextFieldSingleValidation, TextFieldValidation, TextareaField, TextareaFieldClient, TextareaFieldClientComponent, TextareaFieldClientProps, TextareaFieldDescriptionClientComponent, TextareaFieldDescriptionServerComponent, TextareaFieldDiffClientComponent, TextareaFieldDiffServerComponent, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextareaFieldServerComponent, TextareaFieldServerProps, TextareaFieldValidation, TimePickerProps, Timezone, TimezonesConfig, Transaction, TransformCollectionWithSelect, TransformDataWithSelect, TransformGlobalWithSelect, TraverseFieldsCallback, TypeWithID, TypeWithTimestamps, TypeWithVersion, TypedAuthOperations, TypedBlock, TypedCollection, TypedCollectionJoins, TypedCollectionSelect, TypedFallbackLocale, TypedGlobal, TypedGlobalSelect, TypedJobs, TypedLocale, TypedUploadCollection, TypedUser, UIField, UIFieldClient, UIFieldClientComponent, UIFieldClientProps, UIFieldDiffClientComponent, UIFieldDiffServerComponent, UIFieldServerComponent, UIFieldServerProps, UnauthenticatedClientConfig, UnnamedGroupField, UnnamedGroupFieldClient, UnnamedTab, UntypedUser, UpdateGlobal, UpdateGlobalArgs, UpdateGlobalVersion, UpdateGlobalVersionArgs, UpdateJobs, UpdateJobsArgs, UpdateMany, UpdateManyArgs, UpdateOne, UpdateOneArgs, UpdateVersion, UpdateVersionArgs, UploadCollectionSlug, UploadConfig, UploadEdits, UploadField, UploadFieldClient, UploadFieldClientComponent, UploadFieldClientProps, UploadFieldDescriptionClientComponent, UploadFieldDescriptionServerComponent, UploadFieldDiffClientComponent, UploadFieldDiffServerComponent, UploadFieldErrorClientComponent, UploadFieldErrorServerComponent, UploadFieldLabelClientComponent, UploadFieldLabelServerComponent, UploadFieldManyValidation, UploadFieldServerComponent, UploadFieldServerProps, UploadFieldSingleValidation, UploadFieldValidation, Upsert, UpsertArgs, UntypedUser as User, UserSession, UsernameFieldValidation, Validate, ValidateOptions, ValidationFieldError, ValueWithRelation, VerifyConfig, VersionField, VersionOperations, VersionTab, ViewDescriptionClientProps, ViewDescriptionServerProps, ViewDescriptionServerPropsOnly, ViewTypes, VisibleEntities, Where, WhereField, Widget, WidgetInstance, WidgetServerProps, WidgetWidth, WithServerSidePropsComponent, WithServerSidePropsComponentProps, WorkflowConfig, WorkflowHandler, WorkflowTypes, checkFileRestrictionsParams };
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ import { type Options as UpdateGlobalOptions } from './globals/operations/local/
39
39
  export type * from './admin/types.js';
40
40
  export { EntityType } from './admin/views/dashboard.js';
41
41
  import { Cron } from 'croner';
42
+ import type { ResolveFallback } from './exports/internal.js';
42
43
  import type { KVAdapter } from './kv/index.js';
43
44
  import type { BaseJob } from './queues/config/types/workflowTypes.js';
44
45
  import type { TypeWithVersion } from './versions/types.js';
@@ -62,7 +63,10 @@ export { extractAccessFromPermission } from './auth/extractAccessFromPermission.
62
63
  export { getAccessResults } from './auth/getAccessResults.js';
63
64
  export { getFieldsToSign } from './auth/getFieldsToSign.js';
64
65
  export { getLoginOptions } from './auth/getLoginOptions.js';
65
- export interface GeneratedTypes {
66
+ /**
67
+ * Untyped, base GeneratedTypes interface.
68
+ */
69
+ export interface BaseGeneratedTypes {
66
70
  authUntyped: {
67
71
  [slug: string]: {
68
72
  forgotPassword: {
@@ -121,41 +125,35 @@ export interface GeneratedTypes {
121
125
  localeUntyped: null | string;
122
126
  userUntyped: UntypedUser;
123
127
  }
124
- type ResolveCollectionType<T> = 'collections' extends keyof T ? T['collections'] : T['collectionsUntyped'];
125
- type ResolveBlockType<T> = 'blocks' extends keyof T ? T['blocks'] : T['blocksUntyped'];
126
- type ResolveCollectionSelectType<T> = 'collectionsSelect' extends keyof T ? T['collectionsSelect'] : T['collectionsSelectUntyped'];
127
- type ResolveCollectionJoinsType<T> = 'collectionsJoins' extends keyof T ? T['collectionsJoins'] : T['collectionsJoinsUntyped'];
128
- type ResolveGlobalType<T> = 'globals' extends keyof T ? T['globals'] : T['globalsUntyped'];
129
- type ResolveGlobalSelectType<T> = 'globalsSelect' extends keyof T ? T['globalsSelect'] : T['globalsSelectUntyped'];
130
- export type TypedCollection = ResolveCollectionType<GeneratedTypes>;
131
- export type TypedBlock = ResolveBlockType<GeneratedTypes>;
132
- export type TypedUploadCollection = NonNever<{
133
- [K in keyof TypedCollection]: 'filename' | 'filesize' | 'mimeType' | 'url' extends keyof TypedCollection[K] ? TypedCollection[K] : never;
128
+ /**
129
+ * Typed GeneratedTypes interface. This interface will be module-augmented by the `payload-types.ts` file.
130
+ */
131
+ export interface GeneratedTypes extends BaseGeneratedTypes {
132
+ }
133
+ export type TypedCollection<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'collections', 'collectionsUntyped'>;
134
+ export type TypedBlock = ResolveFallback<GeneratedTypes, 'blocks', 'blocksUntyped'>;
135
+ export type TypedUploadCollection<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = NonNever<{
136
+ [TCollectionSlug in keyof TypedCollection<TGeneratedTypes>]: 'filename' | 'filesize' | 'mimeType' | 'url' extends keyof TypedCollection<TGeneratedTypes>[TCollectionSlug] ? TypedCollection<TGeneratedTypes>[TCollectionSlug] : never;
134
137
  }>;
135
- export type TypedCollectionSelect = ResolveCollectionSelectType<GeneratedTypes>;
136
- export type TypedCollectionJoins = ResolveCollectionJoinsType<GeneratedTypes>;
137
- export type TypedGlobal = ResolveGlobalType<GeneratedTypes>;
138
- export type TypedGlobalSelect = ResolveGlobalSelectType<GeneratedTypes>;
138
+ export type TypedCollectionSelect<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'collectionsSelect', 'collectionsSelectUntyped'>;
139
+ export type TypedCollectionJoins<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'collectionsJoins', 'collectionsJoinsUntyped'>;
140
+ export type TypedGlobal<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'globals', 'globalsUntyped'>;
141
+ export type TypedGlobalSelect<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'globalsSelect', 'globalsSelectUntyped'>;
139
142
  export type StringKeyOf<T> = Extract<keyof T, string>;
140
- export type CollectionSlug = StringKeyOf<TypedCollection>;
143
+ export type CollectionSlug<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = StringKeyOf<TypedCollection<TGeneratedTypes>>;
141
144
  export type BlockSlug = StringKeyOf<TypedBlock>;
142
- export type UploadCollectionSlug = StringKeyOf<TypedUploadCollection>;
143
- type ResolveDbType<T> = 'db' extends keyof T ? T['db'] : T['dbUntyped'];
144
- export type DefaultDocumentIDType = ResolveDbType<GeneratedTypes>['defaultIDType'];
145
- export type GlobalSlug = StringKeyOf<TypedGlobal>;
146
- type ResolveLocaleType<T> = 'locale' extends keyof T ? T['locale'] : T['localeUntyped'];
147
- type ResolveFallbackLocaleType<T> = 'fallbackLocale' extends keyof T ? T['fallbackLocale'] : T['fallbackLocaleUntyped'];
148
- type ResolveUserType<T> = 'user' extends keyof T ? T['user'] : T['userUntyped'];
149
- export type TypedLocale = ResolveLocaleType<GeneratedTypes>;
150
- export type TypedFallbackLocale = ResolveFallbackLocaleType<GeneratedTypes>;
145
+ export type UploadCollectionSlug<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = StringKeyOf<TypedUploadCollection<TGeneratedTypes>>;
146
+ export type DefaultDocumentIDType = ResolveFallback<GeneratedTypes, 'db', 'dbUntyped'>['defaultIDType'];
147
+ export type GlobalSlug<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = StringKeyOf<TypedGlobal<TGeneratedTypes>>;
148
+ export type TypedLocale<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'locale', 'localeUntyped'>;
149
+ export type TypedFallbackLocale = ResolveFallback<GeneratedTypes, 'fallbackLocale', 'fallbackLocaleUntyped'>;
151
150
  /**
152
151
  * @todo rename to `User` in 4.0
153
152
  */
154
- export type TypedUser = ResolveUserType<GeneratedTypes>;
155
- type ResolveAuthOperationsType<T> = 'auth' extends keyof T ? T['auth'] : T['authUntyped'];
156
- export type TypedAuthOperations = ResolveAuthOperationsType<GeneratedTypes>;
157
- type ResolveJobOperationsType<T> = 'jobs' extends keyof T ? T['jobs'] : T['jobsUntyped'];
158
- export type TypedJobs = ResolveJobOperationsType<GeneratedTypes>;
153
+ export type TypedUser = ResolveFallback<GeneratedTypes, 'user', 'userUntyped'>;
154
+ export type TypedAuthOperations<TGeneratedTypes extends BaseGeneratedTypes = GeneratedTypes> = ResolveFallback<TGeneratedTypes, 'auth', 'authUntyped'>;
155
+ export type AuthCollectionSlug<TGeneratedTypes extends BaseGeneratedTypes> = StringKeyOf<TypedAuthOperations<TGeneratedTypes>>;
156
+ export type TypedJobs = ResolveFallback<GeneratedTypes, 'jobs', 'jobsUntyped'>;
159
157
  type HasPayloadJobsType = 'collections' extends keyof GeneratedTypes ? 'payload-jobs' extends keyof TypedCollection ? true : false : false;
160
158
  /**
161
159
  * Represents a job in the `payload-jobs` collection, referencing a queued workflow or task (= Job).