Files
klz-cables.com/.pnpm-store/v10/files/04/fb2b87b8f998d0ccd0c1794dd222c659dccc88def0151337dc8b00d4b346559e8ffe08f0e5fbd32df0d48741911d655e5ad932744df0e9fbbff4825c8a4f15
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
21 KiB
Plaintext

{"version":3,"sources":["../../../../src/fields/hooks/beforeDuplicate/promise.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, FieldHookArgs, TabAsField } from '../../config/types.js'\n\nimport { fieldAffectsData, fieldShouldBeLocalized } from '../../config/types.js'\nimport { getFieldPaths } from '../../getFieldPaths.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args<T> = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n doc: T\n field: Field | TabAsField\n fieldIndex: number\n id?: number | string\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingDoc: JsonObject\n siblingFields?: (Field | TabAsField)[]\n}\n\nexport const promise = async <T>({\n id,\n blockData,\n collection,\n context,\n doc,\n field,\n fieldIndex,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingDoc,\n siblingFields,\n}: Args<T>): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const { localization } = req.payload.config\n\n const pathSegments = path ? path.split('.') : []\n const schemaPathSegments = schemaPath ? schemaPath.split('.') : []\n const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : []\n\n if (fieldAffectsData(field)) {\n let fieldData = siblingDoc?.[field.name!]\n const fieldIsLocalized = localization && fieldShouldBeLocalized({ field, parentIsLocalized })\n\n // Run field beforeDuplicate hooks.\n // These hooks are responsible for resetting the `id` field values of array and block rows. See `baseIDField`.\n if (Array.isArray('hooks' in field && field.hooks?.beforeDuplicate)) {\n if (fieldIsLocalized) {\n const localeData: JsonObject = {}\n\n for (const locale of localization.localeCodes) {\n const beforeDuplicateArgs: FieldHookArgs = {\n blockData,\n collection,\n context,\n data: doc as Partial<T>,\n field,\n global: undefined!,\n indexPath: indexPathSegments,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name!]?.[locale],\n req,\n schemaPath: schemaPathSegments,\n siblingData: siblingDoc,\n siblingDocWithLocales: siblingDoc,\n siblingFields: siblingFields!,\n value: siblingDoc[field.name!]?.[locale],\n }\n\n let hookResult\n if ('hooks' in field && field.hooks?.beforeDuplicate) {\n for (const hook of field.hooks.beforeDuplicate) {\n hookResult = await hook(beforeDuplicateArgs)\n }\n }\n\n if (typeof hookResult !== 'undefined') {\n localeData[locale] = hookResult\n }\n }\n\n siblingDoc[field.name!] = localeData\n } else {\n const beforeDuplicateArgs: FieldHookArgs = {\n blockData,\n collection,\n context,\n data: doc as Partial<T>,\n field,\n global: undefined!,\n indexPath: indexPathSegments,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name!]!,\n req,\n schemaPath: schemaPathSegments,\n siblingData: siblingDoc,\n siblingDocWithLocales: siblingDoc,\n siblingFields: siblingFields!,\n value: siblingDoc[field.name!]!,\n }\n\n let hookResult\n if ('hooks' in field && field.hooks?.beforeDuplicate) {\n for (const hook of field.hooks.beforeDuplicate) {\n hookResult = await hook(beforeDuplicateArgs)\n }\n }\n\n if (typeof hookResult !== 'undefined') {\n siblingDoc[field.name!] = hookResult\n }\n }\n }\n\n // First, for any localized fields, we will loop over locales\n // and if locale data is present, traverse the sub fields.\n // There are only a few different fields where this is possible.\n if (fieldIsLocalized) {\n if (typeof fieldData !== 'object' || fieldData === null) {\n siblingDoc[field.name!] = {}\n fieldData = siblingDoc[field.name!]\n }\n\n const promises: Promise<void>[] = []\n\n localization.localeCodes.forEach((locale) => {\n if (fieldData[locale]) {\n switch (field.type) {\n case 'array': {\n const rows = fieldData[locale]\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 doc,\n fields: field.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc: row,\n }),\n )\n })\n }\n\n break\n }\n\n case 'blocks': {\n const rows = fieldData[locale]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n const blockTypeToMatch = row.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n ((field.blockReferences ?? field.blocks).find(\n (curBlock) =>\n typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n promises.push(\n traverseFields({\n id,\n blockData: row,\n collection,\n context,\n doc,\n fields: block!.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath + '.' + block!.slug,\n req,\n siblingDoc: row,\n }),\n )\n })\n }\n break\n }\n\n case 'group':\n case 'tab': {\n promises.push(\n traverseFields({\n id,\n blockData,\n collection,\n context,\n doc,\n fields: field.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc: fieldData[locale],\n }),\n )\n\n break\n }\n }\n }\n })\n\n await Promise.all(promises)\n } else {\n // If the field is not localized, but it affects data,\n // we need to further traverse its children\n // so the child fields can run beforeDuplicate hooks\n switch (field.type) {\n case 'array': {\n const rows = siblingDoc[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 doc,\n fields: field.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc: row,\n }),\n )\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'blocks': {\n const rows = siblingDoc[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n const blockTypeToMatch = row.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n ((field.blockReferences ?? field.blocks).find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n if (block) {\n ;(row as JsonObject).blockType = blockTypeToMatch\n\n promises.push(\n traverseFields({\n id,\n blockData: row,\n collection,\n context,\n doc,\n fields: block.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath + '.' + block.slug,\n req,\n siblingDoc: row,\n }),\n )\n }\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'group': {\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n const groupDoc = siblingDoc[field.name] as JsonObject\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n doc,\n fields: field.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc: groupDoc,\n })\n\n break\n }\n\n case 'tab': {\n if (typeof siblingDoc[field.name!] !== 'object') {\n siblingDoc[field.name!] = {}\n }\n\n const tabDoc = siblingDoc[field.name!] as JsonObject\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n doc,\n fields: field.fields,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized!,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc: tabDoc,\n })\n\n break\n }\n }\n }\n } else {\n // Finally, we traverse fields which do not affect data here - collapsibles, rows, unnamed groups\n switch (field.type) {\n case 'collapsible':\n case 'group':\n case 'row': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n doc,\n fields: field.fields,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc,\n })\n\n break\n }\n\n // Unnamed Tab\n // @ts-expect-error `fieldAffectsData` inferred return type doesn't account for TabAsField\n case 'tab': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n doc,\n // @ts-expect-error `fieldAffectsData` inferred return type doesn't account for TabAsField\n fields: field.fields,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc,\n })\n\n break\n }\n\n case 'tabs': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n doc,\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingDoc,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n }\n}\n"],"names":["fieldAffectsData","fieldShouldBeLocalized","getFieldPaths","traverseFields","promise","id","blockData","collection","context","doc","field","fieldIndex","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingDoc","siblingFields","indexPath","path","schemaPath","index","localization","payload","config","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","fieldData","name","fieldIsLocalized","Array","isArray","hooks","beforeDuplicate","localeData","locale","localeCodes","beforeDuplicateArgs","data","global","undefined","previousSiblingDoc","previousValue","siblingData","siblingDocWithLocales","value","hookResult","hook","promises","forEach","type","rows","row","rowIndex","push","fields","localized","blockTypeToMatch","blockType","block","blocks","blockReferences","find","curBlock","slug","Promise","all","groupDoc","tabDoc","tabs","tab"],"mappings":"AAKA,SAASA,gBAAgB,EAAEC,sBAAsB,QAAQ,wBAAuB;AAChF,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,cAAc,QAAQ,sBAAqB;AAuBpD,OAAO,MAAMC,UAAU,OAAU,EAC/BC,EAAE,EACFC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,GAAG,EACHC,KAAK,EACLC,UAAU,EACVC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,UAAU,EACVC,aAAa,EACL;IACR,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAGpB,cAAc;QACpDQ;QACAa,OAAOZ;QACPE;QACAE;QACAC;IACF;IAEA,MAAM,EAAEQ,YAAY,EAAE,GAAGP,IAAIQ,OAAO,CAACC,MAAM;IAE3C,MAAMC,eAAeN,OAAOA,KAAKO,KAAK,CAAC,OAAO,EAAE;IAChD,MAAMC,qBAAqBP,aAAaA,WAAWM,KAAK,CAAC,OAAO,EAAE;IAClE,MAAME,oBAAoBV,YAAYA,UAAUQ,KAAK,CAAC,KAAKG,MAAM,CAACC,UAAUC,IAAIC,UAAU,EAAE;IAE5F,IAAIlC,iBAAiBU,QAAQ;QAC3B,IAAIyB,YAAYjB,YAAY,CAACR,MAAM0B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