@shapio/cms 0.5.8 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/assets/{AssetTile-BrMzsUZD.js → AssetTile-DecaDqjj.js} +2 -2
- package/dist/admin/assets/{AssetTile-BrMzsUZD.js.map → AssetTile-DecaDqjj.js.map} +1 -1
- package/dist/admin/assets/AssistError-rslPtgWB.js +2 -0
- package/dist/admin/assets/{AssistError-Cs-r9Ssc.js.map → AssistError-rslPtgWB.js.map} +1 -1
- package/dist/admin/assets/{BlockMenuItems-DsccXMc_.js → BlockMenuItems-JHFue7Qt.js} +2 -2
- package/dist/admin/assets/{BlockMenuItems-DsccXMc_.js.map → BlockMenuItems-JHFue7Qt.js.map} +1 -1
- package/dist/admin/assets/Body-7NgJl9Pi.js +2 -0
- package/dist/admin/assets/Body-7NgJl9Pi.js.map +1 -0
- package/dist/admin/assets/Builder-DmlYcgiP.js +2 -0
- package/dist/admin/assets/Builder-DmlYcgiP.js.map +1 -0
- package/dist/admin/assets/{CodeEditor-CBCR73Wd.js → CodeEditor-Dv1FtkvI.js} +2 -2
- package/dist/admin/assets/{CodeEditor-CBCR73Wd.js.map → CodeEditor-Dv1FtkvI.js.map} +1 -1
- package/dist/admin/assets/{CopyButton-CxFsBHfF.js → CopyButton-Brnpfqe0.js} +2 -2
- package/dist/admin/assets/{CopyButton-CxFsBHfF.js.map → CopyButton-Brnpfqe0.js.map} +1 -1
- package/dist/admin/assets/{CursorPager-BW2U3v6l.js → CursorPager-C7cAK5Qe.js} +2 -2
- package/dist/admin/assets/{CursorPager-BW2U3v6l.js.map → CursorPager-C7cAK5Qe.js.map} +1 -1
- package/dist/admin/assets/{ExternalLink-BITMgS1K.js → ExternalLink-D80sb5Jj.js} +2 -2
- package/dist/admin/assets/{ExternalLink-BITMgS1K.js.map → ExternalLink-D80sb5Jj.js.map} +1 -1
- package/dist/admin/assets/{FocalPoint-CpZTve1E.js → FocalPoint-Bhtb1gUa.js} +2 -2
- package/dist/admin/assets/{FocalPoint-CpZTve1E.js.map → FocalPoint-Bhtb1gUa.js.map} +1 -1
- package/dist/admin/assets/Form-Cf1ephPH.js +2 -0
- package/dist/admin/assets/Form-Cf1ephPH.js.map +1 -0
- package/dist/admin/assets/FormCheckboxGroup-BzVZFR3W.js +2 -0
- package/dist/admin/assets/FormCheckboxGroup-BzVZFR3W.js.map +1 -0
- package/dist/admin/assets/{FormRadioGroup-Cfx5pvzU.js → FormRadioGroup-BzmLzRnI.js} +2 -2
- package/dist/admin/assets/{FormRadioGroup-Cfx5pvzU.js.map → FormRadioGroup-BzmLzRnI.js.map} +1 -1
- package/dist/admin/assets/FormSelectField-Cl7EjXc3.js +2 -0
- package/dist/admin/assets/FormSelectField-Cl7EjXc3.js.map +1 -0
- package/dist/admin/assets/FormSheet-CLZpd_7B.js +2 -0
- package/dist/admin/assets/FormSheet-CLZpd_7B.js.map +1 -0
- package/dist/admin/assets/{FormSwitchField-BLOh7qei.js → FormSwitchField-BbqQ3tx_.js} +2 -2
- package/dist/admin/assets/{FormSwitchField-BLOh7qei.js.map → FormSwitchField-BbqQ3tx_.js.map} +1 -1
- package/dist/admin/assets/{FormTextareaField-CO115n_u.js → FormTextareaField-9RN5Pt3B.js} +2 -2
- package/dist/admin/assets/{FormTextareaField-CO115n_u.js.map → FormTextareaField-9RN5Pt3B.js.map} +1 -1
- package/dist/admin/assets/{HintedLabel-DzHnEdIK.js → HintedLabel-D9IVF0EE.js} +2 -2
- package/dist/admin/assets/{HintedLabel-DzHnEdIK.js.map → HintedLabel-D9IVF0EE.js.map} +1 -1
- package/dist/admin/assets/{InfoHint-CSEtcHjL.js → InfoHint-tlSeZB9U.js} +2 -2
- package/dist/admin/assets/{InfoHint-CSEtcHjL.js.map → InfoHint-tlSeZB9U.js.map} +1 -1
- package/dist/admin/assets/{InlineConfirm-yW-iUKFC.js → InlineConfirm-Kj9AOIFO.js} +2 -2
- package/dist/admin/assets/{InlineConfirm-yW-iUKFC.js.map → InlineConfirm-Kj9AOIFO.js.map} +1 -1
- package/dist/admin/assets/{InsertMenuItem-CCr9e0qY.js → InsertMenuItem-CHAp2tH7.js} +2 -2
- package/dist/admin/assets/{InsertMenuItem-CCr9e0qY.js.map → InsertMenuItem-CHAp2tH7.js.map} +1 -1
- package/dist/admin/assets/{LinkTabs-8SmS1vCd.js → LinkTabs-oQXsy1I3.js} +2 -2
- package/dist/admin/assets/{LinkTabs-8SmS1vCd.js.map → LinkTabs-oQXsy1I3.js.map} +1 -1
- package/dist/admin/assets/{Match-CcD9KxHH.js → Match-BfNRwPfR.js} +2 -2
- package/dist/admin/assets/{Match-CcD9KxHH.js.map → Match-BfNRwPfR.js.map} +1 -1
- package/dist/admin/assets/{NoAccess-C8RLPN0I.js → NoAccess-DnEpYj9l.js} +2 -2
- package/dist/admin/assets/{NoAccess-C8RLPN0I.js.map → NoAccess-DnEpYj9l.js.map} +1 -1
- package/dist/admin/assets/Panel-Bcl09TtM.js.map +1 -1
- package/dist/admin/assets/{QueryView-xMP_uJ_t.js → QueryView-B86NcRt5.js} +2 -2
- package/dist/admin/assets/{QueryView-xMP_uJ_t.js.map → QueryView-B86NcRt5.js.map} +1 -1
- package/dist/admin/assets/{RadioTile-DQFmni5A.js → RadioTile-Bwd2Pmlk.js} +2 -2
- package/dist/admin/assets/RadioTile-Bwd2Pmlk.js.map +1 -0
- package/dist/admin/assets/{RichTextField-CVHRIbnu.js → RichTextField-Dou79MHF.js} +4 -4
- package/dist/admin/assets/RichTextField-Dou79MHF.js.map +1 -0
- package/dist/admin/assets/{RowTitle-Bqt6evG9.js → RowTitle-DH9OZs3g.js} +2 -2
- package/dist/admin/assets/{RowTitle-Bqt6evG9.js.map → RowTitle-DH9OZs3g.js.map} +1 -1
- package/dist/admin/assets/{SecretReveal-Bm6nYg5J.js → SecretReveal-D95oACLj.js} +2 -2
- package/dist/admin/assets/{SecretReveal-Bm6nYg5J.js.map → SecretReveal-D95oACLj.js.map} +1 -1
- package/dist/admin/assets/{SharedGlyph-cUmTh0_C.js → SharedGlyph-Chwb1EIS.js} +2 -2
- package/dist/admin/assets/{SharedGlyph-cUmTh0_C.js.map → SharedGlyph-Chwb1EIS.js.map} +1 -1
- package/dist/admin/assets/StepList-D9iHsUZJ.js +2 -0
- package/dist/admin/assets/StepList-D9iHsUZJ.js.map +1 -0
- package/dist/admin/assets/Structure-CewJL1b3.js +2 -0
- package/dist/admin/assets/{Structure-D8csgrIt.js.map → Structure-CewJL1b3.js.map} +1 -1
- package/dist/admin/assets/{SubNavLink-CiCaVV8U.js → SubNavLink-7Cs1LqMv.js} +2 -2
- package/dist/admin/assets/SubNavLink-7Cs1LqMv.js.map +1 -0
- package/dist/admin/assets/{SuggestAltButton-CvIoirnz.js → SuggestAltButton-BK1uo4yC.js} +2 -2
- package/dist/admin/assets/{SuggestAltButton-CvIoirnz.js.map → SuggestAltButton-BK1uo4yC.js.map} +1 -1
- package/dist/admin/assets/{TextLink-HRn66VL1.js → TextLink-Dfs5wsc5.js} +2 -2
- package/dist/admin/assets/{TextLink-HRn66VL1.js.map → TextLink-Dfs5wsc5.js.map} +1 -1
- package/dist/admin/assets/{Thumbnail-DNj5TRBI.js → Thumbnail-C2A_Ub77.js} +2 -2
- package/dist/admin/assets/{Thumbnail-DNj5TRBI.js.map → Thumbnail-C2A_Ub77.js.map} +1 -1
- package/dist/admin/assets/Trans-CPoNNUK1.js +2 -0
- package/dist/admin/assets/Trans-CPoNNUK1.js.map +1 -0
- package/dist/admin/assets/{UnsavedChangesGuard-CUiuMklN.js → UnsavedChangesGuard-BsEyn9oH.js} +2 -2
- package/dist/admin/assets/{UnsavedChangesGuard-CUiuMklN.js.map → UnsavedChangesGuard-BsEyn9oH.js.map} +1 -1
- package/dist/admin/assets/{UserAvatar-p-jV-LoD.js → UserAvatar-CgGKOFfP.js} +2 -2
- package/dist/admin/assets/{UserAvatar-p-jV-LoD.js.map → UserAvatar-CgGKOFfP.js.map} +1 -1
- package/dist/admin/assets/auth-BFSvtV59.js +2 -0
- package/dist/admin/assets/{auth-CQO4MBUj.js.map → auth-BFSvtV59.js.map} +1 -1
- package/dist/admin/assets/{badge-CqKF1pwz.js → badge-DGqA_yr_.js} +2 -2
- package/dist/admin/assets/{badge-CqKF1pwz.js.map → badge-DGqA_yr_.js.map} +1 -1
- package/dist/admin/assets/baseExtensions-TVKN1UwW.js.map +1 -1
- package/dist/admin/assets/{boxes-CAygw8zF.js → boxes-_5klpWNM.js} +2 -2
- package/dist/admin/assets/{boxes-CAygw8zF.js.map → boxes-_5klpWNM.js.map} +1 -1
- package/dist/admin/assets/{calendar-clock-BZGtAvWR.js → calendar-clock-VXok22Xj.js} +2 -2
- package/dist/admin/assets/{calendar-clock-BZGtAvWR.js.map → calendar-clock-VXok22Xj.js.map} +1 -1
- package/dist/admin/assets/changeSets-B6HxCJ4A.js +2 -0
- package/dist/admin/assets/{changeSets-8EburmT0.js.map → changeSets-B6HxCJ4A.js.map} +1 -1
- package/dist/admin/assets/chevron-left-CkRxDtvO.js +2 -0
- package/dist/admin/assets/{chevron-left-DGU3HGYG.js.map → chevron-left-CkRxDtvO.js.map} +1 -1
- package/dist/admin/assets/{circle-check-C37MSJqX.js → circle-check-DtDq7QMo.js} +2 -2
- package/dist/admin/assets/{circle-check-C37MSJqX.js.map → circle-check-DtDq7QMo.js.map} +1 -1
- package/dist/admin/assets/{clock-2arjsgZ4.js → clock-BtvZR9KD.js} +2 -2
- package/dist/admin/assets/{clock-2arjsgZ4.js.map → clock-BtvZR9KD.js.map} +1 -1
- package/dist/admin/assets/cn-DVhJ55Mo.js.map +1 -1
- package/dist/admin/assets/{constants-a_15vqOh.js → constants-DY3YJAKH.js} +2 -2
- package/dist/admin/assets/{constants-a_15vqOh.js.map → constants-DY3YJAKH.js.map} +1 -1
- package/dist/admin/assets/content-BNZF26Ve.js +3 -0
- package/dist/admin/assets/content-BNZF26Ve.js.map +1 -0
- package/dist/admin/assets/{contentCounts-DP7YYeZZ.js → contentCounts-BzC7IQqP.js} +2 -2
- package/dist/admin/assets/{contentCounts-DP7YYeZZ.js.map → contentCounts-BzC7IQqP.js.map} +1 -1
- package/dist/admin/assets/{contentTypes-84uc0bjR.js → contentTypes-Bz2xpqGf.js} +2 -2
- package/dist/admin/assets/{contentTypes-84uc0bjR.js.map → contentTypes-Bz2xpqGf.js.map} +1 -1
- package/dist/admin/assets/{context-IKYdzQJ-.js → context-CEVKblBl.js} +2 -2
- package/dist/admin/assets/{context-IKYdzQJ-.js.map → context-CEVKblBl.js.map} +1 -1
- package/dist/admin/assets/{copy-CsSRHgKZ.js → copy-B7vIq8DS.js} +2 -2
- package/dist/admin/assets/{copy-CsSRHgKZ.js.map → copy-B7vIq8DS.js.map} +1 -1
- package/dist/admin/assets/createLucideIcon-BOsNKleB.js +2 -0
- package/dist/admin/assets/createLucideIcon-BOsNKleB.js.map +1 -0
- package/dist/admin/assets/develop-D6CtwuYj.js +11 -0
- package/dist/admin/assets/develop-D6CtwuYj.js.map +1 -0
- package/dist/admin/assets/{dropdown-menu-_xfaEp5C.js → dropdown-menu-Bz7CLcRK.js} +2 -2
- package/dist/admin/assets/{dropdown-menu-_xfaEp5C.js.map → dropdown-menu-Bz7CLcRK.js.map} +1 -1
- package/dist/admin/assets/{ellipsis-F91991on.js → ellipsis-Ci0rsbCJ.js} +2 -2
- package/dist/admin/assets/{ellipsis-F91991on.js.map → ellipsis-Ci0rsbCJ.js.map} +1 -1
- package/dist/admin/assets/{entryLink-CVB-TdIn.js → entryLink-B0hSb_dN.js} +2 -2
- package/dist/admin/assets/{entryLink-CVB-TdIn.js.map → entryLink-B0hSb_dN.js.map} +1 -1
- package/dist/admin/assets/es2015-Cv57ynE1.js +42 -0
- package/dist/admin/assets/es2015-Cv57ynE1.js.map +1 -0
- package/dist/admin/assets/{external-link-CdG6kHfA.js → external-link-Bs9YRzvY.js} +2 -2
- package/dist/admin/assets/{external-link-CdG6kHfA.js.map → external-link-Bs9YRzvY.js.map} +1 -1
- package/dist/admin/assets/{field-COOzRptX.js → field-D-xWW2E7.js} +2 -2
- package/dist/admin/assets/{field-COOzRptX.js.map → field-D-xWW2E7.js.map} +1 -1
- package/dist/admin/assets/{file-stack-28ZtO1xW.js → file-stack-X4OGmkLA.js} +2 -2
- package/dist/admin/assets/{file-stack-28ZtO1xW.js.map → file-stack-X4OGmkLA.js.map} +1 -1
- package/dist/admin/assets/{fileRoute-s7mCMYUJ.js → fileRoute-DMal-zYL.js} +2 -2
- package/dist/admin/assets/{fileRoute-s7mCMYUJ.js.map → fileRoute-DMal-zYL.js.map} +1 -1
- package/dist/admin/assets/{folder-plus-DIk0pWkP.js → folder-plus-De2GNvry.js} +2 -2
- package/dist/admin/assets/{folder-plus-DIk0pWkP.js.map → folder-plus-De2GNvry.js.map} +1 -1
- package/dist/admin/assets/followPlural-CsgeALTW.js +2 -0
- package/dist/admin/assets/followPlural-CsgeALTW.js.map +1 -0
- package/dist/admin/assets/{globe-DFr3Gd2w.js → globe-DBw84s8Z.js} +2 -2
- package/dist/admin/assets/{globe-DFr3Gd2w.js.map → globe-DBw84s8Z.js.map} +1 -1
- package/dist/admin/assets/{image-DT79QFa_.js → image-CX4mT-_R.js} +2 -2
- package/dist/admin/assets/{image-DT79QFa_.js.map → image-CX4mT-_R.js.map} +1 -1
- package/dist/admin/assets/{image-off-DFs5upyX.js → image-off-CVaH_qKf.js} +2 -2
- package/dist/admin/assets/{image-off-DFs5upyX.js.map → image-off-CVaH_qKf.js.map} +1 -1
- package/dist/admin/assets/inbox-C0PVc6UI.js +2 -0
- package/dist/admin/assets/inbox-C0PVc6UI.js.map +1 -0
- package/dist/admin/assets/{inbox-CySnQydm.js → inbox-D9SmWt5L.js} +2 -2
- package/dist/admin/assets/{inbox-CySnQydm.js.map → inbox-D9SmWt5L.js.map} +1 -1
- package/dist/admin/assets/index-BqtCXB0u.js +4 -0
- package/dist/admin/assets/index-BqtCXB0u.js.map +1 -0
- package/dist/admin/assets/index-DZsQq6fY.css +2 -0
- package/dist/admin/assets/{key-round-D36CePnN.js → key-round-C8sd9CLN.js} +2 -2
- package/dist/admin/assets/{key-round-D36CePnN.js.map → key-round-C8sd9CLN.js.map} +1 -1
- package/dist/admin/assets/{labels-DQckbLGW.js → labels-BtktCNGw.js} +2 -2
- package/dist/admin/assets/{labels-DQckbLGW.js.map → labels-BtktCNGw.js.map} +1 -1
- package/dist/admin/assets/{languages-CzbTaQv9.js → languages-DLjdz6gb.js} +2 -2
- package/dist/admin/assets/{languages-CzbTaQv9.js.map → languages-DLjdz6gb.js.map} +1 -1
- package/dist/admin/assets/{layers-BmcodiaH.js → layers-swLuw-3a.js} +2 -2
- package/dist/admin/assets/{layers-BmcodiaH.js.map → layers-swLuw-3a.js.map} +1 -1
- package/dist/admin/assets/{link-2-off-CoJNwrxm.js → link-2-off-CEsI5T8h.js} +2 -2
- package/dist/admin/assets/{link-2-off-CoJNwrxm.js.map → link-2-off-CEsI5T8h.js.map} +1 -1
- package/dist/admin/assets/{link-Pyr2Y35S.js → link-C98FG_p5.js} +2 -2
- package/dist/admin/assets/{link-Pyr2Y35S.js.map → link-C98FG_p5.js.map} +1 -1
- package/dist/admin/assets/locales-CkuC7TJ1.js +2 -0
- package/dist/admin/assets/{locales-Bg3htKo8.js.map → locales-CkuC7TJ1.js.map} +1 -1
- package/dist/admin/assets/media-CbGSd_Mw.js +2 -0
- package/dist/admin/assets/{media-BCnVhaDH.js.map → media-CbGSd_Mw.js.map} +1 -1
- package/dist/admin/assets/{media-CURizGns.js → media-CeZGDGh7.js} +2 -2
- package/dist/admin/assets/{media-CURizGns.js.map → media-CeZGDGh7.js.map} +1 -1
- package/dist/admin/assets/network-BflLSKFO.js +2 -0
- package/dist/admin/assets/network-BflLSKFO.js.map +1 -0
- package/dist/admin/assets/{plus-BoDtdLCo.js → plus-cr9ZfO6j.js} +2 -2
- package/dist/admin/assets/{plus-BoDtdLCo.js.map → plus-cr9ZfO6j.js.map} +1 -1
- package/dist/admin/assets/publishing-BkxBplUZ.js +2 -0
- package/dist/admin/assets/publishing-BkxBplUZ.js.map +1 -0
- package/dist/admin/assets/{radio-group-4ok5evXq.js → radio-group-CRuWQnuV.js} +2 -2
- package/dist/admin/assets/{radio-group-4ok5evXq.js.map → radio-group-CRuWQnuV.js.map} +1 -1
- package/dist/admin/assets/{rotate-ccw-DL6TzcZh.js → rotate-ccw-BP8Ba-mY.js} +2 -2
- package/dist/admin/assets/{rotate-ccw-DL6TzcZh.js.map → rotate-ccw-BP8Ba-mY.js.map} +1 -1
- package/dist/admin/assets/schedules-BIyBlsYZ.js +2 -0
- package/dist/admin/assets/{schedules-BmB9Y73z.js.map → schedules-BIyBlsYZ.js.map} +1 -1
- package/dist/admin/assets/schema-6eUoC8fJ.js +2 -0
- package/dist/admin/assets/schema-6eUoC8fJ.js.map +1 -0
- package/dist/admin/assets/{scroll-text-PqeZm472.js → scroll-text-B5vfi9fD.js} +2 -2
- package/dist/admin/assets/{scroll-text-PqeZm472.js.map → scroll-text-B5vfi9fD.js.map} +1 -1
- package/dist/admin/assets/{search-BdwIwOzC.js → search-wj7zbkx1.js} +2 -2
- package/dist/admin/assets/{search-BdwIwOzC.js.map → search-wj7zbkx1.js.map} +1 -1
- package/dist/admin/assets/{searchSchemas-CSScloG8.js → searchSchemas-DAnwh3I3.js} +2 -2
- package/dist/admin/assets/{searchSchemas-CSScloG8.js.map → searchSchemas-DAnwh3I3.js.map} +1 -1
- package/dist/admin/assets/{sections-DqBzSKMP.js → sections-CWL-XD6m.js} +2 -2
- package/dist/admin/assets/sections-CWL-XD6m.js.map +1 -0
- package/dist/admin/assets/{sections-BTS683ur.js → sections-DBQpB0uv.js} +2 -2
- package/dist/admin/assets/{sections-BTS683ur.js.map → sections-DBQpB0uv.js.map} +1 -1
- package/dist/admin/assets/{select-C0USI-Ox.js → select-DVrPV1b3.js} +2 -2
- package/dist/admin/assets/{select-C0USI-Ox.js.map → select-DVrPV1b3.js.map} +1 -1
- package/dist/admin/assets/{send-XPWo3m4u.js → send-CzFdgUc_.js} +2 -2
- package/dist/admin/assets/{send-XPWo3m4u.js.map → send-CzFdgUc_.js.map} +1 -1
- package/dist/admin/assets/seo-Bd0sWQMo.js +2 -0
- package/dist/admin/assets/{seo-CceGYTIX.js.map → seo-Bd0sWQMo.js.map} +1 -1
- package/dist/admin/assets/settings-CqnrPmzR.js +2 -0
- package/dist/admin/assets/{settings-B60vHpZd.js.map → settings-CqnrPmzR.js.map} +1 -1
- package/dist/admin/assets/shapes-ZAkMBB-Z.js +6 -0
- package/dist/admin/assets/shapes-ZAkMBB-Z.js.map +1 -0
- package/dist/admin/assets/{skeleton-B5MP72Kw.js → skeleton-CiX26LnL.js} +2 -2
- package/dist/admin/assets/{skeleton-B5MP72Kw.js.map → skeleton-CiX26LnL.js.map} +1 -1
- package/dist/admin/assets/{snapshots-DUI2t-qF.js → snapshots-DbFQNJgN.js} +2 -2
- package/dist/admin/assets/{snapshots-DUI2t-qF.js.map → snapshots-DbFQNJgN.js.map} +1 -1
- package/dist/admin/assets/{sparkles-CvT-jxrW.js → sparkles-D_kmZJVd.js} +2 -2
- package/dist/admin/assets/{sparkles-CvT-jxrW.js.map → sparkles-D_kmZJVd.js.map} +1 -1
- package/dist/admin/assets/src-CMor9izq.js +7 -0
- package/dist/admin/assets/src-CMor9izq.js.map +1 -0
- package/dist/admin/assets/{stableId-BrtQedPy.js → stableId-g1uxJGSz.js} +2 -2
- package/dist/admin/assets/{stableId-BrtQedPy.js.map → stableId-g1uxJGSz.js.map} +1 -1
- package/dist/admin/assets/{store-CdIFG90N.js → store-CznhNKEi.js} +2 -2
- package/dist/admin/assets/{store-CdIFG90N.js.map → store-CznhNKEi.js.map} +1 -1
- package/dist/admin/assets/{switch-Dp6WYNam.js → switch-CiVf05NF.js} +2 -2
- package/dist/admin/assets/{switch-Dp6WYNam.js.map → switch-CiVf05NF.js.map} +1 -1
- package/dist/admin/assets/{theme-65PB8uAu.js → theme-Cv-MfOv8.js} +2 -2
- package/dist/admin/assets/theme-Cv-MfOv8.js.map +1 -0
- package/dist/admin/assets/titles-DrQhW8z3.js +2 -0
- package/dist/admin/assets/titles-DrQhW8z3.js.map +1 -0
- package/dist/admin/assets/tokens-B1S81Epe.js +2 -0
- package/dist/admin/assets/{tokens-ixHjAkDK.js.map → tokens-B1S81Epe.js.map} +1 -1
- package/dist/admin/assets/{tooltip-BGP1DVBt.js → tooltip-Bqf3oyqC.js} +2 -2
- package/dist/admin/assets/{tooltip-BGP1DVBt.js.map → tooltip-Bqf3oyqC.js.map} +1 -1
- package/dist/admin/assets/{undo-2-BiTANHFz.js → undo-2-DpwwRQTf.js} +2 -2
- package/dist/admin/assets/{undo-2-BiTANHFz.js.map → undo-2-DpwwRQTf.js.map} +1 -1
- package/dist/admin/assets/useContentSchema-B_q1rMrG.js +2 -0
- package/dist/admin/assets/useContentSchema-B_q1rMrG.js.map +1 -0
- package/dist/admin/assets/useCursorPager-BHYqHb3M.js +2 -0
- package/dist/admin/assets/{useCursorPager-0zHjlm-7.js.map → useCursorPager-BHYqHb3M.js.map} +1 -1
- package/dist/admin/assets/{useDiscardGuard-BskWSlbT.js → useDiscardGuard-C4QTfiU4.js} +2 -2
- package/dist/admin/assets/{useDiscardGuard-BskWSlbT.js.map → useDiscardGuard-C4QTfiU4.js.map} +1 -1
- package/dist/admin/assets/{useMediaPickerDialog-CU-ekPqX.js → useMediaPickerDialog-BLrVV1Kn.js} +2 -2
- package/dist/admin/assets/{useMediaPickerDialog-CU-ekPqX.js.map → useMediaPickerDialog-BLrVV1Kn.js.map} +1 -1
- package/dist/admin/assets/{useMediaUploader-CBcq1ICg.js → useMediaUploader-CFy6lasO.js} +2 -2
- package/dist/admin/assets/useMediaUploader-CFy6lasO.js.map +1 -0
- package/dist/admin/assets/useModelIndex-NU-WlHQY.js +2 -0
- package/dist/admin/assets/useModelIndex-NU-WlHQY.js.map +1 -0
- package/dist/admin/assets/useNetworkPermission-DehDln-U.js +2 -0
- package/dist/admin/assets/{useNetworkPermission-Cts98h9d.js.map → useNetworkPermission-DehDln-U.js.map} +1 -1
- package/dist/admin/assets/{usePaletteItems-DtReWmkd.js → usePaletteItems-CFpNlSOs.js} +2 -2
- package/dist/admin/assets/{usePaletteItems-DtReWmkd.js.map → usePaletteItems-CFpNlSOs.js.map} +1 -1
- package/dist/admin/assets/usePlaces-BA4x6503.js +2 -0
- package/dist/admin/assets/usePlaces-BA4x6503.js.map +1 -0
- package/dist/admin/assets/useResolvedDefinitions-30lnwFQ1.js +2 -0
- package/dist/admin/assets/useResolvedDefinitions-30lnwFQ1.js.map +1 -0
- package/dist/admin/assets/{useResolvedScheme-C8vcQVko.js → useResolvedScheme-BVM4qLct.js} +2 -2
- package/dist/admin/assets/{useResolvedScheme-C8vcQVko.js.map → useResolvedScheme-BVM4qLct.js.map} +1 -1
- package/dist/admin/assets/useSaveShortcut-DQuNL1uJ.js +2 -0
- package/dist/admin/assets/useSaveShortcut-DQuNL1uJ.js.map +1 -0
- package/dist/admin/assets/{useSchemaScopeAccess-ByrxIdKM.js → useSchemaScopeAccess-JXOMx51q.js} +2 -2
- package/dist/admin/assets/{useSchemaScopeAccess-ByrxIdKM.js.map → useSchemaScopeAccess-JXOMx51q.js.map} +1 -1
- package/dist/admin/assets/users-38jLQ7zr.js +2 -0
- package/dist/admin/assets/users-38jLQ7zr.js.map +1 -0
- package/dist/admin/assets/{users-DM7CXUBJ.js → users-DYwcVDqp.js} +2 -2
- package/dist/admin/assets/{users-DM7CXUBJ.js.map → users-DYwcVDqp.js.map} +1 -1
- package/dist/admin/assets/{zod-Cry7YvLY.js → zod-ZaQjjiAq.js} +2 -2
- package/dist/admin/assets/{zod-Cry7YvLY.js.map → zod-ZaQjjiAq.js.map} +1 -1
- package/dist/admin/index.html +60 -58
- package/dist/cli.js +1 -1
- package/dist/{cliMain-papyXJDd.js → cliMain-CTntiVc2.js} +107 -30
- package/dist/cliMain-CTntiVc2.js.map +1 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +1 -1
- package/dist/{contentDisposition-DOL2Xt0l.js → contentDisposition-DzhPhncr.js} +2 -2
- package/dist/{contentDisposition-DOL2Xt0l.js.map → contentDisposition-DzhPhncr.js.map} +1 -1
- package/dist/index.d.ts +43 -6
- package/dist/index.js +2 -2
- package/dist/{public-COKbHR-N.d.ts → public-CMFaGDyf.d.ts} +50 -8
- package/dist/{public-B57h4F7Y.js → public-sJCQaNaP.js} +2 -2
- package/dist/public-sJCQaNaP.js.map +1 -0
- package/dist/{s3Adapter-U01iEAcK.js → s3Adapter-CZcCl0sy.js} +2 -2
- package/dist/{s3Adapter-U01iEAcK.js.map → s3Adapter-CZcCl0sy.js.map} +1 -1
- package/dist/{worker-B-sC-eY2.js → worker-DHm2JwMZ.js} +3140 -1292
- package/dist/worker-DHm2JwMZ.js.map +1 -0
- package/package.json +5 -5
- package/dist/admin/assets/AssistError-Cs-r9Ssc.js +0 -2
- package/dist/admin/assets/Body-BzZD-TZT.js +0 -2
- package/dist/admin/assets/Body-BzZD-TZT.js.map +0 -1
- package/dist/admin/assets/Builder-DW-GJA_q.js +0 -2
- package/dist/admin/assets/Builder-DW-GJA_q.js.map +0 -1
- package/dist/admin/assets/Form-lNrRHc0I.js +0 -2
- package/dist/admin/assets/Form-lNrRHc0I.js.map +0 -1
- package/dist/admin/assets/FormCheckboxGroup-DeeaYnzB.js +0 -2
- package/dist/admin/assets/FormCheckboxGroup-DeeaYnzB.js.map +0 -1
- package/dist/admin/assets/FormSelectField-BzE9Lq9i.js +0 -2
- package/dist/admin/assets/FormSelectField-BzE9Lq9i.js.map +0 -1
- package/dist/admin/assets/RadioTile-DQFmni5A.js.map +0 -1
- package/dist/admin/assets/RichTextField-CVHRIbnu.js.map +0 -1
- package/dist/admin/assets/StepList-BXGYD9eJ.js +0 -2
- package/dist/admin/assets/StepList-BXGYD9eJ.js.map +0 -1
- package/dist/admin/assets/Structure-D8csgrIt.js +0 -2
- package/dist/admin/assets/SubNavLink-CiCaVV8U.js.map +0 -1
- package/dist/admin/assets/auth-CQO4MBUj.js +0 -2
- package/dist/admin/assets/changeSets-8EburmT0.js +0 -2
- package/dist/admin/assets/chevron-left-DGU3HGYG.js +0 -2
- package/dist/admin/assets/content-CAjkbZEY.js +0 -3
- package/dist/admin/assets/content-CAjkbZEY.js.map +0 -1
- package/dist/admin/assets/createLucideIcon-CLmh7Go-.js +0 -2
- package/dist/admin/assets/createLucideIcon-CLmh7Go-.js.map +0 -1
- package/dist/admin/assets/develop-BOqvnlgt.js +0 -11
- package/dist/admin/assets/develop-BOqvnlgt.js.map +0 -1
- package/dist/admin/assets/es2015-BHmI7wjK.js +0 -42
- package/dist/admin/assets/es2015-BHmI7wjK.js.map +0 -1
- package/dist/admin/assets/followPlural-Cm7v_Udv.js +0 -2
- package/dist/admin/assets/followPlural-Cm7v_Udv.js.map +0 -1
- package/dist/admin/assets/inbox-DGO2D8fa.js +0 -2
- package/dist/admin/assets/inbox-DGO2D8fa.js.map +0 -1
- package/dist/admin/assets/index-BIIU9ZI6.js +0 -4
- package/dist/admin/assets/index-BIIU9ZI6.js.map +0 -1
- package/dist/admin/assets/index-lxe7WimO.css +0 -2
- package/dist/admin/assets/locales-Bg3htKo8.js +0 -2
- package/dist/admin/assets/media-BCnVhaDH.js +0 -2
- package/dist/admin/assets/network-BixABr0o.js +0 -2
- package/dist/admin/assets/network-BixABr0o.js.map +0 -1
- package/dist/admin/assets/publishing-Dke9bSKp.js +0 -2
- package/dist/admin/assets/publishing-Dke9bSKp.js.map +0 -1
- package/dist/admin/assets/schedules-BmB9Y73z.js +0 -2
- package/dist/admin/assets/schema-D-qo7XSF.js +0 -2
- package/dist/admin/assets/schema-D-qo7XSF.js.map +0 -1
- package/dist/admin/assets/sections-DqBzSKMP.js.map +0 -1
- package/dist/admin/assets/seo-CceGYTIX.js +0 -2
- package/dist/admin/assets/settings-B60vHpZd.js +0 -2
- package/dist/admin/assets/shapes-B5twqZcp.js +0 -6
- package/dist/admin/assets/shapes-B5twqZcp.js.map +0 -1
- package/dist/admin/assets/src-ndgTSYLX.js +0 -7
- package/dist/admin/assets/src-ndgTSYLX.js.map +0 -1
- package/dist/admin/assets/theme-65PB8uAu.js.map +0 -1
- package/dist/admin/assets/titles-CQiqqDw-.js +0 -2
- package/dist/admin/assets/titles-CQiqqDw-.js.map +0 -1
- package/dist/admin/assets/tokens-ixHjAkDK.js +0 -2
- package/dist/admin/assets/useContentSchema-DtYfhsd2.js +0 -2
- package/dist/admin/assets/useContentSchema-DtYfhsd2.js.map +0 -1
- package/dist/admin/assets/useCursorPager-0zHjlm-7.js +0 -2
- package/dist/admin/assets/useMediaUploader-CBcq1ICg.js.map +0 -1
- package/dist/admin/assets/useNetworkPermission-Cts98h9d.js +0 -2
- package/dist/admin/assets/usePlaces-DC47wVeU.js +0 -2
- package/dist/admin/assets/usePlaces-DC47wVeU.js.map +0 -1
- package/dist/admin/assets/useQueries-CirW3Mvp.js +0 -2
- package/dist/admin/assets/useQueries-CirW3Mvp.js.map +0 -1
- package/dist/admin/assets/useSaveShortcut-rKtp1qK7.js +0 -2
- package/dist/admin/assets/useSaveShortcut-rKtp1qK7.js.map +0 -1
- package/dist/admin/assets/users-2iJYwlJb.js +0 -2
- package/dist/admin/assets/users-2iJYwlJb.js.map +0 -1
- package/dist/cliMain-papyXJDd.js.map +0 -1
- package/dist/public-B57h4F7Y.js.map +0 -1
- package/dist/worker-B-sC-eY2.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliMain-CTntiVc2.js","names":["CONTAINER_TAGS","LANGUAGE_PATTERN","imageNode","listNode","convertBlock","httpsRequest","httpRequest","mediaVariantsRepository.listForAssets","mediaAssetsRepository.lockById","mediaAssetsRepository.update","mediaAssetsRepository.listLiveByDriver"],"sources":["../../../packages/client/dist/errors-B4bGc9nd.js","../../../packages/client/dist/index.js","../../../packages/schema/dist/html.js","../../../packages/client/dist/node.js","../../../packages/cli/dist/index.js","../src/db/backup.ts","../src/extensions/themeContrast.ts","../src/extensions/check.ts","../src/helpers/healthProbe.ts","../src/mcp/cli.ts","../src/media/migrate.ts","../src/media/cli.ts","../src/cliCommands.ts","../src/cliMain.ts"],"sourcesContent":["//#region src/admin/paths.ts\n/** Every admin route the client calls (packages B, D, F and G, `apps/api/src/routes/admin/**`). */\nconst ADMIN_PATHS = {\n\tsetup: \"/api/admin/setup\",\n\tcsrf: \"/api/admin/auth/csrf\",\n\tlogin: \"/api/admin/auth/login\",\n\tlogout: \"/api/admin/auth/logout\",\n\tme: \"/api/admin/auth/me\",\n\tpassword: \"/api/admin/auth/me/password\",\n\tsessions: \"/api/admin/auth/sessions\",\n\tpasswordReset: \"/api/admin/auth/password-reset\",\n\tpasswordResetConfirm: \"/api/admin/auth/password-reset/confirm\",\n\tusers: \"/api/admin/users\",\n\tinvitations: \"/api/admin/invitations\",\n\tinspectInvitation: \"/api/admin/invitations/inspect\",\n\tacceptInvitation: \"/api/admin/invitations/accept\",\n\troles: \"/api/admin/roles\",\n\ttokens: \"/api/admin/tokens\",\n\taudit: \"/api/admin/audit\",\n\tmodels: \"/api/admin/models\",\n\tcomponents: \"/api/admin/components\",\n\tschema: \"/api/admin/schema\",\n\tschemaChanges: \"/api/admin/schema/changes\",\n\tschemaExport: \"/api/admin/schema/export\",\n\tschemaApply: \"/api/admin/schema/apply\",\n\tschemaSettings: \"/api/admin/schema/settings\",\n\tlocales: \"/api/admin/locales\",\n\tmediaFolders: \"/api/admin/media/folders\",\n\tmediaAssets: \"/api/admin/media/assets\",\n\tmediaUploads: \"/api/admin/media/uploads\",\n\tappUsers: \"/api/admin/app-users\",\n\tappRoles: \"/api/admin/app-roles\",\n\tcontent: \"/api/admin/content\",\n\tcontentCounts: \"/api/admin/content-counts\",\n\tcontentHealth: \"/api/admin/content-health\",\n\tpresence: \"/api/admin/presence\",\n\teditorManifest: \"/api/admin/extensions/editors\",\n\textensionThemes: \"/api/admin/extensions/themes\",\n\tjobs: \"/api/admin/jobs\",\n\tschedules: \"/api/admin/publishing/schedules\",\n\tchangeSets: \"/api/admin/change-sets\",\n\tsnapshots: \"/api/admin/snapshots\",\n\twebhooks: \"/api/admin/webhooks\",\n\tdeploymentConnections: \"/api/admin/deployments/connections\",\n\tdeploymentRuns: \"/api/admin/deployments/runs\",\n\tpreview: \"/api/admin/preview\",\n\tpreviewTokens: \"/api/admin/preview/tokens\"\n};\nconst withId = (base, id) => `${base}/${encodeURIComponent(id)}`;\n//#endregion\n//#region src/admin/query.ts\n/** Serializes defined values into a `?a=1&b=2` string (empty when nothing is set). */\nconst toQueryString = (query) => {\n\tconst params = new URLSearchParams();\n\tfor (const [key, value] of Object.entries(query)) if (value !== void 0 && value !== null && value !== \"\") params.set(key, String(value));\n\tconst serialized = params.toString();\n\treturn serialized ? `?${serialized}` : \"\";\n};\n//#endregion\n//#region src/admin/media.ts\n/** The media library: folders, assets, and the two-step upload (grant, then confirm). */\nconst createMediaApi = (request) => ({ media: {\n\tfolders: {\n\t\t/** The whole tree, flat: build it from `parentId`. */\n\t\tlist: async () => (await request(ADMIN_PATHS.mediaFolders)).items,\n\t\tcreate: (body) => request(ADMIN_PATHS.mediaFolders, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** Rename and/or move; 409 VERSION_CONFLICT when `expectedVersion` is stale. */\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.mediaFolders, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\t/** Only empty folders: 409 FOLDER_NOT_EMPTY otherwise. */\n\t\tremove: (id) => request(withId(ADMIN_PATHS.mediaFolders, id), { method: \"DELETE\" })\n\t},\n\tassets: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.mediaAssets}${toQueryString(query)}`),\n\t\tget: (id) => request(withId(ADMIN_PATHS.mediaAssets, id)),\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.mediaAssets, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\t/** 409 MEDIA_IN_USE when content references the asset; owners may pass `force`. */\n\t\tremove: (id, { force = false } = {}) => request(`${withId(ADMIN_PATHS.mediaAssets, id)}${toQueryString({ force: force || void 0 })}`, { method: \"DELETE\" }),\n\t\tmove: (body) => request(`${ADMIN_PATHS.mediaAssets}/move`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** \"Used in\": the entries that reference the asset. */\n\t\tusage: (id) => request(`${withId(ADMIN_PATHS.mediaAssets, id)}/usage`),\n\t\t/** An upload grant that replaces the asset's file and keeps its ID; confirm it like any upload. */\n\t\treplace: (id, body) => request(`${withId(ADMIN_PATHS.mediaAssets, id)}/replace`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t})\n\t},\n\tuploads: {\n\t\tcreate: (body) => request(ADMIN_PATHS.mediaUploads, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** Step 3: the server checks the stored bytes and records the asset (201 new, 200 replaced). */\n\t\tconfirm: (grantId) => request(`${withId(ADMIN_PATHS.mediaUploads, grantId)}/confirm`, { method: \"POST\" })\n\t}\n} });\n/** The form for step 2 of an upload: the grant's fields in order, then the file. */\nconst buildUploadForm = (grant, file, filename) => {\n\tconst form = new FormData();\n\tfor (const [name, value] of Object.entries(grant.upload.fields)) form.append(name, value);\n\tform.append(grant.upload.fileField, file, filename);\n\treturn form;\n};\n/**\n* Where to send a grant's bytes. Shapio's own upload route (local storage) is addressed through the base URL\n* the caller already talks to, which keeps it reachable when PUBLIC_URL differs from that address (the\n* admin's dev server, a proxy, a container network). Bucket URLs (presigned POST) are used as given.\n*/\nconst resolveUploadUrl = (grant, apiBaseUrl) => {\n\tconst ownRoute = `/api/media/uploads/${encodeURIComponent(grant.grantId)}`;\n\tconst url = new URL(grant.upload.url);\n\tconst base = apiBaseUrl.endsWith(\"/\") ? apiBaseUrl : `${apiBaseUrl}/`;\n\treturn url.pathname.endsWith(ownRoute) ? new URL(ownRoute.slice(1), base).href : grant.upload.url;\n};\n//#endregion\n//#region src/errors.ts\nconst isErrorBody = (value) => {\n\tif (typeof value !== \"object\" || value === null || !(\"error\" in value)) return false;\n\tconst { error } = value;\n\treturn typeof error === \"object\" && error !== null && typeof error.code === \"string\" && typeof error.message === \"string\";\n};\n/** Thrown for any non-2xx response. `code` is Shapio's error code, or `HTTP_<status>` if the body had none. */\nvar ShapioApiError = class extends Error {\n\tstatus;\n\tcode;\n\tdetails;\n\tconstructor(status, body) {\n\t\tconst parsed = isErrorBody(body) ? body.error : void 0;\n\t\tsuper(parsed?.message ?? `Request failed with status ${status}`);\n\t\tthis.name = \"ShapioApiError\";\n\t\tthis.status = status;\n\t\tthis.code = parsed?.code ?? `HTTP_${status}`;\n\t\tthis.details = parsed?.details;\n\t}\n};\n//#endregion\nexport { toQueryString as a, resolveUploadUrl as i, buildUploadForm as n, ADMIN_PATHS as o, createMediaApi as r, withId as s, ShapioApiError as t };\n\n//# sourceMappingURL=errors-B4bGc9nd.js.map","import { a as toQueryString, i as resolveUploadUrl, n as buildUploadForm, o as ADMIN_PATHS, r as createMediaApi, s as withId, t as ShapioApiError } from \"./errors-B4bGc9nd.js\";\nimport { DEFAULT_SEO_KEYS, SEO_COMPONENT_ID, SEO_FIELD_IDS, applyTitleTemplate, resolveSeo, seoDefaultsForLocale } from \"@shapio/schema/seo\";\n//#region src/admin/appUsers.ts\n/** App users (Users → App users) and app roles (Settings → Roles → App roles). */\nconst createAppUsersApi = (request) => ({\n\tappUsers: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.appUsers}${toQueryString(query)}`),\n\t\tget: (id) => request(withId(ADMIN_PATHS.appUsers, id)),\n\t\t/** Block/unblock and replace custom roles. Blocking takes effect on the user's next request. */\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.appUsers, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\tremove: (id) => request(withId(ADMIN_PATHS.appUsers, id), { method: \"DELETE\" }),\n\t\t/** 409 NOT_CONFIGURED without APP_AUTH_CONFIRM_EMAIL_URL; 409 ALREADY_CONFIRMED. */\n\t\tresendConfirmation: (id) => request(`${withId(ADMIN_PATHS.appUsers, id)}/resend-confirmation`, { method: \"POST\" })\n\t},\n\tappRoles: {\n\t\tlist: () => request(ADMIN_PATHS.appRoles),\n\t\tget: (id) => request(withId(ADMIN_PATHS.appRoles, id)),\n\t\tcreate: (body) => request(ADMIN_PATHS.appRoles, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** 409 VERSION_CONFLICT when `expectedVersion` is stale. */\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.appRoles, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\tremove: (id) => request(withId(ADMIN_PATHS.appRoles, id), { method: \"DELETE\" })\n\t}\n});\n//#endregion\n//#region src/admin/assist.ts\nconst ASSIST_PATHS = {\n\tstatus: \"/api/admin/assist/status\",\n\taltText: \"/api/admin/assist/alt-text\",\n\tsummarize: \"/api/admin/assist/summarize\",\n\ttranslate: \"/api/admin/assist/translate\",\n\trewrite: \"/api/admin/assist/rewrite\",\n\tschemaDraft: \"/api/admin/assist/schema/draft\",\n\tcontentOpsPropose: \"/api/admin/assist/content-ops/propose\",\n\tcontentOps: \"/api/admin/assist/content-ops\"\n};\n/** Editor assists with the instance's own model provider (documentation/assist.md). */\nconst createAssistApi = (request) => ({ assist: {\n\tstatus: () => request(ASSIST_PATHS.status),\n\taltText: (body) => request(ASSIST_PATHS.altText, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tsummarize: (body) => request(ASSIST_PATHS.summarize, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\ttranslate: (body) => request(ASSIST_PATHS.translate, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\trewrite: (body) => request(ASSIST_PATHS.rewrite, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tschemaDraft: (body) => request(ASSIST_PATHS.schemaDraft, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\t/** Starts a background run (202); poll it with `contentOpsRun`. */\n\tproposeContentOps: (body) => request(ASSIST_PATHS.contentOpsPropose, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tcontentOpsRun: (runId) => request(withId(ASSIST_PATHS.contentOps, runId))\n} });\n//#endregion\n//#region src/admin/changeSets.ts\nconst setPath = (id) => withId(ADMIN_PATHS.changeSets, id);\nconst draftPath = (id, definitionId) => `${setPath(id)}/schema/${encodeURIComponent(definitionId)}`;\n/** Change sets (schema + content shipped as one snapshot) and the snapshot ledger. */\nconst createChangeSetsApi = (request) => ({\n\tchangeSets: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.changeSets}${toQueryString(query)}`),\n\t\tget: (id) => request(setPath(id)),\n\t\tcreate: (body) => request(ADMIN_PATHS.changeSets, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tupdate: (id, body) => request(setPath(id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\t/** Keeps the set as history (`discarded`) and deletes its schema drafts. */\n\t\tdiscard: (id) => request(`${setPath(id)}/discard`, { method: \"POST\" }),\n\t\taddEntry: (id, body) => request(`${setPath(id)}/items`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tremoveItem: (id, itemId) => request(`${setPath(id)}/items/${encodeURIComponent(itemId)}`, { method: \"DELETE\" }),\n\t\tgetSchemaDraft: (id, definitionId) => request(draftPath(id, definitionId)),\n\t\tputSchemaDraft: (id, definitionId, body) => request(draftPath(id, definitionId), {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t}),\n\t\tremoveSchemaDraft: (id, definitionId) => request(draftPath(id, definitionId), { method: \"DELETE\" }),\n\t\treview: (id) => request(`${setPath(id)}/review`),\n\t\t/**\n\t\t* Resolves with the set: `shipped` (or `failed`) when it shipped inline, `shipping` (HTTP 202) when\n\t\t* prerequisites run in the background. Poll `get` until it leaves `shipping`.\n\t\t*/\n\t\tship: (id, body) => request(`${setPath(id)}/ship`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tschedule: (id, body) => request(`${setPath(id)}/schedule`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tunschedule: (id) => request(`${setPath(id)}/unschedule`, { method: \"POST\" }),\n\t\ttimeline: async (id) => (await request(`${setPath(id)}/timeline`)).items,\n\t\tunassigned: (query = {}) => request(`${ADMIN_PATHS.changeSets}/unassigned${toQueryString(query)}`)\n\t},\n\tsnapshots: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.snapshots}${toQueryString(query)}`),\n\t\tget: (seq) => request(`${ADMIN_PATHS.snapshots}/${seq}`),\n\t\t/** Creates an open restore change set (reviewable); nothing goes live until it ships. */\n\t\trestore: (seq) => request(`${ADMIN_PATHS.snapshots}/${seq}/restore`, { method: \"POST\" })\n\t}\n});\n//#endregion\n//#region src/admin/contentQuery.ts\n/**\n* Serializes a content list query into the bracket querystring the content compiler parses\n* (`filters[title][$eq]=A&sort=title:asc&page=2`). Lists repeat the key (`filters[id][$in]=a&filters[id][$in]=b`).\n*/\nconst appendFilter = (params, prefix, value) => {\n\tif (value === void 0 || value === null) return;\n\tif (Array.isArray(value)) {\n\t\tvalue.forEach((item, index) => {\n\t\t\tif (typeof item === \"object\" && item !== null) appendFilter(params, `${prefix}[${index}]`, item);\n\t\t\telse params.append(prefix, String(item));\n\t\t});\n\t\treturn;\n\t}\n\tif (typeof value === \"object\") {\n\t\tfor (const [key, child] of Object.entries(value)) appendFilter(params, `${prefix}[${key}]`, child);\n\t\treturn;\n\t}\n\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") params.append(prefix, String(value));\n};\nconst toContentQueryString = (query = {}) => {\n\tconst params = new URLSearchParams();\n\tif (query.filters) appendFilter(params, \"filters\", query.filters);\n\tfor (const term of query.sort ?? []) params.append(\"sort\", `${term.field}:${term.direction}`);\n\tif (query.page !== void 0) params.set(\"page\", String(query.page));\n\tif (query.pageSize !== void 0) params.set(\"pageSize\", String(query.pageSize));\n\tif (query.q) params.set(\"q\", query.q);\n\tif (query.locale) params.set(\"locale\", query.locale);\n\tfor (const field of query.fields ?? []) params.append(\"fields\", field);\n\tfor (const path of query.populate ?? []) params.append(\"populate\", path);\n\tif (query.status) params.set(\"status\", query.status);\n\tif (query.author) params.set(\"author\", query.author);\n\tconst serialized = params.toString();\n\treturn serialized ? `?${serialized}` : \"\";\n};\n//#endregion\n//#region src/admin/content.ts\nconst modelPath = (modelKey) => withId(ADMIN_PATHS.content, modelKey);\nconst entryPath$1 = (modelKey, id) => withId(modelPath(modelKey), id);\nconst revisionsPath = (modelKey, id) => `${entryPath$1(modelKey, id)}/revisions`;\n/**\n* Content of any model through the generic admin routes (`/api/admin/content/:modelKey`, where `modelKey`\n* is the model's singular API ID for collections too; only the delivery API uses the plural). Drafts are read\n* and written here; publishing is per locale. Writes carry the draft `version` the editor saw and fail with\n* 409 CONTENT_VERSION_CONFLICT (or SCHEMA_CHANGED) when it moved.\n*/\nconst createContentApi = (request) => ({\n\tcontent: {\n\t\tlist: (modelKey, query = {}) => request(`${modelPath(modelKey)}${toContentQueryString(query)}`),\n\t\tget: (modelKey, id, { locale } = {}) => request(`${entryPath$1(modelKey, id)}${toQueryString({ locale })}`),\n\t\t/** Fully validated (`required` included); 422 CONTENT_INVALID with `details.issues`. */\n\t\tcreate: (modelKey, body) => request(modelPath(modelKey), {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** Saves a patch of one locale's draft; `autosave` skips `required` and creates no revision. */\n\t\tupdate: (modelKey, id, body) => request(entryPath$1(modelKey, id), {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t}),\n\t\t/** 409 ENTRY_REFERENCED with `details.referrers` while other entries point at it. */\n\t\tremove: (modelKey, id) => request(entryPath$1(modelKey, id), { method: \"DELETE\" }),\n\t\tduplicate: (modelKey, id) => request(`${entryPath$1(modelKey, id)}/duplicate`, { method: \"POST\" }),\n\t\t/** With `expectedVersion`/`expectedVersions`, 409 CONTENT_VERSION_CONFLICT when a draft moved since. */\n\t\tpublish: (modelKey, id, body = {}) => request(`${entryPath$1(modelKey, id)}/publish`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tunpublish: (modelKey, id, body = {}) => request(`${entryPath$1(modelKey, id)}/unpublish`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** What changing the entry's kind would drop, without changing anything. */\n\t\tpreviewKindChange: (modelKey, id, body) => request(`${entryPath$1(modelKey, id)}/kind${toQueryString({ dryRun: 1 })}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/**\n\t\t* Moves the entry to another kind of its family, dropping the values of fields the target lacks; the\n\t\t* answer carries the entry under its new kind. 409 while it is in an open change set or scheduled.\n\t\t*/\n\t\tchangeKind: (modelKey, id, body) => request(`${entryPath$1(modelKey, id)}/kind`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\trevisions: async (modelKey, id, { locale } = {}) => (await request(`${revisionsPath(modelKey, id)}${toQueryString({ locale })}`)).items,\n\t\t/** Revisions with their authors' names, and the entry's publications (who published, when, how). */\n\t\thistory: (modelKey, id, { locale } = {}) => request(`${revisionsPath(modelKey, id)}${toQueryString({ locale })}`),\n\t\trevision: (modelKey, id, revisionId) => request(withId(revisionsPath(modelKey, id), revisionId)),\n\t\t/** Brings an older revision back as the new draft of its locale (a new revision). */\n\t\trestore: (modelKey, id, revisionId, expectedVersion) => request(`${withId(revisionsPath(modelKey, id), revisionId)}/restore`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: { expectedVersion }\n\t\t})\n\t},\n\textensions: {\n\t\t/** Custom field editors the project installed (`shapio.config` + `extensions/editors/*.js`). */\n\t\teditors: () => request(ADMIN_PATHS.editorManifest),\n\t\t/** Admin color themes the project declares (`shapio.config` `themes`). Public: no session needed. */\n\t\tthemes: () => request(ADMIN_PATHS.extensionThemes)\n\t}\n});\n//#endregion\n//#region src/admin/editing.ts\nconst entryPath = (base, modelKey, id) => withId(withId(base, modelKey), id);\n/** The entry document's endpoints: pre-flight, content health (the Inbox), presence and counts. */\nconst createEditingApi = (request) => ({\n\tpreflight: { \n\t/** What publishing these locales would run into, without publishing (no hooks, no locks). */\nrun: (modelKey, id, body = {}) => request(`${entryPath(ADMIN_PATHS.content, modelKey, id)}/preflight`, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}) },\n\tcontentHealth: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.contentHealth}${toQueryString(query)}`),\n\t\tsummary: () => request(`${ADMIN_PATHS.contentHealth}/summary`)\n\t},\n\tpresence: {\n\t\t/** Heartbeat (every 15s while the document is visible): who else has the entry open, and its drafts. */\n\t\theartbeat: (modelKey, id, body) => request(entryPath(ADMIN_PATHS.presence, modelKey, id), {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t}),\n\t\tentry: (modelKey, id) => request(entryPath(ADMIN_PATHS.presence, modelKey, id)),\n\t\t/** Everyone editing an entry of the model (list rows). */\n\t\tmodel: (modelKey) => request(withId(ADMIN_PATHS.presence, modelKey)),\n\t\tleave: (modelKey, id, tabId) => request(`${entryPath(ADMIN_PATHS.presence, modelKey, id)}${toQueryString({ tabId })}`, { method: \"DELETE\" })\n\t},\n\tcontentCounts: { list: () => request(ADMIN_PATHS.contentCounts) }\n});\n//#endregion\n//#region src/admin/publishing.ts\n/** Jobs, scheduled publications, webhooks, deployment connections and runs, preview (package H). */\nconst createPublishingApi = (request) => ({\n\tjobs: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.jobs}${toQueryString(query)}`),\n\t\tsummary: () => request(`${ADMIN_PATHS.jobs}/summary`),\n\t\tget: (id) => request(withId(ADMIN_PATHS.jobs, id)),\n\t\t/** Dead jobs only: runs again from attempt 1. 409 JOB_NOT_RETRYABLE otherwise. */\n\t\tretry: (id) => request(`${withId(ADMIN_PATHS.jobs, id)}/retry`, { method: \"POST\" })\n\t},\n\tschedules: {\n\t\tlist: (query = {}) => request(`${ADMIN_PATHS.schedules}${toQueryString(query)}`),\n\t\tcreate: (body) => request(ADMIN_PATHS.schedules, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tcancel: (id) => request(withId(ADMIN_PATHS.schedules, id), { method: \"DELETE\" })\n\t},\n\twebhooks: {\n\t\tlist: () => request(ADMIN_PATHS.webhooks),\n\t\tevents: async () => (await request(`${ADMIN_PATHS.webhooks}/events`)).items,\n\t\tget: (id) => request(withId(ADMIN_PATHS.webhooks, id)),\n\t\tcreate: (body) => request(ADMIN_PATHS.webhooks, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.webhooks, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\tremove: (id) => request(withId(ADMIN_PATHS.webhooks, id), { method: \"DELETE\" }),\n\t\trotateSecret: (id) => request(`${withId(ADMIN_PATHS.webhooks, id)}/rotate-secret`, { method: \"POST\" }),\n\t\t/** Queues a `webhook.test` delivery; poll the delivery log for its outcome. */\n\t\ttest: (id) => request(`${withId(ADMIN_PATHS.webhooks, id)}/test`, { method: \"POST\" }),\n\t\tdeliveries: (id, query = {}) => request(`${withId(ADMIN_PATHS.webhooks, id)}/deliveries${toQueryString(query)}`),\n\t\t/** Sends the same payload again as a new delivery. */\n\t\tredeliver: (id, deliveryId) => request(`${withId(ADMIN_PATHS.webhooks, id)}/deliveries/${encodeURIComponent(deliveryId)}/redeliver`, { method: \"POST\" })\n\t},\n\tdeployments: {\n\t\tconnections: {\n\t\t\tlist: () => request(ADMIN_PATHS.deploymentConnections),\n\t\t\tget: (id) => request(withId(ADMIN_PATHS.deploymentConnections, id)),\n\t\t\tcreate: (body) => request(ADMIN_PATHS.deploymentConnections, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody\n\t\t\t}),\n\t\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.deploymentConnections, id), {\n\t\t\t\tmethod: \"PATCH\",\n\t\t\t\tbody\n\t\t\t}),\n\t\t\tremove: (id) => request(withId(ADMIN_PATHS.deploymentConnections, id), { method: \"DELETE\" }),\n\t\t\ttest: (id) => request(`${withId(ADMIN_PATHS.deploymentConnections, id)}/test`, { method: \"POST\" }),\n\t\t\t/** A manual run at the current publication snapshot. */\n\t\t\ttrigger: (id) => request(`${withId(ADMIN_PATHS.deploymentConnections, id)}/runs`, { method: \"POST\" })\n\t\t},\n\t\truns: {\n\t\t\tlist: (query = {}) => request(`${ADMIN_PATHS.deploymentRuns}${toQueryString(query)}`),\n\t\t\tget: (id) => request(withId(ADMIN_PATHS.deploymentRuns, id)),\n\t\t\t/** A new run (linked by `retryOf`) at the current snapshot. */\n\t\t\tretry: (id) => request(`${withId(ADMIN_PATHS.deploymentRuns, id)}/retry`, { method: \"POST\" })\n\t\t}\n\t},\n\tpreview: {\n\t\ttokens: {\n\t\t\tlist: (query = {}) => request(`${ADMIN_PATHS.previewTokens}${toQueryString(query)}`),\n\t\t\tcreate: (body) => request(ADMIN_PATHS.previewTokens, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody\n\t\t\t}),\n\t\t\trevoke: (id) => request(withId(ADMIN_PATHS.previewTokens, id), { method: \"DELETE\" })\n\t\t},\n\t\t/** The site's connections with a preview URL (the entry form's Preview pane). */\n\t\ttargets: () => request(`${ADMIN_PATHS.preview}/targets`),\n\t\t/** The entry form's Preview action: a short-lived entry token and the rendered preview URL. */\n\t\topen: (body) => request(`${ADMIN_PATHS.preview}/open`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t})\n\t}\n});\n//#endregion\n//#region src/admin/schema.ts\nconst DEFINITION_PATHS = {\n\tmodel: ADMIN_PATHS.models,\n\tcomponent: ADMIN_PATHS.components\n};\n/** Models (collections and singletons) and components share one set of endpoints under their own base. */\nconst createDefinitionApi = (request, category) => {\n\tconst base = DEFINITION_PATHS[category];\n\treturn {\n\t\t/** The site's view (shared definitions and its own); `{ scope: 'network' }` lists the shared ones. */\n\t\tlist: async (options = {}) => (await request(`${base}${toQueryString(options)}`)).items,\n\t\tget: (id) => request(withId(base, id)),\n\t\t/** Creates and activates a definition (`pending` when prerequisites must run first). */\n\t\tcreate: (body) => request(base, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/** Plan preview of a create: classification and impact, nothing written. */\n\t\tplanCreate: (definition, scope) => request(`${base}/plan`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: scope ? {\n\t\t\t\tdefinition,\n\t\t\t\tscope\n\t\t\t} : { definition }\n\t\t}),\n\t\t/** Shares a definition with all sites, or keeps it on one (needs schema.create on every site). */\n\t\tchangeScope: (id, body) => request(`${withId(base, id)}/scope`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t}),\n\t\t/** Changes a definition; 409 SCHEMA_VERSION_CONFLICT when `expectedVersion` is stale. */\n\t\tupdate: (id, body) => request(withId(base, id), {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t}),\n\t\tplanUpdate: (id, body) => request(`${withId(base, id)}/plan`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\t/**\n\t\t* Soft delete: entries are kept and reappear if the definition is applied again. Removing the API is a\n\t\t* breaking change: without `acknowledgeBreaking` the server answers 409 SCHEMA_CHANGE_NOT_ACKNOWLEDGED.\n\t\t*/\n\t\tremove: (id, expectedVersion, options = {}) => request(`${withId(base, id)}${toQueryString({\n\t\t\texpectedVersion,\n\t\t\tacknowledgeBreaking: options.acknowledgeBreaking || void 0\n\t\t})}`, { method: \"DELETE\" }),\n\t\trevisions: async (id) => (await request(`${withId(base, id)}/revisions`)).items,\n\t\trevision: (id, revisionId) => request(withId(`${withId(base, id)}/revisions`, revisionId)),\n\t\tchanges: async (id) => (await request(`${withId(base, id)}/changes`)).items\n\t};\n};\n/** Schema-wide endpoints: the version summary, planned-change status, the read-only lock, locales. */\nconst createSchemaApi = (request) => ({\n\tmodels: createDefinitionApi(request, \"model\"),\n\tcomponents: createDefinitionApi(request, \"component\"),\n\tschema: {\n\t\t/** The global schema version and every visible definition's version (cheap; poll it for changes). */\n\t\tsummary: () => request(ADMIN_PATHS.schema),\n\t\tchange: (changeId) => request(withId(ADMIN_PATHS.schemaChanges, changeId)),\n\t\t/** Every definition in the pull format, with the schema version they come from (`shapio schema pull`). */\n\t\texport: (options = {}) => request(`${ADMIN_PATHS.schemaExport}${toQueryString(options)}`),\n\t\t/** Applies definition files live through the change planner; refuses when the base moved (409). */\n\t\tapply: (body) => request(ADMIN_PATHS.schemaApply, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tsettings: () => request(ADMIN_PATHS.schemaSettings),\n\t\tupdateSettings: (body) => request(ADMIN_PATHS.schemaSettings, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t})\n\t},\n\tlocales: {\n\t\tlist: async () => (await request(ADMIN_PATHS.locales)).items,\n\t\tcreate: (body) => request(ADMIN_PATHS.locales, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tupdate: (code, body) => request(withId(ADMIN_PATHS.locales, code), {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t}),\n\t\t/** A contract change: without `acknowledgeBreaking` the server answers 409 SCHEMA_CHANGE_NOT_ACKNOWLEDGED. */\n\t\tsetDefault: (code, acknowledgeBreaking) => request(`${withId(ADMIN_PATHS.locales, code)}/default`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: { acknowledgeBreaking }\n\t\t}),\n\t\t/**\n\t\t* Deletes a locale and purges its content. When content exists and `acknowledgeDestructive` is false,\n\t\t* the server answers 409 SCHEMA_CHANGE_NOT_ACKNOWLEDGED with `details.plan.impact` (`affectedHeads`,\n\t\t* `deletedEntries`, `movedEntries`).\n\t\t*/\n\t\tremove: (code, acknowledgeDestructive) => request(`${withId(ADMIN_PATHS.locales, code)}${toQueryString({ acknowledgeDestructive: acknowledgeDestructive || void 0 })}`, { method: \"DELETE\" })\n\t}\n});\n//#endregion\n//#region src/admin/sites.ts\nconst SITES_PATHS = { sites: \"/api/admin/sites\" };\n/** The admin API header that names the site a site-scoped request is about (default: the primary site). */\nconst SITE_HEADER = \"shapio-site\";\nconst sitePath = (id) => `${SITES_PATHS.sites}/${encodeURIComponent(id)}`;\n/** Sites (network routes): listing shows the sites the caller holds a role on; changes need `sites.manage`. */\nconst createSitesApi = (request) => ({ sites: {\n\tlist: () => request(SITES_PATHS.sites),\n\tget: (id) => request(sitePath(id)),\n\tcreate: (body) => request(SITES_PATHS.sites, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tupdate: (id, body) => request(sitePath(id), {\n\t\tmethod: \"PATCH\",\n\t\tbody\n\t}),\n\t/** Only an empty site (409 `SITE_NOT_EMPTY`); never the primary site (409 `SITE_IS_PRIMARY`). */\n\tremove: (id) => request(sitePath(id), { method: \"DELETE\" }),\n\t/** The app roles bound to the site's anonymous callers (`public`) and signed-in app users (`authenticated`). */\n\tappRoles: {\n\t\tget: (id) => request(`${sitePath(id)}/app-roles`),\n\t\t/** Replaces both bindings (`roles.manage`). */\n\t\tset: (id, body) => request(`${sitePath(id)}/app-roles`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t})\n\t}\n} });\n//#endregion\n//#region src/admin/usage.ts\nconst USAGE_PATHS = { fields: \"/api/admin/usage/fields\" };\n/** Who reads which fields (needs `tokens.manage`). */\nconst createUsageApi = (request) => ({ usage: { fields: (query) => request(`${USAGE_PATHS.fields}${toQueryString(query)}`) } });\n//#endregion\n//#region src/admin/types.ts\nconst CONTENT_ACTIONS = [\n\t\"read\",\n\t\"create\",\n\t\"update\",\n\t\"delete\",\n\t\"publish\",\n\t\"schemaManage\"\n];\n/**\n* What a delivery role grants: `read`, and `readDrafts` (drafts mode: the token's site may read drafts with\n* `publicationState=draft`). `readDrafts` always covers every model and is never granted to admin roles.\n*/\nconst DELIVERY_ACTIONS = [\"read\", \"readDrafts\"];\n/**\n* Network actions: about the whole instance. Only roles assigned on every site grant them, so a role held\n* on one site never reaches the network.\n*/\nconst NETWORK_ACTIONS = [\n\t\"schema.create\",\n\t\"users.manage\",\n\t\"roles.manage\",\n\t\"audit.read\",\n\t\"sites.manage\"\n];\n/** Site actions: about one site's library, tokens and publishing. */\nconst SITE_ACTIONS = [\n\t\"tokens.manage\",\n\t\"media.read\",\n\t\"media.write\",\n\t\"media.manage\",\n\t\"publishing.manage\",\n\t\"webhooks.manage\",\n\t\"deployments.manage\",\n\t\"deployments.trigger\",\n\t\"changes.manage\",\n\t\"changes.ship\"\n];\n/** Actions not scoped to a model: network actions and site actions. */\nconst GLOBAL_ACTIONS = [\n\t\"schema.create\",\n\t\"users.manage\",\n\t\"roles.manage\",\n\t\"tokens.manage\",\n\t\"audit.read\",\n\t\"sites.manage\",\n\t\"media.read\",\n\t\"media.write\",\n\t\"media.manage\",\n\t\"publishing.manage\",\n\t\"webhooks.manage\",\n\t\"deployments.manage\",\n\t\"deployments.trigger\",\n\t\"changes.manage\",\n\t\"changes.ship\",\n\t\"site.settings\"\n];\n//#endregion\n//#region src/admin/publishingTypes.ts\nconst JOB_STATUSES = [\n\t\"pending\",\n\t\"running\",\n\t\"succeeded\",\n\t\"dead\"\n];\nconst PUBLICATION_ACTIONS = [\"publish\", \"unpublish\"];\nconst SCHEDULE_STATUSES = [\n\t\"scheduled\",\n\t\"done\",\n\t\"failed\",\n\t\"canceled\"\n];\nconst DEPLOYMENT_PROVIDERS = [\n\t\"generic_webhook\",\n\t\"cloudflare_pages\",\n\t\"vercel\",\n\t\"netlify\",\n\t\"github\"\n];\nconst DEPLOYMENT_TRIGGERS = [\n\t\"publish\",\n\t\"change_set\",\n\t\"schema\",\n\t\"manual\"\n];\nconst DEPLOYMENT_RUN_STATUSES = [\n\t\"queued\",\n\t\"triggered\",\n\t\"building\",\n\t\"deployed\",\n\t\"failed\",\n\t\"unknown\"\n];\n//#endregion\n//#region src/admin/appUsersTypes.ts\n/** What app roles may grant: content actions only. */\nconst APP_CONTENT_ACTIONS = [\n\t\"read\",\n\t\"create\",\n\t\"update\",\n\t\"delete\",\n\t\"publish\"\n];\n/** Built-in app role keys: `public` applies to anonymous callers, `authenticated` to every app user. */\nconst BUILT_IN_APP_ROLE_KEYS = [\"public\", \"authenticated\"];\n//#endregion\n//#region src/admin/changeSetTypes.ts\n/**\n* Change sets and snapshots (developer-face plan §5), mirroring the TypeBox route schemas in\n* apps/api/src/routes/admin/{changeSets,snapshots}/schemas.ts. Dates are ISO-8601 strings.\n*/\nconst CHANGE_SET_STATUSES = [\n\t\"open\",\n\t\"scheduled\",\n\t\"shipping\",\n\t\"shipped\",\n\t\"failed\",\n\t\"discarded\"\n];\nconst NOT_RESTORABLE_REASONS = [\n\t\"entry_deleted\",\n\t\"model_missing\",\n\t\"publishing_disabled\",\n\t\"localization_changed\",\n\t\"locale_missing\",\n\t\"invalid\",\n\t\"unique_conflict\",\n\t\"kind_changed\"\n];\nconst SNAPSHOT_SOURCES = [\n\t\"publish\",\n\t\"unpublish\",\n\t\"delete\",\n\t\"schedule\",\n\t\"change_set\",\n\t\"schema\",\n\t\"conversion\",\n\t\"import\",\n\t\"kind_change\",\n\t\"legacy\"\n];\n//#endregion\n//#region src/admin/editingTypes.ts\n/**\n* Shapes of the entry document's endpoints (editor experience, E0b): publish pre-flight, content health\n* findings, presence and per-model counts. Sentences are never sent: the admin builds them from `rule` and\n* `params` with its translations.\n*/\n/** Health rules evaluated per entry (`apps/api/src/services/contentHealth.ts`). */\nconst HEALTH_RULES = [\n\t\"requiredEmpty\",\n\t\"altMissing\",\n\t\"localeMissing\",\n\t\"relationMissing\",\n\t\"mediaMissing\",\n\t\"relationUnpublished\",\n\t\"uniqueConflict\",\n\t\"staleDraft\",\n\t\"unpublishedChanges\"\n];\n//#endregion\n//#region src/admin/assistTypes.ts\nconst CONTENT_OPS_RULES = [\"altMissing\", \"localeMissing\"];\n//#endregion\n//#region src/admin/index.ts\n/**\n* Admin endpoints: identity (setup, auth, sessions, users, invitations, roles, tokens, audit) and the schema\n* registry (models, components, schema, locales), the media library and content.\n*/\nconst createAdminApi = (request) => ({\n\tsetup: {\n\t\tstatus: () => request(ADMIN_PATHS.setup),\n\t\tcomplete: (body) => request(ADMIN_PATHS.setup, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t})\n\t},\n\tauth: {\n\t\tcsrf: () => request(ADMIN_PATHS.csrf),\n\t\tlogin: (body) => request(ADMIN_PATHS.login, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tlogout: () => request(ADMIN_PATHS.logout, { method: \"POST\" }),\n\t\tme: () => request(ADMIN_PATHS.me),\n\t\tupdateProfile: (body) => request(ADMIN_PATHS.me, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\t/** The session is rotated: the response carries the new session's CSRF token. */\n\t\tchangePassword: (body) => request(ADMIN_PATHS.password, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\trequestPasswordReset: (body) => request(ADMIN_PATHS.passwordReset, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tconfirmPasswordReset: (body) => request(ADMIN_PATHS.passwordResetConfirm, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t})\n\t},\n\tsessions: {\n\t\tlist: () => request(ADMIN_PATHS.sessions),\n\t\trevoke: (id) => request(withId(ADMIN_PATHS.sessions, id), { method: \"DELETE\" })\n\t},\n\tusers: {\n\t\tlist: () => request(ADMIN_PATHS.users),\n\t\tget: (id) => request(withId(ADMIN_PATHS.users, id)),\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.users, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\tremove: (id) => request(withId(ADMIN_PATHS.users, id), { method: \"DELETE\" }),\n\t\trevokeSessions: (id) => request(`${withId(ADMIN_PATHS.users, id)}/sessions`, { method: \"DELETE\" })\n\t},\n\tinvitations: {\n\t\tlist: () => request(ADMIN_PATHS.invitations),\n\t\tcreate: (body) => request(ADMIN_PATHS.invitations, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\trevoke: (id) => request(withId(ADMIN_PATHS.invitations, id), { method: \"DELETE\" }),\n\t\t/** A fresh link to send by hand; any earlier link for this invitation stops working. */\n\t\tlink: (id) => request(`${withId(ADMIN_PATHS.invitations, id)}/link`, { method: \"POST\" }),\n\t\t/** Public: the token travels in the body, never in a URL the server logs. */\n\t\tinspect: (token) => request(ADMIN_PATHS.inspectInvitation, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: { token }\n\t\t}),\n\t\taccept: (body) => request(ADMIN_PATHS.acceptInvitation, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t})\n\t},\n\troles: {\n\t\tlist: () => request(ADMIN_PATHS.roles),\n\t\tget: (id) => request(withId(ADMIN_PATHS.roles, id)),\n\t\tcreate: (body) => request(ADMIN_PATHS.roles, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\tupdate: (id, body) => request(withId(ADMIN_PATHS.roles, id), {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody\n\t\t}),\n\t\tremove: (id) => request(withId(ADMIN_PATHS.roles, id), { method: \"DELETE\" })\n\t},\n\ttokens: {\n\t\tlist: () => request(ADMIN_PATHS.tokens),\n\t\tcreate: (body) => request(ADMIN_PATHS.tokens, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t}),\n\t\trevoke: (id) => request(withId(ADMIN_PATHS.tokens, id), { method: \"DELETE\" })\n\t},\n\taudit: { list: (query = {}) => request(`${ADMIN_PATHS.audit}${toQueryString(query)}`) },\n\t...createSchemaApi(request),\n\t...createMediaApi(request),\n\t...createContentApi(request),\n\t...createEditingApi(request),\n\t...createPublishingApi(request),\n\t...createAppUsersApi(request),\n\t...createChangeSetsApi(request),\n\t...createUsageApi(request),\n\t...createSitesApi(request),\n\t...createAssistApi(request)\n});\n//#endregion\n//#region src/appAuth/index.ts\nconst APP_AUTH_PATHS = {\n\tregister: \"/api/app-auth/register\",\n\tlogin: \"/api/app-auth/login\",\n\trefresh: \"/api/app-auth/refresh\",\n\tlogout: \"/api/app-auth/logout\",\n\tme: \"/api/app-auth/me\",\n\tpassword: \"/api/app-auth/me/password\",\n\tconfirmEmail: \"/api/app-auth/confirm-email\",\n\tresendConfirmation: \"/api/app-auth/confirm-email/resend\",\n\tpasswordReset: \"/api/app-auth/password-reset\",\n\tpasswordResetConfirm: \"/api/app-auth/password-reset/confirm\",\n\tproviders: \"/api/app-auth/providers\",\n\toauthExchange: \"/api/app-auth/oauth/exchange\"\n};\n/**\n* App-user endpoints. Calls that act as the signed-in user need a client created with `token: accessToken`.\n* `baseUrl` is the client's base URL, used to build the OAuth start link the browser navigates to.\n*/\nconst createAppAuthApi = (request, baseUrl) => ({\n\tregister: (body) => request(APP_AUTH_PATHS.register, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tlogin: (body) => request(APP_AUTH_PATHS.login, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\trefresh: (refreshToken) => request(APP_AUTH_PATHS.refresh, {\n\t\tmethod: \"POST\",\n\t\tbody: { refreshToken }\n\t}),\n\t/**\n\t* Signs the account out everywhere: this login's refresh tokens are revoked, and every access token the\n\t* account holds (on any device) is refused from the next request. Other logins recover with their own\n\t* refresh token.\n\t*/\n\tlogout: (refreshToken) => request(APP_AUTH_PATHS.logout, {\n\t\tmethod: \"POST\",\n\t\tbody: { refreshToken }\n\t}),\n\t/** The signed-in user. Answers 401 once the account logged out anywhere, changed its password or was blocked. */\n\tme: () => request(APP_AUTH_PATHS.me),\n\tupdateMe: (body) => request(APP_AUTH_PATHS.me, {\n\t\tmethod: \"PATCH\",\n\t\tbody\n\t}),\n\t/** Returns a new session; every other sign-in of the account is revoked. */\n\tchangePassword: (body) => request(APP_AUTH_PATHS.password, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tdeleteMe: (body = {}) => request(APP_AUTH_PATHS.me, {\n\t\tmethod: \"DELETE\",\n\t\tbody\n\t}),\n\t/** The token from the `#token=` fragment of the confirmation link. */\n\tconfirmEmail: (token) => request(APP_AUTH_PATHS.confirmEmail, {\n\t\tmethod: \"POST\",\n\t\tbody: { token }\n\t}),\n\tresendConfirmation: (email) => request(APP_AUTH_PATHS.resendConfirmation, {\n\t\tmethod: \"POST\",\n\t\tbody: { email }\n\t}),\n\trequestPasswordReset: (email) => request(APP_AUTH_PATHS.passwordReset, {\n\t\tmethod: \"POST\",\n\t\tbody: { email }\n\t}),\n\tconfirmPasswordReset: (body) => request(APP_AUTH_PATHS.passwordResetConfirm, {\n\t\tmethod: \"POST\",\n\t\tbody\n\t}),\n\tproviders: async () => (await request(APP_AUTH_PATHS.providers)).providers,\n\t/**\n\t* Where to send the browser to sign in with a provider. `codeChallenge` comes from `createPkcePair()`;\n\t* keep its `codeVerifier` until the browser returns. It comes back to `redirectTo` (an allowed return URL,\n\t* by default an origin listed in CORS_ORIGINS) with `?code=` (pass it to `exchangeCode`) or `?error=`.\n\t*/\n\toauthStartUrl: (provider, redirectTo, codeChallenge) => `${baseUrl.replace(/\\/+$/, \"\")}/api/app-auth/oauth/${provider}/start?redirectTo=${encodeURIComponent(redirectTo)}&codeChallenge=${encodeURIComponent(codeChallenge)}`,\n\t/** Trades the one-time code for a session. A wrong verifier spends the code: start the sign-in again. */\n\texchangeCode: (code, codeVerifier) => request(APP_AUTH_PATHS.oauthExchange, {\n\t\tmethod: \"POST\",\n\t\tbody: {\n\t\t\tcode,\n\t\t\tcodeVerifier\n\t\t}\n\t})\n});\n//#endregion\n//#region src/nextCache.ts\nconst TAG_PREFIX = \"shapio\";\n/**\n* A route key and each ancestor's, root first: `posts/guides` → `posts`, `posts/guides`. A type that extends\n* another is read under a nested route key, and its entries are also in every ancestor's list.\n*/\nconst routeKeyPrefixes = (routeKey) => {\n\tconst segments = routeKey.split(\"/\");\n\treturn segments.map((_, index) => segments.slice(0, index + 1).join(\"/\"));\n};\nconst modelTag = (routeKey) => `${TAG_PREFIX}:${routeKey}`;\nconst entryTag = (routeKey, entryId) => `${TAG_PREFIX}:${routeKey}:${entryId}`;\n/**\n* The cache tags delivery reads carry (`revalidateTag(shapioTags.entry('articles', id), { expire: 0 })`).\n* Models are named by their route key: a collection's plural API ID, a singleton's API ID, and for a type that\n* extends another its ancestors' plural API IDs and its own joined by `/` (`posts/guides`).\n*/\nconst shapioTags = {\n\t/** Every delivery read of the site; `shapio:site` when the client names no site. */\n\tsite: (siteKey) => siteKey === void 0 ? `${TAG_PREFIX}:site` : `${TAG_PREFIX}:site:${siteKey}`,\n\t/** Every read of one model (lists, singletons and its entries). */\n\tmodel: modelTag,\n\t/** Reads of one entry by its ID. */\n\tentry: entryTag,\n\t/**\n\t* Everything to revalidate when an entry of `routeKey` changes (a webhook's or a snapshot diff's\n\t* `routeKey`): the model and entry tags of its route key and of every ancestor's, since a Guide is also\n\t* in the Posts list and readable as `posts/<id>`. `shapioTags.changed('posts/guides', id)` gives\n\t* `shapio:posts`, `shapio:posts:<id>`, `shapio:posts/guides` and `shapio:posts/guides:<id>`. Without an\n\t* entry ID, the model tags only.\n\t*/\n\tchanged: (routeKey, entryId) => routeKeyPrefixes(routeKey).flatMap((prefix) => entryId === void 0 ? [modelTag(prefix)] : [modelTag(prefix), entryTag(prefix, entryId)])\n};\n/** Spelled out so bundlers that inline `process.env.NEXT_RUNTIME` see it; guarded for browsers. */\nconst isNextRuntime = () => {\n\ttry {\n\t\treturn typeof process !== \"undefined\" && Boolean(process.env.NEXT_RUNTIME);\n\t} catch {\n\t\treturn false;\n\t}\n};\n/** The `cache` and `next` fetch options of one delivery read; empty outside Next unless asked for. */\nconst nextFetchInit = ({ client, read, tags, pinned, drafts = false }) => {\n\tif (drafts) return client !== void 0 && client !== false || read !== void 0 && read !== false || isNextRuntime() ? { cache: \"no-store\" } : {};\n\tif (read === false || read === void 0 && client === false) return {};\n\tconst configured = client === false ? read : read === void 0 ? client : {\n\t\t...client,\n\t\t...read\n\t};\n\tif (configured === void 0 && !isNextRuntime()) return {};\n\tif (pinned && read?.cache === void 0) return {\n\t\tcache: \"force-cache\",\n\t\tnext: { tags }\n\t};\n\tconst cache = configured?.cache;\n\tconst revalidate = configured?.revalidate;\n\treturn {\n\t\t...cache === void 0 ? {} : { cache },\n\t\tnext: {\n\t\t\ttags,\n\t\t\t...revalidate === void 0 ? {} : { revalidate }\n\t\t}\n\t};\n};\n//#endregion\n//#region src/delivery.ts\nconst DELIVERY_PATH = \"/api/content\";\n/**\n* The delivery path of a route key. A type that extends another has a nested key (`posts/guides`), sent as\n* nested path segments: each segment is encoded, the `/` between them never is.\n*/\nconst routePath = (routeKey) => `${DELIVERY_PATH}/${routeKey.split(\"/\").map(encodeURIComponent).join(\"/\")}`;\n/**\n* The content query string plus `snapshot`, `richText` and `seo`, which only delivery reads take, and\n* `publicationState=draft` in drafts mode.\n*/\nconst deliveryQueryString = ({ snapshot, richText, seo, ...query }, drafts) => {\n\tconst extra = [\n\t\t...snapshot === void 0 ? [] : [`snapshot=${encodeURIComponent(String(snapshot))}`],\n\t\t...richText === void 0 ? [] : [`richText=${encodeURIComponent(richText)}`],\n\t\t...seo === void 0 ? [] : [`seo=${encodeURIComponent(seo)}`],\n\t\t...drafts ? [\"publicationState=draft\"] : []\n\t];\n\tconst base = toContentQueryString(query);\n\tif (extra.length === 0) return base;\n\treturn base ? `${base}&${extra.join(\"&\")}` : `?${extra.join(\"&\")}`;\n};\n/** Drafts cannot be pinned: the server refuses `snapshot` with drafts, and so does the client, before sending. */\nconst draftsPinned = () => Promise.reject(/* @__PURE__ */ new Error(\"Drafts mode reads saved drafts, which have no publication snapshot: leave `snapshot` out when the client has `drafts: true`\"));\n/**\n* Published content, typed by the caller (`delivery.list<Article>('articles', { locale: 'fr', snapshot })`).\n* A collection is read with `list` (a page) and `get` (one entry); a singleton with `singleton`. A type that\n* extends another is read by its nested route key (`delivery.list('posts/guides')`); a parent's list\n* holds every kind, each entry naming its own in `__model`. Each read\n* takes Next.js cache options last and is tagged for `revalidateTag` (nextCache.ts): lists and singletons with\n* the site and model tags, `get` with the entry's tag too. In drafts mode (`drafts: true`) every read asks for\n* drafts (`publicationState=draft`), is never cached or tagged under Next, and refuses a pinned snapshot.\n*/\nconst createDeliveryApi = (request, cacheContext) => {\n\tconst { drafts } = cacheContext;\n\tconst fetchInit = (tags, query, { next }) => nextFetchInit({\n\t\tclient: cacheContext.next,\n\t\tread: next,\n\t\ttags,\n\t\tpinned: query.snapshot !== void 0,\n\t\tdrafts\n\t});\n\tconst read = (path, tags, query, options) => drafts && query.snapshot !== void 0 ? draftsPinned() : request(`${path}${deliveryQueryString(query, drafts)}`, fetchInit(tags, query, options));\n\tconst siteTag = shapioTags.site(cacheContext.site);\n\treturn {\n\t\tlist: (routeKey, query = {}, options = {}) => read(routePath(routeKey), [siteTag, shapioTags.model(routeKey)], query, options),\n\t\tsingleton: (apiKey, query = {}, options = {}) => read(routePath(apiKey), [siteTag, shapioTags.model(apiKey)], query, options),\n\t\tget: (routeKey, id, query = {}, options = {}) => read(`${routePath(routeKey)}/${encodeURIComponent(id)}`, [\n\t\t\tsiteTag,\n\t\t\tshapioTags.model(routeKey),\n\t\t\tshapioTags.entry(routeKey, id)\n\t\t], query, options)\n\t};\n};\n//#endregion\n//#region src/siteDelivery.ts\nconst DELIVERY_SITE_PATH = \"/api/site\";\n/**\n* The request's site as delivery sees it (key, name, SEO defaults), with the client's token and site. Under\n* Next.js the read carries the site tag (nextCache.ts); in drafts mode it is `no-store` and untagged instead\n* (the site has no draft state, so no `publicationState` is sent).\n*/\nconst createSiteApi = (request, cacheContext) => ({ get: ({ next } = {}) => request(DELIVERY_SITE_PATH, nextFetchInit({\n\tclient: cacheContext.next,\n\tread: next,\n\ttags: [shapioTags.site(cacheContext.site)],\n\tpinned: false,\n\tdrafts: cacheContext.drafts\n})) });\n//#endregion\n//#region src/snapshots.ts\nconst SNAPSHOT_PATHS = {\n\tcurrent: \"/api/snapshots/current\",\n\tchanges: \"/api/snapshots/changes\"\n};\n/** Snapshots and the diff between two of them, for incremental site builds (delivery credentials). */\nconst createSnapshotsApi = (request) => {\n\tconst changes = (query) => request(`${SNAPSHOT_PATHS.changes}${toQueryString(query)}`);\n\treturn {\n\t\tcurrent: () => request(SNAPSHOT_PATHS.current),\n\t\tchanges,\n\t\t/** Every change between `from` and `to`, following `nextCursor` until the last page. */\n\t\tallChanges: async (query) => {\n\t\t\tconst items = [];\n\t\t\tlet page = await changes(query);\n\t\t\titems.push(...page.items);\n\t\t\twhile (page.nextCursor !== null) {\n\t\t\t\tpage = await changes({\n\t\t\t\t\t...query,\n\t\t\t\t\tto: page.to,\n\t\t\t\t\tafter: page.nextCursor\n\t\t\t\t});\n\t\t\t\titems.push(...page.items);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tfrom: page.from,\n\t\t\t\tto: page.to,\n\t\t\t\tschemaVersions: page.schemaVersions,\n\t\t\t\titems\n\t\t\t};\n\t\t}\n\t};\n};\n//#endregion\n//#region src/deliveryClient.ts\n/**\n* The read side of the client over any transport: published content (`delivery`), the site (`site`) and\n* publication snapshots (`snapshots`). `createClient` builds it over HTTP; `@shapio/local` over the delivery\n* API running in the same process. The transport receives exactly the paths the HTTP client sends.\n*/\nconst createDeliveryClient = (request, { site, next, drafts = false } = {}) => {\n\tconst cacheContext = {\n\t\tsite,\n\t\tnext,\n\t\tdrafts\n\t};\n\treturn {\n\t\t/** Published content (the delivery API; drafts in drafts mode), typed by the caller. */\n\t\tdelivery: createDeliveryApi(request, cacheContext),\n\t\t/** The site as delivery sees it: key, name and SEO defaults (`GET /api/site`). */\n\t\tsite: createSiteApi(request, cacheContext),\n\t\t/** Publication snapshots and the diff between two (incremental builds). */\n\t\tsnapshots: createSnapshotsApi(request)\n\t};\n};\n//#endregion\n//#region src/site.ts\n/** Delivery reads name their site with `?site=`; everything else with the `Shapio-Site` header. */\nconst SITE_QUERY_PARAMETER = \"site\";\n/** Delivery reads (content, snapshots, the site): a GET there carries the site in its URL. */\nconst DELIVERY_READ_PREFIXES = [\n\t`${DELIVERY_PATH}/`,\n\t`${DELIVERY_PATH}?`,\n\t\"/api/snapshots/\",\n\t`${DELIVERY_SITE_PATH}?`\n];\nconst isDeliveryRead = (method, path) => method === \"GET\" && (path === \"/api/content\" || path === \"/api/site\" || Object.values(SNAPSHOT_PATHS).some((snapshotPath) => path === snapshotPath) || DELIVERY_READ_PREFIXES.some((prefix) => path.startsWith(prefix)));\nconst namesSite = (path) => {\n\tconst index = path.indexOf(\"?\");\n\treturn index !== -1 && new URLSearchParams(path.slice(index + 1)).has(\"site\");\n};\n/**\n* Where a request names the client's site (sites plan §H). Delivery GETs put it in the query string: a\n* simple cross-origin GET needs no CORS preflight, and URL-keyed CDN caches keep sites apart. Every other\n* request sends the `Shapio-Site` header. A path that already names a site is left as it is.\n*/\nconst applySite = (site, method, path) => {\n\tif (site === void 0 || namesSite(path)) return {\n\t\tpath,\n\t\theaders: {}\n\t};\n\tif (isDeliveryRead(method, path)) {\n\t\tconst parameter = `${SITE_QUERY_PARAMETER}=${encodeURIComponent(site)}`;\n\t\treturn {\n\t\t\tpath: `${path}${path.includes(\"?\") ? \"&\" : \"?\"}${parameter}`,\n\t\t\theaders: {}\n\t\t};\n\t}\n\treturn {\n\t\tpath,\n\t\theaders: { [SITE_HEADER]: site }\n\t};\n};\n//#endregion\n//#region src/request.ts\nconst parseBody = async (response) => {\n\tconst text = await response.text();\n\tif (text.length === 0) return;\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn text;\n\t}\n};\n/** Builds the JSON request function every endpoint group uses. Non-2xx responses throw ShapioApiError. */\nconst createRequest = ({ baseUrl, token, fetch, credentials, headers, site }) => {\n\tconst origin = baseUrl.replace(/\\/+$/, \"\");\n\treturn async (requestPath, { method = \"GET\", body, signal, cache, next } = {}) => {\n\t\tconst { path, headers: siteHeaders } = applySite(site, method, requestPath);\n\t\tconst requestHeaders = {\n\t\t\taccept: \"application/json\",\n\t\t\t...siteHeaders,\n\t\t\t...headers?.()\n\t\t};\n\t\tif (token) requestHeaders.authorization = `Bearer ${token}`;\n\t\tif (body !== void 0) requestHeaders[\"content-type\"] = \"application/json\";\n\t\tconst init = {\n\t\t\tmethod,\n\t\t\theaders: requestHeaders,\n\t\t\t...body !== void 0 ? { body: JSON.stringify(body) } : {},\n\t\t\t...signal ? { signal } : {},\n\t\t\t...credentials ? { credentials } : {},\n\t\t\t...cache ? { cache } : {},\n\t\t\t...next ? { next } : {}\n\t\t};\n\t\tconst response = await fetch(`${origin}${path}`, init);\n\t\tconst parsed = await parseBody(response);\n\t\tif (!response.ok) throw new ShapioApiError(response.status, parsed);\n\t\treturn parsed;\n\t};\n};\n//#endregion\n//#region src/client.ts\nconst createClient = ({ baseUrl, token, fetch = globalThis.fetch, credentials, headers, site, next, drafts }) => {\n\tconst request = createRequest({\n\t\tbaseUrl,\n\t\ttoken,\n\t\tfetch,\n\t\tcredentials,\n\t\theaders,\n\t\tsite\n\t});\n\tconst reads = createDeliveryClient(request, {\n\t\tsite,\n\t\tnext,\n\t\t...drafts !== void 0 ? { drafts } : {}\n\t});\n\treturn {\n\t\t/**\n\t\t* Any Shapio route, e.g. the delivery API. Delivery paths use the model's route key: a collection's\n\t\t* plural API ID (`request('/api/content/articles')`, `/api/content/articles/<id>`), a singleton's API ID\n\t\t* (`/api/content/homepage`). The admin API (`admin.*`) always uses the singular API ID.\n\t\t*/\n\t\trequest,\n\t\tsystem: {\n\t\t\thealth: (signal) => request(\"/api/health\", signal ? { signal } : {}),\n\t\t\tready: (signal) => request(\"/api/ready\", signal ? { signal } : {}),\n\t\t\tversion: (signal) => request(\"/api/version\", signal ? { signal } : {})\n\t\t},\n\t\t/** Published content (the delivery API), typed by the caller. */\n\t\tdelivery: reads.delivery,\n\t\t/** The site as delivery sees it: key, name and SEO defaults (`GET /api/site`). */\n\t\tsite: reads.site,\n\t\tadmin: createAdminApi(request),\n\t\t/** Publication snapshots and the diff between two (incremental builds). */\n\t\tsnapshots: reads.snapshots,\n\t\t/** End users of your sites and apps: sign-up, sign-in, tokens, OAuth. */\n\t\tappAuth: createAppAuthApi(request, baseUrl)\n\t};\n};\n//#endregion\n//#region src/webhooks.ts\n/**\n* Verifying Shapio's signed webhooks and deploy triggers on the receiving side (a site's revalidate route,\n* a build hook). The scheme is the server's (`apps/api/src/publishing/signature.ts`):\n* `X-Shapio-Signature: v1=<hex HMAC-SHA256(secret, \"<timestamp>.<raw body>\")>` with\n* `X-Shapio-Timestamp: <unix seconds>`; several comma-separated `v1=` values are accepted (secret rotation).\n* Uses Web Crypto, so it runs in Node, edge runtimes and browsers alike.\n*/\nconst WEBHOOK_SIGNATURE_HEADER = \"x-shapio-signature\";\nconst WEBHOOK_TIMESTAMP_HEADER = \"x-shapio-timestamp\";\nconst WEBHOOK_EVENT_HEADER = \"x-shapio-event\";\n/** Requests signed further from now than this are rejected (replay protection). */\nconst WEBHOOK_TOLERANCE_SECONDS = 300;\nconst SIGNATURE_VERSION = \"v1\";\nconst toHex = (bytes) => Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n/** Compares two strings without returning early on the first difference. */\nconst constantTimeEqual = (a, b) => {\n\tlet difference = a.length ^ b.length;\n\tfor (let index = 0; index < Math.max(a.length, b.length); index += 1) difference |= (a.charCodeAt(index) || 0) ^ (b.charCodeAt(index) || 0);\n\treturn difference === 0;\n};\nconst expectedSignature = async (secret, timestamp, body) => {\n\tconst encoder = new TextEncoder();\n\tconst key = await globalThis.crypto.subtle.importKey(\"raw\", encoder.encode(secret), {\n\t\tname: \"HMAC\",\n\t\thash: \"SHA-256\"\n\t}, false, [\"sign\"]);\n\tconst mac = await globalThis.crypto.subtle.sign(\"HMAC\", key, encoder.encode(`${timestamp}.${body}`));\n\treturn `${SIGNATURE_VERSION}=${toHex(mac)}`;\n};\n/** Checks a Shapio signature; `{ ok: false, reason }` says why it was refused (never throws for bad input). */\nconst verifyWebhookSignature = async ({ secret, signature, timestamp, body, now = /* @__PURE__ */ new Date(), toleranceSeconds = 300 }) => {\n\tif (!signature || !timestamp || !/^\\d{1,12}$/.test(timestamp)) return {\n\t\tok: false,\n\t\treason: \"missing signature or timestamp\"\n\t};\n\tconst seconds = Number(timestamp);\n\tif (Math.abs(now.getTime() / 1e3 - seconds) > toleranceSeconds) return {\n\t\tok: false,\n\t\treason: \"timestamp outside the allowed window\"\n\t};\n\tconst expected = await expectedSignature(secret, seconds, body);\n\treturn signature.split(\",\").map((candidate) => candidate.trim()).some((candidate) => constantTimeEqual(candidate, expected)) ? { ok: true } : {\n\t\tok: false,\n\t\treason: \"signature mismatch\"\n\t};\n};\n//#endregion\n//#region src/appAuth/pkce.ts\nconst toBase64Url = (bytes) => btoa(String.fromCharCode(...bytes)).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n/** The S256 challenge of a verifier: base64url(SHA-256(verifier)). */\nconst codeChallengeOf = async (codeVerifier) => toBase64Url(new Uint8Array(await globalThis.crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(codeVerifier))));\n/** A fresh verifier (32 random bytes, 43 characters) and its S256 challenge. */\nconst createPkcePair = async () => {\n\tconst codeVerifier = toBase64Url(globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)));\n\treturn {\n\t\tcodeVerifier,\n\t\tcodeChallenge: await codeChallengeOf(codeVerifier)\n\t};\n};\n//#endregion\nexport { ADMIN_PATHS, APP_AUTH_PATHS, APP_CONTENT_ACTIONS, ASSIST_PATHS, BUILT_IN_APP_ROLE_KEYS, CHANGE_SET_STATUSES, CONTENT_ACTIONS, CONTENT_OPS_RULES, DEFAULT_SEO_KEYS, DELIVERY_ACTIONS, DELIVERY_PATH, DELIVERY_SITE_PATH, DEPLOYMENT_PROVIDERS, DEPLOYMENT_RUN_STATUSES, DEPLOYMENT_TRIGGERS, GLOBAL_ACTIONS, HEALTH_RULES, JOB_STATUSES, NETWORK_ACTIONS, NOT_RESTORABLE_REASONS, PUBLICATION_ACTIONS, SCHEDULE_STATUSES, SEO_COMPONENT_ID, SEO_FIELD_IDS, SITES_PATHS, SITE_ACTIONS, SITE_HEADER, SITE_QUERY_PARAMETER, SNAPSHOT_SOURCES, ShapioApiError, WEBHOOK_EVENT_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, WEBHOOK_TOLERANCE_SECONDS, applyTitleTemplate, buildUploadForm, codeChallengeOf, createClient, createDeliveryClient, createPkcePair, resolveSeo, resolveUploadUrl, seoDefaultsForLocale, shapioTags, toContentQueryString, verifyWebhookSignature };\n\n//# sourceMappingURL=index.js.map","import { f as RICHTEXT_FORMAT, r as validateRichText, s as SAFE_LINK_PATTERN } from \"./validate-BQGutaBo.js\";\nimport { parseFragment } from \"parse5\";\n//#region src/richtext/fromHtml.ts\nconst MARK_TAGS = {\n\tstrong: \"bold\",\n\tb: \"bold\",\n\tem: \"italic\",\n\ti: \"italic\",\n\tcode: \"code\",\n\tkbd: \"code\",\n\tsamp: \"code\",\n\ttt: \"code\"\n};\n/** Elements whose content is block-level and simply unwrapped into the surrounding blocks. */\nconst CONTAINER_TAGS = /* @__PURE__ */ new Set([\n\t\"div\",\n\t\"section\",\n\t\"article\",\n\t\"aside\",\n\t\"header\",\n\t\"footer\",\n\t\"main\",\n\t\"nav\",\n\t\"figure\",\n\t\"center\",\n\t\"details\",\n\t\"dl\",\n\t\"address\",\n\t\"form\",\n\t\"fieldset\",\n\t\"hgroup\",\n\t\"body\",\n\t\"html\"\n]);\n/** Elements that become one paragraph of their inline content. */\nconst PARAGRAPH_TAGS = /* @__PURE__ */ new Set([\n\t\"p\",\n\t\"figcaption\",\n\t\"dt\",\n\t\"dd\",\n\t\"summary\",\n\t\"caption\",\n\t\"legend\",\n\t\"li\"\n]);\n/** Dropped with their content; embeds are reported because something visible is lost. */\nconst SILENT_DROP_TAGS = /* @__PURE__ */ new Set([\n\t\"script\",\n\t\"style\",\n\t\"template\",\n\t\"head\",\n\t\"noscript\",\n\t\"title\",\n\t\"meta\",\n\t\"link\"\n]);\nconst EMBED_TAGS = /* @__PURE__ */ new Set([\n\t\"iframe\",\n\t\"video\",\n\t\"audio\",\n\t\"object\",\n\t\"embed\",\n\t\"svg\",\n\t\"math\",\n\t\"canvas\",\n\t\"button\",\n\t\"input\",\n\t\"select\",\n\t\"textarea\"\n]);\nconst HEADING_LEVELS = {\n\th1: 1,\n\th2: 2,\n\th3: 3,\n\th4: 4,\n\th5: 5,\n\th6: 6\n};\nconst LIST_TYPES = /* @__PURE__ */ new Set([\n\t\"1\",\n\t\"a\",\n\t\"A\",\n\t\"i\",\n\t\"I\"\n]);\nconst LANGUAGE_PATTERN = /^[A-Za-z0-9_+#.-]{1,32}$/;\nconst MAX_ATTR_TEXT = 1e3;\n/** Containers deeper than this are unwrapped, so the document stays within MAX_RICHTEXT_DEPTH. */\nconst MAX_BLOCK_DEPTH = 34;\nconst isElement = (node) => \"tagName\" in node;\nconst attrOf = (element, name) => element.attrs.find((attr) => attr.name === name)?.value ?? null;\nconst textContent = (node) => node.nodeName === \"#text\" ? node.value : isElement(node) ? node.childNodes.map(textContent).join(\"\") : \"\";\nconst paragraph = (content) => content.length > 0 ? {\n\ttype: \"paragraph\",\n\tcontent\n} : { type: \"paragraph\" };\nconst newSink = (textblock = paragraph) => ({\n\tblocks: [],\n\tinline: [],\n\ttextblock\n});\nconst sameMarks = (left, right) => JSON.stringify(left ?? []) === JSON.stringify(right ?? []);\n/** HTML whitespace rules for one textblock: collapse runs, trim the edges and around hard breaks, merge texts. */\nconst normalizeInline = (nodes) => {\n\tconst out = [];\n\tlet atLineStart = true;\n\tfor (const node of nodes) {\n\t\tif (node.type !== \"text\") {\n\t\t\tconst last = out.at(-1);\n\t\t\tif (node.type === \"hardBreak\" && last?.type === \"text\" && last.text) last.text = last.text.replace(/ +$/, \"\");\n\t\t\tout.push(node);\n\t\t\tatLineStart = node.type === \"hardBreak\";\n\t\t\tcontinue;\n\t\t}\n\t\tlet text = (node.text ?? \"\").replace(/[ \\t\\n\\r\\f]+/g, \" \");\n\t\tif (atLineStart) text = text.replace(/^ +/, \"\");\n\t\tif (text.length === 0) continue;\n\t\tatLineStart = text.endsWith(\" \");\n\t\tconst last = out.at(-1);\n\t\tif (last?.type === \"text\" && sameMarks(last.marks, node.marks)) last.text = `${last.text ?? \"\"}${text}`;\n\t\telse out.push(node.marks ? {\n\t\t\ttype: \"text\",\n\t\t\ttext,\n\t\t\tmarks: node.marks\n\t\t} : {\n\t\t\ttype: \"text\",\n\t\t\ttext\n\t\t});\n\t}\n\tconst last = out.at(-1);\n\tif (last?.type === \"text\" && last.text) last.text = last.text.replace(/ +$/, \"\");\n\treturn out.filter((node) => node.type !== \"text\" || (node.text ?? \"\").length > 0);\n};\n/** Ends the current textblock. Blocks with no visible text (e.g. `<p> </p>`: `trim` covers U+00A0) are dropped. */\nconst flush = (sink) => {\n\tconst content = normalizeInline(sink.inline);\n\tsink.inline = [];\n\tif (content.some((node) => node.type !== \"text\" || (node.text ?? \"\").trim().length > 0)) sink.blocks.push(sink.textblock(content));\n};\nconst withMark = (marks, mark) => [...marks.filter((existing) => existing.type !== mark.type), mark];\nconst linkMark = (element, context) => {\n\tconst href = attrOf(element, \"href\")?.trim();\n\tif (!href) return;\n\tif (href.length > 2048 || !SAFE_LINK_PATTERN.test(href)) {\n\t\tcontext.warnings.push({\n\t\t\tcode: \"unsafeLink\",\n\t\t\tdetail: href.slice(0, 200)\n\t\t});\n\t\treturn;\n\t}\n\treturn {\n\t\ttype: \"link\",\n\t\tattrs: {\n\t\t\thref,\n\t\t\ttarget: attrOf(element, \"target\") === \"_blank\" ? \"_blank\" : null,\n\t\t\trel: null,\n\t\t\tclass: null\n\t\t}\n\t};\n};\nconst clip = (value) => value === null ? null : value.slice(0, MAX_ATTR_TEXT);\nconst imageNode = (element, context) => {\n\tconst src = attrOf(element, \"src\")?.trim() ?? \"\";\n\tconst image = {\n\t\tsrc,\n\t\talt: clip(attrOf(element, \"alt\")),\n\t\ttitle: clip(attrOf(element, \"title\"))\n\t};\n\tconst mediaId = src ? context.options.resolveImage?.(image) : void 0;\n\tif (!mediaId) {\n\t\tcontext.warnings.push({\n\t\t\tcode: \"imageUnresolved\",\n\t\t\tdetail: src.slice(0, 500)\n\t\t});\n\t\treturn;\n\t}\n\treturn {\n\t\ttype: \"image\",\n\t\tattrs: {\n\t\t\tmediaId,\n\t\t\talt: image.alt,\n\t\t\ttitle: image.title\n\t\t}\n\t};\n};\nconst listItems = (element, context, depth) => {\n\tconst items = [];\n\tlet stray = [];\n\tconst pushItem = (nodes) => {\n\t\tconst content = convertChildren(nodes, context, depth + 2);\n\t\tif (content.length > 0 || nodes.some(isElement)) items.push({\n\t\t\ttype: \"listItem\",\n\t\t\tcontent: content.length > 0 ? content : [paragraph([])]\n\t\t});\n\t};\n\tfor (const child of element.childNodes) if (isElement(child) && child.tagName === \"li\") {\n\t\tif (stray.length > 0) {\n\t\t\tpushItem(stray);\n\t\t\tstray = [];\n\t\t}\n\t\tpushItem(child.childNodes);\n\t} else if (textContent(child).trim().length > 0 || isElement(child)) stray.push(child);\n\tif (stray.length > 0) pushItem(stray);\n\treturn items;\n};\nconst listNode = (element, context, depth) => {\n\tconst items = listItems(element, context, depth);\n\tif (items.length === 0) return [];\n\tif (element.tagName === \"ul\") return [{\n\t\ttype: \"bulletList\",\n\t\tcontent: items\n\t}];\n\tconst start = Number.parseInt(attrOf(element, \"start\") ?? \"1\", 10);\n\tconst type = attrOf(element, \"type\");\n\treturn [{\n\t\ttype: \"orderedList\",\n\t\tattrs: {\n\t\t\tstart: Number.isInteger(start) && start >= 0 && start <= 1e6 ? start : 1,\n\t\t\ttype: type !== null && LIST_TYPES.has(type) ? type : null\n\t\t},\n\t\tcontent: items\n\t}];\n};\nconst codeLanguage = (element) => {\n\tconst code = element.childNodes.find((child) => isElement(child) && child.tagName === \"code\");\n\tconst classes = `${attrOf(element, \"class\") ?? \"\"} ${code ? attrOf(code, \"class\") ?? \"\" : \"\"}`;\n\tconst language = /(?:^|\\s)(?:language|lang)-(\\S+)/.exec(classes)?.[1] ?? null;\n\treturn language !== null && LANGUAGE_PATTERN.test(language) ? language : null;\n};\nconst codeBlockNode = (element) => {\n\tconst text = textContent(element).replace(/\\r\\n?/g, \"\\n\").replace(/\\n$/, \"\");\n\treturn {\n\t\ttype: \"codeBlock\",\n\t\tattrs: { language: codeLanguage(element) },\n\t\t...text.length > 0 ? { content: [{\n\t\t\ttype: \"text\",\n\t\t\ttext\n\t\t}] } : {}\n\t};\n};\nconst CELL_SPAN_MAX = 1e3;\nconst span = (element, name) => {\n\tconst value = Number.parseInt(attrOf(element, name) ?? \"1\", 10);\n\treturn Number.isInteger(value) && value >= 1 && value <= CELL_SPAN_MAX ? value : 1;\n};\nconst tableRows = (element) => element.childNodes.filter(isElement).flatMap((child) => {\n\tif (child.tagName === \"tr\") return [child];\n\treturn [\n\t\t\"thead\",\n\t\t\"tbody\",\n\t\t\"tfoot\"\n\t].includes(child.tagName) ? tableRows(child) : [];\n});\nconst tableNodes = (element, context, depth) => {\n\tconst caption = element.childNodes.find((child) => isElement(child) && child.tagName === \"caption\");\n\tconst rows = tableRows(element).flatMap((row) => {\n\t\tconst cells = row.childNodes.filter((cell) => isElement(cell) && (cell.tagName === \"td\" || cell.tagName === \"th\")).map((cell) => {\n\t\t\tconst content = convertChildren(cell.childNodes, context, depth + 3);\n\t\t\treturn {\n\t\t\t\ttype: cell.tagName === \"th\" ? \"tableHeader\" : \"tableCell\",\n\t\t\t\tattrs: {\n\t\t\t\t\tcolspan: span(cell, \"colspan\"),\n\t\t\t\t\trowspan: span(cell, \"rowspan\"),\n\t\t\t\t\tcolwidth: null\n\t\t\t\t},\n\t\t\t\tcontent: content.length > 0 ? content : [paragraph([])]\n\t\t\t};\n\t\t});\n\t\treturn cells.length > 0 ? [{\n\t\t\ttype: \"tableRow\",\n\t\t\tcontent: cells\n\t\t}] : [];\n\t});\n\treturn [...caption ? convertChildren([caption], context, depth) : [], ...rows.length > 0 ? [{\n\t\ttype: \"table\",\n\t\tcontent: rows\n\t}] : []];\n};\n/** A block-level element → zero or more blocks. Undefined when the element is not block-level. */\nconst convertBlock = (element, context, depth) => {\n\tconst tag = element.tagName;\n\tconst nested = depth < MAX_BLOCK_DEPTH;\n\tconst level = HEADING_LEVELS[tag];\n\tif (level !== void 0) {\n\t\tconst sink = newSink((content) => ({\n\t\t\ttype: \"heading\",\n\t\t\tattrs: { level },\n\t\t\t...content.length > 0 ? { content } : {}\n\t\t}));\n\t\twalkChildren(element.childNodes, sink, [], context, depth);\n\t\tflush(sink);\n\t\treturn sink.blocks;\n\t}\n\tif (PARAGRAPH_TAGS.has(tag) || CONTAINER_TAGS.has(tag) || !nested && (tag === \"blockquote\" || tag === \"ul\" || tag === \"ol\")) return convertChildren(element.childNodes, context, depth);\n\tswitch (tag) {\n\t\tcase \"blockquote\": {\n\t\t\tconst content = convertChildren(element.childNodes, context, depth + 1);\n\t\t\treturn content.length > 0 ? [{\n\t\t\t\ttype: \"blockquote\",\n\t\t\t\tcontent\n\t\t\t}] : [];\n\t\t}\n\t\tcase \"ul\":\n\t\tcase \"ol\": return listNode(element, context, depth);\n\t\tcase \"pre\": return [codeBlockNode(element)];\n\t\tcase \"hr\": return [{ type: \"horizontalRule\" }];\n\t\tcase \"table\": return nested ? tableNodes(element, context, depth) : convertChildren(element.childNodes, context, depth);\n\t\tdefault: return;\n\t}\n};\n/** Walks nodes in inline context, adding text to the sink and ending its textblock at every block element. */\nconst walkChildren = (nodes, sink, marks, context, depth) => {\n\tfor (const node of nodes) {\n\t\tif (node.nodeName === \"#text\") {\n\t\t\tconst text = node.value;\n\t\t\tsink.inline.push(marks.length > 0 ? {\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext,\n\t\t\t\tmarks: [...marks]\n\t\t\t} : {\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (isElement(node)) walkElement(node, sink, marks, context, depth);\n\t}\n};\nconst walkElement = (element, sink, marks, context, depth) => {\n\tconst tag = element.tagName;\n\tif (SILENT_DROP_TAGS.has(tag)) return;\n\tif (EMBED_TAGS.has(tag)) {\n\t\tcontext.warnings.push({\n\t\t\tcode: \"embedDropped\",\n\t\t\tdetail: tag\n\t\t});\n\t\treturn;\n\t}\n\tif (tag === \"br\") {\n\t\tsink.inline.push({ type: \"hardBreak\" });\n\t\treturn;\n\t}\n\tif (tag === \"img\") {\n\t\tconst image = imageNode(element, context);\n\t\tif (image) {\n\t\t\tflush(sink);\n\t\t\tsink.blocks.push(image);\n\t\t}\n\t\treturn;\n\t}\n\tconst blocks = convertBlock(element, context, depth);\n\tif (blocks) {\n\t\tflush(sink);\n\t\tsink.blocks.push(...blocks);\n\t\treturn;\n\t}\n\tconst markType = MARK_TAGS[tag];\n\tconst mark = markType ? { type: markType } : tag === \"a\" ? linkMark(element, context) : void 0;\n\twalkChildren(element.childNodes, sink, mark ? withMark(marks, mark) : marks, context, depth);\n};\n/** Converts nodes in block context: loose inline content becomes paragraphs. */\nconst convertChildren = (nodes, context, depth) => {\n\tconst sink = newSink();\n\twalkChildren(nodes, sink, [], context, depth);\n\tflush(sink);\n\treturn sink.blocks;\n};\nconst envelope = (content) => ({\n\tformat: RICHTEXT_FORMAT,\n\tversion: 1,\n\tdoc: content.length > 0 ? {\n\t\ttype: \"doc\",\n\t\tcontent\n\t} : { type: \"doc\" }\n});\n/** Converts an HTML fragment to a validated rich-text document, with what was lost on the way. */\nconst htmlToRichText = (html, options = {}) => {\n\tconst context = {\n\t\toptions,\n\t\twarnings: []\n\t};\n\tconst blocks = convertChildren(parseFragment(html).childNodes, context, 1);\n\tconst result = validateRichText(envelope(blocks));\n\tif (result.ok) return {\n\t\tdocument: result.document,\n\t\twarnings: context.warnings\n\t};\n\tcontext.warnings.push({\n\t\tcode: \"invalidOutput\",\n\t\tdetail: JSON.stringify(result.problems.slice(0, 3))\n\t});\n\tconst text = parseFragment(html).childNodes.map(textContent).join(\"\").replace(/\\s+/g, \" \").trim();\n\tconst fallback = validateRichText(envelope(text ? [paragraph([{\n\t\ttype: \"text\",\n\t\ttext\n\t}])] : []));\n\tif (!fallback.ok) throw new Error(\"Rich-text fallback document is invalid\");\n\treturn {\n\t\tdocument: fallback.document,\n\t\twarnings: context.warnings\n\t};\n};\n/** Every `<img>` in a fragment (in document order), so an importer can fetch them before converting. */\nconst collectHtmlImages = (html) => {\n\tconst images = [];\n\tconst walk = (node) => {\n\t\tif (!isElement(node)) return;\n\t\tif (node.tagName === \"img\") {\n\t\t\tconst src = attrOf(node, \"src\")?.trim();\n\t\t\tif (src) images.push({\n\t\t\t\tsrc,\n\t\t\t\talt: clip(attrOf(node, \"alt\")),\n\t\t\t\ttitle: clip(attrOf(node, \"title\"))\n\t\t\t});\n\t\t}\n\t\tnode.childNodes.forEach(walk);\n\t};\n\tparseFragment(html).childNodes.forEach(walk);\n\treturn images;\n};\n//#endregion\nexport { collectHtmlImages, htmlToRichText };\n\n//# sourceMappingURL=html.js.map","import { i as resolveUploadUrl, n as buildUploadForm, t as ShapioApiError } from \"./errors-B4bGc9nd.js\";\nimport { openAsBlob } from \"node:fs\";\nimport { stat } from \"node:fs/promises\";\nimport { basename, extname } from \"node:path\";\n//#region src/node.ts\n/**\n* Node-only helpers (`@shapio/client/node`): reading files from disk. The main entry stays free of `node:`\n* imports so it also runs in browsers and edge runtimes.\n*/\n/** Common types by extension; anything else needs an explicit `mimeType`. The server checks the bytes. */\nconst MIME_TYPES = {\n\t\".avif\": \"image/avif\",\n\t\".gif\": \"image/gif\",\n\t\".jpeg\": \"image/jpeg\",\n\t\".jpg\": \"image/jpeg\",\n\t\".png\": \"image/png\",\n\t\".svg\": \"image/svg+xml\",\n\t\".webp\": \"image/webp\",\n\t\".mp4\": \"video/mp4\",\n\t\".webm\": \"video/webm\",\n\t\".mp3\": \"audio/mpeg\",\n\t\".pdf\": \"application/pdf\",\n\t\".txt\": \"text/plain\",\n\t\".csv\": \"text/csv\",\n\t\".json\": \"application/json\"\n};\nconst mimeTypeOf = (path) => MIME_TYPES[extname(path).toLowerCase()];\n/**\n* Uploads a file from disk into the media library: asks for a grant, sends the bytes to the grant's URL\n* (Shapio's upload route or a bucket's presigned POST), then confirms. Returns the new asset.\n*/\nconst uploadFile = async (client, input) => {\n\tconst mimeType = input.mimeType ?? mimeTypeOf(input.path);\n\tif (!mimeType) throw new Error(`Unknown file type for ${input.path}; pass mimeType`);\n\tconst filename = input.filename ?? basename(input.path);\n\tconst { size } = await stat(input.path);\n\tconst grant = await client.admin.media.uploads.create({\n\t\tfilename,\n\t\tmimeType,\n\t\tsizeBytes: size,\n\t\t...input.folderId !== void 0 ? { folderId: input.folderId } : {},\n\t\t...input.visibility ? { visibility: input.visibility } : {}\n\t});\n\tconst file = await openAsBlob(input.path, { type: mimeType });\n\tconst response = await (input.fetch ?? globalThis.fetch)(resolveUploadUrl(grant, input.baseUrl), {\n\t\tmethod: \"POST\",\n\t\tbody: buildUploadForm(grant, file, filename)\n\t});\n\tif (!response.ok) {\n\t\tconst text = await response.text();\n\t\tlet body = text;\n\t\ttry {\n\t\t\tbody = JSON.parse(text);\n\t\t} catch {}\n\t\tthrow new ShapioApiError(response.status, body);\n\t}\n\treturn client.admin.media.uploads.confirm(grant.grantId);\n};\n//#endregion\nexport { mimeTypeOf, uploadFile };\n\n//# sourceMappingURL=node.js.map","import { createDecipheriv, createHash, scryptSync } from \"node:crypto\";\nimport { createReadStream, createWriteStream } from \"node:fs\";\nimport { access, mkdir, open, readFile, readdir, rename, rm, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, extname, isAbsolute, join, posix, relative, resolve } from \"node:path\";\nimport { Readable, Transform } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { createInterface } from \"node:readline\";\nimport { setTimeout } from \"node:timers/promises\";\nimport { parseArgs } from \"node:util\";\nimport { SITE_HEADER, ShapioApiError, createClient } from \"@shapio/client\";\nimport { collectHtmlImages, htmlToRichText } from \"@shapio/schema/html\";\nimport { marked } from \"marked\";\nimport { LOCK_FILE_FORMAT_VERSION, LOCK_FILE_PATH, MAX_API_KEY_LENGTH, RESERVED_DEFINITION_API_KEYS, RESERVED_FIELD_API_KEYS, RESERVED_TYPE_NAMES, RICHTEXT_FORMAT, RICHTEXT_FORMAT_VERSION, SAFE_LINK_PATTERN, SCHEMA_KIND_DIRECTORIES, SITES_DIRECTORY, createDefinitionIndex, createStableId, foldApiKey, generatedNames, hashDefinition, isDataType, lockCoversSite, lockEntriesForSite, mergePulledLock, parseDefinition, parseLockFile, routeKeyOf, schemaFilePath, scopeDirectory, serializeDefinition, serializeLockFile, suggestPlural, toTypeName, typeChangeDropsValues, upgradeLockFile, validateRichText, validateSchema, withSiteCovered } from \"@shapio/schema\";\nimport { extract } from \"tar\";\nimport { mimeTypeOf, uploadFile } from \"@shapio/client/node\";\nimport { SaxesParser } from \"saxes\";\n//#region src/commands/export/bundleLines.ts\n/** Media assets (the manifest) and the end record of a bundle stream. */\nconst scanBundle = async (input) => {\n\tconst assets = [];\n\tlet end;\n\tfor await (const line of createInterface({\n\t\tinput,\n\t\tcrlfDelay: Infinity\n\t})) {\n\t\tif (!line.includes(\"\\\"type\\\":\\\"mediaAsset\\\"\") && !line.includes(\"\\\"type\\\":\\\"end\\\"\")) continue;\n\t\tconst record = JSON.parse(line);\n\t\tif (record.type === \"mediaAsset\") assets.push(record);\n\t\telse if (record.type === \"end\") end = record;\n\t}\n\treturn {\n\t\tassets,\n\t\tend\n\t};\n};\nconst scanBundleFile = (path, range) => scanBundle(createReadStream(path, range ?? {}));\nconst COUNT_LABELS = [\n\t[\"locale\", \"locales\"],\n\t[\"definition\", \"models and components\"],\n\t[\"appRole\", \"app roles\"],\n\t[\"deliveryRole\", \"delivery roles\"],\n\t[\"appUser\", \"app users\"],\n\t[\"webhook\", \"webhooks\"],\n\t[\"deploymentConnection\", \"deployment connections\"],\n\t[\"mediaFolder\", \"media folders\"],\n\t[\"mediaAsset\", \"media assets\"],\n\t[\"entry\", \"entries\"],\n\t[\"revision\", \"revisions\"]\n];\n/** The end record's counts as a sentence: `2 locales, 8 models and components, ...`. */\nconst formatCounts$1 = (counts) => COUNT_LABELS.filter(([type]) => (counts[type] ?? 0) > 0).map(([type, label]) => `${counts[type]} ${label}`).join(\", \");\nconst retryAfterMs = (response, attempt) => {\n\tconst seconds = Number(response.headers.get(\"retry-after\"));\n\treturn Number.isFinite(seconds) && seconds > 0 ? seconds * 1e3 : 500 * 2 ** attempt;\n};\n/**\n* A fetch that retries 429 answers, for `createClient({ fetch })`. Only for re-sendable bodies (JSON strings,\n* FormData, Blobs), which is what the client sends; streamed bodies need a body factory (see `send`).\n*/\nconst createRateLimitedFetch = (base = globalThis.fetch) => async (input, init) => {\n\tfor (let attempt = 0;; attempt += 1) {\n\t\tconst response = await base(input, init);\n\t\tif (response.status !== 429 || attempt >= 8) return response;\n\t\tawait response.body?.cancel();\n\t\tawait setTimeout(retryAfterMs(response, attempt));\n\t}\n};\nvar UsageError$1 = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"UsageError\";\n\t}\n};\n/** `[--url] [--token] [--site] [--<flag>...] <file>` for both commands. */\nconst parseTransferArgs = (args, io, flags) => {\n\tconst { values, positionals } = parseArgs({\n\t\targs: [...args],\n\t\toptions: {\n\t\t\turl: { type: \"string\" },\n\t\t\ttoken: { type: \"string\" },\n\t\t\tsite: { type: \"string\" },\n\t\t\t...Object.fromEntries(flags.map((flag) => [flag, {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t}]))\n\t\t},\n\t\tallowPositionals: true\n\t});\n\tconst token = values.token ?? io.env.SHAPIO_TOKEN;\n\tif (!token) throw new UsageError$1(\"An admin API token is required: pass --token or set SHAPIO_TOKEN\");\n\tconst [file, ...extra] = positionals;\n\tif (!file || extra.length > 0) throw new UsageError$1(\"Give exactly one bundle file\");\n\tconst site = values.site ?? io.env.SHAPIO_SITE;\n\treturn {\n\t\tconnection: {\n\t\t\tbaseUrl: values.url ?? io.env.SHAPIO_URL ?? \"http://localhost:4300\",\n\t\t\ttoken,\n\t\t\t...site ? { site } : {}\n\t\t},\n\t\tflags: Object.fromEntries(flags.map((flag) => [flag, values[flag] === true])),\n\t\tfile\n\t};\n};\nconst errorFrom = async (response) => {\n\tconst text = await response.text();\n\tlet parsed = text;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {}\n\treturn new ShapioApiError(response.status, parsed);\n};\n/** A request whose non-2xx answers throw `ShapioApiError`; returns the response for streaming its body. */\nconst send = async (connection, path, input = {}) => {\n\tconst url = new URL(`${connection.baseUrl.replace(/\\/+$/, \"\")}${path}`);\n\tfor (const [key, value] of Object.entries(input.query ?? {})) url.searchParams.set(key, String(value));\n\tfor (let attempt = 0;; attempt += 1) {\n\t\tconst body = input.body?.();\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: input.method ?? \"GET\",\n\t\t\theaders: {\n\t\t\t\tauthorization: `Bearer ${connection.token}`,\n\t\t\t\t...connection.site ? { [SITE_HEADER]: connection.site } : {},\n\t\t\t\t...input.contentType ? { \"content-type\": input.contentType } : {}\n\t\t\t},\n\t\t\t...body ? {\n\t\t\t\tbody: Readable.toWeb(body),\n\t\t\t\tduplex: \"half\"\n\t\t\t} : {}\n\t\t});\n\t\tif (response.status === 429 && attempt < 8) {\n\t\t\tawait response.body?.cancel();\n\t\t\tawait setTimeout(retryAfterMs(response, attempt));\n\t\t\tcontinue;\n\t\t}\n\t\tif (!response.ok) throw await errorFrom(response);\n\t\treturn response;\n\t}\n};\nconst sendJson = async (connection, path, input = {}) => await (await send(connection, path, input)).json();\n/** The response body as a Node stream. */\nconst bodyOf = (response) => {\n\tif (!response.body) throw new Error(\"The response has no body\");\n\tconst body = response.body;\n\treturn Readable.fromWeb(body);\n};\nconst describeFailure = (error) => error instanceof ShapioApiError ? `${error.code}: ${error.message}` : error instanceof Error ? error.message : String(error);\n//#endregion\n//#region src/commands/export/tar.ts\n/**\n* A minimal POSIX ustar writer and reader for `shapio export --with-media` bundles: `bundle.ndjson` plus\n* `media/<asset id>` files. Regular files only, names under 100 bytes, sizes under 8 GiB. Kept here (no\n* dependency) because the CLI only ever writes and reads its own archives.\n*/\nconst BLOCK = 512;\nconst MAX_SIZE = 8589934591;\nconst BUNDLE_ENTRY = \"bundle.ndjson\";\nconst mediaEntryName = (assetId) => `media/${assetId}`;\nconst writeString = (buffer, offset, length, value) => {\n\tbuffer.write(value, offset, Math.min(length, Buffer.byteLength(value)), \"utf8\");\n};\nconst octal = (value, length) => `${value.toString(8).padStart(length - 1, \"0\")}\\0`;\nconst tarHeader = (name, size, mtime = Math.floor(Date.now() / 1e3)) => {\n\tif (Buffer.byteLength(name) >= 100) throw new Error(`Archive entry name too long: ${name}`);\n\tif (size > MAX_SIZE) throw new Error(`Archive entry too large: ${name}`);\n\tconst header = Buffer.alloc(BLOCK);\n\twriteString(header, 0, 100, name);\n\twriteString(header, 100, 8, \"0000644\\0\");\n\twriteString(header, 108, 8, \"0000000\\0\");\n\twriteString(header, 116, 8, \"0000000\\0\");\n\twriteString(header, 124, 12, octal(size, 12));\n\twriteString(header, 136, 12, octal(mtime, 12));\n\twriteString(header, 148, 8, \" \");\n\theader[156] = 48;\n\twriteString(header, 257, 6, \"ustar\\0\");\n\twriteString(header, 263, 2, \"00\");\n\tlet sum = 0;\n\tfor (const byte of header) sum += byte;\n\twriteString(header, 148, 8, `${sum.toString(8).padStart(6, \"0\")}\\0 `);\n\treturn header;\n};\nconst padding = (size) => Buffer.alloc((BLOCK - size % BLOCK) % BLOCK);\nconst write = (output, chunk) => new Promise((resolve, reject) => {\n\toutput.write(chunk, (error) => error ? reject(error) : resolve());\n});\n/** Writes one entry: header, exactly `size` bytes from `content`, then padding. */\nconst writeTarEntry = async (output, name, size, content) => {\n\tawait write(output, tarHeader(name, size));\n\tlet written = 0;\n\tfor await (const chunk of content) {\n\t\tconst buffer = chunk;\n\t\twritten += buffer.length;\n\t\tif (written > size) throw new Error(`${name}: more data than its declared ${size} bytes`);\n\t\tawait write(output, buffer);\n\t}\n\tif (written !== size) throw new Error(`${name}: got ${written} bytes, expected ${size}`);\n\tawait write(output, padding(size));\n};\nconst endTar = (output) => write(output, Buffer.alloc(BLOCK * 2));\nconst readOctal = (buffer, offset, length) => parseInt(buffer.toString(\"utf8\", offset, offset + length).replace(/\\0.*$/, \"\").trim() || \"0\", 8);\nconst readName = (buffer) => buffer.toString(\"utf8\", 0, 100).replace(/\\0.*$/, \"\");\n/** Whether a file starts with a ustar header. */\nconst isTar = async (path) => {\n\tconst handle = await open(path, \"r\");\n\ttry {\n\t\tconst header = Buffer.alloc(BLOCK);\n\t\tconst { bytesRead } = await handle.read(header, 0, BLOCK, 0);\n\t\treturn bytesRead === BLOCK && header.toString(\"utf8\", 257, 262) === \"ustar\";\n\t} finally {\n\t\tawait handle.close();\n\t}\n};\n/** The archive's table of contents: name, data offset and size of every regular file. */\nconst listTar = async (path) => {\n\tconst handle = await open(path, \"r\");\n\tconst entries = /* @__PURE__ */ new Map();\n\ttry {\n\t\tconst header = Buffer.alloc(BLOCK);\n\t\tfor (let position = 0;;) {\n\t\t\tconst { bytesRead } = await handle.read(header, 0, BLOCK, position);\n\t\t\tif (bytesRead < BLOCK || header.every((byte) => byte === 0)) break;\n\t\t\tconst name = readName(header);\n\t\t\tconst size = readOctal(header, 124, 12);\n\t\t\tconst type = String.fromCharCode(header[156] ?? 48);\n\t\t\tif (type === \"0\" || type === \"\\0\") entries.set(name, {\n\t\t\t\tname,\n\t\t\t\toffset: position + BLOCK,\n\t\t\t\tsize\n\t\t\t});\n\t\t\tposition += BLOCK + size + (BLOCK - size % BLOCK) % BLOCK;\n\t\t}\n\t} finally {\n\t\tawait handle.close();\n\t}\n\treturn entries;\n};\n//#endregion\n//#region src/commands/export/index.ts\nconst USAGE$1 = \"shapio export [--url <origin>] [--token <admin token>] [--site <key>] [--with-media] [--heads-only] [--include-users] <file>\\n Exports one site's content (--site or SHAPIO_SITE; default: the token's site, else the primary site).\";\nconst FLAGS$1 = [\n\t\"with-media\",\n\t\"heads-only\",\n\t\"include-users\"\n];\nconst closeStream = (output) => new Promise((resolveClose, reject) => {\n\toutput.end((error) => error ? reject(error) : resolveClose());\n});\n/** Downloads one asset's original into the archive, checking it against the manifest on the way. */\nconst archiveAsset = async (connection, output, asset) => {\n\tconst hash = createHash(\"sha256\");\n\tconst hashing = new Transform({ transform(chunk, _encoding, done) {\n\t\thash.update(chunk);\n\t\tdone(null, chunk);\n\t} });\n\tconst response = await send(connection, `/api/admin/transfer/media/${encodeURIComponent(asset.id)}`);\n\tconst body = bodyOf(response).pipe(hashing);\n\tawait writeTarEntry(output, mediaEntryName(asset.id), asset.sizeBytes, body);\n\tconst digest = hash.digest(\"hex\");\n\tif (asset.sha256 !== null && digest !== asset.sha256) throw new Error(`${asset.filename} (${asset.id}) does not match its checksum in the bundle`);\n};\n/** Bundle plus media files as one tar archive: `bundle.ndjson`, then `media/<asset id>` per asset. */\nconst writeArchive = async (connection, bundlePath, out, io) => {\n\tconst { assets } = await scanBundleFile(bundlePath);\n\tconst output = createWriteStream(out, { mode: 384 });\n\ttry {\n\t\tawait writeTarEntry(output, BUNDLE_ENTRY, (await stat(bundlePath)).size, createReadStream(bundlePath));\n\t\tfor (const [index, asset] of assets.entries()) {\n\t\t\tawait archiveAsset(connection, output, asset);\n\t\t\tif ((index + 1) % 50 === 0) io.stdout(` ${index + 1}/${assets.length} media files\\n`);\n\t\t}\n\t\tawait endTar(output);\n\t} finally {\n\t\tawait closeStream(output);\n\t}\n\treturn assets.length;\n};\n/**\n* `shapio export`: streams the instance's content bundle (NDJSON) to a file over HTTP with an admin token.\n* `--with-media` writes a tar archive with the bundle and every media file, verified against the manifest.\n*/\nconst exportCommand = {\n\tsummary: \"Export schema, locales, roles, content and media metadata to a bundle file (--with-media: tar with files)\",\n\tusage: USAGE$1,\n\trun: async (args, io) => {\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = parseTransferArgs(args, io, FLAGS$1);\n\t\t} catch (error) {\n\t\t\tif (error instanceof UsageError$1 || error instanceof TypeError) {\n\t\t\t\tio.stderr(`shapio export: ${error.message}\\nUsage: ${USAGE$1}\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tconst { connection, flags, file } = parsed;\n\t\tconst out = resolve(file);\n\t\tconst bundlePath = flags[\"with-media\"] ? `${out}.bundle.tmp` : `${out}.tmp`;\n\t\ttry {\n\t\t\tconst response = await send(connection, \"/api/admin/transfer/export\", { query: {\n\t\t\t\theadsOnly: flags[\"heads-only\"] === true,\n\t\t\t\tincludeUsers: flags[\"include-users\"] === true\n\t\t\t} });\n\t\t\tawait pipeline(bodyOf(response), createWriteStream(bundlePath, { mode: 384 }));\n\t\t\tconst { end } = await scanBundleFile(bundlePath);\n\t\t\tif (!end) throw new Error(\"The export stream ended early (no end record); nothing was written\");\n\t\t\tif (flags[\"with-media\"]) {\n\t\t\t\tconst files = await writeArchive(connection, bundlePath, `${out}.tmp`, io);\n\t\t\t\tawait rm(bundlePath, { force: true });\n\t\t\t\tio.stdout(`Archived ${files} media file(s).\\n`);\n\t\t\t}\n\t\t\tawait rename(`${out}.tmp`, out);\n\t\t\tio.stdout(`Exported ${formatCounts$1(end.counts)} to ${relative(process.cwd(), out) || out}\\n`);\n\t\t\treturn 0;\n\t\t} catch (error) {\n\t\t\tawait rm(bundlePath, { force: true });\n\t\t\tawait rm(`${out}.tmp`, { force: true });\n\t\t\tio.stderr(`shapio export: ${describeFailure(error)}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t}\n};\n//#endregion\n//#region src/commands/import/plan.ts\nconst list = (items) => items.length > 0 ? ` (${items.join(\", \")})` : \"\";\nconst SCHEMA_REASONS = { existsOnTarget: \"the target has it in another form\" };\nconst droppedLine = ({ role, modelIds }) => ` - role ${role}: left out its grants on ${modelIds.length} model(s) neither the bundle nor this instance has`;\nconst conflictLine = (kind, conflict) => ` ! ${kind} ${conflict.id}${conflict.model ? ` (${conflict.model})` : \"\"}: ${conflict.reason}${conflict.detail ? `: ${conflict.detail}` : \"\"}`;\n/** A readable summary of the plan, one line per category plus every listed conflict. */\nconst formatPlan = (diff) => {\n\treturn `${[\n\t\t`Locales: ${diff.locales.added.length} added${list(diff.locales.added)}, ${diff.locales.changed.length} changed${list(diff.locales.changed)}, ${diff.locales.unchanged.length} unchanged`,\n\t\t...diff.locales.defaultLocale ? [` default locale ${diff.locales.defaultLocale.from} → ${diff.locales.defaultLocale.to}${diff.locales.defaultLocale.blocked ? \" (refused: the target has content)\" : \"\"}`] : [],\n\t\t`Models and components: ${diff.schema.added.length} added${list(diff.schema.added.map((item) => item.apiKey))}, ${diff.schema.unchanged.length} unchanged, ${diff.schema.conflicts.length} conflicting`,\n\t\t...diff.schema.conflicts.map((item) => ` ! ${item.kind} ${item.apiKey}: ${SCHEMA_REASONS[item.reason ?? \"\"] ?? item.reason ?? \"differs\"} (reconcile the schemas first: shapio schema pull/apply)`),\n\t\t`App roles: ${diff.appRoles.added.length} added, ${diff.appRoles.updated.length} updated, ${diff.appRoles.unchanged.length} unchanged`,\n\t\t...(diff.appRoles.droppedGrants ?? []).map(droppedLine),\n\t\t`Delivery roles: ${diff.deliveryRoles.added.length} added, ${diff.deliveryRoles.updated.length} updated, ${diff.deliveryRoles.unchanged.length} unchanged, ${diff.deliveryRoles.conflicts.length} conflicting (tokens are never imported: create new ones)`,\n\t\t...diff.deliveryRoles.conflicts.map((key) => ` ! role ${key}: the target uses this key for an admin role`),\n\t\t...(diff.deliveryRoles.droppedGrants ?? []).map(droppedLine),\n\t\t`App users: ${diff.appUsers.added} added, ${diff.appUsers.unchanged} unchanged, ${diff.appUsers.conflictCount} conflicting`,\n\t\t...diff.appUsers.conflicts.map((conflict) => conflictLine(\"user\", conflict)),\n\t\t`Webhooks: ${diff.webhooks.added.length} added (disabled, new secrets), ${diff.webhooks.unchanged.length} unchanged`,\n\t\t`Deployment connections: ${diff.deploymentConnections.added.length} added (disabled; enter their secrets), ${diff.deploymentConnections.unchanged.length} unchanged`,\n\t\t`Media: ${diff.media.folders.added} folders and ${diff.media.added} assets added, ${diff.media.unchanged} unchanged, ${diff.media.conflictCount} conflicting`,\n\t\t...diff.media.conflicts.map((conflict) => conflictLine(\"asset\", conflict)),\n\t\t`Entries: ${diff.entries.added} added, ${diff.entries.updated} updated, ${diff.entries.unchanged} unchanged, ${diff.entries.conflictCount} conflicting`,\n\t\t...Object.entries(diff.entries.byModel).map(([model, counts]) => ` ${model}: ${counts.added} added, ${counts.updated} updated, ${counts.unchanged} unchanged, ${counts.conflicts} conflicting`),\n\t\t...diff.entries.conflicts.map((conflict) => conflictLine(\"entry\", conflict)),\n\t\t...diff.prune ? [`Prune: ${diff.prune.entries} target entries not in the bundle would be deleted`] : [],\n\t\tdiff.conflicts > 0 ? `${diff.conflicts} conflict(s): the import would be refused and nothing written.` : \"No conflicts.\"\n\t].join(\"\\n\")}\\n`;\n};\n//#endregion\n//#region src/import/strapi/blocks.ts\nconst LANGUAGE_PATTERN = /^[A-Za-z0-9_+#.-]{1,32}$/;\nconst inline = (nodes, context, link) => (nodes ?? []).flatMap((node) => {\n\tif (node.type === \"link\") {\n\t\tconst url = node.url?.trim() ?? \"\";\n\t\tconst safe = url.length > 0 && url.length <= 2048 && SAFE_LINK_PATTERN.test(url);\n\t\tif (!safe && url) context.warnings.push({\n\t\t\tcode: \"unsafeLink\",\n\t\t\tdetail: url.slice(0, 200)\n\t\t});\n\t\treturn inline(node.children, context, safe ? {\n\t\t\ttype: \"link\",\n\t\t\tattrs: {\n\t\t\t\thref: url,\n\t\t\t\ttarget: null,\n\t\t\t\trel: null,\n\t\t\t\tclass: null\n\t\t\t}\n\t\t} : link);\n\t}\n\tif (typeof node.text !== \"string\" || node.text.length === 0) return inline(node.children, context, link);\n\tconst parts = node.text.split(\"\\n\");\n\tconst marks = [\n\t\t...node.bold ? [{ type: \"bold\" }] : [],\n\t\t...node.italic ? [{ type: \"italic\" }] : [],\n\t\t...node.code ? [{ type: \"code\" }] : [],\n\t\t...link ? [link] : []\n\t];\n\treturn parts.flatMap((part, index) => [...index > 0 ? [{ type: \"hardBreak\" }] : [], ...part ? [marks.length > 0 ? {\n\t\ttype: \"text\",\n\t\ttext: part,\n\t\tmarks\n\t} : {\n\t\ttype: \"text\",\n\t\ttext: part\n\t}] : []]);\n});\nconst textblock = (type, content, attrs) => ({\n\ttype,\n\t...attrs ? { attrs } : {},\n\t...content.length > 0 ? { content } : {}\n});\nconst plainText = (nodes) => (nodes ?? []).map((node) => typeof node.text === \"string\" ? node.text : plainText(node.children)).join(\"\");\nconst listNode = (block, context) => {\n\tconst items = [];\n\tfor (const child of block.children ?? []) {\n\t\tif (child.type === \"list\") {\n\t\t\tconst nested = listNode(child, context);\n\t\t\tconst previous = items.at(-1);\n\t\t\tif (previous) previous.content = [...previous.content ?? [], ...nested];\n\t\t\telse items.push({\n\t\t\t\ttype: \"listItem\",\n\t\t\t\tcontent: nested.length > 0 ? nested : [{ type: \"paragraph\" }]\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\titems.push({\n\t\t\ttype: \"listItem\",\n\t\t\tcontent: [textblock(\"paragraph\", inline(child.children, context))]\n\t\t});\n\t}\n\tif (items.length === 0) return [];\n\treturn [block.format === \"ordered\" ? {\n\t\ttype: \"orderedList\",\n\t\tattrs: {\n\t\t\tstart: 1,\n\t\t\ttype: null\n\t\t},\n\t\tcontent: items\n\t} : {\n\t\ttype: \"bulletList\",\n\t\tcontent: items\n\t}];\n};\nconst imageNode = (block, context) => {\n\tconst url = block.image?.url ?? \"\";\n\tconst mediaId = url ? context.resolveImage(url) : void 0;\n\tif (!mediaId) {\n\t\tcontext.warnings.push({\n\t\t\tcode: \"imageUnresolved\",\n\t\t\tdetail: url || \"(no url)\"\n\t\t});\n\t\treturn [];\n\t}\n\treturn [{\n\t\ttype: \"image\",\n\t\tattrs: {\n\t\t\tmediaId,\n\t\t\talt: (block.image?.alternativeText?.slice(0, 1e3) ?? null) || null,\n\t\t\ttitle: null\n\t\t}\n\t}];\n};\nconst convertBlock = (block, context) => {\n\tswitch (block.type) {\n\t\tcase \"paragraph\": return [textblock(\"paragraph\", inline(block.children, context))];\n\t\tcase \"heading\": {\n\t\t\tconst level = Number.isInteger(block.level) && block.level >= 1 && block.level <= 6 ? block.level : 1;\n\t\t\treturn [textblock(\"heading\", inline(block.children, context), { level })];\n\t\t}\n\t\tcase \"list\": return listNode(block, context);\n\t\tcase \"quote\": {\n\t\t\tconst content = inline(block.children, context);\n\t\t\treturn [{\n\t\t\t\ttype: \"blockquote\",\n\t\t\t\tcontent: [textblock(\"paragraph\", content)]\n\t\t\t}];\n\t\t}\n\t\tcase \"code\": {\n\t\t\tconst text = plainText(block.children);\n\t\t\treturn [{\n\t\t\t\ttype: \"codeBlock\",\n\t\t\t\tattrs: { language: block.language && LANGUAGE_PATTERN.test(block.language) ? block.language : null },\n\t\t\t\t...text ? { content: [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext\n\t\t\t\t}] } : {}\n\t\t\t}];\n\t\t}\n\t\tcase \"image\": return imageNode(block, context);\n\t\tdefault:\n\t\t\tcontext.warnings.push({\n\t\t\t\tcode: \"unsupportedBlock\",\n\t\t\t\tdetail: String(block.type)\n\t\t\t});\n\t\t\treturn [textblock(\"paragraph\", inline(block.children, context))];\n\t}\n};\nconst blocksToRichText = (value, resolveImage) => {\n\tconst context = {\n\t\tresolveImage,\n\t\twarnings: []\n\t};\n\tconst blocks = Array.isArray(value) ? value : [];\n\tconst content = blocks.flatMap((block) => convertBlock(block, context));\n\tconst result = validateRichText({\n\t\tformat: RICHTEXT_FORMAT,\n\t\tversion: RICHTEXT_FORMAT_VERSION,\n\t\tdoc: content.length > 0 ? {\n\t\t\ttype: \"doc\",\n\t\t\tcontent\n\t\t} : { type: \"doc\" }\n\t});\n\tif (result.ok) return {\n\t\tdocument: result.document,\n\t\twarnings: context.warnings\n\t};\n\tcontext.warnings.push({\n\t\tcode: \"invalidOutput\",\n\t\tdetail: JSON.stringify(result.problems.slice(0, 3))\n\t});\n\tconst text = blocks.map((block) => plainText(block.children)).filter(Boolean).join(\"\\n\\n\");\n\tconst fallback = validateRichText({\n\t\tformat: RICHTEXT_FORMAT,\n\t\tversion: RICHTEXT_FORMAT_VERSION,\n\t\tdoc: text ? {\n\t\t\ttype: \"doc\",\n\t\t\tcontent: [{\n\t\t\t\ttype: \"paragraph\",\n\t\t\t\tcontent: [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext\n\t\t\t\t}]\n\t\t\t}]\n\t\t} : { type: \"doc\" }\n\t});\n\tif (!fallback.ok) throw new Error(\"Rich-text fallback document is invalid\");\n\treturn {\n\t\tdocument: fallback.document,\n\t\twarnings: context.warnings\n\t};\n};\n//#endregion\n//#region src/import/naming.ts\n/** `blog-post`, `Blog post`, `blog_post` → `blogPost`; a leading digit gets an `n` prefix. */\nconst toCamelCase = (value) => {\n\tconst joined = value.split(/[^A-Za-z0-9]+/).filter((word) => word.length > 0).map((word, index) => index === 0 ? word.charAt(0).toLowerCase() + word.slice(1) : word.charAt(0).toUpperCase() + word.slice(1)).join(\"\");\n\treturn ((/^[0-9]/.test(joined) ? `n${joined}` : joined) || \"item\").slice(0, MAX_API_KEY_LENGTH);\n};\n/** `key` with `suffix`, shortened so the result stays within the API ID length limit. */\nconst withSuffix = (key, suffix) => `${key.slice(0, MAX_API_KEY_LENGTH - suffix.length)}${suffix}`;\n/** Makes `candidate` unique within `taken` (case-folded), numbering repeats; records the result in `taken`. */\nconst claim = (candidate, taken) => {\n\tlet key = candidate;\n\tfor (let n = 2; taken.has(foldApiKey(key)); n += 1) key = withSuffix(candidate, String(n));\n\ttaken.add(foldApiKey(key));\n\treturn key;\n};\nconst RESERVED_FIELDS = new Set(RESERVED_FIELD_API_KEYS.map(foldApiKey));\nconst RESERVED_DEFINITIONS = new Set(RESERVED_DEFINITION_API_KEYS.map(foldApiKey));\nconst RESERVED_TYPES = new Set(RESERVED_TYPE_NAMES.map(foldApiKey));\n/** A valid, unreserved field API ID (`status` → `statusField`), unique among `taken`. */\nconst fieldApiKey = (source, taken) => {\n\tconst key = toCamelCase(source);\n\treturn claim(RESERVED_FIELDS.has(foldApiKey(key)) ? withSuffix(key, \"Field\") : key, taken);\n};\n/** A valid, unreserved model or component API ID, unique among `taken`. */\nconst definitionApiKey = (source, taken) => {\n\tconst key = toCamelCase(source);\n\tconst reserved = RESERVED_DEFINITIONS.has(foldApiKey(key)) || RESERVED_TYPES.has(foldApiKey(toTypeName(key)));\n\treturn claim(reserved ? withSuffix(key, \"Item\") : key, taken);\n};\n/** Shapio's slug form (`SLUG_PATTERN`): lower-case ASCII words joined by hyphens; percent-encoding decoded. */\nconst toSlug = (value) => {\n\tlet decoded = value;\n\ttry {\n\t\tdecoded = decodeURIComponent(value);\n\t} catch {}\n\treturn decoded.normalize(\"NFKD\").replace(/[̀-ͯ]/g, \"\").toLowerCase().replace(/[^a-z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\").slice(0, 200).replace(/-+$/, \"\");\n};\n/** A slug unique among `taken`: `hello`, `hello-2`, ...; `fallback` when the value has no usable characters. */\nconst uniqueSlug = (value, fallback, taken) => {\n\tconst base = toSlug(value) || toSlug(fallback);\n\tlet slug = base;\n\tfor (let n = 2; taken.has(slug); n += 1) slug = `${base}-${n}`;\n\ttaken.add(slug);\n\treturn slug;\n};\n//#endregion\n//#region src/import/strapi/schema.ts\n/** Every entry has these in Strapi; Shapio has its own. */\nconst SYSTEM_ATTRIBUTES = /* @__PURE__ */ new Set([\n\t\"id\",\n\t\"documentId\",\n\t\"createdAt\",\n\t\"updatedAt\",\n\t\"publishedAt\",\n\t\"createdBy\",\n\t\"updatedBy\",\n\t\"locale\",\n\t\"localizations\"\n]);\nconst SCALAR_TYPES = {\n\tstring: \"string\",\n\ttext: \"text\",\n\temail: \"email\",\n\tinteger: \"integer\",\n\tbiginteger: \"biginteger\",\n\tfloat: \"number\",\n\tdecimal: \"decimal\",\n\tdate: \"date\",\n\ttime: \"time\",\n\tdatetime: \"datetime\",\n\ttimestamp: \"datetime\",\n\tboolean: \"boolean\",\n\tjson: \"json\",\n\tuid: \"uid\"\n};\nconst UNIQUE_CAPABLE = /* @__PURE__ */ new Set([\n\t\"string\",\n\t\"email\",\n\t\"integer\",\n\t\"biginteger\",\n\t\"decimal\",\n\t\"date\",\n\t\"datetime\",\n\t\"time\",\n\t\"uid\"\n]);\nconst ONE_RELATIONS = /* @__PURE__ */ new Set([\n\t\"oneToOne\",\n\t\"manyToOne\",\n\t\"oneWay\"\n]);\nconst MANY_RELATIONS = /* @__PURE__ */ new Set([\n\t\"oneToMany\",\n\t\"manyToMany\",\n\t\"manyWay\"\n]);\nconst MEDIA_KINDS = {\n\timages: [\"image\"],\n\tvideos: [\"video\"],\n\taudios: [\"audio\"],\n\tfiles: [\"document\", \"other\"]\n};\nconst GRAPHQL_NAME = /^[_A-Za-z][_0-9A-Za-z]*$/;\n/** `publishedOn` / `seo_title` → `Published on` / `Seo title`. */\nconst humanize = (name) => {\n\tconst label = name.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\").split(/[^A-Za-z0-9]+/).filter(Boolean).map((word) => word.toLowerCase()).join(\" \");\n\treturn label ? label.charAt(0).toUpperCase() + label.slice(1) : name;\n};\nconst skip = (context, name, reason) => {\n\tcontext.notes.push(`Skipped ${context.owner}.${name}: ${reason}.`);\n};\nconst isLocalizedAttribute = (attribute) => attribute.pluginOptions?.i18n?.localized === true || attribute.type === \"relation\" || attribute.type === \"uid\";\nconst enumField = (name, attribute, context) => {\n\tconst values = attribute.enum ?? [];\n\tif (!(values.length > 0 && values.every((value) => GRAPHQL_NAME.test(value) && value.length <= 64 && ![\n\t\t\"true\",\n\t\t\"false\",\n\t\t\"null\"\n\t].includes(value)))) {\n\t\tcontext.notes.push(`${context.owner}.${name}: enumeration values are not valid API names, imported as text.`);\n\t\treturn {\n\t\t\tfield: { type: \"string\" },\n\t\t\tvalueKind: \"scalar\"\n\t\t};\n\t}\n\treturn {\n\t\tfield: {\n\t\t\ttype: \"enum\",\n\t\t\tsettings: { values: values.map((value) => ({\n\t\t\t\tvalue,\n\t\t\t\tlabel: humanize(value)\n\t\t\t})) }\n\t\t},\n\t\tvalueKind: \"scalar\"\n\t};\n};\nconst relationField = (name, attribute, context) => {\n\tconst relation = attribute.relation ?? \"\";\n\tif (attribute.mappedBy) return skip(context, name, `the inverse side of ${attribute.target ?? \"a relation\"}.${attribute.mappedBy} (the owning side is imported)`);\n\tif (!attribute.target || !context.contentTypes.has(attribute.target)) return skip(context, name, `relations to ${attribute.target ?? \"polymorphic targets\"} are not imported`);\n\tif (!ONE_RELATIONS.has(relation) && !MANY_RELATIONS.has(relation)) return skip(context, name, `${relation} relations are not supported`);\n\treturn {\n\t\tfield: {\n\t\t\ttype: \"relation\",\n\t\t\ttarget: attribute.target,\n\t\t\tsettings: { cardinality: MANY_RELATIONS.has(relation) ? \"many\" : \"one\" }\n\t\t},\n\t\tvalueKind: \"relation\"\n\t};\n};\nconst mediaField = (attribute) => {\n\tconst kinds = [...new Set((attribute.allowedTypes ?? []).flatMap((type) => MEDIA_KINDS[type] ?? []))];\n\tconst settings = { multiple: attribute.multiple === true };\n\tif (kinds.length > 0) settings.allowedKinds = kinds;\n\treturn {\n\t\tfield: {\n\t\t\ttype: \"media\",\n\t\t\tsettings\n\t\t},\n\t\tvalueKind: \"media\"\n\t};\n};\nconst structuredField = (name, attribute, context) => {\n\tif (attribute.type === \"component\") {\n\t\tif (!attribute.component || !context.components.has(attribute.component)) return skip(context, name, `unknown component ${attribute.component ?? \"\"}`);\n\t\treturn {\n\t\t\tfield: {\n\t\t\t\ttype: \"component\",\n\t\t\t\tcomponent: attribute.component,\n\t\t\t\tsettings: { repeatable: attribute.repeatable === true }\n\t\t\t},\n\t\t\tvalueKind: \"component\"\n\t\t};\n\t}\n\tconst components = (attribute.components ?? []).filter((uid) => context.components.has(uid));\n\tif (components.length === 0) return skip(context, name, \"a dynamic zone without known components\");\n\treturn {\n\t\tfield: {\n\t\t\ttype: \"dynamiczone\",\n\t\t\tcomponents\n\t\t},\n\t\tvalueKind: \"zone\"\n\t};\n};\nconst mapAttribute = (name, attribute, context) => {\n\tconst scalarType = SCALAR_TYPES[attribute.type];\n\tif (scalarType) return {\n\t\tfield: {\n\t\t\ttype: scalarType,\n\t\t\t...(attribute.unique === true || attribute.type === \"uid\") && UNIQUE_CAPABLE.has(scalarType) ? { unique: true } : {}\n\t\t},\n\t\tvalueKind: \"scalar\"\n\t};\n\tswitch (attribute.type) {\n\t\tcase \"richtext\": return {\n\t\t\tfield: { type: \"richtext\" },\n\t\t\tvalueKind: \"markdown\"\n\t\t};\n\t\tcase \"blocks\": return {\n\t\t\tfield: { type: \"richtext\" },\n\t\t\tvalueKind: \"blocks\"\n\t\t};\n\t\tcase \"enumeration\": return enumField(name, attribute, context);\n\t\tcase \"relation\": return relationField(name, attribute, context);\n\t\tcase \"media\": return mediaField(attribute);\n\t\tcase \"component\":\n\t\tcase \"dynamiczone\": return structuredField(name, attribute, context);\n\t\tcase \"password\": return skip(context, name, \"passwords are never imported\");\n\t\tdefault: return skip(context, name, `the \"${attribute.type}\" type is not supported`);\n\t}\n};\nconst planDefinition = (schema, apiKey, context) => {\n\tconst isComponent = schema.modelType === \"component\";\n\tconst localized = !isComponent && schema.pluginOptions?.i18n?.localized === true;\n\tconst takenFields = /* @__PURE__ */ new Set();\n\tconst attributes = [];\n\tconst fields = [];\n\tfor (const [name, attribute] of Object.entries(schema.attributes)) {\n\t\tif (SYSTEM_ATTRIBUTES.has(name)) continue;\n\t\tconst mapped = mapAttribute(name, attribute, {\n\t\t\t...context,\n\t\t\towner: apiKey\n\t\t});\n\t\tif (!mapped) continue;\n\t\tattributes.push({\n\t\t\tname,\n\t\t\tattribute,\n\t\t\ttype: mapped.field.type,\n\t\t\tvalueKind: mapped.valueKind\n\t\t});\n\t\tconst fieldKey = fieldApiKey(name, takenFields);\n\t\tif (fieldKey !== name) context.notes.push(`${apiKey}.${name} is named ${fieldKey} (the name is reserved or not a valid API ID).`);\n\t\tfields.push({\n\t\t\tkey: name,\n\t\t\tapiKey: fieldKey,\n\t\t\tlabel: humanize(name),\n\t\t\t...mapped.field,\n\t\t\t...localized ? { localized: isLocalizedAttribute(attribute) } : {}\n\t\t});\n\t}\n\tconst titleAttribute = attributes.find((attribute) => attribute.type === \"string\")?.name;\n\tconst definition = {\n\t\tkey: schema.uid,\n\t\tkind: isComponent ? \"component\" : schema.kind === \"singleType\" ? \"singleton\" : \"collection\",\n\t\tapiKey,\n\t\tlabel: schema.info?.displayName ?? humanize(apiKey),\n\t\t...schema.info?.description ? { description: schema.info.description.slice(0, 2e3) } : {},\n\t\t...localized ? { localized: true } : {},\n\t\t...isComponent ? { category: schema.category ?? schema.uid.split(\".\")[0] ?? \"imported\" } : {},\n\t\t...titleAttribute ? { titleField: titleAttribute } : {},\n\t\tfields\n\t};\n\tconst plural = schema.info?.pluralName ? toCamelCase(schema.info.pluralName) : void 0;\n\tif (definition.kind === \"collection\" && plural && foldApiKey(plural) !== foldApiKey(apiKey)) definition.pluralApiKey = plural;\n\treturn {\n\t\tschema,\n\t\tdefinition,\n\t\tattributes,\n\t\t...titleAttribute ? { titleAttribute } : {}\n\t};\n};\n/** A component's API ID: its name (`shared.seo` → `seo`), or category and name when names repeat. */\nconst componentBaseNames = (components) => {\n\tconst counts = /* @__PURE__ */ new Map();\n\tconst nameOf = (uid) => uid.split(\".\").slice(1).join(\".\") || uid;\n\tcomponents.forEach((schema) => counts.set(nameOf(schema.uid), (counts.get(nameOf(schema.uid)) ?? 0) + 1));\n\treturn (schema) => (counts.get(nameOf(schema.uid)) ?? 0) > 1 ? schema.uid : nameOf(schema.uid);\n};\nconst planStrapiSchema = (schemas) => {\n\tconst contentTypes = schemas.filter((schema) => schema.modelType === \"contentType\" && schema.uid.startsWith(\"api::\"));\n\tconst components = schemas.filter((schema) => schema.modelType === \"component\");\n\tconst context = {\n\t\tcontentTypes: new Set(contentTypes.map((schema) => schema.uid)),\n\t\tcomponents: new Set(components.map((schema) => schema.uid)),\n\t\tnotes: [],\n\t\towner: \"\"\n\t};\n\tconst taken = /* @__PURE__ */ new Set();\n\tconst plans = /* @__PURE__ */ new Map();\n\t/** The API ID for `name`; a reserved or repeated name gets a suffix, which the plan lists. */\n\tconst claimApiKey = (schema, name) => {\n\t\tconst apiKey = definitionApiKey(name, taken);\n\t\tif (apiKey !== toCamelCase(name)) context.notes.push(`${schema.uid} is named ${apiKey} (the name is reserved or already taken).`);\n\t\treturn apiKey;\n\t};\n\tfor (const schema of contentTypes) {\n\t\tconst name = schema.info?.singularName ?? schema.uid.split(\".\").at(-1) ?? \"model\";\n\t\tplans.set(schema.uid, planDefinition(schema, claimApiKey(schema, name), context));\n\t}\n\tconst baseName = componentBaseNames(components);\n\tfor (const schema of components) plans.set(schema.uid, planDefinition(schema, claimApiKey(schema, baseName(schema)), context));\n\tif (contentTypes.some((schema) => schema.options?.draftAndPublish === false)) context.notes.push(`Draft and publish is turned on for ${contentTypes.filter((schema) => schema.options?.draftAndPublish === false).map((schema) => plans.get(schema.uid)?.definition.apiKey).join(\", \")} (off in Strapi), so imported entries are reviewed before they go live.`);\n\treturn {\n\t\tplans,\n\t\tnotes: context.notes\n\t};\n};\n//#endregion\n//#region src/import/strapi/adapter.ts\n/**\n* A Strapi 5 export → the import model. Content types become models (single types singletons), components\n* components, upload files the media library. Each document becomes one entry; its locales come from the\n* document's rows, using the draft row's content. A locale that has a published row in Strapi becomes a\n* publish item of the change set; draft-only locales stay drafts. Relations and media come from the export's\n* links, components and dynamic zones from the rows themselves.\n*/\nconst UPLOAD_FILE = \"plugin::upload.file\";\nconst rowKey = (type, id) => `${type}#${id}`;\nconst push = (map, key, value) => map.set(key, [...map.get(key) ?? [], value]);\nconst indexLinks = (links) => {\n\tconst relations = /* @__PURE__ */ new Map();\n\tconst media = /* @__PURE__ */ new Map();\n\tfor (const link of links) {\n\t\tconst fileSide = link.left.type === UPLOAD_FILE ? link.left : link.right.type === UPLOAD_FILE ? link.right : void 0;\n\t\tif (fileSide) {\n\t\t\tconst entity = fileSide === link.left ? link.right : link.left;\n\t\t\tif (entity.field) push(media, `${rowKey(entity.type, entity.ref)}#${entity.field}`, fileSide.ref);\n\t\t\tcontinue;\n\t\t}\n\t\tconst owner = link.left.field ? link.left : link.right.field ? link.right : void 0;\n\t\tconst target = owner === link.left ? link.right : link.left;\n\t\tif (owner?.field) push(relations, `${rowKey(owner.type, owner.ref)}#${owner.field}`, {\n\t\t\ttype: target.type,\n\t\t\tref: target.ref\n\t\t});\n\t}\n\treturn {\n\t\trelations,\n\t\tmedia\n\t};\n};\nconst stringOf = (value) => typeof value === \"string\" ? value : void 0;\n/** Strapi IDs and numeric scalars as text (objects are not scalars and give undefined). */\nconst textOf = (value) => typeof value === \"string\" ? value : typeof value === \"number\" || typeof value === \"bigint\" ? String(value) : void 0;\n/** Strapi's `name` may lack the extension (its example project's names do); `ext` always has it. */\nconst withExtension = (name, ext) => name.toLowerCase().endsWith(ext.toLowerCase()) ? name : `${name}${ext}`;\nconst fileMedia = (data, root) => {\n\tconst hash = stringOf(data.hash);\n\tconst ext = stringOf(data.ext) ?? \"\";\n\tconst id = textOf(data.id);\n\tif (!hash || id === void 0) return;\n\tconst alt = stringOf(data.alternativeText);\n\tconst caption = stringOf(data.caption);\n\tconst mimeType = stringOf(data.mime);\n\tconst name = stringOf(data.name);\n\treturn {\n\t\tsourceId: `file:${id}`,\n\t\tfilename: name ? withExtension(name, ext) : `${hash}${ext}`,\n\t\tpath: join(root, \"assets\", \"uploads\", `${hash}${ext}`),\n\t\t...mimeType ? { mimeType } : {},\n\t\t...alt ? { alt } : {},\n\t\t...caption ? { caption } : {}\n\t};\n};\n/** Upload files (entities, or the assets' metadata files) and the URLs content uses for them. */\nconst collectMedia = (exported) => {\n\tconst rows = exported.entities.filter((entity) => entity.type === UPLOAD_FILE).map((entity) => ({\n\t\tid: entity.id,\n\t\t...entity.data\n\t}));\n\tconst files = rows.length > 0 ? rows : exported.assetMetadata.filter((data) => !data.mainHash && !data.type);\n\tconst media = [];\n\tconst imageUrls = /* @__PURE__ */ new Map();\n\tfor (const data of files) {\n\t\tconst item = fileMedia(data, exported.root);\n\t\tif (!item) continue;\n\t\tmedia.push(item);\n\t\tconst formats = data.formats ?? {};\n\t\tfor (const url of [stringOf(data.url), ...Object.values(formats).map((format) => format.url)]) if (url) imageUrls.set(url, item.sourceId);\n\t}\n\treturn {\n\t\tmedia,\n\t\timageUrls\n\t};\n};\nconst imageResolver = (indexes, resolver) => (url) => {\n\tconst sourceId = indexes.imageUrls.get(url) ?? indexes.imageUrls.get(new URL(url, \"http://strapi.invalid\").pathname);\n\treturn sourceId ? resolver.media(sourceId) : void 0;\n};\nconst scalarValue = (attribute, value) => {\n\tif (value === null || value === void 0 || value === \"\") return;\n\tswitch (attribute.type) {\n\t\tcase \"datetime\": {\n\t\t\tconst text = textOf(value);\n\t\t\tconst date = text === void 0 ? void 0 : new Date(text);\n\t\t\treturn date && !Number.isNaN(date.getTime()) ? date.toISOString() : void 0;\n\t\t}\n\t\tcase \"decimal\":\n\t\tcase \"biginteger\": return textOf(value);\n\t\tcase \"json\": return value;\n\t\tdefault: return typeof value === \"object\" ? JSON.stringify(value) : value;\n\t}\n};\nconst entrySourceId = (type, documentId) => `strapi:${type}:${documentId}`;\nconst relationValue = (indexes, key, many) => {\n\tconst sourceIds = [...new Set((indexes.relations.get(key) ?? []).flatMap((target) => {\n\t\tconst documentId = indexes.documents.get(rowKey(target.type, target.ref));\n\t\treturn documentId ? [entrySourceId(target.type, documentId)] : [];\n\t}))];\n\treturn sourceIds.length > 0 ? {\n\t\tkind: \"entries\",\n\t\tsourceIds,\n\t\tmany\n\t} : void 0;\n};\nconst attributeValue = (indexes, attribute, value, linkKey) => {\n\tswitch (attribute.valueKind) {\n\t\tcase \"scalar\": {\n\t\t\tconst scalar = scalarValue(attribute, value);\n\t\t\treturn scalar === void 0 ? void 0 : {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tvalue: scalar\n\t\t\t};\n\t\t}\n\t\tcase \"markdown\": return typeof value === \"string\" && value.trim() ? {\n\t\t\tkind: \"richtext\",\n\t\t\tconvert: (resolver) => {\n\t\t\t\tconst html = marked.parse(value, { async: false });\n\t\t\t\tconst resolve = imageResolver(indexes, resolver);\n\t\t\t\treturn htmlToRichText(html, { resolveImage: (image) => resolve(image.src) });\n\t\t\t}\n\t\t} : void 0;\n\t\tcase \"blocks\": return Array.isArray(value) && value.length > 0 ? {\n\t\t\tkind: \"richtext\",\n\t\t\tconvert: (resolver) => blocksToRichText(value, imageResolver(indexes, resolver))\n\t\t} : void 0;\n\t\tcase \"relation\": return relationValue(indexes, linkKey, attribute.attribute.relation?.endsWith(\"Many\") === true || attribute.attribute.relation === \"manyWay\");\n\t\tcase \"media\": {\n\t\t\tconst ids = indexes.media.get(linkKey) ?? [];\n\t\t\treturn ids.length > 0 ? {\n\t\t\t\tkind: \"media\",\n\t\t\t\tsourceIds: ids.map((id) => `file:${String(id)}`),\n\t\t\t\tmany: attribute.attribute.multiple === true\n\t\t\t} : void 0;\n\t\t}\n\t\tcase \"component\": return componentValue(indexes, attribute, value);\n\t\tcase \"zone\": return zoneValue(indexes, value);\n\t\tdefault: return;\n\t}\n};\n/** The fields of one row or component instance; links are looked up by its type and ID. */\nconst fieldsOf = (indexes, plan, data, id) => {\n\tconst fields = {};\n\tfor (const attribute of plan.attributes) {\n\t\tconst value = attributeValue(indexes, attribute, data[attribute.name], `${rowKey(plan.schema.uid, id)}#${attribute.name}`);\n\t\tif (value) fields[attribute.name] = value;\n\t}\n\treturn fields;\n};\nconst isRecord$1 = (value) => typeof value === \"object\" && value !== null && !Array.isArray(value);\nfunction componentValue(indexes, attribute, value) {\n\tconst plan = attribute.attribute.component ? indexes.plans.get(attribute.attribute.component) : void 0;\n\tconst instances = (Array.isArray(value) ? value : [value]).filter(isRecord$1);\n\tif (!plan || instances.length === 0) return;\n\treturn {\n\t\tkind: \"component\",\n\t\titems: instances.map((instance) => fieldsOf(indexes, plan, instance, instance.id)),\n\t\tmany: attribute.attribute.repeatable === true\n\t};\n}\nfunction zoneValue(indexes, value) {\n\tconst items = (Array.isArray(value) ? value : []).filter(isRecord$1).flatMap((instance) => {\n\t\tconst uid = stringOf(instance.__component);\n\t\tconst plan = uid ? indexes.plans.get(uid) : void 0;\n\t\treturn plan && uid ? [{\n\t\t\tcomponent: uid,\n\t\t\tfields: fieldsOf(indexes, plan, instance, instance.id)\n\t\t}] : [];\n\t});\n\treturn items.length > 0 ? {\n\t\tkind: \"zone\",\n\t\titems\n\t} : void 0;\n}\n/** One entry per document: per locale, the draft row's content (the published row when there is no draft). */\nconst documentEntry = (indexes, plan, documentId, rows) => {\n\tconst localized = plan.definition.localized === true;\n\tconst draftAndPublish = plan.schema.options?.draftAndPublish !== false;\n\tconst byLocale = /* @__PURE__ */ new Map();\n\tfor (const row of rows) {\n\t\tconst locale = localized ? stringOf(row.data.locale) ?? null : null;\n\t\tbyLocale.set(locale, [...byLocale.get(locale) ?? [], row]);\n\t}\n\tconst locales = [...byLocale].map(([locale, localeRows]) => {\n\t\tconst row = localeRows.find((candidate) => !candidate.data.publishedAt) ?? localeRows[0];\n\t\treturn {\n\t\t\tlocale,\n\t\t\tfields: fieldsOf(indexes, plan, row.data, row.id),\n\t\t\tpublished: !draftAndPublish || localeRows.some((candidate) => Boolean(candidate.data.publishedAt))\n\t\t};\n\t});\n\tconst firstRow = rows[0];\n\tconst title = plan.titleAttribute ? stringOf(firstRow.data[plan.titleAttribute]) : void 0;\n\treturn {\n\t\tsourceId: entrySourceId(plan.schema.uid, documentId),\n\t\tdefinition: plan.schema.uid,\n\t\ttitle: title || `${plan.definition.apiKey} ${documentId}`,\n\t\tlocales\n\t};\n};\nconst collectEntries = (indexes, entities) => {\n\tconst documents = /* @__PURE__ */ new Map();\n\tfor (const entity of entities) {\n\t\tconst plan = indexes.plans.get(entity.type);\n\t\tif (!plan || plan.definition.kind === \"component\") continue;\n\t\tconst documentId = indexes.documents.get(rowKey(entity.type, entity.id));\n\t\tconst key = `${entity.type}#${documentId}`;\n\t\tconst document = documents.get(key) ?? {\n\t\t\tplan,\n\t\t\tdocumentId,\n\t\t\trows: []\n\t\t};\n\t\tdocument.rows.push(entity);\n\t\tdocuments.set(key, document);\n\t}\n\treturn [...documents.values()].map((document) => documentEntry(indexes, document.plan, document.documentId, document.rows));\n};\nconst strapiSource = (exported) => {\n\tconst { plans, notes } = planStrapiSchema(exported.schemas);\n\tconst { media, imageUrls } = collectMedia(exported);\n\tconst indexes = {\n\t\tplans,\n\t\tdocuments: new Map(exported.entities.map((entity) => [rowKey(entity.type, entity.id), stringOf(entity.data.documentId) ?? String(entity.id)])),\n\t\t...indexLinks(exported.links),\n\t\timageUrls\n\t};\n\treturn {\n\t\tkind: \"strapi\",\n\t\tdefinitions: [...plans.values()].map((plan) => plan.definition),\n\t\tmedia,\n\t\tentries: collectEntries(indexes, exported.entities),\n\t\tnotes\n\t};\n};\n//#endregion\n//#region src/import/strapi/archive.ts\n/**\n* Unpacks a `strapi export` archive (Strapi v5, `@strapi/data-transfer`'s file format): a tar, gzip-compressed\n* unless exported with `--no-compress`, and encrypted unless exported with `--no-encrypt`. Encrypted archives\n* use Strapi's default cipher, AES-128-ECB with the key derived by `scrypt(key, '', 16)`. Entries are extracted\n* with node-tar's defaults, which refuse absolute paths and `..`.\n*/\nconst GZIP_MAGIC = [31, 139];\nconst USTAR_OFFSET = 257;\nvar EncryptedExportError = class extends Error {\n\tconstructor(path) {\n\t\tsuper(`${path} is encrypted: pass the key it was exported with (--key), or export again with --no-encrypt`);\n\t\tthis.name = \"EncryptedExportError\";\n\t}\n};\nconst readHead = async (path) => {\n\tconst handle = await open(path, \"r\");\n\ttry {\n\t\tconst head = Buffer.alloc(262);\n\t\tconst { bytesRead } = await handle.read(head, 0, head.length, 0);\n\t\treturn head.subarray(0, bytesRead);\n\t} finally {\n\t\tawait handle.close();\n\t}\n};\n/** A gzip stream or a plain tar: anything else is taken as encrypted. */\nconst isReadableArchive = (head) => head[0] === GZIP_MAGIC[0] && head[1] === GZIP_MAGIC[1] || head.subarray(USTAR_OFFSET, 262).toString(\"latin1\") === \"ustar\";\nconst strapiDecipher = (key) => createDecipheriv(\"aes-128-ecb\", scryptSync(key, \"\", 16), null);\n/** Extracts the archive into `dir` (emptied first). */\nconst extractStrapiExport = async (path, dir, key) => {\n\tconst head = await readHead(path);\n\tif (!key && !isReadableArchive(head)) throw new EncryptedExportError(path);\n\tawait rm(dir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait mkdir(dir, { recursive: true });\n\tconst unpack = extract({\n\t\tcwd: dir,\n\t\tstrict: true,\n\t\tfilter: (_path, entry) => !(\"type\" in entry) || entry.type === \"File\" || entry.type === \"Directory\"\n\t});\n\ttry {\n\t\tawait (key ? pipeline(createReadStream(path), strapiDecipher(key), unpack) : pipeline(createReadStream(path), unpack));\n\t} catch (error) {\n\t\tthrow new Error(`${path} could not be unpacked${key ? \" (is the key right?)\" : \"\"}: ${error.message}`, { cause: error });\n\t}\n};\n//#endregion\n//#region src/import/strapi/exportFiles.ts\nvar UnsupportedExportError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"UnsupportedExportError\";\n\t}\n};\nconst isMissing$1 = (error) => error.code === \"ENOENT\";\n/** The export's root: the extraction directory, or its only subdirectory. */\nconst findRoot = async (dir) => {\n\tconst entries = await readdir(dir, { withFileTypes: true });\n\tif (entries.some((entry) => entry.isFile() && entry.name === \"metadata.json\")) return dir;\n\tconst subdirectories = entries.filter((entry) => entry.isDirectory());\n\tfor (const subdirectory of subdirectories) {\n\t\tconst candidate = join(dir, subdirectory.name);\n\t\tif ((await readdir(candidate)).includes(\"metadata.json\")) return candidate;\n\t}\n\tthrow new UnsupportedExportError(\"The archive has no metadata.json: is it a `strapi export` file?\");\n};\nconst readJsonLines = async (dir) => {\n\tlet names;\n\ttry {\n\t\tnames = (await readdir(dir)).filter((name) => name.endsWith(\".jsonl\")).sort();\n\t} catch (error) {\n\t\tif (isMissing$1(error)) return [];\n\t\tthrow error;\n\t}\n\tconst items = [];\n\tfor (const name of names) {\n\t\tconst lines = createInterface({\n\t\t\tinput: createReadStream(join(dir, name), \"utf8\"),\n\t\t\tcrlfDelay: Infinity\n\t\t});\n\t\tfor await (const line of lines) if (line.trim()) items.push(JSON.parse(line));\n\t}\n\treturn items;\n};\nconst readAssetMetadata = async (root) => {\n\tconst dir = join(root, \"assets\", \"metadata\");\n\tlet names;\n\ttry {\n\t\tnames = (await readdir(dir)).filter((name) => name.endsWith(\".json\")).sort();\n\t} catch (error) {\n\t\tif (isMissing$1(error)) return [];\n\t\tthrow error;\n\t}\n\treturn Promise.all(names.map(async (name) => JSON.parse(await readFile(join(dir, name), \"utf8\"))));\n};\n/** Strapi v5 only: v4 exports have another document model (no document IDs) and are refused. */\nconst checkVersion = (metadata) => {\n\tconst version = metadata.strapi?.version ?? \"\";\n\tconst major = Number.parseInt(version, 10);\n\tif (major === 5) return version;\n\tthrow new UnsupportedExportError(major === 4 ? `This is a Strapi ${version} export. Only Strapi 5 exports are supported: upgrade the project to Strapi 5 (npx @strapi/upgrade major), then export again.` : `Unsupported export: Strapi version \"${version || \"unknown\"}\" (only Strapi 5 exports are supported).`);\n};\nconst readStrapiExport = async (dir) => {\n\tconst root = await findRoot(dir);\n\tconst metadata = JSON.parse(await readFile(join(root, \"metadata.json\"), \"utf8\"));\n\treturn {\n\t\troot,\n\t\tversion: checkVersion(metadata),\n\t\tschemas: await readJsonLines(join(root, \"schemas\")),\n\t\tentities: await readJsonLines(join(root, \"entities\")),\n\t\tlinks: await readJsonLines(join(root, \"links\")),\n\t\tassetMetadata: await readAssetMetadata(root)\n\t};\n};\n//#endregion\n//#region src/import/importMap.ts\n/**\n* `import-map.json`: written by `--plan`, then the state of `--map` runs, so a re-run continues where the last\n* one stopped. It records what was planned (definition and field IDs per source key, entries, media) and what\n* was created (asset and entry IDs per source ID, change sets). Rewritten atomically after every step.\n*/\nconst IMPORT_MAP_FILE = \"import-map.json\";\nconst IMPORT_MAP_FORMAT = \"shapio-import-map\";\nconst emptyState = () => ({\n\tsite: null,\n\tbaseUrl: null,\n\tmedia: {},\n\tentries: {},\n\tfailed: {},\n\tchangeSets: [],\n\tchangeSetItems: {}\n});\nconst importMapPath = (dir) => join(dir, IMPORT_MAP_FILE);\nconst readImportMap = async (dir) => {\n\tconst path = importMapPath(dir);\n\tlet raw;\n\ttry {\n\t\traw = JSON.parse(await readFile(path, \"utf8\"));\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") throw new Error(`${path} does not exist: run the import with --plan ${dir} first`, { cause: error });\n\t\tthrow new Error(`${path} is not valid JSON: ${error.message}`, { cause: error });\n\t}\n\tconst map = raw;\n\tif (map.format !== \"shapio-import-map\" || map.formatVersion !== 1) throw new Error(`${path} is not a version 1 import map`);\n\treturn {\n\t\t...map,\n\t\tstate: {\n\t\t\t...emptyState(),\n\t\t\t...map.state\n\t\t}\n\t};\n};\n/** Writes the map through a temporary file, so an interrupted run never leaves half a file. */\nconst writeImportMap = async (dir, map) => {\n\tconst path = importMapPath(dir);\n\tawait writeFile(`${path}.tmp`, `${JSON.stringify(map, null, 2)}\\n`);\n\tawait rename(`${path}.tmp`, path);\n};\nconst sha256File = async (path) => {\n\tconst hash = createHash(\"sha256\");\n\tfor await (const chunk of createReadStream(path)) hash.update(chunk);\n\treturn hash.digest(\"hex\");\n};\n/** The state key of a locale: `\"\"` stands for a model that is not localized. */\nconst localeKey = (locale) => locale ?? \"\";\n//#endregion\n//#region src/import/changeSets.ts\n/**\n* The review step: every created entry locale that was published at the source becomes a `publish` item of\n* an open change set. Above `MAX_ITEMS_PER_SET` items the import opens numbered sets, so each stays\n* reviewable and shippable. Drafts at the source are not added: they stay drafts.\n*/\nconst MAX_ITEMS_PER_SET = 2e3;\n/** Publish items that are not in a change set yet, in plan order. */\nconst pendingPublishItems = (map, live) => {\n\tconst pending = [];\n\tlet total = 0;\n\tfor (const [sourceId, planned] of Object.entries(map.entries)) {\n\t\tconst created = map.state.entries[sourceId];\n\t\tconst view = live.byKey.get(planned.definition);\n\t\tfor (const locale of planned.published) {\n\t\t\ttotal += 1;\n\t\t\tif (!created || !view || !created.locales.includes(localeKey(locale))) continue;\n\t\t\tconst key = `${created.entryId}/${localeKey(locale)}`;\n\t\t\tif (!map.state.changeSetItems[key]) pending.push({\n\t\t\t\tkey,\n\t\t\t\tmodelKey: view.definition.apiKey,\n\t\t\t\tentryId: created.entryId,\n\t\t\t\tlocale\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tpending,\n\t\ttotal\n\t};\n};\nconst setTitle = (label, index, count) => count > 1 ? `Import from ${label} (${index}/${count})` : `Import from ${label}`;\n/** The last set this import opened, when it is still open and has room. */\nconst reusableSet = async (client, map) => {\n\tconst last = map.state.changeSets.at(-1);\n\tif (!last) return;\n\tconst set = await client.admin.changeSets.get(last.id);\n\treturn set.status === \"open\" && set.entryItemCount < 2e3 ? {\n\t\tid: set.id,\n\t\tcount: set.entryItemCount\n\t} : void 0;\n};\nconst addToChangeSets = async (client, map, items, { label, total, save }) => {\n\tconst outcome = {\n\t\tadded: 0,\n\t\tfailed: []\n\t};\n\tconst setCount = Math.max(1, Math.ceil(total / MAX_ITEMS_PER_SET));\n\tlet current = await reusableSet(client, map);\n\tfor (const item of items) {\n\t\tif (!current || current.count >= 2e3) {\n\t\t\tconst index = map.state.changeSets.length + 1;\n\t\t\tconst title = setTitle(label, index, Math.max(setCount, index));\n\t\t\tconst created = await client.admin.changeSets.create({\n\t\t\t\ttitle,\n\t\t\t\tdescription: `Imported entries that were published in ${label}. Review, then ship to publish them.`\n\t\t\t});\n\t\t\tmap.state.changeSets.push({\n\t\t\t\tid: created.id,\n\t\t\t\ttitle\n\t\t\t});\n\t\t\tcurrent = {\n\t\t\t\tid: created.id,\n\t\t\t\tcount: 0\n\t\t\t};\n\t\t\tawait save();\n\t\t}\n\t\ttry {\n\t\t\tawait client.admin.changeSets.addEntry(current.id, {\n\t\t\t\tmodelKey: item.modelKey,\n\t\t\t\tentryId: item.entryId,\n\t\t\t\t...item.locale ? { locale: item.locale } : {},\n\t\t\t\taction: \"publish\"\n\t\t\t});\n\t\t\tmap.state.changeSetItems[item.key] = current.id;\n\t\t\tcurrent.count += 1;\n\t\t\toutcome.added += 1;\n\t\t\tawait save();\n\t\t} catch (error) {\n\t\t\toutcome.failed.push({\n\t\t\t\tkey: item.key,\n\t\t\t\tmessage: error.message\n\t\t\t});\n\t\t}\n\t}\n\treturn outcome;\n};\n/** The admin page of a change set (`/admin/s/<site>/changes/<id>` on a named site). */\nconst changeSetUrl = (baseUrl, id, site) => `${baseUrl.replace(/\\/+$/, \"\")}/admin/${site ? `s/${encodeURIComponent(site)}/` : \"\"}changes/${encodeURIComponent(id)}`;\n//#endregion\n//#region src/import/media.ts\n/**\n* One media item into the library: a local file when the source has one (an extracted export, `--media-dir`),\n* else a download into the plan's cache (kept, so a re-run does not fetch it again). Alt text and caption are\n* set after the upload; failing that is a warning, never a lost upload.\n*/\nconst DOWNLOAD_TIMEOUT_MS = 12e4;\nconst MAX_ALT_LENGTH = 1e3;\nconst MAX_CAPTION_LENGTH = 4e3;\nconst exists$1 = (path) => access(path).then(() => true, () => false);\nconst cachePath = (cacheDir, media) => join(cacheDir, `${createHash(\"sha256\").update(media.sourceId).digest(\"hex\").slice(0, 24)}${extname(media.filename).toLowerCase()}`);\nconst contentTypeOf = (response) => {\n\tconst type = response.headers.get(\"content-type\")?.split(\";\")[0]?.trim().toLowerCase();\n\treturn type && type !== \"application/octet-stream\" ? type : void 0;\n};\nconst download = async (url, path, context) => {\n\tconst parsed = new URL(url);\n\tif (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") throw new Error(`not an http(s) URL: ${url}`);\n\tconst response = await context.fetch(parsed, { signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS) });\n\tif (!response.ok || !response.body) {\n\t\tawait response.body?.cancel();\n\t\tthrow new Error(`download failed: HTTP ${response.status} for ${url}`);\n\t}\n\tawait mkdir(context.cacheDir, { recursive: true });\n\tconst body = response.body;\n\tawait pipeline(Readable.fromWeb(body), createWriteStream(`${path}.part`));\n\tawait rename(`${path}.part`, path);\n\treturn contentTypeOf(response);\n};\n/** The file to upload and its type. */\nconst localFile = async (media, context) => {\n\tif (media.path && await exists$1(media.path)) return {\n\t\tpath: media.path,\n\t\tmimeType: media.mimeType ?? mimeTypeOf(media.filename)\n\t};\n\tif (!media.url) throw new Error(`no file for ${media.filename}${media.path ? ` (${media.path} is missing)` : \"\"}`);\n\tconst path = cachePath(context.cacheDir, media);\n\tconst downloadedType = await exists$1(path) ? void 0 : await download(media.url, path, context);\n\treturn {\n\t\tpath,\n\t\tmimeType: media.mimeType ?? mimeTypeOf(media.filename) ?? downloadedType\n\t};\n};\n/** Uploads one item; returns the new asset's ID. */\nconst importMedia = async (media, context) => {\n\tconst file = await localFile(media, context);\n\tif (!file.mimeType) throw new Error(`unknown file type for ${media.filename}`);\n\tconst asset = await uploadFile(context.client, {\n\t\tbaseUrl: context.baseUrl,\n\t\tpath: file.path,\n\t\tfilename: media.filename,\n\t\tmimeType: file.mimeType\n\t});\n\tconst alt = media.alt?.trim().slice(0, MAX_ALT_LENGTH);\n\tconst caption = media.caption?.trim().slice(0, MAX_CAPTION_LENGTH);\n\tif (alt || caption) try {\n\t\tawait context.client.admin.media.assets.update(asset.id, {\n\t\t\texpectedVersion: asset.version,\n\t\t\t...alt ? { alt } : {},\n\t\t\t...caption ? { caption } : {}\n\t\t});\n\t} catch (error) {\n\t\tcontext.warnings.push({\n\t\t\tcode: \"mediaTextNotSet\",\n\t\t\tdetail: `${media.filename}: ${error.message}`\n\t\t});\n\t}\n\treturn asset.id;\n};\n//#endregion\n//#region src/import/order.ts\nconst collectReferences = (value, into) => {\n\tswitch (value.kind) {\n\t\tcase \"entries\":\n\t\t\tinto.push(...value.sourceIds);\n\t\t\tbreak;\n\t\tcase \"component\":\n\t\t\tvalue.items.forEach((item) => Object.values(item).forEach((nested) => collectReferences(nested, into)));\n\t\t\tbreak;\n\t\tcase \"zone\": value.items.forEach((item) => Object.values(item.fields).forEach((nested) => collectReferences(nested, into)));\n\t}\n};\n/** Referenced entry source IDs, per top-level field key, across every locale of the entry. */\nconst referencesByField = (entry) => {\n\tconst byField = /* @__PURE__ */ new Map();\n\tfor (const locale of entry.locales) for (const [key, value] of Object.entries(locale.fields)) {\n\t\tconst targets = [];\n\t\tcollectReferences(value, targets);\n\t\tif (targets.length > 0) {\n\t\t\tconst set = byField.get(key) ?? /* @__PURE__ */ new Set();\n\t\t\ttargets.forEach((target) => set.add(target));\n\t\t\tbyField.set(key, set);\n\t\t}\n\t}\n\treturn byField;\n};\nconst edgesOf = (entry, known) => {\n\tconst byTarget = /* @__PURE__ */ new Map();\n\tfor (const [field, targets] of referencesByField(entry)) for (const target of targets) if (known.has(target)) byTarget.set(target, [...byTarget.get(target) ?? [], field]);\n\treturn [...byTarget].map(([target, fields]) => ({\n\t\ttarget,\n\t\tfields\n\t}));\n};\nconst defer = (deferred, sourceId, fields) => {\n\tconst set = deferred.get(sourceId) ?? /* @__PURE__ */ new Set();\n\tfields.forEach((field) => set.add(field));\n\tdeferred.set(sourceId, set);\n};\nconst writeOrder = (entries) => {\n\tconst bySourceId = new Map(entries.map((entry) => [entry.sourceId, entry]));\n\tconst known = new Set(bySourceId.keys());\n\tconst state = /* @__PURE__ */ new Map();\n\tconst ordered = [];\n\tconst deferred = /* @__PURE__ */ new Map();\n\tfor (const root of entries) {\n\t\tif (state.has(root.sourceId)) continue;\n\t\tconst stack = [{\n\t\t\tentry: root,\n\t\t\tedges: edgesOf(root, known),\n\t\t\tnext: 0\n\t\t}];\n\t\tstate.set(root.sourceId, \"visiting\");\n\t\twhile (stack.length > 0) {\n\t\t\tconst frame = stack[stack.length - 1];\n\t\t\tconst edge = frame.edges[frame.next];\n\t\t\tif (!edge) {\n\t\t\t\tstack.pop();\n\t\t\t\tstate.set(frame.entry.sourceId, \"done\");\n\t\t\t\tordered.push(frame.entry);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe.next += 1;\n\t\t\tconst status = state.get(edge.target);\n\t\t\tif (status === \"visiting\") defer(deferred, frame.entry.sourceId, edge.fields);\n\t\t\telse if (status === void 0) {\n\t\t\t\tconst target = bySourceId.get(edge.target);\n\t\t\t\tstate.set(edge.target, \"visiting\");\n\t\t\t\tstack.push({\n\t\t\t\t\tentry: target,\n\t\t\t\t\tedges: edgesOf(target, known),\n\t\t\t\t\tnext: 0\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tentries: ordered,\n\t\tdeferred\n\t};\n};\n//#endregion\n//#region src/commands/schema/files.ts\n/** The file of a definition in a scope (`site`: its site key, null when shared). */\nconst definitionPath = (dir, definition, site) => join(dir, ...schemaFilePath(definition, site).split(\"/\"));\nconst isMissing = (error) => error.code === \"ENOENT\";\nconst listNames = async (path, filter) => {\n\ttry {\n\t\treturn (await readdir(path, { withFileTypes: true })).filter(filter).map((entry) => entry.name).sort();\n\t} catch (error) {\n\t\tif (isMissing(error)) return [];\n\t\tthrow error;\n\t}\n};\nconst readLocalFile = async (path, site) => {\n\tlet raw;\n\ttry {\n\t\traw = JSON.parse(await readFile(path, \"utf8\"));\n\t} catch (error) {\n\t\tthrow new Error(`${path} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`, { cause: error });\n\t}\n\tconst parsed = parseDefinition(raw);\n\treturn parsed.ok ? {\n\t\tpath,\n\t\traw,\n\t\tsite,\n\t\tid: parsed.definition.id,\n\t\thash: await hashDefinition(parsed.definition)\n\t} : {\n\t\tpath,\n\t\traw,\n\t\tsite\n\t};\n};\n/** The files of one scope's folder (`models/` and `components/` under it). */\nconst readScopeFiles = async (dir, site) => {\n\tconst base = join(dir, ...scopeDirectory(site).split(\"/\").filter(Boolean));\n\tconst files = [];\n\tfor (const kindDir of SCHEMA_KIND_DIRECTORIES) for (const name of await listNames(join(base, kindDir), (entry) => entry.isFile() && entry.name.endsWith(\".json\"))) files.push(await readLocalFile(join(base, kindDir, name), site));\n\treturn files;\n};\n/** Every schema file under `dir`: the shared folders first, then each site folder by key. */\nconst readLocalFiles = async (dir) => {\n\tconst files = await readScopeFiles(dir, null);\n\tfor (const siteKey of await listNames(join(dir, SITES_DIRECTORY), (entry) => entry.isDirectory() && !entry.name.startsWith(\".\"))) files.push(...await readScopeFiles(dir, siteKey));\n\treturn files;\n};\nconst readLockFile = async (path) => {\n\ttry {\n\t\treturn parseLockFile(await readFile(path, \"utf8\"));\n\t} catch (error) {\n\t\tif (isMissing(error)) return;\n\t\tthrow error;\n\t}\n};\nconst writeLockFile = async (path, lock) => {\n\tawait mkdir(dirname(path), { recursive: true });\n\tawait writeFile(path, serializeLockFile(lock));\n};\nconst writeDefinitionFile = async (dir, definition, site) => {\n\tconst path = definitionPath(dir, definition, site);\n\tawait mkdir(dirname(path), { recursive: true });\n\tawait writeFile(path, serializeDefinition(definition));\n\treturn path;\n};\nconst removeFile = (path) => rm(path, { force: true });\nconst displayPath = (path) => relative(process.cwd(), path) || path;\n//#endregion\n//#region src/commands/schema/format.ts\n/** The `ParentIds` key of a model by API ID (a stable ID never contains `:`). */\nconst parentKeyOf = (apiKey) => `apiKey:${apiKey}`;\n/** A definition's API ID from the files, else its ID; `(none)` for a model that extends nothing. */\nconst definitionName = (id, names) => typeof id === \"string\" && id !== \"\" ? names.get(id) ?? id : \"(none)\";\nconst isObject = (value) => typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst sortKeys = (value) => {\n\tif (Array.isArray(value)) return value.map(sortKeys);\n\tif (isObject(value)) return Object.fromEntries(Object.keys(value).sort().map((key) => [key, sortKeys(value[key])]));\n\treturn value;\n};\n/** A value in full, as one line of JSON with sorted keys, so both sides of a change read in the same order. */\nconst show = (value) => value === void 0 ? \"(unset)\" : JSON.stringify(sortKeys(value));\n/** Lists of objects (groups, enum options) are compared item by item; lists of IDs or values are shown whole. */\nconst isObjectList = (value) => Array.isArray(value) && value.some(isObject);\n/**\n* The parts of two values that differ, with paths like `.groups[1].label`: objects key by key and lists of\n* objects item by item, so a change inside a large value (a form layout) shows only what changed.\n*/\nconst differences = (from, to, path = \"\") => {\n\tif (isObject(from) && isObject(to)) return [.../* @__PURE__ */ new Set([...Object.keys(from), ...Object.keys(to)])].sort().flatMap((key) => differences(from[key], to[key], `${path}.${key}`));\n\tif (isObjectList(from) && isObjectList(to)) return Array.from({ length: Math.max(from.length, to.length) }, (_, index) => differences(from[index], to[index], `${path}[${index}]`)).flat();\n\treturn show(from) === show(to) ? [] : [{\n\t\tpath,\n\t\tfrom,\n\t\tto\n\t}];\n};\nconst fieldName = (change, names) => {\n\tconst fromPayload = (value) => value?.apiKey;\n\treturn fromPayload(change.to) ?? fromPayload(change.from) ?? names.get(change.fieldId ?? \"\") ?? change.fieldId ?? \"?\";\n};\n/**\n* A type change Shapio can't convert: every stored value of the field is dropped. The server classifies each\n* change from both sides' type and settings (`dropsValues`); an older server sends no flag, so the CLI falls\n* back to the type names, which can't see a multi-value enum.\n*/\nconst dropsValues = (change) => {\n\tif (change.kind !== \"field.type\") return false;\n\tif (change.dropsValues !== void 0) return change.dropsValues;\n\treturn isDataType(change.from) && isDataType(change.to) && typeChangeDropsValues({ type: change.from }, { type: change.to });\n};\n/**\n* The lines for one change, `+` added, `-` removed, `~` changed. Values are printed in full; a change inside\n* an object prints one line per part that changed. A type change that drops values says so.\n*/\nconst formatChange = (change, names) => {\n\tconst field = change.fieldId ? fieldName(change, names) : \"\";\n\tswitch (change.kind) {\n\t\tcase \"definition.added\": return [`+ definition ${show(change.to)}`];\n\t\tcase \"definition.removed\": return [`- definition ${show(change.from)}`];\n\t\tcase \"field.added\": return [`+ field ${field}`];\n\t\tcase \"field.removed\": return [`- field ${field}`];\n\t\tcase \"field.order\": return [\"~ field order\"];\n\t\tcase \"model.extends\": return [`~ extends: ${definitionName(change.from, names)} → ${definitionName(change.to, names)}`];\n\t\tdefault: {\n\t\t\tconst subject = change.kind.startsWith(\"field.\") ? `field ${field} ` : \"\";\n\t\t\tconst property = change.property ?? change.kind.split(\".\")[1] ?? change.kind;\n\t\t\tconst dropped = dropsValues(change) ? \" (values dropped)\" : \"\";\n\t\t\tconst parts = differences(change.from, change.to);\n\t\t\treturn (parts.length > 0 ? parts : [{\n\t\t\t\tpath: \"\",\n\t\t\t\tfrom: change.from,\n\t\t\t\tto: change.to\n\t\t\t}]).map((part) => `~ ${subject}${property}${part.path}: ${show(part.from)} → ${show(part.to)}${dropped}`);\n\t\t}\n\t}\n};\nconst DECISION_LABELS = {\n\tunchangedLocally: \"unchanged locally\",\n\talreadyApplied: \"already identical on the target\",\n\tremoteOnly: \"only on the target (pull to get it)\",\n\tdeletedLocallyWithoutPrune: \"deleted locally; pass --prune to delete it on the target\",\n\talreadyDeleted: \"already deleted on the target\",\n\tchangedOnBoth: \"changed locally AND on the target since your last pull\",\n\tdeletedOnTarget: \"changed locally but deleted on the target\",\n\texistsOnTarget: \"new locally but the target already has a different definition with this ID\",\n\tchangedOnTargetBeforeDelete: \"deleted locally but changed on the target since your last pull\"\n};\nconst describeDecision = (item) => {\n\tconst { decision } = item;\n\tif (decision.action === \"skip\" || decision.action === \"conflict\") return `${decision.action}: ${DECISION_LABELS[decision.reason] ?? decision.reason}`;\n\treturn decision.action;\n};\n/**\n* A change the server reports on another member of the item's family (a parent's new field, as each kind\n* that inherits it sees it) names that member, so the same line twice never reads as a duplicate.\n*/\nconst onMember = (change, item, names) => change.definitionId && change.definitionId !== item.definitionId ? ` (on ${definitionName(change.definitionId, names)})` : \"\";\nconst formatItem = (item, names, parents = /* @__PURE__ */ new Map()) => {\n\tconst flags = [\n\t\titem.plan?.summary?.breaking ? \"BREAKING\" : \"\",\n\t\titem.plan?.summary?.destructive ? \"DESTRUCTIVE\" : \"\",\n\t\titem.outcome === \"pending\" ? `pending change ${item.changeId ?? \"\"}` : \"\"\n\t].filter(Boolean);\n\tconst parent = parents.get(item.definitionId) ?? parents.get(parentKeyOf(item.apiKey));\n\tconst extendsNote = parent === void 0 ? \"\" : ` (extends ${definitionName(parent, names)})`;\n\treturn [`${item.kind === \"component\" ? \"component\" : \"model\"} ${item.apiKey}${extendsNote}: ${describeDecision(item)}${flags.length ? ` [${flags.join(\", \")}]` : \"\"}`, ...item.changes.flatMap((change) => formatChange(change, names).map((line) => ` ${line}${onMember(change, item, names)}`))].join(\"\\n\");\n};\nconst FOLDER_OF = {\n\tnetwork: \"the shared folders\",\n\tsite: \"the site’s folder\"\n};\nconst PLACE_OF = {\n\tnetwork: \"shared\",\n\tsite: \"on one site\"\n};\nconst SCOPE_OF = {\n\tnetwork: \"shared\",\n\tsite: \"site\"\n};\n/** One line per item of a scope refusal (`SCOPE_MISMATCH`, `FORBIDDEN_SCOPE`). */\nconst scopeItemLines = (code, items) => items.map((item) => {\n\tconst name = item.apiKey ?? item.definitionId ?? \"?\";\n\treturn code === \"SCOPE_MISMATCH\" ? ` ${name}: its file is in ${FOLDER_OF[item.local ?? \"\"] ?? \"?\"}, but on the instance it is ${PLACE_OF[item.remote ?? \"\"] ?? \"?\"}` : ` ${name} (${SCOPE_OF[item.scope ?? \"\"] ?? item.scope ?? \"?\"}): ${item.message ?? \"not allowed\"}`;\n});\n/** What to do next, per refusal (an error code, or the code of an issue in an invalid file). */\nconst HINTS = {\n\tSCHEMA_CHANGE_NOT_ACKNOWLEDGED: \"Review the changes with `shapio schema diff`, then re-run with --allow-breaking and/or --allow-destructive.\",\n\tSCHEMA_SYNC_CONFLICT: \"Commit your files, run `shapio schema pull --force`, reconcile with git, then apply again.\",\n\tSCOPE_MISMATCH: \"Sync never moves a definition between sites: run `shapio schema pull` to get the instance’s layout, or change the scope with `shapio schema scope`.\",\n\tFORBIDDEN_SCOPE: \"Shared definitions (in models/ and components/) need schema permission on every site: apply with a network token, or leave those files unchanged.\",\n\tUNKNOWN_PARENT: \"\\\"extends\\\" holds the stable ID of the parent type: check the ID, or add the parent’s file (it can be in the same apply).\",\n\tINVALID_PARENT: \"Only a collection can extend another collection, and both must be in the same place: both shared (models/), or both in one site’s folder.\",\n\tINHERITANCE_CYCLE: \"Follow the \\\"extends\\\" chain from the type named above and remove the link that leads back to it.\",\n\tINHERITANCE_TOO_DEEP: \"A family can be at most 8 types deep: make the type extend one higher up the chain.\",\n\tINHERITED_FLAG_MISMATCH: \"A type and the type it extends must agree on \\\"localized\\\" and \\\"draftAndPublish\\\": set the value the message names.\",\n\tINHERITED_FIELD_COLLISION: \"A type cannot declare a field its parent already has: rename its own field, or remove it and use the inherited one.\",\n\tHAS_CHILDREN: \"Delete the types that extend it first, or make them extend another type, then apply again.\"\n};\nconst issueWhere = (found, filePaths) => {\n\tconst match = /^\\/definitions\\/(\\d+)(.*)$/.exec(found.path ?? \"\");\n\tconst where = match ? `${filePaths[Number(match[1])] ?? `definition ${match[1]}`} ${match[2] || \"/\"}` : found.path ?? \"\";\n\treturn found.siteKey ? `${where} (site ${found.siteKey})` : where;\n};\nconst siteCountLines = (sites) => (sites ?? []).flatMap((site) => typeof site === \"object\" && site.entries !== void 0 ? [` site ${site.key ?? site.siteId ?? \"?\"}: ${site.entries} entr${site.entries === 1 ? \"y\" : \"ies\"}`] : []);\n/** Explains a refused request: conflicts with diffs, invalid files, scope refusals, missing acknowledgements. */\nconst formatApiError = (error, filePaths, names, parents = /* @__PURE__ */ new Map()) => {\n\tconst details = error.details ?? {};\n\tconst lines = [`${error.code}: ${error.message}`];\n\tfor (const conflict of details.conflicts ?? []) lines.push(formatItem(conflict, names, parents));\n\tfor (const found of details.issues ?? []) lines.push(` ${issueWhere(found, filePaths)}: ${found.message ?? \"\"}`);\n\tlines.push(...scopeItemLines(error.code, details.items ?? []));\n\tif (error.code === \"SCOPE_IN_USE\") lines.push(...siteCountLines(details.sites));\n\tconst codes = /* @__PURE__ */ new Set([error.code, ...(details.issues ?? []).flatMap((found) => found.code ?? [])]);\n\tlines.push(...[...codes].flatMap((code) => HINTS[code] ?? []));\n\treturn `${lines.join(\"\\n\")}\\n`;\n};\n//#endregion\n//#region src/commands/schema/siteTree.ts\n/**\n* Which part of a schema tree one site's sync is about (plan site-schema): the shared folders and that site's\n* own folder. One tree may hold several sites (`sites/<key>/`); a pull or apply for one never reads, sends,\n* rewrites or removes another site's files or lock entries.\n*/\nconst inView = (site, siteKey) => site === null || site === siteKey;\n/** The files an apply for `siteKey` sends: the shared ones and that site's. */\nconst filesForSite = (files, siteKey) => files.filter((file) => inView(file.site, siteKey));\n/** Each sent file's scope, parallel to the files: its folder decides (only creates use it). */\nconst scopesOf = (files) => files.map((file) => file.site === null ? \"network\" : \"site\");\n/**\n* The base an apply for `siteKey` sends: the lock in format 2 with only the shared entries and that site's,\n* so neither the three-way decision nor `--prune` can ever see another site's IDs. `sites` is kept: the\n* server refuses a tree that covers other sites only.\n*/\nconst baseForSite = (lock, siteKey) => {\n\tconst upgraded = upgradeLockFile(lock);\n\treturn {\n\t\t...upgraded,\n\t\tdefinitions: lockEntriesForSite(upgraded, siteKey)\n\t};\n};\n/** Files in the site's view that differ from what was last pulled (or were never pulled). */\nconst editedFilesForSite = (files, lock, siteKey) => {\n\tconst base = lockEntriesForSite(lock, siteKey);\n\tif (Object.keys(base).length === 0) return [];\n\treturn filesForSite(files, siteKey).filter((file) => {\n\t\tconst entry = file.id ? base[file.id] : void 0;\n\t\treturn !entry || file.hash !== entry.hash;\n\t});\n};\n/**\n* Files a pull of `siteKey` leaves stale: in the pulled scopes and not written (deleted or renamed on the\n* instance), plus any other file of a definition that was just written elsewhere (its scope changed on the\n* instance: it is the same definition, and two files with one ID would make the next apply fail).\n*/\nconst staleFilesAfterPull = (files, siteKey, written) => {\n\tconst writtenPaths = new Set(written.values());\n\treturn files.filter((file) => {\n\t\tif (writtenPaths.has(file.path)) return false;\n\t\treturn inView(file.site, siteKey) || file.id !== void 0 && written.has(file.id);\n\t});\n};\n/**\n* The lock after an apply for `siteKey` recorded its entries: the tree covers the site once it holds one of\n* the site's own definitions. A shared-only tree stays uncovered, so it still applies to every site.\n*/\nconst coverSiteIfHeld = (lock, siteKey) => Object.values(lock.definitions).some((entry) => entry.site === siteKey) ? {\n\t...lock,\n\tsites: withSiteCovered(lock.sites, siteKey)\n} : lock;\n//#endregion\n//#region src/commands/schema/sync.ts\nconst EMPTY_LOCK = {\n\tformatVersion: LOCK_FILE_FORMAT_VERSION,\n\tschemaVersion: 0,\n\tsites: [],\n\tdefinitions: {}\n};\n/**\n* Field and definition names by ID from every local file (all sites' folders too), for readable diffs. A type\n* that extends another stores only its own fields, and an inherited field keeps its parent's ID, so the\n* parent's file names it: the whole file set is read, never one site's part, and inherited fields resolve.\n*/\nconst collectNames = (files) => {\n\tconst names = /* @__PURE__ */ new Map();\n\tfor (const file of files) {\n\t\tconst raw = file.raw;\n\t\tif (raw.id && raw.apiKey) names.set(raw.id, raw.apiKey);\n\t\tfor (const field of raw.fields ?? []) if (field.id && field.apiKey) names.set(field.id, field.apiKey);\n\t}\n\treturn names;\n};\n/**\n* Each model's parent ID (`extends`, a stable ID like a relation's target) from the local files, keyed by the\n* model's ID and by its API ID (`parentKeyOf`): a new file may have no ID yet, which the instance assigns.\n*/\nconst collectParents = (files) => {\n\tconst parents = /* @__PURE__ */ new Map();\n\tfor (const file of files) {\n\t\tconst raw = file.raw;\n\t\tif (typeof raw.extends !== \"string\" || raw.extends === \"\") continue;\n\t\tif (raw.id) parents.set(raw.id, raw.extends);\n\t\tif (raw.apiKey) parents.set(parentKeyOf(raw.apiKey), raw.extends);\n\t}\n\treturn parents;\n};\nconst readLocalState = async (options) => {\n\tconst files = await readLocalFiles(options.dir);\n\treturn {\n\t\tfiles,\n\t\tlock: await readLockFile(options.lockPath) ?? EMPTY_LOCK,\n\t\tnames: collectNames(files),\n\t\tparents: collectParents(files)\n\t};\n};\n/** The admin client for the command's site (`--site`, else the token's site, else the primary). */\nconst clientFor = (options) => createClient({\n\tbaseUrl: options.baseUrl,\n\ttoken: options.token,\n\t...options.site ? { site: options.site } : {}\n});\n/** The schema sync endpoints (`export`, `apply`, `change`) of @shapio/client. */\nconst apiFor = (options) => clientFor(options).admin.schema;\n/** The key of the site the command works on, as the instance resolved it (an unnamed site is the default). */\nconst resolveSiteKey = async (options) => {\n\tif (options.site) return options.site;\n\tconst { site } = await apiFor(options).export({ scope: \"network\" });\n\tif (!site) throw new Error(\"The instance did not say which site this token works on; pass --site <key>\");\n\treturn site.key;\n};\n/**\n* The local tree narrowed to one site (shared files and `sites/<key>/`), or undefined (after explaining)\n* when the tree was pulled for other sites only.\n*/\nconst readSiteState = async (options, io) => {\n\tconst siteKey = await resolveSiteKey(options);\n\tconst state = await readLocalState(options);\n\tif (!lockCoversSite(state.lock, siteKey)) {\n\t\tio.stderr(`${displayPath(options.lockPath)} covers the site(s) ${(state.lock.sites ?? []).join(\", \")}, not \"${siteKey}\".\\nApply it with --site <one of those>, or pull \"${siteKey}\" into this tree first: shapio schema pull --site ${siteKey}\\n`);\n\t\treturn;\n\t}\n\treturn {\n\t\t...state,\n\t\tsiteKey,\n\t\tsent: filesForSite(state.files, siteKey)\n\t};\n};\n/** Sends the site's files with their lock-file bases; the server decides per definition (three-way). */\nconst sendApply = async (options, state, dryRun, io) => {\n\ttry {\n\t\treturn await apiFor(options).apply({\n\t\t\tdefinitions: state.sent.map((file) => file.raw),\n\t\t\tscopes: scopesOf(state.sent),\n\t\t\tbase: baseForSite(state.lock, state.siteKey),\n\t\t\tprune: options.prune,\n\t\t\tdryRun,\n\t\t\tacknowledgeBreaking: options.allowBreaking,\n\t\t\tacknowledgeDestructive: options.allowDestructive\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof ShapioApiError) {\n\t\t\tio.stderr(formatApiError(error, state.sent.map((file) => displayPath(file.path)), state.names, state.parents));\n\t\t\treturn;\n\t\t}\n\t\tthrow error;\n\t}\n};\nconst printResults = (response, state, io, verbose) => {\n\tfor (const item of response.results) if (verbose || item.decision.action !== \"skip\" || item.decision.reason !== \"unchangedLocally\") io.stdout(`${formatItem(item, state.names, state.parents)}\\n`);\n};\n//#endregion\n//#region src/import/planner.ts\n/** Where `--plan` puts the schema files and their (empty) lock file inside the plan directory. */\nconst PLAN_SCHEMA_DIR = \"schema\";\nconst PLAN_LOCK_FILE = \"schema-lock.json\";\n/** Fresh stable IDs for every planned definition and field (a new plan, or a throwaway build). */\nconst assignIds = (definitions) => Object.fromEntries(definitions.map((definition) => [definition.key, {\n\tid: createStableId(),\n\tkind: definition.kind,\n\tapiKey: definition.apiKey,\n\tfields: Object.fromEntries(definition.fields.map((field) => [field.key, createStableId()]))\n}]));\nconst idOf = (ids, key) => {\n\tconst planned = ids[key];\n\tif (!planned) throw new Error(`Import plan bug: unknown definition \"${key}\"`);\n\treturn planned.id;\n};\nconst fieldSettings = (field, ids, fieldIds) => {\n\tconst settings = { ...field.settings };\n\tif (field.target) settings.target = idOf(ids, field.target);\n\tif (field.component) settings.component = idOf(ids, field.component);\n\tif (field.components) settings.components = field.components.map((key) => idOf(ids, key));\n\tconst sourceFieldId = field.slugSource ? fieldIds[field.slugSource] : void 0;\n\tif (sourceFieldId) settings.sourceFieldId = sourceFieldId;\n\treturn settings;\n};\n/** The schema-file form of a planned definition (the pull format, with IDs). */\nconst definitionInput = (definition, ids) => {\n\tconst planned = ids[definition.key];\n\tif (!planned) throw new Error(`Import plan bug: unknown definition \"${definition.key}\"`);\n\tconst isModel = definition.kind !== \"component\";\n\tconst fields = definition.fields.map((field) => ({\n\t\tid: planned.fields[field.key],\n\t\tapiKey: field.apiKey,\n\t\tlabel: field.label,\n\t\ttype: field.type,\n\t\t...isModel && definition.localized ? { localized: field.localized ?? false } : {},\n\t\t...field.public === false ? { public: false } : {},\n\t\t...field.unique ? { unique: true } : {},\n\t\t...field.sortable ? { sortable: true } : {},\n\t\tsettings: fieldSettings(field, ids, planned.fields)\n\t}));\n\tconst titleFieldId = definition.titleField ? planned.fields[definition.titleField] : void 0;\n\treturn {\n\t\tid: planned.id,\n\t\tkind: definition.kind,\n\t\tapiKey: definition.apiKey,\n\t\tlabel: definition.label,\n\t\t...definition.description ? { description: definition.description } : {},\n\t\tfields,\n\t\t...definition.kind === \"collection\" ? { pluralApiKey: definition.pluralApiKey ?? suggestPlural(definition.apiKey) } : {},\n\t\t...isModel ? {\n\t\t\tlocalized: definition.localized ?? false,\n\t\t\tdraftAndPublish: true\n\t\t} : {},\n\t\t...definition.kind === \"component\" && definition.category ? { category: definition.category } : {},\n\t\t...titleFieldId ? { display: { titleFieldId } } : {}\n\t};\n};\n/** Normalized, validated definitions; throws with every issue when the plan would not apply. */\nconst buildDefinitions = (source, ids) => {\n\tconst problems = [];\n\tconst definitions = source.definitions.flatMap((planned) => {\n\t\tconst parsed = parseDefinition(definitionInput(planned, ids));\n\t\tif (!parsed.ok) {\n\t\t\tproblems.push(...parsed.issues.map((issue) => `${planned.apiKey}${issue.path}: ${issue.message}`));\n\t\t\treturn [];\n\t\t}\n\t\treturn [parsed.definition];\n\t});\n\tif (problems.length === 0) problems.push(...validateSchema(definitions).map((issue) => `${issue.path}: ${issue.message}`));\n\tif (problems.length > 0) throw new Error(`The planned schema is not valid:\\n${problems.map((line) => ` ${line}`).join(\"\\n\")}`);\n\treturn definitions;\n};\nconst exists = async (path) => access(path).then(() => true, () => false);\n/** Refuses to replace a plan whose import has started, and any plan without `force`. */\nconst checkPlanDirectory = async (dir, force) => {\n\tif (!await exists(importMapPath(dir))) return;\n\tconst previous = await readImportMap(dir);\n\tif (Object.keys(previous.state.entries).length > 0 || Object.keys(previous.state.media).length > 0) throw new Error(`${dir} holds an import that has started (${Object.keys(previous.state.entries).length} entries created): re-run --map to continue it, or plan into a new directory`);\n\tif (!force) throw new Error(`${dir} already holds a plan: pass --force to replace it (new IDs), or use another directory`);\n};\nconst plannedMap = (source, info, ids, site) => ({\n\tformat: IMPORT_MAP_FORMAT,\n\tformatVersion: 1,\n\tsource: info,\n\tplannedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\tsite: site ?? null,\n\tdefinitions: ids,\n\tmedia: Object.fromEntries(source.media.map((media) => [media.sourceId, {\n\t\tfilename: media.filename,\n\t\t...media.url ? { url: media.url } : {},\n\t\t...media.path ? { path: media.path } : {}\n\t}])),\n\tentries: Object.fromEntries(source.entries.map((entry) => [entry.sourceId, {\n\t\tdefinition: entry.definition,\n\t\ttitle: entry.title,\n\t\tlocales: entry.locales.map((locale) => locale.locale),\n\t\tpublished: entry.locales.filter((locale) => locale.published).map((locale) => locale.locale)\n\t}])),\n\tstate: emptyState()\n});\n/**\n* `--plan`: writes one pull-format schema file per planned definition under `<dir>/schema`, an empty lock file\n* beside them (so `schema apply` treats every definition as new and leaves the project's own lock alone), and\n* `import-map.json`. Nothing is sent to an instance. With `site` (`--site` / SHAPIO_SITE) the files go under\n* `schema/sites/<site>/`, so `schema apply --site <site>` creates them on that site; without one they go in\n* the shared folders and are created shared with all sites.\n*/\nconst writePlan = async (dir, source, info, { force = false, site } = {}) => {\n\tawait checkPlanDirectory(dir, force);\n\tconst ids = assignIds(source.definitions);\n\tconst definitions = buildDefinitions(source, ids);\n\tconst schemaDir = join(dir, PLAN_SCHEMA_DIR);\n\tawait rm(schemaDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tfor (const definition of definitions) await writeDefinitionFile(schemaDir, definition, site ?? null);\n\tawait writeLockFile(join(dir, PLAN_LOCK_FILE), EMPTY_LOCK);\n\tconst map = plannedMap(source, info, ids, site);\n\tawait writeImportMap(dir, map);\n\treturn {\n\t\tdefinitions,\n\t\tmap\n\t};\n};\n//#endregion\n//#region src/import/report.ts\n/** What a warning code means, for the summary of a plan or map run. */\nconst WARNING_LABELS = {\n\timageUnresolved: \"images left out of rich text (not imported)\",\n\tunsafeLink: \"links kept as plain text (unsafe or relative address)\",\n\tembedDropped: \"embeds dropped (iframes, video, forms)\",\n\tinvalidOutput: \"rich-text values imported as plain text\",\n\tmissingReference: \"references to entries that were not imported\",\n\tmissingMedia: \"references to media that were not imported\",\n\tmediaTextNotSet: \"media whose alt text or caption could not be set\",\n\tshortcodeKept: \"WordPress shortcodes kept as text\",\n\tunsupportedBlock: \"Strapi blocks that have no rich-text equivalent\"\n};\nconst EXAMPLES = 3;\n/** One line per warning code with a count and a few examples; empty when there were none. */\nconst formatWarnings = (warnings) => {\n\tconst byCode = /* @__PURE__ */ new Map();\n\tfor (const warning of warnings) byCode.set(warning.code, [...byCode.get(warning.code) ?? [], warning.detail]);\n\treturn [...byCode].map(([code, details]) => {\n\t\tconst examples = [...new Set(details)].slice(0, EXAMPLES).join(\", \");\n\t\treturn ` ${details.length} ${WARNING_LABELS[code] ?? code}${examples ? ` (e.g. ${examples})` : \"\"}\\n`;\n\t}).join(\"\");\n};\n//#endregion\n//#region src/import/values.ts\nconst resolveLiveSchema = (map, definitions) => {\n\tconst live = new Map(definitions.map((definition) => [definition.id, definition]));\n\tconst index = createDefinitionIndex(definitions);\n\tconst byKey = /* @__PURE__ */ new Map();\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst missing = [];\n\tfor (const [key, planned] of Object.entries(map.definitions)) {\n\t\tconst definition = live.get(planned.id);\n\t\tif (!definition) {\n\t\t\tmissing.push(planned.apiKey);\n\t\t\tcontinue;\n\t\t}\n\t\tconst effective = index.resolve(definition.id)?.fields ?? definition.fields;\n\t\tconst fieldsById = new Map(effective.map((field) => [field.id, field]));\n\t\tconst fields = /* @__PURE__ */ new Map();\n\t\tfor (const [fieldKey, fieldId] of Object.entries(planned.fields)) {\n\t\t\tconst field = fieldsById.get(fieldId);\n\t\t\tif (field && !field.deprecated) fields.set(fieldKey, field);\n\t\t}\n\t\tconst view = {\n\t\t\tdefinition,\n\t\t\tfields\n\t\t};\n\t\tbyKey.set(key, view);\n\t\tbyId.set(definition.id, view);\n\t}\n\treturn {\n\t\tbyKey,\n\t\tbyId,\n\t\tmissing\n\t};\n};\nconst resolveIds = (sourceIds, lookup, code, context) => sourceIds.flatMap((sourceId) => {\n\tconst id = lookup(sourceId);\n\tif (!id) {\n\t\tcontext.warnings.push({\n\t\t\tcode,\n\t\t\tdetail: sourceId\n\t\t});\n\t\treturn [];\n\t}\n\treturn [id];\n});\nconst listOrOne = (ids, many) => many ? ids.length > 0 ? ids : void 0 : ids[0];\nconst componentView = (field, context) => field.type === \"component\" ? context.live.byId.get(field.settings.component) : void 0;\nconst convertValue = (value, field, context) => {\n\tswitch (value.kind) {\n\t\tcase \"scalar\": return value.value;\n\t\tcase \"entries\": return listOrOne(resolveIds(value.sourceIds, context.resolver.entry, \"missingReference\", context), value.many);\n\t\tcase \"media\": return listOrOne(resolveIds(value.sourceIds, context.resolver.media, \"missingMedia\", context), value.many);\n\t\tcase \"richtext\": {\n\t\t\tconst converted = value.convert(context.resolver);\n\t\t\tcontext.warnings.push(...converted.warnings);\n\t\t\treturn converted.document;\n\t\t}\n\t\tcase \"component\": {\n\t\t\tconst view = componentView(field, context);\n\t\t\tif (!view) return;\n\t\t\tconst items = value.items.map((item) => buildData(item, view, context));\n\t\t\treturn value.many ? items : items[0];\n\t\t}\n\t\tcase \"zone\": return value.items.flatMap((item) => {\n\t\t\tconst view = context.live.byKey.get(item.component);\n\t\t\treturn view ? [{\n\t\t\t\t__component: view.definition.apiKey,\n\t\t\t\t...buildData(item.fields, view, context)\n\t\t\t}] : [];\n\t\t});\n\t\tdefault: return;\n\t}\n};\n/** The data object for one locale of an entry (or one component item). */\nconst buildData = (fields, view, context, selection = {}) => {\n\tconst data = {};\n\tfor (const [key, value] of Object.entries(fields)) {\n\t\tconst field = view.fields.get(key);\n\t\tif (!field || selection.omit?.has(key) || selection.only && !selection.only.has(key) || selection.localizedOnly && !field.localized) continue;\n\t\tconst converted = convertValue(value, field, context);\n\t\tif (converted !== void 0 && converted !== null) data[field.apiKey] = converted;\n\t}\n\treturn data;\n};\n//#endregion\n//#region src/import/mapper.ts\nvar ImportRefusedError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"ImportRefusedError\";\n\t}\n};\n/**\n* The site `--map` writes to: `--site` (or SHAPIO_SITE), else the site the plan was made for. A requested site\n* that disagrees with the planned one is refused: the planned models exist on that site only.\n*/\nconst resolveMapSite = (map, requested) => {\n\tconst planned = map.site ?? void 0;\n\tif (requested !== void 0 && planned !== void 0 && requested !== planned) throw new ImportRefusedError(`This import was planned for site \"${planned}\", not \"${requested}\": run --map with --site ${planned}, or plan again with --site ${requested}`);\n\treturn requested ?? planned;\n};\nconst messageOf = (error) => error instanceof Error ? error.message : String(error);\nconst checkSourceAndSite = async (map, site) => {\n\tif (await sha256File(map.source.path).catch((error) => {\n\t\tthrow new ImportRefusedError(`The source ${map.source.path} cannot be read: ${messageOf(error)}`);\n\t}) !== map.source.sha256) throw new ImportRefusedError(`${map.source.path} changed since it was planned: plan again into a new directory`);\n\tif ((Object.keys(map.state.entries).length > 0 || Object.keys(map.state.media).length > 0) && (map.state.site ?? null) !== (site ?? null)) throw new ImportRefusedError(`This import was started on site ${map.state.site ?? \"(default)\"}: re-run it with the same --site`);\n};\n/** The target site's view (the client names the site): its own definitions and the shared ones. */\nconst loadLiveSchema = async (client, map, dir, site) => {\n\tconst exported = await client.admin.schema.export();\n\tconst live = resolveLiveSchema(map, exported.definitions.map((entry) => entry.definition));\n\tif (live.missing.length > 0) throw new ImportRefusedError(`The instance does not have the planned models yet: ${live.missing.join(\", \")}.\\nApply them first: shapio schema apply --dir ${join(dir, PLAN_SCHEMA_DIR)} --lock ${join(dir, PLAN_LOCK_FILE)}${site ? ` --site ${site}` : \"\"}`);\n\treturn live;\n};\nconst checkLocales = async (client, source) => {\n\tconst needed = new Set(source.entries.flatMap((entry) => entry.locales.flatMap((locale) => locale.locale ? [locale.locale] : [])));\n\tif (needed.size === 0) return;\n\tconst available = new Set((await client.admin.locales.list()).map((locale) => locale.code));\n\tconst missing = [...needed].filter((code) => !available.has(code));\n\tif (missing.length > 0) throw new ImportRefusedError(`The instance does not have these locales: ${missing.join(\", \")}. Add them (Settings → Locales), then re-run.`);\n};\nconst resolverOf = (map) => ({\n\tmedia: (sourceId) => map.state.media[sourceId]?.assetId,\n\tentry: (sourceId) => map.state.entries[sourceId]?.entryId\n});\nconst fail = (run, sourceId, error) => {\n\trun.map.state.failed[sourceId] = messageOf(error);\n};\nconst succeed = async (run, sourceId) => {\n\tdelete run.map.state.failed[sourceId];\n\tawait run.save();\n};\nconst uploadAll = async (run, source) => {\n\tconst pending = source.media.filter((media) => !run.map.state.media[media.sourceId]);\n\tif (pending.length > 0) run.io.stdout(`Uploading ${pending.length} media file(s)...\\n`);\n\tconst context = {\n\t\tclient: run.client,\n\t\tbaseUrl: run.options.baseUrl,\n\t\tcacheDir: join(run.options.dir, \"media\"),\n\t\tfetch: run.options.fetch ?? globalThis.fetch,\n\t\twarnings: run.warnings\n\t};\n\tfor (const media of pending) try {\n\t\trun.map.state.media[media.sourceId] = { assetId: await importMedia(media, context) };\n\t\tawait succeed(run, media.sourceId);\n\t} catch (error) {\n\t\tfail(run, media.sourceId, error);\n\t}\n};\nconst buildContext = (run) => ({\n\tlive: run.live,\n\tresolver: resolverOf(run.map),\n\twarnings: run.warnings\n});\n/** Creates the entry in its first locale, then adds its other locales; resumes a partly written entry. */\nconst writeEntry = async (run, entry, deferred) => {\n\tconst view = run.live.byKey.get(entry.definition);\n\tif (!view) return;\n\tconst modelKey = view.definition.apiKey;\n\tconst context = buildContext(run);\n\tfor (const [index, locale] of entry.locales.entries()) {\n\t\tconst created = run.map.state.entries[entry.sourceId];\n\t\tconst key = localeKey(locale.locale);\n\t\tif (created?.locales.includes(key)) continue;\n\t\tconst data = buildData(locale.fields, view, context, {\n\t\t\t...deferred ? { omit: deferred } : {},\n\t\t\tlocalizedOnly: index > 0\n\t\t});\n\t\tconst localeInput = locale.locale ? { locale: locale.locale } : {};\n\t\tif (!created) {\n\t\t\tconst result = await run.client.admin.content.create(modelKey, {\n\t\t\t\t...localeInput,\n\t\t\t\tdata\n\t\t\t});\n\t\t\trun.map.state.entries[entry.sourceId] = {\n\t\t\t\tentryId: result.id,\n\t\t\t\tlocales: [key],\n\t\t\t\tcomplete: !deferred\n\t\t\t};\n\t\t} else {\n\t\t\tawait run.client.admin.content.update(modelKey, created.entryId, {\n\t\t\t\t...localeInput,\n\t\t\t\texpectedVersion: null,\n\t\t\t\tdata\n\t\t\t});\n\t\t\tcreated.locales.push(key);\n\t\t}\n\t\tawait run.save();\n\t}\n};\n/** The second write of entries whose references closed a cycle: only the deferred fields, per locale. */\nconst writeDeferred = async (run, entry, fields) => {\n\tconst created = run.map.state.entries[entry.sourceId];\n\tconst view = run.live.byKey.get(entry.definition);\n\tif (!created || created.complete || !view) return;\n\tconst modelKey = view.definition.apiKey;\n\tfor (const [index, locale] of entry.locales.entries()) {\n\t\tconst localeInput = locale.locale ? { locale: locale.locale } : {};\n\t\tconst data = buildData(locale.fields, view, buildContext(run), {\n\t\t\tonly: fields,\n\t\t\tlocalizedOnly: index > 0\n\t\t});\n\t\tif (Object.keys(data).length === 0) continue;\n\t\tconst current = await run.client.admin.content.get(modelKey, created.entryId, localeInput);\n\t\tawait run.client.admin.content.update(modelKey, created.entryId, {\n\t\t\t...localeInput,\n\t\t\texpectedVersion: current.version,\n\t\t\tdata\n\t\t});\n\t}\n\tcreated.complete = true;\n\tawait run.save();\n};\nconst writeEntries = async (run, source) => {\n\tconst order = writeOrder(source.entries);\n\tconst pending = order.entries.filter((entry) => {\n\t\tconst created = run.map.state.entries[entry.sourceId];\n\t\treturn !created || created.locales.length < entry.locales.length || !created.complete;\n\t});\n\tif (pending.length > 0) run.io.stdout(`Writing ${pending.length} entr${pending.length === 1 ? \"y\" : \"ies\"} as drafts...\\n`);\n\tfor (const entry of pending) try {\n\t\tawait writeEntry(run, entry, order.deferred.get(entry.sourceId));\n\t\tawait succeed(run, entry.sourceId);\n\t} catch (error) {\n\t\tfail(run, entry.sourceId, error);\n\t}\n\tfor (const entry of pending) {\n\t\tconst fields = order.deferred.get(entry.sourceId);\n\t\tif (!fields || run.map.state.failed[entry.sourceId]) continue;\n\t\ttry {\n\t\t\tawait writeDeferred(run, entry, fields);\n\t\t} catch (error) {\n\t\t\tfail(run, entry.sourceId, error);\n\t\t}\n\t}\n};\nconst openChangeSets = async (run) => {\n\tconst { pending, total } = pendingPublishItems(run.map, run.live);\n\tif (pending.length === 0) return {\n\t\tadded: 0,\n\t\tfailed: []\n\t};\n\trun.io.stdout(`Adding ${pending.length} published entr${pending.length === 1 ? \"y\" : \"ies\"} to change sets...\\n`);\n\treturn addToChangeSets(run.client, run.map, pending, {\n\t\tlabel: run.options.label,\n\t\ttotal,\n\t\tsave: run.save\n\t});\n};\nconst printSummary = (run, source, changeSetFailures) => {\n\tconst { state } = run.map;\n\tconst drafts = Object.values(run.map.entries).filter((entry) => entry.published.length === 0).length;\n\tconst failures = Object.entries(state.failed);\n\trun.io.stdout(`Media: ${Object.keys(state.media).length}/${source.media.length} uploaded. Entries: ${Object.keys(state.entries).length}/${source.entries.length} created (${drafts} stay drafts: they were not published in ${run.options.label}).\\n`);\n\tfor (const set of state.changeSets) run.io.stdout(`Change set \"${set.title}\": ${changeSetUrl(run.options.baseUrl, set.id, state.site)}\\n`);\n\trun.io.stdout(formatWarnings(run.warnings));\n\tfor (const [sourceId, message] of failures.slice(0, 20)) run.io.stderr(` ! ${sourceId}: ${message}\\n`);\n\tif (failures.length > 0 || changeSetFailures > 0) {\n\t\trun.io.stderr(`${failures.length + changeSetFailures} item(s) failed (see above). Fix the cause and re-run the same command: done items are skipped.\\n`);\n\t\treturn 1;\n\t}\n\treturn 0;\n};\nconst runMap = async (options, io) => {\n\tconst map = await readImportMap(options.dir);\n\tconst site = resolveMapSite(map, options.site);\n\tawait checkSourceAndSite(map, site);\n\tconst client = createClient({\n\t\tbaseUrl: options.baseUrl,\n\t\ttoken: options.token,\n\t\tfetch: createRateLimitedFetch(options.fetch),\n\t\t...site ? { site } : {}\n\t});\n\tconst live = await loadLiveSchema(client, map, options.dir, site);\n\tconst source = await options.load(map);\n\tawait checkLocales(client, source);\n\tmap.state.site = site ?? null;\n\tmap.state.baseUrl = options.baseUrl;\n\tconst run = {\n\t\toptions,\n\t\tio,\n\t\tmap,\n\t\tclient,\n\t\tlive,\n\t\twarnings: [],\n\t\tsave: () => writeImportMap(options.dir, map)\n\t};\n\tawait run.save();\n\tawait uploadAll(run, source);\n\tawait writeEntries(run, source);\n\tconst changeSets = await openChangeSets(run);\n\tfor (const failure of changeSets.failed) io.stderr(` ! change set item ${failure.key}: ${failure.message}\\n`);\n\treturn printSummary(run, source, changeSets.failed.length);\n};\n//#endregion\n//#region src/import/planSite.ts\n/**\n* The site a `--plan` writes its models for. `--plan` runs offline (no URL or token), so it cannot ask the\n* instance which site a token works on: it takes `--site`, else `SHAPIO_SITE`, else the primary site, whose key\n* is always `default`. On a single-site instance that is the only site, so the planned models apply with an\n* ordinary admin token. `--shared` plans models shared with all sites instead (applying them needs a network\n* admin token).\n*/\nconst PRIMARY_SITE_KEY = \"default\";\nconst resolvePlanSite = (options, env) => {\n\tconst named = options.site?.trim() || void 0;\n\tif (options.shared) {\n\t\tif (named) throw new UsageError$1(\"Pass either --site <key> or --shared, not both\");\n\t\treturn {\n\t\t\tsite: void 0,\n\t\t\texplicit: true\n\t\t};\n\t}\n\tconst site = named ?? (env.SHAPIO_SITE?.trim() || void 0);\n\treturn site ? {\n\t\tsite,\n\t\texplicit: true\n\t} : {\n\t\tsite: PRIMARY_SITE_KEY,\n\t\texplicit: false\n\t};\n};\n//#endregion\n//#region src/import/summary.ts\n/** Relative to the working directory when inside it, else absolute (what to paste into the next command). */\nconst display = (path) => {\n\tconst shown = relative(process.cwd(), path);\n\treturn !shown ? \".\" : shown.startsWith(\"..\") || isAbsolute(shown) ? path : shown;\n};\n/** What `--plan` wrote and what to do next. */\nconst formatPlanSummary = (source, definitions, dir, command, { site, explicit }) => {\n\tconst keyOf = new Map(source.definitions.map((definition) => [definition.apiKey, definition.key]));\n\tconst lines = [`Planned ${definitions.length} definition(s) in ${display(`${dir}/${PLAN_SCHEMA_DIR}`)}:`];\n\tfor (const definition of definitions) {\n\t\tconst entries = source.entries.filter((entry) => entry.definition === keyOf.get(definition.apiKey));\n\t\tconst published = entries.filter((entry) => entry.locales.some((locale) => locale.published)).length;\n\t\tlines.push(` ${definition.kind === \"component\" ? \"component\" : \"model\"} ${definition.apiKey}: ${definition.fields.length} field(s)` + (definition.kind === \"component\" ? \"\" : `, ${entries.length} entr${entries.length === 1 ? \"y\" : \"ies\"} (${published} published, ${entries.length - published} draft(s))`));\n\t}\n\tlines.push(`Media: ${source.media.length} file(s) to import.`);\n\tlines.push(\"Every model has draft and publish on: nothing goes live until you ship the change set(s) the import opens.\");\n\tlines.push(...source.notes);\n\tlines.push(!site ? \"The models and components will be shared with all sites (--shared): applying them needs a network admin token.\" : explicit ? `The models and components will belong to site \"${site}\".` : `The models and components will belong to the primary site (\"${site}\"). Plan with --site <key> for another site, or --shared to share them with all sites.`);\n\tconst siteFlag = site && explicit ? ` --site ${site}` : \"\";\n\tlines.push(\"Next:\", \" 1. Review the files: rename API IDs or delete fields you do not want (entries follow the stable IDs).\", ` 2. shapio schema apply --dir ${display(`${dir}/${PLAN_SCHEMA_DIR}`)} --lock ${display(`${dir}/${PLAN_LOCK_FILE}`)}${siteFlag}`, ` 3. shapio import ${command} --map ${display(dir)}${siteFlag}`);\n\treturn `${lines.join(\"\\n\")}\\n`;\n};\n//#endregion\n//#region src/import/targetNames.ts\n/**\n* `--plan --url <instance>`: planned API IDs and the GraphQL names they generate are checked against the\n* definitions the planned site can already see, so `schema apply` does not refuse the plan with\n* `API_KEY_COLLISION` or `GENERATED_NAME_COLLISION`. A planned definition that clashes is renamed (`seo` →\n* `seoItem`, then `seoItem2`, ...) and the plan output says so. Without a URL the plan stays offline and says the\n* names were not checked.\n*/\nconst NAMES_NOT_CHECKED_NOTE = \"Names were not checked against a target: pass --url and --token to --plan, or rename clashes in the schema files before applying.\";\nconst SHARED_PLAN_NOTE = \"Names were checked against the primary site's view: other sites' own definitions were not checked.\";\n/** The definitions the site can see: the same export `--map` reads. */\nconst fetchTargetDefinitions = async ({ baseUrl, token, site, fetch }) => {\n\treturn (await createClient({\n\t\tbaseUrl,\n\t\ttoken,\n\t\tsite,\n\t\tfetch: createRateLimitedFetch(fetch)\n\t}).admin.schema.export()).definitions.map((entry) => entry.definition);\n};\n/**\n* Every folded name a definition holds: its API ID and plural API ID (one shared namespace, `key:`), and each\n* generated GraphQL name in its own namespace (`type:`, `query:`, `mutation:`). `owner` is what a note names.\n*/\nconst claimsOf = (definition) => {\n\tconst keys = [definition.apiKey];\n\tif (definition.kind === \"collection\") keys.push(routeKeyOf(definition));\n\treturn [...keys.map((key) => ({\n\t\tclaim: `key:${foldApiKey(key)}`,\n\t\towner: key\n\t})), ...generatedNames(definition).map((name) => ({\n\t\tclaim: `${name.namespace}:${foldApiKey(name.name)}`,\n\t\towner: definition.apiKey\n\t}))];\n};\nconst renamed = (definition, apiKey) => definition.kind === \"collection\" ? {\n\t...definition,\n\tapiKey,\n\tpluralApiKey: suggestPlural(apiKey)\n} : {\n\t...definition,\n\tapiKey\n};\n/** `seoItem`, `seoItem2`, ...: the first whose names are free among `taken`. */\nconst freeApiKey = (definition, taken) => {\n\tconst base = withSuffix(definition.apiKey, \"Item\");\n\tfor (let n = 1;; n += 1) {\n\t\tconst candidate = n === 1 ? base : withSuffix(base, String(n));\n\t\tif (!claimsOf(renamed(definition, candidate)).some(({ claim }) => taken.has(claim))) return candidate;\n\t}\n};\nconst KIND_LABEL = {\n\tcollection: \"Model\",\n\tsingleton: \"Model\",\n\tcomponent: \"Component\"\n};\n/**\n* Renames the planned definitions whose names the target already holds, one at a time (a rename changes the\n* names the next check sees), until the plan fits. A renamed definition loses its planned plural API ID, so it\n* is derived from the new API ID. Entries address definitions by source key, so they follow.\n*/\nconst avoidTargetNames = (source, target) => {\n\tconst owners = new Map(target.flatMap(claimsOf).map(({ claim, owner }) => [claim, owner]));\n\tlet definitions = source.definitions;\n\tconst notes = [];\n\tfor (let round = 0; round <= source.definitions.length; round += 1) {\n\t\tconst ids = assignIds(definitions);\n\t\tconst built = buildDefinitions({\n\t\t\t...source,\n\t\t\tdefinitions\n\t\t}, ids);\n\t\tconst keyOf = new Map(Object.entries(ids).map(([key, planned]) => [planned.id, key]));\n\t\tconst clash = built.map((definition) => ({\n\t\t\tdefinition,\n\t\t\thit: claimsOf(definition).find(({ claim }) => owners.has(claim))\n\t\t})).find(({ hit }) => hit !== void 0);\n\t\tif (!clash?.hit) return {\n\t\t\t...source,\n\t\t\tdefinitions,\n\t\t\tnotes: [...source.notes, ...notes]\n\t\t};\n\t\tconst taken = /* @__PURE__ */ new Set([...owners.keys(), ...built.filter((definition) => definition !== clash.definition).flatMap((definition) => claimsOf(definition).map(({ claim }) => claim))]);\n\t\tconst apiKey = freeApiKey(clash.definition, taken);\n\t\tconst key = keyOf.get(clash.definition.id);\n\t\tdefinitions = definitions.map((planned) => {\n\t\t\tif (planned.key !== key) return planned;\n\t\t\tconst { pluralApiKey: _dropped, ...rest } = planned;\n\t\t\treturn {\n\t\t\t\t...rest,\n\t\t\t\tapiKey\n\t\t\t};\n\t\t});\n\t\tnotes.push(`${KIND_LABEL[clash.definition.kind]} ${clash.definition.apiKey} is named ${apiKey} (the target already has ${owners.get(clash.hit.claim)}).`);\n\t}\n\tthrow new Error(\"Import plan bug: renaming planned definitions away from the target did not settle\");\n};\n/** The plan step: checks names against the target when one is given, else notes that they were not. */\nconst checkTargetNames = async (source, target) => {\n\tif (!target) return {\n\t\t...source,\n\t\tnotes: [...source.notes, NAMES_NOT_CHECKED_NOTE]\n\t};\n\tconst checked = avoidTargetNames(source, await fetchTargetDefinitions(target));\n\treturn target.shared ? {\n\t\t...checked,\n\t\tnotes: [...checked.notes, SHARED_PLAN_NOTE]\n\t} : checked;\n};\n//#endregion\n//#region src/commands/import/importers.ts\nconst parse = (args, spec) => {\n\tconst { values, positionals } = parseArgs({\n\t\targs: [...args],\n\t\toptions: {\n\t\t\tplan: { type: \"string\" },\n\t\t\tmap: { type: \"string\" },\n\t\t\tforce: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\tshared: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\turl: { type: \"string\" },\n\t\t\ttoken: { type: \"string\" },\n\t\t\tsite: { type: \"string\" },\n\t\t\t...Object.fromEntries(spec.options.map((option) => [option, { type: \"string\" }]))\n\t\t},\n\t\tallowPositionals: true\n\t});\n\tif (positionals.length > 1) throw new UsageError$1(\"Give at most one export file\");\n\tif (values.plan === void 0 === (values.map === void 0)) throw new UsageError$1(\"Pass either --plan <dir> (with the export file) or --map <dir>\");\n\tif (values.plan !== void 0 && !positionals[0]) throw new UsageError$1(\"--plan needs the export file\");\n\tif (values.map !== void 0 && positionals[0]) throw new UsageError$1(\"--map reads the export recorded in the plan: leave the file out\");\n\tif (values.map !== void 0 && values.shared) throw new UsageError$1(\"--shared is a --plan option: --map imports where the plan put the models\");\n\tif (values.shared && values.site !== void 0) throw new UsageError$1(\"Pass either --site <key> or --shared, not both\");\n\treturn {\n\t\tvalues,\n\t\tfile: positionals[0]\n\t};\n};\n/** `--site`, else SHAPIO_SITE: the site `--map` writes to (else the site the plan recorded). */\nconst siteOf = (values, io) => (values.site ?? io.env.SHAPIO_SITE)?.trim() || void 0;\n/**\n* The instance `--plan` checks names against: only with an explicit `--url` (SHAPIO_URL alone keeps the plan\n* offline), with `--token` or SHAPIO_TOKEN. A shared plan is checked against the primary site's view.\n*/\nconst planTargetOf = (values, io, planSite) => {\n\tconst baseUrl = values.url;\n\tif (baseUrl === void 0) return;\n\tconst token = values.token ?? io.env.SHAPIO_TOKEN;\n\tif (!token) throw new UsageError$1(\"--plan --url checks names on that instance and needs an admin API token: pass --token or set SHAPIO_TOKEN\");\n\treturn {\n\t\tbaseUrl,\n\t\ttoken,\n\t\tsite: planSite.site ?? \"default\",\n\t\tshared: planSite.site === void 0\n\t};\n};\nconst runPlan = async (spec, file, values, io) => {\n\tconst dir = resolve(String(values.plan));\n\tconst path = resolve(file);\n\tawait checkPlanDirectory(dir, values.force === true);\n\tconst planSite = resolvePlanSite({\n\t\tsite: values.site,\n\t\tshared: values.shared === true\n\t}, io.env);\n\tconst target = planTargetOf(values, io, planSite);\n\tconst source = await checkTargetNames(await spec.plan(path, dir, values), target);\n\tconst { definitions } = await writePlan(dir, source, {\n\t\tkind: source.kind,\n\t\tpath,\n\t\tsha256: await sha256File(path)\n\t}, {\n\t\tforce: values.force === true,\n\t\tsite: planSite.site\n\t});\n\tio.stdout(formatPlanSummary(source, definitions, dir, spec.name, planSite));\n\treturn 0;\n};\nconst runMapStep = (spec, values, io) => {\n\tconst token = values.token ?? io.env.SHAPIO_TOKEN;\n\tif (!token) throw new UsageError$1(\"An admin API token is required: pass --token or set SHAPIO_TOKEN\");\n\tconst dir = resolve(String(values.map));\n\tconst site = siteOf(values, io);\n\treturn runMap({\n\t\tdir,\n\t\tbaseUrl: values.url ?? io.env.SHAPIO_URL ?? \"http://localhost:4300\",\n\t\ttoken,\n\t\t...site ? { site } : {},\n\t\tlabel: spec.label,\n\t\tload: (map) => spec.load(map, dir, values)\n\t}, io);\n};\nconst createImporterCommand = (spec) => ({\n\tsummary: spec.summary,\n\tusage: spec.usage,\n\trun: async (args, io) => {\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = parse(args, spec);\n\t\t} catch (error) {\n\t\t\tif (error instanceof UsageError$1 || error instanceof TypeError) {\n\t\t\t\tio.stderr(`shapio import ${spec.name}: ${error.message}\\nUsage: ${spec.usage}\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\ttry {\n\t\t\treturn parsed.file !== void 0 && parsed.values.plan !== void 0 ? await runPlan(spec, parsed.file, parsed.values, io) : await runMapStep(spec, parsed.values, io);\n\t\t} catch (error) {\n\t\t\tio.stderr(`shapio import ${spec.name}: ${describeFailure(error)}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t}\n});\n//#endregion\n//#region src/commands/import/strapi.ts\n/** The unpacked export lives in the plan directory, so `--map` reads the same files without the key. */\nconst sourceDir = (dir) => join(dir, \"source\");\n/** `shapio import strapi`: a Strapi 5 export (`strapi export`) as models, components, media and drafts. */\nconst importStrapiCommand = createImporterCommand({\n\tname: \"strapi\",\n\tlabel: \"Strapi\",\n\tsummary: \"Import a Strapi 5 export: --plan writes schema files, --map creates drafts and change sets\",\n\tusage: \"shapio import strapi <export.tar[.gz[.enc]]> --plan <dir> [--key <encryption key>] [--site <key> | --shared] [--url <origin> --token <admin token>] [--force]\\n shapio import strapi --map <dir> [--url <origin>] [--token <admin token>] [--site <key>]\\n --plan unpacks the export into <dir>/source (--key for an encrypted export) and writes the planned models\\n and components (<dir>/schema) and <dir>/import-map.json. With --url it checks the planned API IDs against\\n that instance and renames clashes (seo → seoItem); without it, it sends nothing. They belong to one site\\n (<dir>/schema/sites/<key>/): --site (or SHAPIO_SITE), else the primary site (\\\"default\\\"); --shared shares\\n them with all sites (applying them needs a network admin token). --map without --site imports into the\\n planned site. Apply the schema with\\n `shapio schema apply --dir <dir>/schema --lock <dir>/schema-lock.json [--site <key>]`, then run --map:\\n it uploads the media, creates every document as a draft and opens change sets with the published ones.\\n Strapi 5 only.\",\n\toptions: [\"key\"],\n\tplan: async (file, dir, values) => {\n\t\tawait extractStrapiExport(file, sourceDir(dir), typeof values.key === \"string\" ? values.key : void 0);\n\t\treturn strapiSource(await readStrapiExport(sourceDir(dir)));\n\t},\n\tload: async (_map, dir) => strapiSource(await readStrapiExport(sourceDir(dir)))\n});\n//#endregion\n//#region src/import/wordpress/autop.ts\n/**\n* A reduced port of WordPress's `wpautop`: classic-editor content (and Markdown-free plain posts) is stored\n* without paragraph tags, and WordPress adds them when it renders. Blank lines become paragraphs and single\n* newlines `<br>`, outside block elements and `<pre>`. Block-editor content (`<!-- wp:` comments) already has\n* its markup and is returned as it is.\n*/\nconst BLOCK_TAGS = \"table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary|iframe|script|video|audio|object\";\n/** Blocks whose own content can hold paragraphs (WordPress wraps text inside these too). */\nconst CONTAINER_TAGS = \"blockquote|div|section|article|aside|header|footer|nav|details|form|fieldset|address\";\nconst OPEN_BLOCK = new RegExp(`(<(?:${BLOCK_TAGS})(?:[\\\\s/>]))`, \"gi\");\nconst CLOSE_BLOCK = new RegExp(`(</(?:${BLOCK_TAGS})>)`, \"gi\");\nconst OPEN_CONTAINER_END = new RegExp(`(<(?:${CONTAINER_TAGS})(?:\\\\s[^>]*)?>)`, \"gi\");\nconst CLOSE_CONTAINER = new RegExp(`(</(?:${CONTAINER_TAGS})>)`, \"gi\");\nconst STARTS_WITH_BLOCK = new RegExp(`^</?(?:${BLOCK_TAGS})(?:[\\\\s/>])`, \"i\");\nconst PRE = /<pre[\\s>][\\s\\S]*?<\\/pre>/gi;\nconst isBlockEditorContent = (html) => html.includes(\"<!-- wp:\");\nconst autop = (html) => {\n\tif (html.trim().length === 0 || isBlockEditorContent(html)) return html;\n\tconst preserved = [];\n\treturn html.replace(PRE, (match) => `<pre data-autop=\"${preserved.push(match) - 1}\"></pre>`).replace(/\\r\\n?/g, \"\\n\").replace(/<br\\s*\\/?>\\s*<br\\s*\\/?>/gi, \"\\n\\n\").replace(OPEN_BLOCK, \"\\n\\n$1\").replace(CLOSE_BLOCK, \"$1\\n\\n\").replace(OPEN_CONTAINER_END, \"$1\\n\\n\").replace(CLOSE_CONTAINER, \"\\n\\n$1\").split(/\\n\\s*\\n/).map((chunk) => chunk.trim()).filter((chunk) => chunk.length > 0).map((chunk) => STARTS_WITH_BLOCK.test(chunk) ? chunk : `<p>${chunk.replace(/\\n/g, \"<br />\\n\")}</p>`).join(\"\\n\").replace(/<pre data-autop=\"(\\d+)\"><\\/pre>/g, (_, index) => preserved[Number(index)] ?? \"\");\n};\n//#endregion\n//#region src/import/wordpress/content.ts\n/**\n* Post bodies: shortcodes WordPress would expand, paragraph tags it would add, and matching the images a post\n* shows to the media items that were imported (by URL, including the resized copies WordPress generates).\n*/\nconst CAPTION = /\\[caption[^\\]]*\\]([\\s\\S]*?)\\[\\/caption\\]/gi;\nconst CAPTION_MEDIA = /^\\s*((?:<a\\b[^>]*>\\s*)?<img\\b[^>]*>(?:\\s*<\\/a>)?)([\\s\\S]*)$/i;\nconst SHORTCODE_CLOSE = /\\[\\/([a-z][a-z0-9_-]*)\\]/gi;\nconst KNOWN_SHORTCODES = /\\[(gallery|embed|video|audio|playlist|contact-form-7|contact-form)\\b[^\\]]*\\]/gi;\n/** `[caption]<img> text[/caption]` → `<figure><img><figcaption>text</figcaption></figure>`. */\nconst expandCaptions = (html) => html.replace(CAPTION, (match, inner) => {\n\tconst parts = CAPTION_MEDIA.exec(inner);\n\tif (!parts) return inner;\n\tconst caption = (parts[2] ?? \"\").trim();\n\treturn `<figure>${parts[1] ?? \"\"}${caption ? `<figcaption>${caption}</figcaption>` : \"\"}</figure>`;\n});\n/** Shortcodes left in the text after captions were expanded (they show up as literal text). */\nconst shortcodeWarnings = (html) => {\n\tconst names = /* @__PURE__ */ new Set();\n\tfor (const match of html.matchAll(SHORTCODE_CLOSE)) names.add(match[1].toLowerCase());\n\tfor (const match of html.matchAll(KNOWN_SHORTCODES)) names.add(match[1].toLowerCase());\n\treturn [...names].map((name) => ({\n\t\tcode: \"shortcodeKept\",\n\t\tdetail: `[${name}]`\n\t}));\n};\n/** A post body ready for the HTML converter. */\nconst prepareBody = (content) => autop(expandCaptions(content));\n/** Absolute URL of an image `src` (relative ones against the site), or undefined for data: and the like. */\nconst absoluteUrl = (src, base) => {\n\ttry {\n\t\tconst url = new URL(src, base || void 0);\n\t\treturn url.protocol === \"http:\" || url.protocol === \"https:\" ? url.href : void 0;\n\t} catch {\n\t\treturn;\n\t}\n};\nconst SIZE_SUFFIX = /-(\\d+x\\d+|scaled)(\\.[a-z0-9]+)$/i;\n/** Scheme-, query- and size-insensitive key: `//host/wp-content/uploads/a-300x200.jpg` → `host/…/a.jpg`. */\nconst urlKey = (url, stripSize) => {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tconst path = decodeURIComponent(parsed.pathname);\n\t\treturn `${parsed.host.toLowerCase()}${stripSize ? path.replace(SIZE_SUFFIX, \"$2\") : path}`;\n\t} catch {\n\t\treturn;\n\t}\n};\nconst createImageIndex = (base) => {\n\tconst exact = /* @__PURE__ */ new Map();\n\tconst sized = /* @__PURE__ */ new Map();\n\treturn {\n\t\tadd: (url, sourceId) => {\n\t\t\tconst key = urlKey(url, false);\n\t\t\tconst stripped = urlKey(url, true);\n\t\t\tif (key && !exact.has(key)) exact.set(key, sourceId);\n\t\t\tif (stripped && !sized.has(stripped)) sized.set(stripped, sourceId);\n\t\t},\n\t\tlookup: (src) => {\n\t\t\tconst url = absoluteUrl(src, base);\n\t\t\tif (!url) return;\n\t\t\tconst key = urlKey(url, false);\n\t\t\tconst stripped = urlKey(url, true);\n\t\t\treturn (key && exact.get(key)) ?? (stripped && sized.get(stripped)) ?? void 0;\n\t\t}\n\t};\n};\n/** The file name a URL ends with (decoded), for the media library. */\nconst filenameOf = (url, fallback) => {\n\ttry {\n\t\treturn posix.basename(decodeURIComponent(new URL(url).pathname)) || fallback;\n\t} catch {\n\t\treturn fallback;\n\t}\n};\n/** Where `--media-dir` (a copy of `wp-content/uploads`) holds the file of an uploads URL. */\nconst uploadsRelativePath = (url) => {\n\ttry {\n\t\tconst path = decodeURIComponent(new URL(url).pathname);\n\t\tconst index = path.indexOf(\"/uploads/\");\n\t\treturn index >= 0 ? path.slice(index + 9) : void 0;\n\t} catch {\n\t\treturn;\n\t}\n};\n//#endregion\n//#region src/import/wordpress/adapter.ts\nconst PUBLISHED = /* @__PURE__ */ new Set([\"publish\"]);\nconst KEPT_AS_DRAFT = /* @__PURE__ */ new Set([\n\t\"draft\",\n\t\"pending\",\n\t\"private\",\n\t\"future\"\n]);\nconst CONTENT_TYPES = /* @__PURE__ */ new Set([\"post\", \"page\"]);\nconst text = (key, label, extra = {}) => ({\n\tkey,\n\tapiKey: key,\n\tlabel,\n\ttype: \"string\",\n\t...extra\n});\nconst slugField = (source) => text(\"slug\", \"Slug\", {\n\ttype: \"slug\",\n\tunique: true,\n\tslugSource: source\n});\nconst relation = (key, label, target, many) => ({\n\tkey,\n\tapiKey: key,\n\tlabel,\n\ttype: \"relation\",\n\ttarget,\n\tsettings: { cardinality: many ? \"many\" : \"one\" }\n});\nconst cover = () => ({\n\tkey: \"cover\",\n\tapiKey: \"cover\",\n\tlabel: \"Featured image\",\n\ttype: \"media\",\n\tsettings: {\n\t\tmultiple: false,\n\t\tallowedKinds: [\"image\"]\n\t}\n});\nconst collection = (key, label, titleField, fields) => ({\n\tkey,\n\tkind: \"collection\",\n\tapiKey: key,\n\tlabel,\n\ttitleField,\n\tfields\n});\nconst definitionsFor = (present) => {\n\tconst postFields = [\n\t\ttext(\"title\", \"Title\"),\n\t\tslugField(\"title\"),\n\t\t{\n\t\t\tkey: \"body\",\n\t\t\tapiKey: \"body\",\n\t\t\tlabel: \"Body\",\n\t\t\ttype: \"richtext\"\n\t\t},\n\t\ttext(\"excerpt\", \"Excerpt\", { type: \"text\" }),\n\t\ttext(\"date\", \"Date\", {\n\t\t\ttype: \"datetime\",\n\t\t\tsortable: true\n\t\t}),\n\t\tcover(),\n\t\t...present.authors ? [relation(\"author\", \"Author\", \"author\", false)] : [],\n\t\t...present.categories ? [relation(\"categories\", \"Categories\", \"category\", true)] : [],\n\t\t...present.tags ? [relation(\"tags\", \"Tags\", \"tag\", true)] : []\n\t];\n\treturn [\n\t\t...present.authors ? [collection(\"author\", \"Author\", \"name\", [\n\t\t\ttext(\"name\", \"Name\"),\n\t\t\tslugField(\"name\"),\n\t\t\ttext(\"email\", \"Email\", {\n\t\t\t\ttype: \"email\",\n\t\t\t\tpublic: false\n\t\t\t})\n\t\t])] : [],\n\t\t...present.categories ? [collection(\"category\", \"Category\", \"name\", [\n\t\t\ttext(\"name\", \"Name\"),\n\t\t\tslugField(\"name\"),\n\t\t\ttext(\"description\", \"Description\", { type: \"text\" }),\n\t\t\trelation(\"parent\", \"Parent\", \"category\", false)\n\t\t])] : [],\n\t\t...present.tags ? [collection(\"tag\", \"Tag\", \"name\", [\n\t\t\ttext(\"name\", \"Name\"),\n\t\t\tslugField(\"name\"),\n\t\t\ttext(\"description\", \"Description\", { type: \"text\" })\n\t\t])] : [],\n\t\t...present.posts ? [collection(\"post\", \"Post\", \"title\", postFields)] : [],\n\t\t...present.pages ? [collection(\"page\", \"Page\", \"title\", [\n\t\t\ttext(\"title\", \"Title\"),\n\t\t\tslugField(\"title\"),\n\t\t\t{\n\t\t\t\tkey: \"body\",\n\t\t\t\tapiKey: \"body\",\n\t\t\t\tlabel: \"Body\",\n\t\t\t\ttype: \"richtext\"\n\t\t\t},\n\t\t\ttext(\"date\", \"Date\", {\n\t\t\t\ttype: \"datetime\",\n\t\t\t\tsortable: true\n\t\t\t}),\n\t\t\tcover(),\n\t\t\trelation(\"parent\", \"Parent\", \"page\", false)\n\t\t])] : []\n\t];\n};\nconst scalar = (value) => value !== void 0 && value.trim().length > 0 ? {\n\tkind: \"scalar\",\n\tvalue: value.trim()\n} : void 0;\nconst refs = (sourceIds, many) => sourceIds.length > 0 ? {\n\tkind: \"entries\",\n\tsourceIds,\n\tmany\n} : void 0;\nconst compact = (fields) => Object.fromEntries(Object.entries(fields).filter((entry) => !!entry[1]));\nconst publishedEntry = (sourceId, definition, title, fields) => ({\n\tsourceId,\n\tdefinition,\n\ttitle,\n\tlocales: [{\n\t\tlocale: null,\n\t\tfields,\n\t\tpublished: true\n\t}]\n});\nconst WP_DATE = /^(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2}:\\d{2})$/;\n/** `2024-05-01 10:00:00` (GMT) → `2024-05-01T10:00:00.000Z`; WordPress's zero date has none. */\nconst wordpressDate = (item) => {\n\tfor (const value of [item.dateGmt, item.date]) {\n\t\tconst match = WP_DATE.exec(value.trim());\n\t\tif (match && !value.startsWith(\"0000\")) return `${match[1]}T${match[2]}.000Z`;\n\t}\n};\n/** Every term the export lists, plus terms items use without the channel listing them. */\nconst collectTerms = (document) => {\n\tconst terms = new Map(document.terms.map((term) => [`${term.taxonomy}:${term.slug}`, term]));\n\tfor (const item of document.items) for (const term of item.terms) {\n\t\tconst taxonomy = term.taxonomy === \"post_tag\" ? \"post_tag\" : term.taxonomy === \"category\" ? \"category\" : void 0;\n\t\tif (taxonomy && term.slug && !terms.has(`${taxonomy}:${term.slug}`)) terms.set(`${taxonomy}:${term.slug}`, {\n\t\t\ttaxonomy,\n\t\t\tslug: term.slug,\n\t\t\tname: term.name,\n\t\t\tparent: \"\",\n\t\t\tdescription: \"\"\n\t\t});\n\t}\n\treturn [...terms.values()];\n};\nconst termEntries = (terms) => {\n\tconst slugs = {\n\t\tcategory: /* @__PURE__ */ new Set(),\n\t\tpost_tag: /* @__PURE__ */ new Set()\n\t};\n\tconst known = new Set(terms.map((term) => `${term.taxonomy}:${term.slug}`));\n\treturn terms.map((term) => {\n\t\tconst definition = term.taxonomy === \"category\" ? \"category\" : \"tag\";\n\t\tconst parent = term.taxonomy === \"category\" && known.has(`category:${term.parent}`) ? [`category:${term.parent}`] : [];\n\t\treturn publishedEntry(`${definition}:${term.slug}`, definition, term.name || term.slug, compact({\n\t\t\tname: scalar(term.name || term.slug),\n\t\t\tslug: scalar(uniqueSlug(term.slug, `${definition}-${term.slug}`, slugs[term.taxonomy])),\n\t\t\tdescription: scalar(term.description),\n\t\t\t...definition === \"category\" ? { parent: refs(parent, false) } : {}\n\t\t}));\n\t});\n};\nconst authorEntries = (document) => {\n\tconst byLogin = new Map(document.authors.map((author) => [author.login, author]));\n\tfor (const item of document.items) if (CONTENT_TYPES.has(item.type) && item.creator && !byLogin.has(item.creator)) byLogin.set(item.creator, {\n\t\tid: \"\",\n\t\tlogin: item.creator,\n\t\temail: \"\",\n\t\tdisplayName: item.creator,\n\t\tfirstName: \"\",\n\t\tlastName: \"\"\n\t});\n\tconst slugs = /* @__PURE__ */ new Set();\n\treturn [...byLogin.values()].map((author) => {\n\t\tconst name = author.displayName || [author.firstName, author.lastName].filter(Boolean).join(\" \") || author.login;\n\t\treturn publishedEntry(`author:${author.login}`, \"author\", name, compact({\n\t\t\tname: scalar(name),\n\t\t\tslug: scalar(uniqueSlug(author.login, `author-${author.id || author.login}`, slugs)),\n\t\t\temail: scalar(author.email)\n\t\t}));\n\t});\n};\nconst attachmentMedia = (item, options) => {\n\tconst relative = options.mediaDir ? uploadsRelativePath(item.attachmentUrl) : void 0;\n\tconst alt = item.meta._wp_attachment_image_alt;\n\treturn {\n\t\tsourceId: `attachment:${item.id}`,\n\t\tfilename: filenameOf(item.attachmentUrl, `attachment-${item.id}`),\n\t\turl: item.attachmentUrl,\n\t\t...relative && options.mediaDir ? { path: join(options.mediaDir, relative) } : {},\n\t\t...alt ? { alt } : {},\n\t\t...item.excerpt.trim() ? { caption: item.excerpt.trim() } : {}\n\t};\n};\nconst bodyValue = (html, images) => ({\n\tkind: \"richtext\",\n\tconvert: (resolver) => {\n\t\tconst result = htmlToRichText(html, { resolveImage: (image) => {\n\t\t\tconst sourceId = images.lookup(image.src);\n\t\t\treturn sourceId ? resolver.media(sourceId) : void 0;\n\t\t} });\n\t\treturn {\n\t\t\tdocument: result.document,\n\t\t\twarnings: [...shortcodeWarnings(html), ...result.warnings]\n\t\t};\n\t}\n});\nconst itemEntry = (item, context) => {\n\tconst type = item.type;\n\tconst terms = (taxonomy, prefix) => item.terms.filter((term) => term.taxonomy === taxonomy && term.slug).map((term) => `${prefix}:${term.slug}`);\n\tconst ref = (sourceId) => context.known.has(sourceId) ? [sourceId] : [];\n\tconst body = prepareBody(item.content);\n\tconst date = wordpressDate(item);\n\tconst fields = compact({\n\t\ttitle: scalar(item.title),\n\t\tslug: scalar(uniqueSlug(item.slug || item.title, `${type}-${item.id}`, context.slugs[type])),\n\t\tbody: body.trim() ? bodyValue(body, context.images) : void 0,\n\t\tdate: date ? {\n\t\t\tkind: \"scalar\",\n\t\t\tvalue: date\n\t\t} : void 0,\n\t\tcover: item.meta._thumbnail_id && context.known.has(`attachment:${item.meta._thumbnail_id}`) ? {\n\t\t\tkind: \"media\",\n\t\t\tsourceIds: [`attachment:${item.meta._thumbnail_id}`],\n\t\t\tmany: false\n\t\t} : void 0,\n\t\t...type === \"post\" ? {\n\t\t\texcerpt: scalar(item.excerpt),\n\t\t\tauthor: refs(ref(`author:${item.creator}`), false),\n\t\t\tcategories: refs(terms(\"category\", \"category\"), true),\n\t\t\ttags: refs(terms(\"post_tag\", \"tag\"), true)\n\t\t} : { parent: refs(ref(`page:${item.parent}`), false) }\n\t});\n\treturn {\n\t\tsourceId: `${type}:${item.id}`,\n\t\tdefinition: type,\n\t\ttitle: item.title || `(untitled ${type} ${item.id})`,\n\t\tlocales: [{\n\t\t\tlocale: null,\n\t\t\tfields,\n\t\t\tpublished: PUBLISHED.has(item.status)\n\t\t}]\n\t};\n};\n/** Images posts show that are not attachments of the export: imported from their URLs as extra media. */\nconst extraImages = (items, context) => {\n\tconst extra = [];\n\tfor (const item of items) for (const image of collectHtmlImages(prepareBody(item.content))) {\n\t\tconst url = absoluteUrl(image.src, context.base);\n\t\tif (!url || context.images.lookup(url)) continue;\n\t\tconst sourceId = `url:${url}`;\n\t\tcontext.images.add(url, sourceId);\n\t\textra.push({\n\t\t\tsourceId,\n\t\t\tfilename: filenameOf(url, \"image\"),\n\t\t\turl,\n\t\t\t...image.alt ? { alt: image.alt } : {}\n\t\t});\n\t}\n\treturn extra;\n};\nconst skippedNotes = (items) => {\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const item of items) {\n\t\tconst reason = !CONTENT_TYPES.has(item.type) && item.type !== \"attachment\" ? `items of type \"${item.type}\" (only posts, pages and attachments are imported)` : CONTENT_TYPES.has(item.type) && !PUBLISHED.has(item.status) && !KEPT_AS_DRAFT.has(item.status) ? `${item.type}s with status \"${item.status}\"` : void 0;\n\t\tif (reason) counts.set(reason, (counts.get(reason) ?? 0) + 1);\n\t}\n\treturn [...counts].map(([reason, count]) => `Skipped ${count} ${reason}.`);\n};\nconst wordpressSource = (document, options = {}) => {\n\tconst base = document.baseSiteUrl || document.link;\n\tconst contentItems = document.items.filter((item) => CONTENT_TYPES.has(item.type) && (PUBLISHED.has(item.status) || KEPT_AS_DRAFT.has(item.status)));\n\tconst attachments = document.items.filter((item) => item.type === \"attachment\" && item.attachmentUrl);\n\tconst images = createImageIndex(base);\n\tconst media = attachments.map((item) => attachmentMedia(item, options));\n\tmedia.forEach((item) => images.add(item.url, item.sourceId));\n\tmedia.push(...extraImages(contentItems, {\n\t\tbase,\n\t\timages\n\t}));\n\tconst terms = collectTerms(document);\n\tconst authors = authorEntries(document);\n\tconst present = {\n\t\tauthors: authors.length > 0,\n\t\tcategories: terms.some((term) => term.taxonomy === \"category\"),\n\t\ttags: terms.some((term) => term.taxonomy === \"post_tag\"),\n\t\tposts: contentItems.some((item) => item.type === \"post\"),\n\t\tpages: contentItems.some((item) => item.type === \"page\")\n\t};\n\tconst context = {\n\t\tbase,\n\t\timages,\n\t\tknown: /* @__PURE__ */ new Set([\n\t\t\t...authors.map((entry) => entry.sourceId),\n\t\t\t...contentItems.map((item) => `${item.type}:${item.id}`),\n\t\t\t...attachments.map((item) => `attachment:${item.id}`)\n\t\t]),\n\t\tslugs: {\n\t\t\tpost: /* @__PURE__ */ new Set(),\n\t\t\tpage: /* @__PURE__ */ new Set()\n\t\t}\n\t};\n\treturn {\n\t\tkind: \"wordpress\",\n\t\tdefinitions: definitionsFor(present),\n\t\tmedia,\n\t\tentries: [\n\t\t\t...authors,\n\t\t\t...termEntries(terms),\n\t\t\t...contentItems.map((item) => itemEntry(item, context))\n\t\t],\n\t\tnotes: skippedNotes(document.items)\n\t};\n};\n//#endregion\n//#region src/import/wordpress/wxr.ts\nconst RECORD_KINDS = {\n\titem: \"item\",\n\t\"wp:author\": \"author\",\n\t\"wp:category\": \"category\",\n\t\"wp:tag\": \"tag\",\n\t\"wp:postmeta\": \"postmeta\"\n};\n/** Regions whose content is ignored (comments carry their own meta elements). */\nconst SKIPPED = /* @__PURE__ */ new Set([\"wp:comment\", \"wp:termmeta\"]);\nconst field = (fields, name) => fields[name] ?? \"\";\nconst toAuthor = (fields) => ({\n\tid: field(fields, \"wp:author_id\"),\n\tlogin: field(fields, \"wp:author_login\"),\n\temail: field(fields, \"wp:author_email\"),\n\tdisplayName: field(fields, \"wp:author_display_name\"),\n\tfirstName: field(fields, \"wp:author_first_name\"),\n\tlastName: field(fields, \"wp:author_last_name\")\n});\nconst toTerm = (kind, fields) => kind === \"category\" ? {\n\ttaxonomy: \"category\",\n\tslug: field(fields, \"wp:category_nicename\"),\n\tname: field(fields, \"wp:cat_name\"),\n\tparent: field(fields, \"wp:category_parent\"),\n\tdescription: field(fields, \"wp:category_description\")\n} : {\n\ttaxonomy: \"post_tag\",\n\tslug: field(fields, \"wp:tag_slug\"),\n\tname: field(fields, \"wp:tag_name\"),\n\tparent: \"\",\n\tdescription: field(fields, \"wp:tag_description\")\n};\nconst newItem = () => ({\n\tid: \"\",\n\ttype: \"\",\n\tstatus: \"\",\n\ttitle: \"\",\n\tslug: \"\",\n\tcontent: \"\",\n\texcerpt: \"\",\n\tdateGmt: \"\",\n\tdate: \"\",\n\tcreator: \"\",\n\tparent: \"\",\n\tattachmentUrl: \"\",\n\tterms: [],\n\tmeta: {}\n});\nconst finishItem = (item, fields) => ({\n\t...item,\n\tid: field(fields, \"wp:post_id\"),\n\ttype: field(fields, \"wp:post_type\"),\n\tstatus: field(fields, \"wp:status\"),\n\ttitle: field(fields, \"title\"),\n\tslug: field(fields, \"wp:post_name\"),\n\tcontent: field(fields, \"content:encoded\"),\n\texcerpt: field(fields, \"excerpt:encoded\"),\n\tdateGmt: field(fields, \"wp:post_date_gmt\"),\n\tdate: field(fields, \"wp:post_date\"),\n\tcreator: field(fields, \"dc:creator\"),\n\tparent: field(fields, \"wp:post_parent\"),\n\tattachmentUrl: field(fields, \"wp:attachment_url\")\n});\nconst CHANNEL_FIELDS = {\n\ttitle: \"title\",\n\tlink: \"link\",\n\tlanguage: \"language\",\n\t\"wp:base_site_url\": \"baseSiteUrl\"\n};\n/** Builds the document from parser events; one instance per file. */\nconst createCollector = () => {\n\tconst document = {\n\t\ttitle: \"\",\n\t\tlink: \"\",\n\t\tlanguage: \"\",\n\t\tbaseSiteUrl: \"\",\n\t\tauthors: [],\n\t\tterms: [],\n\t\titems: []\n\t};\n\tconst records = [];\n\tlet item = newItem();\n\tlet text = \"\";\n\tlet skipDepth = 0;\n\tlet depth = 0;\n\tconst open = (tag) => {\n\t\tdepth += 1;\n\t\ttext = \"\";\n\t\tif (skipDepth > 0 || SKIPPED.has(tag.name)) {\n\t\t\tskipDepth += 1;\n\t\t\treturn;\n\t\t}\n\t\tconst kind = RECORD_KINDS[tag.name];\n\t\tif (kind) {\n\t\t\trecords.push({\n\t\t\t\tkind,\n\t\t\t\tfields: {}\n\t\t\t});\n\t\t\tif (kind === \"item\") item = newItem();\n\t\t} else if (tag.name === \"category\" && records.at(-1)?.kind === \"item\") item.terms.push({\n\t\t\ttaxonomy: tag.attributes.domain ?? \"\",\n\t\t\tslug: tag.attributes.nicename ?? \"\",\n\t\t\tname: \"\"\n\t\t});\n\t};\n\tconst closeRecord = (record) => {\n\t\tif (record.kind === \"item\") document.items.push(finishItem(item, record.fields));\n\t\telse if (record.kind === \"author\") document.authors.push(toAuthor(record.fields));\n\t\telse if (record.kind === \"postmeta\") item.meta[field(record.fields, \"wp:meta_key\")] = field(record.fields, \"wp:meta_value\");\n\t\telse document.terms.push(toTerm(record.kind, record.fields));\n\t};\n\tconst close = (tag) => {\n\t\tdepth -= 1;\n\t\tif (skipDepth > 0) {\n\t\t\tskipDepth -= 1;\n\t\t\treturn;\n\t\t}\n\t\tconst current = records.at(-1);\n\t\tif (RECORD_KINDS[tag.name] && current) {\n\t\t\trecords.pop();\n\t\t\tcloseRecord(current);\n\t\t} else if (tag.name === \"category\" && current?.kind === \"item\") {\n\t\t\tconst term = item.terms.at(-1);\n\t\t\tif (term) term.name = text.trim();\n\t\t} else if (current) current.fields[tag.name] = text;\n\t\telse if (depth === 2 && CHANNEL_FIELDS[tag.name]) document[CHANNEL_FIELDS[tag.name]] = text.trim();\n\t\ttext = \"\";\n\t};\n\tconst append = (chunk) => {\n\t\tif (skipDepth === 0) text += chunk;\n\t};\n\treturn {\n\t\tdocument,\n\t\topen,\n\t\tclose,\n\t\tappend\n\t};\n};\n/** Parses a WXR file without loading the XML into memory at once. */\nconst readWxr = async (path) => {\n\tconst parser = new SaxesParser({ xmlns: false });\n\tconst collector = createCollector();\n\tlet failure;\n\tparser.on(\"opentag\", collector.open);\n\tparser.on(\"closetag\", collector.close);\n\tparser.on(\"text\", collector.append);\n\tparser.on(\"cdata\", collector.append);\n\tparser.on(\"error\", (error) => {\n\t\tfailure ??= error;\n\t});\n\tfor await (const chunk of createReadStream(path, { encoding: \"utf8\" })) {\n\t\tparser.write(chunk);\n\t\tif (failure) break;\n\t}\n\tif (!failure) parser.close();\n\tif (failure) throw new Error(`${path} is not a readable WordPress export (WXR): ${failure.message}`);\n\tif (!collector.document.items.length && !collector.document.authors.length) throw new Error(`${path} has no WordPress items or authors: is it a WXR export (Tools → Export)?`);\n\treturn collector.document;\n};\n//#endregion\n//#region src/commands/import/wordpress.ts\nconst mediaDirOf = (values) => typeof values[\"media-dir\"] === \"string\" ? { mediaDir: resolve(values[\"media-dir\"]) } : {};\n/** `shapio import wordpress`: a WordPress export (WXR, Tools → Export) as models, media and drafts. */\nconst importWordPressCommand = createImporterCommand({\n\tname: \"wordpress\",\n\tlabel: \"WordPress\",\n\tsummary: \"Import a WordPress export (WXR): --plan writes schema files, --map creates drafts and change sets\",\n\tusage: \"shapio import wordpress <export.xml> --plan <dir> [--site <key> | --shared] [--url <origin> --token <admin token>] [--force]\\n shapio import wordpress --map <dir> [--url <origin>] [--token <admin token>] [--site <key>] [--media-dir <uploads dir>]\\n --plan reads the export and writes the planned models (<dir>/schema) and <dir>/import-map.json.\\n With --url it checks the planned API IDs against that instance and renames clashes (tag → tagItem);\\n without it, it sends nothing.\\n The models belong to one site (<dir>/schema/sites/<key>/): --site (or SHAPIO_SITE), else the primary site\\n (\\\"default\\\"); --shared shares them with all sites (applying them needs a network admin token).\\n --map without --site imports into the planned site.\\n Apply the models with `shapio schema apply --dir <dir>/schema --lock <dir>/schema-lock.json [--site <key>]`, then run --map:\\n it uploads the media (downloaded from the site, or read from --media-dir, a copy of wp-content/uploads),\\n creates every post and page as a draft, and opens change sets with the published ones. Re-run --map to resume.\",\n\toptions: [\"media-dir\"],\n\tplan: async (file) => wordpressSource(await readWxr(file)),\n\tload: async (map, _dir, values) => wordpressSource(await readWxr(map.source.path), mediaDirOf(values))\n});\n//#endregion\n//#region src/commands/import/index.ts\nconst USAGE = `shapio import [--url <origin>] [--token <admin token>] [--site <key>] [--dry-run] [--prune] [--no-wait] <file>\n Plans the import (--dry-run stops there) and refuses it, writing nothing, on any conflict.\n An import never changes an existing model: a model the target has in another form is a conflict.\n Reconcile the schema first: \\`shapio schema pull\\` from the target, merge the bundle's models into the\n files (git diff), \\`shapio schema apply\\`, then import again.\n --site (or SHAPIO_SITE) names the site the bundle goes to; default: the token's site, else the primary.\n\n${importWordPressCommand.usage}\\n\\n${importStrapiCommand.usage}`;\nconst FLAGS = [\n\t\"dry-run\",\n\t\"prune\",\n\t\"no-wait\"\n];\n/** `shapio import wordpress|strapi …`: the importers (a bundle file is the only positional otherwise). */\nconst IMPORTERS = {\n\twordpress: importWordPressCommand,\n\tstrapi: importStrapiCommand\n};\nconst POLL_INTERVAL_MS$1 = 1e3;\nconst BUNDLE_CONTENT_TYPE = \"application/x-ndjson\";\n/** A plain NDJSON bundle, or a `--with-media` tar archive (bundle + media files). */\nconst openSource = async (path) => {\n\tif (!await isTar(path)) {\n\t\tawait stat(path);\n\t\treturn {\n\t\t\topen: () => createReadStream(path),\n\t\t\tmedia: void 0\n\t\t};\n\t}\n\tconst entries = await listTar(path);\n\tconst bundle = entries.get(BUNDLE_ENTRY);\n\tif (!bundle) throw new Error(`${path} is a tar archive without ${BUNDLE_ENTRY}`);\n\treturn {\n\t\topen: () => createReadStream(path, {\n\t\t\tstart: bundle.offset,\n\t\t\tend: bundle.offset + bundle.size - 1\n\t\t}),\n\t\tmedia: entries\n\t};\n};\nconst rangeOf = (path, entry) => () => createReadStream(path, {\n\tstart: entry.offset,\n\tend: entry.offset + entry.size - 1\n});\nconst sha256Of = async (open) => {\n\tconst hash = createHash(\"sha256\");\n\tfor await (const chunk of open()) hash.update(chunk);\n\treturn hash.digest(\"hex\");\n};\nconst postBundle = (connection, source, query) => sendJson(connection, \"/api/admin/transfer/import\", {\n\tmethod: \"POST\",\n\tquery,\n\tbody: source.open,\n\tcontentType: BUNDLE_CONTENT_TYPE\n});\n/** Uploads the files the plan needs from the archive, each verified by the server against the manifest. */\nconst uploadMedia = async (connection, path, source, files, io) => {\n\tif (files.length === 0) return;\n\tif (!source.media) {\n\t\tio.stdout(`${files.length} media file(s) are not in this bundle: they must already be in the target's storage under their keys (or re-export with --with-media).\\n`);\n\t\treturn;\n\t}\n\tlet uploaded = 0;\n\tfor (const file of files) {\n\t\tconst entry = source.media.get(mediaEntryName(file.assetId));\n\t\tif (!entry) {\n\t\t\tio.stderr(` missing in the archive: media/${file.assetId}\\n`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst open = rangeOf(path, entry);\n\t\tawait send(connection, `/api/admin/transfer/media/${encodeURIComponent(file.assetId)}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tquery: {\n\t\t\t\tstorageKey: file.storageKey,\n\t\t\t\tsha256: file.sha256 ?? await sha256Of(open),\n\t\t\t\tsizeBytes: entry.size,\n\t\t\t\tmimeType: file.mimeType\n\t\t\t},\n\t\t\tbody: open,\n\t\t\tcontentType: \"application/octet-stream\"\n\t\t});\n\t\tuploaded += 1;\n\t}\n\tio.stdout(`Uploaded ${uploaded} media file(s).\\n`);\n};\nconst tally = (value) => typeof value === \"object\" ? [\n\t\"added\",\n\t\"updated\",\n\t\"unchanged\"\n].filter((kind) => value[kind] !== void 0).map((kind) => `${value[kind]} ${kind}`).join(\", \") : String(value ?? 0);\n/** The job's counts in a fixed, readable order. */\nconst formatCounts = (counts) => [\n\t`entries: ${tally(counts?.entries)}`,\n\t`media: ${tally(counts?.media)}`,\n\t`app users: ${tally(counts?.users)}`,\n\t`pruned entries: ${tally(counts?.pruned)}`\n].join(\"; \");\n/** Polls the import job until it finished, printing each phase once. */\nconst waitForImport = async (connection, importId, io) => {\n\tconst client = createClient(connection);\n\tlet phase;\n\tfor (;;) {\n\t\tconst status = await client.request(`/api/admin/transfer/imports/${encodeURIComponent(importId)}`);\n\t\tconst current = status.progress?.phase;\n\t\tif (current && current !== phase && status.status !== \"succeeded\") {\n\t\t\tphase = current;\n\t\t\tio.stdout(` ${current}...\\n`);\n\t\t}\n\t\tif (status.status === \"dead\") {\n\t\t\tio.stderr(`The import failed after ${status.attempts} attempt(s): ${status.lastError ?? \"unknown error\"}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t\tif (status.status === \"succeeded\") {\n\t\t\tconst errors = status.progress?.errors ?? [];\n\t\t\tio.stdout(`Imported. ${formatCounts(status.progress?.counts)}.\\n`);\n\t\t\tfor (const error of errors.slice(0, 20)) io.stderr(` ! ${error.id}: ${error.code}: ${error.message}\\n`);\n\t\t\tconst errorCount = status.progress?.errorCount ?? 0;\n\t\t\tif (errorCount > 0) {\n\t\t\t\tio.stderr(`${errorCount} item(s) were not imported (see above, and the job in Admin → Publishing → Jobs).\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tawait setTimeout(POLL_INTERVAL_MS$1);\n\t}\n};\n/**\n* `shapio import`: plans the import on the instance (a dry run), refuses on conflicts, uploads the media\n* files a `--with-media` archive carries, then starts the import job and follows it to the end.\n*/\nconst importCommand = {\n\tsummary: \"Import a bundle, or a WordPress or Strapi export (import wordpress|strapi)\",\n\tusage: USAGE,\n\trun: async (args, io) => {\n\t\tconst importer = args[0] !== void 0 ? IMPORTERS[args[0]] : void 0;\n\t\tif (importer) return importer.run(args.slice(1), io);\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = parseTransferArgs(args, io, FLAGS);\n\t\t} catch (error) {\n\t\t\tif (error instanceof UsageError$1 || error instanceof TypeError) {\n\t\t\t\tio.stderr(`shapio import: ${error.message}\\nUsage: ${USAGE}\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tconst { connection, flags, file } = parsed;\n\t\ttry {\n\t\t\tconst source = await openSource(file);\n\t\t\tconst prune = flags.prune === true;\n\t\t\tconst planned = await postBundle(connection, source, {\n\t\t\t\tdryRun: true,\n\t\t\t\tprune\n\t\t\t});\n\t\t\tio.stdout(formatPlan(planned.diff));\n\t\t\tif (flags[\"dry-run\"] || planned.diff.conflicts > 0) return planned.diff.conflicts > 0 ? 1 : 0;\n\t\t\tawait uploadMedia(connection, file, source, planned.diff.media.files, io);\n\t\t\tconst started = await postBundle(connection, source, {\n\t\t\t\tdryRun: false,\n\t\t\t\tprune\n\t\t\t});\n\t\t\tfor (const webhook of started.webhookSecrets ?? []) io.stdout(`Webhook \"${webhook.name}\" was imported disabled with a new signing secret: ${webhook.secret}\\n`);\n\t\t\tio.stdout(`Import ${started.importId ?? \"\"} started.\\n`);\n\t\t\tif (flags[\"no-wait\"] || !started.importId) return 0;\n\t\t\treturn await waitForImport(connection, started.importId, io);\n\t\t} catch (error) {\n\t\t\tio.stderr(`shapio import: ${describeFailure(error)}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t}\n};\nvar UsageError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"UsageError\";\n\t}\n};\nconst CONNECTION_FLAGS = {\n\turl: { type: \"string\" },\n\ttoken: { type: \"string\" },\n\tsite: { type: \"string\" }\n};\n/** URL, token and site from the flags, else SHAPIO_URL / SHAPIO_TOKEN / SHAPIO_SITE. */\nconst resolveConnection = (values, io) => {\n\tconst token = values.token ?? io.env.SHAPIO_TOKEN;\n\tif (!token) throw new UsageError(\"An admin API token is required: pass --token or set SHAPIO_TOKEN\");\n\tconst site = (values.site ?? io.env.SHAPIO_SITE)?.trim() || void 0;\n\treturn {\n\t\tbaseUrl: values.url ?? io.env.SHAPIO_URL ?? \"http://localhost:4300\",\n\t\ttoken,\n\t\t...site ? { site } : {}\n\t};\n};\n/** Shared flags of `shapio schema pull|diff|apply`. */\nconst parseSchemaOptions = (args, io) => {\n\tconst { values } = parseArgs({\n\t\targs: [...args],\n\t\toptions: {\n\t\t\t...CONNECTION_FLAGS,\n\t\t\tdir: { type: \"string\" },\n\t\t\tlock: { type: \"string\" },\n\t\t\tprune: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\t\"allow-breaking\": {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\t\"allow-destructive\": {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\tforce: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\t\"no-wait\": {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\t\"wait-timeout\": { type: \"string\" }\n\t\t},\n\t\tallowPositionals: false\n\t});\n\tconst connection = resolveConnection(values, io);\n\tconst waitTimeoutSeconds = Number(values[\"wait-timeout\"] ?? 600);\n\tif (!Number.isFinite(waitTimeoutSeconds) || waitTimeoutSeconds <= 0) throw new UsageError(\"--wait-timeout must be a positive number of seconds\");\n\treturn {\n\t\t...connection,\n\t\tdir: resolve(values.dir ?? \"schema\"),\n\t\tlockPath: resolve(values.lock ?? LOCK_FILE_PATH),\n\t\tprune: values.prune,\n\t\tallowBreaking: values[\"allow-breaking\"],\n\t\tallowDestructive: values[\"allow-destructive\"],\n\t\tforce: values.force,\n\t\twait: !values[\"no-wait\"],\n\t\twaitTimeoutMs: waitTimeoutSeconds * 1e3\n\t};\n};\nconst COMMON_USAGE = `[--url <origin>] [--token <admin token>] [--site <key>] [--dir schema] [--lock .shapio/schema-lock.json]`;\n//#endregion\n//#region src/commands/schema/apply.ts\nconst POLL_INTERVAL_MS = 500;\n/** Waits for planned changes (prerequisite jobs) to activate or fail. Returns the failed ones. */\nconst waitForChanges = async (options, items, io) => {\n\tconst api = apiFor(options);\n\tconst deadline = Date.now() + options.waitTimeoutMs;\n\tconst failed = [];\n\tfor (const item of items) {\n\t\tio.stdout(`Waiting for ${item.apiKey} (change ${item.changeId ?? \"\"})...\\n`);\n\t\tfor (;;) {\n\t\t\tconst change = await api.change(item.changeId ?? \"\");\n\t\t\tif (change.status === \"activated\") {\n\t\t\t\titem.outcome = \"activated\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (change.status === \"failed\" || change.status === \"canceled\") {\n\t\t\t\tio.stderr(`${item.apiKey}: change ${change.status}: ${JSON.stringify(change.error)}\\n`);\n\t\t\t\tfailed.push(item);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (Date.now() > deadline) {\n\t\t\t\tio.stderr(`${item.apiKey}: still ${change.status} after the wait timeout; check it later in the admin.\\n`);\n\t\t\t\tfailed.push(item);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tawait setTimeout(POLL_INTERVAL_MS);\n\t\t}\n\t}\n\treturn failed;\n};\n/**\n* Records the new state in the lock file and rewrites the files of applied definitions in canonical form\n* (e.g. with server-assigned field IDs), in their scope's folder. Definitions skipped because they were\n* unchanged locally keep their old base, so a later apply still treats them as untouched. Other sites'\n* entries are kept as they are. Returns the schema version it recorded: the instance's version after any\n* waited-for changes activated, which can be newer than the one the apply response reported.\n*/\nconst updateLocalState = async (options, state, response) => {\n\tconst exported = await apiFor(options).export();\n\tconst remote = new Map(exported.definitions.map((entry) => [entry.definition.id, entry]));\n\tconst upgraded = upgradeLockFile(state.lock);\n\tconst lock = {\n\t\t...upgraded,\n\t\tschemaVersion: exported.schemaVersion,\n\t\tdefinitions: { ...upgraded.definitions }\n\t};\n\tfor (const item of response.results) {\n\t\tif (!(item.outcome === \"activated\" || item.decision.action === \"skip\" && item.decision.reason === \"alreadyApplied\")) continue;\n\t\tconst entry = remote.get(item.definitionId);\n\t\tif (!entry) {\n\t\t\tdelete lock.definitions[item.definitionId];\n\t\t\tcontinue;\n\t\t}\n\t\tconst previous = state.sent.find((file) => file.id === item.definitionId);\n\t\tconst path = await writeDefinitionFile(options.dir, entry.definition, entry.site);\n\t\tif (previous && previous.path !== path) await removeFile(previous.path);\n\t\tlock.definitions[item.definitionId] = {\n\t\t\tkind: entry.definition.kind,\n\t\t\tapiKey: entry.definition.apiKey,\n\t\t\tversion: entry.version,\n\t\t\thash: entry.hash,\n\t\t\tsite: entry.site\n\t\t};\n\t}\n\tawait writeLockFile(options.lockPath, coverSiteIfHeld(lock, state.siteKey));\n\treturn lock.schemaVersion;\n};\n/**\n* `shapio schema apply`: applies local schema files to a running instance live, through the same planner as\n* the admin UI. Three-way per definition against the lock file; refuses (and changes nothing) on conflicts.\n* It sends the shared files and the site's own (`sites/<key>/`), never another site's.\n*/\nconst schemaApplyCommand = {\n\tsummary: \"Apply local schema files to the instance live (three-way, per model; refuses on conflicts)\",\n\tusage: `shapio schema apply ${COMMON_USAGE} [--prune] [--allow-breaking] [--allow-destructive] [--no-wait] [--wait-timeout <s>]`,\n\trun: async (args, io) => {\n\t\tconst options = parseSchemaOptions(args, io);\n\t\tconst state = await readSiteState(options, io);\n\t\tif (!state) return 1;\n\t\tconst response = await sendApply(options, state, false, io);\n\t\tif (!response) return 1;\n\t\tprintResults(response, state, io, false);\n\t\tconst pending = response.results.filter((item) => item.outcome === \"pending\");\n\t\tconst failed = options.wait ? await waitForChanges(options, pending, io) : [];\n\t\tconst schemaVersion = await updateLocalState(options, state, response);\n\t\tconst applied = response.results.filter((item) => item.outcome === \"activated\").length;\n\t\tio.stdout(`Applied ${applied} definition(s) at schema version ${schemaVersion}.\\n`);\n\t\treturn failed.length > 0 ? 1 : 0;\n\t}\n};\n//#endregion\n//#region src/commands/schema/diff.ts\n/** `shapio schema diff`: what `apply` would do, per definition, without changing anything. */\nconst schemaDiffCommand = {\n\tsummary: \"Show what `shapio schema apply` would change on the instance (dry run)\",\n\tusage: `shapio schema diff ${COMMON_USAGE} [--prune]`,\n\trun: async (args, io) => {\n\t\tconst options = parseSchemaOptions(args, io);\n\t\tconst state = await readSiteState(options, io);\n\t\tif (!state) return 1;\n\t\tconst response = await sendApply(options, state, true, io);\n\t\tif (!response) return 1;\n\t\tprintResults(response, state, io, false);\n\t\tconst pending = response.results.filter((item) => [\n\t\t\t\"create\",\n\t\t\t\"update\",\n\t\t\t\"delete\"\n\t\t].includes(item.decision.action));\n\t\tio.stdout(pending.length === 0 ? \"Nothing to apply.\\n\" : `${pending.length} definition(s) would change.\\n`);\n\t\treturn 0;\n\t}\n};\n//#endregion\n//#region src/commands/schema/pull.ts\n/**\n* `shapio schema pull`: writes one site's view of the instance (the shared definitions in `models/` and\n* `components/`, the site's own under `sites/<key>/`) as canonical JSON, one file per model or component,\n* and records what was pulled in the lock file. Another site's folder and lock entries are left alone, so one\n* tree can hold several sites. Refuses to overwrite local edits in the pulled folders unless --force.\n*/\nconst schemaPullCommand = {\n\tsummary: \"Write a site’s models and components (shared and its own) to schema files and the lock file\",\n\tusage: `shapio schema pull ${COMMON_USAGE} [--force]`,\n\trun: async (args, io) => {\n\t\tconst options = parseSchemaOptions(args, io);\n\t\tconst exported = await apiFor(options).export();\n\t\tif (!exported.site) throw new Error(\"The instance did not say which site this view is; pass --site <key>\");\n\t\tconst siteKey = exported.site.key;\n\t\tconst state = await readLocalState(options);\n\t\tconst edited = editedFilesForSite(state.files, state.lock, siteKey);\n\t\tif (edited.length > 0 && !options.force) {\n\t\t\tio.stderr(`Local schema files have changes that are not on the instance:\\n${edited.map((file) => ` ${displayPath(file.path)}`).join(\"\\n\")}\\nApply them first, or commit them and re-run with --force to overwrite them with the instance’s schema.\n`);\n\t\t\treturn 1;\n\t\t}\n\t\tconst written = /* @__PURE__ */ new Map();\n\t\tfor (const { definition, site } of exported.definitions) written.set(definition.id, await writeDefinitionFile(options.dir, definition, site));\n\t\tfor (const file of staleFilesAfterPull(state.files, siteKey, written)) await removeFile(file.path);\n\t\tawait writeLockFile(options.lockPath, mergePulledLock(state.lock, {\n\t\t\tschemaVersion: exported.schemaVersion,\n\t\t\tsiteKey,\n\t\t\tdefinitions: exported.definitions\n\t\t}));\n\t\tio.stdout(`Pulled ${exported.definitions.length} definition(s) of site \"${siteKey}\" at schema version ${exported.schemaVersion} into ${displayPath(options.dir)}\\n`);\n\t\treturn 0;\n\t}\n};\n//#endregion\n//#region src/commands/schema/scope.ts\nconst parseScopeOptions = (args, io) => {\n\tconst { values, positionals } = parseArgs({\n\t\targs: [...args],\n\t\toptions: {\n\t\t\t...CONNECTION_FLAGS,\n\t\t\tshared: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false\n\t\t\t},\n\t\t\tversion: { type: \"string\" }\n\t\t},\n\t\tallowPositionals: true\n\t});\n\tconst [apiKey, ...extra] = positionals;\n\tif (!apiKey || extra.length > 0) throw new UsageError(\"Name one model or component by its API ID\");\n\tif (!values.shared && !values.site) throw new UsageError(\"Pass --site <key> to keep it on that site, or --shared to share it with all sites\");\n\tconst version = values.version === void 0 ? void 0 : Number(values.version);\n\tif (version !== void 0 && (!Number.isInteger(version) || version < 1)) throw new UsageError(\"--version must be a positive integer\");\n\treturn {\n\t\t...resolveConnection(values, io),\n\t\tapiKey,\n\t\tshared: values.shared,\n\t\tversion\n\t};\n};\n//#endregion\n//#region src/commands/schema/index.ts\nconst SUBCOMMANDS$1 = {\n\tpull: schemaPullCommand,\n\tdiff: schemaDiffCommand,\n\tapply: schemaApplyCommand,\n\tscope: {\n\t\tsummary: \"Keep a shared model or component on one site (--site), or share a site’s with all sites (--shared)\",\n\t\tusage: \"shapio schema scope <apiKey> (--site <key> | --shared [--site <key>]) [--url <origin>] [--token <admin token>] [--version <n>]\",\n\t\trun: async (args, io) => {\n\t\t\tconst options = parseScopeOptions(args, io);\n\t\t\tconst client = clientFor(options);\n\t\t\tconst exported = await client.admin.schema.export();\n\t\t\tconst siteKey = options.site ?? exported.site?.key ?? \"(default)\";\n\t\t\tconst found = exported.definitions.find(({ definition }) => definition.apiKey === options.apiKey);\n\t\t\tif (!found) {\n\t\t\t\tio.stderr(`Site \"${siteKey}\" has no model or component with API ID \"${options.apiKey}\".\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tconst outcome = await (found.definition.kind === \"component\" ? client.admin.components : client.admin.models).changeScope(found.definition.id, {\n\t\t\t\tscope: options.shared ? \"network\" : \"site\",\n\t\t\t\tversion: options.version ?? found.version\n\t\t\t});\n\t\t\tconst where = outcome.scope === \"network\" ? \"shared with all sites\" : `on site \"${siteKey}\" only`;\n\t\t\tio.stdout(outcome.status === \"unchanged\" ? `${options.apiKey} is already ${where}.\\n` : `${options.apiKey} is now ${where} (version ${outcome.version}, schema version ${outcome.schemaVersion}).\\nPull to move its file: shapio schema pull --site ${siteKey}\\n`);\n\t\t\treturn 0;\n\t\t}\n\t}\n};\nconst help$1 = () => `Usage:\\n${Object.values(SUBCOMMANDS$1).map((command) => ` ${command.usage}\\n ${command.summary}`).join(\"\\n\")}\\n`;\n/** `shapio schema <pull|diff|apply|scope>`: git-like schema sync over HTTP with an admin API token. */\nconst schemaCommand = {\n\tsummary: \"Sync models and components with schema files: pull | diff | apply | scope\",\n\tusage: \"shapio schema <pull|diff|apply|scope> [options]\",\n\trun: async (args, io) => {\n\t\tconst [name, ...rest] = args;\n\t\tconst command = name ? SUBCOMMANDS$1[name] : void 0;\n\t\tif (!command) {\n\t\t\t(name && name !== \"help\" && name !== \"--help\" ? io.stderr : io.stdout)(help$1());\n\t\t\treturn name && name !== \"help\" && name !== \"--help\" ? 1 : 0;\n\t\t}\n\t\ttry {\n\t\t\treturn await command.run(rest, io);\n\t\t} catch (error) {\n\t\t\tif (error instanceof UsageError) {\n\t\t\t\tio.stderr(`shapio schema ${name}: ${error.message}\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (error instanceof ShapioApiError) {\n\t\t\t\tio.stderr(formatApiError(error, [], /* @__PURE__ */ new Map()));\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n//#endregion\n//#region src/commands/status.ts\nconst DEFAULT_URL$1 = \"http://localhost:4300\";\nconst isRecord = (value) => typeof value === \"object\" && value !== null;\n/** Whether `/api/version` answered like Shapio does (any other server answering 200 is not Shapio). */\nconst isShapioVersion = (value) => isRecord(value) && value.name === \"shapio\" && typeof value.version === \"string\" && typeof value.node === \"string\";\n/** `shapio status`: is a running instance (local or remote) up, migrated and which version is it. */\nconst statusCommand = {\n\tsummary: \"Check that a Shapio instance is ready and show its version\",\n\tusage: \"shapio status [--url <origin>] (defaults to $SHAPIO_URL or http://localhost:4300)\",\n\trun: async (args, io) => {\n\t\tconst { values } = parseArgs({\n\t\t\targs: [...args],\n\t\t\toptions: { url: { type: \"string\" } },\n\t\t\tallowPositionals: false\n\t\t});\n\t\tconst baseUrl = values.url ?? io.env.SHAPIO_URL ?? DEFAULT_URL$1;\n\t\tconst client = createClient({ baseUrl });\n\t\ttry {\n\t\t\tconst version = await client.system.version();\n\t\t\tif (!isShapioVersion(version)) {\n\t\t\t\tio.stderr(`${baseUrl}: not a Shapio instance (unexpected answer from /api/version)\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tconst ready = await client.system.ready();\n\t\t\tif (!isRecord(ready) || ready.status !== \"ready\") {\n\t\t\t\tio.stderr(`${baseUrl}: not ready (unexpected answer from /api/ready)\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tio.stdout(`${baseUrl}: ${ready.status} (shapio ${version.version}, node ${version.node})\\n`);\n\t\t\treturn 0;\n\t\t} catch (error) {\n\t\t\tif (error instanceof ShapioApiError) {\n\t\t\t\tio.stderr(`${baseUrl}: ${error.code}: ${error.message}\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tio.stderr(`${baseUrl}: unreachable (${error instanceof Error ? error.message : String(error)})\\n`);\n\t\t\treturn 1;\n\t\t}\n\t}\n};\n//#endregion\n//#region src/commands/types/generate.ts\nconst DEFAULT_URL = \"http://localhost:4300\";\nconst DEFAULT_OUT = \"shapio-types.ts\";\n//#endregion\n//#region src/commands/types/index.ts\nconst SUBCOMMANDS = { generate: {\n\tsummary: \"Write TypeScript types for the instance’s models and components\",\n\tusage: \"shapio types generate [--url <origin>] [--token <admin token>] [--out shapio-types.ts]\",\n\trun: async (args, io) => {\n\t\tconst { values } = parseArgs({\n\t\t\targs: [...args],\n\t\t\toptions: {\n\t\t\t\turl: { type: \"string\" },\n\t\t\t\ttoken: { type: \"string\" },\n\t\t\t\tout: { type: \"string\" }\n\t\t\t},\n\t\t\tallowPositionals: false\n\t\t});\n\t\tconst token = values.token ?? io.env.SHAPIO_TOKEN;\n\t\tif (!token) {\n\t\t\tio.stderr(\"shapio types generate: an admin API token is required: pass --token or set SHAPIO_TOKEN\\n\");\n\t\t\treturn 1;\n\t\t}\n\t\tconst baseUrl = values.url ?? io.env.SHAPIO_URL ?? DEFAULT_URL;\n\t\tconst out = resolve(values.out ?? DEFAULT_OUT);\n\t\ttry {\n\t\t\tconst { schemaVersion, source } = await createClient({\n\t\t\t\tbaseUrl,\n\t\t\t\ttoken\n\t\t\t}).request(\"/api/docs/typescript\");\n\t\t\tawait mkdir(dirname(out), { recursive: true });\n\t\t\tawait writeFile(out, source, \"utf8\");\n\t\t\tio.stdout(`Wrote types for schema version ${schemaVersion} to ${relative(process.cwd(), out) || out}\\n`);\n\t\t\treturn 0;\n\t\t} catch (error) {\n\t\t\tif (error instanceof ShapioApiError) {\n\t\t\t\tio.stderr(`shapio types generate: ${error.code}: ${error.message}\\n`);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n} };\nconst help = () => `Usage:\\n${Object.values(SUBCOMMANDS).map((command) => ` ${command.usage}\\n ${command.summary}`).join(\"\\n\")}\\n`;\n//#endregion\n//#region src/index.ts\n/**\n* Commands that talk to a running instance over HTTP (never directly to its database). The `shapio` bin\n* in apps/api bundles these next to its local commands (start, migrate, worker, admin create).\n* Packages D, E and L add schema pull|diff|apply, export|import and types generate here.\n*/\nconst REMOTE_COMMANDS = {\n\tstatus: statusCommand,\n\tschema: schemaCommand,\n\ttypes: {\n\t\tsummary: \"Generate TypeScript types from the active schema: generate\",\n\t\tusage: \"shapio types generate [options]\",\n\t\trun: async (args, io) => {\n\t\t\tconst [name, ...rest] = args;\n\t\t\tconst command = name ? SUBCOMMANDS[name] : void 0;\n\t\t\tif (!command) {\n\t\t\t\tconst asked = !name || name === \"help\" || name === \"--help\";\n\t\t\t\t(asked ? io.stdout : io.stderr)(help());\n\t\t\t\treturn asked ? 0 : 1;\n\t\t\t}\n\t\t\treturn command.run(rest, io);\n\t\t}\n\t},\n\texport: exportCommand,\n\timport: importCommand\n};\n//#endregion\nexport { REMOTE_COMMANDS };\n\n//# sourceMappingURL=index.js.map","import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { sql, type Kysely } from 'kysely';\nimport { sqliteDriverOf } from './sqlite/index.js';\nimport type { DB } from './types.js';\n\n/** A backup request Shapio cannot serve; the message says what to do instead. */\nexport class BackupError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BackupError';\n }\n}\n\n/**\n * Writes a consistent copy of a SQLite database to `target` with `VACUUM INTO` while Shapio keeps running\n * (it reads one moment of the database and briefly holds the write lock). Refuses an existing target,\n * PostgreSQL and MySQL, whose backups are `pg_dump`'s and `mysqldump`'s job (documentation/backup-restore.md).\n * Returns the absolute path.\n */\nexport const backupDatabase = async (db: Kysely<DB>, target: string): Promise<string> => {\n if (!sqliteDriverOf(db)) {\n throw new BackupError(\n 'shapio backup copies SQLite databases. Back up PostgreSQL with pg_dump and MySQL with ' +\n 'mysqldump --single-transaction (see documentation/backup-restore.md).',\n );\n }\n const path = resolve(target);\n if (existsSync(path)) {\n throw new BackupError(`${path} already exists; choose a new file name`);\n }\n await sql`vacuum into ${path}`.execute(db);\n return path;\n};\n","import { checkThemeContrast, THEME_VARIANTS } from '@shapio/schema';\nimport type { ThemeDefinition } from './public.js';\n\nconst HEX = /^#[0-9a-fA-F]{6}$/;\n\n/**\n * WCAG AA warnings for extension themes (`shapio extensions check`): the pairs the built-in themes are held\n * to. Warnings, not errors: a project may knowingly ship a theme that fails. Only `#rrggbb` values can be\n * measured; a variant with other values is reported as not fully checked.\n */\nexport const themeContrastWarnings = (themes: readonly ThemeDefinition[]): string[] =>\n themes.flatMap((theme) =>\n THEME_VARIANTS.flatMap((variant) => {\n const tokens = theme[variant];\n if (!tokens) {\n return [];\n }\n const values: Record<string, string> = Object.fromEntries(\n Object.entries(tokens).filter((entry): entry is [string, string] => typeof entry[1] === 'string'),\n );\n const failures = checkThemeContrast(values, variant)\n .filter(({ ratio, required }) => ratio !== undefined && ratio < required)\n .map(\n ({ foreground, background, ratio, required }) =>\n `${theme.key} (${variant}): --${foreground} on --${background} is ${(ratio ?? 0).toFixed(2)}:1, needs ${required}:1`,\n );\n const unmeasured = Object.values(values).some((value) => !HEX.test(value))\n ? [`${theme.key} (${variant}): only #rrggbb values are checked for contrast`]\n : [];\n return [...failures, ...unmeasured];\n }),\n );\n","import { relative } from 'node:path';\nimport type { FastifyBaseLogger } from 'fastify';\nimport { pino } from 'pino';\nimport { EXTENSION_JOB_PREFIX, EXTENSION_ROUTE_ROOT } from '../constants/extensions.js';\nimport { AFTER_EVENTS, BEFORE_EVENTS } from '../content/hooks.js';\nimport { describeError } from '../helpers/errors.js';\nimport { buildEditorManifest } from './editorManifest.js';\nimport { loadProjectConfig, type LocateOptions } from './loader.js';\nimport { themeContrastWarnings } from './themeContrast.js';\n\n/**\n * `shapio extensions check` (ADR 0009): loads and validates the project config without a database and\n * reports what it registers. Exit code 1 on any problem, so CI catches a broken config before a deploy.\n */\nexport type ExtensionCheckReport = { ok: boolean; text: string };\n\nconst AFTER: ReadonlySet<string> = new Set(AFTER_EVENTS);\n\n/** Collects the editor manifest's complaints (missing files, bad names) instead of printing log lines. */\nconst collectingLogger = (problems: string[]): FastifyBaseLogger =>\n pino(\n { level: 'error' },\n {\n write: (line: string) => {\n const { msg, file } = JSON.parse(line) as { msg?: string; file?: unknown };\n problems.push(`${msg ?? ''}${typeof file === 'string' ? ` (${file})` : ''}`);\n },\n },\n );\n\nexport const checkExtensions = async (options: LocateOptions): Promise<ExtensionCheckReport> => {\n let loaded;\n try {\n loaded = await loadProjectConfig(options);\n } catch (error) {\n return { ok: false, text: `${describeError(error)}\\n` };\n }\n if (!loaded.file) {\n return { ok: true, text: `No shapio.config in ${loaded.projectDir}: no extensions.\\n` };\n }\n const { config, projectDir } = loaded;\n const editorProblems: string[] = [];\n const editors = buildEditorManifest(projectDir, config.editors ?? [], collectingLogger(editorProblems));\n const hooks = Object.entries(config.hooks ?? {}).flatMap(([key, modelHooks]) =>\n [...BEFORE_EVENTS, ...AFTER_EVENTS]\n .filter((event) => modelHooks[event])\n .map(\n (event) => `${key}.${event} (${AFTER.has(event) ? 'after commit, as a job' : 'in the transaction'})`,\n ),\n );\n const themes = config.themes ?? [];\n const contrastWarnings = themeContrastWarnings(themes);\n const section = (title: string, items: readonly string[]) =>\n `${title} (${items.length})\\n${items.map((item) => ` ${item}\\n`).join('')}`;\n const text = [\n `Config: ${relative(process.cwd(), loaded.file) || loaded.file}\\n`,\n section('Hooks', hooks),\n section(\n 'Routes',\n (config.routes ?? []).map((route) => `${EXTENSION_ROUTE_ROOT}/${route.prefix}`),\n ),\n section('Services', Object.keys(config.services ?? {})),\n section(\n 'Jobs',\n Object.keys(config.jobs ?? {}).map((name) => `${EXTENSION_JOB_PREFIX}${name}`),\n ),\n section(\n 'Editors',\n editors.entries.map((entry) => entry.file),\n ),\n section(\n 'Themes',\n themes.map((theme) => `${theme.key} (${theme.name})`),\n ),\n ...(editorProblems.length > 0 ? [section('Problems', editorProblems)] : []),\n // Contrast is a warning: the check still passes.\n ...(contrastWarnings.length > 0 ? [section('Warnings', contrastWarnings)] : []),\n ].join('');\n return { ok: editorProblems.length === 0, text };\n};\n","import { request as httpRequest } from 'node:http';\nimport { request as httpsRequest } from 'node:https';\n\nconst PROBE_TIMEOUT_MS = 4000;\n\n/**\n * Status code of a GET to `url`, or 0 on connection error/timeout. Certificate checks are skipped because\n * the probe targets 127.0.0.1, which a public certificate never names.\n */\nexport const probeStatus = (url: string): Promise<number> =>\n new Promise((resolve) => {\n const request = url.startsWith('https:') ? httpsRequest : httpRequest;\n const req = request(\n url,\n { method: 'GET', timeout: PROBE_TIMEOUT_MS, rejectUnauthorized: false },\n (res) => {\n res.resume();\n resolve(res.statusCode ?? 0);\n },\n );\n req.on('timeout', () => req.destroy());\n req.on('error', () => resolve(0));\n req.end();\n });\n","import { parseArgs } from 'node:util';\nimport type { CliCommand, CliIo } from '@shapio/cli';\nimport { SITE_KEY_PATTERN } from '../constants/sites.js';\nimport { createUrlBuilder } from '../helpers/publicUrl.js';\n\n/**\n * `shapio mcp`: prints how to connect a coding agent to this instance through @shapio/mcp (a stdio MCP\n * server run with npx). Prints configuration only: it creates no token and contacts nothing.\n */\nconst MCP_USAGE =\n 'shapio mcp [--url <Shapio URL>] [--client claude-code|cursor|claude-desktop|generic] [--allow-ship] [--site <key>]\\n' +\n ' Prints the MCP client configuration for @shapio/mcp. The URL defaults to SHAPIO_URL, then\\n' +\n \" PUBLIC_URL + BASE_PATH. --site sets SHAPIO_SITE (multi-site instances; default: the token's site, else\\n\" +\n ' the primary site). --client generic prints the stdio server definition any MCP client takes.\\n' +\n ' Create an admin API token whose role has no \"changes.ship\" and paste it in place\\n' +\n ' of the placeholder: agents prepare change sets, people ship them.';\n\nconst CLIENTS = ['claude-code', 'cursor', 'claude-desktop', 'generic'] as const;\ntype McpClientKind = (typeof CLIENTS)[number];\n\nexport const TOKEN_PLACEHOLDER = '<admin API token>';\nconst PACKAGE = '@shapio/mcp';\n\nconst defaultUrl = (env: CliIo['env']) => {\n if (env.SHAPIO_URL) {\n return env.SHAPIO_URL;\n }\n if (env.PUBLIC_URL) {\n const urls = createUrlBuilder({\n publicUrl: env.PUBLIC_URL,\n basePath: (env.BASE_PATH ?? '').replace(/\\/+$/, ''),\n });\n return urls.publicUrl + urls.basePath;\n }\n return 'http://localhost:4300';\n};\n\n/** What the printed configuration connects to. */\ntype McpTarget = { url: string; allowShip: boolean; site: string | undefined };\n\nconst SITE_KEY = new RegExp(SITE_KEY_PATTERN);\n\nconst serverArgs = ({ allowShip }: McpTarget) => ['-y', PACKAGE, ...(allowShip ? ['--allow-ship'] : [])];\n\nconst serverEnv = ({ url, site }: McpTarget): Record<string, string> => ({\n SHAPIO_URL: url,\n SHAPIO_TOKEN: TOKEN_PLACEHOLDER,\n ...(site !== undefined ? { SHAPIO_SITE: site } : {}),\n});\n\n/** The stdio server definition every MCP client takes: a command, its arguments and its environment. */\nconst serverDefinition = (target: McpTarget) => ({\n command: 'npx',\n args: serverArgs(target),\n env: serverEnv(target),\n});\n\n/** The `mcpServers` JSON block Cursor and Claude Desktop read. */\nconst jsonConfig = (target: McpTarget) =>\n JSON.stringify({ mcpServers: { shapio: serverDefinition(target) } }, null, 2);\n\n/** `claude mcp add` flags; the token placeholder is quoted (it contains spaces). */\nconst claudeCodeEnv = (target: McpTarget) =>\n Object.entries(serverEnv(target))\n .map(([name, value]) =>\n value === TOKEN_PLACEHOLDER ? `--env \"${name}=${value}\"` : `--env ${name}=${value}`,\n )\n .join(' ');\n\nconst SECTIONS: Record<McpClientKind, (target: McpTarget) => string> = {\n 'claude-code': (target) =>\n `Claude Code (run in your project):\\n\\n claude mcp add shapio ${claudeCodeEnv(target)} -- npx ${serverArgs(target).join(' ')}\\n`,\n cursor: (target) => `Cursor (.cursor/mcp.json in your project):\\n\\n${jsonConfig(target)}\\n`,\n 'claude-desktop': (target) =>\n `Claude Desktop (claude_desktop_config.json, then restart the app):\\n\\n${jsonConfig(target)}\\n`,\n generic: (target) =>\n `Any MCP client (stdio server):\\n\\n${JSON.stringify(serverDefinition(target), null, 2)}\\n`,\n};\n\nexport const mcpCommand: CliCommand = {\n summary:\n 'Print the configuration that connects Claude Code, Cursor, Claude Desktop or any MCP client through @shapio/mcp',\n usage: MCP_USAGE,\n run: async (args, io) => {\n let values;\n try {\n ({ values } = parseArgs({\n args: [...args],\n options: {\n url: { type: 'string' },\n client: { type: 'string' },\n 'allow-ship': { type: 'boolean', default: false },\n site: { type: 'string' },\n },\n strict: true,\n }));\n } catch (error) {\n io.stderr(`${error instanceof Error ? error.message : String(error)}\\n\\nUsage: ${MCP_USAGE}\\n`);\n return 1;\n }\n const client = values.client as McpClientKind | undefined;\n if (client !== undefined && !CLIENTS.includes(client)) {\n io.stderr(`--client must be one of ${CLIENTS.join(', ')}\\n`);\n return 1;\n }\n const url = (values.url ?? defaultUrl(io.env)).replace(/\\/+$/, '');\n if (!/^https?:\\/\\//.test(url)) {\n io.stderr(`--url must be an http(s) URL (got ${url})\\n`);\n return 1;\n }\n if (values.site !== undefined && !SITE_KEY.test(values.site)) {\n io.stderr(`--site must be a site key (lower case, starting with a letter; got ${values.site})\\n`);\n return 1;\n }\n const target: McpTarget = { url, allowShip: values['allow-ship'], site: values.site };\n const sections = (client ? [client] : CLIENTS).map((kind) => SECTIONS[kind](target));\n io.stdout(\n `${sections.join('\\n')}\\nReplace ${TOKEN_PLACEHOLDER} with an admin API token (Settings → API tokens). ` +\n 'Give its role no \"changes.ship\": the agent drafts and opens change sets, a person ships them.' +\n (values['allow-ship']\n ? ' --allow-ship only offers the ship tool; the token’s role still decides.\\n'\n : '\\n'),\n );\n return 0;\n },\n};\n","import type { Kysely } from 'kysely';\nimport type { DB } from '../db/types.js';\nimport { describeError } from '../helpers/errors.js';\nimport * as mediaAssetsRepository from '../repositories/mediaAssets.js';\nimport type { MediaAssetRow } from '../repositories/mediaAssets.js';\nimport * as mediaVariantsRepository from '../repositories/mediaVariants.js';\nimport { copyObjectVerified } from './objects.js';\nimport type { MediaStorage, StorageAdapter, StorageDriver } from './types.js';\n\nexport type MigrateMediaOptions = {\n db: Kysely<DB>;\n storage: MediaStorage;\n from: StorageDriver;\n to: StorageDriver;\n /** Delete each object from the source after its asset has moved. Off by default: the source stays a backup. */\n deleteSource?: boolean;\n batchSize?: number;\n /** Progress lines (one per asset). */\n report?: (line: string) => void;\n};\n\nexport type MigrateMediaResult = {\n migrated: number;\n /** Still processing (variants being written); run the command again later. */\n skipped: number;\n failed: { assetId: string; error: string }[];\n};\n\ntype AssetObject = { key: string; mimeType: string; checksum: string | null };\n\nconst objectsOf = async (db: Kysely<DB>, asset: MediaAssetRow): Promise<AssetObject[]> => [\n { key: asset.storage_key, mimeType: asset.mime_type, checksum: asset.checksum_sha256 },\n ...(await mediaVariantsRepository.listForAssets([asset.id], db)).flatMap((variant) =>\n variant.storage_key\n ? [{ key: variant.storage_key, mimeType: variant.mime_type, checksum: variant.checksum_sha256 }]\n : [],\n ),\n];\n\n/**\n * Moves one asset: copy every object (verifying checksums against the database and by reading the copy\n * back), then switch the asset's driver in one transaction, only if nothing changed meanwhile.\n */\nconst migrateAsset = async (\n options: MigrateMediaOptions,\n source: StorageAdapter,\n target: StorageAdapter,\n asset: MediaAssetRow,\n): Promise<'migrated' | 'skipped'> => {\n const { db } = options;\n if (asset.status === 'processing') {\n return 'skipped';\n }\n const objects = await objectsOf(db, asset);\n const verified = new Map<string, string>();\n for (const object of objects) {\n const { sha256 } = await copyObjectVerified({\n from: source,\n fromKey: object.key,\n to: target,\n toKey: object.key,\n contentType: object.mimeType,\n expectedSha256: object.checksum,\n });\n verified.set(object.key, sha256);\n }\n const switched = await db.transaction().execute(async (trx) => {\n const locked = await mediaAssetsRepository.lockById(asset.id, trx);\n if (\n !locked ||\n locked.deleted_at !== null ||\n locked.storage_driver !== options.from ||\n locked.storage_key !== asset.storage_key\n ) {\n return false;\n }\n await mediaAssetsRepository.update(\n asset.id,\n { storage_driver: options.to, checksum_sha256: verified.get(asset.storage_key) ?? null },\n trx,\n );\n return true;\n });\n if (!switched) {\n return 'skipped';\n }\n if (options.deleteSource) {\n for (const object of objects) {\n await source.delete(object.key);\n }\n }\n return 'migrated';\n};\n\n/**\n * `shapio media migrate`: moves every live asset (original and variants) from one driver to another while\n * the server keeps serving, since each asset is read from the driver its row records. Resumable and\n * idempotent: progress is the rows themselves (a moved asset no longer matches `from`), copies overwrite\n * the same keys, and an interrupted run simply continues with the assets still on `from`.\n */\nexport const migrateMedia = async (options: MigrateMediaOptions): Promise<MigrateMediaResult> => {\n if (options.from === options.to) {\n throw new Error('--from and --to must differ');\n }\n const source = options.storage.get(options.from);\n const target = options.storage.get(options.to);\n const batchSize = options.batchSize ?? 100;\n const result: MigrateMediaResult = { migrated: 0, skipped: 0, failed: [] };\n let afterId: string | undefined;\n for (;;) {\n const batch = await mediaAssetsRepository.listLiveByDriver(options.from, afterId, batchSize, options.db);\n if (batch.length === 0) {\n return result;\n }\n for (const asset of batch) {\n try {\n const outcome = await migrateAsset(options, source, target, asset);\n result[outcome] += 1;\n options.report?.(`${outcome} ${asset.id} ${asset.original_filename}`);\n } catch (error) {\n result.failed.push({ assetId: asset.id, error: describeError(error) });\n options.report?.(`failed ${asset.id} ${asset.original_filename}: ${describeError(error)}`);\n }\n }\n afterId = batch.at(-1)?.id;\n }\n};\n","import type { CliCommand, CliIo } from '@shapio/cli';\nimport { loadConfig } from '../config/index.js';\nimport { createDb } from '../db/index.js';\nimport { getPendingMigrations } from '../db/migrator.js';\nimport { createUrlBuilder } from '../helpers/publicUrl.js';\nimport { migrateMedia } from './migrate.js';\nimport { createMediaStorage } from './storage.js';\nimport { STORAGE_DRIVERS, type StorageDriver } from './types.js';\n\nconst MEDIA_USAGE =\n 'shapio media migrate --from <local|s3> --to <local|s3> [--delete-source]\\n' +\n ' Copies every asset and its variants to the other storage, verifies checksums and switches each asset\\n' +\n ' over in its own transaction, while the server keeps running. Safe to interrupt and re-run.\\n' +\n ' Needs MEDIA_PATH and the STORAGE_S3_* settings. Afterwards set STORAGE_DRIVER to the new driver.';\n\ntype MigrateArgs = { from: StorageDriver; to: StorageDriver; deleteSource: boolean };\n\nconst isDriver = (value: string | undefined): value is StorageDriver =>\n STORAGE_DRIVERS.includes(value as StorageDriver);\n\n/** `--from x --to y [--delete-source]`, also as `--from=x`. */\nconst parseMigrateArgs = (args: readonly string[]): MigrateArgs | undefined => {\n const values = new Map<string, string>();\n let deleteSource = false;\n for (let index = 0; index < args.length; index += 1) {\n const match = /^--(from|to|delete-source)(?:=(.*))?$/.exec(args[index] ?? '');\n if (!match?.[1]) {\n return undefined;\n }\n if (match[1] === 'delete-source') {\n deleteSource = true;\n continue;\n }\n const value = match[2] ?? args[index + 1];\n if (match[2] === undefined) {\n index += 1;\n }\n values.set(match[1], value ?? '');\n }\n const from = values.get('from');\n const to = values.get('to');\n return isDriver(from) && isDriver(to) && from !== to ? { from, to, deleteSource } : undefined;\n};\n\nconst runMigrate = async (parsed: MigrateArgs, io: CliIo): Promise<number> => {\n const config = loadConfig();\n const db = createDb({ connectionString: config.database.url, poolMax: 2, applicationName: 'shapio-media' });\n try {\n if ((await getPendingMigrations(db)).length > 0) {\n io.stderr('Database migrations are pending; run `shapio migrate` (or start the server) first.\\n');\n return 1;\n }\n const storage = await createMediaStorage(config.storage, { urls: createUrlBuilder(config.server) });\n if (!storage.has('s3')) {\n io.stderr(\n 'Set STORAGE_S3_BUCKET (and the other STORAGE_S3_* settings) to migrate media to or from S3.\\n',\n );\n return 1;\n }\n const result = await migrateMedia({\n db,\n storage,\n ...parsed,\n report: (line) => io.stdout(`${line}\\n`),\n });\n io.stdout(\n `Migrated ${result.migrated}, skipped ${result.skipped} (still processing; re-run later), failed ${result.failed.length}.\\n`,\n );\n if (result.migrated > 0 && config.storage.driver !== parsed.to) {\n io.stdout(`Set STORAGE_DRIVER=${parsed.to} and restart so new uploads go to ${parsed.to}.\\n`);\n }\n return result.failed.length > 0 ? 1 : 0;\n } finally {\n await db.destroy();\n }\n};\n\n/** `shapio media migrate`: runs on the server host (it reads MEDIA_PATH and talks to the database). */\nexport const mediaCommand: CliCommand = {\n summary: 'Move stored media between local disk and S3 (media migrate --from local --to s3)',\n usage: MEDIA_USAGE,\n run: async (args, io) => {\n const [subcommand, ...rest] = args;\n const parsed = subcommand === 'migrate' ? parseMigrateArgs(rest) : undefined;\n if (!parsed) {\n io.stderr(`Usage: ${MEDIA_USAGE}\\n`);\n return 1;\n }\n return runMigrate(parsed, io);\n },\n};\n","/**\n * The `shapio` bin's commands (cli.ts runs them). Kept apart from the entry point so the documentation's CLI\n * reference can be generated from these definitions without starting anything.\n */\nimport { REMOTE_COMMANDS, type CliCommand, type CliIo } from '@shapio/cli';\nimport { Value } from 'typebox/value';\nimport { loadConfig } from './config/index.js';\nimport { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PERSON_NAME_MAX_LENGTH } from './constants/auth.js';\nimport { SITE_KEY_PATTERN } from './constants/sites.js';\nimport { SHAPIO_VERSION } from './constants/version.js';\nimport { backupDatabase, BackupError } from './db/backup.js';\nimport { createDb } from './db/index.js';\nimport { getPendingMigrations, migrateToLatest } from './db/migrator.js';\nimport { assertDatabaseReachable } from './db/startupChecks.js';\nimport { checkExtensions } from './extensions/check.js';\nimport { probeStatus } from './helpers/healthProbe.js';\nimport { loopbackUrl } from './helpers/publicUrl.js';\nimport { generateToken } from './helpers/tokens.js';\nimport { createLogger } from './logger.js';\nimport { mcpCommand } from './mcp/cli.js';\nimport { mediaCommand } from './media/cli.js';\nimport { EmailSchema, PasswordSchema, PersonNameSchema } from './routes/schemas/adminIdentity.js';\nimport { startServer } from './server.js';\nimport { SYSTEM_CLI_ACTOR } from './services/actorContext.js';\nimport { createAdminDirect } from './services/setup.js';\nimport { createSite, listAllSites } from './services/sites.js';\nimport { startDedicatedWorker } from './worker.js';\n\n/** Runs until a signal stops the process; the exit code is set by the shutdown handler. */\nexport const KEEP_RUNNING = -1;\n\nconst startCommand: CliCommand = {\n summary: 'Run the API server (and the inline worker unless WORKER_MODE=dedicated)',\n usage: 'shapio start',\n run: async () => {\n await startServer(loadConfig());\n return KEEP_RUNNING;\n },\n};\n\nconst workerCommand: CliCommand = {\n summary: 'Run the job worker as its own process (for WORKER_MODE=dedicated)',\n usage: 'shapio worker',\n run: async () => {\n await startDedicatedWorker(loadConfig());\n return KEEP_RUNNING;\n },\n};\n\nconst migrateCommand: CliCommand = {\n summary: 'Apply pending database migrations, then exit',\n usage: 'shapio migrate',\n run: async (_args, io) => {\n const config = loadConfig();\n const db = createDb({\n connectionString: config.database.url,\n poolMax: 2,\n applicationName: 'shapio-migrate',\n });\n try {\n await assertDatabaseReachable(db, config.database.url);\n const results = await migrateToLatest(db, createLogger(config));\n io.stdout(\n results.length === 0 ? 'Database is up to date.\\n' : `Applied ${results.length} migration(s).\\n`,\n );\n return 0;\n } finally {\n await db.destroy();\n }\n },\n};\n\nconst backupCommand: CliCommand = {\n summary:\n 'Copy a SQLite database to a new file while Shapio runs (backup <file>; PostgreSQL uses pg_dump, MySQL mysqldump)',\n usage: 'shapio backup <file>',\n run: async (args, io) => {\n const [target] = args;\n if (!target) {\n io.stderr('Usage: shapio backup <file>\\n');\n return 1;\n }\n const config = loadConfig();\n const db = createDb({\n connectionString: config.database.url,\n poolMax: 2,\n applicationName: 'shapio-backup',\n });\n try {\n await assertDatabaseReachable(db, config.database.url);\n io.stdout(`Backed up the database to ${await backupDatabase(db, target)}\\n`);\n return 0;\n } catch (error) {\n if (error instanceof BackupError) {\n io.stderr(`${error.message}\\n`);\n return 1;\n }\n throw error;\n } finally {\n await db.destroy();\n }\n },\n};\n\nconst healthcheckCommand: CliCommand = {\n summary: \"Exit 0 if this host's Shapio answers /api/ready (for Docker HEALTHCHECK and process monitors)\",\n usage: 'shapio healthcheck',\n run: async (_args, io) => {\n const { server, tls } = loadConfig();\n const url = loopbackUrl(\n { port: server.port, basePath: server.basePath, https: tls.mode !== 'off' },\n '/api/ready',\n );\n const status = await probeStatus(url);\n if (status !== 200) {\n io.stderr(`not ready: ${url} -> ${status === 0 ? 'no response' : String(status)}\\n`);\n return 1;\n }\n return 0;\n },\n};\n\nconst versionCommand: CliCommand = {\n summary: 'Print the Shapio version',\n usage: 'shapio version',\n run: async (_args, io) => {\n io.stdout(`${SHAPIO_VERSION}\\n`);\n return 0;\n },\n};\n\nconst ADMIN_USAGE =\n 'shapio admin create --email <email> [--name <name>] [--role <role key, default owner>]\\n' +\n ' The password is read from SHAPIO_ADMIN_PASSWORD; without it a strong one is generated and printed once.';\n\n/** `--key value` and `--key=value` options. */\nconst parseOptions = (args: readonly string[]): Map<string, string> => {\n const options = new Map<string, string>();\n for (let index = 0; index < args.length; index += 1) {\n const match = /^--([a-z-]+)(?:=(.*))?$/.exec(args[index] ?? '');\n if (match?.[1]) {\n const value = match[2] ?? args[index + 1];\n if (match[2] === undefined) {\n index += 1;\n }\n options.set(match[1], value ?? '');\n }\n }\n return options;\n};\n\n/**\n * The rules Setup and invitations apply (the same TypeBox schemas as their routes), so the CLI cannot create\n * an admin who could never sign in. The name is optional here; when given it follows the same limit.\n */\nconst invalidAdminInput = (\n email: string,\n name: string | undefined,\n password: string | undefined,\n): string | undefined => {\n if (!Value.Check(EmailSchema, email.trim())) {\n return '--email must be an email address (at most 254 characters).';\n }\n if (name !== undefined && !Value.Check(PersonNameSchema, name)) {\n return `--name must be 1 to ${PERSON_NAME_MAX_LENGTH} characters.`;\n }\n if (password !== undefined && !Value.Check(PasswordSchema, password)) {\n return `SHAPIO_ADMIN_PASSWORD must be ${PASSWORD_MIN_LENGTH} to ${PASSWORD_MAX_LENGTH} characters.`;\n }\n return undefined;\n};\n\nconst adminCommand: CliCommand = {\n summary: 'Create an admin account directly in the database (admin create --email ...)',\n usage: ADMIN_USAGE,\n run: async (args, io) => {\n const [subcommand, ...rest] = args;\n const options = parseOptions(rest);\n const email = options.get('email');\n if (subcommand !== 'create' || !email) {\n io.stderr(`Usage: ${ADMIN_USAGE}\\n`);\n return 1;\n }\n const providedPassword = io.env.SHAPIO_ADMIN_PASSWORD;\n const invalid = invalidAdminInput(email, options.get('name'), providedPassword);\n if (invalid) {\n io.stderr(`${invalid}\\n`);\n return 1;\n }\n const password = providedPassword ?? generateToken();\n const config = loadConfig();\n const db = createDb({\n connectionString: config.database.url,\n poolMax: 2,\n applicationName: 'shapio-admin',\n });\n try {\n const pending = await getPendingMigrations(db);\n if (pending.length > 0) {\n io.stderr('Database migrations are pending; run `shapio migrate` (or start the server) first.\\n');\n return 1;\n }\n await createAdminDirect(db, {\n email,\n name: options.get('name') ?? '',\n password,\n roleKey: options.get('role') ?? 'owner',\n });\n io.stdout(`Created admin ${email.trim().toLowerCase()}.\\n`);\n if (providedPassword === undefined) {\n io.stdout(`Generated password (shown once, change it after signing in): ${password}\\n`);\n }\n return 0;\n } finally {\n await db.destroy();\n }\n },\n};\n\nconst SITES_USAGE =\n 'shapio sites list\\n' +\n 'shapio sites create --key <key> --name <name>\\n' +\n ' Lists or creates sites directly in the database (sites share the admins, roles and shared content types;\\n' +\n ' each has its own content types, content, media, tokens and snapshots). Keys are lower case and fixed once\\n' +\n ' created.';\n\nconst SITE_KEY_RE = new RegExp(SITE_KEY_PATTERN);\n\nconst runSites = async (subcommand: string | undefined, options: Map<string, string>, io: CliIo) => {\n const config = loadConfig();\n const db = createDb({ connectionString: config.database.url, poolMax: 2, applicationName: 'shapio-sites' });\n try {\n if ((await getPendingMigrations(db)).length > 0) {\n io.stderr('Database migrations are pending; run `shapio migrate` (or start the server) first.\\n');\n return 1;\n }\n if (subcommand === 'list') {\n for (const site of await listAllSites(db)) {\n io.stdout(`${site.key}\\t${site.name}${site.isPrimary ? '\\t(primary)' : ''}\\n`);\n }\n return 0;\n }\n const key = options.get('key') ?? '';\n const name = options.get('name')?.trim() ?? '';\n if (!SITE_KEY_RE.test(key) || name.length === 0) {\n io.stderr(`Usage: ${SITES_USAGE}\\n`);\n return 1;\n }\n const site = await createSite(SYSTEM_CLI_ACTOR, { key, name }, db);\n io.stdout(`Created site ${site.key} (${site.id}).\\n`);\n return 0;\n } finally {\n await db.destroy();\n }\n};\n\nconst sitesCommand: CliCommand = {\n summary: 'List or create sites directly in the database (sites list | sites create --key ... --name ...)',\n usage: SITES_USAGE,\n run: async (args, io) => {\n const [subcommand, ...rest] = args;\n if (subcommand !== 'list' && subcommand !== 'create') {\n io.stderr(`Usage: ${SITES_USAGE}\\n`);\n return 1;\n }\n return runSites(subcommand, parseOptions(rest), io);\n },\n};\n\nconst EXTENSIONS_USAGE =\n 'shapio extensions check\\n' +\n ' Loads shapio.config (SHAPIO_CONFIG_PATH, else the working directory), validates it and lists its hooks,\\n' +\n ' routes, services, jobs and editors. Exits 1 on any problem. Needs no database.';\n\nconst extensionsCommand: CliCommand = {\n summary: 'Validate shapio.config and list its hooks, routes, services, jobs and editors (extensions check)',\n usage: EXTENSIONS_USAGE,\n run: async (args, io) => {\n if (args[0] !== 'check') {\n io.stderr(`Usage: ${EXTENSIONS_USAGE}\\n`);\n return 1;\n }\n const report = await checkExtensions({ configPath: io.env.SHAPIO_CONFIG_PATH || undefined });\n (report.ok ? io.stdout : io.stderr)(report.text);\n return report.ok ? 0 : 1;\n },\n};\n\nconst LOCAL_COMMANDS: Readonly<Record<string, CliCommand>> = {\n start: startCommand,\n worker: workerCommand,\n migrate: migrateCommand,\n backup: backupCommand,\n healthcheck: healthcheckCommand,\n version: versionCommand,\n admin: adminCommand,\n media: mediaCommand,\n mcp: mcpCommand,\n sites: sitesCommand,\n extensions: extensionsCommand,\n};\n\n/** Every `shapio` command: the server-side ones here and the remote ones from packages/cli. */\nexport const COMMANDS: Readonly<Record<string, CliCommand>> = { ...LOCAL_COMMANDS, ...REMOTE_COMMANDS };\n\nexport const helpText = () => {\n const width = Math.max(...Object.keys(COMMANDS).map((name) => name.length));\n const lines = Object.entries(COMMANDS).map(\n ([name, command]) => ` ${name.padEnd(width)} ${command.summary}`,\n );\n return `shapio ${SHAPIO_VERSION}\\n\\nUsage: shapio <command> [options]\\n\\nCommands:\\n${lines.join('\\n')}\\n`;\n};\n\nexport const runCli = async (argv: readonly string[], io: CliIo): Promise<number> => {\n const [name, ...args] = argv;\n if (!name || name === 'help' || name === '--help' || name === '-h') {\n io.stdout(helpText());\n return 0;\n }\n if (name === '--version' || name === '-v') {\n return versionCommand.run(args, io);\n }\n const command = COMMANDS[name];\n if (!command) {\n io.stderr(`shapio: unknown command \"${name}\"\\n\\n${helpText()}`);\n return 1;\n }\n return command.run(args, io);\n};\n","import type { CliIo } from '@shapio/cli';\nimport { KEEP_RUNNING, runCli } from './cliCommands.js';\nimport { loadEnvFileIfPresent } from './config/index.js';\nimport { describeError } from './helpers/errors.js';\n\n// Settings come from the environment; a .env in the working directory fills in anything unset.\nloadEnvFileIfPresent();\nconst io: CliIo = {\n stdout: (text) => process.stdout.write(text),\n stderr: (text) => process.stderr.write(text),\n env: process.env,\n};\nrunCli(process.argv.slice(2), io)\n .then((code) => {\n if (code !== KEEP_RUNNING) {\n process.exitCode = code;\n }\n })\n .catch((error: unknown) => {\n io.stderr(`shapio: ${describeError(error)}\\n`);\n process.exitCode = 1;\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,cAAc;CACnB,OAAO;CACP,M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