payload 4.0.0-beta.2 → 4.0.0-beta.3

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 (48) hide show
  1. package/dist/auth/types.d.ts.map +1 -1
  2. package/dist/auth/types.js.map +1 -1
  3. package/dist/cli/commands/data/utilities.d.ts +1 -1
  4. package/dist/cli/commands/data/utilities.d.ts.map +1 -1
  5. package/dist/cli/commands/data/utilities.js.map +1 -1
  6. package/dist/collections/config/types.d.ts.map +1 -1
  7. package/dist/collections/config/types.js.map +1 -1
  8. package/dist/collections/operations/utilities/update.js.map +1 -1
  9. package/dist/config/sanitize.js.map +1 -1
  10. package/dist/config/types.d.ts.map +1 -1
  11. package/dist/config/types.js.map +1 -1
  12. package/dist/database/types.d.ts +4 -0
  13. package/dist/database/types.d.ts.map +1 -1
  14. package/dist/database/types.js.map +1 -1
  15. package/dist/fields/config/reservedFieldNames.d.ts.map +1 -1
  16. package/dist/fields/config/reservedFieldNames.js.map +1 -1
  17. package/dist/fields/config/types.d.ts.map +1 -1
  18. package/dist/fields/config/types.js.map +1 -1
  19. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  20. package/dist/fields/hooks/beforeChange/flattenValidationData.d.ts +14 -0
  21. package/dist/fields/hooks/beforeChange/flattenValidationData.d.ts.map +1 -0
  22. package/dist/fields/hooks/beforeChange/flattenValidationData.js +36 -0
  23. package/dist/fields/hooks/beforeChange/flattenValidationData.js.map +1 -0
  24. package/dist/fields/hooks/beforeChange/promise.d.ts +2 -1
  25. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  26. package/dist/fields/hooks/beforeChange/promise.js +96 -22
  27. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  28. package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -1
  29. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  30. package/dist/fields/hooks/beforeChange/traverseFields.js +2 -1
  31. package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
  32. package/dist/globals/config/types.d.ts.map +1 -1
  33. package/dist/globals/config/types.js.map +1 -1
  34. package/dist/index.bundled.d.ts +6 -1
  35. package/dist/types/index.d.ts.map +1 -1
  36. package/dist/types/index.js.map +1 -1
  37. package/dist/uploads/fileVersioning/cloudStorage.js.map +1 -1
  38. package/dist/uploads/generateFileData.js.map +1 -1
  39. package/dist/uploads/getFileContentRequirement.js.map +1 -1
  40. package/dist/utilities/entityInputSchema/validateEntityData.d.ts.map +1 -1
  41. package/dist/utilities/entityInputSchema/validateEntityData.js.map +1 -1
  42. package/dist/utilities/getVersionsConfig.js.map +1 -1
  43. package/dist/utilities/telemetry/conf/index.d.ts +4 -1
  44. package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
  45. package/dist/utilities/telemetry/conf/index.js.map +1 -1
  46. package/dist/versions/isInheritedReadVersionsAccess.js.map +1 -1
  47. package/package.json +20 -20
  48. package/skills/payload/reference/ENDPOINTS.md +3 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/promise.ts"],"sourcesContent":["import type { RichTextAdapter } from '../../../admin/RichText.js'\nimport type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { FieldOperation, JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, TabAsField, Validate } from '../../config/types.js'\n\nimport { MissingEditorProp } from '../../../errors/index.js'\nimport { type RequestContext, validateBlocksFilterOptions } from '../../../index.js'\nimport { deepMergeWithSourceArrays } from '../../../utilities/deepMerge.js'\nimport { getTranslatedLabel } from '../../../utilities/getTranslatedLabel.js'\nimport { fieldAffectsData, fieldShouldBeLocalized, tabHasName } from '../../config/types.js'\nimport { getFieldPaths } from '../../getFieldPaths.js'\nimport { getExistingRowDoc } from './getExistingRowDoc.js'\nimport { traverseFields } from './traverseFields.js'\n\nfunction buildFieldLabel(parentLabel: string, label: string | undefined): string {\n if (!label) {\n return parentLabel\n }\n const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1)\n return parentLabel && capitalizedLabel\n ? `${parentLabel} > ${capitalizedLabel}`\n : capitalizedLabel || parentLabel\n}\n\ntype Args = {\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: JsonObject\n doc: JsonObject\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n field: Field | TabAsField\n fieldIndex: number\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n global: null | SanitizedGlobalConfig\n id?: number | string\n isValidationOperation: boolean\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: FieldOperation\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n siblingDoc: JsonObject\n siblingDocWithLocales?: JsonObject\n siblingFields?: (Field | TabAsField)[]\n skipHooks: boolean\n skipValidation: boolean\n submittedTopLevelFieldNames?: ReadonlySet<string>\n}\n\n// This function is responsible for the following actions, in order:\n// - Run condition\n// - Execute field hooks\n// - Validate data\n// - Transform data for storage\n// - beforeDuplicate hooks (if duplicate)\n// - Unflatten locales\n\nexport const promise = async ({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields,\n skipHooks,\n skipValidation,\n submittedTopLevelFieldNames,\n}: Args): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const { localization } = req.payload.config\n const defaultLocale = localization ? localization?.defaultLocale : 'en'\n const operationLocale = req.locale || defaultLocale\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 const passesCondition = field.admin?.condition\n ? Boolean(\n field.admin.condition(data, siblingData, {\n blockData: blockData!,\n operation,\n path: pathSegments,\n user: req.user,\n }),\n )\n : true\n const isOutsideSubmittedFieldScope =\n submittedTopLevelFieldNames !== undefined &&\n fieldAffectsData(field) &&\n !submittedTopLevelFieldNames.has(pathSegments[0]!)\n let skipValidationFromHere = skipValidation || isOutsideSubmittedFieldScope || !passesCondition\n\n if (fieldAffectsData(field)) {\n const shouldSkipValidationForLocalizedFallback =\n !isValidationOperation &&\n operation !== 'validate' &&\n fieldShouldBeLocalized({ field, parentIsLocalized }) &&\n operationLocale !== defaultLocale &&\n ['array', 'blocks'].includes(field.type) &&\n siblingData[field.name!] === null\n\n if (shouldSkipValidationForLocalizedFallback) {\n skipValidationFromHere = true\n }\n\n // Execute hooks\n if (!skipHooks && 'hooks' in field && field.hooks?.beforeChange) {\n for (const hook of field.hooks.beforeChange) {\n const hookedValue = await hook({\n blockData,\n collection,\n context,\n data,\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 siblingDocWithLocales,\n siblingFields: siblingFields!,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n if (hasInvalidFieldValueShape({ field, value: siblingData[field.name!] })) {\n errors.push({\n label: buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n message: req.t('validation:invalidInput'),\n path,\n })\n return\n }\n\n // Validate\n if (!skipValidationFromHere && 'validate' in field && field.validate) {\n const valueToValidate = siblingData[field.name]\n let jsonError: object\n\n if (field.type === 'json' && typeof siblingData[field.name] === 'string') {\n try {\n JSON.parse(siblingData[field.name] as string)\n } catch (e) {\n jsonError = e as object\n }\n }\n\n const validateFn: Validate<object, object, object, object> = field.validate as Validate<\n object,\n object,\n object,\n object\n >\n\n const validationResult = await validateFn(valueToValidate as never, {\n ...field,\n id,\n blockData: blockData!,\n collectionSlug: collection?.slug,\n data: deepMergeWithSourceArrays(doc, data),\n event: 'submit',\n // @ts-expect-error\n jsonError,\n operation,\n overrideAccess,\n path: pathSegments,\n preferences: { fields: {} },\n previousValue: siblingDoc[field.name],\n req,\n siblingData: deepMergeWithSourceArrays(siblingDoc, siblingData),\n })\n\n if (typeof validationResult === 'string') {\n let filterOptionsError = false\n\n if (field.type === 'blocks' && field.filterOptions) {\n // Re-run filteroptions. If the validation error is due to filteroptions, we need to add error paths to all the blocks\n // that are no longer valid\n const validationResult = await validateBlocksFilterOptions({\n id,\n data,\n filterOptions: field.filterOptions,\n req,\n siblingData,\n value: siblingData[field.name],\n })\n if (validationResult?.invalidBlockSlugs?.length) {\n filterOptionsError = true\n let rowIndex = -1\n for (const block of siblingData[field.name] as JsonObject[]) {\n rowIndex++\n if (validationResult.invalidBlockSlugs.includes(block.blockType as string)) {\n const blockConfigOrSlug = field.blocks.find((blockFromField) =>\n typeof blockFromField === 'string'\n ? blockFromField === block.blockType\n : blockFromField.slug === block.blockType,\n )\n const blockConfig =\n typeof blockConfigOrSlug === 'string'\n ? req.payload.blocks[blockConfigOrSlug]\n : blockConfigOrSlug\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(blockConfig?.labels?.singular || block.blockType, req.i18n)})`,\n )\n\n errors.push({\n label: blockLabelPath,\n message: req.t('validation:invalidBlock', { block: block.blockType }),\n path: `${path}.${rowIndex}.id`,\n })\n }\n }\n }\n }\n\n if (!filterOptionsError) {\n // If the error is due to block filterOptions, we want to push the errors for each individual block, not the blocks\n // field itself => only push the error if the field is not a block field with validation failure due to filterOptions\n const fieldLabel = buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n )\n\n errors.push({\n label: fieldLabel,\n message: validationResult,\n path,\n })\n }\n }\n }\n\n // Push merge locale action if applicable\n if (localization && fieldShouldBeLocalized({ field, parentIsLocalized })) {\n mergeLocaleActions.push(() => {\n const localeData: Record<string, unknown> = {}\n\n for (const locale of localization.localeCodes) {\n const fieldValue =\n locale === req.locale\n ? siblingData[field.name!]\n : siblingDocWithLocales?.[field.name!]?.[locale]\n\n // update locale value if it's not undefined\n if (typeof fieldValue !== 'undefined') {\n localeData[locale] = fieldValue\n }\n }\n\n // If there are locales with data, set the data\n if (Object.keys(localeData).length > 0) {\n siblingData[field.name!] = localeData\n }\n })\n }\n }\n\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 docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} ${rowIndex + 1}`,\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales?.[field.name],\n ),\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n }),\n )\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'blocks': {\n const rows = siblingData[field.name]\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\n const rowSiblingDocWithLocales = getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales ? siblingDocWithLocales[field.name] : {},\n )\n\n const blockTypeToMatch = (row as JsonObject).blockType || rowSiblingDoc.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n (field.blocks.find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(block?.labels?.singular || blockTypeToMatch, req.i18n)})`,\n )\n\n if (block) {\n promises.push(\n traverseFields({\n id,\n blockData: row,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath: blockLabelPath,\n\n fields: block.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: rowSiblingDocWithLocales,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\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 docWithLocales,\n errors,\n fieldLabelPath:\n field.type === 'row' || field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.type, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'group': {\n let groupSiblingData = siblingData\n let groupSiblingDoc = siblingDoc\n let groupSiblingDocWithLocales = siblingDocWithLocales\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 if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\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 if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n groupSiblingData = siblingData[field.name] as JsonObject\n groupSiblingDoc = siblingDoc[field.name] as JsonObject\n groupSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n const fallbackLabel = field?.label || (isNamedGroup ? field.name : field?.type)\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(fallbackLabel, req.i18n)),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: groupSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'point': {\n // Transform point data for storage\n if (\n Array.isArray(siblingData[field.name]) &&\n siblingData[field.name][0] !== null &&\n siblingData[field.name][1] !== null\n ) {\n siblingData[field.name] = {\n type: 'Point',\n coordinates: [\n parseFloat(siblingData[field.name][0]),\n parseFloat(siblingData[field.name][1]),\n ],\n }\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 (!skipHooks && editor?.hooks?.beforeChange?.length) {\n for (const hook of editor.hooks.beforeChange) {\n const hookedValue = await hook({\n collection,\n context,\n data,\n docWithLocales,\n errors,\n field,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n global,\n indexPath: indexPathSegments,\n mergeLocaleActions,\n operation,\n originalDoc: doc,\n overrideAccess,\n parentIsLocalized,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingDocWithLocales,\n skipValidation: skipValidationFromHere,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n break\n }\n\n case 'tab': {\n let tabSiblingData = siblingData\n let tabSiblingDoc = siblingDoc\n let tabSiblingDocWithLocales = siblingDocWithLocales\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 if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n tabSiblingData = siblingData[field.name] as JsonObject\n tabSiblingDoc = siblingDoc[field.name] as JsonObject\n tabSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field.name, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: tabSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\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 docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || '', req.i18n)),\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n}\n\nfunction hasInvalidFieldValueShape({\n field,\n value,\n}: {\n field: Field | TabAsField\n value: unknown\n}): boolean {\n if (value === null || typeof value === 'undefined' || !fieldAffectsData(field)) {\n return false\n }\n\n if (field.type === 'array' || field.type === 'blocks') {\n // Form state may use a numeric row count, while submitted values use arrays.\n return !(Array.isArray(value) || typeof value === 'number')\n }\n\n if (field.type === 'number') {\n // Only hasMany number fields may receive arrays.\n return typeof value === 'object' && !(field.hasMany && Array.isArray(value))\n }\n\n if ((field.type === 'relationship' || field.type === 'upload') && field.hasMany) {\n // HasMany relationships/uploads may receive arrays or one valid polymorphic value.\n if (typeof value !== 'object' || Array.isArray(value)) {\n return false\n }\n\n const relationshipValue = value as Record<PropertyKey, unknown>\n const valuePrototype = Object.getPrototypeOf(value)\n const isSinglePolymorphicRelationshipValue =\n Array.isArray(field.relationTo) &&\n (valuePrototype === null || valuePrototype === Object.prototype) &&\n Object.hasOwn(relationshipValue, 'relationTo') &&\n Object.hasOwn(relationshipValue, 'value') &&\n Reflect.ownKeys(relationshipValue).length === 2 &&\n typeof relationshipValue.relationTo === 'string' &&\n field.relationTo.includes(relationshipValue.relationTo) &&\n (typeof relationshipValue.value === 'string' || typeof relationshipValue.value === 'number')\n\n return !isSinglePolymorphicRelationshipValue\n }\n\n return false\n}\n"],"names":["MissingEditorProp","validateBlocksFilterOptions","deepMergeWithSourceArrays","getTranslatedLabel","fieldAffectsData","fieldShouldBeLocalized","tabHasName","getFieldPaths","getExistingRowDoc","traverseFields","buildFieldLabel","parentLabel","label","capitalizedLabel","charAt","toUpperCase","slice","promise","id","blockData","collection","context","data","doc","docWithLocales","errors","field","fieldIndex","fieldLabelPath","global","isValidationOperation","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","siblingFields","skipHooks","skipValidation","submittedTopLevelFieldNames","indexPath","path","schemaPath","index","localization","payload","config","defaultLocale","operationLocale","locale","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","passesCondition","admin","condition","user","isOutsideSubmittedFieldScope","undefined","has","skipValidationFromHere","shouldSkipValidationForLocalizedFallback","includes","type","name","hooks","beforeChange","hook","hookedValue","originalDoc","previousSiblingDoc","previousValue","value","hasInvalidFieldValueShape","push","i18n","message","t","validate","valueToValidate","jsonError","JSON","parse","e","validateFn","validationResult","collectionSlug","slug","event","preferences","fields","filterOptionsError","filterOptions","invalidBlockSlugs","length","rowIndex","block","blockType","blockConfigOrSlug","blocks","find","blockFromField","blockConfig","blockLabelPath","labels","singular","fieldLabel","localeData","localeCodes","fieldValue","Object","keys","rows","Array","isArray","promises","forEach","row","localized","Promise","all","rowSiblingDoc","rowSiblingDocWithLocales","blockTypeToMatch","curBlock","groupSiblingData","groupSiblingDoc","groupSiblingDocWithLocales","isNamedGroup","fallbackLabel","coordinates","parseFloat","editor","Error","tabSiblingData","tabSiblingDoc","tabSiblingDocWithLocales","isNamedTab","tabs","tab","hasMany","relationshipValue","valuePrototype","getPrototypeOf","isSinglePolymorphicRelationshipValue","relationTo","prototype","hasOwn","Reflect","ownKeys"],"mappings":"AAOA,SAASA,iBAAiB,QAAQ,2BAA0B;AAC5D,SAA8BC,2BAA2B,QAAQ,oBAAmB;AACpF,SAASC,yBAAyB,QAAQ,kCAAiC;AAC3E,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,UAAU,QAAQ,wBAAuB;AAC5F,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,SAASC,gBAAgBC,WAAmB,EAAEC,KAAyB;IACrE,IAAI,CAACA,OAAO;QACV,OAAOD;IACT;IACA,MAAME,mBAAmBD,MAAME,MAAM,CAAC,GAAGC,WAAW,KAAKH,MAAMI,KAAK,CAAC;IACrE,OAAOL,eAAeE,mBAClB,GAAGF,YAAY,GAAG,EAAEE,kBAAkB,GACtCA,o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AEA,IAAI,AAACzD,CAAAA,MAAMgD,IAAI,KAAK,kBAAkBhD,MAAMgD,IAAI,KAAK,QAAO,KAAMhD,MAAM6H,OAAO,EAAE;QAC/E,mFAAmF;QACnF,IAAI,OAAOpE,UAAU,YAAYyC,MAAMC,OAAO,CAAC1C,QAAQ;YACrD,OAAO;QACT;QAEA,MAAMqE,oBAAoBrE;QAC1B,MAAMsE,iBAAiBhC,OAAOiC,cAAc,CAACvE;QAC7C,MAAMwE,uCACJ/B,MAAMC,OAAO,CAACnG,MAAMkI,UAAU,KAC7BH,CAAAA,mBAAmB,QAAQA,mBAAmBhC,OAAOoC,SAAS,AAAD,KAC9DpC,OAAOqC,MAAM,CAACN,mBAAmB,iBACjC/B,OAAOqC,MAAM,CAACN,mBAAmB,YACjCO,QAAQC,OAAO,CAACR,mBAAmB/C,MAAM,KAAK,KAC9C,OAAO+C,kBAAkBI,UAAU,KAAK,YACxClI,MAAMkI,UAAU,CAACnF,QAAQ,CAAC+E,kBAAkBI,UAAU,KACrD,CAAA,OAAOJ,kBAAkBrE,KAAK,KAAK,YAAY,OAAOqE,kBAAkBrE,KAAK,KAAK,QAAO;QAE5F,OAAO,CAACwE;IACV;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/promise.ts"],"sourcesContent":["import type { RichTextAdapter } from '../../../admin/RichText.js'\nimport type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { FieldOperation, JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, TabAsField, Validate } from '../../config/types.js'\n\nimport { MissingEditorProp } from '../../../errors/index.js'\nimport { type RequestContext, validateBlocksFilterOptions } from '../../../index.js'\nimport { deepMergeWithSourceArrays } from '../../../utilities/deepMerge.js'\nimport { getTranslatedLabel } from '../../../utilities/getTranslatedLabel.js'\nimport { isolateObjectProperty } from '../../../utilities/isolateObjectProperty.js'\nimport { fieldAffectsData, fieldShouldBeLocalized, tabHasName } from '../../config/types.js'\nimport { getFieldPaths } from '../../getFieldPaths.js'\nimport { flattenValidationData } from './flattenValidationData.js'\nimport { getExistingRowDoc } from './getExistingRowDoc.js'\nimport { traverseFields } from './traverseFields.js'\n\nfunction buildFieldLabel(parentLabel: string, label: string | undefined): string {\n if (!label) {\n return parentLabel\n }\n const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1)\n return parentLabel && capitalizedLabel\n ? `${parentLabel} > ${capitalizedLabel}`\n : capitalizedLabel || parentLabel\n}\n\ntype Args = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n blockFields?: Field[]\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: JsonObject\n doc: JsonObject\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n field: Field | TabAsField\n fieldIndex: number\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n global: null | SanitizedGlobalConfig\n id?: number | string\n isValidationOperation: boolean\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: FieldOperation\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n siblingDoc: JsonObject\n siblingDocWithLocales?: JsonObject\n siblingFields?: (Field | TabAsField)[]\n skipHooks: boolean\n skipValidation: boolean\n submittedTopLevelFieldNames?: ReadonlySet<string>\n}\n\n// This function is responsible for the following actions, in order:\n// - Run condition\n// - Execute field hooks\n// - Validate data\n// - Transform data for storage\n// - beforeDuplicate hooks (if duplicate)\n// - Unflatten locales\n\nexport const promise = async ({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields,\n skipHooks,\n skipValidation,\n submittedTopLevelFieldNames,\n}: Args): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const { localization } = req.payload.config\n const defaultLocale = localization ? localization?.defaultLocale : 'en'\n const operationLocale = req.locale || defaultLocale\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 const passesCondition = field.admin?.condition\n ? Boolean(\n field.admin.condition(data, siblingData, {\n blockData: blockData!,\n operation,\n path: pathSegments,\n user: req.user,\n }),\n )\n : true\n const isOutsideSubmittedFieldScope =\n submittedTopLevelFieldNames !== undefined &&\n fieldAffectsData(field) &&\n !submittedTopLevelFieldNames.has(pathSegments[0]!)\n let skipValidationFromHere = skipValidation || isOutsideSubmittedFieldScope || !passesCondition\n\n if (fieldAffectsData(field)) {\n const shouldSkipValidationForLocalizedFallback =\n !isValidationOperation &&\n operation !== 'validate' &&\n fieldShouldBeLocalized({ field, parentIsLocalized }) &&\n operationLocale !== defaultLocale &&\n ['array', 'blocks'].includes(field.type) &&\n siblingData[field.name!] === null\n\n if (shouldSkipValidationForLocalizedFallback) {\n skipValidationFromHere = true\n }\n\n // Execute hooks\n if (!skipHooks && 'hooks' in field && field.hooks?.beforeChange) {\n for (const hook of field.hooks.beforeChange) {\n const hookedValue = await hook({\n blockData,\n collection,\n context,\n data,\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 siblingDocWithLocales,\n siblingFields: siblingFields!,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n if (hasInvalidFieldValueShape({ field, value: siblingData[field.name!] })) {\n errors.push({\n label: buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n message: req.t('validation:invalidInput'),\n path,\n })\n return\n }\n\n // Validate\n if (!skipValidationFromHere && 'validate' in field && field.validate) {\n const valueToValidate = siblingData[field.name]\n\n // With `locale: 'all'` a localized scalar is a locale-keyed object; validate each locale, not the\n // wrapper. Containers (`group`/`array`/`blocks`) are excluded - per-locale child validation is a follow-up.\n const isLocaleKeyedValue =\n operationLocale === 'all' &&\n localization &&\n fieldShouldBeLocalized({ field, parentIsLocalized }) &&\n field.type !== 'group' &&\n valueToValidate !== null &&\n typeof valueToValidate === 'object' &&\n !Array.isArray(valueToValidate)\n\n const localizedValuesToValidate: { locale?: string; value: unknown }[] = isLocaleKeyedValue\n ? localization.localeCodes\n .filter((locale) => locale in (valueToValidate as JsonObject))\n .map((locale) => ({ locale, value: (valueToValidate as JsonObject)[locale] }))\n : [{ value: valueToValidate }]\n\n // No recognized locales (e.g. `{}`): validate `undefined` once so required/optional still apply.\n if (localizedValuesToValidate.length === 0) {\n localizedValuesToValidate.push({ value: undefined })\n }\n\n let jsonError: object\n\n if (field.type === 'json' && typeof siblingData[field.name] === 'string') {\n try {\n JSON.parse(siblingData[field.name] as string)\n } catch (e) {\n jsonError = e as object\n }\n }\n\n const validateFn: Validate<object, object, object, object> = field.validate as Validate<\n object,\n object,\n object,\n object\n >\n\n let validationResult: string | true = true\n let failedLocale: string | undefined\n\n const validationData = deepMergeWithSourceArrays<JsonObject>(doc, data)\n const validationSiblingData = deepMergeWithSourceArrays<JsonObject>(siblingDoc, siblingData)\n\n for (const { locale, value } of localizedValuesToValidate) {\n // Scope `req.locale` to the locale being validated without mutating the shared request.\n const validationReq = locale ? isolateObjectProperty(req, 'locale') : req\n if (locale) {\n validationReq.locale = locale\n }\n\n const localeContext = locale\n ? {\n blockData:\n blockData && blockFields\n ? flattenValidationData({\n config: req.payload.config,\n data: blockData,\n fields: blockFields,\n locale,\n parentIsLocalized,\n })\n : blockData,\n data: flattenValidationData({\n config: req.payload.config,\n data: validationData,\n fields: (collection?.fields || global?.fields)!,\n locale,\n }),\n siblingData: flattenValidationData({\n config: req.payload.config,\n data: validationSiblingData,\n fields: siblingFields!,\n locale,\n parentIsLocalized,\n }),\n }\n : { blockData, data: validationData, siblingData: validationSiblingData }\n\n validationResult = await validateFn(value as never, {\n ...field,\n id,\n blockData: localeContext.blockData!,\n collectionSlug: collection?.slug,\n data: localeContext.data,\n event: 'submit',\n // @ts-expect-error generic validation options cannot infer JSON fields\n jsonError,\n operation,\n overrideAccess,\n path: pathSegments,\n preferences: { fields: {} },\n previousValue: locale\n ? (siblingDoc[field.name] as JsonObject)?.[locale]\n : siblingDoc[field.name],\n req: validationReq,\n siblingData: localeContext.siblingData,\n })\n\n if (typeof validationResult === 'string') {\n failedLocale = locale\n break\n }\n }\n\n if (typeof validationResult === 'string') {\n let filterOptionsError = false\n\n if (field.type === 'blocks' && field.filterOptions) {\n // Re-run filteroptions. If the validation error is due to filteroptions, we need to add error paths to all the blocks\n // that are no longer valid\n const validationResult = await validateBlocksFilterOptions({\n id,\n data,\n filterOptions: field.filterOptions,\n req,\n siblingData,\n value: siblingData[field.name],\n })\n if (validationResult?.invalidBlockSlugs?.length) {\n filterOptionsError = true\n let rowIndex = -1\n for (const block of siblingData[field.name] as JsonObject[]) {\n rowIndex++\n if (validationResult.invalidBlockSlugs.includes(block.blockType as string)) {\n const blockConfigOrSlug = field.blocks.find((blockFromField) =>\n typeof blockFromField === 'string'\n ? blockFromField === block.blockType\n : blockFromField.slug === block.blockType,\n )\n const blockConfig =\n typeof blockConfigOrSlug === 'string'\n ? req.payload.blocks[blockConfigOrSlug]\n : blockConfigOrSlug\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(blockConfig?.labels?.singular || block.blockType, req.i18n)})`,\n )\n\n errors.push({\n label: blockLabelPath,\n message: req.t('validation:invalidBlock', { block: block.blockType }),\n path: `${path}.${rowIndex}.id`,\n })\n }\n }\n }\n }\n\n if (!filterOptionsError) {\n // If the error is due to block filterOptions, we want to push the errors for each individual block, not the blocks\n // field itself => only push the error if the field is not a block field with validation failure due to filterOptions\n const fieldLabel = buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n )\n\n errors.push({\n label: failedLocale ? `${fieldLabel} (${failedLocale})` : fieldLabel,\n message: validationResult,\n path,\n })\n }\n }\n }\n\n // Push merge locale action if applicable\n if (localization && fieldShouldBeLocalized({ field, parentIsLocalized })) {\n mergeLocaleActions.push(() => {\n const localeData: Record<string, unknown> = {}\n\n // With `locale: 'all'`, siblingData holds a locale-keyed object (`{ en, es }`) rather than a single\n // locale's value - take each submitted locale, falling back to the existing doc for ones not sent.\n const submittedValue = siblingData[field.name!]\n const isAllLocales =\n req.locale === 'all' &&\n submittedValue !== null &&\n typeof submittedValue === 'object' &&\n !Array.isArray(submittedValue)\n\n for (const locale of localization.localeCodes) {\n const existingValue = siblingDocWithLocales?.[field.name!]?.[locale]\n\n const fieldValue = isAllLocales\n ? locale in (submittedValue as Record<string, unknown>)\n ? (submittedValue as Record<string, unknown>)[locale]\n : existingValue\n : locale === req.locale\n ? submittedValue\n : existingValue\n\n // update locale value if it's not undefined\n if (typeof fieldValue !== 'undefined') {\n localeData[locale] = fieldValue\n }\n }\n\n // If there are locales with data, set the data\n if (Object.keys(localeData).length > 0) {\n siblingData[field.name!] = localeData\n }\n })\n }\n }\n\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 blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} ${rowIndex + 1}`,\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales?.[field.name],\n ),\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n }),\n )\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'blocks': {\n const rows = siblingData[field.name]\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\n const rowSiblingDocWithLocales = getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales ? siblingDocWithLocales[field.name] : {},\n )\n\n const blockTypeToMatch = (row as JsonObject).blockType || rowSiblingDoc.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n (field.blocks.find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(block?.labels?.singular || blockTypeToMatch, req.i18n)})`,\n )\n\n if (block) {\n promises.push(\n traverseFields({\n id,\n blockData: row,\n blockFields: block.fields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath: blockLabelPath,\n\n fields: block.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: rowSiblingDocWithLocales,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\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 blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field.type === 'row' || field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.type, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'group': {\n let groupSiblingData = siblingData\n let groupSiblingDoc = siblingDoc\n let groupSiblingDocWithLocales = siblingDocWithLocales\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 if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\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 if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n groupSiblingData = siblingData[field.name] as JsonObject\n groupSiblingDoc = siblingDoc[field.name] as JsonObject\n groupSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n const fallbackLabel = field?.label || (isNamedGroup ? field.name : field?.type)\n\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(fallbackLabel, req.i18n)),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: groupSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'point': {\n // Transform point data for storage\n if (\n Array.isArray(siblingData[field.name]) &&\n siblingData[field.name][0] !== null &&\n siblingData[field.name][1] !== null\n ) {\n siblingData[field.name] = {\n type: 'Point',\n coordinates: [\n parseFloat(siblingData[field.name][0]),\n parseFloat(siblingData[field.name][1]),\n ],\n }\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 (!skipHooks && editor?.hooks?.beforeChange?.length) {\n for (const hook of editor.hooks.beforeChange) {\n const hookedValue = await hook({\n collection,\n context,\n data,\n docWithLocales,\n errors,\n field,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n global,\n indexPath: indexPathSegments,\n mergeLocaleActions,\n operation,\n originalDoc: doc,\n overrideAccess,\n parentIsLocalized,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingDocWithLocales,\n skipValidation: skipValidationFromHere,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n break\n }\n\n case 'tab': {\n let tabSiblingData = siblingData\n let tabSiblingDoc = siblingDoc\n let tabSiblingDocWithLocales = siblingDocWithLocales\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 if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n tabSiblingData = siblingData[field.name] as JsonObject\n tabSiblingDoc = siblingDoc[field.name] as JsonObject\n tabSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field.name, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\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 siblingDocWithLocales: tabSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'tabs': {\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || '', req.i18n)),\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n}\n\nfunction hasInvalidFieldValueShape({\n field,\n value,\n}: {\n field: Field | TabAsField\n value: unknown\n}): boolean {\n if (value === null || typeof value === 'undefined' || !fieldAffectsData(field)) {\n return false\n }\n\n if (field.type === 'array' || field.type === 'blocks') {\n // Form state may use a numeric row count, while submitted values use arrays.\n return !(Array.isArray(value) || typeof value === 'number')\n }\n\n if (field.type === 'number') {\n // Only hasMany number fields may receive arrays.\n return typeof value === 'object' && !(field.hasMany && Array.isArray(value))\n }\n\n if ((field.type === 'relationship' || field.type === 'upload') && field.hasMany) {\n // HasMany relationships/uploads may receive arrays or one valid polymorphic value.\n if (typeof value !== 'object' || Array.isArray(value)) {\n return false\n }\n\n const relationshipValue = value as Record<PropertyKey, unknown>\n const valuePrototype = Object.getPrototypeOf(value)\n const isSinglePolymorphicRelationshipValue =\n Array.isArray(field.relationTo) &&\n (valuePrototype === null || valuePrototype === Object.prototype) &&\n Object.hasOwn(relationshipValue, 'relationTo') &&\n Object.hasOwn(relationshipValue, 'value') &&\n Reflect.ownKeys(relationshipValue).length === 2 &&\n typeof relationshipValue.relationTo === 'string' &&\n field.relationTo.includes(relationshipValue.relationTo) &&\n (typeof relationshipValue.value === 'string' || typeof relationshipValue.value === 'number')\n\n return !isSinglePolymorphicRelationshipValue\n }\n\n return false\n}\n"],"names":["MissingEditorProp","validateBlocksFilterOptions","deepMergeWithSourceArrays","getTranslatedLabel","isolateObjectProperty","fieldAffectsData","fieldShouldBeLocalized","tabHasName","getFieldPaths","flattenValidationData","getExistingRowDoc","traverseFields","buildFieldLabel","parentLabel","label","capitalizedLabel","charAt","toUpperCase","slice","promise","id","blockData","blockFields","collection","context","data","doc","docWithLocales","errors","field","fieldIndex","fieldLabelPath","global","isValidationOperation","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","siblingFields","skipHooks","skipValidation","submittedTopLevelFieldNames","indexPath","path","schemaPath","index","localization","payload","config","defaultLocale","operationLocale","locale","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","passesCondition","admin","condition","user","isOutsideSubmittedFieldScope","undefined","has","skipValidationFromHere","shouldSkipValidationForLocalizedFallback","includes","type","name","hooks","beforeChange","hook","hookedValue","originalDoc","previousSiblingDoc","previousValue","value","hasInvalidFieldValueShape","push","i18n","message","t","validate","valueToValidate","isLocaleKeyedValue","Array","isArray","localizedValuesToValidate","localeCodes","length","jsonError","JSON","parse","e","validateFn","validationResult","failedLocale","validationData","validationSiblingData","validationReq","localeContext","fields","collectionSlug","slug","event","preferences","filterOptionsError","filterOptions","invalidBlockSlugs","rowIndex","block","blockType","blockConfigOrSlug","blocks","find","blockFromField","blockConfig","blockLabelPath","labels","singular","fieldLabel","localeData","submittedValue","isAllLocales","existingValue","fieldValue","Object","keys","rows","promises","forEach","row","localized","Promise","all","rowSiblingDoc","rowSiblingDocWithLocales","blockTypeToMatch","curBlock","groupSiblingData","groupSiblingDoc","groupSiblingDocWithLocales","isNamedGroup","fallbackLabel","coordinates","parseFloat","editor","Error","tabSiblingData","tabSiblingDoc","tabSiblingDocWithLocales","isNamedTab","tabs","tab","hasMany","relationshipValue","valuePrototype","getPrototypeOf","isSinglePolymorphicRelationshipValue","relationTo","prototype","hasOwn","Reflect","ownKeys"],"mappings":"AAOA,SAASA,iBAAiB,QAAQ,2BAA0B;AAC5D,SAA8BC,2BAA2B,QAAQ,oBAAmB;AACpF,SAASC,yBAAyB,QAAQ,kCAAiC;AAC3E,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,UAAU,QAAQ,wBAAuB;AAC5F,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,SAASC,gBAAgBC,WAAmB,EAAEC,KAAyB;IACrE,IAAI,CAACA,OAAO;QACV,OAAOD;IACT;IACA,MAAME,mBAAmBD,MAAME,MAAM,CAAC,GAAGC,WAAW,KAAKH,MAAMI,KAAK,CAAC;IACrE,OAAOL,eAAeE,mBAClB,GAAGF,YAAY,GAAG,EAAEE,kBAAkB,GACtCA,oBAAoBF;AAC1B;AA0CA,oEAAoE;AACpE,kBAAkB;AAClB,wBAAwB;AACxB,kBAAkB;AAClB,+BAA+B;AAC/B,yCAAyC;AACzC,sBAAsB;AAEtB,OAAO,MAAMM,UAAU,OAAO,EAC5BC,EAAE,EACFC,SAAS,EACTC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,cAAc,EACdC,MAAM,EACNC,KAAK,EACLC,UAAU,EACVC,cAAc,EACdC,MAAM,EACNC,qBAAqB,EACrBC,kBAAkB,EAClBC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,WAAW,EACXC,UAAU,EACVC,qBAAqB,EACrBC,aAAa,EACbC,SAAS,EACTC,cAAc,EACdC,2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AA,MAAMC,OAAO,CAACV,UAAU,OAAOA,UAAU,QAAO;IAC3D;IAEA,IAAIzD,MAAMgD,IAAI,KAAK,UAAU;QAC3B,iDAAiD;QACjD,OAAO,OAAOS,UAAU,YAAY,CAAEzD,CAAAA,MAAMuI,OAAO,IAAIrE,MAAMC,OAAO,CAACV,MAAK;IAC5E;IAEA,IAAI,AAACzD,CAAAA,MAAMgD,IAAI,KAAK,kBAAkBhD,MAAMgD,IAAI,KAAK,QAAO,KAAMhD,MAAMuI,OAAO,EAAE;QAC/E,mFAAmF;QACnF,IAAI,OAAO9E,UAAU,YAAYS,MAAMC,OAAO,CAACV,QAAQ;YACrD,OAAO;QACT;QAEA,MAAM+E,oBAAoB/E;QAC1B,MAAMgF,iBAAiB9B,OAAO+B,cAAc,CAACjF;QAC7C,MAAMkF,uCACJzE,MAAMC,OAAO,CAACnE,MAAM4I,UAAU,KAC7BH,CAAAA,mBAAmB,QAAQA,mBAAmB9B,OAAOkC,SAAS,AAAD,KAC9DlC,OAAOmC,MAAM,CAACN,mBAAmB,iBACjC7B,OAAOmC,MAAM,CAACN,mBAAmB,YACjCO,QAAQC,OAAO,CAACR,mBAAmBlE,MAAM,KAAK,KAC9C,OAAOkE,kBAAkBI,UAAU,KAAK,YACxC5I,MAAM4I,UAAU,CAAC7F,QAAQ,CAACyF,kBAAkBI,UAAU,KACrD,CAAA,OAAOJ,kBAAkB/E,KAAK,KAAK,YAAY,OAAO+E,kBAAkB/E,KAAK,KAAK,QAAO;QAE5F,OAAO,CAACkF;IACV;IAEA,OAAO;AACT"}
@@ -9,6 +9,7 @@ type Args = {
9
9
  * Data of the nearest parent block. If no parent block exists, this will be the `undefined`
10
10
  */
11
11
  blockData?: JsonObject;
12
+ blockFields?: Field[];
12
13
  collection: null | SanitizedCollectionConfig;
13
14
  context: RequestContext;
14
15
  data: JsonObject;
@@ -63,6 +64,6 @@ type Args = {
63
64
  * - Transform data for storage
64
65
  * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.
65
66
  */
66
- export declare const traverseFields: ({ id, blockData, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args) => Promise<void>;
67
+ export declare const traverseFields: ({ id, blockData, blockFields, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args) => Promise<void>;
67
68
  export {};
68
69
  //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/beforeChange/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAI9D,KAAK,IAAI,GAAG;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,IAAI,GAAG,yBAAyB,CAAA;IAC5C,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB;;OAEG;IACH,GAAG,EAAE,UAAU,CAAA;IACf;;OAEG;IACH,cAAc,EAAE,UAAU,CAAA;IAC1B,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B,MAAM,EAAE,IAAI,GAAG,qBAAqB,CAAA;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,kBAAkB,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAA;IAClD,SAAS,EAAE,cAAc,CAAA;IACzB,cAAc,EAAE,OAAO,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,WAAW,EAAE,UAAU,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAA;IACtB;;OAEG;IACH,qBAAqB,EAAE,UAAU,CAAA;IACjC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAClD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,oWA2BxB,IAAI,KAAG,OAAO,CAAC,IAAI,CAuCrB,CAAA"}
1
+ {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/beforeChange/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,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AE,UAAU,CAAA;IACjC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAClD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,iXA4BxB,IAAI,KAAG,OAAO,CAAC,IAAI,CAwCrB,CAAA"}
@@ -6,12 +6,13 @@ import { promise } from './promise.js';
6
6
  * - Validate data
7
7
  * - Transform data for storage
8
8
  * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.
9
- */ export const traverseFields = async ({ id, blockData, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames })=>{
9
+ */ export const traverseFields = async ({ id, blockData, blockFields, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames })=>{
10
10
  const promises = [];
11
11
  fields.forEach((field, fieldIndex)=>{
12
12
  promises.push(promise({
13
13
  id,
14
14
  blockData,
15
+ blockFields,
15
16
  collection,
16
17
  context,
17
18
  data,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/traverseFields.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { FieldOperation, JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Field, TabAsField } from '../../config/types.js'\n\nimport { promise } from './promise.js'\n\ntype Args = {\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: JsonObject\n /**\n * The original data (not modified by any hooks)\n */\n doc: JsonObject\n /**\n * The original data with locales (not modified by any hooks)\n */\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n fields: (Field | TabAsField)[]\n global: null | SanitizedGlobalConfig\n id?: number | string\n isValidationOperation?: boolean\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: FieldOperation\n overrideAccess: boolean\n parentIndexPath: string\n /**\n * @todo make required in v4.0\n */\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 /**\n * The original siblingData with locales (not modified by any hooks)\n */\n siblingDocWithLocales: JsonObject\n skipHooks?: boolean\n skipValidation?: boolean\n submittedTopLevelFieldNames?: ReadonlySet<string>\n}\n\n/**\n * This function is responsible for the following actions, in order:\n * - Run condition\n * - Execute field hooks\n * - Validate data\n * - Transform data for storage\n * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.\n */\nexport const traverseFields = async ({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath,\n fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n skipHooks,\n skipValidation,\n submittedTopLevelFieldNames,\n}: Args): Promise<void> => {\n const promises: Promise<void>[] = []\n\n fields.forEach((field, fieldIndex) => {\n promises.push(\n promise({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n isValidationOperation: isValidationOperation!,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized: parentIsLocalized!,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields: fields,\n skipHooks: skipHooks!,\n skipValidation: skipValidation!,\n submittedTopLevelFieldNames,\n }),\n )\n })\n\n await Promise.all(promises)\n}\n"],"names":["promise","traverseFields","id","blockData","collection","context","data","doc","docWithLocales","errors","fieldLabelPath","fields","global","isValidationOperation","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","skipHooks","skipValidation","submittedTopLevelFieldNames","promises","forEach","field","fieldIndex","push","siblingFields","Promise","all"],"mappings":"AAOA,SAASA,OAAO,QAAQ,eAAc;AAsDtC;;;;;;;CAOC,GACD,OAAO,MAAMC,iBAAiB,OAAO,EACnCC,EAAE,EACFC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,cAAc,EACdC,MAAM,EACNC,cAAc,EACdC,MAAM,EACNC,MAAM,EACNC,qBAAqB,EACrBC,kBAAkB,EAClBC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,WAAW,EACXC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,cAAc,EACdC,2BAA2B,EACtB;IACL,MAAMC,WAA4B,EAAE;IAEpCjB,OAAOkB,OAAO,CAAC,CAACC,OAAOC;QACrBH,SAASI,IAAI,CACXhC,QAAQ;YACNE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAqB;YACAC;YACArB;YACAE;YACAC,uBAAuBA;YACvBC;YACAC;YACAC;YACAC;YACAC,mBAAmBA;YACnBC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAS,eAAetB;YACfc,WAAWA;YACXC,gBAAgBA;YAChBC;QACF;IAEJ;IAEA,MAAMO,QAAQC,GAAG,CAACP;AACpB,EAAC"}
1
+ {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/traverseFields.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { FieldOperation, JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Field, TabAsField } from '../../config/types.js'\n\nimport { promise } from './promise.js'\n\ntype Args = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n blockFields?: Field[]\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: JsonObject\n /**\n * The original data (not modified by any hooks)\n */\n doc: JsonObject\n /**\n * The original data with locales (not modified by any hooks)\n */\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n fields: (Field | TabAsField)[]\n global: null | SanitizedGlobalConfig\n id?: number | string\n isValidationOperation?: boolean\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: FieldOperation\n overrideAccess: boolean\n parentIndexPath: string\n /**\n * @todo make required in v4.0\n */\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 /**\n * The original siblingData with locales (not modified by any hooks)\n */\n siblingDocWithLocales: JsonObject\n skipHooks?: boolean\n skipValidation?: boolean\n submittedTopLevelFieldNames?: ReadonlySet<string>\n}\n\n/**\n * This function is responsible for the following actions, in order:\n * - Run condition\n * - Execute field hooks\n * - Validate data\n * - Transform data for storage\n * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.\n */\nexport const traverseFields = async ({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath,\n fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n skipHooks,\n skipValidation,\n submittedTopLevelFieldNames,\n}: Args): Promise<void> => {\n const promises: Promise<void>[] = []\n\n fields.forEach((field, fieldIndex) => {\n promises.push(\n promise({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n isValidationOperation: isValidationOperation!,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized: parentIsLocalized!,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields: fields,\n skipHooks: skipHooks!,\n skipValidation: skipValidation!,\n submittedTopLevelFieldNames,\n }),\n )\n })\n\n await Promise.all(promises)\n}\n"],"names":["promise","traverseFields","id","blockData","blockFields","collection","context","data","doc","docWithLocales","errors","fieldLabelPath","fields","global","isValidationOperation","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","skipHooks","skipValidation","submittedTopLevelFieldNames","promises","forEach","field","fieldIndex","push","siblingFields","Promise","all"],"mappings":"AAOA,SAASA,OAAO,QAAQ,eAAc;AAuDtC;;;;;;;CAOC,GACD,OAAO,MAAMC,iBAAiB,OAAO,EACnCC,EAAE,EACFC,SAAS,EACTC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,cAAc,EACdC,MAAM,EACNC,cAAc,EACdC,MAAM,EACNC,MAAM,EACNC,qBAAqB,EACrBC,kBAAkB,EAClBC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,WAAW,EACXC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,cAAc,EACdC,2BAA2B,EACtB;IACL,MAAMC,WAA4B,EAAE;IAEpCjB,OAAOkB,OAAO,CAAC,CAACC,OAAOC;QACrBH,SAASI,IAAI,CACXjC,QAAQ;YACNE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAqB;YACAC;YACArB;YACAE;YACAC,uBAAuBA;YACvBC;YACAC;YACAC;YACAC;YACAC,mBAAmBA;YACnBC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAS,eAAetB;YACfc,WAAWA;YACXC,gBAAgBA;YAChBC;QACF;IAEJ;IAEA,MAAMO,QAAQC,GAAG,CAACP;AACpB,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/globals/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,qBAAqB,EACrB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAClG,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACX,iBAAiB,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EACV,cAAc,EAC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AI,GAC3C,iBAAiB,GACjB,oBAAoB,CAAC,KAAK,CAAC,CAChC,EACD,QAAQ,CACT,CAAA;AAED,MAAM,WAAW,qBACf,SACE,IAAI,CACF,YAAY,EACV,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,OAAO,GACP,OAAO,GACP,MAAM,GACN,UAAU,CACb,EACD,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;IAC5D,UAAU,EAAE,IAAI,CAAA;IAChB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAA;IACrF,UAAU,EAAE,mBAAmB,CAAA;IAC/B,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC7B;;;OAGG;IACH,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;IAC5B,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,CAAC,EAAE,uBAAuB,CAAA;CACnC;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/B,OAAO,CAAC,EACJ;QACE,CAAC,IAAI,EAAE,MAAM,GAAG;YACd,iBAAiB,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;YACtC,IAAI,EAAE,iBAAiB,CAAA;YACvB,WAAW,CAAC,EAAE,iBAAiB,CAAA;SAChC,CAAA;KACF,GACD,KAAK,CAAA;CACV,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { IsAny } from 'ts-essentials'\n\nimport type {\n Access,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n SharedAdminComponents,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Authorship, SanitizedAuthorship } from '../../fields/baseFields/authorship/types.js'\nimport type { Field, FlattenedField } from '../../fields/config/types.js'\nimport type {\n GeneratedTypes,\n GlobalAdminCustom,\n GlobalCustom,\n GlobalSlug,\n RequestContext,\n TypedGlobal,\n TypedGlobalSelect,\n} from '../../index.js'\nimport type {\n FieldOperation,\n PayloadRequest,\n SelectIncludeType,\n Where,\n WithSelectFn,\n} from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug]\n\nexport type SelectFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobalSelect[TSlug]\n\nexport type GlobalAccess<TData = any> = {\n read?: Access<TData>\n readVersions?: Access<TData>\n update?: Access<TData>\n /**\n * Controls on-demand validation for this global.\n * Falls back to `update` access when omitted.\n * The access function receives `req.operation === 'validate'`.\n * @see https://payloadcms.com/docs/validation/overview#access-control-and-hooks\n */\n validate?: Access<TData>\n}\n\n/**\n * Global slugs that do not have drafts enabled.\n * Detects globals without drafts by checking for the absence of the `_status` field.\n */\nexport type GlobalsWithoutDrafts = {\n [TSlug in GlobalSlug]: DataFromGlobalSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[GlobalSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on global configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on globals without drafts.\n */\nexport type DraftFlagFromGlobalSlug<TSlug extends GlobalSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends GlobalsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this global does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\ntype GlobalChangeOperation = Extract<FieldOperation, 'update' | 'validate'>\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n data: any\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: 'update'\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n previousDoc: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query?: Where\n req: PayloadRequest\n}) => any\n\nexport type HookOperationType = 'countVersions' | 'read' | 'restoreVersion' | 'update'\n\nexport type BeforeOperationHook = (args: {\n args?: any\n context: RequestContext\n /**\n * The Global which this hook is being run on\n * */\n global: SanitizedGlobalConfig\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: SharedAdminComponents\n /** Extension point to add your custom data. Available in server and client. */\n custom?: GlobalAdminCustom\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Specify a navigational group for globals in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the global from the sidebar, command palette, and dashboard collection cards.\n * This does not disable routes or change access control.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\ntype GlobalHooks = {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n}\n\nexport type GlobalConfig<TSlug extends GlobalSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same global multiple times.\n */\n _sanitized?: boolean\n access?: GlobalAccess\n admin?: GlobalAdminOptions\n /**\n * Automatically track the user that created and last updated this global via\n * polymorphic `createdBy` / `updatedBy` relationship fields to your auth collections.\n *\n * Use `true` (default) to enable both, `false` to disable both, or an object to\n * toggle each field independently, e.g. `{ updatedBy: false }`.\n *\n * @default true\n */\n authorship?: Authorship | boolean\n /** Extension point to add your custom data. Server only. */\n custom?: GlobalCustom\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n name?: string\n }\n | false\n hooks?: GlobalHooks\n label?: LabelFunction | StaticLabel\n /** Read-only Markdown instructions included in this global's MCP and CLI schema responses. */\n llmInstructions?: string\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: boolean | IncomingGlobalVersions\n} & Pick<\n WithSelectFn<\n IsAny<SelectFromGlobalSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromGlobalSlug<TSlug>\n >,\n 'select'\n>\n\nexport interface SanitizedGlobalConfig\n extends Omit<\n GlobalConfig,\n | '_sanitized'\n | 'access'\n | 'admin'\n | 'authorship'\n | 'custom'\n | 'endpoints'\n | 'hooks'\n | 'label'\n | 'slug'\n | 'versions'\n >,\n Required<Pick<GlobalConfig, 'admin' | 'custom' | 'label'>> {\n _sanitized: true\n access: Required<Pick<GlobalAccess, 'read' | 'readVersions' | 'update' | 'validate'>>\n authorship: SanitizedAuthorship\n endpoints: Endpoint[] | false\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n hooks: Required<GlobalHooks>\n slug: GlobalSlug\n versions?: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAgUrD,WAWC"}
1
+ {"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { IsAny } from 'ts-essentials'\n\nimport type {\n Access,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n SharedAdminComponents,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Authorship, SanitizedAuthorship } from '../../fields/baseFields/authorship/types.js'\nimport type { Field, FlattenedField } from '../../fields/config/types.js'\nimport type {\n GeneratedTypes,\n GlobalAdminCustom,\n GlobalCustom,\n GlobalSlug,\n RequestContext,\n TypedGlobal,\n TypedGlobalSelect,\n} from '../../index.js'\nimport type {\n FieldOperation,\n PayloadRequest,\n SelectIncludeType,\n Where,\n WithSelectFn,\n} from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug]\n\nexport type SelectFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobalSelect[TSlug]\n\nexport type GlobalAccess<TData = any> = {\n read?: Access<TData>\n readVersions?: Access<TData>\n update?: Access<TData>\n /**\n * Controls on-demand validation for this global.\n * Falls back to `update` access when omitted.\n * The access function receives `req.operation === 'validate'`.\n * @see https://payloadcms.com/docs/validation/overview#access-control-and-hooks\n */\n validate?: Access<TData>\n}\n\n/**\n * Global slugs that do not have drafts enabled.\n * Detects globals without drafts by checking for the absence of the `_status` field.\n */\nexport type GlobalsWithoutDrafts = {\n [TSlug in GlobalSlug]: DataFromGlobalSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[GlobalSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on global configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on globals without drafts.\n */\nexport type DraftFlagFromGlobalSlug<TSlug extends GlobalSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends GlobalsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this global does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\ntype GlobalChangeOperation = Extract<FieldOperation, 'update' | 'validate'>\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n data: any\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: 'update'\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n previousDoc: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query?: Where\n req: PayloadRequest\n}) => any\n\nexport type HookOperationType = 'countVersions' | 'read' | 'restoreVersion' | 'update'\n\nexport type BeforeOperationHook = (args: {\n args?: any\n context: RequestContext\n /**\n * The Global which this hook is being run on\n * */\n global: SanitizedGlobalConfig\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: SharedAdminComponents\n /** Extension point to add your custom data. Available in server and client. */\n custom?: GlobalAdminCustom\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Specify a navigational group for globals in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the global from the sidebar, command palette, and dashboard collection cards.\n * This does not disable routes or change access control.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\ntype GlobalHooks = {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n}\n\nexport type GlobalConfig<TSlug extends GlobalSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same global multiple times.\n */\n _sanitized?: boolean\n access?: GlobalAccess\n admin?: GlobalAdminOptions\n /**\n * Automatically track the user that created and last updated this global via\n * polymorphic `createdBy` / `updatedBy` relationship fields to your auth collections.\n *\n * Use `true` (default) to enable both, `false` to disable both, or an object to\n * toggle each field independently, e.g. `{ updatedBy: false }`.\n *\n * @default true\n */\n authorship?: Authorship | boolean\n /** Extension point to add your custom data. Server only. */\n custom?: GlobalCustom\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n name?: string\n }\n | false\n hooks?: GlobalHooks\n label?: LabelFunction | StaticLabel\n /** Read-only Markdown instructions included in this global's MCP and CLI schema responses. */\n llmInstructions?: string\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: boolean | IncomingGlobalVersions\n} & Pick<\n WithSelectFn<\n IsAny<SelectFromGlobalSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromGlobalSlug<TSlug>\n >,\n 'select'\n>\n\nexport interface SanitizedGlobalConfig\n extends\n Omit<\n GlobalConfig,\n | '_sanitized'\n | 'access'\n | 'admin'\n | 'authorship'\n | 'custom'\n | 'endpoints'\n | 'hooks'\n | 'label'\n | 'slug'\n | 'versions'\n >,\n Required<Pick<GlobalConfig, 'admin' | 'custom' | 'label'>> {\n _sanitized: true\n access: Required<Pick<GlobalAccess, 'read' | 'readVersions' | 'update' | 'validate'>>\n authorship: SanitizedAuthorship\n endpoints: Endpoint[] | false\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n hooks: Required<GlobalHooks>\n slug: GlobalSlug\n versions?: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAiUrD,WAWC"}
@@ -2285,6 +2285,10 @@ type MigrationTemplateArgs = {
2285
2285
  type GenerateSchemaArgs = {
2286
2286
  log?: boolean;
2287
2287
  outputFile?: string;
2288
+ /**
2289
+ * Format the generated schema with the project's oxfmt, falling back to Prettier.
2290
+ * @default true
2291
+ */
2288
2292
  prettify?: boolean;
2289
2293
  };
2290
2294
  type GenerateSchema = (args?: GenerateSchemaArgs) => Promise<{
@@ -14746,6 +14750,7 @@ type Args$a = {
14746
14750
  * Data of the nearest parent block. If no parent block exists, this will be the `undefined`
14747
14751
  */
14748
14752
  blockData?: JsonObject;
14753
+ blockFields?: Field[];
14749
14754
  collection: null | SanitizedCollectionConfig;
14750
14755
  context: RequestContext;
14751
14756
  data: JsonObject;
@@ -14800,7 +14805,7 @@ type Args$a = {
14800
14805
  * - Transform data for storage
14801
14806
  * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.
14802
14807
  */
14803
- declare const traverseFields$2: ({ id, blockData, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args$a) => Promise<void>;
14808
+ declare const traverseFields$2: ({ id, blockData, blockFields, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args$a) => Promise<void>;
14804
14809
 
14805
14810
  type Args$9<T> = {
14806
14811
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,UAAU,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EACV,sBAAsB,EACtB,gCAAgC,EAChC,UAAU,EACV,kBAAkB,EACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,OAAO,MAA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,CAAC,CAAA;AAEjC,MAAM,MAAM,kCAAkC,CAC5C,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,UAAU,IACxB,OAAO,SAAS,UAAU,GAC1B,uBAAuB,CAAC,gCAAgC,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GACzE,gCAAgC,CAAC,KAAK,CAAC,CAAA;AAE3C,MAAM,MAAM,yBAAyB,CACnC,KAAK,SAAS,UAAU,EACxB,OAAO,SAAS,UAAU,IACxB,OAAO,SAAS,UAAU,GAC1B,uBAAuB,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAC3D,kBAAkB,CAAC,KAAK,CAAC,CAAA;AAE7B,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAEzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAE5D,MAAM,MAAM,qBAAqB,GAAG;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAAA;AAEnE,MAAM,MAAM,oBAAoB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,OAAO,CAC9D,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CACrC,GACC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEtC,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["import type { I18n, TFunction } from '@payloadcms/translations'\nimport type DataLoader from 'dataloader'\nimport type { OptionalKeys, RequiredKeys } from 'ts-essentials'\nimport type { URL } from 'url'\n\nimport type { ServerAdapter } from '../admin/adapters/server.js'\nimport type {\n DataFromCollectionSlug,\n QueryDraftDataFromCollectionSlug,\n TypeWithID,\n TypeWithTimestamps,\n} from '../collections/config/types.js'\nimport type payload from '../index.js'\nimport type {\n AuthenticatedUser,\n CollectionSlug,\n DataFromGlobalSlug,\n GlobalSlug,\n Payload,\n RequestContext,\n TypedCollectionJoins,\n TypedCollectionSelect,\n TypedFallbackLocale,\n TypedLocale,\n} from '../index.js'\nimport type { File } from '../uploads/types.js'\nimport type { HasManyRelationshipOperator, Operator } from './constants.js'\nexport type { TypeWithID } from '../collections/config/types.js'\nexport type { Payload } from '../index.js'\n\nexport interface PayloadRequestAPI {\n GraphQL: true\n local: true\n REST: true\n}\n\nexport type CustomPayloadRequestProperties = {\n context: RequestContext\n /** The locale that should be used for a field when it is not translated to the requested locale */\n fallbackLocale?: TypedFallbackLocale\n /**\n * Set by Payload only while running a collection's `read` access function for a\n * dynamic file transformation request. Restored to its prior value immediately\n * after that access check completes; never set for ordinary reads.\n */\n fileTransform?: true\n i18n: I18n\n /**\n * The requested locale if specified\n * Only available for localized collections\n *\n * Suppressing warning below as it is a valid use case - won't be an issue if generated types exist\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n locale?: 'all' | TypedLocale\n /**\n * The payload object\n */\n payload: typeof payload\n /**\n * The context in which the request is being made\n */\n payloadAPI: keyof PayloadRequestAPI\n /** Optimized document loader */\n payloadDataLoader: {\n /**\n * Wraps `payload.find` with a cache to deduplicate requests\n * @experimental This is may be replaced by a more robust cache strategy in future versions\n * By calling this method with the same arguments many times in one request, it will only be handled one time\n * const result = await req.payloadDataLoader.find({\n * collection,\n * req,\n * where: findWhere,\n * })\n */\n find: Payload['find']\n } & DataLoader<string, TypeWithID>\n /** Resized versions of the image that was uploaded during this request */\n payloadUploadSizes?: Record<string, Buffer>\n /** Query params on the request */\n query: Record<string, unknown>\n /** Any response headers that are required to be set when a response is sent */\n responseHeaders?: Headers\n /** The route parameters\n * @example\n * /:collection/:id -> /posts/123\n * { collection: 'posts', id: '123' }\n */\n routeParams?: Record<string, unknown>\n /**\n * Framework abstraction for server-only navigation, cookies, and headers APIs.\n * Populated by the framework adapter (e.g. `@payloadcms/next`). Plugins that\n * have access to `req` should call methods here (`req.server.unauthorized()`,\n * `req.server.redirect(...)`) instead of importing from `next/navigation` or\n * `next/headers` directly. Optional because non-framework contexts (jobs,\n * scripts, tests) construct requests without a server adapter.\n */\n server?: ServerAdapter\n /** Translate function - duplicate of i18n.t */\n t: TFunction\n /**\n * Identifier for the database transaction for interactions in a single, all-or-nothing operation.\n * Can also be used to ensure consistency when multiple operations try to create a transaction concurrently on the same request.\n */\n transactionID?: number | Promise<number | string> | string\n /** The signed-in user */\n user: AuthenticatedUser | null\n} & Pick<\n URL,\n 'hash' | 'host' | 'href' | 'origin' | 'pathname' | 'port' | 'protocol' | 'search' | 'searchParams'\n>\ntype PayloadRequestData = {\n /**\n * Data from the request body\n *\n * Within Payload operations, i.e. hooks, data will be there\n * BUT in custom endpoints it will not be, you will need to\n * use either:\n * 1. `const data = await req.json()`\n *\n * 2. import { addDataAndFileToRequest } from 'payload'\n * `await addDataAndFileToRequest(req)`\n *\n * You should not expect this object to be the document data. It is the request data.\n * */\n data?: JsonObject\n /** The file on the request, same rules apply as the `data` property */\n file?: {\n uploadReference?: unknown\n } & File\n /** All files from multipart form data, keyed by field name */\n files?: Record<string, File | File[]>\n}\nexport interface PayloadRequest\n extends CustomPayloadRequestProperties,\n Partial<Request>,\n PayloadRequestData {\n headers: Request['headers']\n /** The active Payload operation. */\n operation?: Operation\n}\n\nexport type { HasManyRelationshipOperator, Operator }\n\n// Makes it so things like passing new Date() will error\nexport type JsonValue = JsonArray | JsonObject | unknown //Date | JsonArray | JsonObject | boolean | null | number | string // TODO: Evaluate proper, strong type for this\n\nexport type JsonArray = Array<JsonValue>\n\nexport interface JsonObject {\n [key: string]: any\n}\n\nexport type WhereField = {\n // any json-serializable value, including a nested query for supported relationship operators\n [key in Operator]?: JsonValue\n}\n\nexport type Where = {\n [key: string]: Where[] | WhereField\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n and?: Where[]\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n or?: Where[]\n}\n\nexport type Sort = Array<string> | string\n\ntype SerializableValue = boolean | number | object | string\nexport type DefaultValue =\n | ((args: {\n locale?: TypedLocale\n req: PayloadRequest\n user: PayloadRequest['user']\n }) => Promise<SerializableValue> | SerializableValue)\n | SerializableValue\n\n/**\n * Applies pagination for join fields for including collection relationships\n */\nexport type JoinQuery<TSlug extends CollectionSlug = string> =\n TypedCollectionJoins[TSlug] extends Record<string, string>\n ?\n | false\n | Partial<{\n [K in keyof TypedCollectionJoins[TSlug]]:\n | {\n count?: boolean\n limit?: number\n page?: number\n sort?: string\n where?: Where\n }\n | false\n }>\n : never\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Document = any\n\n/**\n * Operations exposed to access control and request lifecycle functions.\n *\n * On-demand validation uses the first-class `validate` value rather than substituting `create`\n * or `update`.\n */\nexport type Operation = 'create' | 'delete' | 'read' | 'update' | 'validate'\nexport type FieldOperation = Exclude<Operation, 'delete'>\nexport type BeforeValidateOperation = Extract<FieldOperation, 'create' | 'update' | 'validate'>\nexport type VersionOperations = 'readVersions'\nexport type AuthOperations = 'unlock'\nexport type AllOperations = AuthOperations | Operation | VersionOperations\n\nexport function docHasTimestamps(doc: any): doc is TypeWithTimestamps {\n return doc?.createdAt && doc?.updatedAt\n}\n\nexport type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N // This is a commonly used trick to detect 'any'\nexport type IsAny<T> = IfAny<T, true, false>\nexport type ReplaceAny<T, DefaultType> = IsAny<T> extends true ? DefaultType : T\n\nexport type SelectIncludeType = {\n [k: string]: SelectIncludeType | true\n}\n\nexport type SelectExcludeType = {\n [k: string]: false | SelectExcludeType\n}\n\nexport type SelectMode = 'exclude' | 'include'\n\nexport type SelectType = SelectExcludeType | SelectIncludeType\n\n/**\n * Operations that invoke an entity-level `select` function.\n *\n * Narrower than `HookOperationType`: `select` runs only for read- and\n * write-path operations that materialize a document (`create`, `delete`,\n * `read`, `restoreVersion`, `update`). Operations like `autosave`, `count`,\n * `countVersions`, `forgotPassword`, `login`, `readDistinct`, `refresh`, and\n * `resetPassword` do not invoke `select` and are intentionally excluded.\n */\nexport type SelectFnOperation = 'create' | 'delete' | 'read' | 'restoreVersion' | 'update'\n\nexport type SelectFnArgs = {\n operation: SelectFnOperation\n req: PayloadRequest\n /** The caller's `select` arg, or `undefined` if not provided. */\n select?: SelectType\n}\n\nexport type SelectFn<TSelect extends SelectType = SelectType> = (\n args: SelectFnArgs,\n) => TSelect | undefined\n\n/**\n * Shared shape for the entity-level `select` config used by Collections and Globals.\n * The JSDoc on the `select` property is the single source of truth — pick from this\n * type when defining the config:\n *\n * & Pick<WithSelectFn<...>, 'select'>\n */\nexport type WithSelectFn<TSelect extends SelectType = SelectType> = {\n /**\n * Entity-level Select API configuration.\n *\n * A function that receives the current request context (`operation`, `req`,\n * the caller's `select`) and returns the final `select` to apply, replacing\n * the caller's. Return `undefined` to leave the caller's `select` unchanged.\n *\n * Useful to dynamically modify the caller's selection based on the request context:\n * - Forcing a field to be populated for reference within hooks / access control.\n * - Differentiating between API requests and admin panel requests, to optimize\n * the amount of data being queried in each case.\n *\n * Note: per-document data is not available — this runs before the read.\n *\n * @see https://payloadcms.com/docs/queries/select\n */\n select?: SelectFn<TSelect>\n}\n\nexport type ApplyDisableErrors<T, DisableErrors = false> = false extends DisableErrors\n ? T\n : null | T\n\nexport type TransformDataWithSelect<\n Data extends Record<string, any>,\n Select extends SelectType,\n> = Select extends never\n ? Data\n : string extends keyof Select\n ? Data\n : // START Handle types when they aren't generated\n // For example in any package in this repository outside of tests / plugins\n // This stil gives us autocomplete when using include select mode, i.e select: {title :true} returns type {title: any, id: string | number}\n string extends keyof Omit<Data, 'id'>\n ? Select extends SelectIncludeType\n ? {\n [K in Data extends TypeWithID ? 'id' | keyof Select : keyof Select]: K extends 'id'\n ? number | string\n : unknown\n }\n : Data\n : // END Handle types when they aren't generated\n // Handle include mode\n Select extends SelectIncludeType\n ? {\n [K in keyof Data as K extends keyof Select\n ? Select[K] extends object | true\n ? K\n : never\n : // select 'id' always\n K extends 'id'\n ? K\n : never]: Data[K]\n }\n : // Handle exclude mode\n {\n [K in keyof Data as K extends keyof Select\n ? Select[K] extends object | undefined\n ? K\n : never\n : K]: Data[K]\n }\n\nexport type TransformCollectionWithSelect<\n TSlug extends CollectionSlug,\n TSelect extends SelectType,\n> = TSelect extends SelectType\n ? TransformDataWithSelect<DataFromCollectionSlug<TSlug>, TSelect>\n : DataFromCollectionSlug<TSlug>\n\nexport type DraftTransformCollectionWithSelect<\n TSlug extends CollectionSlug,\n TSelect extends SelectType,\n> = TSelect extends SelectType\n ? TransformDataWithSelect<QueryDraftDataFromCollectionSlug<TSlug>, TSelect>\n : QueryDraftDataFromCollectionSlug<TSlug>\n\nexport type TransformGlobalWithSelect<\n TSlug extends GlobalSlug,\n TSelect extends SelectType,\n> = TSelect extends SelectType\n ? TransformDataWithSelect<DataFromGlobalSlug<TSlug>, TSelect>\n : DataFromGlobalSlug<TSlug>\n\nexport type PopulateType = Partial<TypedCollectionSelect>\n\nexport type { SharedLocalAPIOptions } from './operations.js'\n\nexport type ResolvedFilterOptions = { [collection: string]: Where }\n\nexport type PickPreserveOptional<T, K extends keyof T> = Partial<\n Pick<T, Extract<K, OptionalKeys<T>>>\n> &\n Pick<T, Extract<K, RequiredKeys<T>>>\n\nexport type MaybePromise<T> = Promise<T> | T\n"],"names":["docHasTimestamps","doc","createdAt","updatedAt"],"mappings":"AAqNA,OAAO,SAASA,iBAAiBC,GAAQ;IACvC,OAAOA,KAAKC,aAAaD,KAAKE;AAChC"}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["import type { I18n, TFunction } from '@payloadcms/translations'\nimport type DataLoader from 'dataloader'\nimport type { OptionalKeys, RequiredKeys } from 'ts-essentials'\nimport type { URL } from 'url'\n\nimport type { ServerAdapter } from '../admin/adapters/server.js'\nimport type {\n DataFromCollectionSlug,\n QueryDraftDataFromCollectionSlug,\n TypeWithID,\n TypeWithTimestamps,\n} from '../collections/config/types.js'\nimport type payload from '../index.js'\nimport type {\n AuthenticatedUser,\n CollectionSlug,\n DataFromGlobalSlug,\n GlobalSlug,\n Payload,\n RequestContext,\n TypedCollectionJoins,\n TypedCollectionSelect,\n TypedFallbackLocale,\n TypedLocale,\n} from '../index.js'\nimport type { File } from '../uploads/types.js'\nimport type { HasManyRelationshipOperator, Operator } from './constants.js'\nexport type { TypeWithID } from '../collections/config/types.js'\nexport type { Payload } from '../index.js'\n\nexport interface PayloadRequestAPI {\n GraphQL: true\n local: true\n REST: true\n}\n\nexport type CustomPayloadRequestProperties = {\n context: RequestContext\n /** The locale that should be used for a field when it is not translated to the requested locale */\n fallbackLocale?: TypedFallbackLocale\n /**\n * Set by Payload only while running a collection's `read` access function for a\n * dynamic file transformation request. Restored to its prior value immediately\n * after that access check completes; never set for ordinary reads.\n */\n fileTransform?: true\n i18n: I18n\n /**\n * The requested locale if specified\n * Only available for localized collections\n *\n * Suppressing warning below as it is a valid use case - won't be an issue if generated types exist\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n locale?: 'all' | TypedLocale\n /**\n * The payload object\n */\n payload: typeof payload\n /**\n * The context in which the request is being made\n */\n payloadAPI: keyof PayloadRequestAPI\n /** Optimized document loader */\n payloadDataLoader: {\n /**\n * Wraps `payload.find` with a cache to deduplicate requests\n * @experimental This is may be replaced by a more robust cache strategy in future versions\n * By calling this method with the same arguments many times in one request, it will only be handled one time\n * const result = await req.payloadDataLoader.find({\n * collection,\n * req,\n * where: findWhere,\n * })\n */\n find: Payload['find']\n } & DataLoader<string, TypeWithID>\n /** Resized versions of the image that was uploaded during this request */\n payloadUploadSizes?: Record<string, Buffer>\n /** Query params on the request */\n query: Record<string, unknown>\n /** Any response headers that are required to be set when a response is sent */\n responseHeaders?: Headers\n /** The route parameters\n * @example\n * /:collection/:id -> /posts/123\n * { collection: 'posts', id: '123' }\n */\n routeParams?: Record<string, unknown>\n /**\n * Framework abstraction for server-only navigation, cookies, and headers APIs.\n * Populated by the framework adapter (e.g. `@payloadcms/next`). Plugins that\n * have access to `req` should call methods here (`req.server.unauthorized()`,\n * `req.server.redirect(...)`) instead of importing from `next/navigation` or\n * `next/headers` directly. Optional because non-framework contexts (jobs,\n * scripts, tests) construct requests without a server adapter.\n */\n server?: ServerAdapter\n /** Translate function - duplicate of i18n.t */\n t: TFunction\n /**\n * Identifier for the database transaction for interactions in a single, all-or-nothing operation.\n * Can also be used to ensure consistency when multiple operations try to create a transaction concurrently on the same request.\n */\n transactionID?: number | Promise<number | string> | string\n /** The signed-in user */\n user: AuthenticatedUser | null\n} & Pick<\n URL,\n 'hash' | 'host' | 'href' | 'origin' | 'pathname' | 'port' | 'protocol' | 'search' | 'searchParams'\n>\ntype PayloadRequestData = {\n /**\n * Data from the request body\n *\n * Within Payload operations, i.e. hooks, data will be there\n * BUT in custom endpoints it will not be, you will need to\n * use either:\n * 1. `const data = await req.json()`\n *\n * 2. import { addDataAndFileToRequest } from 'payload'\n * `await addDataAndFileToRequest(req)`\n *\n * You should not expect this object to be the document data. It is the request data.\n * */\n data?: JsonObject\n /** The file on the request, same rules apply as the `data` property */\n file?: {\n uploadReference?: unknown\n } & File\n /** All files from multipart form data, keyed by field name */\n files?: Record<string, File | File[]>\n}\nexport interface PayloadRequest\n extends CustomPayloadRequestProperties, Partial<Request>, PayloadRequestData {\n headers: Request['headers']\n /** The active Payload operation. */\n operation?: Operation\n}\n\nexport type { HasManyRelationshipOperator, Operator }\n\n// Makes it so things like passing new Date() will error\nexport type JsonValue = JsonArray | JsonObject | unknown //Date | JsonArray | JsonObject | boolean | null | number | string // TODO: Evaluate proper, strong type for this\n\nexport type JsonArray = Array<JsonValue>\n\nexport interface JsonObject {\n [key: string]: any\n}\n\nexport type WhereField = {\n // any json-serializable value, including a nested query for supported relationship operators\n [key in Operator]?: JsonValue\n}\n\nexport type Where = {\n [key: string]: Where[] | WhereField\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n and?: Where[]\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n or?: Where[]\n}\n\nexport type Sort = Array<string> | string\n\ntype SerializableValue = boolean | number | object | string\nexport type DefaultValue =\n | ((args: {\n locale?: TypedLocale\n req: PayloadRequest\n user: PayloadRequest['user']\n }) => Promise<SerializableValue> | SerializableValue)\n | SerializableValue\n\n/**\n * Applies pagination for join fields for including collection relationships\n */\nexport type JoinQuery<TSlug extends CollectionSlug = string> =\n TypedCollectionJoins[TSlug] extends Record<string, string>\n ?\n | false\n | Partial<{\n [K in keyof TypedCollectionJoins[TSlug]]:\n | {\n count?: boolean\n limit?: number\n page?: number\n sort?: string\n where?: Where\n }\n | false\n }>\n : never\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Document = any\n\n/**\n * Operations exposed to access control and request lifecycle functions.\n *\n * On-demand validation uses the first-class `validate` value rather than substituting `create`\n * or `update`.\n */\nexport type Operation = 'create' | 'delete' | 'read' | 'update' | 'validate'\nexport type FieldOperation = Exclude<Operation, 'delete'>\nexport type BeforeValidateOperation = Extract<FieldOperation, 'create' | 'update' | 'validate'>\nexport type VersionOperations = 'readVersions'\nexport type AuthOperations = 'unlock'\nexport type AllOperations = AuthOperations | Operation | VersionOperations\n\nexport function docHasTimestamps(doc: any): doc is TypeWithTimestamps {\n return doc?.createdAt && doc?.updatedAt\n}\n\nexport type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N // This is a commonly used trick to detect 'any'\nexport type IsAny<T> = IfAny<T, true, false>\nexport type ReplaceAny<T, DefaultType> = IsAny<T> extends true ? DefaultType : T\n\nexport type SelectIncludeType = {\n [k: string]: SelectIncludeType | true\n}\n\nexport type SelectExcludeType = {\n [k: string]: false | SelectExcludeType\n}\n\nexport type SelectMode = 'exclude' | 'include'\n\nexport type SelectType = SelectExcludeType | SelectIncludeType\n\n/**\n * Operations that invoke an entity-level `select` function.\n *\n * Narrower than `HookOperationType`: `select` runs only for read- and\n * write-path operations that materialize a document (`create`, `delete`,\n * `read`, `restoreVersion`, `update`). Operations like `autosave`, `count`,\n * `countVersions`, `forgotPassword`, `login`, `readDistinct`, `refresh`, and\n * `resetPassword` do not invoke `select` and are intentionally excluded.\n */\nexport type SelectFnOperation = 'create' | 'delete' | 'read' | 'restoreVersion' | 'update'\n\nexport type SelectFnArgs = {\n operation: SelectFnOperation\n req: PayloadRequest\n /** The caller's `select` arg, or `undefined` if not provided. */\n select?: SelectType\n}\n\nexport type SelectFn<TSelect extends SelectType = SelectType> = (\n args: SelectFnArgs,\n) => TSelect | undefined\n\n/**\n * Shared shape for the entity-level `select` config used by Collections and Globals.\n * The JSDoc on the `select` property is the single source of truth — pick from this\n * type when defining the config:\n *\n * & Pick<WithSelectFn<...>, 'select'>\n */\nexport type WithSelectFn<TSelect extends SelectType = SelectType> = {\n /**\n * Entity-level Select API configuration.\n *\n * A function that receives the current request context (`operation`, `req`,\n * the caller's `select`) and returns the final `select` to apply, replacing\n * the caller's. Return `undefined` to leave the caller's `select` unchanged.\n *\n * Useful to dynamically modify the caller's selection based on the request context:\n * - Forcing a field to be populated for reference within hooks / access control.\n * - Differentiating between API requests and admin panel requests, to optimize\n * the amount of data being queried in each case.\n *\n * Note: per-document data is not available — this runs before the read.\n *\n * @see https://payloadcms.com/docs/queries/select\n */\n select?: SelectFn<TSelect>\n}\n\nexport type ApplyDisableErrors<T, DisableErrors = false> = false extends DisableErrors\n ? T\n : null | T\n\nexport type TransformDataWithSelect<\n Data extends Record<string, any>,\n Select extends SelectType,\n> = Select extends never\n ? Data\n : string extends keyof Select\n ? Data\n : // START Handle types when they aren't generated\n // For example in any package in this repository outside of tests / plugins\n // This stil gives us autocomplete when using include select mode, i.e select: {title :true} returns type {title: any, id: string | number}\n string extends keyof Omit<Data, 'id'>\n ? Select extends SelectIncludeType\n ? {\n [K in Data extends TypeWithID ? 'id' | keyof Select : keyof Select]: K extends 'id'\n ? number | string\n : unknown\n }\n : Data\n : // END Handle types when they aren't generated\n // Handle include mode\n Select extends SelectIncludeType\n ? {\n [\n K in keyof Data as K extends keyof Select\n ? Select[K] extends object | true\n ? K\n : never\n : // select 'id' always\n K extends 'id'\n ? K\n : never\n ]: Data[K]\n }\n : // Handle exclude mode\n {\n [\n K in keyof Data as K extends keyof Select\n ? Select[K] extends object | undefined\n ? K\n : never\n : K\n ]: Data[K]\n }\n\nexport type TransformCollectionWithSelect<\n TSlug extends CollectionSlug,\n TSelect extends SelectType,\n> = TSelect extends SelectType\n ? TransformDataWithSelect<DataFromCollectionSlug<TSlug>, TSelect>\n : DataFromCollectionSlug<TSlug>\n\nexport type DraftTransformCollectionWithSelect<\n TSlug extends CollectionSlug,\n TSelect extends SelectType,\n> = TSelect extends SelectType\n ? TransformDataWithSelect<QueryDraftDataFromCollectionSlug<TSlug>, TSelect>\n : QueryDraftDataFromCollectionSlug<TSlug>\n\nexport type TransformGlobalWithSelect<\n TSlug extends GlobalSlug,\n TSelect extends SelectType,\n> = TSelect extends SelectType\n ? TransformDataWithSelect<DataFromGlobalSlug<TSlug>, TSelect>\n : DataFromGlobalSlug<TSlug>\n\nexport type PopulateType = Partial<TypedCollectionSelect>\n\nexport type { SharedLocalAPIOptions } from './operations.js'\n\nexport type ResolvedFilterOptions = { [collection: string]: Where }\n\nexport type PickPreserveOptional<T, K extends keyof T> = Partial<\n Pick<T, Extract<K, OptionalKeys<T>>>\n> &\n Pick<T, Extract<K, RequiredKeys<T>>>\n\nexport type MaybePromise<T> = Promise<T> | T\n"],"names":["docHasTimestamps","doc","createdAt","updatedAt"],"mappings":"AAmNA,OAAO,SAASA,iBAAiBC,GAAQ;IACvC,OAAOA,KAAKC,aAAaD,KAAKE;AAChC"}