payload 3.53.0 → 3.54.0-internal.84621da

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/admin/forms/Form.d.ts +1 -0
  2. package/dist/admin/forms/Form.d.ts.map +1 -1
  3. package/dist/admin/forms/Form.js.map +1 -1
  4. package/dist/auth/operations/logout.d.ts.map +1 -1
  5. package/dist/auth/operations/logout.js +3 -0
  6. package/dist/auth/operations/logout.js.map +1 -1
  7. package/dist/auth/operations/refresh.d.ts.map +1 -1
  8. package/dist/auth/operations/refresh.js +2 -0
  9. package/dist/auth/operations/refresh.js.map +1 -1
  10. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  11. package/dist/auth/operations/resetPassword.js +2 -0
  12. package/dist/auth/operations/resetPassword.js.map +1 -1
  13. package/dist/auth/operations/verifyEmail.d.ts.map +1 -1
  14. package/dist/auth/operations/verifyEmail.js +2 -0
  15. package/dist/auth/operations/verifyEmail.js.map +1 -1
  16. package/dist/auth/sessions.d.ts.map +1 -1
  17. package/dist/auth/sessions.js +2 -0
  18. package/dist/auth/sessions.js.map +1 -1
  19. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
  20. package/dist/auth/strategies/local/incrementLoginAttempts.js +2 -0
  21. package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
  22. package/dist/bin/index.d.ts.map +1 -1
  23. package/dist/bin/index.js +73 -30
  24. package/dist/bin/index.js.map +1 -1
  25. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  26. package/dist/collections/operations/restoreVersion.js +2 -0
  27. package/dist/collections/operations/restoreVersion.js.map +1 -1
  28. package/dist/collections/operations/utilities/update.d.ts.map +1 -1
  29. package/dist/collections/operations/utilities/update.js +2 -0
  30. package/dist/collections/operations/utilities/update.js.map +1 -1
  31. package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
  32. package/dist/globals/operations/restoreVersion.js +2 -0
  33. package/dist/globals/operations/restoreVersion.js.map +1 -1
  34. package/dist/globals/operations/update.d.ts.map +1 -1
  35. package/dist/globals/operations/update.js +2 -0
  36. package/dist/globals/operations/update.js.map +1 -1
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +6 -4
  40. package/dist/index.js.map +1 -1
  41. package/dist/queues/operations/handleSchedules/defaultAfterSchedule.d.ts.map +1 -1
  42. package/dist/queues/operations/handleSchedules/defaultAfterSchedule.js +2 -1
  43. package/dist/queues/operations/handleSchedules/defaultAfterSchedule.js.map +1 -1
  44. package/dist/queues/utilities/updateJob.d.ts.map +1 -1
  45. package/dist/queues/utilities/updateJob.js +2 -0
  46. package/dist/queues/utilities/updateJob.js.map +1 -1
  47. package/dist/uploads/types.d.ts +1 -1
  48. package/dist/uploads/types.js.map +1 -1
  49. package/package.json +2 -2
@@ -31,7 +31,8 @@ export const defaultAfterSchedule = async ({ jobStats, queueable, req })=>{
31
31
  [queueable.scheduleConfig.queue]: queueConfig
32
32
  }
33
33
  }
34
- }
34
+ },
35
+ updatedAt: new Date().toISOString()
35
36
  },
36
37
  req,
37
38
  returning: false
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queues/operations/handleSchedules/defaultAfterSchedule.ts"],"sourcesContent":["import type { AfterScheduleFn } from '../../config/types/index.js'\n\nimport { type JobStats, jobStatsGlobalSlug } from '../../config/global.js'\nimport { getCurrentDate } from '../../utilities/getCurrentDate.js'\n\ntype JobStatsScheduledRuns = NonNullable<\n NonNullable<NonNullable<JobStats['stats']>['scheduledRuns']>['queues']\n>[string]\n\nexport const defaultAfterSchedule: AfterScheduleFn = async ({ jobStats, queueable, req }) => {\n const existingQueuesConfig =\n jobStats?.stats?.scheduledRuns?.queues?.[queueable.scheduleConfig.queue] || {}\n\n const queueConfig: JobStatsScheduledRuns = {\n ...existingQueuesConfig,\n }\n if (queueable.taskConfig) {\n ;(queueConfig.tasks ??= {})[queueable.taskConfig.slug] = {\n lastScheduledRun: getCurrentDate().toISOString(),\n }\n } else if (queueable.workflowConfig) {\n ;(queueConfig.workflows ??= {})[queueable.workflowConfig.slug] = {\n lastScheduledRun: getCurrentDate().toISOString(),\n }\n }\n\n // Add to payload-jobs-stats global regardless of the status\n if (jobStats) {\n await req.payload.db.updateGlobal({\n slug: jobStatsGlobalSlug,\n data: {\n ...(jobStats || {}),\n stats: {\n ...(jobStats?.stats || {}),\n scheduledRuns: {\n ...(jobStats?.stats?.scheduledRuns || {}),\n queues: {\n ...(jobStats?.stats?.scheduledRuns?.queues || {}),\n [queueable.scheduleConfig.queue]: queueConfig,\n },\n },\n },\n } as JobStats,\n req,\n returning: false,\n })\n } else {\n await req.payload.db.createGlobal({\n slug: jobStatsGlobalSlug,\n data: {\n createdAt: getCurrentDate().toISOString(),\n stats: {\n scheduledRuns: {\n queues: {\n [queueable.scheduleConfig.queue]: queueConfig,\n },\n },\n },\n } as JobStats,\n req,\n returning: false,\n })\n }\n}\n"],"names":["jobStatsGlobalSlug","getCurrentDate","defaultAfterSchedule","jobStats","queueable","req","existingQueuesConfig","stats","scheduledRuns","queues","scheduleConfig","queue","queueConfig","taskConfig","tasks","slug","lastScheduledRun","toISOString","workflowConfig","workflows","payload","db","updateGlobal","data","returning","createGlobal","createdAt"],"mappings":"AAEA,SAAwBA,kBAAkB,QAAQ,yBAAwB;AAC1E,SAASC,cAAc,QAAQ,oCAAmC;AAMlE,OAAO,MAAMC,uBAAwC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,GAAG,EAAE;IACtF,MAAMC,uBACJH,UAAUI,OAAOC,eAAeC,QAAQ,CAACL,UAAUM,cAAc,CAACC,KAAK,CAAC,IAAI,CAAC;IAE/E,MAAMC,cAAqC;QACzC,GAAGN,oBAAoB;IACzB;IACA,IAAIF,UAAUS,UAAU,EAAE;;QACtBD,CAAAA,YAAYE,KAAK,KAAK,CAAC,CAAA,CAAE,CAACV,UAAUS,UAAU,CAACE,IAAI,CAAC,GAAG;YACvDC,kBAAkBf,iBAAiBgB,WAAW;QAChD;IACF,OAAO,IAAIb,UAAUc,cAAc,EAAE;;QACjCN,CAAAA,YAAYO,SAAS,KAAK,CAAC,CAAA,CAAE,CAACf,UAAUc,cAAc,CAACH,IAAI,CAAC,GAAG;YAC/DC,kBAAkBf,iBAAiBgB,WAAW;QAChD;IACF;IAEA,4DAA4D;IAC5D,IAAId,UAAU;QACZ,MAAME,IAAIe,OAAO,CAACC,EAAE,CAACC,YAAY,CAAC;YAChCP,MAAMf;YACNuB,MAAM;gBACJ,GAAIpB,YAAY,CAAC,CAAC;gBAClBI,OAAO;oBACL,GAAIJ,UAAUI,SAAS,CAAC,CAAC;oBACzBC,eAAe;wBACb,GAAIL,UAAUI,OAAOC,iBAAiB,CAAC,CAAC;wBACxCC,QAAQ;4BACN,GAAIN,UAAUI,OAAOC,eAAeC,UAAU,CAAC,CAAC;4BAChD,CAACL,UAAUM,cAAc,CAACC,KAAK,CAAC,EAAEC;wBACpC;oBACF;gBACF;YACF;YACAP;YACAmB,WAAW;QACb;IACF,OAAO;QACL,MAAMnB,IAAIe,OAAO,CAACC,EAAE,CAACI,YAAY,CAAC;YAChCV,MAAMf;YACNuB,MAAM;gBACJG,WAAWzB,iBAAiBgB,WAAW;gBACvCV,OAAO;oBACLC,eAAe;wBACbC,QAAQ;4BACN,CAACL,UAAUM,cAAc,CAACC,KAAK,CAAC,EAAEC;wBACpC;oBACF;gBACF;YACF;YACAP;YACAmB,WAAW;QACb;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/queues/operations/handleSchedules/defaultAfterSchedule.ts"],"sourcesContent":["import type { AfterScheduleFn } from '../../config/types/index.js'\n\nimport { type JobStats, jobStatsGlobalSlug } from '../../config/global.js'\nimport { getCurrentDate } from '../../utilities/getCurrentDate.js'\n\ntype JobStatsScheduledRuns = NonNullable<\n NonNullable<NonNullable<JobStats['stats']>['scheduledRuns']>['queues']\n>[string]\n\nexport const defaultAfterSchedule: AfterScheduleFn = async ({ jobStats, queueable, req }) => {\n const existingQueuesConfig =\n jobStats?.stats?.scheduledRuns?.queues?.[queueable.scheduleConfig.queue] || {}\n\n const queueConfig: JobStatsScheduledRuns = {\n ...existingQueuesConfig,\n }\n if (queueable.taskConfig) {\n ;(queueConfig.tasks ??= {})[queueable.taskConfig.slug] = {\n lastScheduledRun: getCurrentDate().toISOString(),\n }\n } else if (queueable.workflowConfig) {\n ;(queueConfig.workflows ??= {})[queueable.workflowConfig.slug] = {\n lastScheduledRun: getCurrentDate().toISOString(),\n }\n }\n\n // Add to payload-jobs-stats global regardless of the status\n if (jobStats) {\n await req.payload.db.updateGlobal({\n slug: jobStatsGlobalSlug,\n data: {\n ...(jobStats || {}),\n stats: {\n ...(jobStats?.stats || {}),\n scheduledRuns: {\n ...(jobStats?.stats?.scheduledRuns || {}),\n queues: {\n ...(jobStats?.stats?.scheduledRuns?.queues || {}),\n [queueable.scheduleConfig.queue]: queueConfig,\n },\n },\n },\n updatedAt: new Date().toISOString(),\n } as JobStats,\n req,\n returning: false,\n })\n } else {\n await req.payload.db.createGlobal({\n slug: jobStatsGlobalSlug,\n data: {\n createdAt: getCurrentDate().toISOString(),\n stats: {\n scheduledRuns: {\n queues: {\n [queueable.scheduleConfig.queue]: queueConfig,\n },\n },\n },\n } as JobStats,\n req,\n returning: false,\n })\n }\n}\n"],"names":["jobStatsGlobalSlug","getCurrentDate","defaultAfterSchedule","jobStats","queueable","req","existingQueuesConfig","stats","scheduledRuns","queues","scheduleConfig","queue","queueConfig","taskConfig","tasks","slug","lastScheduledRun","toISOString","workflowConfig","workflows","payload","db","updateGlobal","data","updatedAt","Date","returning","createGlobal","createdAt"],"mappings":"AAEA,SAAwBA,kBAAkB,QAAQ,yBAAwB;AAC1E,SAASC,cAAc,QAAQ,oCAAmC;AAMlE,OAAO,MAAMC,uBAAwC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,GAAG,EAAE;IACtF,MAAMC,uBACJH,UAAUI,OAAOC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rC"}
@@ -37,6 +37,8 @@ import { jobAfterRead, jobsCollectionSlug } from '../config/collection.js';
37
37
  const jobReq = {
38
38
  transactionID: req.payload.db.name !== 'mongoose' ? await req.payload.db.beginTransaction() : undefined
39
39
  };
40
+ // Ensure updatedAt date is always updated
41
+ data.updatedAt = new Date().toISOString();
40
42
  const args = id ? {
41
43
  id,
42
44
  data,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/queues/utilities/updateJob.ts"],"sourcesContent":["import type { ManyOptions } from '../../collections/operations/local/update.js'\nimport type { UpdateJobsArgs } from '../../database/types.js'\nimport type { Job } from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\n\nimport { jobAfterRead, jobsCollectionSlug } from '../config/collection.js'\n\ntype BaseArgs = {\n data: Partial<Job>\n depth?: number\n disableTransaction?: boolean\n limit?: number\n req: PayloadRequest\n returning?: boolean\n}\n\ntype ArgsByID = {\n id: number | string\n limit?: never\n sort?: never\n where?: never\n}\n\ntype ArgsWhere = {\n id?: never\n limit?: number\n sort?: Sort\n where: Where\n}\n\ntype RunJobsArgs = (ArgsByID | ArgsWhere) & BaseArgs\n\n/**\n * Convenience method for updateJobs by id\n */\nexport async function updateJob(args: ArgsByID & BaseArgs) {\n const result = await updateJobs(args)\n if (result) {\n return result[0]\n }\n}\n\n/**\n * Helper for updating jobs in the most performant way possible.\n * Handles deciding whether it can used direct db methods or not, and if so,\n * manually runs the afterRead hook that populates the `taskStatus` property.\n */\nexport async function updateJobs({\n id,\n data,\n depth,\n disableTransaction,\n limit: limitArg,\n req,\n returning,\n sort,\n where: whereArg,\n}: RunJobsArgs): Promise<Job[] | null> {\n const limit = id ? 1 : limitArg\n const where = id ? { id: { equals: id } } : whereArg\n\n if (depth || req.payload.config?.jobs?.runHooks) {\n const result = await req.payload.update({\n id,\n collection: jobsCollectionSlug,\n data,\n depth,\n disableTransaction,\n limit,\n req,\n where,\n } as ManyOptions<any, any>)\n if (returning === false || !result) {\n return null\n }\n return result.docs as Job[]\n }\n\n const jobReq = {\n transactionID:\n req.payload.db.name !== 'mongoose'\n ? ((await req.payload.db.beginTransaction()) as string)\n : undefined,\n }\n\n const args: UpdateJobsArgs = id\n ? {\n id,\n data,\n req: jobReq,\n returning,\n }\n : {\n data,\n limit,\n req: jobReq,\n returning,\n sort,\n where: where as Where,\n }\n\n const updatedJobs: Job[] | null = await req.payload.db.updateJobs(args)\n\n if (req.payload.db.name !== 'mongoose' && jobReq.transactionID) {\n await req.payload.db.commitTransaction(jobReq.transactionID)\n }\n\n if (returning === false || !updatedJobs?.length) {\n return null\n }\n\n return updatedJobs.map((updatedJob) => {\n return jobAfterRead({\n config: req.payload.config,\n doc: updatedJob,\n })\n })\n}\n"],"names":["jobAfterRead","jobsCollectionSlug","updateJob","args","result","updateJobs","id","data","depth","disableTransaction","limit","limitArg","req","returning","sort","where","whereArg","equals","payload","config","jobs","runHooks","update","collection","docs","jobReq","transactionID","db","name","beginTransaction","undefined","updatedJobs","commitTransaction","length","map","updatedJob","doc"],"mappings":"AAKA,SAASA,YAAY,EAAEC,kBAAkB,QAAQ,0BAAyB;AA2B1E;;CAEC,GACD,OAAO,eAAeC,UAAUC,IAAyB;IACvD,MAAMC,SAAS,MAAMC,WAAWF;IAChC,IAAIC,QAAQ;QACV,OAAOA,MAAM,CAAC,EAAE;IAClB;AACF;AAEA;;;;CAIC,GACD,OAAO,eAAeC,WAAW,EAC/BC,EAAE,EACFC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,OAAOC,QAAQ,EACfC,GAAG,EACHC,SAAS,EACTC,IAAI,EACJC,OAAOC,QAAQ,EACH;IACZ,MAAMN,QAAQJ,KAAK,IAAIK;IACvB,MAAMI,QAAQT,KAAK;QAAEA,IAAI;YAAEW,QAAQX;QAAG;IAAE,IAAIU;IAE5C,IAAIR,SAASI,IAAIM,OAAO,CAACC,MAAM,EAAEC,MAAMC,UAAU;QAC/C,MAAMjB,SAAS,MAAMQ,IAAIM,OAAO,CAACI,MAAM,CAAC;YACtChB;YACAiB,YAAYtB;YACZM;YACAC;YACAC;YACAC;YACAE;YACAG;QACF;QACA,IAAIF,cAAc,SAAS,CAACT,QAAQ;YAClC,OAAO;QACT;QACA,OAAOA,OAAOoB,IAAI;IACpB;IAEA,MAAMC,SAAS;QACbC,eACEd,IAAIM,OAAO,CAACS,EAAE,CAACC,IAAI,KAAK,aAClB,MAAMhB,IAAIM,OAAO,CAACS,EAAE,CAACE,gBAAgB,KACvCC;IACR;IAEA,MAAM3B,OAAuBG,KACzB;QACEA;QACAC;QACAK,KAAKa;QACLZ;IACF,IACA;QACEN;QACAG;QACAE,KAAKa;QACLZ;QACAC;QACAC,OAAOA;IACT;IAEJ,MAAMgB,cAA4B,MAAMnB,IAAIM,OAAO,CAACS,EAAE,CAACtB,UAAU,CAACF;IAElE,IAAIS,IAAIM,OAAO,CAACS,EAAE,CAACC,IAAI,KAAK,cAAcH,OAAOC,aAAa,EAAE;QAC9D,MAAMd,IAAIM,OAAO,CAACS,EAAE,CAACK,iBAAiB,CAACP,OAAOC,aAAa;IAC7D;IAEA,IAAIb,cAAc,SAAS,CAACkB,aAAaE,QAAQ;QAC/C,OAAO;IACT;IAEA,OAAOF,YAAYG,GAAG,CAAC,CAACC;QACtB,OAAOnC,aAAa;YAClBmB,QAAQP,IAAIM,OAAO,CAACC,MAAM;YAC1BiB,KAAKD;QACP;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/queues/utilities/updateJob.ts"],"sourcesContent":["import type { ManyOptions } from '../../collections/operations/local/update.js'\nimport type { UpdateJobsArgs } from '../../database/types.js'\nimport type { Job } from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\n\nimport { jobAfterRead, jobsCollectionSlug } from '../config/collection.js'\n\ntype BaseArgs = {\n data: Partial<Job>\n depth?: number\n disableTransaction?: boolean\n limit?: number\n req: PayloadRequest\n returning?: boolean\n}\n\ntype ArgsByID = {\n id: number | string\n limit?: never\n sort?: never\n where?: never\n}\n\ntype ArgsWhere = {\n id?: never\n limit?: number\n sort?: Sort\n where: Where\n}\n\ntype RunJobsArgs = (ArgsByID | ArgsWhere) & BaseArgs\n\n/**\n * Convenience method for updateJobs by id\n */\nexport async function updateJob(args: ArgsByID & BaseArgs) {\n const result = await updateJobs(args)\n if (result) {\n return result[0]\n }\n}\n\n/**\n * Helper for updating jobs in the most performant way possible.\n * Handles deciding whether it can used direct db methods or not, and if so,\n * manually runs the afterRead hook that populates the `taskStatus` property.\n */\nexport async function updateJobs({\n id,\n data,\n depth,\n disableTransaction,\n limit: limitArg,\n req,\n returning,\n sort,\n where: whereArg,\n}: RunJobsArgs): Promise<Job[] | null> {\n const limit = id ? 1 : limitArg\n const where = id ? { id: { equals: id } } : whereArg\n\n if (depth || req.payload.config?.jobs?.runHooks) {\n const result = await req.payload.update({\n id,\n collection: jobsCollectionSlug,\n data,\n depth,\n disableTransaction,\n limit,\n req,\n where,\n } as ManyOptions<any, any>)\n if (returning === false || !result) {\n return null\n }\n return result.docs as Job[]\n }\n\n const jobReq = {\n transactionID:\n req.payload.db.name !== 'mongoose'\n ? ((await req.payload.db.beginTransaction()) as string)\n : undefined,\n }\n\n // Ensure updatedAt date is always updated\n data.updatedAt = new Date().toISOString()\n\n const args: UpdateJobsArgs = id\n ? {\n id,\n data,\n req: jobReq,\n returning,\n }\n : {\n data,\n limit,\n req: jobReq,\n returning,\n sort,\n where: where as Where,\n }\n\n const updatedJobs: Job[] | null = await req.payload.db.updateJobs(args)\n\n if (req.payload.db.name !== 'mongoose' && jobReq.transactionID) {\n await req.payload.db.commitTransaction(jobReq.transactionID)\n }\n\n if (returning === false || !updatedJobs?.length) {\n return null\n }\n\n return updatedJobs.map((updatedJob) => {\n return jobAfterRead({\n config: req.payload.config,\n doc: updatedJob,\n })\n })\n}\n"],"names":["jobAfterRead","jobsCollectionSlug","updateJob","args","result","updateJobs","id","data","depth","disableTransaction","limit","limitArg","req","returning","sort","where","whereArg","equals","payload","config","jobs","runHooks","update","collection","docs","jobReq","transactionID","db","name","beginTransaction","undefined","updatedAt","Date","toISOString","updatedJobs","commitTransaction","length","map","updatedJob","doc"],"mappings":"AAKA,SAASA,YAAY,EAAEC,kBAAkB,QAAQ,0BAAyB;AA2B1E;;CAEC,GACD,OAAO,eAAeC,UAAUC,IAAyB;IACvD,MAAMC,SAAS,MAAMC,WAAWF;IAChC,IAAIC,QAAQ;QACV,OAAOA,MAAM,CAAC,EAAE;IAClB;AACF;AAEA;;;;CAIC,GACD,OAAO,eAAeC,WAAW,EAC/BC,EAAE,EACFC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,OAAOC,QAAQ,EACfC,GAAG,EACHC,SAAS,EACTC,IAAI,EACJC,OAAOC,QAAQ,EACH;IACZ,MAAMN,QAAQJ,KAAK,IAAIK;IACvB,MAAMI,QAAQT,KAAK;QAAEA,IAAI;YAAEW,QAAQX;QAAG;IAAE,IAAIU;IAE5C,IAAIR,SAASI,IAAIM,OAAO,CAACC,MAAM,EAAEC,MAAMC,UAAU;QAC/C,MAAMjB,SAAS,MAAMQ,IAAIM,OAAO,CAACI,MAAM,CAAC;YACtChB;YACAiB,YAAYtB;YACZM;YACAC;YACAC;YACAC;YACAE;YACAG;QACF;QACA,IAAIF,cAAc,SAAS,CAACT,QAAQ;YAClC,OAAO;QACT;QACA,OAAOA,OAAOoB,IAAI;IACpB;IAEA,MAAMC,SAAS;QACbC,eACEd,IAAIM,OAAO,CAACS,EAAE,CAACC,IAAI,KAAK,aAClB,MAAMhB,IAAIM,OAAO,CAACS,EAAE,CAACE,gBAAgB,KACvCC;IACR;IAEA,0CAA0C;IAC1CvB,KAAKwB,SAAS,GAAG,IAAIC,OAAOC,WAAW;IAEvC,MAAM9B,OAAuBG,KACzB;QACEA;QACAC;QACAK,KAAKa;QACLZ;IACF,IACA;QACEN;QACAG;QACAE,KAAKa;QACLZ;QACAC;QACAC,OAAOA;IACT;IAEJ,MAAMmB,cAA4B,MAAMtB,IAAIM,OAAO,CAACS,EAAE,CAACtB,UAAU,CAACF;IAElE,IAAIS,IAAIM,OAAO,CAACS,EAAE,CAACC,IAAI,KAAK,cAAcH,OAAOC,aAAa,EAAE;QAC9D,MAAMd,IAAIM,OAAO,CAACS,EAAE,CAACQ,iBAAiB,CAACV,OAAOC,aAAa;IAC7D;IAEA,IAAIb,cAAc,SAAS,CAACqB,aAAaE,QAAQ;QAC/C,OAAO;IACT;IAEA,OAAOF,YAAYG,GAAG,CAAC,CAACC;QACtB,OAAOtC,aAAa;YAClBmB,QAAQP,IAAIM,OAAO,CAACC,MAAM;YAC1BoB,KAAKD;QACP;IACF;AACF"}
@@ -171,7 +171,7 @@ export type UploadConfig = {
171
171
  */
172
172
  externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>;
173
173
  /**
174
- * Field slugs to use for a compount index instead of the default filename index.
174
+ * Field slugs to use for a compound index instead of the default filename index.
175
175
  */
176
176
  filenameCompoundIndex?: string[];
177
177
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp, SharpOptions } from 'sharp'\n\nimport type { CollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { PayloadComponent } from '../config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { WithMetadata } from './optionallyAppendMetadata.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\n// TODO: deprecate in Payload v4.\n/**\n * FileSizeImproved is a more precise type, and will replace FileSize in Payload v4.\n * This type is for internal use only as it will be deprecated in the future.\n * @internal\n */\nexport type FileSizeImproved = {\n url: null | string\n} & FileSize\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n focalX?: number\n focalY?: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp `toFormat()` function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type GenerateImageName = (args: {\n extension: string\n height: number\n originalName: string\n sizeName: string\n width: number\n}) => string\n\nexport type ImageSize = {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n /**\n * Generate a custom name for the file of this image size.\n */\n generateImageName?: GenerateImageName\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n} & Omit<ResizeOptions, 'withoutEnlargement'>\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type AllowList = Array<{\n hostname: string\n pathname?: string\n port?: string\n protocol?: 'http' | 'https'\n search?: string\n}>\n\nexport type FileAllowList = Array<{\n extensions: string[]\n mimeType: string\n}>\n\ntype Admin = {\n components?: {\n /**\n * The Controls component to extend the upload controls in the admin panel.\n */\n controls?: PayloadComponent[]\n }\n}\n\nexport type UploadConfig = {\n /**\n * The adapter name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\n */\n adapter?: string\n /**\n * The admin configuration for the upload field.\n */\n admin?: Admin\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Allow restricted file types known to be problematic.\n * - If set to `true`, it will allow all file types.\n * - If set to `false`, it will not allow file types and extensions known to be problematic.\n * - This setting is overriden by the `mimeTypes` option.\n * @default false\n */\n allowRestrictedFileTypes?: boolean\n /**\n * Enables bulk upload of files from the list view.\n * @default true\n */\n bulkUpload?: boolean\n /**\n * Appends a cache tag to the image URL when fetching the thumbnail in the admin panel. It may be desirable to disable this when hosting via CDNs with strict parameters.\n *\n * @default true\n */\n cacheTags?: boolean\n /**\n * Sharp constructor options to be passed to the uploaded file.\n * @link https://sharp.pixelplumbing.com/api-constructor/#sharp\n */\n constructorOptions?: SharpOptions\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Enable displaying preview of the uploaded file in Upload fields related to this Collection.\n * Can be locally overridden by `displayPreview` option in Upload field.\n * @default false\n */\n displayPreview?: boolean\n /**\n *\n * Accepts existing headers and returns the headers after filtering or modifying.\n * If using this option, you should handle the removal of any sensitive cookies\n * (like payload-prefixed cookies) to prevent leaking session information to external\n * services. By default, Payload automatically filters out payload-prefixed cookies\n * when this option is NOT defined.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Field slugs to use for a compount index instead of the default filename index.\n */\n filenameCompoundIndex?: string[]\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @link https://sharp.pixelplumbing.com/api-output/#toformat\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequest,\n args: {\n doc: TypeWithID\n headers?: Headers\n params: { clientUploadContext?: unknown; collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n /**\n * Set to `true` to prevent the admin UI from showing file inputs during document creation, useful for programmatic file generation.\n */\n hideFileInputOnCreate?: boolean\n /**\n * Set to `true` to prevent the admin UI having a way to remove an existing file while editing.\n */\n hideRemoveFile?: boolean\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers | void\n /**\n * Controls the behavior of pasting/uploading files from URLs.\n * If set to `false`, fetching from remote URLs is disabled.\n * If an `allowList` is provided, server-side fetching will be enabled for specified URLs.\n *\n * @default true (client-side fetching enabled)\n */\n pasteURL?:\n | {\n allowList: AllowList\n }\n | false\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * Skip safe fetch when using server-side fetching for external files from these URLs.\n * @default false\n */\n skipSafeFetch?: AllowList | boolean\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * Optionally append metadata to the image during processing.\n *\n * Can be a boolean or a function.\n *\n * If true, metadata will be appended to the image.\n * If false, no metadata will be appended.\n * If a function, it will receive an object containing the metadata and should return a boolean indicating whether to append the metadata.\n * @default false\n */\n withMetadata?: WithMetadata\n}\nexport type checkFileRestrictionsParams = {\n collection: CollectionConfig\n file: File\n req: PayloadRequest\n}\n\nexport type SanitizedUploadConfig = {\n staticDir: UploadConfig['staticDir']\n} & UploadConfig\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\ntype Crop = {\n height: number\n unit: '%' | 'px'\n width: number\n x: number\n y: number\n}\n\ntype FocalPoint = {\n x: number\n y: number\n}\n\nexport type UploadEdits = {\n crop?: Crop\n focalPoint?: FocalPoint\n heightInPixels?: number\n widthInPixels?: number\n}\n"],"names":[],"mappings":"AAgVA,WAKC"}
1
+ {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp, SharpOptions } from 'sharp'\n\nimport type { CollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { PayloadComponent } from '../config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { WithMetadata } from './optionallyAppendMetadata.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\n// TODO: deprecate in Payload v4.\n/**\n * FileSizeImproved is a more precise type, and will replace FileSize in Payload v4.\n * This type is for internal use only as it will be deprecated in the future.\n * @internal\n */\nexport type FileSizeImproved = {\n url: null | string\n} & FileSize\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n focalX?: number\n focalY?: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp `toFormat()` function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type GenerateImageName = (args: {\n extension: string\n height: number\n originalName: string\n sizeName: string\n width: number\n}) => string\n\nexport type ImageSize = {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n /**\n * Generate a custom name for the file of this image size.\n */\n generateImageName?: GenerateImageName\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n} & Omit<ResizeOptions, 'withoutEnlargement'>\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type AllowList = Array<{\n hostname: string\n pathname?: string\n port?: string\n protocol?: 'http' | 'https'\n search?: string\n}>\n\nexport type FileAllowList = Array<{\n extensions: string[]\n mimeType: string\n}>\n\ntype Admin = {\n components?: {\n /**\n * The Controls component to extend the upload controls in the admin panel.\n */\n controls?: PayloadComponent[]\n }\n}\n\nexport type UploadConfig = {\n /**\n * The adapter name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\n */\n adapter?: string\n /**\n * The admin configuration for the upload field.\n */\n admin?: Admin\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Allow restricted file types known to be problematic.\n * - If set to `true`, it will allow all file types.\n * - If set to `false`, it will not allow file types and extensions known to be problematic.\n * - This setting is overriden by the `mimeTypes` option.\n * @default false\n */\n allowRestrictedFileTypes?: boolean\n /**\n * Enables bulk upload of files from the list view.\n * @default true\n */\n bulkUpload?: boolean\n /**\n * Appends a cache tag to the image URL when fetching the thumbnail in the admin panel. It may be desirable to disable this when hosting via CDNs with strict parameters.\n *\n * @default true\n */\n cacheTags?: boolean\n /**\n * Sharp constructor options to be passed to the uploaded file.\n * @link https://sharp.pixelplumbing.com/api-constructor/#sharp\n */\n constructorOptions?: SharpOptions\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Enable displaying preview of the uploaded file in Upload fields related to this Collection.\n * Can be locally overridden by `displayPreview` option in Upload field.\n * @default false\n */\n displayPreview?: boolean\n /**\n *\n * Accepts existing headers and returns the headers after filtering or modifying.\n * If using this option, you should handle the removal of any sensitive cookies\n * (like payload-prefixed cookies) to prevent leaking session information to external\n * services. By default, Payload automatically filters out payload-prefixed cookies\n * when this option is NOT defined.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Field slugs to use for a compound index instead of the default filename index.\n */\n filenameCompoundIndex?: string[]\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @link https://sharp.pixelplumbing.com/api-output/#toformat\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequest,\n args: {\n doc: TypeWithID\n headers?: Headers\n params: { clientUploadContext?: unknown; collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n /**\n * Set to `true` to prevent the admin UI from showing file inputs during document creation, useful for programmatic file generation.\n */\n hideFileInputOnCreate?: boolean\n /**\n * Set to `true` to prevent the admin UI having a way to remove an existing file while editing.\n */\n hideRemoveFile?: boolean\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers | void\n /**\n * Controls the behavior of pasting/uploading files from URLs.\n * If set to `false`, fetching from remote URLs is disabled.\n * If an `allowList` is provided, server-side fetching will be enabled for specified URLs.\n *\n * @default true (client-side fetching enabled)\n */\n pasteURL?:\n | {\n allowList: AllowList\n }\n | false\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * Skip safe fetch when using server-side fetching for external files from these URLs.\n * @default false\n */\n skipSafeFetch?: AllowList | boolean\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * Optionally append metadata to the image during processing.\n *\n * Can be a boolean or a function.\n *\n * If true, metadata will be appended to the image.\n * If false, no metadata will be appended.\n * If a function, it will receive an object containing the metadata and should return a boolean indicating whether to append the metadata.\n * @default false\n */\n withMetadata?: WithMetadata\n}\nexport type checkFileRestrictionsParams = {\n collection: CollectionConfig\n file: File\n req: PayloadRequest\n}\n\nexport type SanitizedUploadConfig = {\n staticDir: UploadConfig['staticDir']\n} & UploadConfig\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\ntype Crop = {\n height: number\n unit: '%' | 'px'\n width: number\n x: number\n y: number\n}\n\ntype FocalPoint = {\n x: number\n y: number\n}\n\nexport type UploadEdits = {\n crop?: Crop\n focalPoint?: FocalPoint\n heightInPixels?: number\n widthInPixels?: number\n}\n"],"names":[],"mappings":"AAgVA,WAKC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.53.0",
3
+ "version": "3.54.0-internal.84621da",
4
4
  "description": "Node, React, Headless CMS and Application Framework built on Next.js",
5
5
  "keywords": [
6
6
  "admin panel",
@@ -101,7 +101,7 @@
101
101
  "undici": "7.10.0",
102
102
  "uuid": "10.0.0",
103
103
  "ws": "^8.16.0",
104
- "@payloadcms/translations": "3.53.0"
104
+ "@payloadcms/translations": "3.54.0-internal.84621da"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@hyrious/esbuild-plugin-commonjs": "0.2.6",