UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 977 B
{"version":3,"file":"resolve.mjs","names":["previewSessionsFormatter"],"sources":["../../../src/services/preview-sessions/resolve.ts"],"sourcesContent":["import { previewSessionsFormatter } from \"../../libs/formatters/index.js\";\nimport type { PreviewSession } from \"../../types.js\";\nimport type { ServiceFn } from \"../../utils/services/types.js\";\nimport resolveSession from \"./helpers/resolve-session.js\";\n\nconst resolve: ServiceFn<[{ token: string }], PreviewSession> = async (\n\tcontext,\n\tdata,\n) => {\n\tconst sessionRes = await resolveSession(context, data);\n\tif (sessionRes.error) return sessionRes;\n\n\treturn {\n\t\terror: undefined,\n\t\tdata: previewSessionsFormatter.formatSingle({\n\t\t\tsession: sessionRes.data,\n\t\t}),\n\t};\n};\n\nexport default resolve;\n"],"mappings":"uGAKA,MAAM,EAA0D,MAC/D,EACA,IACI,CACJ,IAAM,EAAa,MAAM,EAAe,EAAS,CAAI,EAGrD,OAFI,EAAW,MAAc,EAEtB,CACN,MAAO,IAAA,GACP,KAAMA,EAAyB,aAAa,CAC3C,QAAS,EAAW,IACrB,CAAC,CACF,CACD"}