payload 3.0.0-beta.124 → 3.0.0-beta.125

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 (101) hide show
  1. package/dist/admin/RichText.d.ts +2 -1
  2. package/dist/admin/RichText.d.ts.map +1 -1
  3. package/dist/admin/RichText.js.map +1 -1
  4. package/dist/collections/config/types.d.ts +2 -2
  5. package/dist/collections/config/types.d.ts.map +1 -1
  6. package/dist/collections/config/types.js.map +1 -1
  7. package/dist/collections/operations/find.d.ts.map +1 -1
  8. package/dist/collections/operations/find.js +9 -2
  9. package/dist/collections/operations/find.js.map +1 -1
  10. package/dist/collections/operations/findByID.d.ts.map +1 -1
  11. package/dist/collections/operations/findByID.js +21 -6
  12. package/dist/collections/operations/findByID.js.map +1 -1
  13. package/dist/collections/operations/local/count.d.ts +2 -2
  14. package/dist/collections/operations/local/count.d.ts.map +1 -1
  15. package/dist/collections/operations/local/count.js.map +1 -1
  16. package/dist/collections/operations/local/create.d.ts +2 -2
  17. package/dist/collections/operations/local/create.d.ts.map +1 -1
  18. package/dist/collections/operations/local/create.js.map +1 -1
  19. package/dist/collections/operations/local/delete.d.ts +2 -2
  20. package/dist/collections/operations/local/delete.d.ts.map +1 -1
  21. package/dist/collections/operations/local/delete.js.map +1 -1
  22. package/dist/collections/operations/local/duplicate.d.ts +2 -2
  23. package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
  24. package/dist/collections/operations/local/duplicate.js.map +1 -1
  25. package/dist/collections/operations/local/find.d.ts +2 -2
  26. package/dist/collections/operations/local/find.d.ts.map +1 -1
  27. package/dist/collections/operations/local/find.js.map +1 -1
  28. package/dist/collections/operations/local/findByID.d.ts +2 -2
  29. package/dist/collections/operations/local/findByID.d.ts.map +1 -1
  30. package/dist/collections/operations/local/findByID.js.map +1 -1
  31. package/dist/collections/operations/local/findVersionByID.d.ts +2 -2
  32. package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
  33. package/dist/collections/operations/local/findVersionByID.js.map +1 -1
  34. package/dist/collections/operations/local/findVersions.d.ts +2 -2
  35. package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
  36. package/dist/collections/operations/local/findVersions.js.map +1 -1
  37. package/dist/collections/operations/local/restoreVersion.d.ts +2 -2
  38. package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
  39. package/dist/collections/operations/local/restoreVersion.js.map +1 -1
  40. package/dist/collections/operations/local/update.d.ts +2 -2
  41. package/dist/collections/operations/local/update.d.ts.map +1 -1
  42. package/dist/collections/operations/local/update.js.map +1 -1
  43. package/dist/database/sanitizeJoinQuery.d.ts +22 -0
  44. package/dist/database/sanitizeJoinQuery.d.ts.map +1 -0
  45. package/dist/database/sanitizeJoinQuery.js +61 -0
  46. package/dist/database/sanitizeJoinQuery.js.map +1 -0
  47. package/dist/fields/config/types.d.ts +6 -3
  48. package/dist/fields/config/types.d.ts.map +1 -1
  49. package/dist/fields/config/types.js.map +1 -1
  50. package/dist/fields/hooks/afterChange/index.d.ts +2 -1
  51. package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
  52. package/dist/fields/hooks/afterChange/index.js.map +1 -1
  53. package/dist/fields/hooks/afterChange/promise.d.ts +2 -1
  54. package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
  55. package/dist/fields/hooks/afterChange/promise.js.map +1 -1
  56. package/dist/fields/hooks/afterChange/traverseFields.d.ts +2 -1
  57. package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
  58. package/dist/fields/hooks/afterChange/traverseFields.js.map +1 -1
  59. package/dist/fields/hooks/afterRead/index.d.ts +2 -1
  60. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
  61. package/dist/fields/hooks/afterRead/index.js.map +1 -1
  62. package/dist/fields/hooks/afterRead/promise.d.ts +2 -1
  63. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  64. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  65. package/dist/fields/hooks/afterRead/traverseFields.d.ts +2 -1
  66. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  67. package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -1
  68. package/dist/fields/hooks/beforeChange/index.d.ts +2 -1
  69. package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
  70. package/dist/fields/hooks/beforeChange/index.js.map +1 -1
  71. package/dist/fields/hooks/beforeChange/promise.d.ts +2 -1
  72. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  73. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  74. package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -1
  75. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  76. package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
  77. package/dist/fields/hooks/beforeDuplicate/index.d.ts +2 -1
  78. package/dist/fields/hooks/beforeDuplicate/index.d.ts.map +1 -1
  79. package/dist/fields/hooks/beforeDuplicate/index.js.map +1 -1
  80. package/dist/fields/hooks/beforeDuplicate/promise.d.ts +2 -1
  81. package/dist/fields/hooks/beforeDuplicate/promise.d.ts.map +1 -1
  82. package/dist/fields/hooks/beforeDuplicate/promise.js.map +1 -1
  83. package/dist/fields/hooks/beforeDuplicate/traverseFields.d.ts +2 -1
  84. package/dist/fields/hooks/beforeDuplicate/traverseFields.d.ts.map +1 -1
  85. package/dist/fields/hooks/beforeDuplicate/traverseFields.js.map +1 -1
  86. package/dist/fields/hooks/beforeValidate/index.d.ts +2 -1
  87. package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
  88. package/dist/fields/hooks/beforeValidate/index.js.map +1 -1
  89. package/dist/fields/hooks/beforeValidate/promise.d.ts +2 -1
  90. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  91. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  92. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +2 -1
  93. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
  94. package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
  95. package/dist/globals/config/types.d.ts +2 -2
  96. package/dist/globals/config/types.d.ts.map +1 -1
  97. package/dist/globals/config/types.js.map +1 -1
  98. package/dist/types/index.d.ts +2 -5
  99. package/dist/types/index.d.ts.map +1 -1
  100. package/dist/types/index.js.map +1 -1
  101. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,UAAU,EACV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,uBAAuB,CAAA;AAO9B,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAC9E,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,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,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAA;I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ACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAGD,wBAA8B,WAAW,CACvC,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAuCxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/create.ts"],"sourcesContent":["import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n RequestContext,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { File } from '../../../uploads/types.js'\nimport type {\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { getFileByPath } from '../../../uploads/getFileByPath.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { createOperation } from '../create.js'\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n data: RequiredDataFromCollectionSlug<TSlug>\n depth?: number\n disableTransaction?: boolean\n disableVerificationEmail?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n file?: File\n filePath?: string\n locale?: TypedLocale\n overrideAccess?: boolean\n overwriteExistingFiles?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\n// eslint-disable-next-line no-restricted-exports\nexport default async function createLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n file,\n filePath,\n overrideAccess = true,\n overwriteExistingFiles = false,\n select,\n showHiddenFields,\n } = options\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Create Operation.`,\n )\n }\n\n const req = await createLocalReq(options, payload)\n req.file = file ?? (await getFileByPath(filePath))\n\n return createOperation<TSlug, TSelect>({\n collection,\n data,\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n overrideAccess,\n overwriteExistingFiles,\n req,\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","getFileByPath","createLocalReq","createOperation","createLocal","payload","options","collection","collectionSlug","data","depth","disableTransaction","disableVerificationEmail","draft","file","filePath","overrideAccess","overwriteExistingFiles","select","showHiddenFields","collections","String","req"],"mappings":"AAcA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAyB9C,iDAAiD;AACjD,eAAe,eAAeC,YAI5BC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,wBAAwB,EACxBC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,iBAAiB,IAAI,EACrBC,yBAAyB,KAAK,EAC9BC,MAAM,EACNC,gBAAgB,EACjB,GAAGb;IACJ,MAAMC,aAAaF,QAAQe,WAAW,CAACZ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEqB,OAAOb,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMc,MAAM,MAAMpB,eAAeI,SAASD;IAC1CiB,IAAIR,IAAI,GAAGA,QAAS,MAAMb,cAAcc;IAExC,OAAOZ,gBAAgC;QACrCI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAK;QACAJ;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/create.ts"],"sourcesContent":["import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { File } from '../../../uploads/types.js'\nimport type {\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { getFileByPath } from '../../../uploads/getFileByPath.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { createOperation } from '../create.js'\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n data: RequiredDataFromCollectionSlug<TSlug>\n depth?: number\n disableTransaction?: boolean\n disableVerificationEmail?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n file?: File\n filePath?: string\n locale?: TypedLocale\n overrideAccess?: boolean\n overwriteExistingFiles?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\n// eslint-disable-next-line no-restricted-exports\nexport default async function createLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n file,\n filePath,\n overrideAccess = true,\n overwriteExistingFiles = false,\n select,\n showHiddenFields,\n } = options\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Create Operation.`,\n )\n }\n\n const req = await createLocalReq(options, payload)\n req.file = file ?? (await getFileByPath(filePath))\n\n return createOperation<TSlug, TSelect>({\n collection,\n data,\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n overrideAccess,\n overwriteExistingFiles,\n req,\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","getFileByPath","createLocalReq","createOperation","createLocal","payload","options","collection","collectionSlug","data","depth","disableTransaction","disableVerificationEmail","draft","file","filePath","overrideAccess","overwriteExistingFiles","select","showHiddenFields","collections","String","req"],"mappings":"AAaA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAyB9C,iDAAiD;AACjD,eAAe,eAAeC,YAI5BC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,wBAAwB,EACxBC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,iBAAiB,IAAI,EACrBC,yBAAyB,KAAK,EAC9BC,MAAM,EACNC,gBAAgB,EACjB,GAAGb;IACJ,MAAMC,aAAaF,QAAQe,WAAW,CAACZ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEqB,OAAOb,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMc,MAAM,MAAMpB,eAAeI,SAASD;IAC1CiB,IAAIR,IAAI,GAAGA,QAAS,MAAMb,cAAcc;IAExC,OAAOZ,gBAAgC;QACrCI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAK;QACAJ;QACAC;IACF;AACF"}
@@ -1,5 +1,5 @@
1
- import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js';
2
- import type { Document, PayloadRequest, RequestContext, SelectType, TransformCollectionWithSelect, Where } from '../../../types/index.js';
1
+ import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
2
+ import type { Document, PayloadRequest, SelectType, TransformCollectionWithSelect, Where } from '../../../types/index.js';
3
3
  import type { BulkOperationResult, SelectFromCollectionSlug } from '../../config/types.js';
4
4
  export type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {
5
5
  collection: TSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,UAAU,EACV,6BAA6B,EAC7B,KAAK,EACN,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAO1F,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAClF,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,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AAG,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AA+C/F,eAAe,WAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/delete.ts"],"sourcesContent":["import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n RequestContext,\n SelectType,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { BulkOperationResult, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { deleteOperation } from '../delete.js'\nimport { deleteByIDOperation } from '../deleteByID.js'\n\nexport type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n disableTransaction?: boolean\n fallbackLocale?: TypedLocale\n locale?: TypedLocale\n overrideAccess?: boolean\n overrideLock?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport type ByIDOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id: number | string\n where?: never\n} & BaseOptions<TSlug, TSelect>\n\nexport type ManyOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id?: never\n where: Where\n} & BaseOptions<TSlug, TSelect>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = ByIDOptions<TSlug, TSelect> | ManyOptions<TSlug, TSelect>\n\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ByIDOptions<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ManyOptions<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableTransaction,\n overrideAccess = true,\n overrideLock,\n select,\n showHiddenFields,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Delete Operation.`,\n )\n }\n\n const args = {\n id,\n collection,\n depth,\n disableTransaction,\n overrideAccess,\n overrideLock,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n where,\n }\n\n if (options.id) {\n return deleteByIDOperation<TSlug, TSelect>(args)\n }\n return deleteOperation<TSlug, TSelect>(args)\n}\n\nexport default deleteLocal\n"],"names":["APIError","createLocalReq","deleteOperation","deleteByIDOperation","deleteLocal","payload","options","id","collection","collectionSlug","depth","disableTransaction","overrideAccess","overrideLock","select","showHiddenFields","where","collections","String","args","req"],"mappings":"AAWA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AA8DtD,eAAeC,YAIbC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,kBAAkB,EAClBC,iBAAiB,IAAI,EACrBC,YAAY,EACZC,MAAM,EACNC,gBAAgB,EAChBC,KAAK,EACN,GAAGV;IAEJ,MAAME,aAAaH,QAAQY,WAAW,CAACR,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEkB,OAAOT,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMU,OAAO;QACXZ;QACAC;QACAE;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMnB,eAAeK,SAASD;QACnCS;QACAC;QACAC;IACF;IAEA,IAAIV,QAAQC,EAAE,EAAE;QACd,OAAOJ,oBAAoCgB;IAC7C;IACA,OAAOjB,gBAAgCiB;AACzC;AAEA,eAAef,YAAW"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/delete.ts"],"sourcesContent":["import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n SelectType,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { BulkOperationResult, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { deleteOperation } from '../delete.js'\nimport { deleteByIDOperation } from '../deleteByID.js'\n\nexport type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n disableTransaction?: boolean\n fallbackLocale?: TypedLocale\n locale?: TypedLocale\n overrideAccess?: boolean\n overrideLock?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport type ByIDOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id: number | string\n where?: never\n} & BaseOptions<TSlug, TSelect>\n\nexport type ManyOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id?: never\n where: Where\n} & BaseOptions<TSlug, TSelect>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = ByIDOptions<TSlug, TSelect> | ManyOptions<TSlug, TSelect>\n\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ByIDOptions<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ManyOptions<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableTransaction,\n overrideAccess = true,\n overrideLock,\n select,\n showHiddenFields,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Delete Operation.`,\n )\n }\n\n const args = {\n id,\n collection,\n depth,\n disableTransaction,\n overrideAccess,\n overrideLock,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n where,\n }\n\n if (options.id) {\n return deleteByIDOperation<TSlug, TSelect>(args)\n }\n return deleteOperation<TSlug, TSelect>(args)\n}\n\nexport default deleteLocal\n"],"names":["APIError","createLocalReq","deleteOperation","deleteByIDOperation","deleteLocal","payload","options","id","collection","collectionSlug","depth","disableTransaction","overrideAccess","overrideLock","select","showHiddenFields","where","collections","String","args","req"],"mappings":"AAUA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AA8DtD,eAAeC,YAIbC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,kBAAkB,EAClBC,iBAAiB,IAAI,EACrBC,YAAY,EACZC,MAAM,EACNC,gBAAgB,EAChBC,KAAK,EACN,GAAGV;IAEJ,MAAME,aAAaH,QAAQY,WAAW,CAACR,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEkB,OAAOT,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMU,OAAO;QACXZ;QACAC;QACAE;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMnB,eAAeK,SAASD;QACnCS;QACAC;QACAC;IACF;IAEA,IAAIV,QAAQC,EAAE,EAAE;QACd,OAAOJ,oBAAoCgB;IAC7C;IACA,OAAOjB,gBAAgCiB;AACzC;AAEA,eAAef,YAAW"}
@@ -1,6 +1,6 @@
1
1
  import type { CollectionSlug, TypedLocale } from '../../..//index.js';
2
- import type { Payload } from '../../../index.js';
3
- import type { Document, PayloadRequest, RequestContext, SelectType, TransformCollectionWithSelect } from '../../../types/index.js';
2
+ import type { Payload, RequestContext } from '../../../index.js';
3
+ import type { Document, PayloadRequest, SelectType, TransformCollectionWithSelect } from '../../../types/index.js';
4
4
  import type { SelectFromCollectionSlug } from '../../config/types.js';
5
5
  export type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {
6
6
  collection: TSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/duplicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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,oBAAoB,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAMrE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAC9E,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAAsB,SAAS,CAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAuCxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/duplicate.ts"],"sourcesContent":["import type { CollectionSlug, TypedLocale } from '../../..//index.js'\nimport type { Payload } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n RequestContext,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { DataFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { duplicateOperation } from '../duplicate.js'\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n disableTransaction?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: number | string\n locale?: TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport async function duplicate<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableTransaction,\n draft,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Duplicate Operation.`,\n )\n }\n\n if (collection.config.disableDuplicate === true) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} cannot be duplicated.`,\n 400,\n )\n }\n\n const req = await createLocalReq(options, payload)\n\n return duplicateOperation<TSlug, TSelect>({\n id,\n collection,\n depth,\n disableTransaction,\n draft,\n overrideAccess,\n req,\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","duplicateOperation","duplicate","payload","options","id","collection","collectionSlug","depth","disableTransaction","draft","overrideAccess","select","showHiddenFields","collections","String","config","disableDuplicate","req"],"mappings":"AAWA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,kBAAkB,QAAQ,kBAAiB;AAqBpD,OAAO,eAAeC,UAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,kBAAkB,EAClBC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGT;IACJ,MAAME,aAAaH,QAAQW,WAAW,CAACP,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEgB,OAAOR,gBAAgB,qCAAqC,CAAC;IAE7F;IAEA,IAAID,WAAWU,MAAM,CAACC,gBAAgB,KAAK,MAAM;QAC/C,MAAM,IAAIlB,SACR,CAAC,yBAAyB,EAAEgB,OAAOR,gBAAgB,sBAAsB,CAAC,EAC1E;IAEJ;IAEA,MAAMW,MAAM,MAAMlB,eAAeI,SAASD;IAE1C,OAAOF,mBAAmC;QACxCI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAO;QACAN;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/duplicate.ts"],"sourcesContent":["import type { CollectionSlug, TypedLocale } from '../../..//index.js'\nimport type { Payload, RequestContext } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { duplicateOperation } from '../duplicate.js'\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n disableTransaction?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: number | string\n locale?: TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport async function duplicate<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableTransaction,\n draft,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Duplicate Operation.`,\n )\n }\n\n if (collection.config.disableDuplicate === true) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} cannot be duplicated.`,\n 400,\n )\n }\n\n const req = await createLocalReq(options, payload)\n\n return duplicateOperation<TSlug, TSelect>({\n id,\n collection,\n depth,\n disableTransaction,\n draft,\n overrideAccess,\n req,\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","duplicateOperation","duplicate","payload","options","id","collection","collectionSlug","depth","disableTransaction","draft","overrideAccess","select","showHiddenFields","collections","String","config","disableDuplicate","req"],"mappings":"AAUA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,kBAAkB,QAAQ,kBAAiB;AAqBpD,OAAO,eAAeC,UAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,kBAAkB,EAClBC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGT;IACJ,MAAME,aAAaH,QAAQW,WAAW,CAACP,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEgB,OAAOR,gBAAgB,qCAAqC,CAAC;IAE7F;IAEA,IAAID,WAAWU,MAAM,CAACC,gBAAgB,KAAK,MAAM;QAC/C,MAAM,IAAIlB,SACR,CAAC,yBAAyB,EAAEgB,OAAOR,gBAAgB,sBAAsB,CAAC,EAC1E;IAEJ;IAEA,MAAMW,MAAM,MAAMlB,eAAeI,SAASD;IAE1C,OAAOF,mBAAmC;QACxCI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAO;QACAN;QACAC;IACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  import type { PaginatedDocs } from '../../../database/types.js';
2
- import type { CollectionSlug, JoinQuery, Payload, TypedLocale } from '../../../index.js';
3
- import type { Document, PayloadRequest, RequestContext, SelectType, Sort, TransformCollectionWithSelect, Where } from '../../../types/index.js';
2
+ import type { CollectionSlug, JoinQuery, Payload, RequestContext, TypedLocale } from '../../../index.js';
3
+ import type { Document, PayloadRequest, SelectType, Sort, TransformCollectionWithSelect, Where } from '../../../types/index.js';
4
4
  import type { SelectFromCollectionSlug } from '../../config/types.js';
5
5
  export type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {
6
6
  collection: TSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACxF,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,UAAU,EACV,IAAI,EACJ,6BAA6B,EAC7B,KAAK,EACN,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAMrE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAC9E,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,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KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAC9E,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAAsB,SAAS,CAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,aAAa,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CA8CvE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/find.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { CollectionSlug, JoinQuery, Payload, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n RequestContext,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findOperation } from '../find.js'\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n currentDepth?: number\n depth?: number\n disableErrors?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n includeLockStatus?: boolean\n joins?: JoinQuery\n limit?: number\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n page?: number\n pagination?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n sort?: Sort\n user?: Document\n where?: Where\n}\n\nexport async function findLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<PaginatedDocs<TransformCollectionWithSelect<TSlug, TSelect>>> {\n const {\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors,\n draft = false,\n includeLockStatus,\n joins,\n limit,\n overrideAccess = true,\n page,\n pagination = true,\n select,\n // select,\n showHiddenFields,\n sort,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Operation.`,\n )\n }\n\n return findOperation<TSlug, TSelect>({\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n includeLockStatus,\n joins,\n limit,\n overrideAccess,\n page,\n pagination,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findOperation","findLocal","payload","options","collection","collectionSlug","currentDepth","depth","disableErrors","draft","includeLockStatus","joins","limit","overrideAccess","page","pagination","select","showHiddenFields","sort","where","collections","String","req"],"mappings":"AAaA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,aAAa,QAAQ,aAAY;AA4B1C,OAAO,eAAeC,UAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,aAAa,EACbC,QAAQ,KAAK,EACbC,iBAAiB,EACjBC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,aAAa,IAAI,EACjBC,MAAM,EACN,UAAU;IACVC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGhB;IAEJ,MAAMC,aAAaF,QAAQkB,WAAW,CAACf,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEuB,OAAOhB,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,cAA8B;QACnCI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMvB,eAAeI,SAASD;QACnCc;QACAC;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/find.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type {\n CollectionSlug,\n JoinQuery,\n Payload,\n RequestContext,\n TypedLocale,\n} from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findOperation } from '../find.js'\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n currentDepth?: number\n depth?: number\n disableErrors?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n includeLockStatus?: boolean\n joins?: JoinQuery\n limit?: number\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n page?: number\n pagination?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n sort?: Sort\n user?: Document\n where?: Where\n}\n\nexport async function findLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<PaginatedDocs<TransformCollectionWithSelect<TSlug, TSelect>>> {\n const {\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors,\n draft = false,\n includeLockStatus,\n joins,\n limit,\n overrideAccess = true,\n page,\n pagination = true,\n select,\n // select,\n showHiddenFields,\n sort,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Operation.`,\n )\n }\n\n return findOperation<TSlug, TSelect>({\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n includeLockStatus,\n joins,\n limit,\n overrideAccess,\n page,\n pagination,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findOperation","findLocal","payload","options","collection","collectionSlug","currentDepth","depth","disableErrors","draft","includeLockStatus","joins","limit","overrideAccess","page","pagination","select","showHiddenFields","sort","where","collections","String","req"],"mappings":"AAkBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,aAAa,QAAQ,aAAY;AA4B1C,OAAO,eAAeC,UAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,aAAa,EACbC,QAAQ,KAAK,EACbC,iBAAiB,EACjBC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,aAAa,IAAI,EACjBC,MAAM,EACN,UAAU;IACVC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGhB;IAEJ,MAAMC,aAAaF,QAAQkB,WAAW,CAACf,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEuB,OAAOhB,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,cAA8B;QACnCI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMvB,eAAeI,SAASD;QACnCc;QACAC;QACAC;QACAC;IACF;AACF"}
@@ -1,5 +1,5 @@
1
- import type { CollectionSlug, JoinQuery, Payload, SelectType, TypedLocale } from '../../../index.js';
2
- import type { ApplyDisableErrors, Document, PayloadRequest, RequestContext, TransformCollectionWithSelect } from '../../../types/index.js';
1
+ import type { CollectionSlug, JoinQuery, Payload, RequestContext, SelectType, TypedLocale } from '../../../index.js';
2
+ import type { ApplyDisableErrors, Document, PayloadRequest, TransformCollectionWithSelect } from '../../../types/index.js';
3
3
  import type { SelectFromCollectionSlug } from '../../config/types.js';
4
4
  export type Options<TSlug extends CollectionSlug, TDisableErrors extends boolean, TSelect extends SelectType> = {
5
5
  collection: TSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findByID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpG,OAAO,KAAK,EACV,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAMrE,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,UAAU,IACxB;IACF,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,cAAc,CAAA;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,aAAa,CACzC,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,GAC/C,OAAO,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAqC5F"}
1
+ {"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findByID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAMrE,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,UAAU,IACxB;IACF,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,cAAc,CAAA;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,aAAa,CACzC,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,GAC/C,OAAO,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAqC5F"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/findByID.ts"],"sourcesContent":["/* eslint-disable no-restricted-exports */\nimport type { CollectionSlug, JoinQuery, Payload, SelectType, TypedLocale } from '../../../index.js'\nimport type {\n ApplyDisableErrors,\n Document,\n PayloadRequest,\n RequestContext,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findByIDOperation } from '../findByID.js'\n\nexport type Options<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectType,\n> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n currentDepth?: number\n depth?: number\n disableErrors?: TDisableErrors\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: number | string\n includeLockStatus?: boolean\n joins?: JoinQuery\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function findByIDLocal<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TDisableErrors, TSelect>,\n): Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>> {\n const {\n id,\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors = false,\n draft = false,\n includeLockStatus,\n joins,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find By ID Operation.`,\n )\n }\n\n return findByIDOperation<TSlug, TDisableErrors, TSelect>({\n id,\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n includeLockStatus,\n joins,\n overrideAccess,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findByIDOperation","findByIDLocal","payload","options","id","collection","collectionSlug","currentDepth","depth","disableErrors","draft","includeLockStatus","joins","overrideAccess","select","showHiddenFields","collections","String","req"],"mappings":"AAAA,wCAAwC,GAWxC,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,iBAAiB,QAAQ,iBAAgB;AA4BlD,eAAe,eAAeC,cAK5BC,OAAgB,EAChBC,OAAgD;IAEhD,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,QAAQ,KAAK,EACbC,iBAAiB,EACjBC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGZ;IAEJ,MAAME,aAAaH,QAAQc,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,sCAAsC,CAAC;IAE9F;IAEA,OAAON,kBAAkD;QACvDI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAK,KAAK,MAAMnB,eAAeI,SAASD;QACnCY;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/findByID.ts"],"sourcesContent":["/* eslint-disable no-restricted-exports */\nimport type {\n CollectionSlug,\n JoinQuery,\n Payload,\n RequestContext,\n SelectType,\n TypedLocale,\n} from '../../../index.js'\nimport type {\n ApplyDisableErrors,\n Document,\n PayloadRequest,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findByIDOperation } from '../findByID.js'\n\nexport type Options<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectType,\n> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n currentDepth?: number\n depth?: number\n disableErrors?: TDisableErrors\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: number | string\n includeLockStatus?: boolean\n joins?: JoinQuery\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function findByIDLocal<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TDisableErrors, TSelect>,\n): Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>> {\n const {\n id,\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors = false,\n draft = false,\n includeLockStatus,\n joins,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find By ID Operation.`,\n )\n }\n\n return findByIDOperation<TSlug, TDisableErrors, TSelect>({\n id,\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n includeLockStatus,\n joins,\n overrideAccess,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findByIDOperation","findByIDLocal","payload","options","id","collection","collectionSlug","currentDepth","depth","disableErrors","draft","includeLockStatus","joins","overrideAccess","select","showHiddenFields","collections","String","req"],"mappings":"AAAA,wCAAwC,GAiBxC,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,iBAAiB,QAAQ,iBAAgB;AA4BlD,eAAe,eAAeC,cAK5BC,OAAgB,EAChBC,OAAgD;IAEhD,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,QAAQ,KAAK,EACbC,iBAAiB,EACjBC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGZ;IAEJ,MAAME,aAAaH,QAAQc,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,sCAAsC,CAAC;IAE9F;IAEA,OAAON,kBAAkD;QACvDI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAK,KAAK,MAAMnB,eAAeI,SAASD;QACnCY;QACAC;IACF;AACF"}
@@ -1,5 +1,5 @@
1
- import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js';
2
- import type { Document, PayloadRequest, RequestContext, SelectType } from '../../../types/index.js';
1
+ import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
2
+ import type { Document, PayloadRequest, SelectType } from '../../../types/index.js';
3
3
  import type { TypeWithVersion } from '../../../versions/types.js';
4
4
  import type { DataFromCollectionSlug } from '../../config/types.js';
5
5
  export type Options<TSlug extends CollectionSlug> = {
@@ -1 +1 @@
1
- {"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAMnE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI;IAClD,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,oBAAoB,CAAC,KAAK,SAAS,cAAc,EAC7E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CA+BzD"}
1
+ {"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAMnE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI;IAClD,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,oBAAoB,CAAC,KAAK,SAAS,cAAc,EAC7E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CA+BzD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"sourcesContent":["import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, SelectType } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\nimport type { DataFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\nexport type Options<TSlug extends CollectionSlug> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n disableErrors?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: string\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: SelectType\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function findVersionByIDLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<TypeWithVersion<DataFromCollectionSlug<TSlug>>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableErrors = false,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Find Version By ID Operation.`,\n )\n }\n\n return findVersionByIDOperation({\n id,\n collection,\n depth,\n disableErrors,\n overrideAccess,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionByIDOperation","findVersionByIDLocal","payload","options","id","collection","collectionSlug","depth","disableErrors","overrideAccess","select","showHiddenFields","collections","String","req"],"mappings":"AAKA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,wBAAwB,QAAQ,wBAAuB;AAqBhE,eAAe,eAAeC,qBAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGR;IAEJ,MAAME,aAAaH,QAAQU,WAAW,CAACN,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEe,OAC1BP,gBACA,8CAA8C,CAAC;IAErD;IAEA,OAAON,yBAAyB;QAC9BI;QACAC;QACAE;QACAC;QACAC;QACAK,KAAK,MAAMf,eAAeI,SAASD;QACnCQ;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"sourcesContent":["import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js'\nimport type { Document, PayloadRequest, SelectType } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\nimport type { DataFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\nexport type Options<TSlug extends CollectionSlug> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n disableErrors?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: string\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: SelectType\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function findVersionByIDLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<TypeWithVersion<DataFromCollectionSlug<TSlug>>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableErrors = false,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Find Version By ID Operation.`,\n )\n }\n\n return findVersionByIDOperation({\n id,\n collection,\n depth,\n disableErrors,\n overrideAccess,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionByIDOperation","findVersionByIDLocal","payload","options","id","collection","collectionSlug","depth","disableErrors","overrideAccess","select","showHiddenFields","collections","String","req"],"mappings":"AAKA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,wBAAwB,QAAQ,wBAAuB;AAqBhE,eAAe,eAAeC,qBAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGR;IAEJ,MAAME,aAAaH,QAAQU,WAAW,CAACN,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEe,OAC1BP,gBACA,8CAA8C,CAAC;IAErD;IAEA,OAAON,yBAAyB;QAC9BI;QACAC;QACAE;QACAC;QACAC;QACAK,KAAK,MAAMf,eAAeI,SAASD;QACnCQ;QACAC;IACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  import type { PaginatedDocs } from '../../../database/types.js';
2
- import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js';
3
- import type { Document, PayloadRequest, RequestContext, SelectType, Sort, Where } from '../../../types/index.js';
2
+ import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
3
+ import type { Document, PayloadRequest, SelectType, Sort, Where } from '../../../types/index.js';
4
4
  import type { TypeWithVersion } from '../../../versions/types.js';
5
5
  import type { DataFromCollectionSlug } from '../../config/types.js';
6
6
  export type Options<TSlug extends CollectionSlug> = {
@@ -1 +1 @@
1
- {"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,UAAU,EACV,IAAI,EACJ,KAAK,EACN,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAMnE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI;IAClD,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAA8B,iBAAiB,CAAC,KAAK,SAAS,cAAc,EAC1E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAiCxE"}
1
+ {"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAMnE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI;IAClD,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAA8B,iBAAiB,CAAC,KAAK,SAAS,cAAc,EAC1E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAiCxE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { CollectionSlug, Payload, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n RequestContext,\n SelectType,\n Sort,\n Where,\n} from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\nimport type { DataFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionsOperation } from '../findVersions.js'\n\nexport type Options<TSlug extends CollectionSlug> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n draft?: boolean\n fallbackLocale?: TypedLocale\n limit?: number\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n page?: number\n req?: PayloadRequest\n select?: SelectType\n showHiddenFields?: boolean\n sort?: Sort\n user?: Document\n where?: Where\n}\n\nexport default async function findVersionsLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<PaginatedDocs<TypeWithVersion<DataFromCollectionSlug<TSlug>>>> {\n const {\n collection: collectionSlug,\n depth,\n limit,\n overrideAccess = true,\n page,\n select,\n showHiddenFields,\n sort,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Versions Operation.`,\n )\n }\n\n return findVersionsOperation({\n collection,\n depth,\n limit,\n overrideAccess,\n page,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionsOperation","findVersionsLocal","payload","options","collection","collectionSlug","depth","limit","overrideAccess","page","select","showHiddenFields","sort","where","collections","String","req"],"mappings":"AAaA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,qBAAqB,QAAQ,qBAAoB;AAuB1D,eAAe,eAAeC,kBAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGV;IAEJ,MAAMC,aAAaF,QAAQY,WAAW,CAACT,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEiB,OAAOV,gBAAgB,yCAAyC,CAAC;IAEjG;IAEA,OAAOL,sBAAsB;QAC3BI;QACAE;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMjB,eAAeI,SAASD;QACnCQ;QACAC;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js'\nimport type { Document, PayloadRequest, SelectType, Sort, Where } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\nimport type { DataFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionsOperation } from '../findVersions.js'\n\nexport type Options<TSlug extends CollectionSlug> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n draft?: boolean\n fallbackLocale?: TypedLocale\n limit?: number\n locale?: 'all' | TypedLocale\n overrideAccess?: boolean\n page?: number\n req?: PayloadRequest\n select?: SelectType\n showHiddenFields?: boolean\n sort?: Sort\n user?: Document\n where?: Where\n}\n\nexport default async function findVersionsLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<PaginatedDocs<TypeWithVersion<DataFromCollectionSlug<TSlug>>>> {\n const {\n collection: collectionSlug,\n depth,\n limit,\n overrideAccess = true,\n page,\n select,\n showHiddenFields,\n sort,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Versions Operation.`,\n )\n }\n\n return findVersionsOperation({\n collection,\n depth,\n limit,\n overrideAccess,\n page,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionsOperation","findVersionsLocal","payload","options","collection","collectionSlug","depth","limit","overrideAccess","page","select","showHiddenFields","sort","where","collections","String","req"],"mappings":"AAMA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,qBAAqB,QAAQ,qBAAoB;AAuB1D,eAAe,eAAeC,kBAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGV;IAEJ,MAAMC,aAAaF,QAAQY,WAAW,CAACT,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEiB,OAAOV,gBAAgB,yCAAyC,CAAC;IAEjG;IAEA,OAAOL,sBAAsB;QAC3BI;QACAE;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMjB,eAAeI,SAASD;QACnCQ;QACAC;QACAC;QACAC;IACF;AACF"}
@@ -1,5 +1,5 @@
1
- import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js';
2
- import type { Document, PayloadRequest, RequestContext, SelectType } from '../../../types/index.js';
1
+ import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
2
+ import type { Document, PayloadRequest, SelectType } from '../../../types/index.js';
3
3
  import type { DataFromCollectionSlug } from '../../config/types.js';
4
4
  export type Options<TSlug extends CollectionSlug> = {
5
5
  collection: TSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAMnE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI;IAClD,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,mBAAmB,CAAC,KAAK,SAAS,cAAc,EAC5E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAgCxC"}
1
+ {"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAMnE,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI;IAClD,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,mBAAmB,CAAC,KAAK,SAAS,cAAc,EAC5E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAgCxC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"sourcesContent":["import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, SelectType } from '../../../types/index.js'\nimport type { DataFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { restoreVersionOperation } from '../restoreVersion.js'\n\nexport type Options<TSlug extends CollectionSlug> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: string\n locale?: TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: SelectType\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function restoreVersionLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<DataFromCollectionSlug<TSlug>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Restore Version Operation.`,\n )\n }\n\n const args = {\n id,\n collection,\n depth,\n overrideAccess,\n payload,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n }\n\n return restoreVersionOperation(args)\n}\n"],"names":["APIError","createLocalReq","restoreVersionOperation","restoreVersionLocal","payload","options","id","collection","collectionSlug","depth","overrideAccess","select","showHiddenFields","collections","String","args","req"],"mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,uBAAuB,QAAQ,uBAAsB;AAoB9D,eAAe,eAAeC,oBAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGP;IAEJ,MAAME,aAAaH,QAAQS,WAAW,CAACL,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEc,OAC1BN,gBACA,2CAA2C,CAAC;IAElD;IAEA,MAAMO,OAAO;QACXT;QACAC;QACAE;QACAC;QACAN;QACAY,KAAK,MAAMf,eAAeI,SAASD;QACnCO;QACAC;IACF;IAEA,OAAOV,wBAAwBa;AACjC"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"sourcesContent":["import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js'\nimport type { Document, PayloadRequest, SelectType } from '../../../types/index.js'\nimport type { DataFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { restoreVersionOperation } from '../restoreVersion.js'\n\nexport type Options<TSlug extends CollectionSlug> = {\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n depth?: number\n draft?: boolean\n fallbackLocale?: TypedLocale\n id: string\n locale?: TypedLocale\n overrideAccess?: boolean\n req?: PayloadRequest\n select?: SelectType\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function restoreVersionLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<DataFromCollectionSlug<TSlug>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n overrideAccess = true,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Restore Version Operation.`,\n )\n }\n\n const args = {\n id,\n collection,\n depth,\n overrideAccess,\n payload,\n req: await createLocalReq(options, payload),\n select,\n showHiddenFields,\n }\n\n return restoreVersionOperation(args)\n}\n"],"names":["APIError","createLocalReq","restoreVersionOperation","restoreVersionLocal","payload","options","id","collection","collectionSlug","depth","overrideAccess","select","showHiddenFields","collections","String","args","req"],"mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,uBAAuB,QAAQ,uBAAsB;AAoB9D,eAAe,eAAeC,oBAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,MAAM,EACNC,gBAAgB,EACjB,GAAGP;IAEJ,MAAME,aAAaH,QAAQS,WAAW,CAACL,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEc,OAC1BN,gBACA,2CAA2C,CAAC;IAElD;IAEA,MAAMO,OAAO;QACXT;QACAC;QACAE;QACAC;QACAN;QACAY,KAAK,MAAMf,eAAeI,SAASD;QACnCO;QACAC;IACF;IAEA,OAAOV,wBAAwBa;AACjC"}
@@ -1,6 +1,6 @@
1
1
  import type { DeepPartial } from 'ts-essentials';
2
- import type { CollectionSlug, Payload, TypedLocale } from '../../../index.js';
3
- import type { Document, PayloadRequest, RequestContext, SelectType, TransformCollectionWithSelect, Where } from '../../../types/index.js';
2
+ import type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
3
+ import type { Document, PayloadRequest, SelectType, TransformCollectionWithSelect, Where } from '../../../types/index.js';
4
4
  import type { File } from '../../../uploads/types.js';
5
5
  import type { BulkOperationResult, RequiredDataFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js';
6
6
  export type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/update.ts"],"names":[],"mappings":"A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AAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AACzD,iBAAe,WAAW,CACxB,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,GACnC,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AAC/C,iBAAe,WAAW,CACxB,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AAiE/F,eAAe,WAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/update.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { CollectionSlug, Payload, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n RequestContext,\n SelectType,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { File } from '../../../uploads/types.js'\nimport type {\n BulkOperationResult,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { getFileByPath } from '../../../uploads/getFileByPath.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { updateOperation } from '../update.js'\nimport { updateByIDOperation } from '../updateByID.js'\n\nexport type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n autosave?: boolean\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n data: DeepPartial<RequiredDataFromCollectionSlug<TSlug>>\n depth?: number\n disableTransaction?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n file?: File\n filePath?: string\n locale?: TypedLocale\n overrideAccess?: boolean\n overrideLock?: boolean\n overwriteExistingFiles?: boolean\n publishSpecificLocale?: string\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport type ByIDOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id: number | string\n limit?: never\n where?: never\n} & BaseOptions<TSlug, TSelect>\n\nexport type ManyOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id?: never\n limit?: number\n where: Where\n} & BaseOptions<TSlug, TSelect>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = ByIDOptions<TSlug, TSelect> | ManyOptions<TSlug, TSelect>\n\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ByIDOptions<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ManyOptions<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect>>\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>>\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n autosave,\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n draft,\n file,\n filePath,\n limit,\n overrideAccess = true,\n overrideLock,\n overwriteExistingFiles = false,\n publishSpecificLocale,\n select,\n showHiddenFields,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Update Operation.`,\n )\n }\n\n const req = await createLocalReq(options, payload)\n req.file = file ?? (await getFileByPath(filePath))\n\n const args = {\n id,\n autosave,\n collection,\n data,\n depth,\n disableTransaction,\n draft,\n limit,\n overrideAccess,\n overrideLock,\n overwriteExistingFiles,\n payload,\n publishSpecificLocale,\n req,\n select,\n showHiddenFields,\n where,\n }\n\n if (options.id) {\n return updateByIDOperation<TSlug, TSelect>(args)\n }\n return updateOperation<TSlug, TSelect>(args)\n}\n\nexport default updateLocal\n"],"names":["APIError","getFileByPath","createLocalReq","updateOperation","updateByIDOperation","updateLocal","payload","options","id","autosave","collection","collectionSlug","data","depth","disableTransaction","draft","file","filePath","limit","overrideAccess","overrideLock","overwriteExistingFiles","publishSpecificLocale","select","showHiddenFields","where","collections","String","req","args"],"mappings":"AAkBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AAuEtD,eAAeC,YAIbC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,QAAQ,EACRC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,YAAY,EACZC,yBAAyB,KAAK,EAC9BC,qBAAqB,EACrBC,MAAM,EACNC,gBAAgB,EAChBC,KAAK,EACN,GAAGlB;IAEJ,MAAMG,aAAaJ,QAAQoB,WAAW,CAACf,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIV,SACR,CAAC,yBAAyB,EAAE2B,OAAOhB,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMiB,MAAM,MAAM1B,eAAeK,SAASD;IAC1CsB,IAAIZ,IAAI,GAAGA,QAAS,MAAMf,cAAcgB;IAExC,MAAMY,OAAO;QACXrB;QACAC;QACAC;QACAE;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAf;QACAgB;QACAM;QACAL;QACAC;QACAC;IACF;IAEA,IAAIlB,QAAQC,EAAE,EAAE;QACd,OAAOJ,oBAAoCyB;IAC7C;IACA,OAAO1B,gBAAgC0B;AACzC;AAEA,eAAexB,YAAW"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/update.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { CollectionSlug, Payload, RequestContext, TypedLocale } from '../../../index.js'\nimport type {\n Document,\n PayloadRequest,\n SelectType,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { File } from '../../../uploads/types.js'\nimport type {\n BulkOperationResult,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { getFileByPath } from '../../../uploads/getFileByPath.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { updateOperation } from '../update.js'\nimport { updateByIDOperation } from '../updateByID.js'\n\nexport type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n autosave?: boolean\n collection: TSlug\n /**\n * context, which will then be passed to req.context, which can be read by hooks\n */\n context?: RequestContext\n data: DeepPartial<RequiredDataFromCollectionSlug<TSlug>>\n depth?: number\n disableTransaction?: boolean\n draft?: boolean\n fallbackLocale?: TypedLocale\n file?: File\n filePath?: string\n locale?: TypedLocale\n overrideAccess?: boolean\n overrideLock?: boolean\n overwriteExistingFiles?: boolean\n publishSpecificLocale?: string\n req?: PayloadRequest\n select?: TSelect\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport type ByIDOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id: number | string\n limit?: never\n where?: never\n} & BaseOptions<TSlug, TSelect>\n\nexport type ManyOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n id?: never\n limit?: number\n where: Where\n} & BaseOptions<TSlug, TSelect>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = ByIDOptions<TSlug, TSelect> | ManyOptions<TSlug, TSelect>\n\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ByIDOptions<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ManyOptions<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect>>\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>>\nasync function updateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n autosave,\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n draft,\n file,\n filePath,\n limit,\n overrideAccess = true,\n overrideLock,\n overwriteExistingFiles = false,\n publishSpecificLocale,\n select,\n showHiddenFields,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Update Operation.`,\n )\n }\n\n const req = await createLocalReq(options, payload)\n req.file = file ?? (await getFileByPath(filePath))\n\n const args = {\n id,\n autosave,\n collection,\n data,\n depth,\n disableTransaction,\n draft,\n limit,\n overrideAccess,\n overrideLock,\n overwriteExistingFiles,\n payload,\n publishSpecificLocale,\n req,\n select,\n showHiddenFields,\n where,\n }\n\n if (options.id) {\n return updateByIDOperation<TSlug, TSelect>(args)\n }\n return updateOperation<TSlug, TSelect>(args)\n}\n\nexport default updateLocal\n"],"names":["APIError","getFileByPath","createLocalReq","updateOperation","updateByIDOperation","updateLocal","payload","options","id","autosave","collection","collectionSlug","data","depth","disableTransaction","draft","file","filePath","limit","overrideAccess","overrideLock","overwriteExistingFiles","publishSpecificLocale","select","showHiddenFields","where","collections","String","req","args"],"mappings":"AAiBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AAuEtD,eAAeC,YAIbC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,QAAQ,EACRC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,YAAY,EACZC,yBAAyB,KAAK,EAC9BC,qBAAqB,EACrBC,MAAM,EACNC,gBAAgB,EAChBC,KAAK,EACN,GAAGlB;IAEJ,MAAMG,aAAaJ,QAAQoB,WAAW,CAACf,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIV,SACR,CAAC,yBAAyB,EAAE2B,OAAOhB,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMiB,MAAM,MAAM1B,eAAeK,SAASD;IAC1CsB,IAAIZ,IAAI,GAAGA,QAAS,MAAMf,cAAcgB;IAExC,MAAMY,OAAO;QACXrB;QACAC;QACAC;QACAE;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAf;QACAgB;QACAM;QACAL;QACAC;QACAC;IACF;IAEA,IAAIlB,QAAQC,EAAE,EAAE;QACd,OAAOJ,oBAAoCyB;IAC7C;IACA,OAAO1B,gBAAgC0B;AACzC;AAEA,eAAexB,YAAW"}
@@ -0,0 +1,22 @@
1
+ import type { SanitizedCollectionConfig } from '../collections/config/types.js';
2
+ import type { JoinQuery, PayloadRequest } from '../types/index.js';
3
+ type Args = {
4
+ collectionConfig: SanitizedCollectionConfig;
5
+ joins?: JoinQuery;
6
+ overrideAccess: boolean;
7
+ req: PayloadRequest;
8
+ };
9
+ /**
10
+ * * Validates `where` for each join
11
+ * * Combines the access result for joined collection
12
+ * * Combines the default join's `where`
13
+ */
14
+ export declare const sanitizeJoinQuery: ({ collectionConfig, joins: joinsQuery, overrideAccess, req, }: Args) => Promise<false | {
15
+ [schemaPath: string]: false | {
16
+ limit?: number;
17
+ sort?: string;
18
+ where?: import("../types/index.js").Where;
19
+ };
20
+ }>;
21
+ export {};
22
+ //# sourceMappingURL=sanitizeJoinQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizeJoinQuery.d.ts","sourceRoot":"","sources":["../../src/database/sanitizeJoinQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAOlE,KAAK,IAAI,GAAG;IACV,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kEAK3B,IAAI;;;;;;EAkEN,CAAA"}
@@ -0,0 +1,61 @@
1
+ import executeAccess from '../auth/executeAccess.js';
2
+ import { QueryError } from '../errors/QueryError.js';
3
+ import { combineQueries } from './combineQueries.js';
4
+ import { validateQueryPaths } from './queryValidation/validateQueryPaths.js';
5
+ /**
6
+ * * Validates `where` for each join
7
+ * * Combines the access result for joined collection
8
+ * * Combines the default join's `where`
9
+ */ export const sanitizeJoinQuery = async ({ collectionConfig, joins: joinsQuery, overrideAccess, req })=>{
10
+ if (joinsQuery === false) {
11
+ return false;
12
+ }
13
+ if (!joinsQuery) {
14
+ joinsQuery = {};
15
+ }
16
+ const errors = [];
17
+ const promises = [];
18
+ for(const collectionSlug in collectionConfig.joins){
19
+ for (const { field, schemaPath } of collectionConfig.joins[collectionSlug]){
20
+ if (joinsQuery[schemaPath] === false) {
21
+ continue;
22
+ }
23
+ const joinCollectionConfig = req.payload.collections[collectionSlug].config;
24
+ const accessResult = !overrideAccess ? await executeAccess({
25
+ disableErrors: true,
26
+ req
27
+ }, joinCollectionConfig.access.read) : true;
28
+ if (accessResult === false) {
29
+ joinsQuery[schemaPath] = false;
30
+ continue;
31
+ }
32
+ if (!joinsQuery[schemaPath]) {
33
+ joinsQuery[schemaPath] = {};
34
+ }
35
+ const joinQuery = joinsQuery[schemaPath];
36
+ if (!joinQuery.where) {
37
+ joinQuery.where = {};
38
+ }
39
+ if (field.where) {
40
+ joinQuery.where = combineQueries(joinQuery.where, field.where);
41
+ }
42
+ if (typeof accessResult === 'object') {
43
+ joinQuery.where = combineQueries(joinQuery.where, accessResult);
44
+ }
45
+ promises.push(validateQueryPaths({
46
+ collectionConfig: joinCollectionConfig,
47
+ errors,
48
+ overrideAccess,
49
+ req,
50
+ where: joinQuery.where
51
+ }));
52
+ }
53
+ }
54
+ await Promise.all(promises);
55
+ if (errors.length > 0) {
56
+ throw new QueryError(errors);
57
+ }
58
+ return joinsQuery;
59
+ };
60
+
61
+ //# sourceMappingURL=sanitizeJoinQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/database/sanitizeJoinQuery.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { JoinQuery, PayloadRequest } from '../types/index.js'\n\nimport executeAccess from '../auth/executeAccess.js'\nimport { QueryError } from '../errors/QueryError.js'\nimport { combineQueries } from './combineQueries.js'\nimport { validateQueryPaths } from './queryValidation/validateQueryPaths.js'\n\ntype Args = {\n collectionConfig: SanitizedCollectionConfig\n joins?: JoinQuery\n overrideAccess: boolean\n req: PayloadRequest\n}\n\n/**\n * * Validates `where` for each join\n * * Combines the access result for joined collection\n * * Combines the default join's `where`\n */\nexport const sanitizeJoinQuery = async ({\n collectionConfig,\n joins: joinsQuery,\n overrideAccess,\n req,\n}: Args) => {\n if (joinsQuery === false) {\n return false\n }\n\n if (!joinsQuery) {\n joinsQuery = {}\n }\n\n const errors: { path: string }[] = []\n const promises: Promise<void>[] = []\n\n for (const collectionSlug in collectionConfig.joins) {\n for (const { field, schemaPath } of collectionConfig.joins[collectionSlug]) {\n if (joinsQuery[schemaPath] === false) {\n continue\n }\n\n const joinCollectionConfig = req.payload.collections[collectionSlug].config\n\n const accessResult = !overrideAccess\n ? await executeAccess({ disableErrors: true, req }, joinCollectionConfig.access.read)\n : true\n\n if (accessResult === false) {\n joinsQuery[schemaPath] = false\n continue\n }\n\n if (!joinsQuery[schemaPath]) {\n joinsQuery[schemaPath] = {}\n }\n\n const joinQuery = joinsQuery[schemaPath]\n\n if (!joinQuery.where) {\n joinQuery.where = {}\n }\n\n if (field.where) {\n joinQuery.where = combineQueries(joinQuery.where, field.where)\n }\n\n if (typeof accessResult === 'object') {\n joinQuery.where = combineQueries(joinQuery.where, accessResult)\n }\n\n promises.push(\n validateQueryPaths({\n collectionConfig: joinCollectionConfig,\n errors,\n overrideAccess,\n req,\n where: joinQuery.where,\n }),\n )\n }\n }\n\n await Promise.all(promises)\n\n if (errors.length > 0) {\n throw new QueryError(errors)\n }\n\n return joinsQuery\n}\n"],"names":["executeAccess","QueryError","combineQueries","validateQueryPaths","sanitizeJoinQuery","collectionConfig","joins","joinsQuery","overrideAccess","req","errors","promises","collectionSlug","field","schemaPath","joinCollectionConfig","payload","collections","config","accessResult","disableErrors","access","read","joinQuery","where","push","Promise","all","length"],"mappings":"AAGA,OAAOA,mBAAmB,2BAA0B;AACpD,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,kBAAkB,QAAQ,0CAAyC;AAS5E;;;;CAIC,GACD,OAAO,MAAMC,oBAAoB,OAAO,EACtCC,gBAAgB,EAChBC,OAAOC,UAAU,EACjBC,cAAc,EACdC,GAAG,EACE;IACL,IAAIF,eAAe,OAAO;QACxB,OAAO;IACT;IAEA,IAAI,CAACA,YAAY;QACfA,aAAa,CAAC;IAChB;IAEA,MAAMG,SAA6B,EAAE;IACrC,MAAMC,WAA4B,EAAE;IAEpC,IAAK,MAAMC,kBAAkBP,iBAAiBC,KAAK,CAAE;QACnD,KAAK,MAAM,EAAEO,KAAK,EAAEC,UAAU,EAAE,IAAIT,iBAAiBC,KAAK,CAACM,eAAe,CAAE;YAC1E,IAAIL,UAAU,CAACO,WAAW,KAAK,OAAO;gBACpC;YACF;YAEA,MAAMC,uBAAuBN,IAAIO,OAAO,CAACC,WAAW,CAACL,eAAe,CAACM,MAAM;YAE3E,MAAMC,eAAe,CAACX,iBAClB,MAAMR,cAAc;gBAAEoB,eAAe;gBAAMX;YAAI,GAAGM,qBAAqBM,MAAM,CAACC,IAAI,IAClF;YAEJ,IAAIH,iBAAiB,OAAO;gBAC1BZ,UAAU,CAACO,WAAW,GAAG;gBACzB;YACF;YAEA,IAAI,CAACP,UAAU,CAACO,WAAW,EAAE;gBAC3BP,UAAU,CAACO,WAAW,GAAG,CAAC;YAC5B;YAEA,MAAMS,YAAYhB,UAAU,CAACO,WAAW;YAExC,IAAI,CAACS,UAAUC,KAAK,EAAE;gBACpBD,UAAUC,KAAK,GAAG,CAAC;YACrB;YAEA,IAAIX,MAAMW,KAAK,EAAE;gBACfD,UAAUC,KAAK,GAAGtB,eAAeqB,UAAUC,KAAK,EAAEX,MAAMW,KAAK;YAC/D;YAEA,IAAI,OAAOL,iBAAiB,UAAU;gBACpCI,UAAUC,KAAK,GAAGtB,eAAeqB,UAAUC,KAAK,EAAEL;YACpD;YAEAR,SAASc,IAAI,CACXtB,mBAAmB;gBACjBE,kBAAkBU;gBAClBL;gBACAF;gBACAC;gBACAe,OAAOD,UAAUC,KAAK;YACxB;QAEJ;IACF;IAEA,MAAME,QAAQC,GAAG,CAAChB;IAElB,IAAID,OAAOkB,MAAM,GAAG,GAAG;QACrB,MAAM,IAAI3B,WAAWS;IACvB;IAEA,OAAOH;AACT,EAAC"}
@@ -10,9 +10,9 @@ import type { SanitizedCollectionConfig, TypeWithID } from '../../collections/co
10
10
  import type { CustomComponent, LabelFunction, PayloadComponent, StaticLabel } from '../../config/types.js';
11
11
  import type { DBIdentifierName } from '../../database/types.js';
12
12
  import type { SanitizedGlobalConfig } from '../../globals/config/types.js';
13
- import type { ArrayFieldValidation, BlocksFieldValidation, CheckboxFieldValidation, CodeFieldValidation, CollectionSlug, DateFieldValidation, EmailFieldValidation, JSONFieldValidation, PointFieldValidation, RadioFieldValidation, Sort, TextareaFieldValidation } from '../../index.js';
13
+ import type { ArrayFieldValidation, BlocksFieldValidation, CheckboxFieldValidation, CodeFieldValidation, CollectionSlug, DateFieldValidation, EmailFieldValidation, JSONFieldValidation, PointFieldValidation, RadioFieldValidation, RequestContext, Sort, TextareaFieldValidation } from '../../index.js';
14
14
  import type { DocumentPreferences } from '../../preferences/types.js';
15
- import type { Operation, PayloadRequest, RequestContext, Where } from '../../types/index.js';
15
+ import type { Operation, PayloadRequest, Where } from '../../types/index.js';
16
16
  import type { NumberFieldManyValidation, NumberFieldSingleValidation, RelationshipFieldManyValidation, RelationshipFieldSingleValidation, SelectFieldManyValidation, SelectFieldSingleValidation, TextFieldManyValidation, TextFieldSingleValidation, UploadFieldManyValidation, UploadFieldSingleValidation } from '../validations.js';
17
17
  export type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
18
18
  /** The collection which the field belongs to. If the field belongs to a global, this will be null. */
@@ -754,6 +754,7 @@ export type JSONField = {
754
754
  Label?: CustomComponent<JSONFieldLabelClientComponent | JSONFieldLabelServerComponent>;
755
755
  } & Admin['components'];
756
756
  editorOptions?: EditorProps['options'];
757
+ maxHeight?: number;
757
758
  } & Admin;
758
759
  jsonSchema?: {
759
760
  fileMatch: string[];
@@ -771,6 +772,7 @@ export type JSONFieldClient = {
771
772
  Error?: MappedComponent;
772
773
  Label?: MappedComponent;
773
774
  } & AdminClient['components'];
775
+ maxHeight?: number;
774
776
  } & AdminClient & Pick<JSONField['admin'], 'editorOptions'>;
775
777
  } & Omit<FieldBaseClient, 'admin'> & Pick<JSONField, 'jsonSchema' | 'type'>;
776
778
  export type SelectField = {
@@ -1137,6 +1139,7 @@ export type JoinField = {
1137
1139
  on: string;
1138
1140
  type: 'join';
1139
1141
  validate?: never;
1142
+ where?: Where;
1140
1143
  } & FieldBase;
1141
1144
  export type JoinFieldClient = {
1142
1145
  admin?: {
@@ -1145,7 +1148,7 @@ export type JoinFieldClient = {
1145
1148
  Label?: MappedComponent;
1146
1149
  } & AdminClient['components'];
1147
1150
  } & AdminClient & Pick<JoinField['admin'], 'disableBulkEdit' | 'readOnly'>;
1148
- } & FieldBaseClient & Pick<JoinField, 'collection' | 'index' | 'maxDepth' | 'on' | 'type'>;
1151
+ } & FieldBaseClient & Pick<JoinField, 'collection' | 'index' | 'maxDepth' | 'on' | 'type' | 'where'>;
1149
1152
  export type Field = ArrayField | BlocksField | CheckboxField | CodeField | CollapsibleField | DateField | EmailField | GroupField | JoinField | JSONField | NumberField | PointField | RadioField | RelationshipField | RichTextField | RowField | SelectField | TabsField | TextareaField | TextField | UIField | UploadField;
1150
1153
  export type ClientField = ArrayFieldClient | BlocksFieldClient | CheckboxFieldClient | CodeFieldClient | CollapsibleFieldClient | DateFieldClient | EmailFieldClient | GroupFieldClient | JoinFieldClient | JSONFieldClient | NumberFieldClient | PointFieldClient | RadioFieldClient | RelationshipFieldClient | RichTextFieldClient | RowFieldClient | SelectFieldClient | TabsFieldClient | TextareaFieldClient | TextFieldClient | UIFieldClient | UploadFieldClient;
1151
1154
  export type ClientFieldProps = ArrayFieldClientProps | BlocksFieldClientProps | CheckboxFieldClientProps | CodeFieldClientProps | CollapsibleFieldClientProps | DateFieldClientProps | EmailFieldClientProps | GroupFieldClientProps | HiddenFieldProps | JSONFieldClientProps | NumberFieldClientProps | PointFieldClientProps | RadioFieldClientProps | RelationshipFieldClientProps | RichTextFieldClientProps | RowFieldClientProps | SelectFieldClientProps | TabsFieldClientProps | TextareaFieldClientProps | UploadFieldClientProps;