headroom-cms 0.1.11 → 0.2.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/admin/.well-known/headroom.json +9 -0
- package/admin/assets/{AdminsPage-BnzH9TL3.js → AdminsPage-DUMTsCEp.js} +1 -1
- package/admin/assets/{AllContentPage-BtObN6oy.js → AllContentPage-D5ey5AOV.js} +1 -1
- package/admin/assets/{ApiKeysPage-DEAa8eyC.js → ApiKeysPage-CzUOSoz_.js} +1 -1
- package/admin/assets/{AuditPage-BN9yNsxh.js → AuditPage-CYAg4dbI.js} +1 -1
- package/admin/assets/BackupsPage-04_oMy3v.js +1 -0
- package/admin/assets/{BlockEditor-3wnisTOZ.js → BlockEditor-s0CRZsjy.js} +3 -3
- package/admin/assets/BlockTypeEditPage-D1OFIlJZ.js +1 -0
- package/admin/assets/{BlockTypesPage-Dhkho6T_.js → BlockTypesPage-cJNR25fN.js} +1 -1
- package/admin/assets/{BulkActionBar-BxdfUSrN.js → BulkActionBar-BWysX7Wo.js} +1 -1
- package/admin/assets/{CollectionEditPage-lOb4hEZy.js → CollectionEditPage-DRmCA_73.js} +1 -1
- package/admin/assets/{CollectionsPage-CgtOloa1.js → CollectionsPage-CeQB5e9u.js} +1 -1
- package/admin/assets/{ContentCreatePage-LeQjahp_.js → ContentCreatePage-Cq8Pi8EF.js} +1 -1
- package/admin/assets/ContentEditPage-CEJ7I3WH.js +1 -0
- package/admin/assets/{ContentField-pilCbdnA.js → ContentField-BZT4OUfI.js} +1 -1
- package/admin/assets/ContentListPage-BCEQrYVs.js +1 -0
- package/admin/assets/{CustomBlockPreview-DNnTFM0z.js → CustomBlockPreview-Kc6bb3oq.js} +1 -1
- package/admin/assets/FieldRenderer-CT-DgCbC.js +2 -0
- package/admin/assets/FileTypeIcon-CNHtffHC.js +1 -0
- package/admin/assets/FloatingComposerController-D4uLQfUX-0_Y8mkGU.js +1 -0
- package/admin/assets/{IconPicker-CpIgiQTC.js → IconPicker-BpPlHJO0.js} +2 -2
- package/admin/assets/{LoginPage-D9ZsGLIi.js → LoginPage-Dya8sF_P.js} +1 -1
- package/admin/assets/MediaField-C3qFf3g5.js +1 -0
- package/admin/assets/MediaPage-BNxc0wLq.js +1 -0
- package/admin/assets/{Pagination-Df9nQ7Z0.js → Pagination-Dx8h11Rn.js} +1 -1
- package/admin/assets/{RelationshipPicker-B3Ftmqxp.js → RelationshipPicker-C2MTxrhl.js} +1 -1
- package/admin/assets/{SiteSettingsPage-6NvH7CiQ.js → SiteSettingsPage-BDZaUBmf.js} +1 -1
- package/admin/assets/{SiteUserEditPage-D5VaQ1Xq.js → SiteUserEditPage-MfzhPW7v.js} +1 -1
- package/admin/assets/{SiteUsersPage-BYVduiqs.js → SiteUsersPage-CrYugXpx.js} +1 -1
- package/admin/assets/{SitesPage-rfWWE0yK.js → SitesPage-Cl8V3Hb7.js} +1 -1
- package/admin/assets/SubmissionDetailPage-BnVlsGb-.js +1 -0
- package/admin/assets/SubmissionEditPage-B0Kq52fb.js +1 -0
- package/admin/assets/SubmissionListPage-K665VwMp.js +1 -0
- package/admin/assets/{TagInput-57c4DG1w.js → TagInput-C6tcB5Xw.js} +1 -1
- package/admin/assets/{TagsPage-BEO5AwCv.js → TagsPage-BONR6bSu.js} +1 -1
- package/admin/assets/{UsersPage-BpIRorJ1.js → UsersPage-C2iCy0UR.js} +1 -1
- package/admin/assets/{WebhookEditPage-D5xgi56h.js → WebhookEditPage-DjZFxT72.js} +1 -1
- package/admin/assets/{WebhooksPage-BY7AaiGr.js → WebhooksPage-g_a224a4.js} +1 -1
- package/admin/assets/{card-C9hfyHXf.js → card-DlfsF8lU.js} +1 -1
- package/admin/assets/{checkbox-DVJcwUt1.js → checkbox-BX8EcGFf.js} +1 -1
- package/admin/assets/{command-Bfmj0MEL.js → command-DaTsImUa.js} +1 -1
- package/admin/assets/{contentStatus-CkPi9Dh6.js → contentStatus-WXGfd7vX.js} +1 -1
- package/admin/assets/format-BRcflvs9.js +1 -0
- package/admin/assets/index-9sbb3-yI.css +1 -0
- package/admin/assets/{index-Ce5pmRMj.js → index-DC1UyCW2.js} +10 -10
- package/admin/assets/listCellValue-CBqXAwce.js +1 -0
- package/admin/assets/{popover-CzaQYEEP.js → popover-BA-47SRI.js} +1 -1
- package/admin/assets/{select-CrRhFGIi.js → select-waaVyoQ5.js} +1 -1
- package/admin/assets/{serializeToText-2VrsuRUh.js → serializeToText-CjHhyvXp.js} +1 -1
- package/admin/assets/{table-_3bMY0_z.js → table-Br-QgtTL.js} +1 -1
- package/admin/assets/{textarea-6fq0R6VV.js → textarea-BILv1DQB.js} +1 -1
- package/admin/assets/useAdminResolver-CbDzGoDp.js +1 -0
- package/admin/assets/useContent-Bp4f9qe0.js +1 -0
- package/admin/assets/{useContentSearch-B3aTjuCu.js → useContentSearch-DbiA8aG-.js} +1 -1
- package/admin/assets/{usePageTitle-C1r1-C00.js → usePageTitle-DOEFrHbj.js} +1 -1
- package/admin/assets/{useSiteUsers-DIaqgNSp.js → useSiteUsers-BFYAbJNT.js} +1 -1
- package/admin/assets/{useTags-B-HgMVwo.js → useTags-DJlXwDyc.js} +1 -1
- package/admin/assets/{useWebhooks-BvZjUJkJ.js → useWebhooks-BkpJKNLN.js} +1 -1
- package/admin/index.html +2 -2
- package/admin/sw.js +1 -1
- package/admin/workbox-362996ec.js +1 -0
- package/dist/admin-site.d.ts.map +1 -1
- package/dist/admin-site.js +46 -3
- package/dist/admin-site.js.map +1 -1
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +57 -5
- package/dist/api.js.map +1 -1
- package/dist/backup.d.ts +29 -0
- package/dist/backup.d.ts.map +1 -0
- package/dist/backup.js +95 -0
- package/dist/backup.js.map +1 -0
- package/dist/cdn-api.d.ts.map +1 -1
- package/dist/cdn-api.js +20 -19
- package/dist/cdn-api.js.map +1 -1
- package/dist/image.d.ts +8 -1
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +26 -6
- package/dist/image.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/storage.d.ts +1 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +21 -0
- package/dist/storage.js.map +1 -1
- package/dist/webhooks.d.ts +4 -3
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js +22 -35
- package/dist/webhooks.js.map +1 -1
- package/lambda/api/bootstrap +0 -0
- package/lambda/backup-worker/bootstrap +0 -0
- package/lambda/image-lambda/index.mjs +30 -6
- package/lambda/image-lambda/node_modules/.package-lock.json +3 -3
- package/lambda/image-lambda/node_modules/semver/classes/range.js +7 -0
- package/lambda/image-lambda/node_modules/semver/package.json +1 -1
- package/lambda/image-lambda/node_modules/semver/ranges/subset.js +2 -2
- package/lambda/webhook-worker/bootstrap +0 -0
- package/package.json +1 -1
- package/src/admin-site.ts +46 -3
- package/src/api.ts +58 -5
- package/src/backup.ts +114 -0
- package/src/cdn-api.ts +20 -22
- package/src/image.ts +30 -6
- package/src/index.ts +37 -1
- package/src/sst-env.d.ts +4 -0
- package/src/storage.ts +22 -0
- package/src/webhooks.ts +22 -39
- package/admin/assets/BlockTypeEditPage-C2evAESK.js +0 -1
- package/admin/assets/ContentEditPage-xczr4d_h.js +0 -1
- package/admin/assets/ContentListPage-BAKDn1Xy.js +0 -1
- package/admin/assets/FieldRenderer-DiOKvkWV.js +0 -2
- package/admin/assets/FilterBar-BZoa63zh.js +0 -1
- package/admin/assets/FloatingComposerController-D4uLQfUX-BMIvFCoE.js +0 -1
- package/admin/assets/MediaField-CxccCFGQ.js +0 -1
- package/admin/assets/MediaPage-QvMaH2YJ.js +0 -1
- package/admin/assets/SubmissionDetailPage-BSUR685F.js +0 -1
- package/admin/assets/SubmissionEditPage-DjLXHjWU.js +0 -1
- package/admin/assets/SubmissionListPage-DBxNEvde.js +0 -1
- package/admin/assets/format-C88SDH8g.js +0 -1
- package/admin/assets/index-BB9Syqw2.css +0 -1
- package/admin/assets/useAdminResolver-BJNPz3OG.js +0 -1
- package/admin/assets/useContent-Bs7nel7C.js +0 -1
- package/admin/assets/useMedia-ae3s_ajC.js +0 -1
- package/admin/workbox-7d58179f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as N,j as e}from"./tanstack-Bs3zYPPV.js";import{u as y,r as p}from"./react-vendor-C2CvUxFh.js";import{e as w,j as x,X as S,a8 as F,a9 as R,B as f,ba as j,ab as T,ac as D,aj as I}from"./index-DC1UyCW2.js";import{P,a as L,b as M}from"./popover-BA-47SRI.js";import{C as B,a as E,b as $,c as k,d as q,e as A}from"./command-DaTsImUa.js";import{u as Q,a as V}from"./useContentSearch-DbiA8aG-.js";import{m as z}from"./media-url-DdCoIedP.js";import{a as U,f as G}from"./format-BRcflvs9.js";function ee({relationships:r,activeFilters:s,onFilterAdd:t,onFilterRemove:a}){const{host:c}=y(),[o,d]=p.useState(null),[m,u]=p.useState(""),l=Q(m,300);if(r.length===0)return null;const g=new Set(s.map(n=>n.relName)),h=r.filter(n=>!g.has(n.name));function b(n){d(n),u("")}function C(n){o&&(t({type:"relationship",relName:o.name,relLabel:o.label,contentId:n.contentId,contentTitle:n.title}),d(null),u(""))}function v(){d(null),u("")}return e.jsxs("div",{className:"flex flex-wrap items-center gap-2","data-testid":"filter-bar",children:[s.map(n=>e.jsxs(x,{variant:"secondary",className:"gap-1 pl-2",children:[n.relLabel,": ",n.contentTitle,e.jsx("button",{onClick:()=>a(n.relName),className:"ml-0.5 hover:text-foreground","aria-label":`Remove ${n.relLabel} filter`,children:e.jsx(S,{className:"h-3 w-3"})})]},n.relName)),h.length>0&&(o?e.jsx(H,{host:c,rel:o,query:m,debouncedQuery:l,onQueryChange:u,onSelect:C,onClose:v}):e.jsxs(F,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(f,{variant:"outline",size:"sm","data-testid":"add-filter-button",children:[e.jsx(j,{className:"mr-1.5 h-3.5 w-3.5"}),"Add filter"]})}),e.jsx(T,{align:"start",children:h.map(n=>e.jsx(D,{onSelect:()=>b(n),children:n.label},n.name))})]}))]})}function H({host:r,rel:s,query:t,debouncedQuery:a,onQueryChange:c,onSelect:o,onClose:d}){const{data:m,isLoading:u}=V(r,a,[s.targetCollection],"published");return e.jsxs(P,{open:!0,onOpenChange:l=>{l||d()},children:[e.jsx(L,{asChild:!0,children:e.jsxs(f,{variant:"outline",size:"sm",children:[e.jsx(j,{className:"mr-1.5 h-3.5 w-3.5"}),s.label,"..."]})}),e.jsx(M,{className:"w-80 p-0",align:"start",children:e.jsxs(B,{shouldFilter:!1,children:[e.jsx(E,{placeholder:`Search ${s.label.toLowerCase()}...`,value:t,onValueChange:c,autoFocus:!0}),e.jsx($,{children:u?e.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching..."}):e.jsxs(e.Fragment,{children:[e.jsx(k,{children:"No published content found."}),e.jsx(q,{heading:a.length===0?"Recent":void 0,children:m?.items.map(l=>e.jsxs(A,{value:l.contentId,onSelect:()=>o({contentId:l.contentId,collection:l.collection,slug:l.slug??"",title:l.title}),children:[e.jsx(I,{className:"h-4 w-4"}),e.jsx("span",{className:"flex-1 truncate",children:l.title}),e.jsx(x,{variant:"outline",className:"text-xs",children:l.collection})]},l.contentId))})]})})]})})]})}function te(r,s){const t=w();return N({queryKey:["sites",r,"content-detail",s,"filter-title"],queryFn:async()=>(await t.apiFetch(`/v1/admin/sites/${r}/content/${s}`)).content?.title||"Untitled",enabled:!!r&&!!s,staleTime:6e4})}const i="—";function ne(r,s){const t=r.fields?.[s.name];switch(s.type){case"boolean":return t==null?i:t?"Yes":"No";case"number":return t==null?i:String(t);case"media":{if(!t||typeof t!="object")return i;const a=t.url,c=t.alt;return typeof a!="string"||a===""?i:e.jsx("img",{src:z(a),alt:typeof c=="string"?c:"",className:"h-6 w-6 rounded object-cover"})}case"date":case"datetime":return typeof t!="number"||!Number.isFinite(t)?i:e.jsx("span",{title:G(t),children:U(t)});case"text":case"select":case"url":case"email":default:{if(t==null)return i;const a=String(t);return a===""?i:a.length>60?a.slice(0,60)+"…":a}}}export{ee as F,ne as g,te as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as n}from"./index-
|
|
1
|
+
import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as n}from"./index-DC1UyCW2.js";import{Z as s,_ as i,$ as d,a0 as p}from"./radix-C5ZmWuuL.js";function c({...o}){return t.jsx(s,{"data-slot":"popover",...o})}function g({...o}){return t.jsx(i,{"data-slot":"popover-trigger",...o})}function v({className:o,align:e="center",sideOffset:a=4,...r}){return t.jsx(d,{children:t.jsx(p,{"data-slot":"popover-content",align:e,sideOffset:a,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",o),...r})})}export{c as P,g as a,v as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{
|
|
1
|
+
import{j as e}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{an as n,y as s,a4 as i,am as d}from"./index-DC1UyCW2.js";import{a3 as c,a4 as u,a5 as m,a6 as p,a7 as x,a8 as f,a9 as g,aa as h,ab as v,ac as b,ad as j,ae as w,af as y,ag as S,ah as z}from"./radix-C5ZmWuuL.js";function D({...t}){return e.jsx(c,{"data-slot":"select",...t})}function T({...t}){return e.jsx(S,{"data-slot":"select-group",...t})}function U({...t}){return e.jsx(p,{"data-slot":"select-value",...t})}function V({className:t,size:a="default",children:r,...o}){return e.jsxs(u,{"data-slot":"select-trigger","data-size":a,className:s("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...o,children:[r,e.jsx(m,{asChild:!0,children:e.jsx(n,{className:"size-4 opacity-50"})})]})}function G({className:t,children:a,position:r="item-aligned",align:o="center",...l}){return e.jsx(x,{children:e.jsxs(f,{"data-slot":"select-content",className:s("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:o,...l,children:[e.jsx(N,{}),e.jsx(g,{className:s("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(_,{})]})})}function L({className:t,...a}){return e.jsx(z,{"data-slot":"select-label",className:s("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function R({className:t,children:a,...r}){return e.jsxs(h,{"data-slot":"select-item",className:s("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(v,{children:e.jsx(i,{className:"size-4"})})}),e.jsx(b,{children:a})]})}function E({className:t,...a}){return e.jsx(y,{"data-slot":"select-separator",className:s("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function N({className:t,...a}){return e.jsx(j,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(d,{className:"size-4"})})}function _({className:t,...a}){return e.jsx(w,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(n,{className:"size-4"})})}export{D as S,V as a,U as b,G as c,R as d,E as e,T as f,L as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as c}from"./tanstack-Bs3zYPPV.js";import{r as k}from"./react-vendor-C2CvUxFh.js";import{y as P}from"./index-Ce5pmRMj.js";class J{diff(e,t,r={}){let n;typeof r=="function"?(n=r,r={}):"callback"in r&&(n=r.callback);const i=this.castInput(e,r),o=this.castInput(t,r),l=this.removeEmpty(this.tokenize(i,r)),u=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(l,u,r,n)}diffWithOptionsObj(e,t,r,n){var i;const o=d=>{if(d=this.postProcess(d,r),n){setTimeout(function(){n(d)},0);return}else return d},l=t.length,u=e.length;let f=1,a=l+u;r.maxEditLength!=null&&(a=Math.min(a,r.maxEditLength));const p=(i=r.timeout)!==null&&i!==void 0?i:1/0,v=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(h[0],t,e,0,r);if(h[0].oldPos+1>=u&&g+1>=l)return o(this.buildValues(h[0].lastComponent,t,e));let N=-1/0,A=1/0;const I=()=>{for(let d=Math.max(N,-f);d<=Math.min(A,f);d+=2){let x;const b=h[d-1],j=h[d+1];b&&(h[d-1]=void 0);let $=!1;if(j){const T=j.oldPos-d;$=j&&0<=T&&T<l}const L=b&&b.oldPos+1<u;if(!$&&!L){h[d]=void 0;continue}if(!L||$&&b.oldPos<j.oldPos?x=this.addToPath(j,!0,!1,0,r):x=this.addToPath(b,!1,!0,1,r),g=this.extractCommon(x,t,e,d,r),x.oldPos+1>=u&&g+1>=l)return o(this.buildValues(x.lastComponent,t,e))||!0;h[d]=x,x.oldPos+1>=u&&(A=Math.min(A,d-1)),g+1>=l&&(N=Math.max(N,d+1))}f++};if(n)(function d(){setTimeout(function(){if(f>a||Date.now()>v)return n(void 0);I()||d()},0)})();else for(;f<=a&&Date.now()<=v;){const d=I();if(d)return d}}addToPath(e,t,r,n,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===t&&o.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:o.count+1,added:t,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:r,previousComponent:o}}}extractCommon(e,t,r,n,i){const o=t.length,l=r.length;let u=e.oldPos,f=u-n,a=0;for(;f+1<o&&u+1<l&&this.equals(r[u+1],t[f+1],i);)f++,u++,a++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return a&&!i.oneChangePerToken&&(e.lastComponent={count:a,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,f}equals(e,t,r){return r.comparator?r.comparator(e,t):e===t||!!r.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,r){const n=[];let i;for(;e;)n.push(e),i=e.previousComponent,delete e.previousComponent,e=i;n.reverse();const o=n.length;let l=0,u=0,f=0;for(;l<o;l++){const a=n[l];if(a.removed)a.value=this.join(r.slice(f,f+a.count)),f+=a.count;else{if(!a.added&&this.useLongestToken){let p=t.slice(u,u+a.count);p=p.map(function(v,h){const g=r[f+h];return g.length>v.length?g:v}),a.value=this.join(p)}else a.value=this.join(t.slice(u,u+a.count));u+=a.count,a.added||(f+=a.count)}}return n}}function M(s,e){let t;for(t=0;t<s.length&&t<e.length;t++)if(s[t]!=e[t])return s.slice(0,t);return s.slice(0,t)}function O(s,e){let t;if(!s||!e||s[s.length-1]!=e[e.length-1])return"";for(t=0;t<s.length&&t<e.length;t++)if(s[s.length-(t+1)]!=e[e.length-(t+1)])return s.slice(-t);return s.slice(-t)}function E(s,e,t){if(s.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(s)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return t+s.slice(e.length)}function W(s,e,t){if(!e)return s+t;if(s.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(s)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return s.slice(0,-e.length)+t}function C(s,e){return E(s,e,"")}function S(s,e){return W(s,e,"")}function F(s,e){return e.slice(0,B(s,e))}function B(s,e){let t=0;s.length>e.length&&(t=s.length-e.length);let r=e.length;s.length<e.length&&(r=s.length);const n=Array(r);let i=0;n[0]=0;for(let o=1;o<r;o++){for(e[o]==e[i]?n[o]=n[i]:n[o]=i;i>0&&e[o]!=e[i];)i=n[i];e[o]==e[i]&&i++}i=0;for(let o=t;o<s.length;o++){for(;i>0&&s[o]!=e[i];)i=n[i];s[o]==e[i]&&i++}return i}function w(s){let e;for(e=s.length-1;e>=0&&s[e].match(/\s/);e--);return s.substring(e+1)}function m(s){const e=s.match(/^\s*/);return e?e[0]:""}const z="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",H=new RegExp(`[${z}]+|\\s+|[^${z}]`,"ug");class U extends J{equals(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let r;if(t.intlSegmenter){const o=t.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=[];for(const l of Array.from(o.segment(e))){const u=l.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(u)?r[r.length-1]+=u:r.push(u)}}else r=e.match(H)||[];const n=[];let i=null;return r.forEach(o=>{/\s/.test(o)?i==null?n.push(o):n.push(n.pop()+o):i!=null&&/\s/.test(i)?n[n.length-1]==i?n.push(n.pop()+o):n.push(i+o):n.push(o),i=o}),n}join(e){return e.map((t,r)=>r==0?t:t.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let r=null,n=null,i=null;return e.forEach(o=>{o.added?n=o:o.removed?i=o:((n||i)&&R(r,i,n,o),r=o,n=null,i=null)}),(n||i)&&R(r,i,n,null),e}}const Y=new U;function Z(s,e,t){return Y.diff(s,e,t)}function R(s,e,t,r){if(e&&t){const n=m(e.value),i=w(e.value),o=m(t.value),l=w(t.value);if(s){const u=M(n,o);s.value=W(s.value,o,u),e.value=C(e.value,u),t.value=C(t.value,u)}if(r){const u=O(i,l);r.value=E(r.value,l,u),e.value=S(e.value,u),t.value=S(t.value,u)}}else if(t){if(s){const n=m(t.value);t.value=t.value.substring(n.length)}if(r){const n=m(r.value);r.value=r.value.substring(n.length)}}else if(s&&r){const n=m(r.value),i=m(e.value),o=w(e.value),l=M(n,i);e.value=C(e.value,l);const u=O(C(n,l),o);e.value=S(e.value,u),r.value=E(r.value,n,u),s.value=W(s.value,n,n.slice(0,n.length-u.length))}else if(r){const n=m(r.value),i=w(e.value),o=F(i,n);e.value=S(e.value,o)}else if(s){const n=w(s.value),i=m(e.value),o=F(n,i);e.value=C(e.value,o)}}class G extends J{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const Q=new G;function X(s,e,t){return Q.diff(s,e,t)}const K=5;function pe({left:s,right:e,leftLabel:t="Before",rightLabel:r="After"}){const n=k.useMemo(()=>se(s,e),[s,e]),i=k.useMemo(()=>re(n),[n]);return n.every(o=>o.type==="unchanged")?c.jsxs("p",{className:"text-sm text-muted-foreground italic py-4",children:["No changes between ",t," and ",r," versions."]}):c.jsxs("div",{className:"font-mono text-xs leading-relaxed border rounded-md overflow-hidden",children:[c.jsxs("div",{className:"grid grid-cols-2 border-b bg-muted/50 text-muted-foreground text-[10px] font-semibold",children:[c.jsx("div",{className:"px-3 py-1.5",children:t}),c.jsx("div",{className:"px-3 py-1.5 border-l",children:r})]}),c.jsx("div",{children:i.map((o,l)=>c.jsx(ee,{segment:o},l))})]})}function ee({segment:s}){const[e,t]=k.useState(!1);return s.type==="collapsed"&&!e?c.jsxs("button",{onClick:()=>t(!0),className:"w-full grid grid-cols-2 text-[10px] text-muted-foreground bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",children:[c.jsxs("div",{className:"px-3 py-1 text-center border-b",children:["... ",s.count," unchanged lines ..."]}),c.jsxs("div",{className:"px-3 py-1 text-center border-l border-b",children:["... ",s.count," unchanged lines ..."]})]}):s.type==="collapsed"?null:c.jsx(c.Fragment,{children:s.rows.map((r,n)=>c.jsx(te,{row:r},n))})}function _({oldText:s,newText:e,side:t}){const r=Z(s,e);return c.jsx(c.Fragment,{children:r.map((n,i)=>n.added?t==="right"?c.jsx("span",{className:"font-bold bg-green-200 dark:bg-green-800/50",children:n.value},i):null:n.removed?t==="left"?c.jsx("span",{className:"line-through bg-red-200 dark:bg-red-800/50",children:n.value},i):null:c.jsx("span",{children:n.value},i))})}function te({row:s}){const e=s.type==="modified";return c.jsxs("div",{className:"grid grid-cols-2 border-b last:border-b-0",children:[c.jsx("div",{className:P("px-3 py-0.5 min-h-[1.5em] min-w-0 break-all",(s.type==="removed"||e)&&"bg-red-50 dark:bg-red-950/30"),style:s.left?{paddingLeft:`calc(0.75rem + ${s.left.indent*1}rem)`}:void 0,children:c.jsx("span",{className:P(s.left?.type==="label"&&"text-muted-foreground font-semibold",s.left?.type==="heading"&&"font-bold"),children:e&&s.left&&s.right?c.jsx(_,{oldText:s.left.text,newText:s.right.text,side:"left"}):s.left?.text??""})}),c.jsx("div",{className:P("px-3 py-0.5 min-h-[1.5em] min-w-0 break-all border-l",(s.type==="added"||e)&&"bg-green-50 dark:bg-green-950/30"),style:s.right?{paddingLeft:`calc(0.75rem + ${s.right.indent*1}rem)`}:void 0,children:c.jsx("span",{className:P(s.right?.type==="label"&&"text-muted-foreground font-semibold",s.right?.type==="heading"&&"font-bold"),children:e&&s.left&&s.right?c.jsx(_,{oldText:s.left.text,newText:s.right.text,side:"right"}):s.right?.text??""})})]})}function ne(s,e){const t=[],r=new Set;for(const n of s){if(!n.text){t.push({type:"removed",left:n});continue}let i=-1,o=-1;for(let l=0;l<e.length;l++){if(r.has(l)||!e[l].text)continue;let u=1;e[l].indent===n.indent&&u++,e[l].type===n.type&&u++,u>o&&(o=u,i=l)}i>=0?(r.add(i),t.push({type:"modified",left:n,right:e[i]})):t.push({type:"removed",left:n})}for(let n=0;n<e.length;n++)r.has(n)||t.push({type:"added",right:e[n]});return t}function se(s,e){const t=X(s,e,{comparator:(n,i)=>n.text===i.text&&n.indent===i.indent&&n.type===i.type}),r=[];for(let n=0;n<t.length;n++){const i=t[n],o=t[n+1];if(i.removed&&o?.added){const l=i.value,u=o.value,f=ne(l,u);r.push(...f),n++}else if(i.added)for(const l of i.value)r.push({type:"added",right:l});else if(i.removed)for(const l of i.value)r.push({type:"removed",left:l});else for(const l of i.value)r.push({type:"unchanged",left:l,right:l})}return r}function re(s){const e=[];let t=[];function r(){if(t.length!==0){if(t.length>K){const o=t.slice(0,2),l=t.slice(-2),u=t.length-4;e.push({type:"rows",rows:o}),u>0&&e.push({type:"collapsed",count:u}),e.push({type:"rows",rows:l})}else e.push({type:"rows",rows:t});t=[]}}let n=[];function i(){n.length!==0&&(e.push({type:"rows",rows:n}),n=[])}for(const o of s)o.type==="unchanged"?(i(),t.push(o)):(r(),n.push(o));return i(),r(),e}function q(s,e){if(e==null||e==="")return[{text:"(empty)",indent:0,type:"value"}];switch(s.type){case"text":case"url":case"email":case"number":case"select":return[{text:String(e),indent:0,type:"value"}];case"date":case"datetime":return[{text:ie(e,s.type),indent:0,type:"value"}];case"textarea":return String(e).split(`
|
|
1
|
+
import{j as c}from"./tanstack-Bs3zYPPV.js";import{r as k}from"./react-vendor-C2CvUxFh.js";import{y as P}from"./index-DC1UyCW2.js";class J{diff(e,t,r={}){let n;typeof r=="function"?(n=r,r={}):"callback"in r&&(n=r.callback);const i=this.castInput(e,r),o=this.castInput(t,r),l=this.removeEmpty(this.tokenize(i,r)),u=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(l,u,r,n)}diffWithOptionsObj(e,t,r,n){var i;const o=d=>{if(d=this.postProcess(d,r),n){setTimeout(function(){n(d)},0);return}else return d},l=t.length,u=e.length;let f=1,a=l+u;r.maxEditLength!=null&&(a=Math.min(a,r.maxEditLength));const p=(i=r.timeout)!==null&&i!==void 0?i:1/0,v=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(h[0],t,e,0,r);if(h[0].oldPos+1>=u&&g+1>=l)return o(this.buildValues(h[0].lastComponent,t,e));let N=-1/0,A=1/0;const I=()=>{for(let d=Math.max(N,-f);d<=Math.min(A,f);d+=2){let x;const b=h[d-1],j=h[d+1];b&&(h[d-1]=void 0);let $=!1;if(j){const T=j.oldPos-d;$=j&&0<=T&&T<l}const L=b&&b.oldPos+1<u;if(!$&&!L){h[d]=void 0;continue}if(!L||$&&b.oldPos<j.oldPos?x=this.addToPath(j,!0,!1,0,r):x=this.addToPath(b,!1,!0,1,r),g=this.extractCommon(x,t,e,d,r),x.oldPos+1>=u&&g+1>=l)return o(this.buildValues(x.lastComponent,t,e))||!0;h[d]=x,x.oldPos+1>=u&&(A=Math.min(A,d-1)),g+1>=l&&(N=Math.max(N,d+1))}f++};if(n)(function d(){setTimeout(function(){if(f>a||Date.now()>v)return n(void 0);I()||d()},0)})();else for(;f<=a&&Date.now()<=v;){const d=I();if(d)return d}}addToPath(e,t,r,n,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===t&&o.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:o.count+1,added:t,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:r,previousComponent:o}}}extractCommon(e,t,r,n,i){const o=t.length,l=r.length;let u=e.oldPos,f=u-n,a=0;for(;f+1<o&&u+1<l&&this.equals(r[u+1],t[f+1],i);)f++,u++,a++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return a&&!i.oneChangePerToken&&(e.lastComponent={count:a,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,f}equals(e,t,r){return r.comparator?r.comparator(e,t):e===t||!!r.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,r){const n=[];let i;for(;e;)n.push(e),i=e.previousComponent,delete e.previousComponent,e=i;n.reverse();const o=n.length;let l=0,u=0,f=0;for(;l<o;l++){const a=n[l];if(a.removed)a.value=this.join(r.slice(f,f+a.count)),f+=a.count;else{if(!a.added&&this.useLongestToken){let p=t.slice(u,u+a.count);p=p.map(function(v,h){const g=r[f+h];return g.length>v.length?g:v}),a.value=this.join(p)}else a.value=this.join(t.slice(u,u+a.count));u+=a.count,a.added||(f+=a.count)}}return n}}function M(s,e){let t;for(t=0;t<s.length&&t<e.length;t++)if(s[t]!=e[t])return s.slice(0,t);return s.slice(0,t)}function O(s,e){let t;if(!s||!e||s[s.length-1]!=e[e.length-1])return"";for(t=0;t<s.length&&t<e.length;t++)if(s[s.length-(t+1)]!=e[e.length-(t+1)])return s.slice(-t);return s.slice(-t)}function E(s,e,t){if(s.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(s)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return t+s.slice(e.length)}function W(s,e,t){if(!e)return s+t;if(s.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(s)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return s.slice(0,-e.length)+t}function C(s,e){return E(s,e,"")}function S(s,e){return W(s,e,"")}function F(s,e){return e.slice(0,B(s,e))}function B(s,e){let t=0;s.length>e.length&&(t=s.length-e.length);let r=e.length;s.length<e.length&&(r=s.length);const n=Array(r);let i=0;n[0]=0;for(let o=1;o<r;o++){for(e[o]==e[i]?n[o]=n[i]:n[o]=i;i>0&&e[o]!=e[i];)i=n[i];e[o]==e[i]&&i++}i=0;for(let o=t;o<s.length;o++){for(;i>0&&s[o]!=e[i];)i=n[i];s[o]==e[i]&&i++}return i}function w(s){let e;for(e=s.length-1;e>=0&&s[e].match(/\s/);e--);return s.substring(e+1)}function m(s){const e=s.match(/^\s*/);return e?e[0]:""}const z="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",H=new RegExp(`[${z}]+|\\s+|[^${z}]`,"ug");class U extends J{equals(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let r;if(t.intlSegmenter){const o=t.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=[];for(const l of Array.from(o.segment(e))){const u=l.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(u)?r[r.length-1]+=u:r.push(u)}}else r=e.match(H)||[];const n=[];let i=null;return r.forEach(o=>{/\s/.test(o)?i==null?n.push(o):n.push(n.pop()+o):i!=null&&/\s/.test(i)?n[n.length-1]==i?n.push(n.pop()+o):n.push(i+o):n.push(o),i=o}),n}join(e){return e.map((t,r)=>r==0?t:t.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let r=null,n=null,i=null;return e.forEach(o=>{o.added?n=o:o.removed?i=o:((n||i)&&R(r,i,n,o),r=o,n=null,i=null)}),(n||i)&&R(r,i,n,null),e}}const Y=new U;function Z(s,e,t){return Y.diff(s,e,t)}function R(s,e,t,r){if(e&&t){const n=m(e.value),i=w(e.value),o=m(t.value),l=w(t.value);if(s){const u=M(n,o);s.value=W(s.value,o,u),e.value=C(e.value,u),t.value=C(t.value,u)}if(r){const u=O(i,l);r.value=E(r.value,l,u),e.value=S(e.value,u),t.value=S(t.value,u)}}else if(t){if(s){const n=m(t.value);t.value=t.value.substring(n.length)}if(r){const n=m(r.value);r.value=r.value.substring(n.length)}}else if(s&&r){const n=m(r.value),i=m(e.value),o=w(e.value),l=M(n,i);e.value=C(e.value,l);const u=O(C(n,l),o);e.value=S(e.value,u),r.value=E(r.value,n,u),s.value=W(s.value,n,n.slice(0,n.length-u.length))}else if(r){const n=m(r.value),i=w(e.value),o=F(i,n);e.value=S(e.value,o)}else if(s){const n=w(s.value),i=m(e.value),o=F(n,i);e.value=C(e.value,o)}}class G extends J{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const Q=new G;function X(s,e,t){return Q.diff(s,e,t)}const K=5;function pe({left:s,right:e,leftLabel:t="Before",rightLabel:r="After"}){const n=k.useMemo(()=>se(s,e),[s,e]),i=k.useMemo(()=>re(n),[n]);return n.every(o=>o.type==="unchanged")?c.jsxs("p",{className:"text-sm text-muted-foreground italic py-4",children:["No changes between ",t," and ",r," versions."]}):c.jsxs("div",{className:"font-mono text-xs leading-relaxed border rounded-md overflow-hidden",children:[c.jsxs("div",{className:"grid grid-cols-2 border-b bg-muted/50 text-muted-foreground text-[10px] font-semibold",children:[c.jsx("div",{className:"px-3 py-1.5",children:t}),c.jsx("div",{className:"px-3 py-1.5 border-l",children:r})]}),c.jsx("div",{children:i.map((o,l)=>c.jsx(ee,{segment:o},l))})]})}function ee({segment:s}){const[e,t]=k.useState(!1);return s.type==="collapsed"&&!e?c.jsxs("button",{onClick:()=>t(!0),className:"w-full grid grid-cols-2 text-[10px] text-muted-foreground bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",children:[c.jsxs("div",{className:"px-3 py-1 text-center border-b",children:["... ",s.count," unchanged lines ..."]}),c.jsxs("div",{className:"px-3 py-1 text-center border-l border-b",children:["... ",s.count," unchanged lines ..."]})]}):s.type==="collapsed"?null:c.jsx(c.Fragment,{children:s.rows.map((r,n)=>c.jsx(te,{row:r},n))})}function _({oldText:s,newText:e,side:t}){const r=Z(s,e);return c.jsx(c.Fragment,{children:r.map((n,i)=>n.added?t==="right"?c.jsx("span",{className:"font-bold bg-green-200 dark:bg-green-800/50",children:n.value},i):null:n.removed?t==="left"?c.jsx("span",{className:"line-through bg-red-200 dark:bg-red-800/50",children:n.value},i):null:c.jsx("span",{children:n.value},i))})}function te({row:s}){const e=s.type==="modified";return c.jsxs("div",{className:"grid grid-cols-2 border-b last:border-b-0",children:[c.jsx("div",{className:P("px-3 py-0.5 min-h-[1.5em] min-w-0 break-all",(s.type==="removed"||e)&&"bg-red-50 dark:bg-red-950/30"),style:s.left?{paddingLeft:`calc(0.75rem + ${s.left.indent*1}rem)`}:void 0,children:c.jsx("span",{className:P(s.left?.type==="label"&&"text-muted-foreground font-semibold",s.left?.type==="heading"&&"font-bold"),children:e&&s.left&&s.right?c.jsx(_,{oldText:s.left.text,newText:s.right.text,side:"left"}):s.left?.text??""})}),c.jsx("div",{className:P("px-3 py-0.5 min-h-[1.5em] min-w-0 break-all border-l",(s.type==="added"||e)&&"bg-green-50 dark:bg-green-950/30"),style:s.right?{paddingLeft:`calc(0.75rem + ${s.right.indent*1}rem)`}:void 0,children:c.jsx("span",{className:P(s.right?.type==="label"&&"text-muted-foreground font-semibold",s.right?.type==="heading"&&"font-bold"),children:e&&s.left&&s.right?c.jsx(_,{oldText:s.left.text,newText:s.right.text,side:"right"}):s.right?.text??""})})]})}function ne(s,e){const t=[],r=new Set;for(const n of s){if(!n.text){t.push({type:"removed",left:n});continue}let i=-1,o=-1;for(let l=0;l<e.length;l++){if(r.has(l)||!e[l].text)continue;let u=1;e[l].indent===n.indent&&u++,e[l].type===n.type&&u++,u>o&&(o=u,i=l)}i>=0?(r.add(i),t.push({type:"modified",left:n,right:e[i]})):t.push({type:"removed",left:n})}for(let n=0;n<e.length;n++)r.has(n)||t.push({type:"added",right:e[n]});return t}function se(s,e){const t=X(s,e,{comparator:(n,i)=>n.text===i.text&&n.indent===i.indent&&n.type===i.type}),r=[];for(let n=0;n<t.length;n++){const i=t[n],o=t[n+1];if(i.removed&&o?.added){const l=i.value,u=o.value,f=ne(l,u);r.push(...f),n++}else if(i.added)for(const l of i.value)r.push({type:"added",right:l});else if(i.removed)for(const l of i.value)r.push({type:"removed",left:l});else for(const l of i.value)r.push({type:"unchanged",left:l,right:l})}return r}function re(s){const e=[];let t=[];function r(){if(t.length!==0){if(t.length>K){const o=t.slice(0,2),l=t.slice(-2),u=t.length-4;e.push({type:"rows",rows:o}),u>0&&e.push({type:"collapsed",count:u}),e.push({type:"rows",rows:l})}else e.push({type:"rows",rows:t});t=[]}}let n=[];function i(){n.length!==0&&(e.push({type:"rows",rows:n}),n=[])}for(const o of s)o.type==="unchanged"?(i(),t.push(o)):(r(),n.push(o));return i(),r(),e}function q(s,e){if(e==null||e==="")return[{text:"(empty)",indent:0,type:"value"}];switch(s.type){case"text":case"url":case"email":case"number":case"select":return[{text:String(e),indent:0,type:"value"}];case"date":case"datetime":return[{text:ie(e,s.type),indent:0,type:"value"}];case"textarea":return String(e).split(`
|
|
2
2
|
`).map(t=>({text:t,indent:0,type:"value"}));case"boolean":return[{text:e?"Yes":"No",indent:0,type:"value"}];case"media":return oe(e);case"blocks":return D(e);case"array":return ae(s,e);default:return[{text:String(e),indent:0,type:"value"}]}}function ie(s,e){let t=null;if(typeof s=="number")t=s;else if(typeof s=="string"){const n=/^-?\d+$/.test(s)?Number(s):Date.parse(s);Number.isNaN(n)||(t=n)}if(t===null)return String(s);const r=new Date(t);return Number.isNaN(r.getTime())?String(s):e==="datetime"?r.toISOString():r.toISOString().slice(0,10)}function oe(s){return Array.isArray(s)?s.length===0?[{text:"(empty)",indent:0,type:"value"}]:s.flatMap(e=>V(e).map(t=>({...t,indent:t.indent,type:"list-item"}))):V(s)}function V(s){if(s==null||s==="")return[{text:"(empty)",indent:0,type:"value"}];if(typeof s=="string")return[{text:`[Media: ${s}]`,indent:0,type:"value"}];if(typeof s!="object")return[{text:`[Media: ${String(s)}]`,indent:0,type:"value"}];const e=s,t=(typeof e.id=="string"?e.id:void 0)??(typeof e.mediaId=="string"?e.mediaId:void 0)??"",r=typeof e.filename=="string"?e.filename:"",n=typeof e.alt=="string"?e.alt:"",i=typeof e.caption=="string"?e.caption:"",o=r||t||"(unknown)",l=[];return n&&l.push(`alt: "${n}"`),i&&l.push(`caption: "${i}"`),[{text:l.length>0?`[Media: ${o} — ${l.join(", ")}]`:`[Media: ${o}]`,indent:0,type:"value"}]}function he(s,e,t,r){const n=[];t&&(t.title!==void 0&&(n.push({text:"Title",indent:0,type:"label"}),n.push({text:t.title||"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})),t.slug!==void 0&&(n.push({text:"Slug",indent:0,type:"label"}),n.push({text:t.slug||"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})),t.snippet!==void 0&&(n.push({text:"Snippet",indent:0,type:"label"}),n.push({text:t.snippet||"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})),t.tags!==void 0&&(n.push({text:"Tags",indent:0,type:"label"}),n.push({text:t.tags.length>0?t.tags.join(", "):"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})));for(const i of s){n.push({text:i.label,indent:0,type:"label"});const o=q(i,e[i.name]);n.push(...o),n.push({text:"",indent:0,type:"empty"})}if(r&&r.defs.length>0)for(const i of r.defs){n.push({text:i.label,indent:0,type:"label"});const o=r.values[i.name]??[];o.length===0?n.push({text:"(empty)",indent:0,type:"value"}):n.push({text:o.map(l=>l.title).join(", "),indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})}return n.length>0&&n[n.length-1].type==="empty"&&n.pop(),n}const le=[["bold","**","**"],["italic","_","_"],["underline","__","__"],["strike","~~","~~"],["code","`","`"]];function ue(s,e){if(!e||!s)return s;let t=s;for(const[r,n,i]of le)e[r]===!0&&(t=n+t+i);return t}function y(s){return Array.isArray(s)?s.map(e=>typeof e.text=="string"?ue(e.text,e.styles):e.type==="link"&&Array.isArray(e.content)?`[${y(e.content)}](${e.href??""})`:"").join(""):""}function D(s,e=0){if(!Array.isArray(s))return[{text:"(empty)",indent:0,type:"value"}];if(s.length===0)return[{text:"(empty)",indent:0,type:"value"}];const t=[];let r=0;for(const n of s){if(typeof n!="object"||n===null)continue;const i=n,o=i.type??"";switch(o!=="numberedListItem"&&(r=0),o){case"paragraph":{const l=y(i.content);t.push({text:l||"",indent:e,type:"value"});break}case"heading":{const l=i.props?.level??1,u="#".repeat(Math.min(l,6))+" ",f=y(i.content);t.push({text:u+f,indent:e,type:"heading"});break}case"bulletListItem":{const l=y(i.content);t.push({text:`- ${l}`,indent:e,type:"list-item"});break}case"numberedListItem":{r++;const l=y(i.content);t.push({text:`${r}. ${l}`,indent:e,type:"list-item"});break}case"image":case"HeadroomImage":{const l=i.props?.alt,u=i.props?.mediaId,f=l||u||"image";t.push({text:`[Image: ${f}]`,indent:e,type:"value"});break}case"quote":{const l=y(i.content);t.push({text:`> ${l}`,indent:e,type:"value"});break}default:{const l=y(i.content),u=i.props&&typeof i.props=="object"?i.props:{},f=Object.entries(u).filter(([a,p])=>!(a==="textAlignment"||a==="level"||(a==="backgroundColor"||a==="textColor")&&p==="default"||p==null||p===""));if(f.length>0){t.push({text:`[${o}]`,indent:e,type:"label"}),l&&t.push({text:l,indent:e+1,type:"value"});for(const[a,p]of f)Array.isArray(p)?(t.push({text:`${a}:`,indent:e+1,type:"label"}),t.push(...D(p,e+2))):t.push({text:`${a}: ${String(p)}`,indent:e+1,type:"value"})}else l?t.push({text:l,indent:e,type:"value"}):t.push({text:`[${o}]`,indent:e,type:"value"});break}}Array.isArray(i.children)&&i.children.length>0&&t.push(...D(i.children,e+1))}return t}function ae(s,e){if(!Array.isArray(e)||e.length===0)return[{text:"(empty)",indent:0,type:"value"}];const r=s.options?.itemFields??[],n=[];for(let i=0;i<e.length;i++){n.push({text:`${i+1}.`,indent:0,type:"list-item"});const o=e[i];if(r.length>0)for(const l of r){n.push({text:l.label+":",indent:1,type:"label"});const u=q(l,o[l.name]);n.push(...u.map(f=>({...f,indent:f.indent+1})))}else n.push({text:JSON.stringify(o,null,2),indent:1,type:"value"})}return n}export{pe as T,X as d,he as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as l}from"./index-
|
|
1
|
+
import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as l}from"./index-DC1UyCW2.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function d({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function c({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,d as a,b,i as c,c as d,m as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as t}from"./index-
|
|
1
|
+
import{j as i}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as t}from"./index-DC1UyCW2.js";function s({className:r,...e}){return i.jsx("textarea",{"data-slot":"textarea",className:t("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),...e})}export{s as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t}from"./react-vendor-C2CvUxFh.js";import{b4 as n}from"./index-DC1UyCW2.js";function c(o){const r=[...new Set(o)],{data:e}=n(r);return{resolve:t.useCallback(s=>e?.users[s]?.email??s,[e]),isLoaded:!!e}}export{c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,a,b as c}from"./tanstack-Bs3zYPPV.js";import{e as u}from"./index-DC1UyCW2.js";function y(e,t,i,n){const s=u(),o=new URLSearchParams({collection:t});return n&&o.set("afterId",n),i?.q&&o.set("q",i.q),i?.search&&o.set("search",i.search),i?.tag&&o.set("tag",i.tag),i?.status&&o.set("status",i.status),i?.sort&&o.set("sort",i.sort),i?.relatedTo&&o.set("relatedTo",i.relatedTo),i?.relField&&o.set("relField",i.relField),i?.limit&&o.set("limit",String(i.limit)),r({queryKey:["sites",e,"content",t,i??{},n??""],queryFn:()=>s.apiFetch(`/v1/admin/sites/${e}/content?${o.toString()}`),enabled:!!e&&!!t})}function v(e,t,i){const n=u(),s=new URLSearchParams;t&&s.set("afterId",t),s.set("limit",String(i));const o=s.toString();return r({queryKey:["sites",e,"content","__all__",t??"",i??""],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content${o?`?${o}`:""}`),enabled:!!e})}function m(e,t){const i=u();return r({queryKey:["sites",e,"content-detail",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}`),enabled:!!e&&!!t})}function q(e){const t=u(),i=a();return c({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/content`,{method:"POST",body:JSON.stringify({collection:n.collection,params:{title:n.title,slug:n.slug,body:{}}})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"content"]})})}function p(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/draft`,{method:"PUT",body:JSON.stringify(s),timeoutMs:2e4}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function F(e,t,i){const n=u();return r({queryKey:["sites",e,"content-published",t],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/published`),enabled:!!e&&!!t&&i})}function S(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/publish`,{method:"POST",...s!=null?{body:JSON.stringify({publishDate:s})}:{}}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]}),n.invalidateQueries({queryKey:["sites",e,"content-published",t]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function $(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/unpublish`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]}),n.removeQueries({queryKey:["sites",e,"content-published",t]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function K(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}`,{method:"DELETE"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function b(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/publish-date`,{method:"PATCH",body:JSON.stringify({publishDate:s})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function f(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/schedule`,{method:"POST",body:JSON.stringify({scheduleAt:s})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function Q(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/unschedule`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function g(e){const t=u(),i=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>t.apiFetch(`/v1/admin/sites/${e}/content/${s}/publish`,{method:"POST"}))),onSettled:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function h(e){const t=u(),i=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>t.apiFetch(`/v1/admin/sites/${e}/content/${s}/unpublish`,{method:"POST"}))),onSettled:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function P(e){const t=u(),i=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>t.apiFetch(`/v1/admin/sites/${e}/content/${s}`,{method:"DELETE"}))),onSettled:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function O(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/discard`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function C(e,t,i){const n=u();return r({queryKey:["sites",e,"content-detail",t,"versions",i],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/versions/${i}`),enabled:!!e&&!!t&&!!i})}function T(e,t){const i=u();return r({queryKey:["sites",e,"content-detail",t,"versions"],queryFn:async()=>({items:(await i.apiFetch(`/v1/admin/sites/${e}/content/${t}/versions`)).versions??[]}),enabled:!!e&&!!t})}function U(e){const t=u(),i=a();return c({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/submissions/${n.collection}`,{method:"POST",body:JSON.stringify({fields:n.fields,...n.relationships&&Object.keys(n.relationships).length>0?{relationships:n.relationships}:{}})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"content"]})})}function D(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/submissions/${t}`,{method:"PUT",body:JSON.stringify({fields:s.fields,...s.relationships&&Object.keys(s.relationships).length>0?{relationships:s.relationships}:{}})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function J(e,t,i){const n=u();return r({queryKey:["sites",e,"content-references",t],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/references`),enabled:!!e&&!!t&&i})}export{g as a,h as b,P as c,y as d,q as e,p as f,F as g,C as h,T as i,m as j,S as k,$ as l,K as m,b as n,f as o,Q as p,O as q,J as r,U as s,D as t,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./react-vendor-C2CvUxFh.js";import{u as m}from"./tanstack-Bs3zYPPV.js";import{e as f}from"./index-
|
|
1
|
+
import{r as o}from"./react-vendor-C2CvUxFh.js";import{u as m}from"./tanstack-Bs3zYPPV.js";import{e as f}from"./index-DC1UyCW2.js";function h(t,n){const[e,s]=o.useState(t);return o.useEffect(()=>{const i=setTimeout(()=>s(t),n);return()=>clearTimeout(i)},[t,n]),e}function b(t,n,e,s){const i=f(),u=e?.length===1?e[0]:void 0,r=new URLSearchParams;return n?(r.set("q",n),r.set("search","full")):r.set("limit","5"),u&&r.set("collection",u),s&&r.set("status",s),m({queryKey:["sites",t,"content-search",n,e??[],s??""],queryFn:async()=>{const a=await i.apiFetch(`/v1/admin/sites/${t}/content?${r.toString()}`);return e&&e.length>1?{...a,items:a.items.filter(c=>e.includes(c.collection))}:a},enabled:!!t,staleTime:3e4})}export{b as a,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./react-vendor-C2CvUxFh.js";import{
|
|
1
|
+
import{r as o}from"./react-vendor-C2CvUxFh.js";import{bh as s,aH as c}from"./index-DC1UyCW2.js";function f(e){const r=s(),i=c(),n=o.useRef("");o.useEffect(()=>{if(!r)return;const t=`${e.title}|${e.showBack??""}|${e.backTo??""}|${e.badge?.label??""}|${e.badge?.variant??""}|${e.subtitle??""}`;t!==n.current&&(n.current=t,r.setTitleBar(e))}),o.useEffect(()=>{if(e.title){const t=i?.site?.name||i?.site?.host;document.title=t?`${e.title} | ${t}`:e.title}return()=>{document.title="Headroom"}},[e.title,i?.site?.name,i?.site?.host])}export{f as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as c,a as r,b as a}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-
|
|
1
|
+
import{u as c,a as r,b as a}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-DC1UyCW2.js";function d(e,t){const s=n(),i=new URLSearchParams;t?.cursor&&i.set("cursor",t.cursor),t?.tag&&i.set("tag",t.tag),i.set("limit",String(t.limit));const u=i.toString();return c({queryKey:["sites",e,"site-users",u],queryFn:()=>s.apiFetch(`/v1/admin/sites/${e}/site-users${u?`?${u}`:""}`),enabled:!!e})}function y(e,t){const s=n();return c({queryKey:["sites",e,"site-users",t],queryFn:()=>s.apiFetch(`/v1/admin/sites/${e}/site-users/${t}`),enabled:!!e&&!!t})}function l(e){const t=n(),s=r();return a({mutationFn:i=>t.apiFetch(`/v1/admin/sites/${e}/site-users`,{method:"POST",body:JSON.stringify(i)}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function S(e){const t=n(),s=r();return a({mutationFn:({userId:i,...u})=>t.apiFetch(`/v1/admin/sites/${e}/site-users/${i}`,{method:"PUT",body:JSON.stringify(u)}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function f(e){const t=n(),s=r();return a({mutationFn:({userId:i,email:u})=>t.apiFetch(`/v1/admin/sites/${e}/site-users/${i}/email`,{method:"PUT",body:JSON.stringify({email:u})}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function F(e){const t=n(),s=r();return a({mutationFn:i=>t.apiFetch(`/v1/admin/sites/${e}/site-users/${i}`,{method:"DELETE"}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function q(e){const t=n();return c({queryKey:["sites",e,"auth"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/auth`),enabled:!!e})}function v(e){const t=n(),s=r();return a({mutationFn:i=>t.apiFetch(`/v1/admin/sites/${e}/auth`,{method:"PUT",body:JSON.stringify(i)}),onSuccess:()=>{s.invalidateQueries({queryKey:["sites",e,"auth"]}),s.invalidateQueries({queryKey:["sites",e]})}})}function h(e){const t=n();return a({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/auth/test-email`,{method:"POST",body:JSON.stringify({email:s})})})}function $(e){const t=n();return a({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/auth/latest-otp?email=${encodeURIComponent(s)}`)})}export{v as a,h as b,$ as c,d,l as e,F as f,y as g,S as h,f as i,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as r,a as i,b as u}from"./tanstack-Bs3zYPPV.js";import{e as a}from"./index-
|
|
1
|
+
import{u as r,a as i,b as u}from"./tanstack-Bs3zYPPV.js";import{e as a}from"./index-DC1UyCW2.js";function m(e){const t=a();return r({queryKey:["sites",e,"tags"],queryFn:async()=>(await t.apiFetch(`/v1/admin/sites/${e}/tags`)).tags,enabled:!!e})}function y(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags`,{method:"POST",body:JSON.stringify({tag:n})}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}function d(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags/${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}export{y as a,d as b,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u,a,b as o}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-
|
|
1
|
+
import{u,a,b as o}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-DC1UyCW2.js";function y(e){const s=n();return u({queryKey:["sites",e,"webhooks"],queryFn:async()=>({items:(await s.apiFetch(`/v1/admin/sites/${e}/webhooks`)).webhooks}),enabled:!!e})}function d(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`),enabled:!!e&&!!s})}function m(e){const s=n(),t=a();return o({mutationFn:i=>s.apiFetch(`/v1/admin/sites/${e}/webhooks`,{method:"POST",body:JSON.stringify(i)}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function h(e,s){const t=n(),i=a();return o({mutationFn:c=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"PUT",body:JSON.stringify(c)}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"webhooks"]})}})}function l(e,s){const t=n(),i=a();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function k(e,s){const t=n();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/test`,{method:"POST"})})}function v(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s,"deliveries"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/deliveries`),enabled:!!e&&!!s})}export{d as a,m as b,h as c,l as d,k as e,v as f,y as u};
|
package/admin/index.html
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
<meta name="apple-mobile-web-app-title" content="Headroom" />
|
|
12
12
|
<link rel="apple-touch-icon" href="/icons/icon-180x180.png" />
|
|
13
13
|
<title>Headroom</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DC1UyCW2.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-C2CvUxFh.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/tanstack-Bs3zYPPV.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/radix-C5ZmWuuL.js">
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/assets/index-9sbb3-yI.css">
|
|
19
19
|
<link rel="manifest" href="/manifest.webmanifest"></head>
|
|
20
20
|
<body>
|
|
21
21
|
<script>
|
package/admin/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const a=s=>l(s,r),o={module:{uri:r},exports:u,require:a};e[r]=Promise.all(i.map(s=>o[s]||a(s))).then(s=>(n(...s),u))}}define(["./workbox-362996ec"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"index.html",revision:"d4148c6fc1b1b32a2e862818d9028c63"},{url:"favicon-32x32.png",revision:"66799e8a4d619473d6d5b9e3f99f1eb4"},{url:"favicon-16x16.png",revision:"2e31d947bf6f9868849eec8c65be4eac"},{url:"icons/maskable-icon-512x512.png",revision:"6d3b72c5991408caac100229c0c1b054"},{url:"icons/icon-512x512.png",revision:"7a67637e8a879e7cfa4f2f3e1737782a"},{url:"icons/icon-192x192.png",revision:"375b88bd595ea9a954684dd32e571606"},{url:"icons/icon-180x180.png",revision:"66fb27eca516778823daa4a4acfc4096"},{url:"assets/yjs-tXBm_srz.js",revision:null},{url:"assets/workbox-window.prod.es5-BIl4cyR9.js",revision:null},{url:"assets/useWebhooks-BkpJKNLN.js",revision:null},{url:"assets/useTags-DJlXwDyc.js",revision:null},{url:"assets/useSiteUsers-BFYAbJNT.js",revision:null},{url:"assets/usePageTitle-DOEFrHbj.js",revision:null},{url:"assets/useFilterParams-DYdEuWPE.js",revision:null},{url:"assets/useContentSearch-DbiA8aG-.js",revision:null},{url:"assets/useContent-Bp4f9qe0.js",revision:null},{url:"assets/useAdminResolver-CbDzGoDp.js",revision:null},{url:"assets/textarea-BILv1DQB.js",revision:null},{url:"assets/tanstack-Bs3zYPPV.js",revision:null},{url:"assets/table-Br-QgtTL.js",revision:null},{url:"assets/sortable.esm-qVEMoaTg.js",revision:null},{url:"assets/serializeToText-CjHhyvXp.js",revision:null},{url:"assets/select-waaVyoQ5.js",revision:null},{url:"assets/react-vendor-C2CvUxFh.js",revision:null},{url:"assets/radix-C5ZmWuuL.js",revision:null},{url:"assets/popover-BA-47SRI.js",revision:null},{url:"assets/native-48B9X9Wg.js",revision:null},{url:"assets/module-RjUF93sV.js",revision:null},{url:"assets/media-url-DdCoIedP.js",revision:null},{url:"assets/listCellValue-CBqXAwce.js",revision:null},{url:"assets/lib-BrI1UB_t.js",revision:null},{url:"assets/index-DC1UyCW2.js",revision:null},{url:"assets/index-9sbb3-yI.css",revision:null},{url:"assets/format-BRcflvs9.js",revision:null},{url:"assets/core.esm-DdQHdRkd.js",revision:null},{url:"assets/contentStatus-WXGfd7vX.js",revision:null},{url:"assets/command-DaTsImUa.js",revision:null},{url:"assets/collapsible-D3d29uJp.js",revision:null},{url:"assets/checkbox-BX8EcGFf.js",revision:null},{url:"assets/card-DlfsF8lU.js",revision:null},{url:"assets/WebhooksPage-g_a224a4.js",revision:null},{url:"assets/WebhookEditPage-DjZFxT72.js",revision:null},{url:"assets/UsersPage-C2iCy0UR.js",revision:null},{url:"assets/TagsPage-BONR6bSu.js",revision:null},{url:"assets/TagInput-C6tcB5Xw.js",revision:null},{url:"assets/SubmissionListPage-K665VwMp.js",revision:null},{url:"assets/SubmissionEditPage-B0Kq52fb.js",revision:null},{url:"assets/SubmissionDetailPage-BnVlsGb-.js",revision:null},{url:"assets/SitesPage-Cl8V3Hb7.js",revision:null},{url:"assets/SiteUsersPage-CrYugXpx.js",revision:null},{url:"assets/SiteUserEditPage-MfzhPW7v.js",revision:null},{url:"assets/SiteSettingsPage-BDZaUBmf.js",revision:null},{url:"assets/RelationshipPicker-C2MTxrhl.js",revision:null},{url:"assets/Pagination-Dx8h11Rn.js",revision:null},{url:"assets/MediaPage-DfPQBmNf.css",revision:null},{url:"assets/MediaPage-BNxc0wLq.js",revision:null},{url:"assets/MediaField-C3qFf3g5.js",revision:null},{url:"assets/LoginPage-Dya8sF_P.js",revision:null},{url:"assets/IconPicker-BpPlHJO0.js",revision:null},{url:"assets/FloatingComposerController-D4uLQfUX-0_Y8mkGU.js",revision:null},{url:"assets/FileTypeIcon-CNHtffHC.js",revision:null},{url:"assets/FieldRenderer-CT-DgCbC.js",revision:null},{url:"assets/CustomBlockPreview-Kc6bb3oq.js",revision:null},{url:"assets/ContentListPage-BCEQrYVs.js",revision:null},{url:"assets/ContentField-BZT4OUfI.js",revision:null},{url:"assets/ContentEditPage-CEJ7I3WH.js",revision:null},{url:"assets/ContentCreatePage-Cq8Pi8EF.js",revision:null},{url:"assets/CollectionsPage-CeQB5e9u.js",revision:null},{url:"assets/CollectionEditPage-DRmCA_73.js",revision:null},{url:"assets/BulkActionBar-BWysX7Wo.js",revision:null},{url:"assets/BlockTypesPage-cJNR25fN.js",revision:null},{url:"assets/BlockTypeEditPage-D1OFIlJZ.js",revision:null},{url:"assets/BlockEditor-s0CRZsjy.js",revision:null},{url:"assets/BlockEditor-CQpF8tYb.css",revision:null},{url:"assets/BackupsPage-04_oMy3v.js",revision:null},{url:"assets/AuditPage-CYAg4dbI.js",revision:null},{url:"assets/ApiKeysPage-CzUOSoz_.js",revision:null},{url:"assets/AllContentPage-D5ey5AOV.js",revision:null},{url:"assets/AdminsPage-DUMTsCEp.js",revision:null},{url:"icons/icon-180x180.png",revision:"66fb27eca516778823daa4a4acfc4096"},{url:"icons/icon-192x192.png",revision:"375b88bd595ea9a954684dd32e571606"},{url:"icons/icon-512x512.png",revision:"7a67637e8a879e7cfa4f2f3e1737782a"},{url:"icons/maskable-icon-512x512.png",revision:"6d3b72c5991408caac100229c0c1b054"},{url:"manifest.webmanifest",revision:"be12a951409033222ff660a548620488"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/v1\//,/^\/\.well-known\//]})),s.registerRoute(({url:s})=>s.pathname.startsWith("/v1/admin/"),new s.NetworkFirst({cacheName:"api-cache",networkTimeoutSeconds:10,plugins:[new s.ExpirationPlugin({maxEntries:200,maxAgeSeconds:3600}),new s.CacheableResponsePlugin({statuses:[200]})]}),"GET"),s.registerRoute(({url:s})=>"/.well-known/headroom.json"===s.pathname,new s.NetworkOnly,"GET"),s.registerRoute(({request:s})=>"image"===s.destination,new s.CacheFirst({cacheName:"media-cache",plugins:[new s.ExpirationPlugin({maxEntries:500,maxAgeSeconds:604800}),new s.CacheableResponsePlugin({statuses:[200]})]}),"GET")});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
define(["exports"],function(t){"use strict";try{self["workbox:core:7.3.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.3.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class r{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class i extends r{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class a{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let a=i&&i.handler;const o=t.method;if(!a&&this.i.has(o)&&(a=this.i.get(o)),!a)return;let c;try{c=a.handle({url:s,request:t,event:e,params:r})}catch(t){c=Promise.reject(t)}const h=i&&i.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:r})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const r=this.t.get(s.method)||[];for(const i of r){let r;const a=i.match({url:t,sameOrigin:e,request:s,event:n});if(a)return r=a,(Array.isArray(r)&&0===r.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(r=void 0),{route:i,params:r}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let o;const c=()=>(o||(o=new a,o.addFetchListener(),o.addCacheListener()),o);function h(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new r(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)a=new i(t,e,n);else if("function"==typeof t)a=new r(t,e,n);else{if(!(t instanceof r))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}return c().registerRoute(a),a}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter(t=>t&&t.length>0).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t){t.then(()=>{})}const p=new Set;function y(){return y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},y.apply(null,arguments)}let m,g;const R=new WeakMap,v=new WeakMap,b=new WeakMap,q=new WeakMap,D=new WeakMap;let U={get(t,e,s){if(t instanceof IDBTransaction){if("done"===e)return v.get(t);if("objectStoreNames"===e)return t.objectStoreNames||b.get(t);if("store"===e)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return I(t[e])},set:(t,e,s)=>(t[e]=s,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function x(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(g||(g=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(L(this),e),I(R.get(this))}:function(...e){return I(t.apply(L(this),e))}:function(e,...s){const n=t.call(L(this),e,...s);return b.set(n,e.sort?e.sort():[e]),I(n)}}function E(t){return"function"==typeof t?x(t):(t instanceof IDBTransaction&&function(t){if(v.has(t))return;const e=new Promise((e,s)=>{const n=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",i),t.removeEventListener("abort",i)},r=()=>{e(),n()},i=()=>{s(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",r),t.addEventListener("error",i),t.addEventListener("abort",i)});v.set(t,e)}(t),e=t,(m||(m=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,U):t);var e}function I(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,s)=>{const n=()=>{t.removeEventListener("success",r),t.removeEventListener("error",i)},r=()=>{e(I(t.result)),n()},i=()=>{s(t.error),n()};t.addEventListener("success",r),t.addEventListener("error",i)});return e.then(e=>{e instanceof IDBCursor&&R.set(e,t)}).catch(()=>{}),D.set(e,t),e}(t);if(q.has(t))return q.get(t);const e=E(t);return e!==t&&(q.set(t,e),D.set(e,t)),e}const L=t=>D.get(t);const C=["get","getKey","getAll","getAllKeys","count"],N=["put","add","delete","clear"],O=new Map;function k(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(O.get(e))return O.get(e);const s=e.replace(/FromIndex$/,""),n=e!==s,r=N.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!C.includes(s))return;const i=async function(t,...e){const i=this.transaction(t,r?"readwrite":"readonly");let a=i.store;return n&&(a=a.index(e.shift())),(await Promise.all([a[s](...e),r&&i.done]))[0]};return O.set(e,i),i}U=(t=>y({},t,{get:(e,s,n)=>k(e,s)||t.get(e,s,n),has:(e,s)=>!!k(e,s)||t.has(e,s)}))(U);try{self["workbox:expiration:7.3.0"]&&_()}catch(t){}const B="cache-entries",T=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class P{constructor(t){this.h=null,this.u=t}l(t){const e=t.createObjectStore(B,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}p(t){this.l(t),this.u&&function(t,{blocked:e}={}){const s=indexedDB.deleteDatabase(t);e&&s.addEventListener("blocked",t=>e(t.oldVersion,t)),I(s).then(()=>{})}(this.u)}async setTimestamp(t,e){const s={url:t=T(t),timestamp:e,cacheName:this.u,id:this.m(t)},n=(await this.getDb()).transaction(B,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(t){const e=await this.getDb(),s=await e.get(B,this.m(t));return null==s?void 0:s.timestamp}async expireEntries(t,e){const s=await this.getDb();let n=await s.transaction(B).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;n;){const s=n.value;s.cacheName===this.u&&(t&&s.timestamp<t||e&&i>=e?r.push(n.value):i++),n=await n.continue()}const a=[];for(const t of r)await s.delete(B,t.id),a.push(t.url);return a}m(t){return this.u+"|"+T(t)}async getDb(){return this.h||(this.h=await function(t,e,{blocked:s,upgrade:n,blocking:r,terminated:i}={}){const a=indexedDB.open(t,e),o=I(a);return n&&a.addEventListener("upgradeneeded",t=>{n(I(a.result),t.oldVersion,t.newVersion,I(a.transaction),t)}),s&&a.addEventListener("blocked",t=>s(t.oldVersion,t.newVersion,t)),o.then(t=>{i&&t.addEventListener("close",()=>i()),r&&t.addEventListener("versionchange",t=>r(t.oldVersion,t.newVersion,t))}).catch(()=>{}),o}("workbox-expiration",1,{upgrade:this.p.bind(this)})),this.h}}class M{constructor(t,e={}){this.R=!1,this.v=!1,this.q=e.maxEntries,this.D=e.maxAgeSeconds,this.U=e.matchOptions,this.u=t,this._=new P(t)}async expireEntries(){if(this.R)return void(this.v=!0);this.R=!0;const t=this.D?Date.now()-1e3*this.D:0,e=await this._.expireEntries(t,this.q),s=await self.caches.open(this.u);for(const t of e)await s.delete(t,this.U);this.R=!1,this.v&&(this.v=!1,d(this.expireEntries()))}async updateTimestamp(t){await this._.setTimestamp(t,Date.now())}async isURLExpired(t){if(this.D){const e=await this._.getTimestamp(t),s=Date.now()-1e3*this.D;return void 0===e||e<s}return!1}async delete(){this.v=!1,await this._.expireEntries(1/0)}}try{self["workbox:cacheable-response:7.3.0"]&&_()}catch(t){}class j{constructor(t={}){this.I=t.statuses,this.L=t.headers}isResponseCacheable(t){let e=!0;return this.I&&(e=this.I.includes(t.status)),this.L&&e&&(e=Object.keys(this.L).some(e=>t.headers.get(e)===this.L[e])),e}}try{self["workbox:strategies:7.3.0"]&&_()}catch(t){}const W={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null};function S(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class K{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}function A(t){return new Promise(e=>setTimeout(e,t))}function F(t){return"string"==typeof t?new Request(t):t}class ${constructor(t,e){this.C={},Object.assign(this,e),this.event=e.event,this.N=t,this.O=new K,this.k=[],this.B=[...t.plugins],this.T=new Map;for(const t of this.B)this.T.set(t,{});this.event.waitUntil(this.O.promise)}async fetch(t){const{event:e}=this;let n=F(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.N.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:i,response:t});return t}catch(t){throw r&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:r.clone(),request:i.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=F(t);let s;const{cacheName:n,matchOptions:r}=this.N,i=await this.getCacheKey(e,"read"),a=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(i,a);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:r,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(t,e){const n=F(t);await A(0);const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(i=r.url,new URL(String(i),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var i;const a=await this.P(e);if(!a)return!1;const{cacheName:o,matchOptions:c}=this.N,h=await self.caches.open(o),u=this.hasCallback("cacheDidUpdate"),l=u?await async function(t,e,s,n){const r=S(e.url,s);if(e.url===r)return t.match(e,n);const i=Object.assign(Object.assign({},n),{ignoreSearch:!0}),a=await t.keys(e,i);for(const e of a)if(r===S(e.url,s))return t.match(e,n)}(h,r.clone(),["__WB_REVISION__"],c):null;try{await h.put(r,u?a.clone():a)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of p)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:o,oldResponse:l,newResponse:a.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.C[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=F(await t({mode:e,request:n,event:this.event,params:this.params}));this.C[s]=n}return this.C[s]}hasCallback(t){for(const e of this.N.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.N.plugins)if("function"==typeof e[t]){const s=this.T.get(e),n=n=>{const r=Object.assign(Object.assign({},n),{state:s});return e[t](r)};yield n}}waitUntil(t){return this.k.push(t),t}async doneWaiting(){for(;this.k.length;){const t=this.k.splice(0),e=(await Promise.allSettled(t)).find(t=>"rejected"===t.status);if(e)throw e.reason}}destroy(){this.O.resolve(null)}async P(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class H{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,r=new $(this,{event:e,request:s,params:n}),i=this.M(r,s,e);return[i,this.j(i,r,s,e)]}async M(t,e,n){let r;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(r=await this.W(e,t),!r||"error"===r.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:s,event:n,request:e}),r)break;if(!r)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))r=await s({event:n,request:e,response:r});return r}async j(t,e,s,n){let r,i;try{r=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await e.doneWaiting()}catch(t){t instanceof Error&&(i=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:i}),e.destroy(),i)throw i}}function G(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.3.0"]&&_()}catch(t){}function V(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const r=new URL(n,location.href),i=new URL(n,location.href);return r.searchParams.set("__WB_REVISION__",e),{cacheKey:r.href,url:i.href}}class J{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class Q{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.S.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.S=t}}let z,X;async function Y(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const r=t.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},a=e?e(i):i,o=function(){if(void 0===z){const t=new Response("");if("body"in t)try{new Response(t.body),z=!0}catch(t){z=!1}z=!1}return z}()?r.body:await r.blob();return new Response(o,a)}class Z extends H{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this.K=!1!==t.fallbackToNetwork,this.plugins.push(Z.copyRedirectedCacheableResponsesPlugin)}async W(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.A(t,e):await this.F(t,e))}async F(t,e){let n;const r=e.params||{};if(!this.K)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=r.integrity,i=t.integrity,a=!i||i===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?i||s:void 0})),s&&a&&"no-cors"!==t.mode&&(this.$(),await e.cachePut(t,n.clone()))}return n}async A(t,e){this.$();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}$(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==Z.copyRedirectedCacheableResponsesPlugin&&(n===Z.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(Z.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}Z.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},Z.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await Y(t):t};class tt{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.H=new Map,this.G=new Map,this.V=new Map,this.N=new Z({cacheName:f(t),plugins:[...e,new Q({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.N}precache(t){this.addToCacheList(t),this.J||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.J=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:r}=V(n),i="string"!=typeof n&&n.revision?"reload":"default";if(this.H.has(r)&&this.H.get(r)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.H.get(r),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.V.has(t)&&this.V.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:r});this.V.set(t,n.integrity)}if(this.H.set(r,t),this.G.set(r,i),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return G(t,async()=>{const e=new J;this.strategy.plugins.push(e);for(const[e,s]of this.H){const n=this.V.get(s),r=this.G.get(e),i=new Request(e,{integrity:n,cache:r,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}})}activate(t){return G(t,async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.H.values()),n=[];for(const r of e)s.has(r.url)||(await t.delete(r),n.push(r.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this.H}getCachedURLs(){return[...this.H.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.H.get(e.href)}getIntegrityForCacheKey(t){return this.V.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const et=()=>(X||(X=new tt),X);class st extends r{constructor(t,e){super(({request:s})=>{const n=t.getURLsToCacheKeys();for(const r of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const i=new URL(t,location.href);i.hash="",yield i.href;const a=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some(t=>t.test(s))&&t.searchParams.delete(s);return t}(i,e);if(yield a.href,s&&a.pathname.endsWith("/")){const t=new URL(a.href);t.pathname+=s,yield t.href}if(n){const t=new URL(a.href);t.pathname+=".html",yield t.href}if(r){const t=r({url:i});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(r);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}},t.strategy)}}t.CacheFirst=class extends H{async W(t,e){let n,r=await e.cacheMatch(t);if(!r)try{r=await e.fetchAndCachePut(t)}catch(t){t instanceof Error&&(n=t)}if(!r)throw new s("no-response",{url:t.url,error:n});return r}},t.CacheableResponsePlugin=class{constructor(t){this.cacheWillUpdate=async({response:t})=>this.X.isResponseCacheable(t)?t:null,this.X=new j(t)}},t.ExpirationPlugin=class{constructor(t={}){this.cachedResponseWillBeUsed=async({event:t,request:e,cacheName:s,cachedResponse:n})=>{if(!n)return null;const r=this.Y(n),i=this.Z(s);d(i.expireEntries());const a=i.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(t){}return r?n:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const s=this.Z(t);await s.updateTimestamp(e.url),await s.expireEntries()},this.tt=t,this.D=t.maxAgeSeconds,this.et=new Map,t.purgeOnQuotaError&&function(t){p.add(t)}(()=>this.deleteCacheAndMetadata())}Z(t){if(t===w())throw new s("expire-custom-caches-only");let e=this.et.get(t);return e||(e=new M(t,this.tt),this.et.set(t,e)),e}Y(t){if(!this.D)return!0;const e=this.st(t);if(null===e)return!0;return e>=Date.now()-1e3*this.D}st(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),s=new Date(e).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[t,e]of this.et)await self.caches.delete(t),await e.delete();this.et=new Map}},t.NavigationRoute=class extends r{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super(t=>this.nt(t),t),this.rt=e,this.it=s}nt({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.it)if(t.test(s))return!1;return!!this.rt.some(t=>t.test(s))}},t.NetworkFirst=class extends H{constructor(t={}){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(W),this.ot=t.networkTimeoutSeconds||0}async W(t,e){const n=[],r=[];let i;if(this.ot){const{id:s,promise:a}=this.ct({request:t,logs:n,handler:e});i=s,r.push(a)}const a=this.ht({timeoutId:i,request:t,logs:n,handler:e});r.push(a);const o=await e.waitUntil((async()=>await e.waitUntil(Promise.race(r))||await a)());if(!o)throw new s("no-response",{url:t.url});return o}ct({request:t,logs:e,handler:s}){let n;return{promise:new Promise(e=>{n=setTimeout(async()=>{e(await s.cacheMatch(t))},1e3*this.ot)}),id:n}}async ht({timeoutId:t,request:e,logs:s,handler:n}){let r,i;try{i=await n.fetchAndCachePut(e)}catch(t){t instanceof Error&&(r=t)}return t&&clearTimeout(t),!r&&i||(i=await n.cacheMatch(e)),i}},t.NetworkOnly=class extends H{constructor(t={}){super(t),this.ot=t.networkTimeoutSeconds||0}async W(t,e){let n,r;try{const s=[e.fetch(t)];if(this.ot){const t=A(1e3*this.ot);s.push(t)}if(r=await Promise.race(s),!r)throw new Error(`Timed out the network response after ${this.ot} seconds.`)}catch(t){t instanceof Error&&(n=t)}if(!r)throw new s("no-response",{url:t.url,error:n});return r}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter(s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t);return await Promise.all(s.map(t=>self.caches.delete(t))),s})(e).then(t=>{}))})},t.clientsClaim=function(){self.addEventListener("activate",()=>self.clients.claim())},t.createHandlerBoundToURL=function(t){return et().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){et().precache(t)}(t),function(t){const e=et();h(new st(e,t))}(e)},t.registerRoute=h});
|
package/dist/admin-site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-site.d.ts","sourceRoot":"","sources":["../src/admin-site.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,YAAY,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE;QACJ,qDAAqD;QACrD,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;;;
|
|
1
|
+
{"version":3,"file":"admin-site.d.ts","sourceRoot":"","sources":["../src/admin-site.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,YAAY,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE;QACJ,qDAAqD;QACrD,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;;;EAiIhE;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/admin-site.js
CHANGED
|
@@ -19,7 +19,18 @@ export function createAdminSite(name, args) {
|
|
|
19
19
|
}
|
|
20
20
|
: undefined;
|
|
21
21
|
if (args.dev) {
|
|
22
|
-
// Dev mode: standard StaticSite with Vite build
|
|
22
|
+
// Dev mode: standard StaticSite with Vite build.
|
|
23
|
+
//
|
|
24
|
+
// VITE_ADMIN_URL is set from the configured custom domain when present
|
|
25
|
+
// (we know it before the StaticSite is constructed). Without a custom
|
|
26
|
+
// domain the admin URL is only known *after* the StaticSite resolves —
|
|
27
|
+
// which would be circular at the `environment` map. In that case we
|
|
28
|
+
// leave VITE_ADMIN_URL empty; the discovery doc emits adminUrl: "" and
|
|
29
|
+
// the CLI tolerates the empty value. See:
|
|
30
|
+
// steering/CLI_BOOSTRAP_DESIGN.md §1.2 (env-injection circularity)
|
|
31
|
+
const viteAdminUrl = args.domain
|
|
32
|
+
? `https://${args.domain.name}`
|
|
33
|
+
: "";
|
|
23
34
|
const site = new sst.aws.StaticSite(`${name}Admin`, {
|
|
24
35
|
path: args.dev.adminPath,
|
|
25
36
|
dev: {
|
|
@@ -37,6 +48,7 @@ export function createAdminSite(name, args) {
|
|
|
37
48
|
VITE_AWS_REGION: aws.getRegionOutput().name,
|
|
38
49
|
VITE_COLLAB_WS_URL: collab.wsUrl,
|
|
39
50
|
VITE_COLLAB_ENABLED: collabEnabledStr,
|
|
51
|
+
VITE_ADMIN_URL: viteAdminUrl,
|
|
40
52
|
},
|
|
41
53
|
domain: domainConfig,
|
|
42
54
|
});
|
|
@@ -50,10 +62,22 @@ export function createAdminSite(name, args) {
|
|
|
50
62
|
// (avoid modifying files in node_modules)
|
|
51
63
|
fs.mkdirSync(workDir, { recursive: true });
|
|
52
64
|
fs.cpSync(adminSrc, workDir, { recursive: true });
|
|
65
|
+
// Compute the admin URL for placeholder substitution. When a custom domain
|
|
66
|
+
// is configured, use it directly; otherwise fall back to the CloudFront-
|
|
67
|
+
// distribution URL the StaticSite resolves to. Using `$interpolate` keeps
|
|
68
|
+
// the value as an SST Output until deploy time, where it's safely inlined
|
|
69
|
+
// into the node script via the existing $-interpolated template.
|
|
70
|
+
const adminUrlForSubstitution = args.domain
|
|
71
|
+
? `https://${args.domain.name}`
|
|
72
|
+
: "";
|
|
53
73
|
const site = new sst.aws.StaticSite(`${name}Admin`, {
|
|
54
74
|
path: workDir,
|
|
55
75
|
build: {
|
|
56
|
-
// Replace placeholder env vars in the pre-built JS/HTML files
|
|
76
|
+
// Replace placeholder env vars in the pre-built JS/HTML/discovery files.
|
|
77
|
+
//
|
|
78
|
+
// The walk filter intentionally only matches the exact path
|
|
79
|
+
// `.well-known/headroom.json` (not any *.json) so we don't touch
|
|
80
|
+
// manifest.webmanifest, asset manifests, or other runtime JSON files.
|
|
57
81
|
command: $interpolate `node -e "
|
|
58
82
|
const fs = require('fs');
|
|
59
83
|
const path = require('path');
|
|
@@ -65,12 +89,18 @@ export function createAdminSite(name, args) {
|
|
|
65
89
|
'__HEADROOM_AWS_REGION__': '${aws.getRegionOutput().name}',
|
|
66
90
|
'__HEADROOM_COLLAB_WS_URL__': '${collab.wsUrl}',
|
|
67
91
|
'__HEADROOM_COLLAB_ENABLED__': '${collabEnabledStr}',
|
|
92
|
+
'__HEADROOM_ADMIN_URL__': '${adminUrlForSubstitution}',
|
|
68
93
|
};
|
|
94
|
+
const discoveryFile = path.join('.well-known', 'headroom.json');
|
|
69
95
|
function walk(d) {
|
|
70
96
|
for (const f of fs.readdirSync(d)) {
|
|
71
97
|
const full = path.join(d, f);
|
|
72
98
|
if (fs.statSync(full).isDirectory()) walk(full);
|
|
73
|
-
else
|
|
99
|
+
else {
|
|
100
|
+
const isSubstitutable = f.endsWith('.js')
|
|
101
|
+
|| f.endsWith('.html')
|
|
102
|
+
|| full.endsWith(discoveryFile);
|
|
103
|
+
if (!isSubstitutable) continue;
|
|
74
104
|
let content = fs.readFileSync(full, 'utf8');
|
|
75
105
|
for (const [k, v] of Object.entries(replacements)) {
|
|
76
106
|
content = content.replaceAll(k, v);
|
|
@@ -80,6 +110,19 @@ export function createAdminSite(name, args) {
|
|
|
80
110
|
}
|
|
81
111
|
}
|
|
82
112
|
walk('.');
|
|
113
|
+
// Regression guard: the discovery doc must have all placeholders
|
|
114
|
+
// substituted by now. A surviving __HEADROOM_*__ would indicate a
|
|
115
|
+
// mismatch between the Vite-emitted file and the replacements map.
|
|
116
|
+
try {
|
|
117
|
+
const body = fs.readFileSync(discoveryFile, 'utf8');
|
|
118
|
+
if (/__HEADROOM_[A-Z_]+__/.test(body)) {
|
|
119
|
+
console.error('headroom: unsubstituted placeholders survive in ' + discoveryFile);
|
|
120
|
+
console.error(body);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
} catch (e) {
|
|
124
|
+
if (e && e.code !== 'ENOENT') throw e;
|
|
125
|
+
}
|
|
83
126
|
"`,
|
|
84
127
|
output: ".",
|
|
85
128
|
},
|
package/dist/admin-site.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-site.js","sourceRoot":"","sources":["../src/admin-site.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAkCxB,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,IAAmB;IAC/D,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7C,qEAAqE;IACrE,2EAA2E;IAC3E,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAEzE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM;QAC9B,CAAC,CAAC;YACE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc;SACjC;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,
|
|
1
|
+
{"version":3,"file":"admin-site.js","sourceRoot":"","sources":["../src/admin-site.ts"],"names":[],"mappings":"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"}
|
package/dist/api.d.ts
CHANGED
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
import type { StorageResources } from "./storage.js";
|
|
8
8
|
import type { AuthResources } from "./auth.js";
|
|
9
9
|
import type { WebhookResources } from "./webhooks.js";
|
|
10
|
+
import type { BackupResources } from "./backup.js";
|
|
10
11
|
import type { ImageResources } from "./image.js";
|
|
11
12
|
import type { CollabTableResources } from "./collaboration.js";
|
|
12
13
|
export interface ApiArgs {
|
|
13
14
|
storage: StorageResources;
|
|
14
15
|
auth: AuthResources;
|
|
15
16
|
webhooks: WebhookResources;
|
|
17
|
+
backup: BackupResources;
|
|
16
18
|
image: ImageResources;
|
|
17
19
|
/**
|
|
18
20
|
* Just the collab DynamoDB table — the API Lambda only links the table
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAuB/D,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB;;;;OAIG;IACH,MAAM,EAAE,oBAAoB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE;QACJ,0CAA0C;QAC1C,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;;EAiIpD;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
package/dist/api.js
CHANGED
|
@@ -5,8 +5,31 @@
|
|
|
5
5
|
* Supports dev mode (Go source with live reload) and package mode (pre-compiled binary).
|
|
6
6
|
*/
|
|
7
7
|
import path from "path";
|
|
8
|
+
import { execSync } from "child_process";
|
|
9
|
+
/**
|
|
10
|
+
* Capture the deploying commit SHA so the API can self-report which build is
|
|
11
|
+
* running. Read at infra-eval time (once per `sst deploy` / `sst dev`) and
|
|
12
|
+
* baked into the Lambda's env. Falls back to "unknown" outside a git repo —
|
|
13
|
+
* never throws, since failing the deploy over a missing SHA would be hostile.
|
|
14
|
+
*/
|
|
15
|
+
function captureGitSha() {
|
|
16
|
+
// Allow CI to inject a specific SHA — useful when builds happen on a
|
|
17
|
+
// detached checkout where `git rev-parse HEAD` returns the wrong value.
|
|
18
|
+
const fromEnv = process.env.HEADROOM_GIT_SHA;
|
|
19
|
+
if (fromEnv)
|
|
20
|
+
return fromEnv.trim();
|
|
21
|
+
try {
|
|
22
|
+
return execSync("git rev-parse HEAD", {
|
|
23
|
+
encoding: "utf-8",
|
|
24
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
25
|
+
}).trim();
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return "unknown";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
8
31
|
export function createApi(name, args) {
|
|
9
|
-
const { storage, auth, webhooks, image, collab } = args;
|
|
32
|
+
const { storage, auth, webhooks, backup, image, collab } = args;
|
|
10
33
|
const handlerConfig = args.dev
|
|
11
34
|
? {
|
|
12
35
|
handler: args.dev.handler,
|
|
@@ -40,8 +63,17 @@ export function createApi(name, args) {
|
|
|
40
63
|
AWS_REGION_NAME: aws.getRegionOutput().name,
|
|
41
64
|
WEBHOOKS_TABLE: webhooks.webhooks.name,
|
|
42
65
|
WEBHOOK_DELIVERIES_TABLE: webhooks.webhookDeliveries.name,
|
|
43
|
-
|
|
44
|
-
|
|
66
|
+
WEBHOOK_WORKER_FUNCTION_NAME: webhooks.webhookWorker.name,
|
|
67
|
+
// Backup admin endpoints (Phases 3+4): the API Lambda async-invokes
|
|
68
|
+
// the backup worker and serves list/presign/delete from the backup
|
|
69
|
+
// bucket directly. Both env vars must be present for /v1/admin/...
|
|
70
|
+
// backup endpoints to function; unset = 503 from the service layer.
|
|
71
|
+
BACKUP_BUCKET: storage.backupBucket.name,
|
|
72
|
+
BACKUP_WORKER_FUNCTION_NAME: backup.backupWorker.name,
|
|
73
|
+
// The Go API only signs with the primary master and derives the
|
|
74
|
+
// per-site key per request. It never receives the OLD master —
|
|
75
|
+
// only the Sharp Lambda's verifier needs it.
|
|
76
|
+
IMAGE_SIGNING_MASTER_SECRET: image.imageSigningMasterSecret.value,
|
|
45
77
|
IMAGE_LAMBDA_NAME: image.imageLambda.name,
|
|
46
78
|
RELATIONSHIPS_TABLE: storage.relationships.name,
|
|
47
79
|
SITE_USERS_TABLE: storage.siteUsers.name,
|
|
@@ -51,6 +83,9 @@ export function createApi(name, args) {
|
|
|
51
83
|
// `X-Headroom-Internal` against this on internal service calls
|
|
52
84
|
// (collab → draft snapshot). See packages/api/internal/middleware/jwt.go.
|
|
53
85
|
INTERNAL_SECRET: storage.internalSecret.value,
|
|
86
|
+
// Commit SHA of the source tree at infra-eval time. Surfaced on
|
|
87
|
+
// /health so operators can map deploys → commits without tagging.
|
|
88
|
+
GIT_SHA: captureGitSha(),
|
|
54
89
|
},
|
|
55
90
|
link: [
|
|
56
91
|
storage.sites,
|
|
@@ -64,12 +99,16 @@ export function createApi(name, args) {
|
|
|
64
99
|
storage.contentBucket,
|
|
65
100
|
webhooks.webhooks,
|
|
66
101
|
webhooks.webhookDeliveries,
|
|
67
|
-
|
|
68
|
-
image.imageSigningSecret,
|
|
102
|
+
image.imageSigningMasterSecret,
|
|
69
103
|
storage.relationships,
|
|
70
104
|
storage.siteUsers,
|
|
71
105
|
collab.collabTable,
|
|
72
106
|
storage.internalSecret,
|
|
107
|
+
// Backup bucket — admin endpoints list/presign-get/delete here. The
|
|
108
|
+
// worker writes here (already linked via backup.ts); the API only
|
|
109
|
+
// needs read + delete + presign-get + list-bucket, which are all
|
|
110
|
+
// covered by the SST `link` IAM grant for the bucket.
|
|
111
|
+
storage.backupBucket,
|
|
73
112
|
],
|
|
74
113
|
permissions: [
|
|
75
114
|
{
|
|
@@ -95,6 +134,19 @@ export function createApi(name, args) {
|
|
|
95
134
|
actions: ["lambda:InvokeFunction"],
|
|
96
135
|
resources: [image.imageLambda.arn],
|
|
97
136
|
},
|
|
137
|
+
{
|
|
138
|
+
// Async invoke of the webhook worker. Replaces the old SQS
|
|
139
|
+
// SendMessage permission that was previously auto-derived from
|
|
140
|
+
// linking the queue.
|
|
141
|
+
actions: ["lambda:InvokeFunction"],
|
|
142
|
+
resources: [webhooks.webhookWorker.arn],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
// Async invoke of the backup worker — admin endpoints for trigger
|
|
146
|
+
// backup / restore call lambda:Invoke with InvocationType=Event.
|
|
147
|
+
actions: ["lambda:InvokeFunction"],
|
|
148
|
+
resources: [backup.backupWorker.arn],
|
|
149
|
+
},
|
|
98
150
|
{
|
|
99
151
|
actions: ["ses:SendEmail", "ses:SendRawEmail"],
|
|
100
152
|
resources: ["*"],
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"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"}
|