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
1 line
4.3 KiB
Plaintext
1 line
4.3 KiB
Plaintext
{"version":3,"sources":["../../../../src/fields/hooks/afterRead/traverseFields.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../../../index.js'\nimport type {\n JsonObject,\n PayloadRequest,\n PopulateType,\n SelectMode,\n SelectType,\n} 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 currentDepth: number\n depth: number\n doc: JsonObject\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * The depth of the current field being processed.\n * Fields without names (i.e. rows, collapsibles, unnamed groups)\n * simply pass this value through\n *\n * @default 0\n */\n fieldDepth?: number\n /**\n * fieldPromises are used for things like field hooks. They should be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n fields: (Field | TabAsField)[]\n findMany: boolean\n flattenLocales: boolean\n global: null | SanitizedGlobalConfig\n locale: null | string\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 populate?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n select?: SelectType\n selectMode?: SelectMode\n showHiddenFields: boolean\n siblingDoc: JsonObject\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport const traverseFields = ({\n blockData,\n collection,\n context,\n currentDepth,\n depth,\n doc,\n draft,\n fallbackLocale,\n fieldDepth = 0,\n fieldPromises,\n fields,\n findMany,\n flattenLocales,\n global,\n locale,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n populate,\n populationPromises,\n req,\n select,\n selectMode,\n showHiddenFields,\n siblingDoc,\n triggerAccessControl = true,\n triggerHooks = true,\n}: Args): void => {\n fields.forEach((field, fieldIndex) => {\n fieldPromises.push(\n promise({\n blockData,\n collection,\n context,\n currentDepth,\n depth,\n doc,\n draft,\n fallbackLocale,\n field,\n fieldDepth,\n fieldIndex,\n fieldPromises,\n findMany,\n flattenLocales,\n global,\n locale,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n populate,\n populationPromises,\n req,\n select,\n selectMode,\n showHiddenFields,\n siblingDoc,\n siblingFields: fields,\n triggerAccessControl,\n triggerHooks,\n }),\n )\n })\n}\n"],"names":["promise","traverseFields","blockData","collection","context","currentDepth","depth","doc","draft","fallbackLocale","fieldDepth","fieldPromises","fields","findMany","flattenLocales","global","locale","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","populate","populationPromises","req","select","selectMode","showHiddenFields","siblingDoc","triggerAccessControl","triggerHooks","forEach","field","fieldIndex","push","siblingFields"],"mappings":"AAYA,SAASA,OAAO,QAAQ,eAAc;AAkDtC,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,GAAG,EACHC,KAAK,EACLC,cAAc,EACdC,aAAa,CAAC,EACdC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,cAAc,EACdC,MAAM,EACNC,MAAM,EACNC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,QAAQ,EACRC,kBAAkB,EAClBC,GAAG,EACHC,MAAM,EACNC,UAAU,EACVC,gBAAgB,EAChBC,UAAU,EACVC,uBAAuB,IAAI,EAC3BC,eAAe,IAAI,EACd;IACLlB,OAAOmB,OAAO,CAAC,CAACC,OAAOC;QACrBtB,cAAcuB,IAAI,CAChBlC,QAAQ;YACNE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAuB;YACAtB;YACAuB;YACAtB;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAO,eAAevB;YACfiB;YACAC;QACF;IAEJ;AACF,EAAC"} |