headroom-cms 0.2.0 → 0.2.2

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.
Files changed (91) hide show
  1. package/admin/assets/{AdminsPage-DUMTsCEp.js → AdminsPage-lGd1MFW3.js} +1 -1
  2. package/admin/assets/AllContentPage-YykTt4xH.js +1 -0
  3. package/admin/assets/{ApiKeysPage-CzUOSoz_.js → ApiKeysPage-BCpNEKxF.js} +1 -1
  4. package/admin/assets/{AuditPage-CYAg4dbI.js → AuditPage-DBKiujoI.js} +1 -1
  5. package/admin/assets/{BackupsPage-04_oMy3v.js → BackupsPage-DCrmYnQc.js} +1 -1
  6. package/admin/assets/{BlockEditor-s0CRZsjy.js → BlockEditor-BQVXN_Yn.js} +3 -3
  7. package/admin/assets/{BlockTypeEditPage-D1OFIlJZ.js → BlockTypeEditPage-BZmvEezy.js} +1 -1
  8. package/admin/assets/{BlockTypesPage-cJNR25fN.js → BlockTypesPage-CAr2JDj9.js} +1 -1
  9. package/admin/assets/BulkActionBar-CgHMxSkm.js +1 -0
  10. package/admin/assets/{CollectionEditPage-DRmCA_73.js → CollectionEditPage-BQoXWAB-.js} +1 -1
  11. package/admin/assets/{CollectionsPage-CeQB5e9u.js → CollectionsPage-Dakk_NyE.js} +1 -1
  12. package/admin/assets/{ContentCreatePage-Cq8Pi8EF.js → ContentCreatePage-d-xxhoxO.js} +1 -1
  13. package/admin/assets/ContentEditPage-CUi_mFRC.js +1 -0
  14. package/admin/assets/{ContentField-BZT4OUfI.js → ContentField-D6UO6W9G.js} +1 -1
  15. package/admin/assets/ContentListPage-8riubzdw.js +1 -0
  16. package/admin/assets/{CustomBlockPreview-Kc6bb3oq.js → CustomBlockPreview-BuRfUKgt.js} +1 -1
  17. package/admin/assets/{FieldRenderer-CT-DgCbC.js → FieldRenderer-CUVay-yx.js} +2 -2
  18. package/admin/assets/{FileTypeIcon-CNHtffHC.js → FileTypeIcon-DRD08pW_.js} +1 -1
  19. package/admin/assets/{FloatingComposerController-D4uLQfUX-0_Y8mkGU.js → FloatingComposerController-D4uLQfUX-Dc1_NZ4l.js} +1 -1
  20. package/admin/assets/{IconPicker-BpPlHJO0.js → IconPicker-DR-6b0GI.js} +1 -1
  21. package/admin/assets/{LoginPage-Dya8sF_P.js → LoginPage-DbHhSxgY.js} +1 -1
  22. package/admin/assets/{MediaField-C3qFf3g5.js → MediaField-eRyEALYH.js} +1 -1
  23. package/admin/assets/{MediaPage-BNxc0wLq.js → MediaPage-DW85F2UV.js} +1 -1
  24. package/admin/assets/{Pagination-Dx8h11Rn.js → Pagination-DTboMLK6.js} +1 -1
  25. package/admin/assets/{RelationshipPicker-C2MTxrhl.js → RelationshipPicker-VVZN4dlP.js} +1 -1
  26. package/admin/assets/{SiteSettingsPage-BDZaUBmf.js → SiteSettingsPage-5-HzcJLC.js} +1 -1
  27. package/admin/assets/{SiteUserEditPage-MfzhPW7v.js → SiteUserEditPage-C_PPvEye.js} +1 -1
  28. package/admin/assets/{SiteUsersPage-CrYugXpx.js → SiteUsersPage-CIgMMi-T.js} +1 -1
  29. package/admin/assets/{SitesPage-Cl8V3Hb7.js → SitesPage-DkG0gyHT.js} +1 -1
  30. package/admin/assets/SubmissionDetailPage-BwFWjkVu.js +1 -0
  31. package/admin/assets/{SubmissionEditPage-B0Kq52fb.js → SubmissionEditPage-C6Og25NH.js} +1 -1
  32. package/admin/assets/SubmissionListPage-spPh8dwQ.js +1 -0
  33. package/admin/assets/{TagInput-C6tcB5Xw.js → TagInput-DxktEo07.js} +1 -1
  34. package/admin/assets/{TagsPage-BONR6bSu.js → TagsPage-Dcc1IkF7.js} +1 -1
  35. package/admin/assets/TrashPage-8ybk22ZM.js +1 -0
  36. package/admin/assets/{UsersPage-C2iCy0UR.js → UsersPage-D5uXgLV4.js} +1 -1
  37. package/admin/assets/{WebhookEditPage-DjZFxT72.js → WebhookEditPage-T5KsZGqe.js} +1 -1
  38. package/admin/assets/{WebhooksPage-g_a224a4.js → WebhooksPage-DEIu5cX0.js} +1 -1
  39. package/admin/assets/{card-DlfsF8lU.js → card-CVAiqxnT.js} +1 -1
  40. package/admin/assets/{checkbox-BX8EcGFf.js → checkbox-BO-Fusdb.js} +1 -1
  41. package/admin/assets/{command-DaTsImUa.js → command-D0ojin3H.js} +1 -1
  42. package/admin/assets/index-BCa3VYjL.css +1 -0
  43. package/admin/assets/{index-DC1UyCW2.js → index-CbEa9yyd.js} +10 -10
  44. package/admin/assets/{listCellValue-CBqXAwce.js → listCellValue-BUdbRyCz.js} +1 -1
  45. package/admin/assets/{popover-BA-47SRI.js → popover-B9WNjj2t.js} +1 -1
  46. package/admin/assets/{select-waaVyoQ5.js → select-B2yTIHJT.js} +1 -1
  47. package/admin/assets/{serializeToText-CjHhyvXp.js → serializeToText-Tv-7pIdy.js} +1 -1
  48. package/admin/assets/{table-Br-QgtTL.js → table-C3EQVw1z.js} +1 -1
  49. package/admin/assets/{textarea-BILv1DQB.js → textarea-DIHLWabG.js} +1 -1
  50. package/admin/assets/useAdminResolver-_OHcUYwq.js +1 -0
  51. package/admin/assets/useContent-DLo6FUYZ.js +1 -0
  52. package/admin/assets/{useContentSearch-DbiA8aG-.js → useContentSearch-D-D0veFh.js} +1 -1
  53. package/admin/assets/{usePageTitle-DOEFrHbj.js → usePageTitle-BJ2ARyuc.js} +1 -1
  54. package/admin/assets/{useSiteUsers-BFYAbJNT.js → useSiteUsers-Bn3GiEYB.js} +1 -1
  55. package/admin/assets/{useTags-DJlXwDyc.js → useTags-CyGo0zXa.js} +1 -1
  56. package/admin/assets/useTrash-BFJMIP8N.js +1 -0
  57. package/admin/assets/{useWebhooks-BkpJKNLN.js → useWebhooks-BgJL2-Ek.js} +1 -1
  58. package/admin/index.html +2 -2
  59. package/admin/sw.js +1 -1
  60. package/dist/api.d.ts.map +1 -1
  61. package/dist/api.js +6 -0
  62. package/dist/api.js.map +1 -1
  63. package/dist/cron.d.ts +42 -0
  64. package/dist/cron.d.ts.map +1 -0
  65. package/dist/cron.js +128 -0
  66. package/dist/cron.js.map +1 -0
  67. package/dist/index.d.ts +3 -0
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +17 -0
  70. package/dist/index.js.map +1 -1
  71. package/lambda/api/bootstrap +0 -0
  72. package/lambda/backup-worker/bootstrap +0 -0
  73. package/lambda/image-lambda/node_modules/.package-lock.json +3 -3
  74. package/lambda/image-lambda/node_modules/semver/classes/semver.js +19 -2
  75. package/lambda/image-lambda/node_modules/semver/package.json +1 -1
  76. package/lambda/trash-sweeper/bootstrap +0 -0
  77. package/lambda/webhook-worker/bootstrap +0 -0
  78. package/package.json +1 -1
  79. package/src/api.ts +6 -0
  80. package/src/cron.ts +153 -0
  81. package/src/index.ts +21 -0
  82. package/src/sst-env.d.ts +17 -0
  83. package/admin/assets/AllContentPage-D5ey5AOV.js +0 -1
  84. package/admin/assets/BulkActionBar-BWysX7Wo.js +0 -1
  85. package/admin/assets/ContentEditPage-CEJ7I3WH.js +0 -1
  86. package/admin/assets/ContentListPage-BCEQrYVs.js +0 -1
  87. package/admin/assets/SubmissionDetailPage-BnVlsGb-.js +0 -1
  88. package/admin/assets/SubmissionListPage-K665VwMp.js +0 -1
  89. package/admin/assets/index-9sbb3-yI.css +0 -1
  90. package/admin/assets/useAdminResolver-CbDzGoDp.js +0 -1
  91. package/admin/assets/useContent-Bp4f9qe0.js +0 -1
@@ -1 +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
+ 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-CbEa9yyd.js";import{P,a as L,b as M}from"./popover-B9WNjj2t.js";import{C as B,a as E,b as $,c as k,d as q,e as A}from"./command-D0ojin3H.js";import{u as Q,a as V}from"./useContentSearch-D-D0veFh.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-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
+ import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as n}from"./index-CbEa9yyd.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{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
+ 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-CbEa9yyd.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-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(`
1
+ import{j as c}from"./tanstack-Bs3zYPPV.js";import{r as k}from"./react-vendor-C2CvUxFh.js";import{y as P}from"./index-CbEa9yyd.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-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
+ import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as l}from"./index-CbEa9yyd.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-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};
1
+ import{j as i}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as t}from"./index-CbEa9yyd.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{b6 as n}from"./index-CbEa9yyd.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 o,a,b as c}from"./tanstack-Bs3zYPPV.js";import{e as u}from"./index-CbEa9yyd.js";function y(e,i,t,n){const s=u(),r=new URLSearchParams({collection:i});return n&&r.set("afterId",n),t?.q&&r.set("q",t.q),t?.search&&r.set("search",t.search),t?.tag&&r.set("tag",t.tag),t?.status&&r.set("status",t.status),t?.sort&&r.set("sort",t.sort),t?.relatedTo&&r.set("relatedTo",t.relatedTo),t?.relField&&r.set("relField",t.relField),t?.limit&&r.set("limit",String(t.limit)),o({queryKey:["sites",e,"content",i,t??{},n??""],queryFn:()=>s.apiFetch(`/v1/admin/sites/${e}/content?${r.toString()}`),enabled:!!e&&!!i})}function v(e,i,t){const n=u(),s=new URLSearchParams;i&&s.set("afterId",i),s.set("limit",String(t));const r=s.toString();return o({queryKey:["sites",e,"content","__all__",i??"",t??""],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content${r?`?${r}`:""}`),enabled:!!e})}function m(e,i){const t=u();return o({queryKey:["sites",e,"content-detail",i],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}`),enabled:!!e&&!!i})}function q(e){const i=u(),t=a();return c({mutationFn:n=>i.apiFetch(`/v1/admin/sites/${e}/content`,{method:"POST",body:JSON.stringify({collection:n.collection,params:{title:n.title,slug:n.slug,body:{}}})}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",e,"content"]})})}function p(e,i){const t=u(),n=a();return c({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/draft`,{method:"PUT",body:JSON.stringify(s),timeoutMs:2e4}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]})}})}function F(e,i,t){const n=u();return o({queryKey:["sites",e,"content-published",i],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${i}/published`),enabled:!!e&&!!i&&t})}function S(e,i){const t=u(),n=a();return c({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/publish`,{method:"POST",...s!=null?{body:JSON.stringify({publishDate:s})}:{}}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]}),n.invalidateQueries({queryKey:["sites",e,"content-published",i]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function $(e,i){const t=u(),n=a();return c({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/unpublish`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]}),n.removeQueries({queryKey:["sites",e,"content-published",i]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function K(e,i){const t=u(),n=a();return c({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}`,{method:"DELETE"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"tags"]}),n.invalidateQueries({queryKey:["sites",e,"trash"]})}})}function b(e,i){const t=u(),n=a();return c({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/publish-date`,{method:"PATCH",body:JSON.stringify({publishDate:s})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]})}})}function Q(e,i){const t=u(),n=a();return c({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/schedule`,{method:"POST",body:JSON.stringify({scheduleAt:s})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]})}})}function f(e,i){const t=u(),n=a();return c({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/unschedule`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]})}})}function g(e){const i=u(),t=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>i.apiFetch(`/v1/admin/sites/${e}/content/${s}/publish`,{method:"POST"}))),onSettled:()=>{t.invalidateQueries({queryKey:["sites",e,"content"]}),t.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function h(e){const i=u(),t=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>i.apiFetch(`/v1/admin/sites/${e}/content/${s}/unpublish`,{method:"POST"}))),onSettled:()=>{t.invalidateQueries({queryKey:["sites",e,"content"]}),t.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function P(e){const i=u(),t=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>i.apiFetch(`/v1/admin/sites/${e}/content/${s}`,{method:"DELETE"}))),onSettled:()=>{t.invalidateQueries({queryKey:["sites",e,"content"]}),t.invalidateQueries({queryKey:["sites",e,"tags"]}),t.invalidateQueries({queryKey:["sites",e,"trash"]})}})}function O(e,i){const t=u(),n=a();return c({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/content/${i}/discard`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",i]})}})}function C(e,i,t){const n=u();return o({queryKey:["sites",e,"content-detail",i,"versions",t],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${i}/versions/${t}`),enabled:!!e&&!!i&&!!t})}function T(e,i){const t=u();return o({queryKey:["sites",e,"content-detail",i,"versions"],queryFn:async()=>({items:(await t.apiFetch(`/v1/admin/sites/${e}/content/${i}/versions`)).versions??[]}),enabled:!!e&&!!i})}function U(e){const i=u(),t=a();return c({mutationFn:n=>i.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:()=>t.invalidateQueries({queryKey:["sites",e,"content"]})})}function D(e,i){const t=u(),n=a();return c({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/submissions/${i}`,{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",i]})}})}function J(e,i,t){const n=u();return o({queryKey:["sites",e,"content-references",i],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${i}/references`),enabled:!!e&&!!i&&t})}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,Q as o,f 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-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
+ import{r as o}from"./react-vendor-C2CvUxFh.js";import{u as m}from"./tanstack-Bs3zYPPV.js";import{e as f}from"./index-CbEa9yyd.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{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
+ import{r as o}from"./react-vendor-C2CvUxFh.js";import{bh as s,aH as c}from"./index-CbEa9yyd.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-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
+ import{u as c,a as r,b as a}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-CbEa9yyd.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-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
+ import{u as r,a as i,b as u}from"./tanstack-Bs3zYPPV.js";import{e as a}from"./index-CbEa9yyd.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};
@@ -0,0 +1 @@
1
+ import{u as c,d,a as r,b as u}from"./tanstack-Bs3zYPPV.js";import{e as a}from"./index-CbEa9yyd.js";const y=30;function l(e,n){const s=a();return d({queryKey:["sites",e,"trash","list",n??"__all__"],initialPageParam:"",queryFn:({pageParam:t})=>{const i=new URLSearchParams;n&&i.set("collection",n),t&&i.set("cursor",t);const o=i.toString();return s.apiFetch(`/v1/admin/sites/${e}/trash${o?`?${o}`:""}`)},getNextPageParam:t=>t.hasMore&&t.cursor?t.cursor:void 0,enabled:!!e})}function q(e){const n=a(),s=r();return u({mutationFn:t=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/restore`,{method:"POST"}),onSuccess:(t,i)=>{s.invalidateQueries({queryKey:["sites",e,"trash"]}),s.invalidateQueries({queryKey:["sites",e,"content"]}),s.invalidateQueries({queryKey:["sites",e,"content-detail",i]}),s.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function h(e){const n=a(),s=r();return u({mutationFn:t=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}?purge=true`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:["sites",e,"trash"]})}})}function p(e){const n=a(),s=r();return u({mutationFn:t=>{const i=new URLSearchParams({collection:t});return n.apiFetch(`/v1/admin/sites/${e}/trash?${i.toString()}`,{method:"DELETE"})},onSuccess:()=>{s.invalidateQueries({queryKey:["sites",e,"trash"]})}})}function F(e){const n=a(),{data:s}=c({queryKey:["sites",e,"version"],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/version`),enabled:!!e,staleTime:5*6e4});return s?.trashRetentionDays??y}export{l as a,q as b,h as c,p as d,F as u};
@@ -1 +1 @@
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};
1
+ import{u,a,b as o}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-CbEa9yyd.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-DC1UyCW2.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-CbEa9yyd.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-9sbb3-yI.css">
18
+ <link rel="stylesheet" crossorigin href="/assets/index-BCa3VYjL.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 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")});
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:"172b13630793a0281fa8267abdc56925"},{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-BgJL2-Ek.js",revision:null},{url:"assets/useTrash-BFJMIP8N.js",revision:null},{url:"assets/useTags-CyGo0zXa.js",revision:null},{url:"assets/useSiteUsers-Bn3GiEYB.js",revision:null},{url:"assets/usePageTitle-BJ2ARyuc.js",revision:null},{url:"assets/useFilterParams-DYdEuWPE.js",revision:null},{url:"assets/useContentSearch-D-D0veFh.js",revision:null},{url:"assets/useContent-DLo6FUYZ.js",revision:null},{url:"assets/useAdminResolver-_OHcUYwq.js",revision:null},{url:"assets/textarea-DIHLWabG.js",revision:null},{url:"assets/tanstack-Bs3zYPPV.js",revision:null},{url:"assets/table-C3EQVw1z.js",revision:null},{url:"assets/sortable.esm-qVEMoaTg.js",revision:null},{url:"assets/serializeToText-Tv-7pIdy.js",revision:null},{url:"assets/select-B2yTIHJT.js",revision:null},{url:"assets/react-vendor-C2CvUxFh.js",revision:null},{url:"assets/radix-C5ZmWuuL.js",revision:null},{url:"assets/popover-B9WNjj2t.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-BUdbRyCz.js",revision:null},{url:"assets/lib-BrI1UB_t.js",revision:null},{url:"assets/index-CbEa9yyd.js",revision:null},{url:"assets/index-BCa3VYjL.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-D0ojin3H.js",revision:null},{url:"assets/collapsible-D3d29uJp.js",revision:null},{url:"assets/checkbox-BO-Fusdb.js",revision:null},{url:"assets/card-CVAiqxnT.js",revision:null},{url:"assets/WebhooksPage-DEIu5cX0.js",revision:null},{url:"assets/WebhookEditPage-T5KsZGqe.js",revision:null},{url:"assets/UsersPage-D5uXgLV4.js",revision:null},{url:"assets/TrashPage-8ybk22ZM.js",revision:null},{url:"assets/TagsPage-Dcc1IkF7.js",revision:null},{url:"assets/TagInput-DxktEo07.js",revision:null},{url:"assets/SubmissionListPage-spPh8dwQ.js",revision:null},{url:"assets/SubmissionEditPage-C6Og25NH.js",revision:null},{url:"assets/SubmissionDetailPage-BwFWjkVu.js",revision:null},{url:"assets/SitesPage-DkG0gyHT.js",revision:null},{url:"assets/SiteUsersPage-CIgMMi-T.js",revision:null},{url:"assets/SiteUserEditPage-C_PPvEye.js",revision:null},{url:"assets/SiteSettingsPage-5-HzcJLC.js",revision:null},{url:"assets/RelationshipPicker-VVZN4dlP.js",revision:null},{url:"assets/Pagination-DTboMLK6.js",revision:null},{url:"assets/MediaPage-DfPQBmNf.css",revision:null},{url:"assets/MediaPage-DW85F2UV.js",revision:null},{url:"assets/MediaField-eRyEALYH.js",revision:null},{url:"assets/LoginPage-DbHhSxgY.js",revision:null},{url:"assets/IconPicker-DR-6b0GI.js",revision:null},{url:"assets/FloatingComposerController-D4uLQfUX-Dc1_NZ4l.js",revision:null},{url:"assets/FileTypeIcon-DRD08pW_.js",revision:null},{url:"assets/FieldRenderer-CUVay-yx.js",revision:null},{url:"assets/CustomBlockPreview-BuRfUKgt.js",revision:null},{url:"assets/ContentListPage-8riubzdw.js",revision:null},{url:"assets/ContentField-D6UO6W9G.js",revision:null},{url:"assets/ContentEditPage-CUi_mFRC.js",revision:null},{url:"assets/ContentCreatePage-d-xxhoxO.js",revision:null},{url:"assets/CollectionsPage-Dakk_NyE.js",revision:null},{url:"assets/CollectionEditPage-BQoXWAB-.js",revision:null},{url:"assets/BulkActionBar-CgHMxSkm.js",revision:null},{url:"assets/BlockTypesPage-CAr2JDj9.js",revision:null},{url:"assets/BlockTypeEditPage-BZmvEezy.js",revision:null},{url:"assets/BlockEditor-CQpF8tYb.css",revision:null},{url:"assets/BlockEditor-BQVXN_Yn.js",revision:null},{url:"assets/BackupsPage-DCrmYnQc.js",revision:null},{url:"assets/AuditPage-DBKiujoI.js",revision:null},{url:"assets/ApiKeysPage-BCpNEKxF.js",revision:null},{url:"assets/AllContentPage-YykTt4xH.js",revision:null},{url:"assets/AdminsPage-lGd1MFW3.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")});
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;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,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M,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;;EAuIpD;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
package/dist/api.js CHANGED
@@ -43,6 +43,12 @@ export function createApi(name, args) {
43
43
  };
44
44
  const api = new sst.aws.Function(`${name}Api`, {
45
45
  ...handlerConfig,
46
+ // NOTE: the maintenance endpoints (backfill-sitehost, migrate-block-keys)
47
+ // self-checkpoint within `backfillTimeBudget` in
48
+ // packages/api/internal/service/backfill.go, which MUST stay under this
49
+ // value — otherwise the function is killed mid-scan before it can return a
50
+ // resume token and the caller sees a 502. If you lower this, lower that too
51
+ // (guarded by TestBackfillTimeBudget_UnderFunctionTimeout).
46
52
  timeout: "60 seconds",
47
53
  url: {
48
54
  cors: false,
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;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQzC;;;;;GAKG;AACH,SAAS,aAAa;IACpB,qEAAqE;IACrE,wEAAwE;IACxE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC7C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,oBAAoB,EAAE;YACpC,QAAQ,EAAE,OA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SAAS,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;aAC/B;YACD;gBACE,OAAO,EAAE,CAAC,uBAAuB,CAAC;gBAClC,SAAS,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;aACnC;YACD;gBACE,2DAA2D;gBAC3D,+DAA+D;gBAC/D,qBAAqB;gBACrB,OAAO,EAAE,CAAC,uBAAuB,CAAC;gBAClC,SAAS,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;aACxC;YACD;gBACE,kEAAkE;gBAClE,iEAAiE;gBACjE,OAAO,EAAE,CAAC,uBAAuB,CAAC;gBAClC,SAAS,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC;aACrC;YACD;gBACE,OAAO,EAAE,CAAC,eAAe,EAAE,kBAAkB,CAAC;gBAC9C,SAAS,EAAE,CAAC,GAAG,CAAC;aACjB;SACF;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC"}
package/dist/cron.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Cron Infrastructure
3
+ *
4
+ * EventBridge-driven scheduled Lambdas for periodic CMS maintenance. Today
5
+ * this is just the trash sweeper (Phase 2b of `steering/TRASH_CAN.md`); other
6
+ * cron-shaped workers (backup retention, etc.) live in their own modules.
7
+ *
8
+ * The trash sweeper Lambda walks every site, every collection, and purges
9
+ * content trashed more than `model.TrashRetentionDays` (30) days ago via the
10
+ * service-layer `Purge` — which fans out to drafts, slug lookups, tag counts,
11
+ * relationships, audit, and a `content.deleted` webhook per item. See
12
+ * `packages/api/cmd/trash_sweeper/main.go` for the entrypoint.
13
+ *
14
+ * Mass-delete protection is a per-run circuit breaker inside the sweeper
15
+ * (`TRASH_PURGE_RUN_CAP`), not a CloudWatch alarm: a run that would purge at
16
+ * least the cap aborts and logs at ERROR instead of completing. This keeps the
17
+ * feature at $0-at-rest (no custom CloudWatch metric, no alarm, no SNS topic)
18
+ * while actively *preventing* a runaway purge rather than alerting after the
19
+ * fact. The abort is visible in the sweeper's daily CloudWatch Logs line.
20
+ */
21
+ import type { StorageResources } from "./storage.js";
22
+ import type { WebhookResources } from "./webhooks.js";
23
+ export interface CronArgs {
24
+ storage: StorageResources;
25
+ webhooks: WebhookResources;
26
+ pkgRoot: string;
27
+ /**
28
+ * Stage name (`$app.stage`). Used to tune per-stage alarm thresholds: prod
29
+ * is tight (1000 purges/day signals mass-delete), dev/PR stages are loose
30
+ * to absorb manual testing without paging.
31
+ */
32
+ stage: string;
33
+ dev?: {
34
+ /** Go source path for the trash sweeper, e.g. "packages/api/cmd/trash_sweeper" */
35
+ handler: string;
36
+ };
37
+ }
38
+ export declare function createCron(name: string, args: CronArgs): {
39
+ trashSweeperCron: sst.aws.Cron;
40
+ };
41
+ export type CronResources = ReturnType<typeof createCron>;
42
+ //# sourceMappingURL=cron.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../src/cron.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE;QACJ,kFAAkF;QAClF,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAcD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;;EAiGtD;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
package/dist/cron.js ADDED
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Cron Infrastructure
3
+ *
4
+ * EventBridge-driven scheduled Lambdas for periodic CMS maintenance. Today
5
+ * this is just the trash sweeper (Phase 2b of `steering/TRASH_CAN.md`); other
6
+ * cron-shaped workers (backup retention, etc.) live in their own modules.
7
+ *
8
+ * The trash sweeper Lambda walks every site, every collection, and purges
9
+ * content trashed more than `model.TrashRetentionDays` (30) days ago via the
10
+ * service-layer `Purge` — which fans out to drafts, slug lookups, tag counts,
11
+ * relationships, audit, and a `content.deleted` webhook per item. See
12
+ * `packages/api/cmd/trash_sweeper/main.go` for the entrypoint.
13
+ *
14
+ * Mass-delete protection is a per-run circuit breaker inside the sweeper
15
+ * (`TRASH_PURGE_RUN_CAP`), not a CloudWatch alarm: a run that would purge at
16
+ * least the cap aborts and logs at ERROR instead of completing. This keeps the
17
+ * feature at $0-at-rest (no custom CloudWatch metric, no alarm, no SNS topic)
18
+ * while actively *preventing* a runaway purge rather than alerting after the
19
+ * fact. The abort is visible in the sweeper's daily CloudWatch Logs line.
20
+ */
21
+ import path from "path";
22
+ /**
23
+ * Per-stage value for the sweeper's per-run purge circuit breaker
24
+ * (`TRASH_PURGE_RUN_CAP`). A run that would purge at least this many items
25
+ * aborts instead of completing — the cheap, $0 replacement for the old
26
+ * CloudWatch mass-delete alarm. Production is tight (1000/run signals a likely
27
+ * mass-delete); dev/PR stages are loose so manual testing doesn't trip it.
28
+ * Read by `packages/api/cmd/trash_sweeper/main.go`.
29
+ */
30
+ function trashPurgeRunCap(stage) {
31
+ return stage === "production" ? 1000 : 10000;
32
+ }
33
+ export function createCron(name, args) {
34
+ const { storage, webhooks } = args;
35
+ const trashSweeperConfig = args.dev
36
+ ? {
37
+ handler: args.dev.handler,
38
+ runtime: "go",
39
+ }
40
+ : {
41
+ bundle: path.join(args.pkgRoot, "lambda/trash-sweeper"),
42
+ handler: "bootstrap",
43
+ runtime: "provided.al2023",
44
+ architecture: "arm64",
45
+ };
46
+ // Daily at 03:00 UTC. Cron syntax: minute hour day-of-month month day-of-week year.
47
+ // EventBridge requires either day-of-month or day-of-week to be `?`.
48
+ const trashSweeperCron = new sst.aws.Cron(`${name}TrashSweeper`, {
49
+ schedule: "cron(0 3 * * ? *)",
50
+ job: {
51
+ ...trashSweeperConfig,
52
+ // The sweeper pages through every site × every collection. 5 minutes
53
+ // is generous; a single site rarely has > 100 trashed items per
54
+ // collection per day. If we ever hit the timeout, the next run will
55
+ // pick up where we left off (items remain in the trash partition).
56
+ timeout: "5 minutes",
57
+ memory: "512 MB",
58
+ environment: {
59
+ // DynamoDB tables. NOTE: The sweeper's only entry point is
60
+ // AdminContentService.Purge, which touches content + drafts + audit
61
+ // + relationships + (indirectly via tagsRepo) ContentTable's
62
+ // tag-count items. blocksRepo and mediaRepo are passed to
63
+ // NewAdminContentService for symmetry with the API, but Purge's
64
+ // call graph never reaches them — so BLOCKS_TABLE / MEDIA_TABLE
65
+ // are deliberately omitted. If the sweeper ever grows a second
66
+ // entry point (Trash / Restore / Publish), revisit.
67
+ SITES_TABLE: storage.sites.name,
68
+ CONTENT_TABLE: storage.content.name,
69
+ DRAFT_CONTENT_TABLE: storage.draftContent.name,
70
+ COLLECTIONS_TABLE: storage.collections.name,
71
+ BLOCK_TYPES_TABLE: storage.blockTypes.name,
72
+ ADMIN_AUDIT_TABLE: storage.adminAudit.name,
73
+ RELATIONSHIPS_TABLE: storage.relationships.name,
74
+ WEBHOOKS_TABLE: webhooks.webhooks.name,
75
+ WEBHOOK_DELIVERIES_TABLE: webhooks.webhookDeliveries.name,
76
+ // Purge bumps the CDN site-version on published items, so the
77
+ // sweeper needs to write into the KVS just like the API Lambda.
78
+ KVS_ARN: storage.kvs.arn,
79
+ // Webhook fan-out async-invokes this Lambda per subscribed webhook.
80
+ WEBHOOK_WORKER_FUNCTION_NAME: webhooks.webhookWorker.name,
81
+ AWS_REGION_NAME: aws.getRegionOutput().name,
82
+ // Per-run purge circuit breaker. A sweep that would purge at least
83
+ // this many items aborts (and logs at ERROR) instead of completing —
84
+ // a $0 guard against a mass-delete / runaway, replacing the old
85
+ // CloudWatch mass-delete alarm. See trashPurgeRunCap above.
86
+ TRASH_PURGE_RUN_CAP: String(trashPurgeRunCap(args.stage)),
87
+ },
88
+ link: [
89
+ // Read/write — Purge mutates content (incl. tag-count items and
90
+ // slug-lookup rows) + drafts + audit + relationships, and emits
91
+ // per-item webhook delivery rows. Sites/collections/blockTypes are
92
+ // read-only for the sweep loop (ListAll + GetCollections).
93
+ // storage.blocks and storage.media are deliberately NOT linked —
94
+ // see env comment above.
95
+ storage.sites,
96
+ storage.content,
97
+ storage.draftContent,
98
+ storage.collections,
99
+ storage.blockTypes,
100
+ storage.adminAudit,
101
+ storage.relationships,
102
+ webhooks.webhooks,
103
+ webhooks.webhookDeliveries,
104
+ ],
105
+ permissions: [
106
+ {
107
+ // CloudFront KVS bump on Purge of a published item — mirrors the
108
+ // API Lambda's KVS permission set.
109
+ actions: [
110
+ "cloudfront-keyvaluestore:DescribeKeyValueStore",
111
+ "cloudfront-keyvaluestore:PutKey",
112
+ "cloudfront-keyvaluestore:DeleteKey",
113
+ "cloudfront-keyvaluestore:GetKey",
114
+ ],
115
+ resources: [storage.kvs.arn],
116
+ },
117
+ {
118
+ // Async invoke of the webhook worker. Same grant pattern as the
119
+ // API Lambda (`webhooks.webhookWorker.arn` in `api.ts`).
120
+ actions: ["lambda:InvokeFunction"],
121
+ resources: [webhooks.webhookWorker.arn],
122
+ },
123
+ ],
124
+ },
125
+ });
126
+ return { trashSweeperCron };
127
+ }
128
+ //# sourceMappingURL=cron.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron.js","sourceRoot":"","sources":["../src/cron.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAoBxB;;;;;;;GAOG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,KAAK,KAAK,YAAY,CAAC,CAAC,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;aACF;SACF;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC9B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export type { MediaCdnResources } from "./cdn-media.js";
15
15
  export type { SchedulerResources } from "./scheduler.js";
16
16
  export type { CollaborationResources } from "./collaboration.js";
17
17
  export type { AdminSiteResources } from "./admin-site.js";
18
+ export type { CronResources } from "./cron.js";
18
19
  export interface HeadroomCMSArgs {
19
20
  /**
20
21
  * Email address for sending admin invitations and password resets.
@@ -91,6 +92,8 @@ export interface HeadroomCMSArgs {
91
92
  schedulerHandler?: string;
92
93
  /** SST handler for collab Lambda, e.g. "packages/collab/src/index.handler" */
93
94
  collabHandler?: string;
95
+ /** Go source path for trash sweeper Lambda, e.g. "packages/api/cmd/trash_sweeper" */
96
+ trashSweeperHandler?: string;
94
97
  };
95
98
  /**
96
99
  * Build-time toggle for the collaboration feature in the admin UI.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2CH,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBA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+EAA+E;QAC/E,kBAAkB,EAAE,MAAM,CAAC;QAC3B,qDAAqD;QACrD,SAAS,EAAE,MAAM,CAAC;QAClB,qEAAqE;QACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,8EAA8E;QAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,qFAAqF;QACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IAEF;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qBAAa,WAAW;IACtB,SAAgB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,SAAgB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChD,SAAgB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,SAAgB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/C,SAAgB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,SAAgB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvD,SAAgB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAElD,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;gBAElD,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe;CAoLhD"}
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import { createMediaCdn } from "./cdn-media.js";
17
17
  import { createScheduler } from "./scheduler.js";
18
18
  import { createCollabTable, createCollabHandler } from "./collaboration.js";
19
19
  import { createAdminSite } from "./admin-site.js";
20
+ import { createCron } from "./cron.js";
20
21
  /**
21
22
  * Resolve the headroom-cms package root directory.
22
23
  *
@@ -132,6 +133,18 @@ export class HeadroomCMS {
132
133
  ? { handler: args.dev.schedulerHandler }
133
134
  : undefined,
134
135
  });
136
+ // 7b. Cron — daily trash sweeper Lambda (with an in-sweeper per-run purge
137
+ // circuit breaker; no CloudWatch metric/alarm). See `steering/TRASH_CAN.md`
138
+ // Phase 2b.
139
+ const cron = createCron(name, {
140
+ storage,
141
+ webhooks,
142
+ pkgRoot,
143
+ stage: $app.stage,
144
+ dev: args.dev?.trashSweeperHandler
145
+ ? { handler: args.dev.trashSweeperHandler }
146
+ : undefined,
147
+ });
135
148
  // 8a. API CDN (CloudFront distribution + edge auth, /v1/* and /health)
136
149
  const apiCdn = createApiCdn(name, {
137
150
  api,
@@ -196,6 +209,10 @@ export class HeadroomCMS {
196
209
  webhooksTable: webhooks.webhooks.name,
197
210
  contentBucket: storage.contentBucket.name,
198
211
  backupBucket: storage.backupBucket.name,
212
+ // Trash-sweeper Lambda function name (Phase 2b). Surfaced so ops/test
213
+ // scripts can target the sweeper by deterministic output instead of
214
+ // `aws lambda list-functions | grep`.
215
+ trashSweeperFunctionName: cron.trashSweeperCron.nodes.function.name,
199
216
  };
200
217
  }
201
218
  }