payload 3.71.0-internal-debug.cd77e5d → 3.71.0-internal-debug.80dab4c

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.
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/create.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAA;AAChE,OAAO,KAAK,EAEV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,oBAAoB,CAAA;AAwB3B,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,cAAc,IAAI;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,CAAA;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,eAAe,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAA;IACrD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,KAAK,SAAS,cAAc,EA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c,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,gBAEjC,SAAS,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAsVvD,CAAA"}
@@ -189,7 +189,8 @@ export const createOperation = async (incomingArgs)=>{
189
189
  operation: 'create',
190
190
  payload,
191
191
  publishSpecificLocale,
192
- req
192
+ req,
193
+ returning: false
193
194
  });
194
195
  }
195
196
  // /////////////////////////////////////
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/operations/create.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { CollectionSlug, JsonObject } from '../../index.js'\nimport type {\n Document,\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../types/index.js'\nimport type {\n Collection,\n DataFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../config/types.js'\n\nimport { ensureUsernameOrEmail } from '../../auth/ensureUsernameOrEmail.js'\nimport { executeAccess } from '../../auth/executeAccess.js'\nimport { sendVerificationEmail } from '../../auth/sendVerificationEmail.js'\nimport { registerLocalStrategy } from '../../auth/strategies/local/register.js'\nimport { getDuplicateDocumentData } from '../../duplicateDocument/index.js'\nimport { afterChange } from '../../fields/hooks/afterChange/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { beforeChange } from '../../fields/hooks/beforeChange/index.js'\nimport { beforeValidate } from '../../fields/hooks/beforeValidate/index.js'\nimport { saveVersion } from '../../index.js'\nimport { generateFileData } from '../../uploads/generateFileData.js'\nimport { unlinkTempFiles } from '../../uploads/unlinkTempFiles.js'\nimport { uploadFiles } from '../../uploads/uploadFiles.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { hasDraftsEnabled, hasDraftValidationEnabled } from '../../utilities/getVersionsConfig.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { sanitizeInternalFields } from '../../utilities/sanitizeInternalFields.js'\nimport { sanitizeSelect } from '../../utilities/sanitizeSelect.js'\nimport { buildAfterOperation } from './utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from './utilities/buildBeforeOperation.js'\n\nexport type Arguments<TSlug extends CollectionSlug> = {\n autosave?: boolean\n collection: Collection\n data: RequiredDataFromCollectionSlug<TSlug>\n depth?: number\n disableTransaction?: boolean\n disableVerificationEmail?: boolean\n draft?: boolean\n duplicateFromID?: DataFromCollectionSlug<TSlug>['id']\n overrideAccess?: boolean\n overwriteExistingFiles?: boolean\n populate?: PopulateType\n publishSpecificLocale?: string\n req: PayloadRequest\n select?: SelectType\n selectedLocales?: string[]\n showHiddenFields?: boolean\n}\n\nexport const createOperation = async <\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n incomingArgs: Arguments<TSlug>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n let args = incomingArgs\n\n try {\n const shouldCommit = !args.disableTransaction && (await initTransaction(args.req))\n\n ensureUsernameOrEmail<TSlug>({\n authOptions: args.collection.config.auth,\n collectionSlug: args.collection.config.slug,\n data: args.data,\n operation: 'create',\n req: args.req,\n })\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'create',\n })\n\n if (args.publishSpecificLocale) {\n args.req.locale = args.publishSpecificLocale\n }\n\n const {\n autosave = false,\n collection: { config: collectionConfig },\n collection,\n depth,\n disableVerificationEmail,\n draft = false,\n duplicateFromID,\n overrideAccess,\n overwriteExistingFiles = false,\n populate,\n publishSpecificLocale,\n req: {\n fallbackLocale,\n locale,\n payload,\n payload: { config },\n },\n req,\n select: incomingSelect,\n selectedLocales,\n showHiddenFields,\n } = args\n\n let { data } = args\n\n const isSavingDraft = Boolean(draft && hasDraftsEnabled(collectionConfig))\n\n let duplicatedFromDocWithLocales: JsonObject = {}\n let duplicatedFromDoc: JsonObject = {}\n\n if (duplicateFromID) {\n const duplicateResult = await getDuplicateDocumentData({\n id: duplicateFromID,\n collectionConfig,\n draftArg: isSavingDraft,\n overrideAccess,\n req,\n selectedLocales,\n })\n\n duplicatedFromDoc = duplicateResult.duplicatedFromDoc\n duplicatedFromDocWithLocales = duplicateResult.duplicatedFromDocWithLocales\n }\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n if (!overrideAccess) {\n await executeAccess({ data, req }, collectionConfig.access.create)\n }\n\n // /////////////////////////////////////\n // Generate data for all files and sizes\n // /////////////////////////////////////\n\n const { data: newFileData, files: filesToUpload } = await generateFileData({\n collection,\n config,\n data,\n isDuplicating: Boolean(duplicateFromID),\n operation: 'create',\n originalDoc: duplicatedFromDoc,\n overwriteExistingFiles,\n req,\n throwOnMissingFile:\n !isSavingDraft && collection.config.upload.filesRequiredOnCreate !== false,\n })\n\n data = newFileData\n\n // /////////////////////////////////////\n // beforeValidate - Fields\n // /////////////////////////////////////\n\n data = await beforeValidate({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: duplicatedFromDoc,\n global: null,\n operation: 'create',\n overrideAccess: overrideAccess!,\n req,\n })\n\n // /////////////////////////////////////\n // beforeValidate - Collections\n // /////////////////////////////////////\n\n if (collectionConfig.hooks.beforeValidate?.length) {\n for (const hook of collectionConfig.hooks.beforeValidate) {\n data =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n data,\n operation: 'create',\n originalDoc: duplicatedFromDoc,\n req,\n })) || data\n }\n }\n\n // /////////////////////////////////////\n // beforeChange - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.beforeChange?.length) {\n for (const hook of collectionConfig.hooks.beforeChange) {\n data =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n data,\n operation: 'create',\n originalDoc: duplicatedFromDoc,\n req,\n })) || data\n }\n }\n\n // /////////////////////////////////////\n // beforeChange - Fields\n // /////////////////////////////////////\n\n const resultWithLocales = await beforeChange<JsonObject>({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: duplicatedFromDoc,\n docWithLocales: duplicatedFromDocWithLocales,\n global: null,\n operation: 'create',\n overrideAccess,\n req,\n skipValidation: isSavingDraft && !hasDraftValidationEnabled(collectionConfig),\n })\n\n // /////////////////////////////////////\n // Write files to local storage\n // /////////////////////////////////////\n\n if (!collectionConfig.upload.disableLocalStorage) {\n await uploadFiles(payload, filesToUpload, req)\n }\n\n // /////////////////////////////////////\n // Create\n // /////////////////////////////////////\n\n let doc\n\n const select = sanitizeSelect({\n fields: collectionConfig.flattenedFields,\n forceSelect: collectionConfig.forceSelect,\n select: incomingSelect,\n })\n\n if (collectionConfig.auth && !collectionConfig.auth.disableLocalStrategy) {\n if (collectionConfig.auth.verify) {\n resultWithLocales._verified = Boolean(resultWithLocales._verified) || false\n resultWithLocales._verificationToken = crypto.randomBytes(20).toString('hex')\n }\n\n doc = await registerLocalStrategy({\n collection: collectionConfig,\n doc: resultWithLocales,\n password: data.password as string,\n payload: req.payload,\n req,\n })\n } else {\n doc = await payload.db.create({\n collection: collectionConfig.slug,\n data: resultWithLocales,\n req,\n })\n }\n\n const verificationToken = doc._verificationToken\n let result: Document = sanitizeInternalFields(doc)\n\n // /////////////////////////////////////\n // Create version\n // /////////////////////////////////////\n\n if (collectionConfig.versions) {\n await saveVersion({\n id: result.id,\n autosave,\n collection: collectionConfig,\n docWithLocales: result,\n operation: 'create',\n payload,\n publishSpecificLocale,\n req,\n })\n }\n\n // /////////////////////////////////////\n // Send verification email if applicable\n // /////////////////////////////////////\n\n if (collectionConfig.auth && collectionConfig.auth.verify && result.email) {\n await sendVerificationEmail({\n collection: { config: collectionConfig },\n config: payload.config,\n disableEmail: disableVerificationEmail!,\n email: payload.email,\n req,\n token: verificationToken,\n user: result,\n })\n }\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n result = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth: depth!,\n doc: result,\n draft,\n fallbackLocale: fallbackLocale!,\n global: null,\n locale: locale!,\n overrideAccess: overrideAccess!,\n populate,\n req,\n select,\n showHiddenFields: showHiddenFields!,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterRead?.length) {\n for (const hook of collectionConfig.hooks.afterRead) {\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n doc: result,\n req,\n })) || result\n }\n }\n\n // /////////////////////////////////////\n // afterChange - Fields\n // /////////////////////////////////////\n\n result = await afterChange({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: result,\n global: null,\n operation: 'create',\n previousDoc: {},\n req,\n })\n\n // /////////////////////////////////////\n // afterChange - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterChange?.length) {\n for (const hook of collectionConfig.hooks.afterChange) {\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: result,\n operation: 'create',\n previousDoc: {},\n req: args.req,\n })) || result\n }\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation<TSlug>({\n args,\n collection: collectionConfig,\n operation: 'create',\n result,\n })\n\n await unlinkTempFiles({ collectionConfig, config, req })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["crypto","ensureUsernameOrEmail","executeAccess","sendVerificationEmail","registerLocalStrategy","getDuplicateDocumentData","afterChange","afterRead","beforeChange","beforeValidate","saveVersion","generateFileData","unlinkTempFiles","uploadFiles","commitTransaction","hasDraftsEnabled","hasDraftValidationEnabled","initTransaction","killTransaction","sanitizeInternalFields","sanitizeSelect","buildAfterOperation","buildBeforeOperation","createOperation","incomingArgs","args","shouldCommit","disableTransaction","req","authOptions","collection","config","auth","collectionSlug","slug","data","operation","publishSpecificLocale","locale","autosave","collectionConfig","depth","disableVerificationEmail","draft","duplicateFromID","overrideAccess","overwriteExistingFiles","populate","fallbackLocale","payload","select","incomingSelect","selectedLocales","showHiddenFields","isSavingDraft","Boolean","duplicatedFromDocWithLocales","duplicatedFromDoc","duplicateResult","id","draftArg","access","create","newFileData","files","filesToUpload","isDuplicating","originalDoc","throwOnMissingFile","upload","filesRequiredOnCreate","context","doc","global","hooks","length","hook","resultWithLocales","docWithLocales","skipValidation","disableLocalStorage","fields","flattenedFields","forceSelect","disableLocalStrategy","verify","_verified","_verificationToken","randomBytes","toString","password","db","verificationToken","result","versions","email","disableEmail","token","user","previousDoc","error"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAiB3B,SAASC,qBAAqB,QAAQ,sCAAqC;AAC3E,SAASC,aAAa,QAAQ,8BAA6B;AAC3D,SAASC,qBAAqB,QAAQ,sCAAqC;AAC3E,SAASC,qBAAqB,QAAQ,0CAAyC;AAC/E,SAASC,wBAAwB,QAAQ,mCAAkC;AAC3E,SAASC,WAAW,QAAQ,0CAAyC;AACrE,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,YAAY,QAAQ,2CAA0C;AACvE,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,WAAW,QAAQ,iBAAgB;AAC5C,SAASC,gBAAgB,QAAQ,oCAAmC;AACpE,SAASC,eAAe,QAAQ,mCAAkC;AAClE,SAASC,WAAW,QAAQ,+BAA8B;AAC1D,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,gBAAgB,EAAEC,yBAAyB,QAAQ,uCAAsC;AAClG,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,mBAAmB,QAAQ,qCAAoC;AACxE,SAASC,oBAAoB,QAAQ,sCAAqC;AAqB1E,OAAO,MAAMC,kBAAkB,OAI7BC;IAEA,IAAIC,OAAOD;IAEX,IAA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,YAAYU;YACZ+B,SAAS3C,IAAI2C,OAAO;YACpBpC;YACAqC,KAAKqB;YACLpB,QAAQ;YACRrC,WAAW;YACX+D,aAAa,CAAC;YACdvE;QACF;QAEA,wCAAwC;QACxC,2BAA2B;QAC3B,wCAAwC;QAExC,IAAIY,iBAAiBkC,KAAK,EAAEpE,aAAaqE,QAAQ;YAC/C,KAAK,MAAMC,QAAQpC,iBAAiBkC,KAAK,CAACpE,WAAW,CAAE;gBACrDuF,SACE,AAAC,MAAMjB,KAAK;oBACV9C,YAAYU;oBACZ+B,SAAS3C,IAAI2C,OAAO;oBACpBpC;oBACAqC,KAAKqB;oBACLzD,WAAW;oBACX+D,aAAa,CAAC;oBACdvE,KAAKH,KAAKG,GAAG;gBACf,MAAOiE;YACX;QACF;QAEA,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCA,SAAS,MAAMxE,oBAA2B;YACxCI;YACAK,YAAYU;YACZJ,WAAW;YACXyD;QACF;QAEA,MAAMjF,gBAAgB;YAAE4B;YAAkBT;YAAQH;QAAI;QAEtD,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,IAAIF,cAAc;YAChB,MAAMZ,kBAAkBc;QAC1B;QAEA,OAAOiE;IACT,EAAE,OAAOO,OAAgB;QACvB,MAAMlF,gBAAgBO,KAAKG,GAAG;QAC9B,MAAMwE;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/collections/operations/create.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { CollectionSlug, JsonObject } from '../../index.js'\nimport type {\n Document,\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../types/index.js'\nimport type {\n Collection,\n DataFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../config/types.js'\n\nimport { ensureUsernameOrEmail } from '../../auth/ensureUsernameOrEmail.js'\nimport { executeAccess } from '../../auth/executeAccess.js'\nimport { sendVerificationEmail } from '../../auth/sendVerificationEmail.js'\nimport { registerLocalStrategy } from '../../auth/strategies/local/register.js'\nimport { getDuplicateDocumentData } from '../../duplicateDocument/index.js'\nimport { afterChange } from '../../fields/hooks/afterChange/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { beforeChange } from '../../fields/hooks/beforeChange/index.js'\nimport { beforeValidate } from '../../fields/hooks/beforeValidate/index.js'\nimport { saveVersion } from '../../index.js'\nimport { generateFileData } from '../../uploads/generateFileData.js'\nimport { unlinkTempFiles } from '../../uploads/unlinkTempFiles.js'\nimport { uploadFiles } from '../../uploads/uploadFiles.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { hasDraftsEnabled, hasDraftValidationEnabled } from '../../utilities/getVersionsConfig.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { sanitizeInternalFields } from '../../utilities/sanitizeInternalFields.js'\nimport { sanitizeSelect } from '../../utilities/sanitizeSelect.js'\nimport { buildAfterOperation } from './utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from './utilities/buildBeforeOperation.js'\n\nexport type Arguments<TSlug extends CollectionSlug> = {\n autosave?: boolean\n collection: Collection\n data: RequiredDataFromCollectionSlug<TSlug>\n depth?: number\n disableTransaction?: boolean\n disableVerificationEmail?: boolean\n draft?: boolean\n duplicateFromID?: DataFromCollectionSlug<TSlug>['id']\n overrideAccess?: boolean\n overwriteExistingFiles?: boolean\n populate?: PopulateType\n publishSpecificLocale?: string\n req: PayloadRequest\n select?: SelectType\n selectedLocales?: string[]\n showHiddenFields?: boolean\n}\n\nexport const createOperation = async <\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n incomingArgs: Arguments<TSlug>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n let args = incomingArgs\n\n try {\n const shouldCommit = !args.disableTransaction && (await initTransaction(args.req))\n\n ensureUsernameOrEmail<TSlug>({\n authOptions: args.collection.config.auth,\n collectionSlug: args.collection.config.slug,\n data: args.data,\n operation: 'create',\n req: args.req,\n })\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'create',\n })\n\n if (args.publishSpecificLocale) {\n args.req.locale = args.publishSpecificLocale\n }\n\n const {\n autosave = false,\n collection: { config: collectionConfig },\n collection,\n depth,\n disableVerificationEmail,\n draft = false,\n duplicateFromID,\n overrideAccess,\n overwriteExistingFiles = false,\n populate,\n publishSpecificLocale,\n req: {\n fallbackLocale,\n locale,\n payload,\n payload: { config },\n },\n req,\n select: incomingSelect,\n selectedLocales,\n showHiddenFields,\n } = args\n\n let { data } = args\n\n const isSavingDraft = Boolean(draft && hasDraftsEnabled(collectionConfig))\n\n let duplicatedFromDocWithLocales: JsonObject = {}\n let duplicatedFromDoc: JsonObject = {}\n\n if (duplicateFromID) {\n const duplicateResult = await getDuplicateDocumentData({\n id: duplicateFromID,\n collectionConfig,\n draftArg: isSavingDraft,\n overrideAccess,\n req,\n selectedLocales,\n })\n\n duplicatedFromDoc = duplicateResult.duplicatedFromDoc\n duplicatedFromDocWithLocales = duplicateResult.duplicatedFromDocWithLocales\n }\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n if (!overrideAccess) {\n await executeAccess({ data, req }, collectionConfig.access.create)\n }\n\n // /////////////////////////////////////\n // Generate data for all files and sizes\n // /////////////////////////////////////\n\n const { data: newFileData, files: filesToUpload } = await generateFileData({\n collection,\n config,\n data,\n isDuplicating: Boolean(duplicateFromID),\n operation: 'create',\n originalDoc: duplicatedFromDoc,\n overwriteExistingFiles,\n req,\n throwOnMissingFile:\n !isSavingDraft && collection.config.upload.filesRequiredOnCreate !== false,\n })\n\n data = newFileData\n\n // /////////////////////////////////////\n // beforeValidate - Fields\n // /////////////////////////////////////\n\n data = await beforeValidate({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: duplicatedFromDoc,\n global: null,\n operation: 'create',\n overrideAccess: overrideAccess!,\n req,\n })\n\n // /////////////////////////////////////\n // beforeValidate - Collections\n // /////////////////////////////////////\n\n if (collectionConfig.hooks.beforeValidate?.length) {\n for (const hook of collectionConfig.hooks.beforeValidate) {\n data =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n data,\n operation: 'create',\n originalDoc: duplicatedFromDoc,\n req,\n })) || data\n }\n }\n\n // /////////////////////////////////////\n // beforeChange - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.beforeChange?.length) {\n for (const hook of collectionConfig.hooks.beforeChange) {\n data =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n data,\n operation: 'create',\n originalDoc: duplicatedFromDoc,\n req,\n })) || data\n }\n }\n\n // /////////////////////////////////////\n // beforeChange - Fields\n // /////////////////////////////////////\n\n const resultWithLocales = await beforeChange<JsonObject>({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: duplicatedFromDoc,\n docWithLocales: duplicatedFromDocWithLocales,\n global: null,\n operation: 'create',\n overrideAccess,\n req,\n skipValidation: isSavingDraft && !hasDraftValidationEnabled(collectionConfig),\n })\n\n // /////////////////////////////////////\n // Write files to local storage\n // /////////////////////////////////////\n\n if (!collectionConfig.upload.disableLocalStorage) {\n await uploadFiles(payload, filesToUpload, req)\n }\n\n // /////////////////////////////////////\n // Create\n // /////////////////////////////////////\n\n let doc\n\n const select = sanitizeSelect({\n fields: collectionConfig.flattenedFields,\n forceSelect: collectionConfig.forceSelect,\n select: incomingSelect,\n })\n\n if (collectionConfig.auth && !collectionConfig.auth.disableLocalStrategy) {\n if (collectionConfig.auth.verify) {\n resultWithLocales._verified = Boolean(resultWithLocales._verified) || false\n resultWithLocales._verificationToken = crypto.randomBytes(20).toString('hex')\n }\n\n doc = await registerLocalStrategy({\n collection: collectionConfig,\n doc: resultWithLocales,\n password: data.password as string,\n payload: req.payload,\n req,\n })\n } else {\n doc = await payload.db.create({\n collection: collectionConfig.slug,\n data: resultWithLocales,\n req,\n })\n }\n\n const verificationToken = doc._verificationToken\n let result: Document = sanitizeInternalFields(doc)\n\n // /////////////////////////////////////\n // Create version\n // /////////////////////////////////////\n\n if (collectionConfig.versions) {\n await saveVersion({\n id: result.id,\n autosave,\n collection: collectionConfig,\n docWithLocales: result,\n operation: 'create',\n payload,\n publishSpecificLocale,\n req,\n returning: false,\n })\n }\n\n // /////////////////////////////////////\n // Send verification email if applicable\n // /////////////////////////////////////\n\n if (collectionConfig.auth && collectionConfig.auth.verify && result.email) {\n await sendVerificationEmail({\n collection: { config: collectionConfig },\n config: payload.config,\n disableEmail: disableVerificationEmail!,\n email: payload.email,\n req,\n token: verificationToken,\n user: result,\n })\n }\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n result = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth: depth!,\n doc: result,\n draft,\n fallbackLocale: fallbackLocale!,\n global: null,\n locale: locale!,\n overrideAccess: overrideAccess!,\n populate,\n req,\n select,\n showHiddenFields: showHiddenFields!,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterRead?.length) {\n for (const hook of collectionConfig.hooks.afterRead) {\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n doc: result,\n req,\n })) || result\n }\n }\n\n // /////////////////////////////////////\n // afterChange - Fields\n // /////////////////////////////////////\n\n result = await afterChange({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: result,\n global: null,\n operation: 'create',\n previousDoc: {},\n req,\n })\n\n // /////////////////////////////////////\n // afterChange - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterChange?.length) {\n for (const hook of collectionConfig.hooks.afterChange) {\n result =\n (await hook({\n collection: collectionConfig,\n context: req.context,\n data,\n doc: result,\n operation: 'create',\n previousDoc: {},\n req: args.req,\n })) || result\n }\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation<TSlug>({\n args,\n collection: collectionConfig,\n operation: 'create',\n result,\n })\n\n await unlinkTempFiles({ collectionConfig, config, req })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["crypto","ensureUsernameOrEmail","executeAccess","sendVerificationEmail","registerLocalStrategy","getDuplicateDocumentData","afterChange","afterRead","beforeChange","beforeValidate","saveVersion","generateFileData","unlinkTempFiles","uploadFiles","commitTransaction","hasDraftsEnabled","hasDraftValidationEnabled","initTransaction","killTransaction","sanitizeInternalFields","sanitizeSelect","buildAfterOperation","buildBeforeOperation","createOperation","incomingArgs","args","shouldCommit","disableTransaction","req","authOptions","collection","config","auth","collectionSlug","slug","data","operation","publishSpecificLocale","locale","autosave","collectionConfig","depth","disableVerificationEmail","draft","duplicateFromID","overrideAccess","overwriteExistingFiles","populate","fallbackLocale","payload","select","incomingSelect","selectedLocales","showHiddenFields","isSavingDraft","Boolean","duplicatedFromDocWithLocales","duplicatedFromDoc","duplicateResult","id","draftArg","access","create","newFileData","files","filesToUpload","isDuplicating","originalDoc","throwOnMissingFile","upload","filesRequiredOnCreate","context","doc","global","hooks","length","hook","resultWithLocales","docWithLocales","skipValidation","disableLocalStorage","fields","flattenedFields","forceSelect","disableLocalStrategy","verify","_verified","_verificationToken","randomBytes","toString","password","db","verificationToken","result","versions","returning","email","disableEmail","token","user","previousDoc","error"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAiB3B,SAASC,qBAAqB,QAAQ,sCAAqC;AAC3E,SAASC,aAAa,QAAQ,8BAA6B;AAC3D,SAASC,qBAAqB,QAAQ,sCAAqC;AAC3E,SAASC,qBAAqB,QAAQ,0CAAyC;AAC/E,SAASC,wBAAwB,QAAQ,mCAAkC;AAC3E,SAASC,WAAW,QAAQ,0CAAyC;AACrE,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,YAAY,Q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EtD,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,IAAIF,cAAc;YAChB,MAAMZ,kBAAkBc;QAC1B;QAEA,OAAOiE;IACT,EAAE,OAAOQ,OAAgB;QACvB,MAAMnF,gBAAgBO,KAAKG,GAAG;QAC9B,MAAMyE;IACR;AACF,EAAC"}
@@ -527,7 +527,12 @@ export type FetchAPIFileUploadOptions = {
527
527
  } & Partial<BusboyConfig>;
528
528
  export type ErrorResult = {
529
529
  data?: any;
530
- errors: unknown[];
530
+ errors: {
531
+ data?: Record<string, unknown>;
532
+ field?: string;
533
+ message?: string;
534
+ name?: string;
535
+ }[];
531
536
  stack?: string;
532
537
  };
533
538
  export type AfterErrorResult = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,IAAI,EACJ,UAAU,EACV,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAC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AAE,CAAC,EAAE,EAAE;IAAE,CAAC,EAAE,SAAS,CAAA;CAAE,KAAK,MAAM,CAAA;AAE3E,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;AAE3F,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n DefaultTranslationKeys,\n DefaultTranslationsObject,\n I18n,\n I18nClient,\n I18nOptions,\n TFunction,\n} from '@payloadcms/translations'\nimport type { BusboyConfig } from 'busboy'\nimport type GraphQL from 'graphql'\nimport type { GraphQLFormattedError } from 'graphql'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { Metadata } from 'next'\nimport type { DestinationStream, Level, LoggerOptions } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { RichTextAdapterProvider } from '../admin/RichText.js'\nimport type {\n DocumentSubViewTypes,\n DocumentTabConfig,\n DocumentViewServerProps,\n RichTextAdapter,\n} from '../admin/types.js'\nimport type { AdminViewConfig, ViewTypes, VisibleEntities } from '../admin/views/index.js'\nimport type { SanitizedPermissions } from '../auth/index.js'\nimport type {\n AddToImportMap,\n ImportMap,\n Imports,\n InternalImportMap,\n} from '../bin/generateImportMap/index.js'\nimport type {\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { ErrorName } from '../errors/types.js'\nimport type { RootFoldersConfiguration } from '../folders/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type {\n Block,\n DefaultDocumentIDType,\n FlattenedBlock,\n JobsConfig,\n KVAdapterResult,\n Payload,\n RequestContext,\n SelectField,\n TypedUser,\n} from '../index.js'\nimport type { QueryPreset, QueryPresetConstraints } from '../query-presets/types.js'\nimport type { SanitizedJobsConfig } from '../queues/config/types/index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\n\n/**\n * The string path pointing to the React component. If one of the generics is `never`, you effectively mark it as a server-only or client-only component.\n *\n * If it is `false` an empty component will be rendered.\n */\nexport type PayloadComponent<\n TComponentServerProps extends never | object = Record<string, any>,\n TComponentClientProps extends never | object = Record<string, any>,\n> = false | RawPayloadComponent<TComponentServerProps, TComponentClientProps> | string\n\n// We need the actual object as its own type, otherwise the infers for the PayloadClientReactComponent / PayloadServerReactComponent will not work due to the string union.\n// We also NEED to actually use those generics for this to work, thus they are part of the props.\nexport type RawPayloadComponent<\n TComponentServerProps extends never | object = Record<string, any>,\n TComponentClientProps extends never | object = Record<string, any>,\n> = {\n clientProps?: object | TComponentClientProps\n exportName?: string\n path: string\n serverProps?: object | TComponentServerProps\n}\n\nexport type PayloadComponentProps<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<\n infer TComponentServerProps,\n infer TComponentClientProps\n >\n ? TComponentClientProps | TComponentServerProps\n : never\n\nexport type PayloadClientComponentProps<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer _, infer TComponentClientProps>\n ? TComponentClientProps\n : never\n\nexport type PayloadServerComponentProps<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer TComponentServerProps, infer _>\n ? TComponentServerProps\n : never\n\nexport type PayloadReactComponent<TPayloadComponent> = React.FC<\n PayloadComponentProps<TPayloadComponent>\n>\n\n// This also ensures that if never is passed to TComponentClientProps, this entire type will be never.\n// => TypeScript will now ensure that users cannot even define the typed Server Components if the PayloadComponent is marked as\n// Client-Only (marked as Client-Only = TComponentServerProps is never)\nexport type PayloadClientReactComponent<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer _, infer TComponentClientProps>\n ? TComponentClientProps extends never\n ? never\n : React.FC<TComponentClientProps>\n : never\n\nexport type PayloadServerReactComponent<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer TComponentServerProps, infer _>\n ? TComponentServerProps extends never\n ? never\n : React.FC<TComponentServerProps>\n : never\n\nexport type ResolvedComponent<\n TComponentServerProps extends never | object,\n TComponentClientProps extends never | object,\n> = {\n clientProps?: TComponentClientProps\n Component: React.FC<TComponentClientProps | TComponentServerProps>\n serverProps?: TComponentServerProps\n}\n\nexport type BinScriptConfig = {\n key: string\n scriptPath: string\n}\n\nexport type BinScript = (config: SanitizedConfig) => Promise<void> | void\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\nexport type Plugin = (config: Config) => Config | Promise<Config>\n\nexport type LivePreviewURLType = null | string | undefined\n\nexport type LivePreviewConfig = {\n /**\n Device breakpoints to use for the `iframe` of the Live Preview window.\n Options are displayed in the Live Preview toolbar.\n The `responsive` breakpoint is included by default.\n */\n breakpoints?: {\n height: number | string\n label: string\n name: string\n width: number | string\n }[]\n /**\n * The URL of the frontend application. This will be rendered within an `iframe` as its `src`.\n * Payload will send a `window.postMessage()` to this URL with the document data in real-time.\n * The frontend application is responsible for receiving the message and updating the UI accordingly.\n * @see https://payloadcms.com/docs/live-preview/frontend\n *\n * To conditionally render Live Preview, use a function that returns `undefined` or `null`.\n *\n * Note: this function may run often if autosave is enabled with a small interval.\n * For performance, avoid long-running tasks or expensive operations within this function,\n * or if you need to do something more complex, cache your function as needed.\n */\n url?:\n | ((args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n /**\n * @deprecated\n * Use `req.payload` instead. This will be removed in the next major version.\n */\n payload: Payload\n req: PayloadRequest\n }) => LivePreviewURLType | Promise<LivePreviewURLType>)\n | LivePreviewURLType\n}\n\nexport type RootLivePreviewConfig = {\n collections?: string[]\n globals?: string[]\n} & LivePreviewConfig\n\nexport type OGImageConfig = {\n alt?: string\n height?: number | string\n type?: string\n url: string\n width?: number | string\n}\n\n/**\n * @todo find a way to remove the deep clone here.\n * It can probably be removed after the `DeepRequired` from `Config` to `SanitizedConfig` is removed.\n * Same with `CollectionConfig` to `SanitizedCollectionConfig`.\n */\ntype DeepClone<T> = T extends object ? { [K in keyof T]: DeepClone<T[K]> } : T\n\nexport type MetaConfig = {\n /**\n * When `static`, a pre-made image will be used for all pages.\n * When `dynamic`, a unique image will be generated for each page based on page content and given overrides.\n * When `off`, no Open Graph images will be generated and the `/api/og` endpoint will be disabled. You can still provide custom images using the `openGraph.images` property.\n * @default 'dynamic'\n */\n defaultOGImageType?: 'dynamic' | 'off' | 'static'\n /**\n * String to append to the auto-generated <title> of admin pages\n * @example `\" - Custom CMS\"`\n */\n titleSuffix?: string\n} & DeepClone<Metadata>\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<RootLivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n req: PayloadRequest\n token: null | string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => null | Promise<null | string> | string\n\nexport type GraphQLInfo = {\n collections: {\n [slug: string]: Collection\n }\n globals: Globals\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n types: {\n arrayTypes: Record<string, GraphQL.GraphQLType>\n blockInputTypes: Record<string, GraphQL.GraphQLInputObjectType>\n blockTypes: Record<string, GraphQL.GraphQLObjectType>\n fallbackLocaleInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n groupTypes: Record<string, GraphQL.GraphQLObjectType>\n localeInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n tabTypes: Record<string, GraphQL.GraphQLObjectType>\n }\n}\nexport type GraphQLExtension = (\n graphQL: typeof GraphQL,\n context: {\n config: SanitizedConfig\n } & GraphQLInfo,\n) => Record<string, unknown>\n\nexport type InitOptions = {\n /**\n * Sometimes, with the local API, you might need to pass a config file directly, for example, serverless on Vercel\n * The passed config should match the config file, and if it doesn't, there could be mismatches between the admin UI\n * and the backend functionality\n */\n config: Promise<SanitizedConfig> | SanitizedConfig\n /**\n * If set to `true`, payload will initialize crons for things like autorunning jobs on initialization.\n *\n * @default false\n */\n cron?: boolean\n\n /**\n * Disable connect to the database on init\n */\n disableDBConnect?: boolean\n\n /**\n * Disable running of the `onInit` function\n */\n disableOnInit?: boolean\n\n importMap?: ImportMap\n\n /**\n * A function that is called immediately following startup that receives the Payload instance as it's only argument.\n */\n onInit?: (payload: Payload) => Promise<void> | void\n}\n\n/**\n * This result is calculated on the server\n * and then sent to the client allowing the dashboard to show accessible data and actions.\n *\n * If the result is `true`, the user has access.\n * If the result is an object, it is interpreted as a MongoDB query.\n *\n * @example `{ createdBy: { equals: id } }`\n *\n * @example `{ tenant: { in: tenantIds } }`\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type AccessResult = boolean | Where\n\nexport type AccessArgs<TData = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: TData\n /** ID of the resource being accessed */\n id?: DefaultDocumentIDType\n /** If true, the request is for a static file */\n isReadingStaticFile?: boolean\n /** The original request that requires an access check */\n req: PayloadRequest\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<TData = any> = (args: AccessArgs<TData>) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint = {\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n\n /**\n * Middleware that will be called when the path/method matches\n *\n * Compatible with Web Request/Response Model\n */\n handler: PayloadHandler\n /** HTTP method */\n method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n /**\n * Pattern that should match the path of the incoming request\n *\n * Compatible with the Express router\n */\n path: string\n /**\n * Please add \"root\" routes under the /api folder in the Payload Project.\n * https://nextjs.org/docs/app/api-reference/file-conventions/route\n *\n * @deprecated in 3.0\n */\n root?: never\n}\n\n/**\n * @deprecated\n * This type will be renamed in v4.\n * Use `DocumentViewComponent` instead.\n */\nexport type EditViewComponent = DocumentViewComponent\n\nexport type DocumentViewComponent = PayloadComponent<DocumentViewServerProps>\n\n/**\n * @deprecated\n * This type will be renamed in v4.\n * Use `DocumentViewConfig` instead.\n */\nexport type EditViewConfig = DocumentViewConfig\n\ntype BaseDocumentViewConfig = {\n actions?: CustomComponent[]\n meta?: MetaConfig\n tab?: DocumentTabConfig\n}\n\n/*\n If your view does not originate from a \"known\" key, e.g. `myCustomView`, then it is considered a \"custom\" view and can accept a `path`, etc.\n To render just a tab component without an accompanying view, you can omit the `path` and `Component` properties altogether.\n*/\nexport type CustomDocumentViewConfig =\n | ({\n Component: DocumentViewComponent\n path: `/${string}`\n } & BaseDocumentViewConfig)\n | ({\n Component?: DocumentViewComponent\n path?: never\n } & BaseDocumentViewConfig)\n\n/*\n If your view does originates from a \"known\" key, e.g. `api`, then it is considered a \"default\" view and cannot accept a `path`, etc.\n*/\nexport type DefaultDocumentViewConfig = {\n Component?: DocumentViewComponent\n} & BaseDocumentViewConfig\n\nexport type DocumentViewConfig = CustomDocumentViewConfig | DefaultDocumentViewConfig\n\nexport type Params = { [key: string]: string | string[] | undefined }\n\nexport type ServerProps = {\n readonly documentSubViewType?: DocumentSubViewTypes\n readonly i18n: I18nClient\n readonly id?: number | string\n readonly locale?: Locale\n readonly params?: Params\n readonly payload: Payload\n readonly permissions?: SanitizedPermissions\n readonly searchParams?: Params\n readonly user?: TypedUser\n readonly viewType?: ViewTypes\n readonly visibleEntities?: VisibleEntities\n}\n\nexport const serverProps: (keyof ServerProps)[] = [\n 'payload',\n 'i18n',\n 'locale',\n 'params',\n 'permissions',\n 'searchParams',\n 'permissions',\n]\n\nexport type Timezone = {\n label: string\n value: string\n}\n\ntype SupportedTimezonesFn = (args: { defaultTimezones: Timezone[] }) => Timezone[]\n\nexport type TimezonesConfig = {\n /**\n * The default timezone to use for the admin panel.\n */\n defaultTimezone?: string\n /**\n * Provide your own list of supported timezones for the admin panel\n *\n * Values should be IANA timezone names, eg. `America/New_York`\n *\n * We use `@date-fns/tz` to handle timezones\n */\n supportedTimezones?: SupportedTimezonesFn | Timezone[]\n}\n\ntype SanitizedTimezoneConfig = {\n supportedTimezones: Timezone[]\n} & Omit<TimezonesConfig, 'supportedTimezones'>\n\nexport type CustomComponent<TAdditionalProps extends object = Record<string, any>> =\n PayloadComponent<ServerProps & TAdditionalProps, TAdditionalProps>\n\nexport type Locale = {\n /**\n * value of supported locale\n * @example \"en\"\n */\n code: string\n /**\n * Code of another locale to use when reading documents with fallback, if not specified defaultLocale is used\n */\n fallbackLocale?: string | string[]\n /**\n * label of supported locale\n * @example \"English\"\n */\n label: Record<string, string> | string\n /**\n * if true, defaults textAligmnent on text fields to RTL\n */\n rtl?: boolean\n}\n\nexport type BaseLocalizationConfig = {\n /**\n * Locale for users that have not expressed their preference for a specific locale\n * @example `\"en\"`\n */\n defaultLocale: string\n /**\n * Change the locale used by the default Publish button.\n * If set to `all`, all locales will be published.\n * If set to `active`, only the locale currently being edited will be published.\n * The non-default option will be available via the secondary button.\n * @default 'all'\n */\n defaultLocalePublishOption?: 'active' | 'all'\n /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale`\n *\n * If false, then no requests will fallback unless a fallbackLocale is specified in the request.\n * @default true\n */\n fallback?: boolean\n /**\n * Define a function to filter the locales made available in Payload admin UI\n * based on user.\n */\n filterAvailableLocales?: (args: {\n locales: Locale[]\n req: PayloadRequest\n }) => Locale[] | Promise<Locale[]>\n}\n\nexport type LocalizationConfigWithNoLabels = Prettify<\n {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n locales: string[]\n } & BaseLocalizationConfig\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n {\n /**\n * List of supported locales with labels\n * @example {\n * label: 'English',\n * value: 'en',\n * rtl: false\n * }\n */\n locales: Locale[]\n } & BaseLocalizationConfig\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n localeCodes: string[]\n } & LocalizationConfigWithLabels\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\n\nexport type LabelFunction<TTranslationKeys = DefaultTranslationKeys> = (args: {\n i18n: I18nClient\n t: TFunction<TTranslationKeys>\n}) => string\n\nexport type StaticLabel = Record<string, string> | string\n\nexport type SharpDependency = (\n input?:\n | ArrayBuffer\n | Buffer\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | string\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array,\n options?: sharp.SharpOptions,\n) => sharp.Sharp\n\nexport type CORSConfig = {\n headers?: string[]\n origins: '*' | string[]\n}\n\nexport type AdminFunction = {\n args?: object\n path: string\n type: 'function'\n}\n\nexport type AdminComponent = {\n clientProps?: object\n path: string\n serverProps?: object\n type: 'component'\n}\n\nexport interface AdminDependencies {\n [key: string]: AdminComponent | AdminFunction\n}\n\nexport type FetchAPIFileUploadOptions = {\n /**\n * Returns a HTTP 413 when the file is bigger than the size limit if `true`.\n * Otherwise, it will add a `truncated = true` to the resulting file structure.\n * @default false\n */\n abortOnLimit?: boolean | undefined\n /**\n * Automatically creates the directory path specified in `.mv(filePathName)`\n * @default false\n */\n createParentPath?: boolean | undefined\n /**\n * Turn on/off upload process logging. Can be useful for troubleshooting.\n * @default false\n */\n debug?: boolean | undefined\n /**\n * User defined limit handler which will be invoked if the file is bigger than configured limits.\n * @default false\n */\n limitHandler?: ((args: { request: Request; size: number }) => void) | boolean | undefined\n /**\n * By default, `req.body` and `req.files` are flattened like this:\n * `{'name': 'John', 'hobbies[0]': 'Cinema', 'hobbies[1]': 'Bike'}\n *\n * When this option is enabled they are parsed in order to be nested like this:\n * `{'name': 'John', 'hobbies': ['Cinema', 'Bike']}`\n * @default false\n */\n parseNested?: boolean | undefined\n /**\n * Preserves filename extension when using `safeFileNames` option.\n * If set to `true`, will default to an extension length of `3`.\n * If set to `number`, this will be the max allowable extension length.\n * If an extension is smaller than the extension length, it remains untouched. If the extension is longer,\n * it is shifted.\n * @default false\n *\n * @example\n * // true\n * app.use(fileUpload({ safeFileNames: true, preserveExtension: true }));\n * // myFileName.ext --> myFileName.ext\n *\n * @example\n * // max extension length 2, extension shifted\n * app.use(fileUpload({ safeFileNames: true, preserveExtension: 2 }));\n * // myFileName.ext --> myFileNamee.xt\n */\n preserveExtension?: boolean | number | undefined\n /**\n * Response which will be send to client if file size limit exceeded when `abortOnLimit` set to `true`.\n * @default 'File size limit has been reached'\n */\n responseOnLimit?: string | undefined\n /**\n * Strips characters from the upload's filename.\n * You can use custom regex to determine what to strip.\n * If set to `true`, non-alphanumeric characters _except_ dashes and underscores will be stripped.\n * This option is off by default.\n * @default false\n *\n * @example\n * // strip slashes from file names\n * app.use(fileUpload({ safeFileNames: /\\\\/g }))\n *\n * @example\n * app.use(fileUpload({ safeFileNames: true }))\n */\n safeFileNames?: boolean | RegExp | undefined\n /**\n * Path to store temporary files.\n * Used along with the `useTempFiles` option. By default this module uses `'tmp'` folder\n * in the current working directory.\n * You can use trailing slash, but it is not necessary.\n * @default './tmp'\n */\n tempFileDir?: string | undefined\n /**\n * This defines how long to wait for data before aborting. Set to `0` if you want to turn off timeout checks.\n * @default 60_000\n */\n uploadTimeout?: number | undefined\n /**\n * Applies uri decoding to file names if set `true`.\n * @default false\n */\n uriDecodeFileNames?: boolean | undefined\n /**\n * By default this module uploads files into RAM.\n * Setting this option to `true` turns on using temporary files instead of utilising RAM.\n * This avoids memory overflow issues when uploading large files or in case of uploading\n * lots of files at same time.\n * @default false\n */\n useTempFiles?: boolean | undefined\n} & Partial<BusboyConfig>\n\nexport type ErrorResult = { data?: any; errors: unknown[]; stack?: string }\n\nexport type AfterErrorResult = {\n graphqlResult?: GraphQLFormattedError\n response?: Partial<ErrorResult> & Record<string, unknown>\n status?: number\n} | void\n\nexport type AfterErrorHookArgs = {\n /** The Collection that the hook is operating on. This will be undefined if the hook is executed from a non-collection endpoint or GraphQL. */\n collection?: SanitizedCollectionConfig\n /** \tCustom context passed between hooks */\n context: RequestContext\n /** The error that occurred. */\n error: Error\n /** The GraphQL result object, available if the hook is executed within a GraphQL context. */\n graphqlResult?: GraphQLFormattedError\n /** The Request object containing the currently authenticated user. */\n req: PayloadRequest\n /** The formatted error result object, available if the hook is executed from a REST context. */\n result?: ErrorResult\n}\n\nexport type ImportMapGenerators = Array<\n (props: {\n addToImportMap: AddToImportMap\n baseDir: string\n config: SanitizedConfig\n importMap: InternalImportMap\n imports: Imports\n }) => void\n>\n\nexport type AfterErrorHook = (\n args: AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type WidgetWidth = 'full' | 'large' | 'medium' | 'small' | 'x-large' | 'x-small'\n\nexport type Widget = {\n ComponentPath: string\n /**\n * Human-friendly label for the widget.\n * Supports i18n by passing an object with locale keys, or a function with `t` for translations.\n * If not provided, the label will be auto-generated from the slug.\n */\n label?: LabelFunction | StaticLabel\n maxWidth?: WidgetWidth\n minWidth?: WidgetWidth\n slug: string\n // TODO: Add fields\n // fields?: Field[]\n // Maybe:\n // ImageURL?: string // similar to Block\n}\n\n/**\n * Client-side widget type with resolved label (no functions).\n */\nexport type ClientWidget = {\n label?: StaticLabel\n maxWidth?: WidgetWidth\n minWidth?: WidgetWidth\n slug: string\n}\n\nexport type WidgetInstance = {\n // TODO: should be inferred from Widget Fields\n // data: Record<string, any>\n widgetSlug: string\n width?: WidgetWidth\n}\n\nexport type DashboardConfig = {\n defaultLayout?:\n | ((args: { req: PayloadRequest }) => Array<WidgetInstance> | Promise<Array<WidgetInstance>>)\n | Array<WidgetInstance>\n widgets: Array<Widget>\n}\n\nexport type SanitizedDashboardConfig = {\n widgets: Array<Omit<Widget, 'ComponentPath'>>\n}\n\n/**\n * This is the central configuration\n *\n * @see https://payloadcms.com/docs/configuration/overview\n */\nexport type Config = {\n /** Configure admin dashboard */\n admin?: {\n /** Automatically log in as a user */\n autoLogin?:\n | {\n /**\n * The email address of the user to login as\n */\n email?: string\n /** The password of the user to login as. This is only needed if `prefillOnly` is set to true */\n password?: string\n /**\n * If set to true, the login credentials will be prefilled but the user will still need to click the login button.\n *\n * @default false\n */\n prefillOnly?: boolean\n /** The username of the user to login as */\n username?: string\n }\n | false\n /**\n * Automatically refresh user tokens for users logged into the dashboard\n *\n * @default false\n */\n autoRefresh?: boolean\n /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?:\n | 'default'\n | 'gravatar'\n | {\n Component: PayloadComponent\n }\n\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/custom-components/overview\n */\n components?: {\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: CustomComponent[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: CustomComponent[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: CustomComponent[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: CustomComponent[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: CustomComponent[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: CustomComponent[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: CustomComponent[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: CustomComponent\n /** Replace the logo on the login page */\n Logo?: CustomComponent\n }\n /**\n * Add custom header to top of page globally\n */\n header?: CustomComponent[]\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: PayloadComponent<{ children?: React.ReactNode }, { children?: React.ReactNode }>[]\n /**\n * Add custom menu items to the navigation menu accessible via the gear icon.\n * These components will be rendered in a popup menu above the logout button.\n */\n settingsMenu?: CustomComponent[]\n /**\n * Replace or modify top-level admin routes, or add new ones:\n * + `Account` - `/admin/account`\n * + `Dashboard` - `/admin`\n * + `:path` - `/admin/:path`\n */\n views?: {\n /** Add custom admin views */\n [key: string]: AdminViewConfig\n /** Replace the account screen */\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n account?: AdminViewConfig\n /** Replace the admin homepage */\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n dashboard?: AdminViewConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Customize the dashboard widgets\n * @experimental This prop is subject to change in future releases.\n */\n dashboard?: DashboardConfig\n /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n dateFormat?: string\n /**\n * Each entry in this map generates an entry in the importMap.\n */\n dependencies?: AdminDependencies\n /**\n * @deprecated\n * This option is deprecated and will be removed in v4.\n * To disable the admin panel itself, delete your `/app/(payload)/admin` directory.\n * To disable all REST API and GraphQL endpoints, delete your `/app/(payload)/api` directory.\n * Note: If you've modified the default paths via `admin.routes`, delete those directories instead.\n */\n disable?: boolean\n importMap?: {\n /**\n * Automatically generate component map during development\n * @default true\n */\n autoGenerate?: boolean\n /**\n * The base directory for component paths starting with /.\n * @default process.cwd()\n **/\n baseDir?: string\n /**\n * You can use generators to add custom components to the component import map.\n * This allows you to import custom components in the admin panel.\n */\n generators?: ImportMapGenerators\n /**\n * If Payload cannot find the import map file location automatically,\n * you can manually provide it here.\n */\n importMapFile?: string\n }\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\n */\n livePreview?: RootLivePreviewConfig\n /** Base meta data to use for the Admin Panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: MetaConfig\n routes?: {\n /** The route for the account page.\n *\n * @default '/account'\n */\n account?: `/${string}`\n /** The route for the browse by folder view.\n *\n * @default '/browse-by-folder'\n */\n browseByFolder?: `/${string}`\n /** The route for the create first user page.\n *\n * @default '/create-first-user'\n */\n createFirstUser?: `/${string}`\n /** The route for the forgot password page.\n *\n * @default '/forgot'\n */\n forgot?: `/${string}`\n /** The route the user will be redirected to after being inactive for too long.\n *\n * @default '/logout-inactivity'\n */\n inactivity?: `/${string}`\n /** The route for the login page.\n *\n * @default '/login'\n */\n login?: `/${string}`\n /** The route for the logout page.\n *\n * @default '/logout'\n */\n logout?: `/${string}`\n /** The route for the reset password page.\n *\n * @default '/reset'\n */\n reset?: `/${string}`\n /** The route for the unauthorized page.\n *\n * @default '/unauthorized'\n */\n unauthorized?: `/${string}`\n }\n /**\n * Suppresses React hydration mismatch warnings during the hydration of the root <html> tag.\n * Useful in scenarios where the server-rendered HTML might intentionally differ from the client-rendered DOM.\n * @default false\n */\n suppressHydrationWarning?: boolean\n /**\n * Restrict the Admin Panel theme to use only one of your choice\n *\n * @default 'all' // The theme can be configured by users\n */\n theme?: 'all' | 'dark' | 'light'\n /**\n * Configure timezone related settings for the admin panel.\n */\n timezones?: TimezonesConfig\n /**\n * Configure toast message behavior and appearance in the admin panel.\n * Currently using [Sonner](https://sonner.emilkowal.ski) for toast notifications.\n *\n * @experimental This property is experimental and may change in future releases. Use at your own risk.\n */\n toast?: {\n /**\n * Time in milliseconds until the toast automatically closes.\n * @default 4000\n */\n duration?: number\n /**\n * If `true`, will expand the message stack so that all messages are shown simultaneously without user interaction.\n * Otherwise only the latest notification can be read until the user hovers the stack.\n * @default false\n */\n expand?: boolean\n /**\n * The maximum number of toasts that can be visible on the screen at once.\n * @default 5\n */\n limit?: number\n /**\n * The position of the toast on the screen.\n * @default 'bottom-right'\n */\n position?:\n | 'bottom-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'top-center'\n | 'top-left'\n | 'top-right'\n }\n /** The slug of a Collection that you want to be used to log in to the Admin dashboard. */\n user?: string\n }\n\n /**\n * Configure authentication-related Payload-wide settings.\n */\n auth?: {\n /**\n * Define which JWT identification methods you'd like to support for Payload's local auth strategy, as well as the order that they're retrieved in.\n * Defaults to ['JWT', 'Bearer', 'cookie]\n */\n jwtOrder: ('Bearer' | 'cookie' | 'JWT')[]\n }\n /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\n blocks?: Block[]\n /**\n * Pass additional options to the parser used to process `multipart/form-data` requests.\n * For example, a PATCH request containing HTML form data.\n * For example, you may want to increase the `limits` imposed by the parser.\n * Currently using @link {https://www.npmjs.com/package/busboy|busboy} under the hood.\n *\n * @experimental This property is experimental and may change in future releases. Use at your own risk.\n */\n bodyParser?: Partial<BusboyConfig>\n /**\n * Manage the datamodel of your application\n *\n * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n */\n collections?: CollectionConfig[]\n /**\n * Compatibility flags for prior Payload versions\n */\n compatibility?: {\n /**\n * By default, Payload will remove the `localized: true` property\n * from fields if a parent field is localized. Set this property\n * to `true` only if you have an existing Payload database from pre-3.0\n * that you would like to maintain without migrating. This is only\n * relevant for MongoDB databases.\n *\n * @todo Remove in v4\n */\n allowLocalizedWithinLocalized: true\n }\n /**\n * Prefix a string to all cookies that Payload sets.\n *\n * @default \"payload\"\n */\n cookiePrefix?: string\n /** Either a whitelist array of URLS to allow CORS requests from, or a wildcard string ('*') to accept incoming requests from any domain. */\n cors?: '*' | CORSConfig | string[]\n /** A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. */\n csrf?: string[]\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /** Pass in a database adapter for use on this project. */\n db: DatabaseAdapterResult\n /** Enable to expose more detailed error information. */\n debug?: boolean\n /**\n * If a user does not specify `depth` while requesting a resource, this depth will be used.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 2\n */\n defaultDepth?: number\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @default 40000\n */\n defaultMaxTextLength?: number\n /** Default richtext editor to use for richText fields */\n editor?: RichTextAdapterProvider<any, any, any>\n /**\n * Email Adapter\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailAdapter | Promise<EmailAdapter>\n /** Custom REST endpoints */\n endpoints?: Endpoint[]\n /**\n * Options for folder view within the admin panel\n *\n * @experimental This feature may change in minor versions until it is fully stable\n */\n folders?: false | RootFoldersConfiguration\n /**\n * @see https://payloadcms.com/docs/configuration/globals#global-configs\n */\n globals?: GlobalConfig[]\n /**\n * Manage the GraphQL API\n *\n * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n *\n * @see https://payloadcms.com/docs/graphql/overview\n */\n graphQL?: {\n disable?: boolean\n /**\n * Disable introspection queries in production.\n *\n * @default true\n */\n disableIntrospectionInProduction?: boolean\n /**\n * Disable the GraphQL Playground in production.\n *\n * @default true\n */\n disablePlaygroundInProduction?: boolean\n maxComplexity?: number\n /**\n * Function that returns an object containing keys to custom GraphQL mutations\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n mutations?: GraphQLExtension\n /**\n * Function that returns an object containing keys to custom GraphQL queries\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n queries?: GraphQLExtension\n /**\n * Filepath to write the generated schema to\n */\n schemaOutputFile?: string\n /**\n * Function that returns an array of validation rules to apply to the GraphQL schema\n *\n * @see https://payloadcms.com/docs/graphql/overview#custom-validation-rules\n */\n validationRules?: (args: GraphQL.ExecutionArgs) => GraphQL.ValidationRule[]\n }\n /**\n * Tap into Payload-wide hooks.\n *\n * @see https://payloadcms.com/docs/hooks/overview\n */\n hooks?: {\n afterError?: AfterErrorHook[]\n }\n /** i18n config settings */\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n i18n?: I18nOptions<{} | DefaultTranslationsObject> // loosen the type here to allow for custom translations\n /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n indexSortableFields?: boolean\n /**\n * @experimental There may be frequent breaking changes to this API\n */\n jobs?: JobsConfig\n /**\n * Pass in a KV adapter for use on this project.\n * @default `DatabaseKVAdapter` from:\n * ```ts\n * import { createDatabaseKVAdapter } from 'payload'\n * createDatabaseKVAdapter()\n * ```\n */\n kv?: KVAdapterResult\n /**\n * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: false | LocalizationConfig\n /**\n * Logger options, logger options with a destination stream, or an instantiated logger instance.\n *\n * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n *\n * ```ts\n * // Logger options only\n * logger: {\n * level: 'info',\n * }\n *\n * // Logger options with destination stream\n * logger: {\n * options: {\n * level: 'info',\n * },\n * destination: process.stdout\n * },\n *\n * // Logger instance\n * logger: pino({ name: 'my-logger' })\n *\n * ```\n */\n logger?: 'sync' | { destination?: DestinationStream; options: LoggerOptions } | PayloadLogger\n\n /**\n * Override the log level of errors for Payload's error handler or disable logging with `false`.\n * Levels can be any of the following: 'trace', 'debug', 'info', 'warn', 'error', 'fatal' or false.\n *\n * Default levels:\n * {\n `* APIError: 'error',\n `* AuthenticationError: 'error',\n `* ErrorDeletingFile: 'error',\n `* FileRetrievalError: 'error',\n `* FileUploadError: 'error',\n `* Forbidden: 'info',\n `* Locked: 'info',\n `* LockedAuth: 'error',\n `* MissingFile: 'info',\n `* NotFound: 'info',\n `* QueryError: 'error',\n `* ValidationError: 'info',\n * }\n */\n loggingLevels?: Partial<Record<ErrorName, false | Level>>\n\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 10\n */\n maxDepth?: number\n\n /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n onInit?: (payload: Payload) => Promise<void> | void\n /**\n * An array of Payload plugins.\n *\n * @see https://payloadcms.com/docs/plugins/overview\n */\n plugins?: Plugin[]\n /**\n * Allow you to save and share filters, columns, and sort orders for your collections.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n queryPresets?: {\n access: {\n create?: Access<QueryPreset>\n delete?: Access<QueryPreset>\n read?: Access<QueryPreset>\n update?: Access<QueryPreset>\n }\n constraints: {\n create?: QueryPresetConstraints\n delete?: QueryPresetConstraints\n read?: QueryPresetConstraints\n update?: QueryPresetConstraints\n }\n filterConstraints?: SelectField['filterOptions']\n labels?: CollectionConfig['labels']\n }\n /**\n * Control the routing structure that Payload binds itself to.\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n routes?: {\n /**\n * The route for the admin panel.\n * @example \"/my-admin\" or \"/\"\n * @default \"/admin\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n admin?: string\n /**\n * The base route for all REST API endpoints.\n * @default \"/api\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n api?: string\n /**\n * The base route for all GraphQL endpoints.\n * @default \"/graphql\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n graphQL?: string\n /**\n * The route for the GraphQL Playground.\n * @default \"/graphql-playground\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n graphQLPlayground?: string\n }\n /** Secure string that Payload will use for any encryption workflows */\n secret: string\n /**\n * Define the absolute URL of your app including the protocol, for example `https://example.org`.\n * No paths allowed, only protocol, domain and (optionally) port.\n *\n * @see https://payloadcms.com/docs/configuration/overview#options\n */\n serverURL?: string\n /**\n * Pass in a local copy of Sharp if you'd like to use it.\n *\n */\n sharp?: SharpDependency\n /** Send anonymous telemetry data about general usage. */\n telemetry?: boolean\n /** Control how typescript interfaces are generated from your collections. */\n typescript?: {\n /**\n * Automatically generate types during development\n * @default true\n */\n autoGenerate?: boolean\n\n /** Disable declare block in generated types file */\n declare?:\n | {\n /**\n * @internal internal use only to allow for multiple declarations within a monorepo and suppress the \"Duplicate identifier GeneratedTypes\" error\n *\n * Adds a @ts-ignore flag above the GeneratedTypes interface declaration\n *\n * @default false\n */\n ignoreTSError?: boolean\n }\n | false\n\n /** Filename to write the generated types to */\n outputFile?: string\n\n /**\n * Allows you to modify the base JSON schema that is generated during generate:types. This JSON schema will be used\n * to generate the TypeScript interfaces.\n */\n schema?: Array<\n (args: {\n collectionIDFieldTypes: {\n [key: string]: 'number' | 'string'\n }\n config: SanitizedConfig\n i18n: I18n\n jsonSchema: JSONSchema4\n }) => JSONSchema4\n >\n\n /**\n * Enable strict type safety for draft mode queries.\n * When enabled, find operations with draft: true will type required fields as optional.\n * @default false\n * @todo Remove in v4. Strict draft types will become the default behavior.\n */\n strictDraftTypes?: boolean\n }\n /**\n * Customize the handling of incoming file uploads for collections that have uploads enabled.\n */\n upload?: FetchAPIFileUploadOptions\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport type SanitizedConfig = {\n admin: {\n timezones: SanitizedTimezoneConfig\n } & DeepRequired<Config['admin']>\n blocks?: FlattenedBlock[]\n collections: SanitizedCollectionConfig[]\n /** Default richtext editor to use for richText fields */\n editor?: RichTextAdapter<any, any, any>\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n i18n: Required<I18nOptions>\n jobs: SanitizedJobsConfig\n localization: false | SanitizedLocalizationConfig\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n upload: {\n /**\n * Deduped list of adapters used in the project\n */\n adapters: string[]\n } & FetchAPIFileUploadOptions\n} & Omit<\n // TODO: DeepRequired breaks certain, advanced TypeScript types / certain type information is lost. We should remove it when possible.\n // E.g. in packages/ui/src/graphics/Account/index.tsx in getComponent, if avatar.Component is casted to what it's supposed to be,\n // the result type is different\n DeepRequired<Config>,\n | 'admin'\n | 'blocks'\n | 'collections'\n | 'editor'\n | 'endpoint'\n | 'globals'\n | 'i18n'\n | 'jobs'\n | 'localization'\n | 'upload'\n>\n\nexport type EditConfig = EditConfigWithoutRoot | EditConfigWithRoot\n\n/**\n * Replace or modify _all_ nested document views and routes, including the document header, controls, and tabs. This cannot be used in conjunction with other nested views.\n * + `root` - `/admin/collections/:collection/:id/**\\/*`\n * @link https://payloadcms.com/docs/custom-components/document-views#document-root\n */\nexport type EditConfigWithRoot = {\n api?: never\n default?: never\n livePreview?: never\n root: DefaultDocumentViewConfig\n version?: never\n versions?: never\n}\n\ntype KnownEditKeys = 'api' | 'default' | 'livePreview' | 'root' | 'version' | 'versions'\n\n/**\n * Replace or modify individual nested routes, or add new ones:\n * + `default` - `/admin/collections/:collection/:id`\n * + `api` - `/admin/collections/:collection/:id/api`\n * + `livePreview` - `/admin/collections/:collection/:id/preview`\n * + `references` - `/admin/collections/:collection/:id/references`\n * + `relationships` - `/admin/collections/:collection/:id/relationships`\n * + `versions` - `/admin/collections/:collection/:id/versions`\n * + `version` - `/admin/collections/:collection/:id/versions/:version`\n * + `customView` - `/admin/collections/:collection/:id/:path`\n *\n * To override the entire Edit View including all nested views, use the `root` key.\n *\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\nexport type EditConfigWithoutRoot = {\n [K in Exclude<string, KnownEditKeys>]: CustomDocumentViewConfig\n} & {\n api?: DefaultDocumentViewConfig\n default?: DefaultDocumentViewConfig\n livePreview?: DefaultDocumentViewConfig\n root?: never\n version?: DefaultDocumentViewConfig\n versions?: DefaultDocumentViewConfig\n}\n\nexport type EntityDescriptionComponent = CustomComponent\n\nexport type EntityDescriptionFunction = ({ t }: { t: TFunction }) => string\n\nexport type EntityDescription = EntityDescriptionFunction | Record<string, string> | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"mappings":"AA0aA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
1
+ {"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type {\n DefaultTranslationKeys,\n DefaultTranslationsObject,\n I18n,\n I18nClient,\n I18nOptions,\n TFunction,\n} from '@payloadcms/translations'\nimport type { BusboyConfig } from 'busboy'\nimport type GraphQL from 'graphql'\nimport type { GraphQLFormattedError } from 'graphql'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { Metadata } from 'next'\nimport type { DestinationStream, Level, LoggerOptions } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { RichTextAdapterProvider } from '../admin/RichText.js'\nimport type {\n DocumentSubViewTypes,\n DocumentTabConfig,\n DocumentViewServerProps,\n RichTextAdapter,\n} from '../admin/types.js'\nimport type { AdminViewConfig, ViewTypes, VisibleEntities } from '../admin/views/index.js'\nimport type { SanitizedPermissions } from '../auth/index.js'\nimport type {\n AddToImportMap,\n ImportMap,\n Imports,\n InternalImportMap,\n} from '../bin/generateImportMap/index.js'\nimport type {\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { ErrorName } from '../errors/types.js'\nimport type { RootFoldersConfiguration } from '../folders/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type {\n Block,\n DefaultDocumentIDType,\n FlattenedBlock,\n JobsConfig,\n KVAdapterResult,\n Payload,\n RequestContext,\n SelectField,\n TypedUser,\n} from '../index.js'\nimport type { QueryPreset, QueryPresetConstraints } from '../query-presets/types.js'\nimport type { SanitizedJobsConfig } from '../queues/config/types/index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\n\n/**\n * The string path pointing to the React component. If one of the generics is `never`, you effectively mark it as a server-only or client-only component.\n *\n * If it is `false` an empty component will be rendered.\n */\nexport type PayloadComponent<\n TComponentServerProps extends never | object = Record<string, any>,\n TComponentClientProps extends never | object = Record<string, any>,\n> = false | RawPayloadComponent<TComponentServerProps, TComponentClientProps> | string\n\n// We need the actual object as its own type, otherwise the infers for the PayloadClientReactComponent / PayloadServerReactComponent will not work due to the string union.\n// We also NEED to actually use those generics for this to work, thus they are part of the props.\nexport type RawPayloadComponent<\n TComponentServerProps extends never | object = Record<string, any>,\n TComponentClientProps extends never | object = Record<string, any>,\n> = {\n clientProps?: object | TComponentClientProps\n exportName?: string\n path: string\n serverProps?: object | TComponentServerProps\n}\n\nexport type PayloadComponentProps<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<\n infer TComponentServerProps,\n infer TComponentClientProps\n >\n ? TComponentClientProps | TComponentServerProps\n : never\n\nexport type PayloadClientComponentProps<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer _, infer TComponentClientProps>\n ? TComponentClientProps\n : never\n\nexport type PayloadServerComponentProps<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer TComponentServerProps, infer _>\n ? TComponentServerProps\n : never\n\nexport type PayloadReactComponent<TPayloadComponent> = React.FC<\n PayloadComponentProps<TPayloadComponent>\n>\n\n// This also ensures that if never is passed to TComponentClientProps, this entire type will be never.\n// => TypeScript will now ensure that users cannot even define the typed Server Components if the PayloadComponent is marked as\n// Client-Only (marked as Client-Only = TComponentServerProps is never)\nexport type PayloadClientReactComponent<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer _, infer TComponentClientProps>\n ? TComponentClientProps extends never\n ? never\n : React.FC<TComponentClientProps>\n : never\n\nexport type PayloadServerReactComponent<TPayloadComponent> =\n TPayloadComponent extends RawPayloadComponent<infer TComponentServerProps, infer _>\n ? TComponentServerProps extends never\n ? never\n : React.FC<TComponentServerProps>\n : never\n\nexport type ResolvedComponent<\n TComponentServerProps extends never | object,\n TComponentClientProps extends never | object,\n> = {\n clientProps?: TComponentClientProps\n Component: React.FC<TComponentClientProps | TComponentServerProps>\n serverProps?: TComponentServerProps\n}\n\nexport type BinScriptConfig = {\n key: string\n scriptPath: string\n}\n\nexport type BinScript = (config: SanitizedConfig) => Promise<void> | void\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\nexport type Plugin = (config: Config) => Config | Promise<Config>\n\nexport type LivePreviewURLType = null | string | undefined\n\nexport type LivePreviewConfig = {\n /**\n Device breakpoints to use for the `iframe` of the Live Preview window.\n Options are displayed in the Live Preview toolbar.\n The `responsive` breakpoint is included by default.\n */\n breakpoints?: {\n height: number | string\n label: string\n name: string\n width: number | string\n }[]\n /**\n * The URL of the frontend application. This will be rendered within an `iframe` as its `src`.\n * Payload will send a `window.postMessage()` to this URL with the document data in real-time.\n * The frontend application is responsible for receiving the message and updating the UI accordingly.\n * @see https://payloadcms.com/docs/live-preview/frontend\n *\n * To conditionally render Live Preview, use a function that returns `undefined` or `null`.\n *\n * Note: this function may run often if autosave is enabled with a small interval.\n * For performance, avoid long-running tasks or expensive operations within this function,\n * or if you need to do something more complex, cache your function as needed.\n */\n url?:\n | ((args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n /**\n * @deprecated\n * Use `req.payload` instead. This will be removed in the next major version.\n */\n payload: Payload\n req: PayloadRequest\n }) => LivePreviewURLType | Promise<LivePreviewURLType>)\n | LivePreviewURLType\n}\n\nexport type RootLivePreviewConfig = {\n collections?: string[]\n globals?: string[]\n} & LivePreviewConfig\n\nexport type OGImageConfig = {\n alt?: string\n height?: number | string\n type?: string\n url: string\n width?: number | string\n}\n\n/**\n * @todo find a way to remove the deep clone here.\n * It can probably be removed after the `DeepRequired` from `Config` to `SanitizedConfig` is removed.\n * Same with `CollectionConfig` to `SanitizedCollectionConfig`.\n */\ntype DeepClone<T> = T extends object ? { [K in keyof T]: DeepClone<T[K]> } : T\n\nexport type MetaConfig = {\n /**\n * When `static`, a pre-made image will be used for all pages.\n * When `dynamic`, a unique image will be generated for each page based on page content and given overrides.\n * When `off`, no Open Graph images will be generated and the `/api/og` endpoint will be disabled. You can still provide custom images using the `openGraph.images` property.\n * @default 'dynamic'\n */\n defaultOGImageType?: 'dynamic' | 'off' | 'static'\n /**\n * String to append to the auto-generated <title> of admin pages\n * @example `\" - Custom CMS\"`\n */\n titleSuffix?: string\n} & DeepClone<Metadata>\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<RootLivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n req: PayloadRequest\n token: null | string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => null | Promise<null | string> | string\n\nexport type GraphQLInfo = {\n collections: {\n [slug: string]: Collection\n }\n globals: Globals\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n types: {\n arrayTypes: Record<string, GraphQL.GraphQLType>\n blockInputTypes: Record<string, GraphQL.GraphQLInputObjectType>\n blockTypes: Record<string, GraphQL.GraphQLObjectType>\n fallbackLocaleInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n groupTypes: Record<string, GraphQL.GraphQLObjectType>\n localeInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n tabTypes: Record<string, GraphQL.GraphQLObjectType>\n }\n}\nexport type GraphQLExtension = (\n graphQL: typeof GraphQL,\n context: {\n config: SanitizedConfig\n } & GraphQLInfo,\n) => Record<string, unknown>\n\nexport type InitOptions = {\n /**\n * Sometimes, with the local API, you might need to pass a config file directly, for example, serverless on Vercel\n * The passed config should match the config file, and if it doesn't, there could be mismatches between the admin UI\n * and the backend functionality\n */\n config: Promise<SanitizedConfig> | SanitizedConfig\n /**\n * If set to `true`, payload will initialize crons for things like autorunning jobs on initialization.\n *\n * @default false\n */\n cron?: boolean\n\n /**\n * Disable connect to the database on init\n */\n disableDBConnect?: boolean\n\n /**\n * Disable running of the `onInit` function\n */\n disableOnInit?: boolean\n\n importMap?: ImportMap\n\n /**\n * A function that is called immediately following startup that receives the Payload instance as it's only argument.\n */\n onInit?: (payload: Payload) => Promise<void> | void\n}\n\n/**\n * This result is calculated on the server\n * and then sent to the client allowing the dashboard to show accessible data and actions.\n *\n * If the result is `true`, the user has access.\n * If the result is an object, it is interpreted as a MongoDB query.\n *\n * @example `{ createdBy: { equals: id } }`\n *\n * @example `{ tenant: { in: tenantIds } }`\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type AccessResult = boolean | Where\n\nexport type AccessArgs<TData = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: TData\n /** ID of the resource being accessed */\n id?: DefaultDocumentIDType\n /** If true, the request is for a static file */\n isReadingStaticFile?: boolean\n /** The original request that requires an access check */\n req: PayloadRequest\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<TData = any> = (args: AccessArgs<TData>) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint = {\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n\n /**\n * Middleware that will be called when the path/method matches\n *\n * Compatible with Web Request/Response Model\n */\n handler: PayloadHandler\n /** HTTP method */\n method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n /**\n * Pattern that should match the path of the incoming request\n *\n * Compatible with the Express router\n */\n path: string\n /**\n * Please add \"root\" routes under the /api folder in the Payload Project.\n * https://nextjs.org/docs/app/api-reference/file-conventions/route\n *\n * @deprecated in 3.0\n */\n root?: never\n}\n\n/**\n * @deprecated\n * This type will be renamed in v4.\n * Use `DocumentViewComponent` instead.\n */\nexport type EditViewComponent = DocumentViewComponent\n\nexport type DocumentViewComponent = PayloadComponent<DocumentViewServerProps>\n\n/**\n * @deprecated\n * This type will be renamed in v4.\n * Use `DocumentViewConfig` instead.\n */\nexport type EditViewConfig = DocumentViewConfig\n\ntype BaseDocumentViewConfig = {\n actions?: CustomComponent[]\n meta?: MetaConfig\n tab?: DocumentTabConfig\n}\n\n/*\n If your view does not originate from a \"known\" key, e.g. `myCustomView`, then it is considered a \"custom\" view and can accept a `path`, etc.\n To render just a tab component without an accompanying view, you can omit the `path` and `Component` properties altogether.\n*/\nexport type CustomDocumentViewConfig =\n | ({\n Component: DocumentViewComponent\n path: `/${string}`\n } & BaseDocumentViewConfig)\n | ({\n Component?: DocumentViewComponent\n path?: never\n } & BaseDocumentViewConfig)\n\n/*\n If your view does originates from a \"known\" key, e.g. `api`, then it is considered a \"default\" view and cannot accept a `path`, etc.\n*/\nexport type DefaultDocumentViewConfig = {\n Component?: DocumentViewComponent\n} & BaseDocumentViewConfig\n\nexport type DocumentViewConfig = CustomDocumentViewConfig | DefaultDocumentViewConfig\n\nexport type Params = { [key: string]: string | string[] | undefined }\n\nexport type ServerProps = {\n readonly documentSubViewType?: DocumentSubViewTypes\n readonly i18n: I18nClient\n readonly id?: number | string\n readonly locale?: Locale\n readonly params?: Params\n readonly payload: Payload\n readonly permissions?: SanitizedPermissions\n readonly searchParams?: Params\n readonly user?: TypedUser\n readonly viewType?: ViewTypes\n readonly visibleEntities?: VisibleEntities\n}\n\nexport const serverProps: (keyof ServerProps)[] = [\n 'payload',\n 'i18n',\n 'locale',\n 'params',\n 'permissions',\n 'searchParams',\n 'permissions',\n]\n\nexport type Timezone = {\n label: string\n value: string\n}\n\ntype SupportedTimezonesFn = (args: { defaultTimezones: Timezone[] }) => Timezone[]\n\nexport type TimezonesConfig = {\n /**\n * The default timezone to use for the admin panel.\n */\n defaultTimezone?: string\n /**\n * Provide your own list of supported timezones for the admin panel\n *\n * Values should be IANA timezone names, eg. `America/New_York`\n *\n * We use `@date-fns/tz` to handle timezones\n */\n supportedTimezones?: SupportedTimezonesFn | Timezone[]\n}\n\ntype SanitizedTimezoneConfig = {\n supportedTimezones: Timezone[]\n} & Omit<TimezonesConfig, 'supportedTimezones'>\n\nexport type CustomComponent<TAdditionalProps extends object = Record<string, any>> =\n PayloadComponent<ServerProps & TAdditionalProps, TAdditionalProps>\n\nexport type Locale = {\n /**\n * value of supported locale\n * @example \"en\"\n */\n code: string\n /**\n * Code of another locale to use when reading documents with fallback, if not specified defaultLocale is used\n */\n fallbackLocale?: string | string[]\n /**\n * label of supported locale\n * @example \"English\"\n */\n label: Record<string, string> | string\n /**\n * if true, defaults textAligmnent on text fields to RTL\n */\n rtl?: boolean\n}\n\nexport type BaseLocalizationConfig = {\n /**\n * Locale for users that have not expressed their preference for a specific locale\n * @example `\"en\"`\n */\n defaultLocale: string\n /**\n * Change the locale used by the default Publish button.\n * If set to `all`, all locales will be published.\n * If set to `active`, only the locale currently being edited will be published.\n * The non-default option will be available via the secondary button.\n * @default 'all'\n */\n defaultLocalePublishOption?: 'active' | 'all'\n /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale`\n *\n * If false, then no requests will fallback unless a fallbackLocale is specified in the request.\n * @default true\n */\n fallback?: boolean\n /**\n * Define a function to filter the locales made available in Payload admin UI\n * based on user.\n */\n filterAvailableLocales?: (args: {\n locales: Locale[]\n req: PayloadRequest\n }) => Locale[] | Promise<Locale[]>\n}\n\nexport type LocalizationConfigWithNoLabels = Prettify<\n {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n locales: string[]\n } & BaseLocalizationConfig\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n {\n /**\n * List of supported locales with labels\n * @example {\n * label: 'English',\n * value: 'en',\n * rtl: false\n * }\n */\n locales: Locale[]\n } & BaseLocalizationConfig\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n localeCodes: string[]\n } & LocalizationConfigWithLabels\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\n\nexport type LabelFunction<TTranslationKeys = DefaultTranslationKeys> = (args: {\n i18n: I18nClient\n t: TFunction<TTranslationKeys>\n}) => string\n\nexport type StaticLabel = Record<string, string> | string\n\nexport type SharpDependency = (\n input?:\n | ArrayBuffer\n | Buffer\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | string\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array,\n options?: sharp.SharpOptions,\n) => sharp.Sharp\n\nexport type CORSConfig = {\n headers?: string[]\n origins: '*' | string[]\n}\n\nexport type AdminFunction = {\n args?: object\n path: string\n type: 'function'\n}\n\nexport type AdminComponent = {\n clientProps?: object\n path: string\n serverProps?: object\n type: 'component'\n}\n\nexport interface AdminDependencies {\n [key: string]: AdminComponent | AdminFunction\n}\n\nexport type FetchAPIFileUploadOptions = {\n /**\n * Returns a HTTP 413 when the file is bigger than the size limit if `true`.\n * Otherwise, it will add a `truncated = true` to the resulting file structure.\n * @default false\n */\n abortOnLimit?: boolean | undefined\n /**\n * Automatically creates the directory path specified in `.mv(filePathName)`\n * @default false\n */\n createParentPath?: boolean | undefined\n /**\n * Turn on/off upload process logging. Can be useful for troubleshooting.\n * @default false\n */\n debug?: boolean | undefined\n /**\n * User defined limit handler which will be invoked if the file is bigger than configured limits.\n * @default false\n */\n limitHandler?: ((args: { request: Request; size: number }) => void) | boolean | undefined\n /**\n * By default, `req.body` and `req.files` are flattened like this:\n * `{'name': 'John', 'hobbies[0]': 'Cinema', 'hobbies[1]': 'Bike'}\n *\n * When this option is enabled they are parsed in order to be nested like this:\n * `{'name': 'John', 'hobbies': ['Cinema', 'Bike']}`\n * @default false\n */\n parseNested?: boolean | undefined\n /**\n * Preserves filename extension when using `safeFileNames` option.\n * If set to `true`, will default to an extension length of `3`.\n * If set to `number`, this will be the max allowable extension length.\n * If an extension is smaller than the extension length, it remains untouched. If the extension is longer,\n * it is shifted.\n * @default false\n *\n * @example\n * // true\n * app.use(fileUpload({ safeFileNames: true, preserveExtension: true }));\n * // myFileName.ext --> myFileName.ext\n *\n * @example\n * // max extension length 2, extension shifted\n * app.use(fileUpload({ safeFileNames: true, preserveExtension: 2 }));\n * // myFileName.ext --> myFileNamee.xt\n */\n preserveExtension?: boolean | number | undefined\n /**\n * Response which will be send to client if file size limit exceeded when `abortOnLimit` set to `true`.\n * @default 'File size limit has been reached'\n */\n responseOnLimit?: string | undefined\n /**\n * Strips characters from the upload's filename.\n * You can use custom regex to determine what to strip.\n * If set to `true`, non-alphanumeric characters _except_ dashes and underscores will be stripped.\n * This option is off by default.\n * @default false\n *\n * @example\n * // strip slashes from file names\n * app.use(fileUpload({ safeFileNames: /\\\\/g }))\n *\n * @example\n * app.use(fileUpload({ safeFileNames: true }))\n */\n safeFileNames?: boolean | RegExp | undefined\n /**\n * Path to store temporary files.\n * Used along with the `useTempFiles` option. By default this module uses `'tmp'` folder\n * in the current working directory.\n * You can use trailing slash, but it is not necessary.\n * @default './tmp'\n */\n tempFileDir?: string | undefined\n /**\n * This defines how long to wait for data before aborting. Set to `0` if you want to turn off timeout checks.\n * @default 60_000\n */\n uploadTimeout?: number | undefined\n /**\n * Applies uri decoding to file names if set `true`.\n * @default false\n */\n uriDecodeFileNames?: boolean | undefined\n /**\n * By default this module uploads files into RAM.\n * Setting this option to `true` turns on using temporary files instead of utilising RAM.\n * This avoids memory overflow issues when uploading large files or in case of uploading\n * lots of files at same time.\n * @default false\n */\n useTempFiles?: boolean | undefined\n} & Partial<BusboyConfig>\n\nexport type ErrorResult = {\n data?: any\n errors: {\n data?: Record<string, unknown>\n field?: string\n message?: string\n name?: string\n }[]\n stack?: string\n}\n\nexport type AfterErrorResult = {\n graphqlResult?: GraphQLFormattedError\n response?: Partial<ErrorResult> & Record<string, unknown>\n status?: number\n} | void\n\nexport type AfterErrorHookArgs = {\n /** The Collection that the hook is operating on. This will be undefined if the hook is executed from a non-collection endpoint or GraphQL. */\n collection?: SanitizedCollectionConfig\n /** \tCustom context passed between hooks */\n context: RequestContext\n /** The error that occurred. */\n error: Error\n /** The GraphQL result object, available if the hook is executed within a GraphQL context. */\n graphqlResult?: GraphQLFormattedError\n /** The Request object containing the currently authenticated user. */\n req: PayloadRequest\n /** The formatted error result object, available if the hook is executed from a REST context. */\n result?: ErrorResult\n}\n\nexport type ImportMapGenerators = Array<\n (props: {\n addToImportMap: AddToImportMap\n baseDir: string\n config: SanitizedConfig\n importMap: InternalImportMap\n imports: Imports\n }) => void\n>\n\nexport type AfterErrorHook = (\n args: AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type WidgetWidth = 'full' | 'large' | 'medium' | 'small' | 'x-large' | 'x-small'\n\nexport type Widget = {\n ComponentPath: string\n /**\n * Human-friendly label for the widget.\n * Supports i18n by passing an object with locale keys, or a function with `t` for translations.\n * If not provided, the label will be auto-generated from the slug.\n */\n label?: LabelFunction | StaticLabel\n maxWidth?: WidgetWidth\n minWidth?: WidgetWidth\n slug: string\n // TODO: Add fields\n // fields?: Field[]\n // Maybe:\n // ImageURL?: string // similar to Block\n}\n\n/**\n * Client-side widget type with resolved label (no functions).\n */\nexport type ClientWidget = {\n label?: StaticLabel\n maxWidth?: WidgetWidth\n minWidth?: WidgetWidth\n slug: string\n}\n\nexport type WidgetInstance = {\n // TODO: should be inferred from Widget Fields\n // data: Record<string, any>\n widgetSlug: string\n width?: WidgetWidth\n}\n\nexport type DashboardConfig = {\n defaultLayout?:\n | ((args: { req: PayloadRequest }) => Array<WidgetInstance> | Promise<Array<WidgetInstance>>)\n | Array<WidgetInstance>\n widgets: Array<Widget>\n}\n\nexport type SanitizedDashboardConfig = {\n widgets: Array<Omit<Widget, 'ComponentPath'>>\n}\n\n/**\n * This is the central configuration\n *\n * @see https://payloadcms.com/docs/configuration/overview\n */\nexport type Config = {\n /** Configure admin dashboard */\n admin?: {\n /** Automatically log in as a user */\n autoLogin?:\n | {\n /**\n * The email address of the user to login as\n */\n email?: string\n /** The password of the user to login as. This is only needed if `prefillOnly` is set to true */\n password?: string\n /**\n * If set to true, the login credentials will be prefilled but the user will still need to click the login button.\n *\n * @default false\n */\n prefillOnly?: boolean\n /** The username of the user to login as */\n username?: string\n }\n | false\n /**\n * Automatically refresh user tokens for users logged into the dashboard\n *\n * @default false\n */\n autoRefresh?: boolean\n /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?:\n | 'default'\n | 'gravatar'\n | {\n Component: PayloadComponent\n }\n\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/custom-components/overview\n */\n components?: {\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: CustomComponent[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: CustomComponent[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: CustomComponent[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: CustomComponent[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: CustomComponent[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: CustomComponent[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: CustomComponent[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: CustomComponent\n /** Replace the logo on the login page */\n Logo?: CustomComponent\n }\n /**\n * Add custom header to top of page globally\n */\n header?: CustomComponent[]\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: PayloadComponent<{ children?: React.ReactNode }, { children?: React.ReactNode }>[]\n /**\n * Add custom menu items to the navigation menu accessible via the gear icon.\n * These components will be rendered in a popup menu above the logout button.\n */\n settingsMenu?: CustomComponent[]\n /**\n * Replace or modify top-level admin routes, or add new ones:\n * + `Account` - `/admin/account`\n * + `Dashboard` - `/admin`\n * + `:path` - `/admin/:path`\n */\n views?: {\n /** Add custom admin views */\n [key: string]: AdminViewConfig\n /** Replace the account screen */\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n account?: AdminViewConfig\n /** Replace the admin homepage */\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n dashboard?: AdminViewConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Customize the dashboard widgets\n * @experimental This prop is subject to change in future releases.\n */\n dashboard?: DashboardConfig\n /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n dateFormat?: string\n /**\n * Each entry in this map generates an entry in the importMap.\n */\n dependencies?: AdminDependencies\n /**\n * @deprecated\n * This option is deprecated and will be removed in v4.\n * To disable the admin panel itself, delete your `/app/(payload)/admin` directory.\n * To disable all REST API and GraphQL endpoints, delete your `/app/(payload)/api` directory.\n * Note: If you've modified the default paths via `admin.routes`, delete those directories instead.\n */\n disable?: boolean\n importMap?: {\n /**\n * Automatically generate component map during development\n * @default true\n */\n autoGenerate?: boolean\n /**\n * The base directory for component paths starting with /.\n * @default process.cwd()\n **/\n baseDir?: string\n /**\n * You can use generators to add custom components to the component import map.\n * This allows you to import custom components in the admin panel.\n */\n generators?: ImportMapGenerators\n /**\n * If Payload cannot find the import map file location automatically,\n * you can manually provide it here.\n */\n importMapFile?: string\n }\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\n */\n livePreview?: RootLivePreviewConfig\n /** Base meta data to use for the Admin Panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: MetaConfig\n routes?: {\n /** The route for the account page.\n *\n * @default '/account'\n */\n account?: `/${string}`\n /** The route for the browse by folder view.\n *\n * @default '/browse-by-folder'\n */\n browseByFolder?: `/${string}`\n /** The route for the create first user page.\n *\n * @default '/create-first-user'\n */\n createFirstUser?: `/${string}`\n /** The route for the forgot password page.\n *\n * @default '/forgot'\n */\n forgot?: `/${string}`\n /** The route the user will be redirected to after being inactive for too long.\n *\n * @default '/logout-inactivity'\n */\n inactivity?: `/${string}`\n /** The route for the login page.\n *\n * @default '/login'\n */\n login?: `/${string}`\n /** The route for the logout page.\n *\n * @default '/logout'\n */\n logout?: `/${string}`\n /** The route for the reset password page.\n *\n * @default '/reset'\n */\n reset?: `/${string}`\n /** The route for the unauthorized page.\n *\n * @default '/unauthorized'\n */\n unauthorized?: `/${string}`\n }\n /**\n * Suppresses React hydration mismatch warnings during the hydration of the root <html> tag.\n * Useful in scenarios where the server-rendered HTML might intentionally differ from the client-rendered DOM.\n * @default false\n */\n suppressHydrationWarning?: boolean\n /**\n * Restrict the Admin Panel theme to use only one of your choice\n *\n * @default 'all' // The theme can be configured by users\n */\n theme?: 'all' | 'dark' | 'light'\n /**\n * Configure timezone related settings for the admin panel.\n */\n timezones?: TimezonesConfig\n /**\n * Configure toast message behavior and appearance in the admin panel.\n * Currently using [Sonner](https://sonner.emilkowal.ski) for toast notifications.\n *\n * @experimental This property is experimental and may change in future releases. Use at your own risk.\n */\n toast?: {\n /**\n * Time in milliseconds until the toast automatically closes.\n * @default 4000\n */\n duration?: number\n /**\n * If `true`, will expand the message stack so that all messages are shown simultaneously without user interaction.\n * Otherwise only the latest notification can be read until the user hovers the stack.\n * @default false\n */\n expand?: boolean\n /**\n * The maximum number of toasts that can be visible on the screen at once.\n * @default 5\n */\n limit?: number\n /**\n * The position of the toast on the screen.\n * @default 'bottom-right'\n */\n position?:\n | 'bottom-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'top-center'\n | 'top-left'\n | 'top-right'\n }\n /** The slug of a Collection that you want to be used to log in to the Admin dashboard. */\n user?: string\n }\n\n /**\n * Configure authentication-related Payload-wide settings.\n */\n auth?: {\n /**\n * Define which JWT identification methods you'd like to support for Payload's local auth strategy, as well as the order that they're retrieved in.\n * Defaults to ['JWT', 'Bearer', 'cookie]\n */\n jwtOrder: ('Bearer' | 'cookie' | 'JWT')[]\n }\n /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\n blocks?: Block[]\n /**\n * Pass additional options to the parser used to process `multipart/form-data` requests.\n * For example, a PATCH request containing HTML form data.\n * For example, you may want to increase the `limits` imposed by the parser.\n * Currently using @link {https://www.npmjs.com/package/busboy|busboy} under the hood.\n *\n * @experimental This property is experimental and may change in future releases. Use at your own risk.\n */\n bodyParser?: Partial<BusboyConfig>\n /**\n * Manage the datamodel of your application\n *\n * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n */\n collections?: CollectionConfig[]\n /**\n * Compatibility flags for prior Payload versions\n */\n compatibility?: {\n /**\n * By default, Payload will remove the `localized: true` property\n * from fields if a parent field is localized. Set this property\n * to `true` only if you have an existing Payload database from pre-3.0\n * that you would like to maintain without migrating. This is only\n * relevant for MongoDB databases.\n *\n * @todo Remove in v4\n */\n allowLocalizedWithinLocalized: true\n }\n /**\n * Prefix a string to all cookies that Payload sets.\n *\n * @default \"payload\"\n */\n cookiePrefix?: string\n /** Either a whitelist array of URLS to allow CORS requests from, or a wildcard string ('*') to accept incoming requests from any domain. */\n cors?: '*' | CORSConfig | string[]\n /** A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. */\n csrf?: string[]\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /** Pass in a database adapter for use on this project. */\n db: DatabaseAdapterResult\n /** Enable to expose more detailed error information. */\n debug?: boolean\n /**\n * If a user does not specify `depth` while requesting a resource, this depth will be used.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 2\n */\n defaultDepth?: number\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @default 40000\n */\n defaultMaxTextLength?: number\n /** Default richtext editor to use for richText fields */\n editor?: RichTextAdapterProvider<any, any, any>\n /**\n * Email Adapter\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailAdapter | Promise<EmailAdapter>\n /** Custom REST endpoints */\n endpoints?: Endpoint[]\n /**\n * Options for folder view within the admin panel\n *\n * @experimental This feature may change in minor versions until it is fully stable\n */\n folders?: false | RootFoldersConfiguration\n /**\n * @see https://payloadcms.com/docs/configuration/globals#global-configs\n */\n globals?: GlobalConfig[]\n /**\n * Manage the GraphQL API\n *\n * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n *\n * @see https://payloadcms.com/docs/graphql/overview\n */\n graphQL?: {\n disable?: boolean\n /**\n * Disable introspection queries in production.\n *\n * @default true\n */\n disableIntrospectionInProduction?: boolean\n /**\n * Disable the GraphQL Playground in production.\n *\n * @default true\n */\n disablePlaygroundInProduction?: boolean\n maxComplexity?: number\n /**\n * Function that returns an object containing keys to custom GraphQL mutations\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n mutations?: GraphQLExtension\n /**\n * Function that returns an object containing keys to custom GraphQL queries\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n queries?: GraphQLExtension\n /**\n * Filepath to write the generated schema to\n */\n schemaOutputFile?: string\n /**\n * Function that returns an array of validation rules to apply to the GraphQL schema\n *\n * @see https://payloadcms.com/docs/graphql/overview#custom-validation-rules\n */\n validationRules?: (args: GraphQL.ExecutionArgs) => GraphQL.ValidationRule[]\n }\n /**\n * Tap into Payload-wide hooks.\n *\n * @see https://payloadcms.com/docs/hooks/overview\n */\n hooks?: {\n afterError?: AfterErrorHook[]\n }\n /** i18n config settings */\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n i18n?: I18nOptions<{} | DefaultTranslationsObject> // loosen the type here to allow for custom translations\n /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n indexSortableFields?: boolean\n /**\n * @experimental There may be frequent breaking changes to this API\n */\n jobs?: JobsConfig\n /**\n * Pass in a KV adapter for use on this project.\n * @default `DatabaseKVAdapter` from:\n * ```ts\n * import { createDatabaseKVAdapter } from 'payload'\n * createDatabaseKVAdapter()\n * ```\n */\n kv?: KVAdapterResult\n /**\n * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: false | LocalizationConfig\n /**\n * Logger options, logger options with a destination stream, or an instantiated logger instance.\n *\n * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n *\n * ```ts\n * // Logger options only\n * logger: {\n * level: 'info',\n * }\n *\n * // Logger options with destination stream\n * logger: {\n * options: {\n * level: 'info',\n * },\n * destination: process.stdout\n * },\n *\n * // Logger instance\n * logger: pino({ name: 'my-logger' })\n *\n * ```\n */\n logger?: 'sync' | { destination?: DestinationStream; options: LoggerOptions } | PayloadLogger\n\n /**\n * Override the log level of errors for Payload's error handler or disable logging with `false`.\n * Levels can be any of the following: 'trace', 'debug', 'info', 'warn', 'error', 'fatal' or false.\n *\n * Default levels:\n * {\n `* APIError: 'error',\n `* AuthenticationError: 'error',\n `* ErrorDeletingFile: 'error',\n `* FileRetrievalError: 'error',\n `* FileUploadError: 'error',\n `* Forbidden: 'info',\n `* Locked: 'info',\n `* LockedAuth: 'error',\n `* MissingFile: 'info',\n `* NotFound: 'info',\n `* QueryError: 'error',\n `* ValidationError: 'info',\n * }\n */\n loggingLevels?: Partial<Record<ErrorName, false | Level>>\n\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 10\n */\n maxDepth?: number\n\n /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n onInit?: (payload: Payload) => Promise<void> | void\n /**\n * An array of Payload plugins.\n *\n * @see https://payloadcms.com/docs/plugins/overview\n */\n plugins?: Plugin[]\n /**\n * Allow you to save and share filters, columns, and sort orders for your collections.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n queryPresets?: {\n access: {\n create?: Access<QueryPreset>\n delete?: Access<QueryPreset>\n read?: Access<QueryPreset>\n update?: Access<QueryPreset>\n }\n constraints: {\n create?: QueryPresetConstraints\n delete?: QueryPresetConstraints\n read?: QueryPresetConstraints\n update?: QueryPresetConstraints\n }\n filterConstraints?: SelectField['filterOptions']\n labels?: CollectionConfig['labels']\n }\n /**\n * Control the routing structure that Payload binds itself to.\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n routes?: {\n /**\n * The route for the admin panel.\n * @example \"/my-admin\" or \"/\"\n * @default \"/admin\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n admin?: string\n /**\n * The base route for all REST API endpoints.\n * @default \"/api\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n api?: string\n /**\n * The base route for all GraphQL endpoints.\n * @default \"/graphql\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n graphQL?: string\n /**\n * The route for the GraphQL Playground.\n * @default \"/graphql-playground\"\n * @link https://payloadcms.com/docs/admin/overview#root-level-routes\n */\n graphQLPlayground?: string\n }\n /** Secure string that Payload will use for any encryption workflows */\n secret: string\n /**\n * Define the absolute URL of your app including the protocol, for example `https://example.org`.\n * No paths allowed, only protocol, domain and (optionally) port.\n *\n * @see https://payloadcms.com/docs/configuration/overview#options\n */\n serverURL?: string\n /**\n * Pass in a local copy of Sharp if you'd like to use it.\n *\n */\n sharp?: SharpDependency\n /** Send anonymous telemetry data about general usage. */\n telemetry?: boolean\n /** Control how typescript interfaces are generated from your collections. */\n typescript?: {\n /**\n * Automatically generate types during development\n * @default true\n */\n autoGenerate?: boolean\n\n /** Disable declare block in generated types file */\n declare?:\n | {\n /**\n * @internal internal use only to allow for multiple declarations within a monorepo and suppress the \"Duplicate identifier GeneratedTypes\" error\n *\n * Adds a @ts-ignore flag above the GeneratedTypes interface declaration\n *\n * @default false\n */\n ignoreTSError?: boolean\n }\n | false\n\n /** Filename to write the generated types to */\n outputFile?: string\n\n /**\n * Allows you to modify the base JSON schema that is generated during generate:types. This JSON schema will be used\n * to generate the TypeScript interfaces.\n */\n schema?: Array<\n (args: {\n collectionIDFieldTypes: {\n [key: string]: 'number' | 'string'\n }\n config: SanitizedConfig\n i18n: I18n\n jsonSchema: JSONSchema4\n }) => JSONSchema4\n >\n\n /**\n * Enable strict type safety for draft mode queries.\n * When enabled, find operations with draft: true will type required fields as optional.\n * @default false\n * @todo Remove in v4. Strict draft types will become the default behavior.\n */\n strictDraftTypes?: boolean\n }\n /**\n * Customize the handling of incoming file uploads for collections that have uploads enabled.\n */\n upload?: FetchAPIFileUploadOptions\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport type SanitizedConfig = {\n admin: {\n timezones: SanitizedTimezoneConfig\n } & DeepRequired<Config['admin']>\n blocks?: FlattenedBlock[]\n collections: SanitizedCollectionConfig[]\n /** Default richtext editor to use for richText fields */\n editor?: RichTextAdapter<any, any, any>\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n i18n: Required<I18nOptions>\n jobs: SanitizedJobsConfig\n localization: false | SanitizedLocalizationConfig\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n upload: {\n /**\n * Deduped list of adapters used in the project\n */\n adapters: string[]\n } & FetchAPIFileUploadOptions\n} & Omit<\n // TODO: DeepRequired breaks certain, advanced TypeScript types / certain type information is lost. We should remove it when possible.\n // E.g. in packages/ui/src/graphics/Account/index.tsx in getComponent, if avatar.Component is casted to what it's supposed to be,\n // the result type is different\n DeepRequired<Config>,\n | 'admin'\n | 'blocks'\n | 'collections'\n | 'editor'\n | 'endpoint'\n | 'globals'\n | 'i18n'\n | 'jobs'\n | 'localization'\n | 'upload'\n>\n\nexport type EditConfig = EditConfigWithoutRoot | EditConfigWithRoot\n\n/**\n * Replace or modify _all_ nested document views and routes, including the document header, controls, and tabs. This cannot be used in conjunction with other nested views.\n * + `root` - `/admin/collections/:collection/:id/**\\/*`\n * @link https://payloadcms.com/docs/custom-components/document-views#document-root\n */\nexport type EditConfigWithRoot = {\n api?: never\n default?: never\n livePreview?: never\n root: DefaultDocumentViewConfig\n version?: never\n versions?: never\n}\n\ntype KnownEditKeys = 'api' | 'default' | 'livePreview' | 'root' | 'version' | 'versions'\n\n/**\n * Replace or modify individual nested routes, or add new ones:\n * + `default` - `/admin/collections/:collection/:id`\n * + `api` - `/admin/collections/:collection/:id/api`\n * + `livePreview` - `/admin/collections/:collection/:id/preview`\n * + `references` - `/admin/collections/:collection/:id/references`\n * + `relationships` - `/admin/collections/:collection/:id/relationships`\n * + `versions` - `/admin/collections/:collection/:id/versions`\n * + `version` - `/admin/collections/:collection/:id/versions/:version`\n * + `customView` - `/admin/collections/:collection/:id/:path`\n *\n * To override the entire Edit View including all nested views, use the `root` key.\n *\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\nexport type EditConfigWithoutRoot = {\n [K in Exclude<string, KnownEditKeys>]: CustomDocumentViewConfig\n} & {\n api?: DefaultDocumentViewConfig\n default?: DefaultDocumentViewConfig\n livePreview?: DefaultDocumentViewConfig\n root?: never\n version?: DefaultDocumentViewConfig\n versions?: DefaultDocumentViewConfig\n}\n\nexport type EntityDescriptionComponent = CustomComponent\n\nexport type EntityDescriptionFunction = ({ t }: { t: TFunction }) => string\n\nexport type EntityDescription = EntityDescriptionFunction | Record<string, string> | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"mappings":"AA0aA,OAAO,MAAMA,cAAqC;IAChD;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
@@ -5563,7 +5563,12 @@ type FetchAPIFileUploadOptions = {
5563
5563
  } & Partial<BusboyConfig>;
5564
5564
  type ErrorResult = {
5565
5565
  data?: any;
5566
- errors: unknown[];
5566
+ errors: {
5567
+ data?: Record<string, unknown>;
5568
+ field?: string;
5569
+ message?: string;
5570
+ name?: string;
5571
+ }[];
5567
5572
  stack?: string;
5568
5573
  };
5569
5574
  type AfterErrorResult = {
@@ -12680,10 +12685,17 @@ type Args<T extends JsonObject = JsonObject> = {
12680
12685
  payload: Payload;
12681
12686
  publishSpecificLocale?: string;
12682
12687
  req?: PayloadRequest;
12688
+ returning?: boolean;
12683
12689
  select?: SelectType;
12684
12690
  snapshot?: any;
12685
12691
  };
12686
- declare const saveVersion: <TData extends JsonObject = JsonObject>({ id, autosave, collection, docWithLocales, draft, global, operation, payload, publishSpecificLocale, req, select, snapshot, }: Args<TData>) => Promise<JsonObject>;
12692
+ declare function saveVersion<TData extends JsonObject = JsonObject>(args: {
12693
+ returning: false;
12694
+ } & Args<TData>): Promise<null>;
12695
+ declare function saveVersion<TData extends JsonObject = JsonObject>(args: {
12696
+ returning: true;
12697
+ } & Args<TData>): Promise<JsonObject>;
12698
+ declare function saveVersion<TData extends JsonObject = JsonObject>(args: Omit<Args<TData>, 'returning'>): Promise<JsonObject>;
12687
12699
 
12688
12700
  type SchedulePublishTaskInput = {
12689
12701
  doc?: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/formatErrors.ts"],"sourcesContent":["import type { ErrorResult } from '../config/types.js'\nimport type { APIError } from '../errors/APIError.js'\n\nimport { APIErrorName } from '../errors/APIError.js'\nimport { ValidationErrorName } from '../errors/ValidationError.js'\n\nexport const formatErrors = (incoming: { [key: string]: unknown } | APIError): ErrorResult => {\n if (incoming) {\n // Cannot use `instanceof` to check error type: https://github.com/microsoft/TypeScript/issues/13965\n // Instead, get the prototype of the incoming error and check its constructor name\n const proto = Object.getPrototypeOf(incoming)\n\n // Payload 'ValidationError' and 'APIError'\n if (\n (proto.constructor.name === ValidationErrorName || proto.constructor.name === APIErrorName) &&\n incoming.data\n ) {\n return {\n errors: [\n {\n name: incoming.name,\n data: incoming.data,\n message: incoming.message,\n },\n ],\n }\n }\n\n // Mongoose 'ValidationError': https://mongoosejs.com/docs/api/error.html#Error.ValidationError\n if (proto.constructor.name === ValidationErrorName && 'errors' in incoming && incoming.errors) {\n return {\n errors: Object.keys(incoming.errors).reduce(\n (acc, key) => {\n acc.push({\n field: (incoming.errors as any)[key].path,\n message: (incoming.errors as any)[key].message,\n })\n return acc\n },\n [] as { field: string; message: string }[],\n ),\n }\n }\n\n if (Array.isArray(incoming.message)) {\n return {\n errors: incoming.message,\n }\n }\n\n if (incoming.name) {\n return {\n errors: [\n {\n message: incoming.message,\n },\n ],\n }\n }\n }\n\n return {\n errors: [\n {\n message: 'An unknown error occurred.',\n },\n ],\n }\n}\n"],"names":["APIErrorName","ValidationErrorName","formatErrors","incoming","proto","Object","getPrototypeOf","name","data","errors","message","keys","reduce","acc","key","push","field","path","Array","isArray"],"mappings":"AAGA,SAASA,YAAY,QAAQ,wBAAuB;AACpD,SAASC,mBAAmB,QAAQ,+BAA8B;AAElE,OAAO,MAAMC,eAAe,CAACC;IAC3B,IAAIA,UAAU;QACZ,oGAAoG;QACpG,kFAAkF;QAClF,MAAMC,QAAQC,OAAOC,cAAc,CAACH;QAEpC,2CAA2C;QAC3C,IACE,AAACC,CAAAA,MAAM,WAAW,CAACG,IAAI,KAAKN,uBAAuBG,MAAM,WAAW,CAACG,IAAI,KAAKP,YAAW,KACzFG,SAASK,IAAI,EACb;YACA,OAAO;gBACLC,QAAQ;oBACN;wBACEF,MAAMJ,SAASI,IAAI;wBACnBC,MAAML,SAASK,IAAI;wBACnBE,SAASP,SAASO,OAAO;oBAC3B;iBACD;YACH;QACF;QAEA,+FAA+F;QAC/F,IAAIN,MAAM,WAAW,CAACG,IAAI,KAAKN,uBAAuB,YAAYE,YAAYA,SAASM,MAAM,EAAE;YAC7F,OAAO;gBACLA,QAAQJ,OAAOM,IAAI,CAACR,SAASM,MAAM,EAAEG,MAAM,CACzC,CAACC,KAAKC;oBACJD,IAAIE,IAAI,CAAC;wBACPC,OAAO,AAACb,SAASM,MAAM,AAAQ,CAACK,IAAI,CAACG,IAAI;wBACzCP,SAAS,AAACP,SAASM,MAAM,AAAQ,CAACK,IAAI,CAACJ,OAAO;oBAChD;oBACA,OAAOG;gBACT,GACA,EAAE;YAEN;QACF;QAEA,IAAIK,MAAMC,OAAO,CAAChB,SAASO,OAAO,GAAG;YACnC,OAAO;gBACLD,QAAQN,SAASO,OAAO;YAC1B;QACF;QAEA,IAAIP,SAASI,IAAI,EAAE;YACjB,OAAO;gBACLE,QAAQ;oBACN;wBACEC,SAASP,SAASO,OAAO;oBAC3B;iBACD;YACH;QACF;IACF;IAEA,OAAO;QACLD,QAAQ;YACN;gBACEC,SAAS;YACX;SACD;IACH;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/formatErrors.ts"],"sourcesContent":["import type { ErrorResult } from '../config/types.js'\nimport type { APIError } from '../errors/APIError.js'\n\nimport { APIErrorName } from '../errors/APIError.js'\nimport { ValidationErrorName } from '../errors/ValidationError.js'\n\nexport const formatErrors = (incoming: { [key: string]: unknown } | APIError): ErrorResult => {\n if (incoming) {\n // Cannot use `instanceof` to check error type: https://github.com/microsoft/TypeScript/issues/13965\n // Instead, get the prototype of the incoming error and check its constructor name\n const proto = Object.getPrototypeOf(incoming)\n\n // Payload 'ValidationError' and 'APIError'\n if (\n (proto.constructor.name === ValidationErrorName || proto.constructor.name === APIErrorName) &&\n incoming.data\n ) {\n return {\n errors: [\n {\n name: incoming.name as string,\n data: incoming.data as Record<string, unknown>,\n message: incoming.message as string,\n },\n ],\n }\n }\n\n // Mongoose 'ValidationError': https://mongoosejs.com/docs/api/error.html#Error.ValidationError\n if (proto.constructor.name === ValidationErrorName && 'errors' in incoming && incoming.errors) {\n return {\n errors: Object.keys(incoming.errors).reduce(\n (acc, key) => {\n acc.push({\n field: (incoming.errors as any)[key].path,\n message: (incoming.errors as any)[key].message,\n })\n return acc\n },\n [] as { field: string; message: string }[],\n ),\n }\n }\n\n if (Array.isArray(incoming.message)) {\n return {\n errors: incoming.message,\n }\n }\n\n if (incoming.name) {\n return {\n errors: [\n {\n message: incoming.message as string,\n },\n ],\n }\n }\n }\n\n return {\n errors: [\n {\n message: 'An unknown error occurred.',\n },\n ],\n }\n}\n"],"names":["APIErrorName","ValidationErrorName","formatErrors","incoming","proto","Object","getPrototypeOf","name","data","errors","message","keys","reduce","acc","key","push","field","path","Array","isArray"],"mappings":"AAGA,SAASA,YAAY,QAAQ,wBAAuB;AACpD,SAASC,mBAAmB,QAAQ,+BAA8B;AAElE,OAAO,MAAMC,eAAe,CAACC;IAC3B,IAAIA,UAAU;QACZ,oGAAoG;QACpG,kFAAkF;QAClF,MAAMC,QAAQC,OAAOC,cAAc,CAACH;QAEpC,2CAA2C;QAC3C,IACE,AAACC,CAAAA,MAAM,WAAW,CAACG,IAAI,KAAKN,uBAAuBG,MAAM,WAAW,CAACG,IAAI,KAAKP,YAAW,KACzFG,SAASK,IAAI,EACb;YACA,OAAO;gBACLC,QAAQ;oBACN;wBACEF,MAAMJ,SAASI,IAAI;wBACnBC,MAAML,SAASK,IAAI;wBACnBE,SAASP,SAASO,OAAO;oBAC3B;iBACD;YACH;QACF;QAEA,+FAA+F;QAC/F,IAAIN,MAAM,WAAW,CAACG,IAAI,KAAKN,uBAAuB,YAAYE,YAAYA,SAASM,MAAM,EAAE;YAC7F,OAAO;gBACLA,QAAQJ,OAAOM,IAAI,CAACR,SAASM,MAAM,EAAEG,MAAM,CACzC,CAACC,KAAKC;oBACJD,IAAIE,IAAI,CAAC;wBACPC,OAAO,AAACb,SAASM,MAAM,AAAQ,CAACK,IAAI,CAACG,IAAI;wBACzCP,SAAS,AAACP,SAASM,MAAM,AAAQ,CAACK,IAAI,CAACJ,OAAO;oBAChD;oBACA,OAAOG;gBACT,GACA,EAAE;YAEN;QACF;QAEA,IAAIK,MAAMC,OAAO,CAAChB,SAASO,OAAO,GAAG;YACnC,OAAO;gBACLD,QAAQN,SAASO,OAAO;YAC1B;QACF;QAEA,IAAIP,SAASI,IAAI,EAAE;YACjB,OAAO;gBACLE,QAAQ;oBACN;wBACEC,SAASP,SAASO,OAAO;oBAC3B;iBACD;YACH;QACF;IACF;IAEA,OAAO;QACLD,QAAQ;YACN;gBACEC,SAAS;YACX;SACD;IACH;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"handleEndpoints.d.ts","sourceRoot":"","sources":["../../src/utilities/handleEndpoints.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA4B,eAAe,EAAE,MAAM,oBAAoB,CAAA;AA0BnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,eAAe,kFAMzB;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,OAAO,CAAC,QAAQ,CA8MnB,CAAA"}
1
+ {"version":3,"file":"handleEndpoints.d.ts","sourceRoot":"","sources":["../../src/utilities/handleEndpoints.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA4B,eAAe,EAAE,MAAM,oBAAoB,CAAA;AA0BnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,eAAe,kFAMzB;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,OAAO,CAAC,QAAQ,CAgNnB,CAAA"}
@@ -101,15 +101,6 @@ const notFoundResponse = (req, pathname)=>{
101
101
  payloadInstanceCacheKey,
102
102
  request
103
103
  });
104
- if (req.method?.toLowerCase() === 'options') {
105
- return Response.json({}, {
106
- headers: headersWithCors({
107
- headers: new Headers(),
108
- req
109
- }),
110
- status: 200
111
- });
112
- }
113
104
  const { payload } = req;
114
105
  const { config } = payload;
115
106
  const pathname = path ?? new URL(req.url).pathname;
@@ -191,6 +182,17 @@ const notFoundResponse = (req, pathname)=>{
191
182
  handler = endpoint.handler;
192
183
  }
193
184
  if (!handler) {
185
+ // If no custom handler found and this is an OPTIONS request,
186
+ // return default CORS response for preflight requests
187
+ if (req.method?.toLowerCase() === 'options') {
188
+ return Response.json({}, {
189
+ headers: headersWithCors({
190
+ headers: new Headers(),
191
+ req
192
+ }),
193
+ status: 200
194
+ });
195
+ }
194
196
  return notFoundResponse(req, pathname);
195
197
  }
196
198
  const response = await handler(req);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/handleEndpoints.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\nimport { match } from 'path-to-regexp'\n\nimport type { Collection } from '../collections/config/types.js'\nimport type { Endpoint, PayloadHandler, SanitizedConfig } from '../config/types.js'\nimport type { APIError } from '../errors/APIError.js'\nimport type { GlobalConfig } from '../globals/config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { createPayloadRequest } from './createPayloadRequest.js'\nimport { formatAdminURL } from './formatAdminURL.js'\nimport { headersWithCors } from './headersWithCors.js'\nimport { mergeHeaders } from './mergeHeaders.js'\nimport { routeError } from './routeError.js'\n\nconst notFoundResponse = (req: PayloadRequest, pathname?: string) => {\n return Response.json(\n {\n message: `Route not found \"${pathname ?? new URL(req.url!).pathname}\"`,\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.NOT_FOUND,\n },\n )\n}\n\n/**\n * Attaches the Payload REST API to any backend framework that uses Fetch Request/Response\n * like Next.js (app router), Remix, Bun, Hono.\n *\n * ### Example: Using Hono\n * ```ts\n * import { handleEndpoints } from 'payload';\n * import { serve } from '@hono/node-server';\n * import { loadEnv } from 'payload/node';\n *\n * const port = 3001;\n * loadEnv();\n *\n * const { default: config } = await import('@payload-config');\n *\n * const server = serve({\n * fetch: async (request) => {\n * const response = await handleEndpoints({\n * config,\n * request: request.clone(),\n * });\n *\n * return response;\n * },\n * port,\n * });\n *\n * server.on('listening', () => {\n * console.log(`API server is listening on http://localhost:${port}/api`);\n * });\n * ```\n */\nexport const handleEndpoints = async ({\n basePath = '',\n config: incomingConfig,\n path,\n payloadInstanceCacheKey,\n request,\n}: {\n basePath?: string\n config: Promise<SanitizedConfig> | SanitizedConfig\n /** Override path from the request */\n path?: string\n payloadInstanceCacheKey?: string\n request: Request\n}): Promise<Response> => {\n let handler!: PayloadHandler\n let req: PayloadRequest\n let collection!: Collection\n\n // This can be used against GET request search params size limit.\n // Instead you can do POST request with a text body as search params.\n // We use this internally for relationships querying on the frontend\n // packages/ui/src/fields/Relationship/index.tsx\n if (\n request.method.toLowerCase() === 'post' &&\n (request.headers.get('X-Payload-HTTP-Method-Override') === 'GET' ||\n request.headers.get('X-HTTP-Method-Override') === 'GET')\n ) {\n let url = request.url\n let data: any = undefined\n\n if (request.headers.get('Content-Type') === 'application/x-www-form-urlencoded') {\n const search = await request.text()\n url = `${request.url}?${search}`\n } else if (request.headers.get('Content-Type') === 'application/json') {\n // May not be supported by every endpoint\n data = await request.json()\n\n // locale and fallbackLocale is read by createPayloadRequest to populate req.locale and req.fallbackLocale\n // => add to searchParams\n if (data?.locale) {\n url += `?locale=${data.locale}`\n }\n if (data?.fallbackLocale) {\n url += `&fallbackLocale=${data.depth}`\n }\n }\n\n const req = new Request(url, {\n // @ts-expect-error // TODO: check if this is required\n cache: request.cache,\n credentials: request.credentials,\n headers: request.headers,\n method: 'GET',\n signal: request.signal,\n })\n\n if (data) {\n // @ts-expect-error attach data to request - less overhead than using urlencoded\n req.data = data\n }\n\n const response = await handleEndpoints({\n basePath,\n config: incomingConfig,\n path,\n payloadInstanceCacheKey,\n request: req,\n })\n\n return response\n }\n\n try {\n req = await createPayloadRequest({\n canSetHeaders: true,\n config: incomingConfig,\n payloadInstanceCacheKey,\n request,\n })\n\n if (req.method?.toLowerCase() === 'options') {\n return Response.json(\n {},\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: 200,\n },\n )\n }\n\n const { payload } = req\n const { config } = payload\n\n const pathname = path ?? new URL(req.url!).pathname\n const baseAPIPath = formatAdminURL({\n apiRoute: config.routes.api,\n path: '',\n })\n\n if (!pathname.startsWith(baseAPIPath)) {\n return notFoundResponse(req, pathname)\n }\n\n // /api/posts/route -> /posts/route\n let adjustedPathname = pathname.replace(baseAPIPath, '')\n\n let isGlobals = false\n\n // /globals/header/route -> /header/route\n if (adjustedPathname.startsWith('/globals')) {\n isGlobals = true\n adjustedPathname = adjustedPathname.replace('/globals', '')\n }\n\n const segments = adjustedPathname.split('/')\n // remove empty string first element\n segments.shift()\n\n const firstParam = segments[0]\n\n let globalConfig!: GlobalConfig\n\n // first param can be a global slug or collection slug, find the relevant config\n if (firstParam) {\n if (isGlobals) {\n globalConfig = payload.globals.config.find((each) => each.slug === firstParam)!\n } else if (payload.collections[firstParam]) {\n collection = payload.collections[firstParam]\n }\n }\n\n let endpoints: Endpoint[] | false = config.endpoints\n\n if (collection) {\n endpoints = collection.config.endpoints\n // /posts/route -> /route\n adjustedPathname = adjustedPathname.replace(`/${collection.config.slug}`, '')\n } else if (globalConfig) {\n // /header/route -> /route\n adjustedPathname = adjustedPathname.replace(`/${globalConfig.slug}`, '')\n endpoints = globalConfig.endpoints!\n }\n\n // sanitize when endpoint.path is '/'\n if (adjustedPathname === '') {\n adjustedPathname = '/'\n }\n\n if (endpoints === false) {\n return Response.json(\n {\n message: `Cannot ${req.method?.toUpperCase()} ${req.url}`,\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.NOT_IMPLEMENTED,\n },\n )\n }\n\n // Find the relevant endpoint configuration\n const endpoint = endpoints?.find((endpoint) => {\n if (endpoint.method !== req.method?.toLowerCase()) {\n return false\n }\n\n const pathMatchFn = match(endpoint.path, { decode: decodeURIComponent })\n\n const matchResult = pathMatchFn(adjustedPathname)\n\n if (!matchResult) {\n return false\n }\n\n req.routeParams = matchResult.params as Record<string, unknown>\n\n // Inject to routeParams the slug as well so it can be used later\n if (collection) {\n req.routeParams.collection = collection.config.slug\n } else if (globalConfig) {\n req.routeParams.global = globalConfig.slug\n }\n\n return true\n })\n\n if (endpoint) {\n handler = endpoint.handler\n }\n\n if (!handler) {\n return notFoundResponse(req, pathname)\n }\n\n const response = await handler(req)\n\n return new Response(response.body, {\n headers: headersWithCors({\n headers: mergeHeaders(req.responseHeaders ?? new Headers(), response.headers),\n req,\n }),\n status: response.status,\n statusText: response.statusText,\n })\n } catch (_err) {\n const err = _err as APIError\n return routeError({\n collection,\n config: incomingConfig,\n err,\n req: req!,\n })\n }\n}\n"],"names":["status","httpStatus","match","createPayloadRequest","formatAdminURL","headersWithCors","mergeHeaders","routeError","notFoundResponse","req","pathname","Response","json","message","URL","url","headers","Headers","NOT_FOUND","handleEndpoints","basePath","config","incomingConfig","path","payloadInstanceCacheKey","request","handler","collection","method","toLowerCase","get","data","undefined","search","text","locale","fallbackLocale","depth","Request","cache","credentials","signal","response","canSetHeaders","payload","baseAPIPath","apiRoute","routes","api","startsWith","adjustedPathname","replace","isGlobals","segments","split","shift","firstParam","globalConfig","globals","find","each","slug","collections","endpoints","toUpperCase","NOT_IMPLEMENTED","endpoint","pathMatchFn","decode","decodeURIComponent","matchResult","routeParams","params","global","body","responseHeaders","statusText","_err","err"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAClD,SAASC,KAAK,QAAQ,iBAAgB;AAQtC,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,UAAU,QAAQ,kBAAiB;AAE5C,MAAMC,mBAAmB,CAACC,KAAqBC;IAC7C,OAAOC,SAASC,IAAI,CAClB;QACEC,SAAS,CAAC,iBAAiB,EAAEH,YAAY,IAAII,IAAIL,IAAIM,GAAG,EAAGL,QAAQ,CAAC,CAAC,CAAC;IACxE,GACA;QACEM,SAASX,gBAAgB;YACvBW,SAAS,IAAIC;YACbR;QACF;QACAT,QAAQC,WAAWiB,SAAS;IAC9B;AAEJ;AAEA;;;;;;;;;;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,CAACE,MAAM,GAAGhB,aAAaI,IAAI;YAC5C;YAEA,OAAO;QACT;QAEA,IAAIK,UAAU;YACZxC,UAAUwC,SAASxC,OAAO;QAC5B;QAEA,IAAI,CAACA,SAAS;YACZ,OAAOlB,iBAAiBC,KAAKC;QAC/B;QAEA,MAAMgC,WAAW,MAAMhB,QAAQjB;QAE/B,OAAO,IAAIE,SAAS+B,SAASgC,IAAI,EAAE;YACjC1D,SAASX,gBAAgB;gBACvBW,SAASV,aAAaG,IAAIkE,eAAe,IAAI,IAAI1D,WAAWyB,SAAS1B,OAAO;gBAC5EP;YACF;YACAT,QAAQ0C,SAAS1C,MAAM;YACvB4E,YAAYlC,SAASkC,UAAU;QACjC;IACF,EAAE,OAAOC,MAAM;QACb,MAAMC,MAAMD;QACZ,OAAOtE,WAAW;YAChBoB;YACAN,QAAQC;YACRwD;YACArE,KAAKA;QACP;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/handleEndpoints.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\nimport { match } from 'path-to-regexp'\n\nimport type { Collection } from '../collections/config/types.js'\nimport type { Endpoint, PayloadHandler, SanitizedConfig } from '../config/types.js'\nimport type { APIError } from '../errors/APIError.js'\nimport type { GlobalConfig } from '../globals/config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { createPayloadRequest } from './createPayloadRequest.js'\nimport { formatAdminURL } from './formatAdminURL.js'\nimport { headersWithCors } from './headersWithCors.js'\nimport { mergeHeaders } from './mergeHeaders.js'\nimport { routeError } from './routeError.js'\n\nconst notFoundResponse = (req: PayloadRequest, pathname?: string) => {\n return Response.json(\n {\n message: `Route not found \"${pathname ?? new URL(req.url!).pathname}\"`,\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.NOT_FOUND,\n },\n )\n}\n\n/**\n * Attaches the Payload REST API to any backend framework that uses Fetch Request/Response\n * like Next.js (app router), Remix, Bun, Hono.\n *\n * ### Example: Using Hono\n * ```ts\n * import { handleEndpoints } from 'payload';\n * import { serve } from '@hono/node-server';\n * import { loadEnv } from 'payload/node';\n *\n * const port = 3001;\n * loadEnv();\n *\n * const { default: config } = await import('@payload-config');\n *\n * const server = serve({\n * fetch: async (request) => {\n * const response = await handleEndpoints({\n * config,\n * request: request.clone(),\n * });\n *\n * return response;\n * },\n * port,\n * });\n *\n * server.on('listening', () => {\n * console.log(`API server is listening on http://localhost:${port}/api`);\n * });\n * ```\n */\nexport const handleEndpoints = async ({\n basePath = '',\n config: incomingConfig,\n path,\n payloadInstanceCacheKey,\n request,\n}: {\n basePath?: string\n config: Promise<SanitizedConfig> | SanitizedConfig\n /** Override path from the request */\n path?: string\n payloadInstanceCacheKey?: string\n request: Request\n}): Promise<Response> => {\n let handler!: PayloadHandler\n let req: PayloadRequest\n let collection!: Collection\n\n // This can be used against GET request search params size limit.\n // Instead you can do POST request with a text body as search params.\n // We use this internally for relationships querying on the frontend\n // packages/ui/src/fields/Relationship/index.tsx\n if (\n request.method.toLowerCase() === 'post' &&\n (request.headers.get('X-Payload-HTTP-Method-Override') === 'GET' ||\n request.headers.get('X-HTTP-Method-Override') === 'GET')\n ) {\n let url = request.url\n let data: any = undefined\n\n if (request.headers.get('Content-Type') === 'application/x-www-form-urlencoded') {\n const search = await request.text()\n url = `${request.url}?${search}`\n } else if (request.headers.get('Content-Type') === 'application/json') {\n // May not be supported by every endpoint\n data = await request.json()\n\n // locale and fallbackLocale is read by createPayloadRequest to populate req.locale and req.fallbackLocale\n // => add to searchParams\n if (data?.locale) {\n url += `?locale=${data.locale}`\n }\n if (data?.fallbackLocale) {\n url += `&fallbackLocale=${data.depth}`\n }\n }\n\n const req = new Request(url, {\n // @ts-expect-error // TODO: check if this is required\n cache: request.cache,\n credentials: request.credentials,\n headers: request.headers,\n method: 'GET',\n signal: request.signal,\n })\n\n if (data) {\n // @ts-expect-error attach data to request - less overhead than using urlencoded\n req.data = data\n }\n\n const response = await handleEndpoints({\n basePath,\n config: incomingConfig,\n path,\n payloadInstanceCacheKey,\n request: req,\n })\n\n return response\n }\n\n try {\n req = await createPayloadRequest({\n canSetHeaders: true,\n config: incomingConfig,\n payloadInstanceCacheKey,\n request,\n })\n\n const { payload } = req\n const { config } = payload\n\n const pathname = path ?? new URL(req.url!).pathname\n const baseAPIPath = formatAdminURL({\n apiRoute: config.routes.api,\n path: '',\n })\n\n if (!pathname.startsWith(baseAPIPath)) {\n return notFoundResponse(req, pathname)\n }\n\n // /api/posts/route -> /posts/route\n let adjustedPathname = pathname.replace(baseAPIPath, '')\n\n let isGlobals = false\n\n // /globals/header/route -> /header/route\n if (adjustedPathname.startsWith('/globals')) {\n isGlobals = true\n adjustedPathname = adjustedPathname.replace('/globals', '')\n }\n\n const segments = adjustedPathname.split('/')\n // remove empty string first element\n segments.shift()\n\n const firstParam = segments[0]\n\n let globalConfig!: GlobalConfig\n\n // first param can be a global slug or collection slug, find the relevant config\n if (firstParam) {\n if (isGlobals) {\n globalConfig = payload.globals.config.find((each) => each.slug === firstParam)!\n } else if (payload.collections[firstParam]) {\n collection = payload.collections[firstParam]\n }\n }\n\n let endpoints: Endpoint[] | false = config.endpoints\n\n if (collection) {\n endpoints = collection.config.endpoints\n // /posts/route -> /route\n adjustedPathname = adjustedPathname.replace(`/${collection.config.slug}`, '')\n } else if (globalConfig) {\n // /header/route -> /route\n adjustedPathname = adjustedPathname.replace(`/${globalConfig.slug}`, '')\n endpoints = globalConfig.endpoints!\n }\n\n // sanitize when endpoint.path is '/'\n if (adjustedPathname === '') {\n adjustedPathname = '/'\n }\n\n if (endpoints === false) {\n return Response.json(\n {\n message: `Cannot ${req.method?.toUpperCase()} ${req.url}`,\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.NOT_IMPLEMENTED,\n },\n )\n }\n\n // Find the relevant endpoint configuration\n const endpoint = endpoints?.find((endpoint) => {\n if (endpoint.method !== req.method?.toLowerCase()) {\n return false\n }\n\n const pathMatchFn = match(endpoint.path, { decode: decodeURIComponent })\n\n const matchResult = pathMatchFn(adjustedPathname)\n\n if (!matchResult) {\n return false\n }\n\n req.routeParams = matchResult.params as Record<string, unknown>\n\n // Inject to routeParams the slug as well so it can be used later\n if (collection) {\n req.routeParams.collection = collection.config.slug\n } else if (globalConfig) {\n req.routeParams.global = globalConfig.slug\n }\n\n return true\n })\n\n if (endpoint) {\n handler = endpoint.handler\n }\n\n if (!handler) {\n // If no custom handler found and this is an OPTIONS request,\n // return default CORS response for preflight requests\n if (req.method?.toLowerCase() === 'options') {\n return Response.json(\n {},\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: 200,\n },\n )\n }\n\n return notFoundResponse(req, pathname)\n }\n\n const response = await handler(req)\n\n return new Response(response.body, {\n headers: headersWithCors({\n headers: mergeHeaders(req.responseHeaders ?? new Headers(), response.headers),\n req,\n }),\n status: response.status,\n statusText: response.statusText,\n })\n } catch (_err) {\n const err = _err as APIError\n return routeError({\n collection,\n config: incomingConfig,\n err,\n req: req!,\n })\n }\n}\n"],"names":["status","httpStatus","match","createPayloadRequest","formatAdminURL","headersWithCors","mergeHeaders","routeError","notFoundResponse","req","pathname","Response","json","message","URL","url","headers","Headers","NOT_FOUND","handleEndpoints","basePath","config","incomingConfig","path","payloadInstanceCacheKey","request","handler","collection","method","toLowerCase","get","data","undefined","search","text","locale","fallbackLocale","depth","Request","cache","credentials","signal","response","canSetHeaders","payload","baseAPIPath","apiRoute","routes","api","startsWith","adjustedPathname","replace","isGlobals","segments","split","shift","firstParam","globalConfig","globals","find","each","slug","collections","endpoints","toUpperCase","NOT_IMPLEMENTED","endpoint","pathMatchFn","decode","decodeURIComponent","matchResult","routeParams","params","global","body","responseHeaders","statusText","_err","err"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAClD,SAASC,KAAK,QAAQ,iBAAgB;AAQtC,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,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AO;YACT;YAEA7D,IAAI8D,WAAW,GAAGD,YAAYE,MAAM;YAEpC,iEAAiE;YACjE,IAAI7C,YAAY;gBACdlB,IAAI8D,WAAW,CAAC5C,UAAU,GAAGA,WAAWN,MAAM,CAACwC,IAAI;YACrD,OAAO,IAAIJ,cAAc;gBACvBhD,IAAI8D,WAAW,CAACE,MAAM,GAAGhB,aAAaI,IAAI;YAC5C;YAEA,OAAO;QACT;QAEA,IAAIK,UAAU;YACZxC,UAAUwC,SAASxC,OAAO;QAC5B;QAEA,IAAI,CAACA,SAAS;YACZ,6DAA6D;YAC7D,sDAAsD;YACtD,IAAIjB,IAAImB,MAAM,EAAEC,kBAAkB,WAAW;gBAC3C,OAAOlB,SAASC,IAAI,CAClB,CAAC,GACD;oBACEI,SAASX,gBAAgB;wBACvBW,SAAS,IAAIC;wBACbR;oBACF;oBACAT,QAAQ;gBACV;YAEJ;YAEA,OAAOQ,iBAAiBC,KAAKC;QAC/B;QAEA,MAAMgC,WAAW,MAAMhB,QAAQjB;QAE/B,OAAO,IAAIE,SAAS+B,SAASgC,IAAI,EAAE;YACjC1D,SAASX,gBAAgB;gBACvBW,SAASV,aAAaG,IAAIkE,eAAe,IAAI,IAAI1D,WAAWyB,SAAS1B,OAAO;gBAC5EP;YACF;YACAT,QAAQ0C,SAAS1C,MAAM;YACvB4E,YAAYlC,SAASkC,UAAU;QACjC;IACF,EAAE,OAAOC,MAAM;QACb,MAAMC,MAAMD;QACZ,OAAOtE,WAAW;YAChBoB;YACAN,QAAQC;YACRwD;YACArE,KAAKA;QACP;IACF;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"headersWithCors.d.ts","sourceRoot":"","sources":["../../src/utilities/headersWithCors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;CAC7B,CAAA;AACD,eAAO,MAAM,eAAe,qBAAsB,QAAQ,KAAG,OA0C5D,CAAA"}
1
+ {"version":3,"file":"headersWithCors.d.ts","sourceRoot":"","sources":["../../src/utilities/headersWithCors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;CAC7B,CAAA;AACD,eAAO,MAAM,eAAe,qBAAsB,QAAQ,KAAG,OAiD5D,CAAA"}
@@ -12,20 +12,27 @@ export const headersWithCors = ({ headers, req })=>{
12
12
  'x-apollo-tracing',
13
13
  'X-Payload-HTTP-Method-Override'
14
14
  ];
15
- headers.set('Access-Control-Allow-Methods', 'PUT, PATCH, POST, GET, DELETE, OPTIONS');
16
- if (typeof cors === 'object' && 'headers' in cors) {
17
- headers.set('Access-Control-Allow-Headers', [
18
- ...defaultAllowedHeaders,
19
- ...cors.headers
20
- ].filter(Boolean).join(', '));
21
- } else {
22
- headers.set('Access-Control-Allow-Headers', defaultAllowedHeaders.join(', '));
15
+ // Only set default CORS headers if they haven't been set by custom handler
16
+ if (!headers.has('Access-Control-Allow-Methods')) {
17
+ headers.set('Access-Control-Allow-Methods', 'PUT, PATCH, POST, GET, DELETE, OPTIONS');
23
18
  }
24
- if (cors === '*' || typeof cors === 'object' && 'origins' in cors && cors.origins === '*') {
25
- headers.set('Access-Control-Allow-Origin', '*');
26
- } else if (Array.isArray(cors) && cors.indexOf(requestOrigin) > -1 || !Array.isArray(cors) && typeof cors === 'object' && 'origins' in cors && cors.origins.indexOf(requestOrigin) > -1) {
27
- headers.set('Access-Control-Allow-Credentials', 'true');
28
- headers.set('Access-Control-Allow-Origin', requestOrigin);
19
+ if (!headers.has('Access-Control-Allow-Headers')) {
20
+ if (typeof cors === 'object' && 'headers' in cors) {
21
+ headers.set('Access-Control-Allow-Headers', [
22
+ ...defaultAllowedHeaders,
23
+ ...cors.headers
24
+ ].filter(Boolean).join(', '));
25
+ } else {
26
+ headers.set('Access-Control-Allow-Headers', defaultAllowedHeaders.join(', '));
27
+ }
28
+ }
29
+ if (!headers.has('Access-Control-Allow-Origin')) {
30
+ if (cors === '*' || typeof cors === 'object' && 'origins' in cors && cors.origins === '*') {
31
+ headers.set('Access-Control-Allow-Origin', '*');
32
+ } else if (Array.isArray(cors) && cors.indexOf(requestOrigin) > -1 || !Array.isArray(cors) && typeof cors === 'object' && 'origins' in cors && cors.origins.indexOf(requestOrigin) > -1) {
33
+ headers.set('Access-Control-Allow-Credentials', 'true');
34
+ headers.set('Access-Control-Allow-Origin', requestOrigin);
35
+ }
29
36
  }
30
37
  }
31
38
  return headers;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/headersWithCors.ts"],"sourcesContent":["import type { PayloadRequest } from '../types/index.js'\n\ntype CorsArgs = {\n headers: Headers\n req: Partial<PayloadRequest>\n}\nexport const headersWithCors = ({ headers, req }: CorsArgs): Headers => {\n const cors = req?.payload?.config.cors\n const requestOrigin = req?.headers?.get('Origin')\n\n if (cors) {\n const defaultAllowedHeaders = [\n 'Origin',\n 'X-Requested-With',\n 'Content-Type',\n 'Accept',\n 'Authorization',\n 'Content-Encoding',\n 'x-apollo-tracing',\n 'X-Payload-HTTP-Method-Override',\n ]\n\n headers.set('Access-Control-Allow-Methods', 'PUT, PATCH, POST, GET, DELETE, OPTIONS')\n\n if (typeof cors === 'object' && 'headers' in cors) {\n headers.set(\n 'Access-Control-Allow-Headers',\n [...defaultAllowedHeaders, ...cors.headers].filter(Boolean).join(', '),\n )\n } else {\n headers.set('Access-Control-Allow-Headers', defaultAllowedHeaders.join(', '))\n }\n\n if (cors === '*' || (typeof cors === 'object' && 'origins' in cors && cors.origins === '*')) {\n headers.set('Access-Control-Allow-Origin', '*')\n } else if (\n (Array.isArray(cors) && cors.indexOf(requestOrigin!) > -1) ||\n (!Array.isArray(cors) &&\n typeof cors === 'object' &&\n 'origins' in cors &&\n cors.origins.indexOf(requestOrigin!) > -1)\n ) {\n headers.set('Access-Control-Allow-Credentials', 'true')\n headers.set('Access-Control-Allow-Origin', requestOrigin!)\n }\n }\n\n return headers\n}\n"],"names":["headersWithCors","headers","req","cors","payload","config","requestOrigin","get","defaultAllowedHeaders","set","filter","Boolean","join","origins","Array","isArray","indexOf"],"mappings":"AAMA,OAAO,MAAMA,kBAAkB,CAAC,EAAEC,OAAO,EAAEC,GAAG,EAAY;IACxD,MAAMC,OAAOD,KAAKE,SAASC,OAAOF;IAClC,MAAMG,gBAAgBJ,KAAKD,SAASM,IAAI;IAExC,IAAIJ,MAAM;QACR,MAAMK,wBAAwB;YAC5B;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QAEDP,QAAQQ,GAAG,CAAC,gCAAgC;QAE5C,IAAI,OAAON,SAAS,YAAY,aAAaA,MAAM;YACjDF,QAAQQ,GAAG,CACT,gCACA;mBAAID;mBAA0BL,KAAKF,OAAO;aAAC,CAACS,MAAM,CAACC,SAASC,IAAI,CAAC;QAErE,OAAO;YACLX,QAAQQ,GAAG,CAAC,gCAAgCD,sBAAsBI,IAAI,CAAC;QACzE;QAEA,IAAIT,SAAS,OAAQ,OAAOA,SAAS,YAAY,aAAaA,QAAQA,KAAKU,OAAO,KAAK,KAAM;YAC3FZ,QAAQQ,GAAG,CAAC,+BAA+B;QAC7C,OAAO,IACL,AAACK,MAAMC,OAAO,CAACZ,SAASA,KAAKa,OAAO,CAACV,iBAAkB,CAAC,KACvD,CAACQ,MAAMC,OAAO,CAACZ,SACd,OAAOA,SAAS,YAChB,aAAaA,QACbA,KAAKU,OAAO,CAACG,OAAO,CAACV,iBAAkB,CAAC,GAC1C;YACAL,QAAQQ,GAAG,CAAC,oCAAoC;YAChDR,QAAQQ,GAAG,CAAC,+BAA+BH;QAC7C;IACF;IAEA,OAAOL;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/headersWithCors.ts"],"sourcesContent":["import type { PayloadRequest } from '../types/index.js'\n\ntype CorsArgs = {\n headers: Headers\n req: Partial<PayloadRequest>\n}\nexport const headersWithCors = ({ headers, req }: CorsArgs): Headers => {\n const cors = req?.payload?.config.cors\n const requestOrigin = req?.headers?.get('Origin')\n\n if (cors) {\n const defaultAllowedHeaders = [\n 'Origin',\n 'X-Requested-With',\n 'Content-Type',\n 'Accept',\n 'Authorization',\n 'Content-Encoding',\n 'x-apollo-tracing',\n 'X-Payload-HTTP-Method-Override',\n ]\n\n // Only set default CORS headers if they haven't been set by custom handler\n if (!headers.has('Access-Control-Allow-Methods')) {\n headers.set('Access-Control-Allow-Methods', 'PUT, PATCH, POST, GET, DELETE, OPTIONS')\n }\n\n if (!headers.has('Access-Control-Allow-Headers')) {\n if (typeof cors === 'object' && 'headers' in cors) {\n headers.set(\n 'Access-Control-Allow-Headers',\n [...defaultAllowedHeaders, ...cors.headers].filter(Boolean).join(', '),\n )\n } else {\n headers.set('Access-Control-Allow-Headers', defaultAllowedHeaders.join(', '))\n }\n }\n\n if (!headers.has('Access-Control-Allow-Origin')) {\n if (cors === '*' || (typeof cors === 'object' && 'origins' in cors && cors.origins === '*')) {\n headers.set('Access-Control-Allow-Origin', '*')\n } else if (\n (Array.isArray(cors) && cors.indexOf(requestOrigin!) > -1) ||\n (!Array.isArray(cors) &&\n typeof cors === 'object' &&\n 'origins' in cors &&\n cors.origins.indexOf(requestOrigin!) > -1)\n ) {\n headers.set('Access-Control-Allow-Credentials', 'true')\n headers.set('Access-Control-Allow-Origin', requestOrigin!)\n }\n }\n }\n\n return headers\n}\n"],"names":["headersWithCors","headers","req","cors","payload","config","requestOrigin","get","defaultAllowedHeaders","has","set","filter","Boolean","join","origins","Array","isArray","indexOf"],"mappings":"AAMA,OAAO,MAAMA,kBAAkB,CAAC,EAAEC,OAAO,EAAEC,GAAG,EAAY;IACxD,MAAMC,OAAOD,KAAKE,SAASC,OAAOF;IAClC,MAAMG,gBAAgBJ,KAAKD,SAASM,IAAI;IAExC,IAAIJ,MAAM;QACR,MAAMK,wBAAwB;YAC5B;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QAED,2EAA2E;QAC3E,IAAI,CAACP,QAAQQ,GAAG,CAAC,iCAAiC;YAChDR,QAAQS,GAAG,CAAC,gCAAgC;QAC9C;QAEA,IAAI,CAACT,QAAQQ,GAAG,CAAC,iCAAiC;YAChD,IAAI,OAAON,SAAS,YAAY,aAAaA,MAAM;gBACjDF,QAAQS,GAAG,CACT,gCACA;uBAAIF;uBAA0BL,KAAKF,OAAO;iBAAC,CAACU,MAAM,CAACC,SAASC,IAAI,CAAC;YAErE,OAAO;gBACLZ,QAAQS,GAAG,CAAC,gCAAgCF,sBAAsBK,IAAI,CAAC;YACzE;QACF;QAEA,IAAI,CAACZ,QAAQQ,GAAG,CAAC,gCAAgC;YAC/C,IAAIN,SAAS,OAAQ,OAAOA,SAAS,YAAY,aAAaA,QAAQA,KAAKW,OAAO,KAAK,KAAM;gBAC3Fb,QAAQS,GAAG,CAAC,+BAA+B;YAC7C,OAAO,IACL,AAACK,MAAMC,OAAO,CAACb,SAASA,KAAKc,OAAO,CAACX,iBAAkB,CAAC,KACvD,CAACS,MAAMC,OAAO,CAACb,SACd,OAAOA,SAAS,YAChB,aAAaA,QACbA,KAAKW,OAAO,CAACG,OAAO,CAACX,iBAAkB,CAAC,GAC1C;gBACAL,QAAQS,GAAG,CAAC,oCAAoC;gBAChDT,QAAQS,GAAG,CAAC,+BAA+BJ;YAC7C;QACF;IACF;IAEA,OAAOL;AACT,EAAC"}
@@ -13,9 +13,16 @@ type Args<T extends JsonObject = JsonObject> = {
13
13
  payload: Payload;
14
14
  publishSpecificLocale?: string;
15
15
  req?: PayloadRequest;
16
+ returning?: boolean;
16
17
  select?: SelectType;
17
18
  snapshot?: any;
18
19
  };
19
- export declare const saveVersion: <TData extends JsonObject = JsonObject>({ id, autosave, collection, docWithLocales, draft, global, operation, payload, publishSpecificLocale, req, select, snapshot, }: Args<TData>) => Promise<JsonObject>;
20
+ export declare function saveVersion<TData extends JsonObject = JsonObject>(args: {
21
+ returning: false;
22
+ } & Args<TData>): Promise<null>;
23
+ export declare function saveVersion<TData extends JsonObject = JsonObject>(args: {
24
+ returning: true;
25
+ } & Args<TData>): Promise<JsonObject>;
26
+ export declare function saveVersion<TData extends JsonObject = JsonObject>(args: Omit<Args<TData>, 'returning'>): Promise<JsonObject>;
20
27
  export {};
21
28
  //# sourceMappingURL=saveVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"saveVersion.d.ts","sourceRoot":"","sources":["../../src/versions/saveVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAA8C,OAAO,EAAE,MAAM,aAAa,CAAA;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAS/E,KAAK,IAAI,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC,cAAc,EAAE,CAAC,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,QAAQ,GAAG,gBAAgB,GAAG,QAAQ,CAAA;IAClD,OAAO,EAAE,OAAO,CAAA;IAChB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAA;CACf,CAAA;AAED,eAA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AK,SAAS,UAAU,GAAG,UAAU,EACrE,IAAI,EAAE;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GACtC,OAAO,CAAC,UAAU,CAAC,CAAA;AACtB,wBAAsB,WAAW,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EACrE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,GACnC,OAAO,CAAC,UAAU,CAAC,CAAA"}
@@ -4,7 +4,7 @@ import { sanitizeInternalFields } from '../utilities/sanitizeInternalFields.js';
4
4
  import { getQueryDraftsSelect } from './drafts/getQueryDraftsSelect.js';
5
5
  import { enforceMaxVersions } from './enforceMaxVersions.js';
6
6
  import { saveSnapshot } from './saveSnapshot.js';
7
- export const saveVersion = async ({ id, autosave, collection, docWithLocales, draft, global, operation, payload, publishSpecificLocale, req, select, snapshot })=>{
7
+ export async function saveVersion({ id, autosave, collection, docWithLocales, draft, global, operation, payload, publishSpecificLocale, req, returning, select, snapshot }) {
8
8
  let result;
9
9
  let createNewVersion = true;
10
10
  const now = new Date().toISOString();
@@ -92,6 +92,7 @@ export const saveVersion = async ({ id, autosave, collection, docWithLocales, dr
92
92
  parent: collection ? id : undefined,
93
93
  publishedLocale: publishSpecificLocale || undefined,
94
94
  req,
95
+ returning,
95
96
  select: getQueryDraftsSelect({
96
97
  select
97
98
  }),
@@ -145,10 +146,13 @@ export const saveVersion = async ({ id, autosave, collection, docWithLocales, dr
145
146
  req
146
147
  });
147
148
  }
149
+ if (returning === false) {
150
+ return null;
151
+ }
148
152
  let createdVersion = result.version;
149
153
  createdVersion = sanitizeInternalFields(createdVersion);
150
154
  createdVersion.id = result.parent;
151
155
  return createdVersion;
152
- };
156
+ }
153
157
 
154
158
  //# sourceMappingURL=saveVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/versions/saveVersion.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { CreateGlobalVersionArgs, CreateVersionArgs, Payload } from '../index.js'\nimport type { JsonObject, PayloadRequest, SelectType } from '../types/index.js'\n\nimport { deepCopyObjectSimple } from '../index.js'\nimport { getVersionsMax } from '../utilities/getVersionsConfig.js'\nimport { sanitizeInternalFields } from '../utilities/sanitizeInternalFields.js'\nimport { getQueryDraftsSelect } from './drafts/getQueryDraftsSelect.js'\nimport { enforceMaxVersions } from './enforceMaxVersions.js'\nimport { saveSnapshot } from './saveSnapshot.js'\n\ntype Args<T extends JsonObject = JsonObject> = {\n autosave?: boolean\n collection?: SanitizedCollectionConfig\n docWithLocales: T\n draft?: boolean\n global?: SanitizedGlobalConfig\n id?: number | string\n operation?: 'create' | 'restoreVersion' | 'update'\n payload: Payload\n publishSpecificLocale?: string\n req?: PayloadRequest\n select?: SelectType\n snapshot?: any\n}\n\nexport const saveVersion = async <TData extends JsonObject = JsonObject>({\n id,\n autosave,\n collection,\n docWithLocales,\n draft,\n global,\n operation,\n payload,\n publishSpecificLocale,\n req,\n select,\n snapshot,\n}: Args<TData>): Promise<JsonObject> => {\n let result: JsonObject | undefined\n let createNewVersion = true\n const now = new Date().toISOString()\n const versionData: {\n _status?: 'draft'\n updatedAt?: string\n } & TData = deepCopyObjectSimple(docWithLocales)\n\n if (draft) {\n versionData._status = 'draft'\n }\n\n if (collection?.timestamps && draft) {\n versionData.updatedAt = now\n }\n\n if (versionData._id) {\n delete versionData._id\n }\n\n try {\n if (autosave) {\n let docs\n const findVersionArgs = {\n limit: 1,\n pagination: false,\n req,\n sort: '-updatedAt',\n }\n\n if (collection) {\n ;({ docs } = await payload.db.findVersions<TData>({\n ...findVersionArgs,\n collection: collection.slug,\n limit: 1,\n pagination: false,\n req,\n where: {\n parent: {\n equals: id,\n },\n },\n }))\n } else {\n ;({ docs } = await payload.db.findGlobalVersions<TData>({\n ...findVersionArgs,\n global: global!.slug,\n limit: 1,\n pagination: false,\n req,\n }))\n }\n const [latestVersion] = docs\n\n // overwrite the latest version if it's set to autosave\n if (latestVersion && 'autosave' in latestVersion && latestVersion.autosave === true) {\n createNewVersion = false\n\n const updateVersionArgs = {\n id: latestVersion.id,\n req,\n versionData: {\n createdAt: new Date(latestVersion.createdAt).toISOString(),\n latest: true,\n parent: id,\n updatedAt: now,\n version: {\n ...versionData,\n },\n },\n }\n\n if (collection) {\n result = await payload.db.updateVersion<TData>({\n ...updateVersionArgs,\n collection: collection.slug,\n req,\n })\n } else {\n result = await payload.db.updateGlobalVersion<TData>({\n ...updateVersionArgs,\n global: global!.slug,\n req,\n })\n }\n }\n }\n\n if (createNewVersion) {\n const createVersionArgs = {\n autosave: Boolean(autosave),\n collectionSlug: undefined as string | undefined,\n createdAt: operation === 'restoreVersion' ? versionData.createdAt : now,\n globalSlug: undefined as string | undefined,\n parent: collection ? id : undefined,\n publishedLocale: publishSpecificLocale || undefined,\n req,\n select: getQueryDraftsSelect({ select }),\n updatedAt: now,\n versionData,\n }\n\n if (collection) {\n createVersionArgs.collectionSlug = collection.slug\n result = await payload.db.createVersion(createVersionArgs as CreateVersionArgs)\n }\n\n if (global) {\n createVersionArgs.globalSlug = global.slug\n result = await payload.db.createGlobalVersion(createVersionArgs as CreateGlobalVersionArgs)\n }\n\n if (snapshot) {\n await saveSnapshot<TData>({\n id,\n autosave,\n collection,\n data: snapshot,\n global,\n payload,\n publishSpecificLocale,\n req,\n select,\n })\n }\n }\n } catch (err) {\n let errorMessage: string | undefined\n\n if (collection) {\n errorMessage = `There was an error while saving a version for the ${typeof collection.labels.singular === 'string' ? collection.labels.singular : collection.slug} with ID ${id}.`\n }\n if (global) {\n errorMessage = `There was an error while saving a version for the global ${typeof global.label === 'string' ? global.label : global.slug}.`\n }\n payload.logger.error({ err, msg: errorMessage })\n return undefined!\n }\n\n const max = getVersionsMax(collection || global!)\n\n if (createNewVersion && max > 0) {\n await enforceMaxVersions({\n id,\n collection,\n global,\n max,\n payload,\n req,\n })\n }\n\n let createdVersion = (result as any).version\n\n createdVersion = sanitizeInternalFields(createdVersion)\n createdVersion.id = (result as any).parent\n\n return createdVersion\n}\n"],"names":["deepCopyObjectSimple","getVersionsMax","sanitizeInternalFields","getQueryDraftsSelect","enforceMaxVersions","saveSnapshot","saveVersion","id","autosave","collection","docWithLocales","draft","global","operation","payload","publishSpecificLocale","req","select","snapshot","result","createNewVersion","now","Date","toISOString","versionData","_status","timestamps","updatedAt","_id","docs","findVersionArgs","limit","pagination","sort","db","findVersions","slug","where","parent","equals","findGlobalVersions","latestVersion","updateVersionArgs","createdAt","latest","version","updateVersion","updateGlobalVersion","createVersionArgs","Boolean","collectionSlug","undefined","globalSlug","publishedLocale","createVersion","createGlobalVersion","data","err","errorMessage","labels","singular","label","logger","error","msg","max","createdVersion"],"mappings":"AAKA,SAASA,oBAAoB,QAAQ,cAAa;AAClD,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,sBAAsB,QAAQ,yCAAwC;AAC/E,SAASC,oBAAoB,QAAQ,mCAAkC;AACvE,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAiBhD,OAAO,MAAMC,cAAc,OAA8C,EACvEC,EAAE,EACFC,QAAQ,EACRC,UAAU,EACVC,cAAc,EACdC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,OAAO,EACPC,qBAAqB,EACrBC,GAAG,EACHC,MAAM,EACNC,QAAQ,EACI;IACZ,IAAIC;IACJ,IAAIC,mBAAmB;IACvB,MAAMC,MAAM,IAAIC,OAAOC,WAAW;IAClC,MAAMC,cAGMxB,qBAAqBU;IAEjC,IAAIC,OAAO;QACTa,YAAYC,OAAO,GAAG;IACxB;IAEA,IAAIhB,YAAYiB,cAAcf,OAAO;QACnCa,YAAYG,SAAS,GAAGN;IAC1B;IAEA,IAAIG,YAAYI,GAAG,EAAE;QACnB,OAAOJ,YAAYI,GAAG;IACxB;IAEA,IAAI;QACF,IAAIpB,UAAU;YAC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GAAG;QAC/B,MAAM7D,mBAAmB;YACvBG;YACAE;YACAG;YACAqD;YACAnD;YACAE;QACF;IACF;IAEA,IAAIkD,iBAAiB,AAAC/C,OAAe0B,OAAO;IAE5CqB,iBAAiBhE,uBAAuBgE;IACxCA,eAAe3D,EAAE,GAAG,AAACY,OAAemB,MAAM;IAE1C,OAAO4B;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/versions/saveVersion.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { CreateGlobalVersionArgs, CreateVersionArgs, Payload } from '../index.js'\nimport type { JsonObject, PayloadRequest, SelectType } from '../types/index.js'\n\nimport { deepCopyObjectSimple } from '../index.js'\nimport { getVersionsMax } from '../utilities/getVersionsConfig.js'\nimport { sanitizeInternalFields } from '../utilities/sanitizeInternalFields.js'\nimport { getQueryDraftsSelect } from './drafts/getQueryDraftsSelect.js'\nimport { enforceMaxVersions } from './enforceMaxVersions.js'\nimport { saveSnapshot } from './saveSnapshot.js'\n\ntype Args<T extends JsonObject = JsonObject> = {\n autosave?: boolean\n collection?: SanitizedCollectionConfig\n docWithLocales: T\n draft?: boolean\n global?: SanitizedGlobalConfig\n id?: number | string\n operation?: 'create' | 'restoreVersion' | 'update'\n payload: Payload\n publishSpecificLocale?: string\n req?: PayloadRequest\n returning?: boolean\n select?: SelectType\n snapshot?: any\n}\n\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: { returning: false } & Args<TData>,\n): Promise<null>\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: { returning: true } & Args<TData>,\n): Promise<JsonObject>\nexport async function saveVersion<TData extends JsonObject = JsonObject>(\n args: Omit<Args<TData>, 'returning'>,\n): Promise<JsonObject>\nexport async function saveVersion<TData extends JsonObject = JsonObject>({\n id,\n autosave,\n collection,\n docWithLocales,\n draft,\n global,\n operation,\n payload,\n publishSpecificLocale,\n req,\n returning,\n select,\n snapshot,\n}: Args<TData>): Promise<JsonObject | null> {\n let result: JsonObject | undefined\n let createNewVersion = true\n const now = new Date().toISOString()\n const versionData: {\n _status?: 'draft'\n updatedAt?: string\n } & TData = deepCopyObjectSimple(docWithLocales)\n\n if (draft) {\n versionData._status = 'draft'\n }\n\n if (collection?.timestamps && draft) {\n versionData.updatedAt = now\n }\n\n if (versionData._id) {\n delete versionData._id\n }\n\n try {\n if (autosave) {\n let docs\n const findVersionArgs = {\n limit: 1,\n pagination: false,\n req,\n sort: '-updatedAt',\n }\n\n if (collection) {\n ;({ docs } = await payload.db.findVersions<TData>({\n ...findVersionArgs,\n collection: collection.slug,\n limit: 1,\n pagination: false,\n req,\n where: {\n parent: {\n equals: id,\n },\n },\n }))\n } else {\n ;({ docs } = await payload.db.findGlobalVersions<TData>({\n ...findVersionArgs,\n global: global!.slug,\n limit: 1,\n pagination: false,\n req,\n }))\n }\n const [latestVersion] = docs\n\n // overwrite the latest version if it's set to autosave\n if (latestVersion && 'autosave' in latestVersion && latestVersion.autosave === true) {\n createNewVersion = false\n\n const updateVersionArgs = {\n id: latestVersion.id,\n req,\n versionData: {\n createdAt: new Date(latestVersion.createdAt).toISOString(),\n latest: true,\n parent: id,\n updatedAt: now,\n version: {\n ...versionData,\n },\n },\n }\n\n if (collection) {\n result = await payload.db.updateVersion<TData>({\n ...updateVersionArgs,\n collection: collection.slug,\n req,\n })\n } else {\n result = await payload.db.updateGlobalVersion<TData>({\n ...updateVersionArgs,\n global: global!.slug,\n req,\n })\n }\n }\n }\n\n if (createNewVersion) {\n const createVersionArgs = {\n autosave: Boolean(autosave),\n collectionSlug: undefined as string | undefined,\n createdAt: operation === 'restoreVersion' ? versionData.createdAt : now,\n globalSlug: undefined as string | undefined,\n parent: collection ? id : undefined,\n publishedLocale: publishSpecificLocale || undefined,\n req,\n returning,\n select: getQueryDraftsSelect({ select }),\n updatedAt: now,\n versionData,\n }\n\n if (collection) {\n createVersionArgs.collectionSlug = collection.slug\n result = await payload.db.createVersion(createVersionArgs as CreateVersionArgs)\n }\n\n if (global) {\n createVersionArgs.globalSlug = global.slug\n result = await payload.db.createGlobalVersion(createVersionArgs as CreateGlobalVersionArgs)\n }\n\n if (snapshot) {\n await saveSnapshot<TData>({\n id,\n autosave,\n collection,\n data: snapshot,\n global,\n payload,\n publishSpecificLocale,\n req,\n select,\n })\n }\n }\n } catch (err) {\n let errorMessage: string | undefined\n\n if (collection) {\n errorMessage = `There was an error while saving a version for the ${typeof collection.labels.singular === 'string' ? collection.labels.singular : collection.slug} with ID ${id}.`\n }\n if (global) {\n errorMessage = `There was an error while saving a version for the global ${typeof global.label === 'string' ? global.label : global.slug}.`\n }\n payload.logger.error({ err, msg: errorMessage })\n return undefined!\n }\n\n const max = getVersionsMax(collection || global!)\n\n if (createNewVersion && max > 0) {\n await enforceMaxVersions({\n id,\n collection,\n global,\n max,\n payload,\n req,\n })\n }\n if (returning === false) {\n return null\n }\n\n let createdVersion = (result as any).version\n\n createdVersion = sanitizeInternalFields(createdVersion)\n createdVersion.id = (result as any).parent\n\n return createdVersion\n}\n"],"names":["deepCopyObjectSimple","getVersionsMax","sanitizeInternalFields","getQueryDraftsSelect","enforceMaxVersions","saveSnapshot","saveVersion","id","autosave","collection","docWithLocales","draft","global","operation","payload","publishSpecificLocale","req","returning","select","snapshot","result","createNewVersion","now","Date","toISOString","versionData","_status","timestamps","updatedAt","_id","docs","findVersionArgs","limit","pagination","sort","db","findVersions","slug","where","parent","equals","findGlobalVersions","latestVersion","updateVersionArgs","createdAt","latest","version","updateVersion","updateGlobalVersion","createVersionArgs","Boolean","collectionSlug","undefined","globalSlug","publishedLocale","createVersion","createGlobalVersion","data","err","errorMessage","labels","singular","label","logger","error","msg","max","createdVersion"],"mappings":"AAKA,SAASA,oBAAoB,QAAQ,cAAa;AAClD,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,sBAAsB,QAAQ,yCAAwC;AAC/E,SAASC,oBAAoB,QAAQ,mCAAkC;AACvE,SAASC,kB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oBACNP;oBACAE;oBACAC;oBACAC;oBACAE;gBACF;YACF;QACF;IACF,EAAE,OAAOwC,KAAK;QACZ,IAAIC;QAEJ,IAAIlD,YAAY;YACdkD,eAAe,CAAC,kDAAkD,EAAE,OAAOlD,WAAWmD,MAAM,CAACC,QAAQ,KAAK,WAAWpD,WAAWmD,MAAM,CAACC,QAAQ,GAAGpD,WAAW4B,IAAI,CAAC,SAAS,EAAE9B,GAAG,CAAC,CAAC;QACpL;QACA,IAAIK,QAAQ;YACV+C,eAAe,CAAC,yDAAyD,EAAE,OAAO/C,OAAOkD,KAAK,KAAK,WAAWlD,OAAOkD,KAAK,GAAGlD,OAAOyB,IAAI,CAAC,CAAC,CAAC;QAC7I;QACAvB,QAAQiD,MAAM,CAACC,KAAK,CAAC;YAAEN;YAAKO,KAAKN;QAAa;QAC9C,OAAOP;IACT;IAEA,MAAMc,MAAMjE,eAAeQ,cAAcG;IAEzC,IAAIS,oBAAoB6C,MAAM,GAAG;QAC/B,MAAM9D,mBAAmB;YACvBG;YACAE;YACAG;YACAsD;YACApD;YACAE;QACF;IACF;IACA,IAAIC,cAAc,OAAO;QACvB,OAAO;IACT;IAEA,IAAIkD,iBAAiB,AAAC/C,OAAe0B,OAAO;IAE5CqB,iBAAiBjE,uBAAuBiE;IACxCA,eAAe5D,EAAE,GAAG,AAACa,OAAemB,MAAM;IAE1C,OAAO4B;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.71.0-internal-debug.cd77e5d",
3
+ "version": "3.71.0-internal-debug.80dab4c",
4
4
  "description": "Node, React, Headless CMS and Application Framework built on Next.js",
5
5
  "keywords": [
6
6
  "admin panel",
@@ -111,7 +111,7 @@
111
111
  "undici": "7.10.0",
112
112
  "uuid": "10.0.0",
113
113
  "ws": "^8.16.0",
114
- "@payloadcms/translations": "3.71.0-internal-debug.cd77e5d"
114
+ "@payloadcms/translations": "3.71.0-internal-debug.80dab4c"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@hyrious/esbuild-plugin-commonjs": "0.2.6",