UNPKG

@lucidcms/core

Version:

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

2 lines 658 B
import e from"../../../libs/repositories/document-versions.mjs";import{getTableNames as t}from"../../../libs/collection/schema/runtime/runtime-schema-selectors.mjs";import n from"../../documents/checks/check-collection.mjs";const r=async(r,i)=>{let a=await n(r,{key:i.collectionKey});if(a.error)return a;let o=await t(r,i.collectionKey);if(o.error)return o;let s=new e(r.db.client,r.config.db),c=new Date;c.setDate(c.getDate()-i.retentionDays);let l=await s.deleteExpiredRevisions({cutoffDate:c.toISOString()},{tableName:o.data.version});return l.error?l:{error:void 0,data:void 0}};export{r as default}; //# sourceMappingURL=delete-expired-revisions.mjs.map