domma-cms 1.46.0 → 1.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/admin/js/lib/api-tokens-arrange.js +2 -2
- package/admin/js/lib/whatsapp-call.js +1 -0
- package/admin/js/templates/contacts.html +2 -0
- package/admin/js/views/api-tokens.js +9 -4
- package/admin/js/views/contacts.js +12 -11
- package/admin/js/views/form-editor.js +5 -5
- package/admin/js/views/plugins.js +1 -1
- package/docs/api-reference.md +22 -0
- package/package.json +1 -1
- package/plugins/_lib/admin/mail/body-menu.js +1 -1
- package/plugins/_lib/admin/mail/cms-host.js +1 -1
- package/plugins/_lib/admin/mail/compose-window.js +1 -1
- package/plugins/_lib/admin/mail/contacts.js +1 -1
- package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
- package/plugins/_lib/admin/mail/drag-drop.js +1 -1
- package/plugins/_lib/admin/mail/folder-tree.js +1 -1
- package/plugins/_lib/admin/mail/font-controls.js +1 -1
- package/plugins/_lib/admin/mail/fonts.js +1 -1
- package/plugins/_lib/admin/mail/host-context.js +1 -1
- package/plugins/_lib/admin/mail/identity.js +1 -1
- package/plugins/_lib/admin/mail/image-senders-section.js +1 -1
- package/plugins/_lib/admin/mail/keyboard.js +1 -1
- package/plugins/_lib/admin/mail/mail.html +1 -1
- package/plugins/_lib/admin/mail/message-actions.js +1 -1
- package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
- package/plugins/_lib/admin/mail/panes.js +1 -1
- package/plugins/_lib/admin/mail/reader-kit.js +1 -1
- package/plugins/_lib/admin/mail/reader-runtime.js +7 -6
- package/plugins/_lib/admin/mail/reader-view.js +1 -1
- package/plugins/_lib/admin/mail/resizable.js +1 -1
- package/plugins/_lib/admin/mail/restore-spam.js +1 -1
- package/plugins/_lib/admin/mail/rules.js +1 -1
- package/plugins/_lib/admin/mail/scheduling.js +1 -1
- package/plugins/_lib/admin/mail/section-kit.js +1 -1
- package/plugins/_lib/admin/mail/security-note.js +1 -1
- package/plugins/_lib/admin/mail/settings-section.js +1 -1
- package/plugins/_lib/admin/mail/templates.js +1 -1
- package/plugins/_lib/admin/mail/threads.js +1 -1
- package/plugins/_lib/admin/mail/vacation.js +1 -1
- package/plugins/_lib/admin/mail/when-closed.js +1 -1
- package/plugins/_lib/admin/ui/dates.js +1 -1
- package/plugins/_lib/admin/ui/resizable.js +1 -1
- package/plugins/_lib/domma-mail.lock.json +80 -80
- package/plugins/_lib/mail/accountFileStore.js +1 -1
- package/plugins/_lib/mail/accountRepository.js +1 -1
- package/plugins/_lib/mail/accountRoutes.js +1 -1
- package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
- package/plugins/_lib/mail/bodyTokens.js +1 -1
- package/plugins/_lib/mail/compose.js +1 -1
- package/plugins/_lib/mail/defaults.js +1 -1
- package/plugins/_lib/mail/envelope.js +1 -1
- package/plugins/_lib/mail/folderActions.js +1 -1
- package/plugins/_lib/mail/folderRuntime.js +1 -1
- package/plugins/_lib/mail/folders.js +1 -1
- package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
- package/plugins/_lib/mail/mbox.js +1 -1
- package/plugins/_lib/mail/message-action.js +1 -1
- package/plugins/_lib/mail/messageSecurity.js +1 -1
- package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
- package/plugins/_lib/mail/networkAddresses.js +1 -1
- package/plugins/_lib/mail/networkPolicy.js +1 -1
- package/plugins/_lib/mail/oauthAccounts.js +1 -1
- package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
- package/plugins/_lib/mail/oauthRuntime.js +1 -1
- package/plugins/_lib/mail/pollSchedule.js +1 -1
- package/plugins/_lib/mail/poller.js +1 -1
- package/plugins/_lib/mail/pollerRuntime.js +1 -1
- package/plugins/_lib/mail/priority.js +1 -1
- package/plugins/_lib/mail/publicMailbox.js +1 -1
- package/plugins/_lib/mail/readRuntime.js +1 -1
- package/plugins/_lib/mail/render.js +1 -1
- package/plugins/_lib/mail/ruleRunner.js +1 -1
- package/plugins/_lib/mail/schedulerRuntime.js +1 -1
- package/plugins/_lib/mail/secretProvider.js +1 -1
- package/plugins/_lib/mail/secretbox.js +1 -1
- package/plugins/_lib/mail/senderAuth.js +1 -1
- package/plugins/_lib/mail/sieve.js +1 -1
- package/plugins/_lib/mail/smtpService.js +1 -1
- package/plugins/_lib/mail/snoozeRuntime.js +1 -1
- package/plugins/_lib/mail/store.js +1 -1
- package/plugins/_lib/mail/subscriptions.js +1 -1
- package/plugins/_lib/mail/syncPlan.js +1 -1
- package/plugins/_lib/mail/syncRuntime.js +1 -1
- package/plugins/_lib/mail/syncSelection.js +1 -1
- package/plugins/_lib/mail/unreadBadge.js +1 -1
- package/plugins/_lib/mail/unsubscribe.js +1 -1
- package/plugins/_lib/mail/vacationRuntime.js +1 -1
- package/plugins/_lib/mail/write.js +1 -1
- package/plugins/blog/CHANGELOG.md +5 -0
- package/plugins/blog/plugin.js +3 -0
- package/plugins/blog/plugin.json +2 -2
- package/plugins/free-tier.lock.json +37 -16
- package/plugins/security/CHANGELOG.md +6 -0
- package/plugins/security/admin/lib/health.js +4 -1
- package/plugins/security/plugin.json +2 -2
- package/plugins/security/server/facts.js +2 -1
- package/plugins/security/tests/security.test.js +5 -0
- package/plugins/shopping-cart/CHANGELOG.md +7 -0
- package/plugins/shopping-cart/admin/views/orders.js +3 -4
- package/plugins/shopping-cart/lib/summary.js +1 -1
- package/plugins/shopping-cart/plugin.json +2 -2
- package/plugins/shopping-cart/public/lib/orders.js +16 -0
- package/plugins/shopping-cart/public/shop.css +1 -1
- package/plugins/shopping-cart/tests/pure.test.js +16 -0
- package/plugins/whatsapp-calling/CLAUDE.md +12 -0
- package/plugins/whatsapp-calling/admin/css/index.css +22 -0
- package/plugins/whatsapp-calling/admin/templates/index.html +56 -0
- package/plugins/whatsapp-calling/admin/views/connection-help.js +55 -0
- package/plugins/whatsapp-calling/admin/views/index.js +275 -0
- package/plugins/whatsapp-calling/config.js +7 -0
- package/plugins/whatsapp-calling/docs/guide.md +70 -0
- package/plugins/whatsapp-calling/lib/calls.js +156 -0
- package/plugins/whatsapp-calling/lib/meta.js +55 -0
- package/plugins/whatsapp-calling/lib/recipients.js +26 -0
- package/plugins/whatsapp-calling/plugin.js +123 -0
- package/plugins/whatsapp-calling/plugin.json +86 -0
- package/plugins/whatsapp-calling/tests/calling.test.js +254 -0
- package/server/routes/api/api-tokens.js +2 -2
- package/server/routes/api/collections.js +42 -17
- package/server/routes/api/endpoints-public.js +1 -2
- package/server/services/apiTokens.js +59 -4
- package/server/services/presetCollections.js +1 -0
|
@@ -34,7 +34,7 @@ import{api as h,getUser as Q}from"../api.js";import{addBannerAction as Te}from".
|
|
|
34
34
|
<strong data-bind-text="displayName"></strong>
|
|
35
35
|
<span class="plx-chip" data-bind-class="stateCls" data-bind-text="stateText"></span>
|
|
36
36
|
<small class="plx-hint" data-bind-hidden="!reason" data-bind-text="reason"></small>
|
|
37
|
-
</li>`,u=R=>String(R??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function Ce(R){const $=document.createElement("template");return $.innerHTML=R.trim(),$.content.firstElementChild}const k=Tt(at);export const pluginsView={templateUrl:"/admin/js/templates/plugins.html",async onMount(R){k.reset();const $=R.get(0).querySelector(".plx")||R.get(0),m=()=>at.test(location.hash)&&$.isConnected,j=M.observable([]),P=M.observable([]),Ne=M.computed(()=>P.value.map(e=>{const t=[...(e.requiredBy||[]).map(a=>a.displayName),...(e.usedBy||[]).map(a=>a.displayName)];return{name:e.name,displayName:e.displayName,icon:e.icon,meta:[e.description,t.length?`used by ${t.join(", ")}`:"",e.locked?"locked by your manager":"",e.staff?"your host's staff can still use it":""].filter(Boolean).join(" \xB7 "),locked:e.locked===!0,statusText:e.enabled?"On":"Off",statusCls:e.enabled?"is-ok":"is-muted",rowCls:e.enabled?"":"is-off"}})),p=M.observable({available:null,site:null,items:[]}),Me=M.observable(!0),be=M.observable(""),y=M.observable("");let Ae="all";try{Ae=Ct.includes(S.get(Se))?S.get(Se):"all"}catch{}const B=M.observable(Ae),G=M.observable(""),q=M.observable("all"),Ie=M.observable("");k.add(M.effect(()=>{const e=B.value;try{S.set(Se,e)}catch{}}));const Z=M.computed(()=>new Map((p.value.items||[]).map(e=>[e.slug,e.version]))),U=e=>(p.peek().items||[]).find(t=>t.slug===e),he=M.observable([]);k.add(M.effect(()=>{const e=Z.value;he.value=Mt(j.value,{filter:B.value,query:G.value,latest:e}).map(t=>({...Rt(t,e),accent:Ge(t.name)}))}));const st=M.computed(()=>{const e=j.value,t=Z.value,a=e.filter(n=>Ze(n).running).length;return{all:e.length,on:a,off:e.length-a,attention:e.filter(n=>Ut(n,t)).length}}),ee=M.computed(()=>(p.value.items||[]).filter(e=>ue(e)==="update").length),lt=M.computed(()=>j.value.length?"No plugins match.":"No plugins installed. Browse the catalogue, or Install from file in the banner."),fe=M.observable([]);k.add(M.effect(()=>{fe.value=Nt(p.value.items,{filter:q.value,query:Ie.value}).map(e=>{const t=At(e),a=t.action==="update"||t.action==="install"||t.action==="buy";return{...t,accent:Ge(e.slug),actCls:a?"btn-primary":"btn-ghost",actDisabled:!a}})}));const ot=M.computed(()=>{const e=p.value.items||[];return{all:e.length,installed:e.filter(t=>t.installed).length,available:e.filter(t=>ue(t)==="install").length,updates:ee.value}}),Oe=M.computed(()=>Wt(p.value.bundle)),te=e=>j.peek().find(t=>t.name===e);async function ge(){try{const[e,t]=await kt($.querySelector(".dm-loading-slot"),Promise.all([h.plugins.list(),h.tools.list().catch(()=>[])]),xt.iconRows);if(!m())return;j.value=Array.isArray(e)?e:[],P.value=Array.isArray(t)?t:[],be.value=""}catch(e){be.value=`Could not load the plugins: ${e.message||e}`}finally{Me.value=!1}}async function Le(){try{const e=await h.marketplace.catalogue();if(!m())return;p.value={available:!!e?.available,site:e?.site||null,items:e?.catalogue||[],mode:e?.mode||(e?.available?"managed":"none"),siteError:e?.siteError||"",storeFailed:e?.failed||"",connection:e?.connection||null,vat:e?.vat||null,bundle:(e?.bundles||[]).find(t=>t.slug==="bundle-pro")||null},e?.bundles?.[0]?.pending&&ye(e.bundles[0].pending,{fast:!1}),e?.connection?.status==="pending"&&ve();for(const t of e?.pending||[])ye(t.id,{fast:!1})}catch{p.value={available:!1,site:null,items:[],failed:!0}}}const N=async()=>{await Promise.all([ge(),Le()]),Et(qt)};async function _(e,t,a="plugin"){if(e.core)return;const n=t?"on":"off";if(e.locked){E.toast(`${e.displayName||e.name} is locked by your site's manager - ask them to switch it ${n}.`,{type:"info",duration:6e3});return}if(!await E.confirm(`Switch ${u(e.displayName||e.name)} ${n}? The server restarts to apply it, which takes a few seconds.`)||y.peek())return;const s=l=>a==="tool"?h.tools.update(e.name,{enabled:t,cascade:l}):h.plugins.update(e.name,{enabled:t,cascade:l});y.value=`Switching ${e.displayName||e.name} ${n}\u2026`;try{let l;try{l=await s(!1)}catch(i){if(i.status!==409||!i.body?.needsConfirm)throw i;const r=Dt(i.body.plan);if(y.value="",!await E.confirm(`<p>Switching ${u(e.displayName||e.name)} ${n} also means:</p><ul>${r.map(c=>`<li>${u(c)}</li>`).join("")}</ul><p>Go ahead?</p>`))return;y.value=`Switching ${e.displayName||e.name} ${n}\u2026`,l=await s(!0)}await St(l,{onStatus:i=>{y.value=i}}),E.toast(`${e.displayName||e.name} is ${n}.${t?" Reload the admin to open its screens.":""}`,{type:"success",duration:6e3});try{document.dispatchEvent(new CustomEvent("dm:sidebar-rebuild"))}catch{}}catch(l){E.toast(`Not switched ${n}: ${l.message||l}`,{type:"error"})}finally{y.value="",m()&&await N()}}async function V(e,{update:t=!1}={}){const a=u(e.displayName||e.slug),n=t?`<p>Update ${a} from ${u(e.installedVersion)} to ${u(e.version)}?</p> <p class="text-muted">The plugin keeps its data, and the current version is put back if the update fails.</p>`:`<p>Install ${a} v${u(e.version)}?</p> <p class="text-muted">It arrives licensed to this site and takes effect after a restart.</p>`;if(await E.confirm(n,{title:t?"Update plugin":"Install plugin",confirmText:t?"Update":"Install",cancelText:"Cancel",html:!0})){try{const s=await h.marketplace.install(e.slug,e.version,{update:t}),l=s?.action==="upgrade"?`${e.slug} updated${s.from?` from ${s.from}`:""} to ${s.version}.`:`${e.slug} ${s?.version??e.version} installed.`;E.toast(`${l} Restart the server to activate it.`,{type:"success",duration:6e3})}catch(s){E.toast(s.message||"Install failed.",{type:"error"})}m()&&await N()}}const O=new Map;k.add(()=>{for(const e of O.values())clearTimeout(e.timer);O.clear()});function ye(e,{fast:t=!0}={}){if(!e||O.has(e))return;const a={timer:null,until:Date.now()+(t?Pt:0)};O.set(e,a);const n=()=>{clearTimeout(a.timer),!(!m()||!O.has(e))&&(a.timer=setTimeout(()=>ne(e),Date.now()<a.until?nt:Vt))};a.next=n,n()}const Ue=e=>{const t=O.get(e);t&&clearTimeout(t.timer),O.delete(e)},ae=new Set;async function ne(e,{byHand:t=!1}={}){if(!m()||ae.has(e))return;ae.add(e),clearTimeout(O.get(e)?.timer);let a;try{a=await h.marketplace.claim(e)}catch(s){t&&E.toast(s.message||"The store could not be asked just now.",{type:"error"}),ae.delete(e),O.get(e)?.next?.();return}ae.delete(e);const n=a.bundle?p.peek().bundle?.displayName||"The Pro bundle":U(a.slug)?.displayName||a.slug;if(a.status==="pending"){t&&E.toast(`Not paid yet - ${n} installs here as soon as the payment is through.`,{type:"info",duration:6e3}),O.get(e)?.next?.();return}if(Ue(e),a.status==="paid"&&a.bundle){const s=a.included||[],l=s.filter(r=>r.installed&&!r.alreadyHere).length,i=s.filter(r=>!r.installed);E.toast(a.kind==="renew"?`${n}: updates renewed for all ${s.length} Tools.`:`${n} is paid for: ${l} Tool${l===1?"":"s"} installed${s.length-l-i.length?`, ${s.length-l-i.length} already here`:""}. They are switched off - turn on the ones you want, then restart the server.`+(i.length?` ${i.length} did not install (${i.map(r=>U(r.slug)?.displayName||r.slug).join(", ")}) - use Install on the Browse tab.`:""),{type:i.length?"warning":"success",duration:14e3})}else if(a.status==="paid")if(a.kind==="renew")E.toast(`${n}: updates renewed.${a.installed&&!a.refreshed?" Update it on the Browse tab.":""}`,{type:"success",duration:8e3});else if(a.installed&&a.refreshed===!1&&a.installError)E.toast(`${n} is paid for, but the copy here could not be brought up to date: ${a.installError}. Use Update on the Browse tab.`,{type:"warning",duration:12e3});else if(a.installed){const s=(a.included||[]).filter(l=>l.installed).map(l=>U(l.slug)?.displayName||l.slug);E.toast(`${n} is paid for and installed${s.length?`, with ${s.join(" and ")} free`:""}. Restart the server to activate ${s.length?"them":"it"}.`+(s.some(l=>/mongo/i.test(l))?" Then open MongoDB in the sidebar to connect your database.":""),{type:"success",duration:12e3})}else E.toast(`${n} is paid for, but did not install: ${a.installError||"try Install on the Browse tab"}. The licence key is in your email.`,{type:"warning",duration:12e3});else a.status!=="unknown"&&E.toast(`${n}: the purchase ${a.status==="expired"?"was not paid for in time":`is ${a.status}`}.`,{type:"warning",duration:8e3});m()&&await N()}async function it(e){if(e?.pending&&await E.confirm(`<p>Stop waiting for the payment for ${u(e.displayName||e.slug)}?</p> <p class="text-muted">Nothing is cancelled at the store - if you did pay, the licence key is in your email and Install from file takes the file it links to.</p>`,{title:"Stop waiting",confirmText:"Stop waiting",cancelText:"Keep waiting",html:!0})){Ue(e.pending);try{await h.marketplace.dropPurchase(e.pending)}catch(t){E.toast(t.message||"Could not do that.",{type:"error"})}m()&&await N()}}async function rt(e){const t=await E.prompt(`Licence key for ${u(e.displayName||e.slug)} - it is in the email you had when you bought it.`,{title:"Enter licence key",inputPlaceholder:"DOMMA-XXXX-XXXX-XXXX",confirmText:"Use this key"});if(!(!t||!m()))try{const a=await h.marketplace.enterKey(e.slug,String(t).trim());await N();const n=U(e.slug);a.updates&&n&&!n.installed?(E.toast(`Licence accepted for ${e.displayName||e.slug}.`,{type:"success"}),await V(n)):E.toast(`Licence accepted for ${e.displayName||e.slug}.${n?.installed?" Restart the server for it to take effect.":""}`,{type:"success",duration:7e3})}catch(a){E.toast(a.message||"That key could not be used.",{type:"error",duration:8e3})}}function ct(e,t,a){return new Promise(n=>{let s=!1;const l=C=>{if(!s){s=!0,n(C);try{i.close()}catch{}}},i=E.modal({title:e.title,size:"md",onClose:()=>l(null)}),r=document.createElement("div");r.className="flex flex-col gap-3",e.lines.forEach((C,d)=>{const w=document.createElement("p");d&&(w.className="text-muted"),w.textContent=C,r.append(w)});const c=(C,d,w)=>{const D=document.createElement("label");D.className="form-group";const X=document.createElement("span");if(X.className="form-label",X.textContent=C,D.append(X,d),w){const H=document.createElement("small");H.className="text-muted",H.textContent=w,D.append(H)}return D},b=document.createElement("select");b.className="form-select",b.append(new Option("Choose\u2026",""));for(const C of t.countries)b.append(new Option(C.name,C.code));const f=document.createElement("input");f.className="form-input",f.maxLength=20,f.spellcheck=!1,f.placeholder="Only for a business with one";const v=document.createElement("p");v.className="text-sm text-danger",v.hidden=!0;const x=document.createElement("div");x.className="flex gap-2 justify-end";const T=document.createElement("button");T.type="button",T.className="btn btn-ghost",T.textContent="Cancel";const A=document.createElement("button");A.type="button",A.className="btn btn-primary",A.textContent=a,T.addEventListener("click",()=>l(null)),A.addEventListener("click",()=>{if(!b.value){v.textContent="Choose your country - it decides the VAT.",v.hidden=!1,b.focus();return}l({country:b.value,vatNumber:f.value.trim()})}),x.append(T,A),r.append(c("Your country",b,"It decides the VAT on this purchase."),c("EU VAT number",f,"A business with a valid EU VAT number pays no VAT (reverse charge)."),v,x),i.element.appendChild(r),i.open(),setTimeout(()=>b.focus(),60)})}async function De(e){if(y.peek())return;const t=jt(e,{site:p.peek().site,email:Q()?.email}),a=p.peek().vat;let n={};if(a?.countryRequired&&Array.isArray(a.countries)&&a.countries.length){const l=await ct(t,a,e.owned?"Renew":"Buy");if(!l)return;n=l}else{const l=t.lines.map((i,r)=>`<p${r?' class="text-muted"':""}>${u(i)}</p>`).join(" ");if(!await E.confirm(l,{title:t.title,confirmText:e.owned?"Renew":"Buy",cancelText:"Cancel",html:!0}))return}const s=window.open("","_blank");try{const l=await h.marketplace.buy(e.slug,n);s&&!s.closed?(s.opener=null,s.location.href=l.checkoutUrl):window.open(l.checkoutUrl,"_blank","noopener")||E.toast("Your browser blocked the payment tab - allow pop-ups for this site and choose Buy again.",{type:"warning",duration:9e3}),ye(l.id),E.toast(`Payment opened in a new tab. ${e.displayName||e.slug} ${e.owned?"renews":"installs here"} as soon as it is through - keep this page open, or come back to it.`,{type:"info",duration:9e3}),l.vatNote&&E.toast(l.vatNote,{type:"warning",duration:1e4})}catch(l){try{s?.close()}catch{}E.toast(l.message||"The purchase could not be started.",{type:"error",duration:8e3})}m()&&await N()}let se=null,z=0;k.add(()=>clearTimeout(se));function ve(){z||(z=Date.now()+60*6e4),clearTimeout(se),!(!m()||Date.now()>z)&&(se=setTimeout(()=>we(!1),nt))}let le=!1;async function we(e){if(le||!m())return;le=!0;let t;try{t=await h.marketplace.connectCheck()}catch(n){e&&E.toast(n.message||"Could not ask just now.",{type:"error"}),le=!1,ve();return}le=!1;const a=t?.connection||null;if(a?.status==="pending"){e&&E.toast(`Not yet - open the link we emailed to ${a.email} and choose Connect.`,{type:"info",duration:6e3}),ve();return}z=0,a?.status==="connected"?E.toast(`Connected to Domma as ${a.email}.`,{type:"success",duration:7e3}):E.toast("The link was not opened in time - choose Connect to Domma again.",{type:"warning",duration:7e3}),m()&&await N()}async function dt(){const e=await E.prompt("The email address you bought your Tools with. We email it a link; open it and choose Connect.",{title:"Connect to Domma",inputPlaceholder:Q()?.email||"you@example.com",defaultValue:Q()?.email||"",confirmText:"Email me the link"});if(!(e==null||!m()))try{const t=await h.marketplace.connect(String(e).trim()||Q()?.email||"");E.toast(`Link emailed to ${t.connection?.email}. Open it and choose Connect - this page picks it up.`,{type:"info",duration:9e3}),z=0,await N()}catch(t){E.toast(t.message||"Could not connect.",{type:"error",duration:8e3})}}async function ut(){const e=p.peek().connection;if(e&&!(e.status!=="pending"&&!await E.confirm(`<p>Disconnect this site from Domma (${u(e.email)})?</p> <p class="text-muted">The licences it already has stay. New ones stop arriving by themselves - connect again, or enter a key.</p>`,{title:"Disconnect",confirmText:"Disconnect",cancelText:"Keep it",html:!0}))){clearTimeout(se),z=0;try{await h.marketplace.disconnect()}catch(t){E.toast(t.message||"Could not do that.",{type:"error"})}m()&&await N()}}const Re=()=>{for(const e of[...O.keys()])ne(e);p.peek().connection?.status==="pending"&&we(!1)};window.addEventListener("focus",Re),k.add(()=>window.removeEventListener("focus",Re));function Be(e){if(e?.store){De(e);return}e?.buyUrl&&(window.open(e.buyUrl,"_blank","noopener"),E.toast(`Manage my site opened in a new tab. We email you a sign-in link; ${e.displayName||e.slug} is ticked ready once you are in. Install it here when it is paid for.`,{type:"info",duration:9e3}))}async function Fe(e,t){const n=U(e)?.tier==="paid"&&!U(e)?.store?` <p class="text-muted">It is a paid Tool: your site's manager is told, and if you pay for it on its own it comes off your monthly bill (the rest of this month is credited).</p>`:"";if(await E.confirm(`<p>Uninstall ${u(t||e)}?</p> <p class="text-muted">Its files are removed, and its <code>data/</code> folder with them. Roles it added are removed and their users moved to <code>user</code>. Restart the server to finish.</p>${n}`,{title:"Uninstall plugin",confirmText:"Uninstall",cancelText:"Cancel",html:!0})){try{const l=(await h.marketplace.uninstall(e))?.release?.removed?" It is off your bill.":"";E.toast(`${t||e} uninstalled.${l} Restart the server to apply.`,{type:"success",duration:6e3})}catch(s){E.toast(`Uninstall failed: ${s.message||s}`,{type:"error"})}m()&&await N()}}async function je(e){try{await h.plugins.exportBundle(e.name)}catch(t){E.toast(t.message||"Export failed.",{type:"error"})}}const We=e=>{location.hash=`#/plugins/code/${encodeURIComponent(e.name)}`},K=$.querySelector(".plx-file");async function pt(e){if(y.peek())return;y.value=`Installing ${e.name}\u2026`;const t={};try{for(let a=0;a<4;a++)try{const n=await h.plugins.installFile(e,t),s=n.action==="upgrade"?`${n.name} updated${n.from?` from ${n.from}`:""} to ${n.version}.`:`${n.name} ${n.version} installed.`;E.toast(`${s} Restart the server to activate it.`,{type:"success",duration:6e3});return}catch(n){if(y.value="",n.code==="CONFLICT"&&!t.confirmUpgrade){if(!await E.confirm(`<p>${u(n.name)} ${u(n.installedVersion||"the installed version")} is already installed. Update it to ${u(n.incomingVersion||"this file")}?</p> <p class="text-muted">The plugin keeps its data, and the current version is put back if the update fails.</p>`,{title:"Update plugin",confirmText:"Update",cancelText:"Cancel",html:!0}))return;t.confirmUpgrade=!0}else if(/refusing to downgrade/i.test(n.message)&&!t.confirmDowngrade){if(!await E.confirm(`<p>${u(n.message)} Install it anyway?</p> <p class="text-muted">An older version may not understand data written by the newer one.</p>`,{title:"Downgrade plugin",confirmText:"Downgrade",cancelText:"Cancel",html:!0}))return;t.confirmDowngrade=!0}else if(/unsigned|signature/i.test(n.message)&&!t.confirmUnsigned){if(!await E.confirm(`<p>${u(n.message)}</p> <p class="text-muted">An unsigned plugin has not been verified as coming from the marketplace. Its code runs on this server with full access. Install it anyway?</p>`,{title:"Unsigned plugin",confirmText:"Install anyway",cancelText:"Cancel",html:!0}))return;t.confirmUnsigned=!0}else{E.toast(n.message||"Install failed.",{type:"error"});return}y.value=`Installing ${e.name}\u2026`}}finally{y.value="",m()&&await N()}}const Ve=async()=>{const e=K.files?.[0];K.value="",e&&await pt(e)};K.addEventListener("change",Ve),k.add(()=>K.removeEventListener("change",Ve));const oe=new Set;let W=null,Pe=!1;function qe({title:e,size:t="md",panel:a,model:n,methods:s,dirty:l=()=>!1,form:i=null,cleanup:r=()=>{}}){const c=E.slideover({title:u(e),size:t,position:"right"});c.element.appendChild(a);const b=Je(a),f=M.applyBindings(n,a,{methods:s});i&&(W=i),oe.add(c),$t(c,()=>{r(),f.dispose(),b(),oe.delete(c),W===i&&(W=null)});const v=c.close.bind(c);let x=!1,T=!1;return c.close=async A=>{if(!x&&A!==!0&&l()){if(T)return;T=!0;const C=await E.confirm("Discard the changes you have not saved?");if(T=!1,!C)return}return x=!0,v()},I.scan(a),c.open(),c}function xe(e,t=null){const a=te(e);if(!a)return;const n=Ze(a),s=et(a),l=U(a.name),i=tt(a,Z.peek()),r=!!(i&&l?.entitled&&!l?.needsCms),b={...Object.fromEntries(s.map(o=>[o.key,o.value])),...Object.fromEntries(Object.entries(t||{}).filter(([o])=>!s.find(g=>g.key===o)?.secret))},f=Object.fromEntries(s.map(o=>[o.key,M.observable(b[o.key])])),v=M.computed(()=>Bt(s,Object.fromEntries(s.map(o=>[o.key,f[o.key].value])))),x=M.observable(!1),T=()=>Object.keys(v.peek().changed).length>0||Object.keys(v.peek().errors).length>0,A=[["Version",`v${a.version}${i?` (v${i} available)`:""}`],["Status",n.text+(a.supersededBy?` - replaced by ${a.supersededBy}`:"")],["Author",a.author],["Released",Lt(a.date)],["Licence",a.licence],["Slug",a.name]].filter(([,o])=>o),C=(o,g)=>{const F=`plx-set-${g}`,ce=o.help?` <span data-help="${u(o.help)}"></span>`:"",Y=`<label class="form-label" for="${F}">${u(o.label)}${ce}</label>`,J=`data-model="v${g}.value"`,de=`<small class="plx-err" data-bind-hidden="!err${g}.value" data-bind-text="err${g}.value"></small>`;if(o.type==="checkbox")return`<div class="plx-setting">${Y}<input id="${F}" type="checkbox" class="form-switch" ${J}></div>`;if(o.type==="select")return`<div>${Y}<select id="${F}" class="form-input" ${J}>${o.options.map(Ye=>`<option value="${u(Ye.value)}">${u(Ye.label)}</option>`).join("")}</select>${de}</div>`;if(o.type==="json")return`<div>${Y}<textarea id="${F}" class="form-input plx-json" rows="5" spellcheck="false" ${J}></textarea>${de}</div>`;if(o.type==="textarea")return`<div>${Y}<textarea id="${F}" class="form-input" rows="3" ${J}></textarea>${de}</div>`;const vt=o.type==="number"?"number":o.secret?"password":"text",wt=`${o.min!=null?` min="${u(o.min)}"`:""}${o.max!=null?` max="${u(o.max)}"`:""}`;return`<div>${Y}<input id="${F}" type="${vt}" class="form-input" autocomplete="${o.secret?"new-password":"off"}"${wt} ${J}>${de}</div>`},d=Ot(a,{plugins:j.peek(),tools:P.peek(),catalogue:p.peek().items||[]}),w={saving:x,needs:M.observable(d.needs),worksWith:M.observable(d.worksWith),hasNeeds:d.needs.length>0,hasWorksWith:d.worksWith.length>0,hasFields:s.length>0,cannot:M.computed(()=>x.value||!Object.keys(v.value.changed).length||Object.keys(v.value.errors).length>0),...Object.fromEntries(s.flatMap((o,g)=>[[`v${g}`,f[o.key]],[`err${g}`,M.computed(()=>v.value.errors[o.key]||"")]]))},D=Ce(`
|
|
37
|
+
</li>`,u=R=>String(R??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function Ce(R){const $=document.createElement("template");return $.innerHTML=R.trim(),$.content.firstElementChild}const k=Tt(at);export const pluginsView={templateUrl:"/admin/js/templates/plugins.html",async onMount(R){k.reset();const $=R.get(0).querySelector(".plx")||R.get(0),m=()=>at.test(location.hash)&&$.isConnected,j=M.observable([]),P=M.observable([]),Ne=M.computed(()=>P.value.map(e=>{const t=[...(e.requiredBy||[]).map(a=>a.displayName),...(e.usedBy||[]).map(a=>a.displayName)];return{name:e.name,displayName:e.displayName,icon:e.icon,meta:[e.description,t.length?`used by ${t.join(", ")}`:"",e.locked?"locked by your manager":"",e.staff?"your host's staff can still use it":""].filter(Boolean).join(" \xB7 "),locked:e.locked===!0,statusText:e.enabled?"On":"Off",statusCls:e.enabled?"is-ok":"is-muted",rowCls:e.enabled?"":"is-off"}})),p=M.observable({available:null,site:null,items:[]}),Me=M.observable(!0),be=M.observable(""),y=M.observable("");let Ae="all";try{Ae=Ct.includes(S.get(Se))?S.get(Se):"all"}catch{}const B=M.observable(Ae),G=M.observable(""),q=M.observable("all"),Ie=M.observable("");k.add(M.effect(()=>{const e=B.value;try{S.set(Se,e)}catch{}}));const Z=M.computed(()=>new Map((p.value.items||[]).map(e=>[e.slug,e.version]))),U=e=>(p.peek().items||[]).find(t=>t.slug===e),he=M.observable([]);k.add(M.effect(()=>{const e=Z.value;he.value=Mt(j.value,{filter:B.value,query:G.value,latest:e}).map(t=>({...Rt(t,e),accent:Ge(t.name)}))}));const st=M.computed(()=>{const e=j.value,t=Z.value,a=e.filter(n=>Ze(n).running).length;return{all:e.length,on:a,off:e.length-a,attention:e.filter(n=>Ut(n,t)).length}}),ee=M.computed(()=>(p.value.items||[]).filter(e=>ue(e)==="update").length),lt=M.computed(()=>j.value.length?"No plugins match.":"No plugins installed. Browse the catalogue, or Install from file in the banner."),fe=M.observable([]);k.add(M.effect(()=>{fe.value=Nt(p.value.items,{filter:q.value,query:Ie.value}).map(e=>{const t=At(e),a=t.action==="update"||t.action==="install"||t.action==="buy";return{...t,accent:Ge(e.slug),actCls:a?"btn-primary":"btn-ghost",actDisabled:!a}})}));const ot=M.computed(()=>{const e=p.value.items||[];return{all:e.length,installed:e.filter(t=>t.installed).length,available:e.filter(t=>ue(t)==="install").length,updates:ee.value}}),Oe=M.computed(()=>Wt(p.value.bundle)),te=e=>j.peek().find(t=>t.name===e);async function ge(){try{const[e,t]=await kt($.querySelector(".dm-loading-slot"),Promise.all([h.plugins.list(),h.tools.list().catch(()=>[])]),xt.iconRows);if(!m())return;j.value=Array.isArray(e)?e:[],P.value=Array.isArray(t)?t:[],be.value=""}catch(e){be.value=`Could not load the plugins: ${e.message||e}`}finally{Me.value=!1}}async function Le(){try{const e=await h.marketplace.catalogue();if(!m())return;p.value={available:!!e?.available,site:e?.site||null,items:e?.catalogue||[],mode:e?.mode||(e?.available?"managed":"none"),siteError:e?.siteError||"",storeFailed:e?.failed||"",connection:e?.connection||null,vat:e?.vat||null,bundle:(e?.bundles||[]).find(t=>t.slug==="bundle-pro")||null},e?.bundles?.[0]?.pending&&ye(e.bundles[0].pending,{fast:!1}),e?.connection?.status==="pending"&&ve();for(const t of e?.pending||[])ye(t.id,{fast:!1})}catch{p.value={available:!1,site:null,items:[],failed:!0}}}const N=async()=>{await Promise.all([ge(),Le()]),Et(qt)};async function _(e,t,a="plugin"){if(e.core)return;const n=t?"on":"off";if(e.locked){E.toast(`${e.displayName||e.name} is locked by your site's manager - ask them to switch it ${n}.`,{type:"info",duration:6e3});return}if(!await E.confirm(`Switch ${u(e.displayName||e.name)} ${n}? The server restarts to apply it, which takes a few seconds.`)||y.peek())return;const s=l=>a==="tool"?h.tools.update(e.name,{enabled:t,cascade:l}):h.plugins.update(e.name,{enabled:t,cascade:l});y.value=`Switching ${e.displayName||e.name} ${n}\u2026`;try{let l;try{l=await s(!1)}catch(i){if(i.status!==409||!i.body?.needsConfirm)throw i;const r=Dt(i.body.plan);if(y.value="",!await E.confirm(`<p>Switching ${u(e.displayName||e.name)} ${n} also means:</p><ul>${r.map(c=>`<li>${u(c)}</li>`).join("")}</ul><p>Go ahead?</p>`))return;y.value=`Switching ${e.displayName||e.name} ${n}\u2026`,l=await s(!0)}await St(l,{onStatus:i=>{y.value=i}}),E.toast(`${e.displayName||e.name} is ${n}.${t?" Reload the admin to open its screens.":""}`,{type:"success",duration:6e3});try{document.dispatchEvent(new CustomEvent("dm:sidebar-rebuild"))}catch{}}catch(l){E.toast(`Not switched ${n}: ${l.message||l}`,{type:"error"})}finally{y.value="",m()&&await N()}}async function V(e,{update:t=!1}={}){const a=u(e.displayName||e.slug),n=t?`<p>Update ${a} from ${u(e.installedVersion)} to ${u(e.version)}?</p> <p class="text-muted">The plugin keeps its data, and the current version is put back if the update fails.</p>`:`<p>Install ${a} v${u(e.version)}?</p> <p class="text-muted">It arrives licensed to this site and takes effect after a restart.</p>`;if(await E.confirm(n,{title:t?"Update plugin":"Install plugin",confirmText:t?"Update":"Install",cancelText:"Cancel",html:!0})){try{const s=await h.marketplace.install(e.slug,e.version,{update:t}),l=s?.action==="upgrade"?`${e.slug} updated${s.from?` from ${s.from}`:""} to ${s.version}.`:`${e.slug} ${s?.version??e.version} installed.`;E.toast(`${l} Restart the server to activate it.`,{type:"success",duration:6e3})}catch(s){E.toast(s.message||"Install failed.",{type:"error"})}m()&&await N()}}const O=new Map;k.add(()=>{for(const e of O.values())clearTimeout(e.timer);O.clear()});function ye(e,{fast:t=!0}={}){if(!e||O.has(e))return;const a={timer:null,until:Date.now()+(t?Pt:0)};O.set(e,a);const n=()=>{clearTimeout(a.timer),!(!m()||!O.has(e))&&(a.timer=setTimeout(()=>ne(e),Date.now()<a.until?nt:Vt))};a.next=n,n()}const Ue=e=>{const t=O.get(e);t&&clearTimeout(t.timer),O.delete(e)},ae=new Set;async function ne(e,{byHand:t=!1}={}){if(!m()||ae.has(e))return;ae.add(e),clearTimeout(O.get(e)?.timer);let a;try{a=await h.marketplace.claim(e)}catch(s){t&&E.toast(s.message||"The store could not be asked just now.",{type:"error"}),ae.delete(e),O.get(e)?.next?.();return}ae.delete(e);const n=a.bundle?p.peek().bundle?.displayName||"The Pro bundle":U(a.slug)?.displayName||a.slug;if(a.status==="pending"){t&&E.toast(`Not paid yet - ${n} installs here as soon as the payment is through.`,{type:"info",duration:6e3}),O.get(e)?.next?.();return}if(Ue(e),a.status==="paid"&&a.bundle){const s=a.included||[],l=s.filter(r=>r.installed&&!r.alreadyHere).length,i=s.filter(r=>!r.installed);E.toast(a.kind==="renew"?`${n}: updates renewed for all ${s.length} Tools.`:`${n} is paid for: ${l} Tool${l===1?"":"s"} installed${s.length-l-i.length?`, ${s.length-l-i.length} already here`:""}. They are switched off - turn on the ones you want, then restart the server.`+(i.length?` ${i.length} did not install (${i.map(r=>U(r.slug)?.displayName||r.slug).join(", ")}) - use Install on the Browse tab.`:""),{type:i.length?"warning":"success",duration:14e3})}else if(a.status==="paid")if(a.kind==="renew")E.toast(`${n}: updates renewed.${a.installed&&!a.refreshed?" Update it on the Browse tab.":""}`,{type:"success",duration:8e3});else if(a.installed&&a.refreshed===!1&&a.installError)E.toast(`${n} is paid for, but the copy here could not be brought up to date: ${a.installError}. Use Update on the Browse tab.`,{type:"warning",duration:12e3});else if(a.installed){const s=(a.included||[]).filter(l=>l.installed).map(l=>U(l.slug)?.displayName||l.slug);E.toast(`${n} is paid for and installed${s.length?`, with ${s.join(" and ")} free`:""}. Restart the server to activate ${s.length?"them":"it"}.`+(s.some(l=>/mongo/i.test(l))?" Then open MongoDB in the sidebar to connect your database.":""),{type:"success",duration:12e3})}else E.toast(`${n} is paid for, but did not install: ${a.installError||"try Install on the Browse tab"}. The licence key is in your email.`,{type:"warning",duration:12e3});else a.status!=="unknown"&&E.toast(`${n}: the purchase ${a.status==="expired"?"was not paid for in time":`is ${a.status}`}.`,{type:"warning",duration:8e3});m()&&await N()}async function it(e){if(e?.pending&&await E.confirm(`<p>Stop waiting for the payment for ${u(e.displayName||e.slug)}?</p> <p class="text-muted">Nothing is cancelled at the store - if you did pay, the licence key is in your email and Install from file takes the file it links to.</p>`,{title:"Stop waiting",confirmText:"Stop waiting",cancelText:"Keep waiting",html:!0})){Ue(e.pending);try{await h.marketplace.dropPurchase(e.pending)}catch(t){E.toast(t.message||"Could not do that.",{type:"error"})}m()&&await N()}}async function rt(e){const t=await E.prompt(`Licence key for ${u(e.displayName||e.slug)} - it is in the email you had when you bought it.`,{title:"Enter licence key",inputPlaceholder:"DOMMA-XXXX-XXXX-XXXX",confirmText:"Use this key"});if(!(!t||!m()))try{const a=await h.marketplace.enterKey(e.slug,String(t).trim());await N();const n=U(e.slug);a.updates&&n&&!n.installed?(E.toast(`Licence accepted for ${e.displayName||e.slug}.`,{type:"success"}),await V(n)):E.toast(`Licence accepted for ${e.displayName||e.slug}.${n?.installed?" Restart the server for it to take effect.":""}`,{type:"success",duration:7e3})}catch(a){E.toast(a.message||"That key could not be used.",{type:"error",duration:8e3})}}function ct(e,t,a){return new Promise(n=>{let s=!1;const l=C=>{if(!s){s=!0,n(C);try{i.close()}catch{}}},i=E.modal({title:e.title,size:"md",buttons:[],onClose:()=>l(null)}),r=document.createElement("div");r.className="flex flex-col gap-3",e.lines.forEach((C,d)=>{const w=document.createElement("p");d&&(w.className="text-muted"),w.textContent=C,r.append(w)});const c=(C,d,w)=>{const D=document.createElement("label");D.className="form-group";const X=document.createElement("span");if(X.className="form-label",X.textContent=C,D.append(X,d),w){const H=document.createElement("small");H.className="text-muted",H.textContent=w,D.append(H)}return D},b=document.createElement("select");b.className="form-select",b.append(new Option("Choose\u2026",""));for(const C of t.countries)b.append(new Option(C.name,C.code));const f=document.createElement("input");f.className="form-input",f.maxLength=20,f.spellcheck=!1,f.placeholder="Only for a business with one";const v=document.createElement("p");v.className="text-sm text-danger",v.hidden=!0;const x=document.createElement("div");x.className="flex gap-2 justify-end";const T=document.createElement("button");T.type="button",T.className="btn btn-ghost",T.textContent="Cancel";const A=document.createElement("button");A.type="button",A.className="btn btn-primary",A.textContent=a,T.addEventListener("click",()=>l(null)),A.addEventListener("click",()=>{if(!b.value){v.textContent="Choose your country - it decides the VAT.",v.hidden=!1,b.focus();return}l({country:b.value,vatNumber:f.value.trim()})}),x.append(T,A),r.append(c("Your country",b,"It decides the VAT on this purchase."),c("EU VAT number",f,"A business with a valid EU VAT number pays no VAT (reverse charge)."),v,x),i.element.appendChild(r),i.open(),setTimeout(()=>b.focus(),60)})}async function De(e){if(y.peek())return;const t=jt(e,{site:p.peek().site,email:Q()?.email}),a=p.peek().vat;let n={};if(a?.countryRequired&&Array.isArray(a.countries)&&a.countries.length){const l=await ct(t,a,e.owned?"Renew":"Buy");if(!l)return;n=l}else{const l=t.lines.map((i,r)=>`<p${r?' class="text-muted"':""}>${u(i)}</p>`).join(" ");if(!await E.confirm(l,{title:t.title,confirmText:e.owned?"Renew":"Buy",cancelText:"Cancel",html:!0}))return}const s=window.open("","_blank");try{const l=await h.marketplace.buy(e.slug,n);s&&!s.closed?(s.opener=null,s.location.href=l.checkoutUrl):window.open(l.checkoutUrl,"_blank","noopener")||E.toast("Your browser blocked the payment tab - allow pop-ups for this site and choose Buy again.",{type:"warning",duration:9e3}),ye(l.id),E.toast(`Payment opened in a new tab. ${e.displayName||e.slug} ${e.owned?"renews":"installs here"} as soon as it is through - keep this page open, or come back to it.`,{type:"info",duration:9e3}),l.vatNote&&E.toast(l.vatNote,{type:"warning",duration:1e4})}catch(l){try{s?.close()}catch{}E.toast(l.message||"The purchase could not be started.",{type:"error",duration:8e3})}m()&&await N()}let se=null,z=0;k.add(()=>clearTimeout(se));function ve(){z||(z=Date.now()+60*6e4),clearTimeout(se),!(!m()||Date.now()>z)&&(se=setTimeout(()=>we(!1),nt))}let le=!1;async function we(e){if(le||!m())return;le=!0;let t;try{t=await h.marketplace.connectCheck()}catch(n){e&&E.toast(n.message||"Could not ask just now.",{type:"error"}),le=!1,ve();return}le=!1;const a=t?.connection||null;if(a?.status==="pending"){e&&E.toast(`Not yet - open the link we emailed to ${a.email} and choose Connect.`,{type:"info",duration:6e3}),ve();return}z=0,a?.status==="connected"?E.toast(`Connected to Domma as ${a.email}.`,{type:"success",duration:7e3}):E.toast("The link was not opened in time - choose Connect to Domma again.",{type:"warning",duration:7e3}),m()&&await N()}async function dt(){const e=await E.prompt("The email address you bought your Tools with. We email it a link; open it and choose Connect.",{title:"Connect to Domma",inputPlaceholder:Q()?.email||"you@example.com",defaultValue:Q()?.email||"",confirmText:"Email me the link"});if(!(e==null||!m()))try{const t=await h.marketplace.connect(String(e).trim()||Q()?.email||"");E.toast(`Link emailed to ${t.connection?.email}. Open it and choose Connect - this page picks it up.`,{type:"info",duration:9e3}),z=0,await N()}catch(t){E.toast(t.message||"Could not connect.",{type:"error",duration:8e3})}}async function ut(){const e=p.peek().connection;if(e&&!(e.status!=="pending"&&!await E.confirm(`<p>Disconnect this site from Domma (${u(e.email)})?</p> <p class="text-muted">The licences it already has stay. New ones stop arriving by themselves - connect again, or enter a key.</p>`,{title:"Disconnect",confirmText:"Disconnect",cancelText:"Keep it",html:!0}))){clearTimeout(se),z=0;try{await h.marketplace.disconnect()}catch(t){E.toast(t.message||"Could not do that.",{type:"error"})}m()&&await N()}}const Re=()=>{for(const e of[...O.keys()])ne(e);p.peek().connection?.status==="pending"&&we(!1)};window.addEventListener("focus",Re),k.add(()=>window.removeEventListener("focus",Re));function Be(e){if(e?.store){De(e);return}e?.buyUrl&&(window.open(e.buyUrl,"_blank","noopener"),E.toast(`Manage my site opened in a new tab. We email you a sign-in link; ${e.displayName||e.slug} is ticked ready once you are in. Install it here when it is paid for.`,{type:"info",duration:9e3}))}async function Fe(e,t){const n=U(e)?.tier==="paid"&&!U(e)?.store?` <p class="text-muted">It is a paid Tool: your site's manager is told, and if you pay for it on its own it comes off your monthly bill (the rest of this month is credited).</p>`:"";if(await E.confirm(`<p>Uninstall ${u(t||e)}?</p> <p class="text-muted">Its files are removed, and its <code>data/</code> folder with them. Roles it added are removed and their users moved to <code>user</code>. Restart the server to finish.</p>${n}`,{title:"Uninstall plugin",confirmText:"Uninstall",cancelText:"Cancel",html:!0})){try{const l=(await h.marketplace.uninstall(e))?.release?.removed?" It is off your bill.":"";E.toast(`${t||e} uninstalled.${l} Restart the server to apply.`,{type:"success",duration:6e3})}catch(s){E.toast(`Uninstall failed: ${s.message||s}`,{type:"error"})}m()&&await N()}}async function je(e){try{await h.plugins.exportBundle(e.name)}catch(t){E.toast(t.message||"Export failed.",{type:"error"})}}const We=e=>{location.hash=`#/plugins/code/${encodeURIComponent(e.name)}`},K=$.querySelector(".plx-file");async function pt(e){if(y.peek())return;y.value=`Installing ${e.name}\u2026`;const t={};try{for(let a=0;a<4;a++)try{const n=await h.plugins.installFile(e,t),s=n.action==="upgrade"?`${n.name} updated${n.from?` from ${n.from}`:""} to ${n.version}.`:`${n.name} ${n.version} installed.`;E.toast(`${s} Restart the server to activate it.`,{type:"success",duration:6e3});return}catch(n){if(y.value="",n.code==="CONFLICT"&&!t.confirmUpgrade){if(!await E.confirm(`<p>${u(n.name)} ${u(n.installedVersion||"the installed version")} is already installed. Update it to ${u(n.incomingVersion||"this file")}?</p> <p class="text-muted">The plugin keeps its data, and the current version is put back if the update fails.</p>`,{title:"Update plugin",confirmText:"Update",cancelText:"Cancel",html:!0}))return;t.confirmUpgrade=!0}else if(/refusing to downgrade/i.test(n.message)&&!t.confirmDowngrade){if(!await E.confirm(`<p>${u(n.message)} Install it anyway?</p> <p class="text-muted">An older version may not understand data written by the newer one.</p>`,{title:"Downgrade plugin",confirmText:"Downgrade",cancelText:"Cancel",html:!0}))return;t.confirmDowngrade=!0}else if(/unsigned|signature/i.test(n.message)&&!t.confirmUnsigned){if(!await E.confirm(`<p>${u(n.message)}</p> <p class="text-muted">An unsigned plugin has not been verified as coming from the marketplace. Its code runs on this server with full access. Install it anyway?</p>`,{title:"Unsigned plugin",confirmText:"Install anyway",cancelText:"Cancel",html:!0}))return;t.confirmUnsigned=!0}else{E.toast(n.message||"Install failed.",{type:"error"});return}y.value=`Installing ${e.name}\u2026`}}finally{y.value="",m()&&await N()}}const Ve=async()=>{const e=K.files?.[0];K.value="",e&&await pt(e)};K.addEventListener("change",Ve),k.add(()=>K.removeEventListener("change",Ve));const oe=new Set;let W=null,Pe=!1;function qe({title:e,size:t="md",panel:a,model:n,methods:s,dirty:l=()=>!1,form:i=null,cleanup:r=()=>{}}){const c=E.slideover({title:u(e),size:t,position:"right"});c.element.appendChild(a);const b=Je(a),f=M.applyBindings(n,a,{methods:s});i&&(W=i),oe.add(c),$t(c,()=>{r(),f.dispose(),b(),oe.delete(c),W===i&&(W=null)});const v=c.close.bind(c);let x=!1,T=!1;return c.close=async A=>{if(!x&&A!==!0&&l()){if(T)return;T=!0;const C=await E.confirm("Discard the changes you have not saved?");if(T=!1,!C)return}return x=!0,v()},I.scan(a),c.open(),c}function xe(e,t=null){const a=te(e);if(!a)return;const n=Ze(a),s=et(a),l=U(a.name),i=tt(a,Z.peek()),r=!!(i&&l?.entitled&&!l?.needsCms),b={...Object.fromEntries(s.map(o=>[o.key,o.value])),...Object.fromEntries(Object.entries(t||{}).filter(([o])=>!s.find(g=>g.key===o)?.secret))},f=Object.fromEntries(s.map(o=>[o.key,M.observable(b[o.key])])),v=M.computed(()=>Bt(s,Object.fromEntries(s.map(o=>[o.key,f[o.key].value])))),x=M.observable(!1),T=()=>Object.keys(v.peek().changed).length>0||Object.keys(v.peek().errors).length>0,A=[["Version",`v${a.version}${i?` (v${i} available)`:""}`],["Status",n.text+(a.supersededBy?` - replaced by ${a.supersededBy}`:"")],["Author",a.author],["Released",Lt(a.date)],["Licence",a.licence],["Slug",a.name]].filter(([,o])=>o),C=(o,g)=>{const F=`plx-set-${g}`,ce=o.help?` <span data-help="${u(o.help)}"></span>`:"",Y=`<label class="form-label" for="${F}">${u(o.label)}${ce}</label>`,J=`data-model="v${g}.value"`,de=`<small class="plx-err" data-bind-hidden="!err${g}.value" data-bind-text="err${g}.value"></small>`;if(o.type==="checkbox")return`<div class="plx-setting">${Y}<input id="${F}" type="checkbox" class="form-switch" ${J}></div>`;if(o.type==="select")return`<div>${Y}<select id="${F}" class="form-input" ${J}>${o.options.map(Ye=>`<option value="${u(Ye.value)}">${u(Ye.label)}</option>`).join("")}</select>${de}</div>`;if(o.type==="json")return`<div>${Y}<textarea id="${F}" class="form-input plx-json" rows="5" spellcheck="false" ${J}></textarea>${de}</div>`;if(o.type==="textarea")return`<div>${Y}<textarea id="${F}" class="form-input" rows="3" ${J}></textarea>${de}</div>`;const vt=o.type==="number"?"number":o.secret?"password":"text",wt=`${o.min!=null?` min="${u(o.min)}"`:""}${o.max!=null?` max="${u(o.max)}"`:""}`;return`<div>${Y}<input id="${F}" type="${vt}" class="form-input" autocomplete="${o.secret?"new-password":"off"}"${wt} ${J}>${de}</div>`},d=Ot(a,{plugins:j.peek(),tools:P.peek(),catalogue:p.peek().items||[]}),w={saving:x,needs:M.observable(d.needs),worksWith:M.observable(d.worksWith),hasNeeds:d.needs.length>0,hasWorksWith:d.worksWith.length>0,hasFields:s.length>0,cannot:M.computed(()=>x.value||!Object.keys(v.value.changed).length||Object.keys(v.value.errors).length>0),...Object.fromEntries(s.flatMap((o,g)=>[[`v${g}`,f[o.key]],[`err${g}`,M.computed(()=>v.value.errors[o.key]||"")]]))},D=Ce(`
|
|
38
38
|
<div class="plx-form">
|
|
39
39
|
<p class="plx-desc"></p>
|
|
40
40
|
<dl class="plx-facts"></dl>
|
package/docs/api-reference.md
CHANGED
|
@@ -1005,6 +1005,28 @@ or the verb is disabled).
|
|
|
1005
1005
|
|
|
1006
1006
|
Entries created via token auth are attributed `meta.createdBy: "token:<token-id>"`, `meta.source: "api"`.
|
|
1007
1007
|
|
|
1008
|
+
**Drafts only (optional):** `draftsOnly: true` on a token (the **Drafts only** switch in the token
|
|
1009
|
+
editor) is for a bot or another system writing on someone's behalf - nothing it writes reaches the
|
|
1010
|
+
public until a person publishes it. Enforced on the server, whatever the caller sends:
|
|
1011
|
+
|
|
1012
|
+
- **create** - the entry is saved with `status: "draft"` (a `published` or `scheduled` status sent is replaced);
|
|
1013
|
+
- **update** - only an entry whose `status` is `draft` now, and it stays `draft`; any other entry is `403`;
|
|
1014
|
+
- **delete** - only a draft; any other entry is `403`;
|
|
1015
|
+
- a collection with no draft status (a field named `status` whose options include `draft`, as Blog posts
|
|
1016
|
+
have) refuses the token's writes with `403`. Reads are unaffected.
|
|
1017
|
+
|
|
1018
|
+
Example - a draft blog post, from a token scoped `blog-posts: create` with Drafts only on (the
|
|
1019
|
+
collection's `api.create` set to `{enabled: true, access: "token"}`):
|
|
1020
|
+
|
|
1021
|
+
```bash
|
|
1022
|
+
curl -X POST https://example.com/api/v1/blog-posts \
|
|
1023
|
+
-H "Authorization: Bearer dcms_…" -H "Content-Type: application/json" \
|
|
1024
|
+
-d '{"data": {"title": "Hello", "slug": "hello", "content": "…", "status": "draft"}}'
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
Send `slug` and `status` yourself - the v1 write saves the entry as given. `authorId` (a user id)
|
|
1028
|
+
credits a person; without it the post has no author.
|
|
1029
|
+
|
|
1008
1030
|
### Token management (`/api/api-tokens/*`)
|
|
1009
1031
|
|
|
1010
1032
|
| Method | Path | Auth | Description |
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/body-menu.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The reading pane's right-click menu - the pure parts.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/cms-host.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** The CMS shell boundary. Standalone never imports this adapter. */
|
|
4
4
|
const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/compose-window.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/contacts.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Recipient suggestions from the host address book.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/diagnostics-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The settings section that answers "which build is this, and what went wrong".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/drag-drop.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Drag identities include the mailbox and source folder: UIDs alone are not unique. */
|
|
4
4
|
const PROTECTED_USES = new Set(['\\Inbox', '\\Sent', '\\Drafts', '\\Trash', '\\Junk', '\\Archive', '\\All', '\\Flagged']);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/folder-tree.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Mail folder presentation, shared by the Mail Reader and Email Pro.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/font-controls.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/fonts.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The fonts and sizes the mail editor offers - pure, so both the compose
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/host-context.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Services supplied by the application that hosts the shared mail interface. */
|
|
4
4
|
export function createMailApi({getToken, fetch: request = globalThis.fetch, onUnauthorized = () => {}}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/identity.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Who a mailbox sends as, and what it signs off with.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/image-senders-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The settings section for senders whose images always load.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/keyboard.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Keyboard navigation for the reader.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/message-actions.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* What other Tools add to a message's menu - Booking's "Book Sam...".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/oauth-panel.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* "Sign in with Microsoft / Google" for a mailbox - the part of the mailbox
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/panes.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Pane sizing for the mail reader, shared by the Mail Reader and Email Pro.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/reader-kit.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The reader view's decisions that need no DOM - escaping, the mailbox form's
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/reader-runtime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
|
|
@@ -111,6 +111,7 @@ function formatSize(bytes) {
|
|
|
111
111
|
* function given the reader's `view` handle (see `extensionView()`):
|
|
112
112
|
* - `paneActions(view)` -> `[{id, label, icon, onClick, haspopup?}]`, buttons
|
|
113
113
|
* in the Folders pane head beside New folder;
|
|
114
|
+
* - `messageItems(message, view)` -> menu items for the selected message;
|
|
114
115
|
* - `folderItems(folder, view)` -> Domma menu items, added to a folder's
|
|
115
116
|
* menu (right-click, ⋮, Shift+F10);
|
|
116
117
|
* - `mailboxItems(account, view)` -> the same, on a mailbox row's menu.
|
|
@@ -3961,7 +3962,7 @@ return {
|
|
|
3961
3962
|
{type: 'divider'},
|
|
3962
3963
|
{label: 'Add sender to contacts', icon: 'user-plus', disabled: () => senderKnown || !sender, action: () => addSender(message)}
|
|
3963
3964
|
] : []),
|
|
3964
|
-
...(messageActions.length ? [{type: 'divider'}, ...toolActionItems(message)] : [])
|
|
3965
|
+
...((messageActions.length || typeof extensions.messageItems === 'function') ? [{type: 'divider'}, ...toolActionItems(message)] : [])
|
|
3965
3966
|
];
|
|
3966
3967
|
}
|
|
3967
3968
|
|
|
@@ -3974,7 +3975,6 @@ return {
|
|
|
3974
3975
|
* @returns {object[]}
|
|
3975
3976
|
*/
|
|
3976
3977
|
function toolActionItems(message) {
|
|
3977
|
-
if (!messageActions.length) return [];
|
|
3978
3978
|
const facts = messageFacts(message);
|
|
3979
3979
|
const items = messageActions.map(action => {
|
|
3980
3980
|
const {label, hash} = fillMessageAction(action, facts);
|
|
@@ -3985,7 +3985,8 @@ return {
|
|
|
3985
3985
|
action: () => { location.hash = hash.replace(/^#/, ''); }
|
|
3986
3986
|
};
|
|
3987
3987
|
});
|
|
3988
|
-
|
|
3988
|
+
items.push(...extensionItems('messageItems', message));
|
|
3989
|
+
return features.write && items.length ? [...items, {type: 'divider'}] : items;
|
|
3989
3990
|
}
|
|
3990
3991
|
|
|
3991
3992
|
/**
|
|
@@ -5191,8 +5192,8 @@ return {
|
|
|
5191
5192
|
/**
|
|
5192
5193
|
* The menu items an extension adds for one row.
|
|
5193
5194
|
*
|
|
5194
|
-
* @param {'folderItems'|'mailboxItems'} name
|
|
5195
|
-
* @param {object} subject - the folder or
|
|
5195
|
+
* @param {'folderItems'|'mailboxItems'|'messageItems'} name
|
|
5196
|
+
* @param {object} subject - the folder, mailbox or message
|
|
5196
5197
|
* @returns {object[]}
|
|
5197
5198
|
*/
|
|
5198
5199
|
function extensionItems(name, subject) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/reader-view.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Existing CMS entry point for the shared mail view. */
|
|
4
4
|
const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/resizable.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The mail reader's resizable slideovers.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/restore-spam.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Undo restores both junk status and the original folder, following each UID remap. */
|
|
4
4
|
export async function restoreSpam({api, base, account, from, destination, uids, spam}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/scheduling.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/section-kit.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/security-note.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* What the reader says about a signed or encrypted (S/MIME) message.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/settings-section.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** Browser preferences for the shared mail reader. */
|
|
4
4
|
export const READ_DELAY_KEY = 'domma-mail.mark-read-seconds';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/templates.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/threads.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Grouping messages into conversations.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/vacation.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The automatic reply, and everything that must stop it.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/when-closed.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Run code when a Domma modal or slideover actually closes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.24.
|
|
1
|
+
// Source: @domma-mail/core 0.24.2, packages/core/src/admin/ui/dates.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Dates as a plugin shows them to a person: dd/mm/yyyy, and dd/mm/yyyy HH:mm
|