payload 3.0.0-beta.6 → 3.0.0-beta.8
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.
- package/dist/collections/operations/local/create.d.ts +2 -2
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js.map +1 -1
- package/dist/collections/operations/local/delete.d.ts +2 -2
- package/dist/collections/operations/local/delete.d.ts.map +1 -1
- package/dist/collections/operations/local/delete.js.map +1 -1
- package/dist/collections/operations/local/duplicate.d.ts +2 -2
- package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/local/duplicate.js.map +1 -1
- package/dist/collections/operations/local/find.d.ts +2 -2
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js.map +1 -1
- package/dist/collections/operations/local/findByID.d.ts +2 -2
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js.map +1 -1
- package/dist/collections/operations/local/findVersionByID.d.ts +2 -2
- package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersionByID.js.map +1 -1
- package/dist/collections/operations/local/findVersions.d.ts +2 -2
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js.map +1 -1
- package/dist/collections/operations/local/restoreVersion.d.ts +2 -2
- package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/local/restoreVersion.js.map +1 -1
- package/dist/collections/operations/local/update.d.ts +2 -2
- package/dist/collections/operations/local/update.d.ts.map +1 -1
- package/dist/collections/operations/local/update.js.map +1 -1
- package/dist/globals/operations/findOne.d.ts +0 -1
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- package/dist/globals/operations/findOne.js.map +1 -1
- package/dist/globals/operations/local/findOne.d.ts +2 -2
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js.map +1 -1
- package/dist/globals/operations/local/findVersionByID.d.ts +2 -2
- package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersionByID.js.map +1 -1
- package/dist/globals/operations/local/findVersions.d.ts +2 -2
- package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersions.js.map +1 -1
- package/dist/globals/operations/local/restoreVersion.d.ts +2 -2
- package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/local/restoreVersion.js.map +1 -1
- package/dist/globals/operations/local/update.d.ts +2 -2
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +19 -0
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/auth.d.ts +0 -6
- package/auth.js +0 -6
- package/config.d.ts +0 -14
- package/config.js +0 -14
- package/database.d.ts +0 -23
- package/database.js +0 -22
- package/errors.d.ts +0 -2
- package/errors.js +0 -3
- package/node.d.ts +0 -3
- package/node.js +0 -4
- package/operations.d.ts +0 -30
- package/operations.js +0 -31
- package/types.d.ts +0 -17
- package/types.js +0 -5
- package/uploads.d.ts +0 -2
- package/uploads.js +0 -3
- package/utilities.d.ts +0 -31
- package/utilities.js +0 -32
- package/versions.d.ts +0 -9
- package/versions.js +0 -9
|
@@ -13,10 +13,10 @@ export type Options<TSlug extends keyof GeneratedTypes['collections']> = {
|
|
|
13
13
|
depth?: number;
|
|
14
14
|
disableVerificationEmail?: boolean;
|
|
15
15
|
draft?: boolean;
|
|
16
|
-
fallbackLocale?:
|
|
16
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
17
17
|
file?: File;
|
|
18
18
|
filePath?: string;
|
|
19
|
-
locale?:
|
|
19
|
+
locale?: GeneratedTypes['locale'];
|
|
20
20
|
overrideAccess?: boolean;
|
|
21
21
|
overwriteExistingFiles?: boolean;
|
|
22
22
|
req?: PayloadRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAOrD,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACvE,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,IAAI,EAAE,YAAY,CAChB,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,EACpC,WAAW,GAAG,IAAI,GAAG,OAAO,GAAG,WAAW,CAC3C,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;A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["../../../../src/collections/operations/local/create.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { GeneratedTypes } from '../../../index.js'\nimport type { Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\nimport type { File } from '../../../uploads/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 keyof GeneratedTypes['collections']> = {\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: MarkOptional<\n GeneratedTypes['collections'][TSlug],\n 'createdAt' | 'id' | 'sizes' | 'updatedAt'\n >\n depth?: number\n disableVerificationEmail?: boolean\n draft?: boolean\n fallbackLocale?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/create.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { GeneratedTypes } from '../../../index.js'\nimport type { Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\nimport type { File } from '../../../uploads/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 keyof GeneratedTypes['collections']> = {\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: MarkOptional<\n GeneratedTypes['collections'][TSlug],\n 'createdAt' | 'id' | 'sizes' | 'updatedAt'\n >\n depth?: number\n disableVerificationEmail?: boolean\n draft?: boolean\n fallbackLocale?: GeneratedTypes['locale']\n file?: File\n filePath?: string\n locale?: GeneratedTypes['locale']\n overrideAccess?: boolean\n overwriteExistingFiles?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\n// eslint-disable-next-line no-restricted-exports\nexport default async function createLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<GeneratedTypes['collections'][TSlug]> {\n const {\n collection: collectionSlug,\n data,\n depth,\n disableVerificationEmail,\n draft,\n file,\n filePath,\n overrideAccess = true,\n overwriteExistingFiles = false,\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>({\n collection,\n data,\n depth,\n disableVerificationEmail,\n draft,\n overrideAccess,\n overwriteExistingFiles,\n req,\n showHiddenFields,\n })\n}\n"],"names":["APIError","getFileByPath","createLocalReq","createOperation","createLocal","payload","options","collection","collectionSlug","data","depth","disableVerificationEmail","draft","file","filePath","overrideAccess","overwriteExistingFiles","showHiddenFields","collections","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAOA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AA0B9C,iDAAiD;AACjD,eAAe,eAAeC,YAC5BC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,wBAAwB,EACxBC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,iBAAiB,IAAI,EACrBC,yBAAyB,KAAK,EAC9BC,gBAAgB,EACjB,GAAGX;IACJ,MAAMC,aAAaF,QAAQa,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMY,MAAM,MAAMlB,eAAeI,SAASD;IAC1Ce,IAAIP,IAAI,GAAGA,QAAS,MAAMZ,cAAca;IAExC,OAAOX,gBAAuB;QAC5BI;QACAE;QACAC;QACAC;QACAC;QACAG;QACAC;QACAI;QACAH;IACF;AACF"}
|
|
@@ -10,8 +10,8 @@ export type BaseOptions<T extends keyof GeneratedTypes['collections']> = {
|
|
|
10
10
|
*/
|
|
11
11
|
context?: RequestContext;
|
|
12
12
|
depth?: number;
|
|
13
|
-
fallbackLocale?:
|
|
14
|
-
locale?:
|
|
13
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
14
|
+
locale?: GeneratedTypes['locale'];
|
|
15
15
|
overrideAccess?: boolean;
|
|
16
16
|
req?: PayloadRequest;
|
|
17
17
|
showHiddenFields?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACvE,UAAU,EAAE,CAAC,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,M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AAC,KAAK,CAAC,CAAA;AAEtB,iBAAe,WAAW,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC1E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,GAC1B,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;AAChD,iBAAe,WAAW,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC1E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,GAC1B,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAA;AACtC,iBAAe,WAAW,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC1E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;AAsC7E,eAAe,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/delete.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\nimport type { GeneratedTypes } from '../../../index.js'\nimport type { PayloadRequest, RequestContext } from '../../../types/index.js'\nimport type { Document, Where } from '../../../types/index.js'\nimport type { BulkOperationResult } 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<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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 fallbackLocale?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/delete.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\nimport type { GeneratedTypes } from '../../../index.js'\nimport type { PayloadRequest, RequestContext } from '../../../types/index.js'\nimport type { Document, Where } from '../../../types/index.js'\nimport type { BulkOperationResult } 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<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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 fallbackLocale?: GeneratedTypes['locale']\n locale?: GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport type ByIDOptions<T extends keyof GeneratedTypes['collections']> = BaseOptions<T> & {\n id: number | string\n where?: never\n}\n\nexport type ManyOptions<T extends keyof GeneratedTypes['collections']> = BaseOptions<T> & {\n id?: never\n where: Where\n}\n\nexport type Options<TSlug extends keyof GeneratedTypes['collections']> =\n | ByIDOptions<TSlug>\n | ManyOptions<TSlug>\n\nasync function deleteLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: ByIDOptions<TSlug>,\n): Promise<GeneratedTypes['collections'][TSlug]>\nasync function deleteLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: ManyOptions<TSlug>,\n): Promise<BulkOperationResult<TSlug>>\nasync function deleteLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<BulkOperationResult<TSlug> | GeneratedTypes['collections'][TSlug]>\nasync function deleteLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<BulkOperationResult<TSlug> | GeneratedTypes['collections'][TSlug]> {\n const {\n id,\n collection: collectionSlug,\n depth,\n overrideAccess = true,\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 overrideAccess,\n req: await createLocalReq(options, payload),\n showHiddenFields,\n where,\n }\n\n if (options.id) {\n return deleteByIDOperation<TSlug>(args)\n }\n return deleteOperation<TSlug>(args)\n}\n\nexport default deleteLocal\n"],"names":["APIError","createLocalReq","deleteOperation","deleteByIDOperation","deleteLocal","payload","options","id","collection","collectionSlug","depth","overrideAccess","showHiddenFields","where","collections","String","args","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAMA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AA2CtD,eAAeC,YACbC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,gBAAgB,EAChBC,KAAK,EACN,GAAGP;IAEJ,MAAME,aAAaH,QAAQS,WAAW,CAACL,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEe,OAAON,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMO,OAAO;QACXT;QACAC;QACAE;QACAC;QACAM,KAAK,MAAMhB,eAAeK,SAASD;QACnCO;QACAC;IACF;IAEA,IAAIP,QAAQC,EAAE,EAAE;QACd,OAAOJ,oBAA2Ba;IACpC;IACA,OAAOd,gBAAuBc;AAChC;AAEA,eAAeZ,YAAW"}
|
|
@@ -9,9 +9,9 @@ export type Options<TSlug extends keyof GeneratedTypes['collections']> = {
|
|
|
9
9
|
context?: RequestContext;
|
|
10
10
|
depth?: number;
|
|
11
11
|
draft?: boolean;
|
|
12
|
-
fallbackLocale?:
|
|
12
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
13
13
|
id: number | string;
|
|
14
|
-
locale?:
|
|
14
|
+
locale?: GeneratedTypes['locale'];
|
|
15
15
|
overrideAccess?: boolean;
|
|
16
16
|
req?: PayloadRequest;
|
|
17
17
|
showHiddenFields?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/duplicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvF,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACvE,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,
|
|
1
|
+
{"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/duplicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvF,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACvE,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,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACjC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAAsB,SAAS,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC/E,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAmC/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/duplicate.ts"],"sourcesContent":["import type { GeneratedTypes } from '../../..//index.js'\nimport type { Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.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 keyof GeneratedTypes['collections']> = {\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?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/duplicate.ts"],"sourcesContent":["import type { GeneratedTypes } from '../../..//index.js'\nimport type { Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.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 keyof GeneratedTypes['collections']> = {\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?: GeneratedTypes['locale']\n id: number | string\n locale?: GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport async function duplicate<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<GeneratedTypes['collections'][TSlug]> {\n const {\n id,\n collection: collectionSlug,\n depth,\n draft,\n overrideAccess = true,\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 === false) {\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>({\n id,\n collection,\n depth,\n draft,\n overrideAccess,\n req,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","duplicateOperation","duplicate","payload","options","id","collection","collectionSlug","depth","draft","overrideAccess","showHiddenFields","collections","String","config","disableDuplicate","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,kBAAkB,QAAQ,kBAAiB;AAmBpD,OAAO,eAAeC,UACpBC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,gBAAgB,EACjB,GAAGP;IACJ,MAAME,aAAaH,QAAQS,WAAW,CAACL,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEc,OAAON,gBAAgB,qCAAqC,CAAC;IAE7F;IAEA,IAAID,WAAWQ,MAAM,CAACC,gBAAgB,KAAK,OAAO;QAChD,MAAM,IAAIhB,SACR,CAAC,yBAAyB,EAAEc,OAAON,gBAAgB,sBAAsB,CAAC,EAC1E;IAEJ;IAEA,MAAMS,MAAM,MAAMhB,eAAeI,SAASD;IAE1C,OAAOF,mBAA0B;QAC/BI;QACAC;QACAE;QACAC;QACAC;QACAM;QACAL;IACF;AACF"}
|
|
@@ -11,9 +11,9 @@ export type Options<T extends keyof GeneratedTypes['collections']> = {
|
|
|
11
11
|
depth?: number;
|
|
12
12
|
disableErrors?: boolean;
|
|
13
13
|
draft?: boolean;
|
|
14
|
-
fallbackLocale?:
|
|
14
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
15
15
|
limit?: number;
|
|
16
|
-
locale?:
|
|
16
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
17
17
|
overrideAccess?: boolean;
|
|
18
18
|
page?: number;
|
|
19
19
|
pagination?: boolean;
|
|
@@ -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,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAM9F,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;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,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,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAuC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/find.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, Where } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findOperation } from '../find.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/find.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, Where } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findOperation } from '../find.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?: GeneratedTypes['locale']\n limit?: number\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n page?: number\n pagination?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n sort?: string\n user?: Document\n where?: Where\n}\n\nexport default async function findLocal<T extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<T>,\n): Promise<PaginatedDocs<GeneratedTypes['collections'][T]>> {\n const {\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors,\n draft = false,\n limit,\n overrideAccess = true,\n page,\n pagination = true,\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<GeneratedTypes['collections'][T]>({\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n limit,\n overrideAccess,\n page,\n pagination,\n req: await createLocalReq(options, payload),\n showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findOperation","findLocal","payload","options","collection","collectionSlug","currentDepth","depth","disableErrors","draft","limit","overrideAccess","page","pagination","showHiddenFields","sort","where","collections","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,aAAa,QAAQ,aAAY;AAyB1C,eAAe,eAAeC,UAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,aAAa,EACbC,QAAQ,KAAK,EACbC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,aAAa,IAAI,EACjBC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGb;IAEJ,MAAMC,aAAaF,QAAQe,WAAW,CAACZ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEoB,OAAOb,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,cAAgD;QACrDI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAM,KAAK,MAAMpB,eAAeI,SAASD;QACnCY;QACAC;QACAC;IACF;AACF"}
|
|
@@ -10,9 +10,9 @@ export type Options<T extends keyof GeneratedTypes['collections']> = {
|
|
|
10
10
|
depth?: number;
|
|
11
11
|
disableErrors?: boolean;
|
|
12
12
|
draft?: boolean;
|
|
13
|
-
fallbackLocale?:
|
|
13
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
14
14
|
id: number | string;
|
|
15
|
-
locale?:
|
|
15
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
16
16
|
overrideAccess?: boolean;
|
|
17
17
|
req?: PayloadRequest;
|
|
18
18
|
showHiddenFields?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;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,
|
|
1
|
+
{"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;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,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,aAAa,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EACvF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CA+B3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/findByID.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findByIDOperation } from '../findByID.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/findByID.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findByIDOperation } from '../findByID.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?: GeneratedTypes['locale']\n id: number | string\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function findByIDLocal<T extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<T>,\n): Promise<GeneratedTypes['collections'][T]> {\n const {\n id,\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors = false,\n draft = false,\n overrideAccess = true,\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<GeneratedTypes['collections'][T]>({\n id,\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n overrideAccess,\n req: await createLocalReq(options, payload),\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findByIDOperation","findByIDLocal","payload","options","id","collection","collectionSlug","currentDepth","depth","disableErrors","draft","overrideAccess","showHiddenFields","collections","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,iBAAiB,QAAQ,iBAAgB;AAqBlD,eAAe,eAAeC,cAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,QAAQ,KAAK,EACbC,iBAAiB,IAAI,EACrBC,gBAAgB,EACjB,GAAGT;IAEJ,MAAME,aAAaH,QAAQW,WAAW,CAACP,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEgB,OAAOR,gBAAgB,sCAAsC,CAAC;IAE9F;IAEA,OAAON,kBAAoD;QACzDI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAI,KAAK,MAAMhB,eAAeI,SAASD;QACnCU;IACF;AACF"}
|
|
@@ -10,9 +10,9 @@ export type Options<T extends keyof GeneratedTypes['collections']> = {
|
|
|
10
10
|
depth?: number;
|
|
11
11
|
disableErrors?: boolean;
|
|
12
12
|
draft?: boolean;
|
|
13
|
-
fallbackLocale?:
|
|
13
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
14
14
|
id: string;
|
|
15
|
-
locale?:
|
|
15
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
16
16
|
overrideAccess?: boolean;
|
|
17
17
|
req?: PayloadRequest;
|
|
18
18
|
showHiddenFields?: boolean;
|
|
@@ -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,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;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,
|
|
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,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;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,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,oBAAoB,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC9F,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA6B5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?: GeneratedTypes['locale']\n id: string\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function findVersionByIDLocal<T extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<T>,\n): Promise<TypeWithVersion<GeneratedTypes['collections'][T]>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableErrors = false,\n overrideAccess = true,\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 showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionByIDOperation","findVersionByIDLocal","payload","options","id","collection","collectionSlug","depth","disableErrors","overrideAccess","showHiddenFields","collections","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,wBAAwB,QAAQ,wBAAuB;AAoBhE,eAAe,eAAeC,qBAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,iBAAiB,IAAI,EACrBC,gBAAgB,EACjB,GAAGP;IAEJ,MAAME,aAAaH,QAAQS,WAAW,CAACL,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEc,OAC1BN,gBACA,8CAA8C,CAAC;IAErD;IAEA,OAAON,yBAAyB;QAC9BI;QACAC;QACAE;QACAC;QACAC;QACAI,KAAK,MAAMd,eAAeI,SAASD;QACnCQ;IACF;AACF"}
|
|
@@ -10,9 +10,9 @@ export type Options<T extends keyof GeneratedTypes['collections']> = {
|
|
|
10
10
|
context?: RequestContext;
|
|
11
11
|
depth?: number;
|
|
12
12
|
draft?: boolean;
|
|
13
|
-
fallbackLocale?:
|
|
13
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
14
14
|
limit?: number;
|
|
15
|
-
locale?:
|
|
15
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
16
16
|
overrideAccess?: boolean;
|
|
17
17
|
page?: number;
|
|
18
18
|
req?: PayloadRequest;
|
|
@@ -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,MAAM,mBAAmB,CAAA;AAChE,OAA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AAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAA8B,iBAAiB,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC3F,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA+B3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, Where } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionsOperation } from '../findVersions.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, Where } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionsOperation } from '../findVersions.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?: GeneratedTypes['locale']\n limit?: number\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n page?: number\n req?: PayloadRequest\n showHiddenFields?: boolean\n sort?: string\n user?: Document\n where?: Where\n}\n\nexport default async function findVersionsLocal<T extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<T>,\n): Promise<PaginatedDocs<TypeWithVersion<GeneratedTypes['collections'][T]>>> {\n const {\n collection: collectionSlug,\n depth,\n limit,\n overrideAccess = true,\n page,\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 showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionsOperation","findVersionsLocal","payload","options","collection","collectionSlug","depth","limit","overrideAccess","page","showHiddenFields","sort","where","collections","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,qBAAqB,QAAQ,qBAAoB;AAsB1D,eAAe,eAAeC,kBAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGT;IAEJ,MAAMC,aAAaF,QAAQW,WAAW,CAACR,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEgB,OAAOT,gBAAgB,yCAAyC,CAAC;IAEjG;IAEA,OAAOL,sBAAsB;QAC3BI;QACAE;QACAC;QACAC;QACAC;QACAM,KAAK,MAAMhB,eAAeI,SAASD;QACnCQ;QACAC;QACAC;IACF;AACF"}
|
|
@@ -8,9 +8,9 @@ export type Options<T extends keyof GeneratedTypes['collections']> = {
|
|
|
8
8
|
context?: RequestContext;
|
|
9
9
|
depth?: number;
|
|
10
10
|
draft?: boolean;
|
|
11
|
-
fallbackLocale?:
|
|
11
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
12
12
|
id: string;
|
|
13
|
-
locale?:
|
|
13
|
+
locale?: GeneratedTypes['locale'];
|
|
14
14
|
overrideAccess?: boolean;
|
|
15
15
|
req?: PayloadRequest;
|
|
16
16
|
showHiddenFields?: boolean;
|
|
@@ -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,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,
|
|
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,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IACnE,UAAU,EAAE,CAAC,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACjC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,mBAAmB,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,EAC7F,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAwB3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { restoreVersionOperation } from '../restoreVersion.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/restoreVersion.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { restoreVersionOperation } from '../restoreVersion.js'\n\nexport type Options<T extends keyof GeneratedTypes['collections']> = {\n collection: T\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?: GeneratedTypes['locale']\n id: string\n locale?: GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport default async function restoreVersionLocal<T extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<T>,\n): Promise<GeneratedTypes['collections'][T]> {\n const { id, collection: collectionSlug, depth, overrideAccess = true, showHiddenFields } = 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 showHiddenFields,\n }\n\n return restoreVersionOperation(args)\n}\n"],"names":["APIError","createLocalReq","restoreVersionOperation","restoreVersionLocal","payload","options","id","collection","collectionSlug","depth","overrideAccess","showHiddenFields","collections","String","args","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,uBAAuB,QAAQ,uBAAsB;AAmB9D,eAAe,eAAeC,oBAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EAAEC,EAAE,EAAEC,YAAYC,cAAc,EAAEC,KAAK,EAAEC,iBAAiB,IAAI,EAAEC,gBAAgB,EAAE,GAAGN;IAE3F,MAAME,aAAaH,QAAQQ,WAAW,CAACJ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEa,OAC1BL,gBACA,2CAA2C,CAAC;IAElD;IAEA,MAAMM,OAAO;QACXR;QACAC;QACAE;QACAC;QACAN;QACAW,KAAK,MAAMd,eAAeI,SAASD;QACnCO;IACF;IAEA,OAAOT,wBAAwBY;AACjC"}
|
|
@@ -13,10 +13,10 @@ export type BaseOptions<TSlug extends keyof GeneratedTypes['collections']> = {
|
|
|
13
13
|
data: DeepPartial<GeneratedTypes['collections'][TSlug]>;
|
|
14
14
|
depth?: number;
|
|
15
15
|
draft?: boolean;
|
|
16
|
-
fallbackLocale?:
|
|
16
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
17
17
|
file?: File;
|
|
18
18
|
filePath?: string;
|
|
19
|
-
locale?:
|
|
19
|
+
locale?: GeneratedTypes['locale'];
|
|
20
20
|
overrideAccess?: boolean;
|
|
21
21
|
overwriteExistingFiles?: boolean;
|
|
22
22
|
req?: PayloadRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC9F,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAQhE,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,MAAM,cAAc,CAAC,aAAa,CAAC,IAAI;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,IAAI,EAAE,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/collections/operations/local/update.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, Where } from '../../../types/index.js'\nimport type { File } from '../../../uploads/types.js'\nimport type { BulkOperationResult } 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 keyof GeneratedTypes['collections']> = {\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<GeneratedTypes['collections'][TSlug]>\n depth?: number\n draft?: boolean\n fallbackLocale?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/collections/operations/local/update.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { GeneratedTypes, Payload } from '../../../index.js'\nimport type { Document, PayloadRequest, RequestContext, Where } from '../../../types/index.js'\nimport type { File } from '../../../uploads/types.js'\nimport type { BulkOperationResult } 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 keyof GeneratedTypes['collections']> = {\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<GeneratedTypes['collections'][TSlug]>\n depth?: number\n draft?: boolean\n fallbackLocale?: GeneratedTypes['locale']\n file?: File\n filePath?: string\n locale?: GeneratedTypes['locale']\n overrideAccess?: boolean\n overwriteExistingFiles?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n user?: Document\n}\n\nexport type ByIDOptions<TSlug extends keyof GeneratedTypes['collections']> = BaseOptions<TSlug> & {\n id: number | string\n where?: never\n}\n\nexport type ManyOptions<TSlug extends keyof GeneratedTypes['collections']> = BaseOptions<TSlug> & {\n id?: never\n where: Where\n}\n\nexport type Options<TSlug extends keyof GeneratedTypes['collections']> =\n | ByIDOptions<TSlug>\n | ManyOptions<TSlug>\n\nasync function updateLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: ByIDOptions<TSlug>,\n): Promise<GeneratedTypes['collections'][TSlug]>\nasync function updateLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: ManyOptions<TSlug>,\n): Promise<BulkOperationResult<TSlug>>\nasync function updateLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<BulkOperationResult<TSlug> | GeneratedTypes['collections'][TSlug]>\nasync function updateLocal<TSlug extends keyof GeneratedTypes['collections']>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<BulkOperationResult<TSlug> | GeneratedTypes['collections'][TSlug]> {\n const {\n id,\n autosave,\n collection: collectionSlug,\n data,\n depth,\n draft,\n file,\n filePath,\n overrideAccess = true,\n overwriteExistingFiles = false,\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 draft,\n overrideAccess,\n overwriteExistingFiles,\n payload,\n req,\n showHiddenFields,\n where,\n }\n\n if (options.id) {\n return updateByIDOperation<TSlug>(args)\n }\n return updateOperation<TSlug>(args)\n}\n\nexport default updateLocal\n"],"names":["APIError","getFileByPath","createLocalReq","updateOperation","updateByIDOperation","updateLocal","payload","options","id","autosave","collection","collectionSlug","data","depth","draft","file","filePath","overrideAccess","overwriteExistingFiles","showHiddenFields","where","collections","String","req","args"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAOA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AAiDtD,eAAeC,YACbC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,QAAQ,EACRC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,iBAAiB,IAAI,EACrBC,yBAAyB,KAAK,EAC9BC,gBAAgB,EAChBC,KAAK,EACN,GAAGb;IAEJ,MAAMG,aAAaJ,QAAQe,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIV,SACR,CAAC,yBAAyB,EAAEsB,OAAOX,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMY,MAAM,MAAMrB,eAAeK,SAASD;IAC1CiB,IAAIR,IAAI,GAAGA,QAAS,MAAMd,cAAce;IAExC,MAAMQ,OAAO;QACXhB;QACAC;QACAC;QACAE;QACAC;QACAC;QACAG;QACAC;QACAZ;QACAiB;QACAJ;QACAC;IACF;IAEA,IAAIb,QAAQC,EAAE,EAAE;QACd,OAAOJ,oBAA2BoB;IACpC;IACA,OAAOrB,gBAAuBqB;AAChC;AAEA,eAAenB,YAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../src/globals/operations/findOne.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../src/globals/operations/findOne.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAS/D,KAAK,IAAI,GAAG;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,EAAE,qBAAqB,CAAA;IACnC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,gBAAgB,4CACrB,IAAI,KACT,QAAQ,CAAC,CAsHX,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/globals/operations/findOne.ts"],"sourcesContent":["import type { AccessResult } from '../../config/types.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { SanitizedGlobalConfig } from '../config/types.js'\n\nimport executeAccess from '../../auth/executeAccess.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport replaceWithDraftIfAvailable from '../../versions/drafts/replaceWithDraftIfAvailable.js'\n\ntype Args = {\n depth?: number\n draft?: boolean\n globalConfig: SanitizedGlobalConfig\n
|
|
1
|
+
{"version":3,"sources":["../../../src/globals/operations/findOne.ts"],"sourcesContent":["import type { AccessResult } from '../../config/types.js'\nimport type { GeneratedTypes } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { SanitizedGlobalConfig } from '../config/types.js'\n\nimport executeAccess from '../../auth/executeAccess.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport replaceWithDraftIfAvailable from '../../versions/drafts/replaceWithDraftIfAvailable.js'\n\ntype Args = {\n depth?: number\n draft?: boolean\n globalConfig: SanitizedGlobalConfig\n overrideAccess?: boolean\n req: PayloadRequest\n showHiddenFields?: boolean\n slug: string\n}\n\nexport const findOneOperation = async <T extends Record<string, unknown>>(\n args: Args,\n): Promise<T> => {\n const {\n slug,\n depth,\n draft: draftEnabled = false,\n globalConfig,\n overrideAccess = false,\n req: { fallbackLocale, locale },\n req,\n showHiddenFields,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n // /////////////////////////////////////\n // Retrieve and execute access\n // /////////////////////////////////////\n\n let accessResult: AccessResult\n\n if (!overrideAccess) {\n accessResult = await executeAccess({ req }, globalConfig.access.read)\n }\n\n // /////////////////////////////////////\n // Perform database operation\n // /////////////////////////////////////\n\n let doc = await req.payload.db.findGlobal({\n slug,\n locale,\n req,\n where: overrideAccess ? undefined : (accessResult as Where),\n })\n if (!doc) {\n doc = {}\n }\n\n // /////////////////////////////////////\n // Replace document with draft if available\n // /////////////////////////////////////\n\n if (globalConfig.versions?.drafts && draftEnabled) {\n doc = await replaceWithDraftIfAvailable({\n accessResult,\n doc,\n entity: globalConfig,\n entityType: 'global',\n overrideAccess,\n req,\n })\n }\n\n // /////////////////////////////////////\n // Execute before global hook\n // /////////////////////////////////////\n\n await globalConfig.hooks.beforeRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n doc =\n (await hook({\n context: req.context,\n doc,\n global: globalConfig,\n req,\n })) || doc\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // Execute field-level hooks and access\n // /////////////////////////////////////\n\n doc = await afterRead({\n collection: null,\n context: req.context,\n depth,\n doc,\n fallbackLocale,\n global: globalConfig,\n locale,\n overrideAccess,\n req,\n showHiddenFields,\n })\n\n // /////////////////////////////////////\n // Execute after global hook\n // /////////////////////////////////////\n\n await globalConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n doc =\n (await hook({\n context: req.context,\n doc,\n global: globalConfig,\n req,\n })) || doc\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) await commitTransaction(req)\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n return doc\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["executeAccess","afterRead","commitTransaction","initTransaction","killTransaction","replaceWithDraftIfAvailable","findOneOperation","args","slug","depth","draft","draftEnabled","globalConfig","overrideAccess","req","fallbackLocale","locale","showHiddenFields","shouldCommit","accessResult","access","read","doc","payload","db","findGlobal","where","undefined","versions","drafts","entity","entityType","hooks","beforeRead","reduce","priorHook","hook","context","global","Promise","resolve","collection","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,OAAOA,mBAAmB,8BAA6B;AACvD,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,OAAOC,iCAAiC,uDAAsD;AAY9F,OAAO,MAAMC,mBAAmB,OAC9BC;IAEA,MAAM,EACJC,IAAI,EACJC,KAAK,EACLC,OAAOC,eAAe,KAAK,EAC3BC,YAAY,EACZC,iBAAiB,KAAK,EACtBC,KAAK,EAAEC,cAAc,EAAEC,MAAM,EAAE,EAC/BF,GAAG,EACHG,gBAAgB,EACjB,GAAGV;IAEJ,IAAI;QACF,MAAMW,eAAe,MAAMf,gBAAgBW;QAE3C,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExC,IAAIK;QAEJ,IAAI,CAACN,gBAAgB;YACnBM,eAAe,MAAMnB,cAAc;gBAAEc;YAAI,GAAGF,aAAaQ,MAAM,CAACC,IAAI;QACtE;QAEA,wCAAwC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wC;QAExC,OAAOQ;IACT,EAAE,OAAOoB,OAAgB;QACvB,MAAMtC,gBAAgBU;QACtB,MAAM4B;IACR;AACF,EAAC"}
|
|
@@ -4,8 +4,8 @@ export type Options<T extends keyof GeneratedTypes['globals']> = {
|
|
|
4
4
|
context?: RequestContext;
|
|
5
5
|
depth?: number;
|
|
6
6
|
draft?: boolean;
|
|
7
|
-
fallbackLocale?:
|
|
8
|
-
locale?:
|
|
7
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
8
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
9
9
|
overrideAccess?: boolean;
|
|
10
10
|
req?: PayloadRequest;
|
|
11
11
|
showHiddenFields?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../../src/globals/operations/local/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI;IAC/D,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../../src/globals/operations/local/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAMvE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI;IAC/D,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,CAAC,CAAA;IACP,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,wBAA8B,YAAY,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,EAClF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAwBvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/globals/operations/local/findOne.ts"],"sourcesContent":["import type { GeneratedTypes, Payload, RequestContext } from '../../../index.js'\nimport type { Document, PayloadRequest } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findOneOperation } from '../findOne.js'\n\nexport type Options<T extends keyof GeneratedTypes['globals']> = {\n context?: RequestContext\n depth?: number\n draft?: boolean\n fallbackLocale?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/globals/operations/local/findOne.ts"],"sourcesContent":["import type { GeneratedTypes, Payload, RequestContext } from '../../../index.js'\nimport type { Document, PayloadRequest } from '../../../types/index.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findOneOperation } from '../findOne.js'\n\nexport type Options<T extends keyof GeneratedTypes['globals']> = {\n context?: RequestContext\n depth?: number\n draft?: boolean\n fallbackLocale?: GeneratedTypes['locale']\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n slug: T\n user?: Document\n}\n\nexport default async function findOneLocal<T extends keyof GeneratedTypes['globals']>(\n payload: Payload,\n options: Options<T>,\n): Promise<GeneratedTypes['globals'][T]> {\n const {\n slug: globalSlug,\n depth,\n draft = false,\n overrideAccess = true,\n showHiddenFields,\n } = options\n\n const globalConfig = payload.globals.config.find((config) => config.slug === globalSlug)\n\n if (!globalConfig) {\n throw new APIError(`The global with slug ${String(globalSlug)} can't be found.`)\n }\n\n return findOneOperation({\n slug: globalSlug as string,\n depth,\n draft,\n globalConfig,\n overrideAccess,\n req: await createLocalReq(options, payload),\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findOneOperation","findOneLocal","payload","options","slug","globalSlug","depth","draft","overrideAccess","showHiddenFields","globalConfig","globals","config","find","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,gBAAgB,QAAQ,gBAAe;AAehD,eAAe,eAAeC,aAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,MAAMC,UAAU,EAChBC,KAAK,EACLC,QAAQ,KAAK,EACbC,iBAAiB,IAAI,EACrBC,gBAAgB,EACjB,GAAGN;IAEJ,MAAMO,eAAeR,QAAQS,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAACD,SAAWA,OAAOR,IAAI,KAAKC;IAE7E,IAAI,CAACK,cAAc;QACjB,MAAM,IAAIZ,SAAS,CAAC,qBAAqB,EAAEgB,OAAOT,YAAY,gBAAgB,CAAC;IACjF;IAEA,OAAOL,iBAAiB;QACtBI,MAAMC;QACNC;QACAC;QACAG;QACAF;QACAO,KAAK,MAAMhB,eAAeI,SAASD;QACnCO;IACF;AACF"}
|
|
@@ -5,9 +5,9 @@ export type Options<T extends keyof GeneratedTypes['globals']> = {
|
|
|
5
5
|
context?: RequestContext;
|
|
6
6
|
depth?: number;
|
|
7
7
|
disableErrors?: boolean;
|
|
8
|
-
fallbackLocale?:
|
|
8
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
9
9
|
id: string;
|
|
10
|
-
locale?:
|
|
10
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
11
11
|
overrideAccess?: boolean;
|
|
12
12
|
req?: PayloadRequest;
|
|
13
13
|
showHiddenFields?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/globals/operations/local/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI;IAC/D,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/globals/operations/local/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI;IAC/D,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,CAAC,CAAA;IACP,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA;AAGD,wBAA8B,oBAAoB,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,EAC1F,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAyBxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/globals/operations/local/findVersionByID.ts"],"sourcesContent":["import type { GeneratedTypes, Payload, RequestContext } from '../../../index.js'\nimport type { Document, PayloadRequest } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\nexport type Options<T extends keyof GeneratedTypes['globals']> = {\n context?: RequestContext\n depth?: number\n disableErrors?: boolean\n fallbackLocale?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/globals/operations/local/findVersionByID.ts"],"sourcesContent":["import type { GeneratedTypes, Payload, RequestContext } from '../../../index.js'\nimport type { Document, PayloadRequest } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\nexport type Options<T extends keyof GeneratedTypes['globals']> = {\n context?: RequestContext\n depth?: number\n disableErrors?: boolean\n fallbackLocale?: GeneratedTypes['locale']\n id: string\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n req?: PayloadRequest\n showHiddenFields?: boolean\n slug: T\n user?: Document\n}\n\n// eslint-disable-next-line no-restricted-exports\nexport default async function findVersionByIDLocal<T extends keyof GeneratedTypes['globals']>(\n payload: Payload,\n options: Options<T>,\n): Promise<TypeWithVersion<GeneratedTypes['globals'][T]>> {\n const {\n id,\n slug: globalSlug,\n depth,\n disableErrors = false,\n overrideAccess = true,\n showHiddenFields,\n } = options\n\n const globalConfig = payload.globals.config.find((config) => config.slug === globalSlug)\n\n if (!globalConfig) {\n throw new APIError(`The global with slug ${String(globalSlug)} can't be found.`)\n }\n\n return findVersionByIDOperation({\n id,\n depth,\n disableErrors,\n globalConfig,\n overrideAccess,\n req: await createLocalReq(options, payload),\n showHiddenFields,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionByIDOperation","findVersionByIDLocal","payload","options","id","slug","globalSlug","depth","disableErrors","overrideAccess","showHiddenFields","globalConfig","globals","config","find","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,wBAAwB,QAAQ,wBAAuB;AAgBhE,iDAAiD;AACjD,eAAe,eAAeC,qBAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,EAAE,EACFC,MAAMC,UAAU,EAChBC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,iBAAiB,IAAI,EACrBC,gBAAgB,EACjB,GAAGP;IAEJ,MAAMQ,eAAeT,QAAQU,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAACD,SAAWA,OAAOR,IAAI,KAAKC;IAE7E,IAAI,CAACK,cAAc;QACjB,MAAM,IAAIb,SAAS,CAAC,qBAAqB,EAAEiB,OAAOT,YAAY,gBAAgB,CAAC;IACjF;IAEA,OAAON,yBAAyB;QAC9BI;QACAG;QACAC;QACAG;QACAF;QACAO,KAAK,MAAMjB,eAAeI,SAASD;QACnCQ;IACF;AACF"}
|
|
@@ -5,9 +5,9 @@ import type { TypeWithVersion } from '../../../versions/types.js';
|
|
|
5
5
|
export type Options<T extends keyof GeneratedTypes['globals']> = {
|
|
6
6
|
context?: RequestContext;
|
|
7
7
|
depth?: number;
|
|
8
|
-
fallbackLocale?:
|
|
8
|
+
fallbackLocale?: GeneratedTypes['locale'];
|
|
9
9
|
limit?: number;
|
|
10
|
-
locale?:
|
|
10
|
+
locale?: 'all' | GeneratedTypes['locale'];
|
|
11
11
|
overrideAccess?: boolean;
|
|
12
12
|
page?: number;
|
|
13
13
|
req?: PayloadRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/globals/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,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI;IAC/D,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,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|
-
{"version":3,"sources":["../../../../src/globals/operations/local/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { GeneratedTypes, Payload, RequestContext } from '../../../index.js'\nimport type { Document, PayloadRequest, Where } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionsOperation } from '../findVersions.js'\n\nexport type Options<T extends keyof GeneratedTypes['globals']> = {\n context?: RequestContext\n depth?: number\n fallbackLocale?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/globals/operations/local/findVersions.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type { GeneratedTypes, Payload, RequestContext } from '../../../index.js'\nimport type { Document, PayloadRequest, Where } from '../../../types/index.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { findVersionsOperation } from '../findVersions.js'\n\nexport type Options<T extends keyof GeneratedTypes['globals']> = {\n context?: RequestContext\n depth?: number\n fallbackLocale?: GeneratedTypes['locale']\n limit?: number\n locale?: 'all' | GeneratedTypes['locale']\n overrideAccess?: boolean\n page?: number\n req?: PayloadRequest\n showHiddenFields?: boolean\n slug: T\n sort?: string\n user?: Document\n where?: Where\n}\n\nexport default async function findVersionsLocal<T extends keyof GeneratedTypes['globals']>(\n payload: Payload,\n options: Options<T>,\n): Promise<PaginatedDocs<TypeWithVersion<GeneratedTypes['globals'][T]>>> {\n const {\n slug: globalSlug,\n depth,\n limit,\n overrideAccess = true,\n page,\n showHiddenFields,\n sort,\n where,\n } = options\n\n const globalConfig = payload.globals.config.find((config) => config.slug === globalSlug)\n\n if (!globalConfig) {\n throw new APIError(`The global with slug ${String(globalSlug)} can't be found.`)\n }\n\n return findVersionsOperation({\n depth,\n globalConfig,\n limit,\n overrideAccess,\n page,\n req: await createLocalReq(options, payload),\n showHiddenFields,\n sort,\n where,\n })\n}\n"],"names":["APIError","createLocalReq","findVersionsOperation","findVersionsLocal","payload","options","slug","globalSlug","depth","limit","overrideAccess","page","showHiddenFields","sort","where","globalConfig","globals","config","find","String","req"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,qBAAqB,QAAQ,qBAAoB;AAkB1D,eAAe,eAAeC,kBAC5BC,OAAgB,EAChBC,OAAmB;IAEnB,MAAM,EACJC,MAAMC,UAAU,EAChBC,KAAK,EACLC,KAAK,EACLC,iBAAiB,IAAI,EACrBC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,EACJC,KAAK,EACN,GAAGT;IAEJ,MAAMU,eAAeX,QAAQY,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAACD,SAAWA,OAAOX,IAAI,KAAKC;IAE7E,IAAI,CAACQ,cAAc;QACjB,MAAM,IAAIf,SAAS,CAAC,qBAAqB,EAAEmB,OAAOZ,YAAY,gBAAgB,CAAC;IACjF;IAEA,OAAOL,sBAAsB;QAC3BM;QACAO;QACAN;QACAC;QACAC;QACAS,KAAK,MAAMnB,eAAeI,SAASD;QACnCQ;QACAC;QACAC;IACF;AACF"}
|