UNPKG

@lucidcms/core

Version:

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

2 lines 1.18 kB
import{copy as e}from"../../../i18n/copy.mjs";import t from"./get-runtime-schema.mjs";const n=async(e,n)=>{let r=await t(e,{collectionKey:n});return r.error?r:{error:void 0,data:r.data.tables.filter(e=>e.type!==`document`&&e.type!==`versions`)}},r=async(e,n)=>{let r=await t(e,{collectionKey:n});return r.error?r:{error:void 0,data:r.data.tables.find(e=>e.type===`document`)}},i=async(e,n)=>{let r=await t(e,{collectionKey:n});return r.error?r:{error:void 0,data:r.data.tables.find(e=>e.type===`document-fields`)}},a=async(e,n)=>{let r=await t(e,{collectionKey:n});return r.error?r:{error:void 0,data:r.data.tables.find(e=>e.type===`versions`)}},o=async(t,n)=>{let[o,s,c]=await Promise.all([a(t,n),r(t,n),i(t,n)]);return o.error?o:s.error?s:c.error?c:!o.data?.name||!s.data?.name||!c.data?.name?{error:{message:e(`server:core.collections.names.fetch.failed`),status:500},data:void 0}:{data:{version:o.data.name,document:s.data.name,documentFields:c.data.name},error:void 0}};export{n as getBricksTableSchema,i as getDocumentFieldsTableSchema,r as getDocumentTableSchema,a as getDocumentVersionTableSchema,o as getTableNames}; //# sourceMappingURL=runtime-schema-selectors.mjs.map