{"version":3,"sources":["../../../src/collections/endpoints/findVersionByID.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { parseParams } from '../../utilities/parseParams/index.js'\nimport { findVersionByIDOperation } from '../operations/findVersionByID.js'\n\nexport const findVersionByIDHandler: PayloadHandler = async (req) => {\n const { depth, populate, select, trash } = parseParams(req.query)\n\n const { id, collection } = getRequestCollectionWithID(req)\n\n const result = await findVersionByIDOperation({\n id,\n collection,\n depth,\n populate,\n req,\n select,\n trash,\n })\n\n return Response.json(result, {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["status","httpStatus","getRequestCollectionWithID","headersWithCors","parseParams","findVersionByIDOperation","findVersionByIDHandler","req","depth","populate","select","trash","query","id","collection","result","Response","json","headers","Headers","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,0BAA0B,QAAQ,sCAAqC;AAChF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,WAAW,QAAQ,uCAAsC;AAClE,SAASC,wBAAwB,QAAQ,mCAAkC;AAE3E,OAAO,MAAMC,yBAAyC,OAAOC;IAC3D,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGP,YAAYG,IAAIK,KAAK;IAEhE,MAAM,EAAEC,EAAE,EAAEC,UAAU,EAAE,GAAGZ,2BAA2BK;IAEtD,MAAMQ,SAAS,MAAMV,yBAAyB;QAC5CQ;QACAC;QACAN;QACAC;QACAF;QACAG;QACAC;IACF;IAEA,OAAOK,SAASC,IAAI,CAACF,QAAQ;QAC3BG,SAASf,gBAAgB;YACvBe,SAAS,IAAIC;YACbZ;QACF;QACAP,QAAQC,WAAWmB,EAAE;IACvB;AACF,EAAC"}