@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 780 B
JavaScript
import{encrypt as e}from"../../utils/helpers/encrypt-decrypt.mjs";import t from"../../libs/repositories/options.mjs";import{getLicenseOptionName as n}from"./helpers/option-names.mjs";import r from"./verify.mjs";import i from"../../libs/formatters/license.mjs";const a=async(a,o)=>{let s=new t(a.db.client,a.config.db),c=a.request.tenantKey??null,l=o.licenseKey?.trim()||null,u=i.createLicenseKeyDisplay(l),d=l?e(l,a.config.secrets.encryption):null,[f,p]=await Promise.all([s.upsertSingle({data:{name:n(c,`license_key`),value_text:d}}),s.upsertSingle({data:{name:n(c,`license_key_display`),value_text:u}})]);if(f.error)return f;if(p.error)return p;let m=await r(a,{tenantKey:c});return m.error?m:{error:void 0,data:void 0}};export{a as default};
//# sourceMappingURL=update.mjs.map