@phtngyn/cms 0.2.0-beta.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (524) hide show
  1. package/LICENSE +18 -10
  2. package/README.md +59 -404
  3. package/drizzle/20261003215543_initial/migration.sql +251 -0
  4. package/drizzle/20261003215543_initial/snapshot.json +1941 -0
  5. package/package.json +75 -71
  6. package/src/Authoring.d.ts +41 -49
  7. package/src/Authoring.js +1 -1
  8. package/src/Blocks-BrxSemnd.js +40 -0
  9. package/src/Client.d.ts +8186 -0
  10. package/src/Client.js +41 -0
  11. package/src/Collections.d.ts +142 -0
  12. package/src/Collections.js +142 -0
  13. package/src/Config-CMiwciub.js +130 -0
  14. package/src/Config.d.ts +172 -0
  15. package/src/Config.js +2 -0
  16. package/src/Configuration-Dk2k3OIc.js +73 -0
  17. package/src/DataTransfer-BmECvPHB.js +488 -0
  18. package/src/Database-DSsNCGft.d.ts +3 -0
  19. package/src/Delivery.d.ts +28 -0
  20. package/src/Delivery.js +7 -0
  21. package/src/Document-CKXMSEf1.js +293 -0
  22. package/src/Document-TgwYKJZM.d.ts +220 -0
  23. package/src/DocumentRenderer-Wz2xaNyf.js +394 -0
  24. package/src/EditorSchema-wrDv-id6.js +296 -0
  25. package/src/Fields-BegSgYhj.d.ts +166 -0
  26. package/src/Fields-ioGaMEh9.js +130 -0
  27. package/src/Forms-BuKAXQxr.d.ts +203 -0
  28. package/src/Forms.d.ts +48 -11
  29. package/src/Forms.js +342 -7
  30. package/src/I18n-Ckf9h0rC.js +154 -0
  31. package/src/I18n.d.ts +45 -2
  32. package/src/I18n.js +2 -1
  33. package/src/Image-CJWPLnhP.js +110 -0
  34. package/src/Links-CJYyy7rC.js +28 -0
  35. package/src/Links-Dx1yOni8.d.ts +28 -0
  36. package/src/Locales-Ch7a5xuA.js +67 -0
  37. package/src/Locales-jwbmJaOp.d.ts +43 -0
  38. package/src/Locales.d.ts +3 -0
  39. package/src/Locales.js +3 -0
  40. package/src/Media-BQ0uL4w7.d.ts +15 -0
  41. package/src/Media-DSyvd14o.js +87 -0
  42. package/src/Module.d.ts +2 -10
  43. package/src/Module.js +1040 -152
  44. package/src/Operations.d.ts +57 -0
  45. package/src/Operations.js +263 -0
  46. package/src/People-DvNZauWw.js +69 -0
  47. package/src/PreviewFocus-C_EelZO5.js +104 -0
  48. package/src/Query-C0kGJF5_.d.ts +261 -0
  49. package/src/RevisionPreview-IVwbJ9Wy.js +133 -0
  50. package/src/Routes-BaZvm2LE.js +126 -0
  51. package/src/Routes-DM1rRp3r.d.ts +15 -0
  52. package/src/S3MediaObjects-y-WacEi9.js +193 -0
  53. package/src/Seo-BcpqxoAs.d.ts +57 -0
  54. package/src/Seo-CjNUtUkj.js +254 -0
  55. package/src/StudioApi-CXLwwocX.js +833 -0
  56. package/src/StudioErrors-T5zLGQ1M.js +117 -0
  57. package/src/StudioErrors-kq-E44lQ.d.ts +104 -0
  58. package/src/StudioServer.d.ts +20 -0
  59. package/src/StudioServer.js +34 -0
  60. package/src/answers-DcTg0Xv2.js +41 -0
  61. package/src/cli.js +681 -187
  62. package/src/contracts-rprW3ZOB.js +130 -0
  63. package/src/forms-3xuf0Ym7.d.ts +206 -0
  64. package/src/localeConfiguration-BPbkLi7-.js +32 -0
  65. package/src/localeContext-DhF3SPvM.js +59 -0
  66. package/src/locales-6OD4XGIZ.js +12 -0
  67. package/src/nuxtDelivery-BYX_Cddb.js +466 -0
  68. package/src/plugin-DTYuDaQu.js +7171 -0
  69. package/src/previewContext-dt3ZUh-w.js +4 -0
  70. package/src/previewRegions-CXjk5cbP.js +145 -0
  71. package/src/previewSource-fb-q3ESM.js +144 -0
  72. package/src/rendering-D9LVeEKX.js +47 -0
  73. package/src/rolldown-runtime-8H4AJuhK.js +14 -0
  74. package/src/runtime/CmsImage.js +38 -0
  75. package/src/runtime/DocumentPage.vue +10 -0
  76. package/src/runtime/DocumentPageContent.js +48 -0
  77. package/src/runtime/DocumentRenderer.d.ts +129 -0
  78. package/src/runtime/DocumentRenderer.js +2 -0
  79. package/src/runtime/api.js +48 -6
  80. package/src/runtime/delivery/useCmsDocument.js +2 -0
  81. package/src/runtime/delivery/useCmsDocumentQuery.js +2 -0
  82. package/src/runtime/delivery/useCmsDocumentSeo.js +2 -114
  83. package/src/runtime/delivery/useCmsLocale.js +10 -0
  84. package/src/runtime/plugin.js +2 -40
  85. package/src/runtime/preview.css +85 -0
  86. package/src/runtime/preview.js +277 -0
  87. package/src/runtime/previewSource.js +82 -0
  88. package/src/runtime/revisionPrivacy.js +13 -0
  89. package/src/runtime/studio.js +10 -0
  90. package/src/runtime/studioIcons.js +36 -0
  91. package/src/validation-3pggwcnm.js +396 -0
  92. package/src/validation-DpUwPC8Y.js +224 -0
  93. package/studio/THIRD-PARTY-LICENSES.md +2406 -0
  94. package/studio/chunks/AccountPage-DL3DitDM.js +288 -0
  95. package/studio/chunks/AccountPage-DL3DitDM.js.br +0 -0
  96. package/studio/chunks/AccountPage-DL3DitDM.js.gz +0 -0
  97. package/studio/chunks/ActivityPage-CLqVUqTh.js +584 -0
  98. package/studio/chunks/ActivityPage-CLqVUqTh.js.br +0 -0
  99. package/studio/chunks/ActivityPage-CLqVUqTh.js.gz +0 -0
  100. package/studio/chunks/Alert-D0D24z_a.js +335 -0
  101. package/studio/chunks/Alert-D0D24z_a.js.br +0 -0
  102. package/studio/chunks/Alert-D0D24z_a.js.gz +0 -0
  103. package/studio/chunks/Badge-BBFs88TI.js +346 -0
  104. package/studio/chunks/Badge-BBFs88TI.js.br +0 -0
  105. package/studio/chunks/Badge-BBFs88TI.js.gz +0 -0
  106. package/studio/chunks/Button-BT3ztSPx.js +14319 -0
  107. package/studio/chunks/Button-BT3ztSPx.js.br +0 -0
  108. package/studio/chunks/Button-BT3ztSPx.js.gz +0 -0
  109. package/studio/chunks/Collapsible-CKnEYIlp.js +246 -0
  110. package/studio/chunks/Collapsible-CKnEYIlp.js.br +0 -0
  111. package/studio/chunks/Collapsible-CKnEYIlp.js.gz +0 -0
  112. package/studio/chunks/ContentInventory-D7nsFA6U.js +1745 -0
  113. package/studio/chunks/ContentInventory-D7nsFA6U.js.br +0 -0
  114. package/studio/chunks/ContentInventory-D7nsFA6U.js.gz +0 -0
  115. package/studio/chunks/ContentPage-DCxt6BeD.js +18 -0
  116. package/studio/chunks/ContentPage-DCxt6BeD.js.br +0 -0
  117. package/studio/chunks/ContentPage-DCxt6BeD.js.gz +0 -0
  118. package/studio/chunks/DashboardSearch-DjyMjJwF.js +2413 -0
  119. package/studio/chunks/DashboardSearch-DjyMjJwF.js.br +0 -0
  120. package/studio/chunks/DashboardSearch-DjyMjJwF.js.gz +0 -0
  121. package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js +26063 -0
  122. package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js.br +0 -0
  123. package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js.gz +0 -0
  124. package/studio/chunks/DropdownMenu-CA9fB0uZ.js +4400 -0
  125. package/studio/chunks/DropdownMenu-CA9fB0uZ.js.br +0 -0
  126. package/studio/chunks/DropdownMenu-CA9fB0uZ.js.gz +0 -0
  127. package/studio/chunks/EditorPage-D_PAYEE4.js +7799 -0
  128. package/studio/chunks/EditorPage-D_PAYEE4.js.br +0 -0
  129. package/studio/chunks/EditorPage-D_PAYEE4.js.gz +0 -0
  130. package/studio/chunks/FormField-CgM6l2Yn.js +198 -0
  131. package/studio/chunks/FormField-CgM6l2Yn.js.br +0 -0
  132. package/studio/chunks/FormField-CgM6l2Yn.js.gz +0 -0
  133. package/studio/chunks/HelpPage-C-vrFcT_.js +552 -0
  134. package/studio/chunks/HelpPage-C-vrFcT_.js.br +0 -0
  135. package/studio/chunks/HelpPage-C-vrFcT_.js.gz +0 -0
  136. package/studio/chunks/Kbd-Ot7TIhVZ.js +271 -0
  137. package/studio/chunks/Kbd-Ot7TIhVZ.js.br +0 -0
  138. package/studio/chunks/Kbd-Ot7TIhVZ.js.gz +0 -0
  139. package/studio/chunks/MediaFolderDialog-DYu-eu-q.js +101 -0
  140. package/studio/chunks/MediaFolderDialog-DYu-eu-q.js.br +0 -0
  141. package/studio/chunks/MediaFolderDialog-DYu-eu-q.js.gz +0 -0
  142. package/studio/chunks/MediaPage-D-jaWtdl.js +923 -0
  143. package/studio/chunks/MediaPage-D-jaWtdl.js.br +0 -0
  144. package/studio/chunks/MediaPage-D-jaWtdl.js.gz +0 -0
  145. package/studio/chunks/MediaPicker-BZs2wUFz.js +837 -0
  146. package/studio/chunks/MediaPicker-BZs2wUFz.js.br +0 -0
  147. package/studio/chunks/MediaPicker-BZs2wUFz.js.gz +0 -0
  148. package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js +1173 -0
  149. package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js.br +0 -0
  150. package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js.gz +0 -0
  151. package/studio/chunks/Modal-D6hSvxHd.js +265 -0
  152. package/studio/chunks/Modal-D6hSvxHd.js.br +0 -0
  153. package/studio/chunks/Modal-D6hSvxHd.js.gz +0 -0
  154. package/studio/chunks/NewDocumentDialog-C8B6_r3J.js +277 -0
  155. package/studio/chunks/NewDocumentDialog-C8B6_r3J.js.br +0 -0
  156. package/studio/chunks/NewDocumentDialog-C8B6_r3J.js.gz +0 -0
  157. package/studio/chunks/Pagination-D9BSo5H2.js +573 -0
  158. package/studio/chunks/Pagination-D9BSo5H2.js.br +0 -0
  159. package/studio/chunks/Pagination-D9BSo5H2.js.gz +0 -0
  160. package/studio/chunks/PeoplePage-CWIXitBD.js +783 -0
  161. package/studio/chunks/PeoplePage-CWIXitBD.js.br +0 -0
  162. package/studio/chunks/PeoplePage-CWIXitBD.js.gz +0 -0
  163. package/studio/chunks/Popover-B63bkTMS.js +128 -0
  164. package/studio/chunks/Popover-B63bkTMS.js.br +0 -0
  165. package/studio/chunks/Popover-B63bkTMS.js.gz +0 -0
  166. package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js +255 -0
  167. package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js.br +0 -0
  168. package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js.gz +0 -0
  169. package/studio/chunks/Routes-DLYHmulE.js +102 -0
  170. package/studio/chunks/Routes-DLYHmulE.js.br +0 -0
  171. package/studio/chunks/Routes-DLYHmulE.js.gz +0 -0
  172. package/studio/chunks/RovingFocusItem-QZNg-wWF.js +95 -0
  173. package/studio/chunks/RovingFocusItem-QZNg-wWF.js.br +0 -0
  174. package/studio/chunks/RovingFocusItem-QZNg-wWF.js.gz +0 -0
  175. package/studio/chunks/ScheduledPage-C0hqrkr5.js +332 -0
  176. package/studio/chunks/ScheduledPage-C0hqrkr5.js.br +0 -0
  177. package/studio/chunks/ScheduledPage-C0hqrkr5.js.gz +0 -0
  178. package/studio/chunks/Search-BEgCe9Aj.js +14646 -0
  179. package/studio/chunks/Search-BEgCe9Aj.js.br +0 -0
  180. package/studio/chunks/Search-BEgCe9Aj.js.gz +0 -0
  181. package/studio/chunks/Select-B50WZMW-.js +2145 -0
  182. package/studio/chunks/Select-B50WZMW-.js.br +0 -0
  183. package/studio/chunks/Select-B50WZMW-.js.gz +0 -0
  184. package/studio/chunks/SelectMenu-DSweWGMz.js +2109 -0
  185. package/studio/chunks/SelectMenu-DSweWGMz.js.br +0 -0
  186. package/studio/chunks/SelectMenu-DSweWGMz.js.gz +0 -0
  187. package/studio/chunks/SeoPage-CNNxGe4h.js +846 -0
  188. package/studio/chunks/SeoPage-CNNxGe4h.js.br +0 -0
  189. package/studio/chunks/SeoPage-CNNxGe4h.js.gz +0 -0
  190. package/studio/chunks/Skeleton-COz8dcrw.js +39 -0
  191. package/studio/chunks/Skeleton-COz8dcrw.js.br +2 -0
  192. package/studio/chunks/Skeleton-COz8dcrw.js.gz +0 -0
  193. package/studio/chunks/Slideover-QMMHAAys.js +289 -0
  194. package/studio/chunks/Slideover-QMMHAAys.js.br +0 -0
  195. package/studio/chunks/Slideover-QMMHAAys.js.gz +0 -0
  196. package/studio/chunks/StudioPage-ngEIDr5d.js +80 -0
  197. package/studio/chunks/StudioPage-ngEIDr5d.js.br +0 -0
  198. package/studio/chunks/StudioPage-ngEIDr5d.js.gz +0 -0
  199. package/studio/chunks/StudioPageToolbar-BwHnqyr6.js +2524 -0
  200. package/studio/chunks/StudioPageToolbar-BwHnqyr6.js.br +0 -0
  201. package/studio/chunks/StudioPageToolbar-BwHnqyr6.js.gz +0 -0
  202. package/studio/chunks/Switch-qKl1aDn7.js +484 -0
  203. package/studio/chunks/Switch-qKl1aDn7.js.br +0 -0
  204. package/studio/chunks/Switch-qKl1aDn7.js.gz +0 -0
  205. package/studio/chunks/ToolPage-DxoVAJVk.js +29 -0
  206. package/studio/chunks/ToolPage-DxoVAJVk.js.br +0 -0
  207. package/studio/chunks/ToolPage-DxoVAJVk.js.gz +0 -0
  208. package/studio/chunks/Tooltip-Bu15m_DB.js +693 -0
  209. package/studio/chunks/Tooltip-Bu15m_DB.js.br +0 -0
  210. package/studio/chunks/Tooltip-Bu15m_DB.js.gz +0 -0
  211. package/studio/chunks/TrashPage-lhqLLdoG.js +12 -0
  212. package/studio/chunks/TrashPage-lhqLLdoG.js.br +0 -0
  213. package/studio/chunks/TrashPage-lhqLLdoG.js.gz +0 -0
  214. package/studio/chunks/VersionsPage-Cqy6UAp9.js +2349 -0
  215. package/studio/chunks/VersionsPage-Cqy6UAp9.js.br +0 -0
  216. package/studio/chunks/VersionsPage-Cqy6UAp9.js.gz +0 -0
  217. package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js +113 -0
  218. package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js.br +0 -0
  219. package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js.gz +0 -0
  220. package/studio/chunks/arrays-CUJkmV4I.js +10 -0
  221. package/studio/chunks/arrays-CUJkmV4I.js.br +0 -0
  222. package/studio/chunks/arrays-CUJkmV4I.js.gz +0 -0
  223. package/studio/chunks/base-DkTekJe8.js +213 -0
  224. package/studio/chunks/base-DkTekJe8.js.br +0 -0
  225. package/studio/chunks/base-DkTekJe8.js.gz +0 -0
  226. package/studio/chunks/content-DUGl3N4d.js +6012 -0
  227. package/studio/chunks/content-DUGl3N4d.js.br +0 -0
  228. package/studio/chunks/content-DUGl3N4d.js.gz +0 -0
  229. package/studio/chunks/destinations-DPIQVQa6.js +227 -0
  230. package/studio/chunks/destinations-DPIQVQa6.js.br +0 -0
  231. package/studio/chunks/destinations-DPIQVQa6.js.gz +0 -0
  232. package/studio/chunks/en-073cjKW4.js +152 -0
  233. package/studio/chunks/en-073cjKW4.js.br +0 -0
  234. package/studio/chunks/en-073cjKW4.js.gz +0 -0
  235. package/studio/chunks/en-Bn8mxPuf.js +134 -0
  236. package/studio/chunks/en-Bn8mxPuf.js.br +0 -0
  237. package/studio/chunks/en-Bn8mxPuf.js.gz +0 -0
  238. package/studio/chunks/en-C9OiaUDZ.js +251 -0
  239. package/studio/chunks/en-C9OiaUDZ.js.br +0 -0
  240. package/studio/chunks/en-C9OiaUDZ.js.gz +0 -0
  241. package/studio/chunks/en-CHAR6jzx.js +147 -0
  242. package/studio/chunks/en-CHAR6jzx.js.br +0 -0
  243. package/studio/chunks/en-CHAR6jzx.js.gz +0 -0
  244. package/studio/chunks/en-Cq4N1vEF.js +93 -0
  245. package/studio/chunks/en-Cq4N1vEF.js.br +2 -0
  246. package/studio/chunks/en-Cq4N1vEF.js.gz +0 -0
  247. package/studio/chunks/en-D2hRqlse.js +140 -0
  248. package/studio/chunks/en-D2hRqlse.js.br +0 -0
  249. package/studio/chunks/en-D2hRqlse.js.gz +0 -0
  250. package/studio/chunks/en-DiUC3-j6.js +144 -0
  251. package/studio/chunks/en-DiUC3-j6.js.br +0 -0
  252. package/studio/chunks/en-DiUC3-j6.js.gz +0 -0
  253. package/studio/chunks/english-Cs_Adu-u.js +8 -0
  254. package/studio/chunks/english-Cs_Adu-u.js.br +0 -0
  255. package/studio/chunks/english-Cs_Adu-u.js.gz +0 -0
  256. package/studio/chunks/esm-D6DqSiL1.js +752 -0
  257. package/studio/chunks/esm-D6DqSiL1.js.br +0 -0
  258. package/studio/chunks/esm-D6DqSiL1.js.gz +0 -0
  259. package/studio/chunks/externalRequest-CTzr2nDq.js +23 -0
  260. package/studio/chunks/externalRequest-CTzr2nDq.js.br +0 -0
  261. package/studio/chunks/externalRequest-CTzr2nDq.js.gz +0 -0
  262. package/studio/chunks/iconify-DR9ryCPv.js +1007 -0
  263. package/studio/chunks/iconify-DR9ryCPv.js.br +0 -0
  264. package/studio/chunks/iconify-DR9ryCPv.js.gz +0 -0
  265. package/studio/chunks/icons-D2MsAaXq.js +183 -0
  266. package/studio/chunks/icons-D2MsAaXq.js.br +0 -0
  267. package/studio/chunks/icons-D2MsAaXq.js.gz +0 -0
  268. package/studio/chunks/leaveGuards-D22fTGgr.js +26 -0
  269. package/studio/chunks/leaveGuards-D22fTGgr.js.br +0 -0
  270. package/studio/chunks/leaveGuards-D22fTGgr.js.gz +0 -0
  271. package/studio/chunks/lucideIcons-EyqyPBsX.js +238 -0
  272. package/studio/chunks/lucideIcons-EyqyPBsX.js.br +0 -0
  273. package/studio/chunks/lucideIcons-EyqyPBsX.js.gz +0 -0
  274. package/studio/chunks/mediaRoute--8cY8rUe.js +17 -0
  275. package/studio/chunks/mediaRoute--8cY8rUe.js.br +0 -0
  276. package/studio/chunks/mediaRoute--8cY8rUe.js.gz +0 -0
  277. package/studio/chunks/newDocumentPlanning-C26DHpvh.js +77 -0
  278. package/studio/chunks/newDocumentPlanning-C26DHpvh.js.br +0 -0
  279. package/studio/chunks/newDocumentPlanning-C26DHpvh.js.gz +0 -0
  280. package/studio/chunks/notifications-OKOLc40v.js +110 -0
  281. package/studio/chunks/notifications-OKOLc40v.js.br +0 -0
  282. package/studio/chunks/notifications-OKOLc40v.js.gz +0 -0
  283. package/studio/chunks/operations-CjNHyrEX.js +57 -0
  284. package/studio/chunks/operations-CjNHyrEX.js.br +0 -0
  285. package/studio/chunks/operations-CjNHyrEX.js.gz +0 -0
  286. package/studio/chunks/overlay-DnqFLZTc.js +1733 -0
  287. package/studio/chunks/overlay-DnqFLZTc.js.br +0 -0
  288. package/studio/chunks/overlay-DnqFLZTc.js.gz +0 -0
  289. package/studio/chunks/presentation-DF83w0hE.js +57 -0
  290. package/studio/chunks/presentation-DF83w0hE.js.br +0 -0
  291. package/studio/chunks/presentation-DF83w0hE.js.gz +0 -0
  292. package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js +4557 -0
  293. package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js.br +0 -0
  294. package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js.gz +0 -0
  295. package/studio/chunks/searchPresentation-DFwxQkt3.js +76 -0
  296. package/studio/chunks/searchPresentation-DFwxQkt3.js.br +0 -0
  297. package/studio/chunks/searchPresentation-DFwxQkt3.js.gz +0 -0
  298. package/studio/chunks/status-DQv6ihkU.js +38 -0
  299. package/studio/chunks/status-DQv6ihkU.js.br +0 -0
  300. package/studio/chunks/status-DQv6ihkU.js.gz +0 -0
  301. package/studio/chunks/studioContext-I8HozGU1.js +4953 -0
  302. package/studio/chunks/studioContext-I8HozGU1.js.br +0 -0
  303. package/studio/chunks/studioContext-I8HozGU1.js.gz +0 -0
  304. package/studio/chunks/studioQueries-BR-9NT5F.js +73 -0
  305. package/studio/chunks/studioQueries-BR-9NT5F.js.br +0 -0
  306. package/studio/chunks/studioQueries-BR-9NT5F.js.gz +0 -0
  307. package/studio/chunks/studioSearch-ByaL-QpM.js +1095 -0
  308. package/studio/chunks/studioSearch-ByaL-QpM.js.br +0 -0
  309. package/studio/chunks/studioSearch-ByaL-QpM.js.gz +0 -0
  310. package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js +62 -0
  311. package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js.br +0 -0
  312. package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js.gz +0 -0
  313. package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js +189 -0
  314. package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js.br +0 -0
  315. package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js.gz +0 -0
  316. package/studio/chunks/useDocumentMessage-BAWvc38w.js +16 -0
  317. package/studio/chunks/useDocumentMessage-BAWvc38w.js.br +3 -0
  318. package/studio/chunks/useDocumentMessage-BAWvc38w.js.gz +0 -0
  319. package/studio/chunks/useFilter-DzyiTR7f.js +87 -0
  320. package/studio/chunks/useFilter-DzyiTR7f.js.br +0 -0
  321. package/studio/chunks/useFilter-DzyiTR7f.js.gz +0 -0
  322. package/studio/chunks/useFormControl-CL7sSCUo.js +8 -0
  323. package/studio/chunks/useFormControl-CL7sSCUo.js.br +0 -0
  324. package/studio/chunks/useFormControl-CL7sSCUo.js.gz +0 -0
  325. package/studio/chunks/useGraceArea-Chcy25IQ.js +154 -0
  326. package/studio/chunks/useGraceArea-Chcy25IQ.js.br +0 -0
  327. package/studio/chunks/useGraceArea-Chcy25IQ.js.gz +0 -0
  328. package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js +44 -0
  329. package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js.br +8 -0
  330. package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js.gz +0 -0
  331. package/studio/chunks/useLinkCopy-CMjQteCy.js +35 -0
  332. package/studio/chunks/useLinkCopy-CMjQteCy.js.br +0 -0
  333. package/studio/chunks/useLinkCopy-CMjQteCy.js.gz +0 -0
  334. package/studio/chunks/usePointerMotion-DwRcwBNQ.js +16 -0
  335. package/studio/chunks/usePointerMotion-DwRcwBNQ.js.br +0 -0
  336. package/studio/chunks/usePointerMotion-DwRcwBNQ.js.gz +0 -0
  337. package/studio/chunks/useStudioNavigation-CLwtSYpb.js +298 -0
  338. package/studio/chunks/useStudioNavigation-CLwtSYpb.js.br +0 -0
  339. package/studio/chunks/useStudioNavigation-CLwtSYpb.js.gz +0 -0
  340. package/studio/chunks/useStudioPages-DR9qmYLg.js +79 -0
  341. package/studio/chunks/useStudioPages-DR9qmYLg.js.br +0 -0
  342. package/studio/chunks/useStudioPages-DR9qmYLg.js.gz +0 -0
  343. package/studio/chunks/utils-mdScC0v0.js +59 -0
  344. package/studio/chunks/utils-mdScC0v0.js.br +0 -0
  345. package/studio/chunks/utils-mdScC0v0.js.gz +0 -0
  346. package/studio/chunks/virtualizer-D1S0bZ4t.js +781 -0
  347. package/studio/chunks/virtualizer-D1S0bZ4t.js.br +0 -0
  348. package/studio/chunks/virtualizer-D1S0bZ4t.js.gz +0 -0
  349. package/studio/help/64f767fe29c2-save-and-publish.svg +7 -0
  350. package/studio/host.css +1 -1
  351. package/studio/host.css.br +0 -0
  352. package/studio/host.css.gz +0 -0
  353. package/studio/host.js +8793 -39395
  354. package/studio/host.js.br +0 -0
  355. package/studio/host.js.gz +0 -0
  356. package/CHANGELOG.md +0 -14
  357. package/bin/cms.mjs +0 -2
  358. package/src/ApplicationTypes.d.ts +0 -84
  359. package/src/ApplicationTypes.js +0 -1
  360. package/src/Configuration-CMweD9bn.js +0 -1191
  361. package/src/Configuration-CMweD9bn.js.map +0 -1
  362. package/src/Configuration.d.ts +0 -82
  363. package/src/Configuration.js +0 -8
  364. package/src/Configuration.js.map +0 -1
  365. package/src/Content.d.ts +0 -68
  366. package/src/Content.js +0 -373
  367. package/src/Content.js.map +0 -1
  368. package/src/ContentTransfer-BxwswWn3.js +0 -86
  369. package/src/ContentTransfer-BxwswWn3.js.map +0 -1
  370. package/src/ContentTransfer-Z9FHyLez.d.ts +0 -72
  371. package/src/DocumentEngine-tYtwbBjr.js +0 -978
  372. package/src/DocumentEngine-tYtwbBjr.js.map +0 -1
  373. package/src/DocumentModel.d.ts +0 -52
  374. package/src/DocumentModel.js +0 -66
  375. package/src/DocumentModel.js.map +0 -1
  376. package/src/Forms-CX-hwmJF.js +0 -391
  377. package/src/Forms-CX-hwmJF.js.map +0 -1
  378. package/src/Forms-CfNPTiCr.js +0 -110
  379. package/src/Forms-CfNPTiCr.js.map +0 -1
  380. package/src/Forms-R0HoTR-o.d.ts +0 -92
  381. package/src/Forms.js.map +0 -1
  382. package/src/HttpPaths-Be3vshPJ.js +0 -20
  383. package/src/HttpPaths-Be3vshPJ.js.map +0 -1
  384. package/src/I18n-wxswIRyY.d.ts +0 -30
  385. package/src/Media-j1bTritO.js +0 -112
  386. package/src/Media-j1bTritO.js.map +0 -1
  387. package/src/Module.js.map +0 -1
  388. package/src/References-CCPDAPve.js +0 -45
  389. package/src/References-CCPDAPve.js.map +0 -1
  390. package/src/S3MediaObjects-BXfjaZOu.js +0 -2756
  391. package/src/S3MediaObjects-BXfjaZOu.js.map +0 -1
  392. package/src/Seo-402YumpT.d.ts +0 -198
  393. package/src/cli/content.js +0 -101
  394. package/src/cli/content.js.map +0 -1
  395. package/src/cli.js.map +0 -1
  396. package/src/connection-BP80q4d-.js +0 -92
  397. package/src/connection-BP80q4d-.js.map +0 -1
  398. package/src/dev-lifecycle-3I_pozUl.js +0 -535
  399. package/src/dev-lifecycle-3I_pozUl.js.map +0 -1
  400. package/src/installation-DxqSSVbH.js +0 -9105
  401. package/src/installation-DxqSSVbH.js.map +0 -1
  402. package/src/internal/application-types.js +0 -43
  403. package/src/internal/application-types.js.map +0 -1
  404. package/src/internal/authoring-catalog.js +0 -158
  405. package/src/internal/authoring-catalog.js.map +0 -1
  406. package/src/internal/authoring-compiler.js +0 -146
  407. package/src/internal/authoring-compiler.js.map +0 -1
  408. package/src/internal/authoring-metadata.js +0 -191
  409. package/src/internal/authoring-metadata.js.map +0 -1
  410. package/src/internal/cms-config.js +0 -45
  411. package/src/internal/cms-config.js.map +0 -1
  412. package/src/internal/configuration.js +0 -228
  413. package/src/internal/configuration.js.map +0 -1
  414. package/src/internal/dev-lifecycle.js +0 -3
  415. package/src/internal/diagnostics.js +0 -47
  416. package/src/internal/diagnostics.js.map +0 -1
  417. package/src/internal/document-model.js +0 -376
  418. package/src/internal/document-model.js.map +0 -1
  419. package/src/internal/field-metadata.js +0 -7
  420. package/src/internal/field-metadata.js.map +0 -1
  421. package/src/internal/form-capabilities.js +0 -12
  422. package/src/internal/form-capabilities.js.map +0 -1
  423. package/src/internal/i18n.js +0 -73
  424. package/src/internal/i18n.js.map +0 -1
  425. package/src/internal/studio-app.js +0 -68
  426. package/src/internal/studio-app.js.map +0 -1
  427. package/src/location-CMNGO3lU.js +0 -35
  428. package/src/location-CMNGO3lU.js.map +0 -1
  429. package/src/metadata-DN9_K6Yl.js +0 -201
  430. package/src/metadata-DN9_K6Yl.js.map +0 -1
  431. package/src/models-5j67LMqW.js +0 -131
  432. package/src/models-5j67LMqW.js.map +0 -1
  433. package/src/models-VmGmG19-.js +0 -628
  434. package/src/models-VmGmG19-.js.map +0 -1
  435. package/src/runtime/api.js.map +0 -1
  436. package/src/runtime/blocks.js +0 -30
  437. package/src/runtime/blocks.js.map +0 -1
  438. package/src/runtime/collaboration.js +0 -45
  439. package/src/runtime/collaboration.js.map +0 -1
  440. package/src/runtime/delivery/DocumentField.js +0 -23
  441. package/src/runtime/delivery/DocumentField.js.map +0 -1
  442. package/src/runtime/delivery/DocumentRenderer.js +0 -61
  443. package/src/runtime/delivery/DocumentRenderer.js.map +0 -1
  444. package/src/runtime/delivery/DocumentScope.js +0 -41
  445. package/src/runtime/delivery/DocumentScope.js.map +0 -1
  446. package/src/runtime/delivery/blocks.js +0 -8
  447. package/src/runtime/delivery/blocks.js.map +0 -1
  448. package/src/runtime/delivery/context.js +0 -12
  449. package/src/runtime/delivery/context.js.map +0 -1
  450. package/src/runtime/delivery/document-page.js +0 -21
  451. package/src/runtime/delivery/document-page.js.map +0 -1
  452. package/src/runtime/delivery/document.js +0 -43
  453. package/src/runtime/delivery/document.js.map +0 -1
  454. package/src/runtime/delivery/error.js +0 -11
  455. package/src/runtime/delivery/error.js.map +0 -1
  456. package/src/runtime/delivery/plugin.js +0 -104
  457. package/src/runtime/delivery/plugin.js.map +0 -1
  458. package/src/runtime/delivery/preview.d.ts +0 -11
  459. package/src/runtime/delivery/preview.js +0 -6
  460. package/src/runtime/delivery/preview.js.map +0 -1
  461. package/src/runtime/delivery/types.d.ts +0 -2
  462. package/src/runtime/delivery/types.js +0 -1
  463. package/src/runtime/delivery/useCmsDocumentSeo.d.ts +0 -67
  464. package/src/runtime/delivery/useCmsDocumentSeo.js.map +0 -1
  465. package/src/runtime/delivery/useDocument.d.ts +0 -6
  466. package/src/runtime/delivery/useDocument.js +0 -23
  467. package/src/runtime/delivery/useDocument.js.map +0 -1
  468. package/src/runtime/delivery/useDocumentQuery.d.ts +0 -7
  469. package/src/runtime/delivery/useDocumentQuery.js +0 -29
  470. package/src/runtime/delivery/useDocumentQuery.js.map +0 -1
  471. package/src/runtime/forms/document.js +0 -38
  472. package/src/runtime/forms/document.js.map +0 -1
  473. package/src/runtime/forms/useCmsForm.js +0 -257
  474. package/src/runtime/forms/useCmsForm.js.map +0 -1
  475. package/src/runtime/i18n/translator.js +0 -58
  476. package/src/runtime/i18n/translator.js.map +0 -1
  477. package/src/runtime/i18n/useCmsI18n.d.ts +0 -13
  478. package/src/runtime/i18n/useCmsI18n.js +0 -38
  479. package/src/runtime/i18n/useCmsI18n.js.map +0 -1
  480. package/src/runtime/installation.js +0 -3
  481. package/src/runtime/plugin.js.map +0 -1
  482. package/src/runtime/preview/CmsStudioPreviewMarker.js +0 -29
  483. package/src/runtime/preview/CmsStudioPreviewMarker.js.map +0 -1
  484. package/src/runtime/preview/comark-document.js +0 -37
  485. package/src/runtime/preview/comark-document.js.map +0 -1
  486. package/src/runtime/preview/connection.js +0 -3
  487. package/src/runtime/preview/controller.js +0 -265
  488. package/src/runtime/preview/controller.js.map +0 -1
  489. package/src/runtime/preview/crypto.js +0 -16
  490. package/src/runtime/preview/crypto.js.map +0 -1
  491. package/src/runtime/preview/overlay.js +0 -122
  492. package/src/runtime/preview/overlay.js.map +0 -1
  493. package/src/runtime/preview/plugin.client.js +0 -68
  494. package/src/runtime/preview/plugin.client.js.map +0 -1
  495. package/src/runtime/preview/preview.css +0 -91
  496. package/src/runtime/preview/protocol.d.ts +0 -16
  497. package/src/runtime/preview/protocol.js +0 -23
  498. package/src/runtime/preview/protocol.js.map +0 -1
  499. package/src/runtime/preview/regions.js +0 -142
  500. package/src/runtime/preview/regions.js.map +0 -1
  501. package/src/runtime/preview/store.js +0 -4
  502. package/src/runtime/sitemap-entries.js +0 -17
  503. package/src/runtime/sitemap-entries.js.map +0 -1
  504. package/src/runtime/sitemap.js +0 -23
  505. package/src/runtime/sitemap.js.map +0 -1
  506. package/src/runtime/studio-app.js +0 -17
  507. package/src/runtime/studio-app.js.map +0 -1
  508. package/src/runtime/studio-document.js +0 -46
  509. package/src/runtime/studio-document.js.map +0 -1
  510. package/src/runtime/studio-entry.js +0 -19
  511. package/src/runtime/studio-entry.js.map +0 -1
  512. package/src/runtime/studio-navigation.js +0 -11
  513. package/src/runtime/studio-navigation.js.map +0 -1
  514. package/src/scalars-CA6kyipS.d.ts +0 -7
  515. package/src/scalars-CVZqT3L0.js +0 -22
  516. package/src/scalars-CVZqT3L0.js.map +0 -1
  517. package/src/store-X1e1o_MF.js +0 -209
  518. package/src/store-X1e1o_MF.js.map +0 -1
  519. package/src/types-DZ0IV-Ow.d.ts +0 -101
  520. package/studio/CreateDocumentDialog-C4_JBo1w.js +0 -335
  521. package/studio/SelectMenu-wXqxymUw.js +0 -34045
  522. package/studio/collaboration-DcK2F6v9.js +0 -4566
  523. package/studio/editor-P2rB7Csp.js +0 -30128
  524. package/studio/rolldown-runtime-Dy4uBu1J.js +0 -11
package/src/Content.js DELETED
@@ -1,373 +0,0 @@
1
- import { c as DocumentIdentity, p as DocumentPlacement } from "./models-VmGmG19-.js";
2
- import { a as ContentSnapshot, i as ContentPlan, n as ContentApplyResult, o as ContentSnapshotSource, p as DocumentValidationFailed, r as ContentFilePath, s as ContentSource } from "./ContentTransfer-BxwswWn3.js";
3
- import { t as CMS_AUTHENTICATION_PATH, u as STUDIO_API_PATH } from "./HttpPaths-Be3vshPJ.js";
4
- import { Effect, Encoding, Result, Schema } from "effect";
5
- import { NodeCrypto } from "@effect/platform-node-shared";
6
- import { lstat, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
7
- import { dirname, extname, relative, resolve, sep } from "node:path";
8
-
9
- //#region src/Content.ts
10
- var CmsContentError = class extends Error {
11
- code;
12
- conflicts;
13
- issues;
14
- constructor(code, message, options = {}) {
15
- super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
16
- this.name = "CmsContentError";
17
- this.code = code;
18
- this.conflicts = options.conflicts;
19
- this.issues = options.issues;
20
- }
21
- };
22
- const plans = /* @__PURE__ */ new WeakMap();
23
- function createCmsContentClient(options) {
24
- const baseUrl = contentBaseUrl(options.baseUrl);
25
- const requestFetch = options.fetch ?? globalThis.fetch;
26
- const identity = {};
27
- let cookie;
28
- const authenticate = async () => {
29
- if (cookie) return cookie;
30
- cookie = request(requestFetch, new URL(`${CMS_AUTHENTICATION_PATH}/sign-in/email`, baseUrl), {
31
- method: "POST",
32
- headers: {
33
- accept: "application/json",
34
- "content-type": "application/json",
35
- origin: baseUrl.origin
36
- },
37
- body: JSON.stringify(options.credentials)
38
- }).then(async (response) => {
39
- if (!response.ok) throw new CmsContentError("authentication-required", `CMS sign-in failed (${response.status}).`);
40
- const value = response.headers.get("set-cookie")?.split(";", 1)[0];
41
- if (!value) throw new CmsContentError("authentication-required", "CMS sign-in did not return a session cookie.");
42
- return value;
43
- });
44
- return cookie;
45
- };
46
- const contentRequest = async (path, schema, label, body) => {
47
- const session = await authenticate();
48
- const response = await request(requestFetch, new URL(`${STUDIO_API_PATH}/content/${path}`, baseUrl), {
49
- method: body === void 0 ? "GET" : "POST",
50
- headers: {
51
- accept: "application/json",
52
- cookie: session,
53
- ...body === void 0 ? void 0 : { "content-type": "application/json" }
54
- },
55
- ...body === void 0 ? void 0 : { body: JSON.stringify(body) }
56
- });
57
- if (!response.ok) {
58
- if (response.status === 401 || response.status === 403) throw new CmsContentError("authentication-required", `CMS content request was rejected (${response.status}).`);
59
- if (response.status === 409) throw new CmsContentError("generation-changed", "The CMS changed after this content plan was created.");
60
- if (response.status === 422) {
61
- const failure = await decodeResponse(response, DocumentValidationFailed, "document validation failure");
62
- throw new CmsContentError("invalid-document", "The CMS rejected an invalid document.", { issues: failure.issues });
63
- }
64
- throw new CmsContentError("network-error", `CMS content request failed (${response.status}).`);
65
- }
66
- return decodeResponse(response, schema, label);
67
- };
68
- const snapshot = async () => contentRequest("snapshot", ContentSnapshot, "content snapshot");
69
- return {
70
- plan: async (source, authoredOptions = {}) => {
71
- const sources = Object.freeze(source.sources.map((entry) => Object.freeze(ContentSource.make({
72
- filePath: entry.filePath,
73
- ...entry.identity === void 0 ? void 0 : { identity: entry.identity },
74
- markdown: entry.markdown,
75
- ...entry.placement === void 0 ? void 0 : { placement: entry.placement },
76
- published: entry.published
77
- }))));
78
- const input = Object.freeze({
79
- sources,
80
- overwrite: authoredOptions.overwrite ?? false,
81
- publish: authoredOptions.publish ?? false
82
- });
83
- const [protocol, current] = await Promise.all([contentRequest("plan", ContentPlan, "content plan", input), snapshot()]);
84
- const documentIds = new Set(sources.flatMap((entry) => entry.identity ? [entry.identity.documentId] : []));
85
- const entries = (action) => protocol.entries.filter((entry) => entry.action === action);
86
- const plan = Object.freeze({
87
- generation: protocol.generation,
88
- creates: entries("create"),
89
- updates: entries("update"),
90
- publications: entries("publish"),
91
- unpublications: entries("unpublish"),
92
- conflicts: entries("conflict"),
93
- unchanged: entries("unchanged"),
94
- issues: protocol.issues,
95
- targetOnly: current.sources.filter((entry) => !documentIds.has(entry.identity.documentId)),
96
- valid: protocol.valid
97
- });
98
- plans.set(plan, {
99
- client: identity,
100
- input,
101
- protocol
102
- });
103
- return plan;
104
- },
105
- apply: async (plan) => {
106
- const state = plans.get(plan);
107
- if (!state || state.client !== identity) throw new CmsContentError("content-conflict", "This content plan was not created by this client.");
108
- if (!plan.valid) throw new CmsContentError("content-conflict", "The content plan is not valid.", {
109
- conflicts: plan.conflicts,
110
- issues: plan.issues
111
- });
112
- if (plan.conflicts.length) throw new CmsContentError("content-conflict", "The content plan contains conflicts.", { conflicts: plan.conflicts });
113
- if (plan.issues.length) throw new CmsContentError("invalid-document", "The content plan contains invalid documents.", { issues: plan.issues });
114
- return contentRequest("apply", ContentApplyResult, "content apply result", {
115
- ...state.input,
116
- expectedGeneration: state.protocol.generation
117
- });
118
- },
119
- diff: async (source) => diffSources(source.sources, (await snapshot()).sources),
120
- export: async ({ directory }) => {
121
- return writeContentDirectory(directory, (await snapshot()).sources);
122
- },
123
- readDocument: async (documentId) => {
124
- const document = (await snapshot()).sources.find((source) => source.identity.documentId === documentId);
125
- if (!document) throw new CmsContentError("document-not-found", `CMS document ${documentId} was not found.`);
126
- return document;
127
- }
128
- };
129
- }
130
- async function readCmsContentDirectory(directory) {
131
- try {
132
- const root = resolve(directory);
133
- const indexPath = await safeContentFile(root, ".cms-content.json");
134
- let index;
135
- try {
136
- index = parseIndex(await readFile(indexPath, "utf8"));
137
- } catch (cause) {
138
- if (!isMissingFile(cause)) throw cause;
139
- }
140
- if (index) return { sources: await Promise.all(index.sources.map(async (entry) => decode(ContentSource, {
141
- filePath: entry.filePath,
142
- identity: entry.identity,
143
- markdown: await readFile(await safeContentFile(root, entry.filePath), "utf8"),
144
- placement: entry.placement,
145
- published: entry.published,
146
- revisionId: entry.revisionId
147
- }, "content source"))) };
148
- const files = await markdownFiles(root);
149
- if (!files.length) throw new CmsContentError("filesystem-error", `No Markdown files found in ${root}.`);
150
- return { sources: await Promise.all(files.map(async (file) => decode(ContentSource, {
151
- filePath: relative(root, file).replaceAll("\\", "/"),
152
- markdown: await readFile(file, "utf8"),
153
- published: true
154
- }, "content source"))) };
155
- } catch (cause) {
156
- if (cause instanceof CmsContentError) throw cause;
157
- throw new CmsContentError("filesystem-error", `Could not read CMS content from ${directory}.`, { cause });
158
- }
159
- }
160
- function diffCmsContentSources(local, target) {
161
- return diffSources(local, target);
162
- }
163
- const ContentHash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u));
164
- const ContentIndexEntry = Schema.Struct({
165
- filePath: ContentSource.fields.filePath,
166
- identity: DocumentIdentity,
167
- placement: DocumentPlacement,
168
- published: Schema.Boolean,
169
- revisionId: ContentSnapshotSource.fields.revisionId,
170
- sha256: ContentHash
171
- });
172
- const ContentIndex = Schema.Struct({
173
- version: Schema.Literal(2),
174
- sources: Schema.Array(ContentIndexEntry),
175
- exportSha256: ContentHash
176
- });
177
- async function writeContentDirectory(directory, sources) {
178
- try {
179
- const root = resolve(directory);
180
- const indexPath = await safeContentFile(root, ".cms-content.json");
181
- let previous;
182
- try {
183
- previous = parseIndex(await readFile(indexPath, "utf8"));
184
- } catch (cause) {
185
- if (!isMissingFile(cause)) throw cause;
186
- }
187
- const previousById = new Map(previous?.sources.map((entry) => [entry.identity.documentId, entry]));
188
- const paths = exportPaths(sources, previousById);
189
- if (previous) {
190
- const metadata = {
191
- version: previous.version,
192
- sources: previous.sources
193
- };
194
- if (sha256(JSON.stringify(metadata)) !== previous.exportSha256) throw new CmsContentError("filesystem-error", "The local .cms-content.json file has been edited.");
195
- const incomingIds = new Set(sources.map((source) => source.identity.documentId));
196
- for (const entry of previous.sources) if (!incomingIds.has(entry.identity.documentId)) throw new CmsContentError("filesystem-error", `CMS document ${entry.filePath} no longer exists; resolve the local file before exporting again.`);
197
- }
198
- for (const source of sources) {
199
- const filePath = paths.get(source.identity.documentId);
200
- if (!filePath) throw new CmsContentError("filesystem-error", `Could not allocate an export path for ${source.identity.documentId}.`);
201
- try {
202
- const local = await readFile(await safeContentFile(root, filePath), "utf8");
203
- const before = previousById.get(source.identity.documentId);
204
- if (before ? sha256(local) !== before.sha256 : local !== source.markdown) throw new CmsContentError("filesystem-error", `Local edits in ${filePath}; export was stopped.`);
205
- } catch (cause) {
206
- if (!isMissingFile(cause)) throw cause;
207
- }
208
- }
209
- await mkdir(root, { recursive: true });
210
- const entries = [];
211
- for (const source of sources) {
212
- const filePath = paths.get(source.identity.documentId);
213
- if (!filePath) throw new CmsContentError("filesystem-error", `Could not allocate an export path for ${source.identity.documentId}.`);
214
- const file = await safeContentFile(root, filePath);
215
- await mkdir(dirname(file), { recursive: true });
216
- await safeContentFile(root, filePath);
217
- await writeFile(file, source.markdown);
218
- entries.push({
219
- filePath,
220
- identity: source.identity,
221
- placement: source.placement,
222
- published: source.published,
223
- revisionId: source.revisionId,
224
- sha256: sha256(source.markdown)
225
- });
226
- }
227
- const metadata = {
228
- version: 2,
229
- sources: entries
230
- };
231
- const index = {
232
- ...metadata,
233
- exportSha256: sha256(JSON.stringify(metadata))
234
- };
235
- await safeContentFile(root, ".cms-content.json");
236
- await writeFile(indexPath, `${JSON.stringify(index, void 0, 2)}\n`);
237
- return { sources: sources.map((source) => ContentSource.make({
238
- filePath: paths.get(source.identity.documentId),
239
- identity: source.identity,
240
- markdown: source.markdown,
241
- placement: source.placement,
242
- published: source.published,
243
- revisionId: source.revisionId
244
- })) };
245
- } catch (cause) {
246
- throw new CmsContentError("filesystem-error", `Could not export CMS content to ${directory}.`, { cause });
247
- }
248
- }
249
- function diffSources(local, target) {
250
- const targetById = new Map(target.flatMap((source) => source.identity ? [[source.identity.documentId, source]] : []));
251
- const targetByFile = new Map(target.flatMap((source) => "filePath" in source ? [[source.filePath, source]] : []));
252
- const localIds = new Set(local.flatMap((source) => source.identity ? [source.identity.documentId] : []));
253
- const localFiles = new Set(local.map((source) => source.filePath));
254
- return {
255
- changes: local.flatMap((source) => {
256
- const current = source.identity ? targetById.get(source.identity.documentId) : targetByFile.get(source.filePath);
257
- const markdownChanged = current?.markdown !== source.markdown;
258
- const publicationChanged = current !== void 0 && current.published !== source.published;
259
- return markdownChanged || publicationChanged ? [{
260
- filePath: source.filePath,
261
- local: source,
262
- target: current,
263
- markdownChanged,
264
- publicationChanged
265
- }] : [];
266
- }),
267
- targetOnly: target.filter((source) => source.identity ? !localIds.has(source.identity.documentId) : "filePath" in source && !localFiles.has(source.filePath))
268
- };
269
- }
270
- function exportPaths(sources, previous) {
271
- const byId = new Map(sources.map((source) => [source.identity.documentId, source]));
272
- const allocated = /* @__PURE__ */ new Set();
273
- const result = /* @__PURE__ */ new Map();
274
- const segmentsFor = (source, visited = /* @__PURE__ */ new Set()) => {
275
- if (source.placement.kind === "home") return [];
276
- if (visited.has(source.identity.documentId)) return [source.placement.slug];
277
- const parent = byId.get(source.placement.parentDocumentId);
278
- return parent ? [...segmentsFor(parent, /* @__PURE__ */ new Set([...visited, source.identity.documentId])), source.placement.slug] : [source.placement.slug];
279
- };
280
- for (const source of sources) {
281
- const retained = previous.get(source.identity.documentId)?.filePath;
282
- const base = [source.identity.collection, ...source.identity.locale ? [source.identity.locale] : []];
283
- const placement = segmentsFor(source);
284
- const generated = source.placement.kind === "home" ? [...base, "index.md"].join("/") : [
285
- ...base,
286
- ...placement.slice(0, -1),
287
- `${placement.at(-1) ?? "document"}.md`
288
- ].join("/");
289
- let candidate = retained ?? ContentFilePath.make(generated);
290
- if (allocated.has(candidate)) candidate = ContentFilePath.make(generated.replace(/\.md$/u, `-${source.identity.documentId.slice(0, 8)}.md`));
291
- allocated.add(candidate);
292
- result.set(source.identity.documentId, candidate);
293
- }
294
- return result;
295
- }
296
- async function markdownFiles(directory) {
297
- const entries = await readdir(directory, { withFileTypes: true });
298
- return (await Promise.all(entries.map(async (entry) => {
299
- const path = resolve(directory, entry.name);
300
- if (entry.isDirectory()) return markdownFiles(path);
301
- return entry.isFile() && [".md", ".mdc"].includes(extname(path)) ? [path] : [];
302
- }))).flat().sort((left, right) => left.localeCompare(right));
303
- }
304
- function safeContentPath(root, filePath) {
305
- const path = resolve(root, filePath);
306
- if (!path.startsWith(`${root}${sep}`)) throw new CmsContentError("filesystem-error", `Unsafe content path: ${filePath}`);
307
- return path;
308
- }
309
- async function safeContentFile(root, filePath) {
310
- const path = safeContentPath(root, filePath);
311
- const segments = relative(root, path).split(sep);
312
- let current = root;
313
- for (const segment of ["", ...segments]) {
314
- current = segment ? resolve(current, segment) : current;
315
- try {
316
- if ((await lstat(current)).isSymbolicLink()) throw new CmsContentError("filesystem-error", `Symlinks are not allowed in CMS content paths: ${filePath}`);
317
- } catch (cause) {
318
- if (!isMissingFile(cause)) throw cause;
319
- }
320
- }
321
- return path;
322
- }
323
- function contentBaseUrl(value) {
324
- let url;
325
- try {
326
- url = new URL(value);
327
- } catch (cause) {
328
- throw new CmsContentError("network-error", "CMS baseUrl is invalid.", { cause });
329
- }
330
- if (url.username || url.password || url.search || url.hash) throw new CmsContentError("network-error", "CMS baseUrl must be an origin without credentials, query, or fragment.");
331
- if (url.protocol !== "https:" && !(url.protocol === "http:" && [
332
- "localhost",
333
- "127.0.0.1",
334
- "[::1]"
335
- ].includes(url.hostname))) throw new CmsContentError("network-error", "Use HTTPS for CMS credentials; HTTP is allowed only on localhost.");
336
- return new URL(url.origin);
337
- }
338
- async function request(fetch, input, init) {
339
- try {
340
- return await fetch(input, init);
341
- } catch (cause) {
342
- throw new CmsContentError("network-error", `Could not reach ${input.origin}.`, { cause });
343
- }
344
- }
345
- async function decodeResponse(response, schema, label) {
346
- try {
347
- return decode(schema, await response.json(), label);
348
- } catch (cause) {
349
- if (cause instanceof CmsContentError) throw cause;
350
- throw new CmsContentError("invalid-response", "CMS returned an invalid JSON response.", { cause });
351
- }
352
- }
353
- function decode(schema, value, label) {
354
- const decoded = Schema.decodeUnknownResult(schema)(value);
355
- if (Result.isFailure(decoded)) throw new CmsContentError("invalid-response", `CMS returned an invalid ${label}.`, { cause: decoded.failure });
356
- return decoded.success;
357
- }
358
- function sha256(value) {
359
- return Encoding.encodeHex(Effect.runSync(NodeCrypto.make.digest("SHA-256", new TextEncoder().encode(value)).pipe(Effect.orDie)));
360
- }
361
- function parseIndex(value) {
362
- const decoded = Schema.decodeUnknownResult(ContentIndex)(JSON.parse(value));
363
- if (Result.isFailure(decoded)) throw new CmsContentError("filesystem-error", "The .cms-content.json index is invalid.");
364
- if (new Set(decoded.success.sources.map((entry) => entry.filePath)).size !== decoded.success.sources.length) throw new CmsContentError("filesystem-error", "The .cms-content.json index contains duplicate file paths.");
365
- return decoded.success;
366
- }
367
- function isMissingFile(cause) {
368
- return cause instanceof Error && "code" in cause && cause.code === "ENOENT";
369
- }
370
-
371
- //#endregion
372
- export { CmsContentError, createCmsContentClient, diffCmsContentSources, readCmsContentDirectory };
373
- //# sourceMappingURL=Content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Content.js","names":["ContentSnapshotSchema","ContentSourceSchema","ProtocolContentPlanSchema","ContentApplyResultSchema","ContentSnapshotSourceSchema"],"sources":["../../../src/Content.ts"],"sourcesContent":["/* oxlint-disable effecttsgo/async-function effecttsgo/extends-native-error effecttsgo/node-builtin-import -- This public Node-only API deliberately exposes Promises, native filesystem paths, and an Error subclass to ordinary deployment scripts. */\nimport type {\n ContentApplyResult,\n ContentPlan as ProtocolContentPlan,\n ContentPlanEntry,\n ContentSnapshotSource,\n ContentSource,\n ContentSnapshot,\n} from '@internal/protocol/ContentTransfer'\nimport {\n ContentApplyResult as ContentApplyResultSchema,\n ContentFilePath,\n ContentPlan as ProtocolContentPlanSchema,\n ContentSnapshotSource as ContentSnapshotSourceSchema,\n ContentSource as ContentSourceSchema,\n ContentSnapshot as ContentSnapshotSchema,\n} from '@internal/protocol/ContentTransfer'\nimport type { DocumentIssue } from '@internal/protocol/Documents'\nimport { DocumentIdentity, DocumentPlacement, DocumentValidationFailed } from '@internal/protocol/Documents'\nimport { CMS_AUTHENTICATION_PATH, STUDIO_API_PATH } from '@internal/protocol/HttpPaths'\nimport { NodeCrypto } from '@effect/platform-node-shared'\nimport { Effect, Encoding, Result, Schema } from 'effect'\nimport { lstat, readdir, readFile, mkdir, writeFile } from 'node:fs/promises'\nimport { dirname, extname, relative, resolve, sep } from 'node:path'\n\nexport type CmsContentErrorCode =\n | 'authentication-required'\n | 'content-conflict'\n | 'filesystem-error'\n | 'generation-changed'\n | 'invalid-document'\n | 'document-not-found'\n | 'invalid-response'\n | 'network-error'\n\nexport class CmsContentError extends Error {\n readonly code: CmsContentErrorCode\n readonly conflicts?: ReadonlyArray<CmsContentPlanEntry>\n readonly issues?: ReadonlyArray<DocumentIssue>\n\n constructor(\n code: CmsContentErrorCode,\n message: string,\n options: {\n readonly cause?: unknown\n readonly conflicts?: ReadonlyArray<CmsContentPlanEntry>\n readonly issues?: ReadonlyArray<DocumentIssue>\n } = {},\n ) {\n super(message, options.cause === undefined ? undefined : { cause: options.cause })\n this.name = 'CmsContentError'\n this.code = code\n this.conflicts = options.conflicts\n this.issues = options.issues\n }\n}\n\nexport interface CmsContentCredentials {\n readonly email: string\n readonly password: string\n}\n\nexport interface CmsContentClientOptions {\n readonly baseUrl: string\n readonly credentials: CmsContentCredentials\n readonly fetch?: typeof globalThis.fetch\n}\n\nexport interface CmsContentSourceSet {\n readonly sources: ReadonlyArray<ContentSource>\n}\n\nexport interface CmsContentDocument extends ContentSnapshotSource {}\n\nexport interface CmsContentPlanEntry extends ContentPlanEntry {}\n\nexport interface CmsContentPlan {\n readonly generation: string\n readonly creates: ReadonlyArray<CmsContentPlanEntry>\n readonly updates: ReadonlyArray<CmsContentPlanEntry>\n readonly publications: ReadonlyArray<CmsContentPlanEntry>\n readonly unpublications: ReadonlyArray<CmsContentPlanEntry>\n readonly conflicts: ReadonlyArray<CmsContentPlanEntry>\n readonly unchanged: ReadonlyArray<CmsContentPlanEntry>\n readonly issues: ReadonlyArray<DocumentIssue>\n readonly targetOnly: ReadonlyArray<ContentSnapshotSource>\n readonly valid: boolean\n}\n\nexport interface CmsContentImportOptions {\n readonly overwrite?: boolean\n readonly publish?: boolean\n}\n\nexport interface CmsContentDiff {\n readonly changes: ReadonlyArray<{\n readonly filePath: string\n readonly local?: ContentSource\n readonly target?: ContentSource | ContentSnapshotSource\n readonly markdownChanged: boolean\n readonly publicationChanged: boolean\n }>\n readonly targetOnly: ReadonlyArray<ContentSource | ContentSnapshotSource>\n}\n\nexport interface CmsContentClient {\n readonly plan: (source: CmsContentSourceSet, options?: CmsContentImportOptions) => Promise<CmsContentPlan>\n readonly apply: (plan: CmsContentPlan) => Promise<ContentApplyResult>\n readonly diff: (source: CmsContentSourceSet) => Promise<CmsContentDiff>\n readonly export: (options: { readonly directory: string }) => Promise<CmsContentSourceSet>\n readonly readDocument: (documentId: string) => Promise<CmsContentDocument>\n}\n\ninterface PlanState {\n readonly client: object\n readonly input: {\n readonly sources: ReadonlyArray<ContentSource>\n readonly overwrite: boolean\n readonly publish: boolean\n }\n readonly protocol: ProtocolContentPlan\n}\n\ntype CmsContentRequestBody =\n | PlanState['input']\n | (PlanState['input'] & { readonly expectedGeneration: ProtocolContentPlan['generation'] })\n\nconst plans = new WeakMap<CmsContentPlan, PlanState>()\n\nexport function createCmsContentClient(options: CmsContentClientOptions): CmsContentClient {\n const baseUrl = contentBaseUrl(options.baseUrl)\n const requestFetch = options.fetch ?? globalThis.fetch\n const identity = {}\n let cookie: Promise<string> | undefined\n\n const authenticate = async (): Promise<string> => {\n if (cookie) return cookie\n\n cookie = request(requestFetch, new URL(`${CMS_AUTHENTICATION_PATH}/sign-in/email`, baseUrl), {\n method: 'POST',\n headers: { accept: 'application/json', 'content-type': 'application/json', origin: baseUrl.origin },\n body: JSON.stringify(options.credentials),\n }).then(async (response) => {\n if (!response.ok) throw new CmsContentError('authentication-required', `CMS sign-in failed (${response.status}).`)\n const value = response.headers.get('set-cookie')?.split(';', 1)[0]\n\n if (!value) throw new CmsContentError('authentication-required', 'CMS sign-in did not return a session cookie.')\n\n return value\n })\n\n return cookie\n }\n\n const contentRequest = async <SchemaType extends Schema.ConstraintDecoder<unknown>>(\n path: string,\n schema: SchemaType,\n label: string,\n body?: CmsContentRequestBody,\n ): Promise<SchemaType['Type']> => {\n const session = await authenticate()\n\n const response = await request(requestFetch, new URL(`${STUDIO_API_PATH}/content/${path}`, baseUrl), {\n method: body === undefined ? 'GET' : 'POST',\n headers: {\n accept: 'application/json',\n cookie: session,\n ...(body === undefined ? undefined : { 'content-type': 'application/json' }),\n },\n ...(body === undefined ? undefined : { body: JSON.stringify(body) }),\n })\n\n if (!response.ok) {\n if (response.status === 401 || response.status === 403)\n throw new CmsContentError('authentication-required', `CMS content request was rejected (${response.status}).`)\n\n if (response.status === 409)\n throw new CmsContentError('generation-changed', 'The CMS changed after this content plan was created.')\n\n if (response.status === 422) {\n const failure = await decodeResponse(response, DocumentValidationFailed, 'document validation failure')\n\n throw new CmsContentError('invalid-document', 'The CMS rejected an invalid document.', {\n issues: failure.issues,\n })\n }\n\n throw new CmsContentError('network-error', `CMS content request failed (${response.status}).`)\n }\n\n return decodeResponse(response, schema, label)\n }\n\n const snapshot = async (): Promise<ContentSnapshot> =>\n contentRequest('snapshot', ContentSnapshotSchema, 'content snapshot')\n\n const client: CmsContentClient = {\n plan: async (source, authoredOptions = {}) => {\n const sources = Object.freeze(\n source.sources.map((entry) =>\n Object.freeze(\n ContentSourceSchema.make({\n filePath: entry.filePath,\n ...(entry.identity === undefined ? undefined : { identity: entry.identity }),\n markdown: entry.markdown,\n ...(entry.placement === undefined ? undefined : { placement: entry.placement }),\n published: entry.published,\n }),\n ),\n ),\n )\n\n const input = Object.freeze({\n sources,\n overwrite: authoredOptions.overwrite ?? false,\n publish: authoredOptions.publish ?? false,\n })\n\n const [protocol, current] = await Promise.all([\n contentRequest('plan', ProtocolContentPlanSchema, 'content plan', input),\n snapshot(),\n ])\n\n const documentIds = new Set(sources.flatMap((entry) => (entry.identity ? [entry.identity.documentId] : [])))\n\n const entries = (action: ContentPlanEntry['action']) =>\n protocol.entries.filter((entry) => entry.action === action)\n\n const plan: CmsContentPlan = Object.freeze({\n generation: protocol.generation,\n creates: entries('create'),\n updates: entries('update'),\n publications: entries('publish'),\n unpublications: entries('unpublish'),\n conflicts: entries('conflict'),\n unchanged: entries('unchanged'),\n issues: protocol.issues,\n targetOnly: current.sources.filter((entry) => !documentIds.has(entry.identity.documentId)),\n valid: protocol.valid,\n })\n\n plans.set(plan, { client: identity, input, protocol })\n\n return plan\n },\n apply: async (plan) => {\n const state = plans.get(plan)\n\n if (!state || state.client !== identity)\n throw new CmsContentError('content-conflict', 'This content plan was not created by this client.')\n\n if (!plan.valid)\n throw new CmsContentError('content-conflict', 'The content plan is not valid.', {\n conflicts: plan.conflicts,\n issues: plan.issues,\n })\n\n if (plan.conflicts.length)\n throw new CmsContentError('content-conflict', 'The content plan contains conflicts.', {\n conflicts: plan.conflicts,\n })\n\n if (plan.issues.length)\n throw new CmsContentError('invalid-document', 'The content plan contains invalid documents.', {\n issues: plan.issues,\n })\n\n return contentRequest('apply', ContentApplyResultSchema, 'content apply result', {\n ...state.input,\n expectedGeneration: state.protocol.generation,\n })\n },\n diff: async (source) => diffSources(source.sources, (await snapshot()).sources),\n export: async ({ directory }) => {\n const value = await snapshot()\n\n return writeContentDirectory(directory, value.sources)\n },\n readDocument: async (documentId) => {\n const document = (await snapshot()).sources.find((source) => source.identity.documentId === documentId)\n\n if (!document) throw new CmsContentError('document-not-found', `CMS document ${documentId} was not found.`)\n\n return document\n },\n }\n\n return client\n}\n\nexport async function readCmsContentDirectory(directory: string): Promise<CmsContentSourceSet> {\n try {\n const root = resolve(directory)\n const indexPath = await safeContentFile(root, '.cms-content.json')\n let index: ContentIndex | undefined\n\n try {\n index = parseIndex(await readFile(indexPath, 'utf8'))\n } catch (cause) {\n if (!isMissingFile(cause)) throw cause\n }\n\n if (index) {\n const sources = await Promise.all(\n index.sources.map(async (entry) =>\n decode(\n ContentSourceSchema,\n {\n filePath: entry.filePath,\n identity: entry.identity,\n markdown: await readFile(await safeContentFile(root, entry.filePath), 'utf8'),\n placement: entry.placement,\n published: entry.published,\n revisionId: entry.revisionId,\n },\n 'content source',\n ),\n ),\n )\n\n return { sources }\n }\n\n const files = await markdownFiles(root)\n\n if (!files.length) throw new CmsContentError('filesystem-error', `No Markdown files found in ${root}.`)\n\n return {\n sources: await Promise.all(\n files.map(async (file) =>\n decode(\n ContentSourceSchema,\n {\n filePath: relative(root, file).replaceAll('\\\\', '/'),\n markdown: await readFile(file, 'utf8'),\n published: true,\n },\n 'content source',\n ),\n ),\n ),\n }\n } catch (cause) {\n if (cause instanceof CmsContentError) throw cause\n throw new CmsContentError('filesystem-error', `Could not read CMS content from ${directory}.`, { cause })\n }\n}\n\nexport function diffCmsContentSources(\n local: ReadonlyArray<ContentSource>,\n target: ReadonlyArray<ContentSource | ContentSnapshotSource>,\n): CmsContentDiff {\n return diffSources(local, target)\n}\n\nconst ContentHash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u))\n\nconst ContentIndexEntry = Schema.Struct({\n filePath: ContentSourceSchema.fields.filePath,\n identity: DocumentIdentity,\n placement: DocumentPlacement,\n published: Schema.Boolean,\n revisionId: ContentSnapshotSourceSchema.fields.revisionId,\n sha256: ContentHash,\n})\n\nconst ContentIndex = Schema.Struct({\n version: Schema.Literal(2),\n sources: Schema.Array(ContentIndexEntry),\n exportSha256: ContentHash,\n})\n\ntype ContentIndex = typeof ContentIndex.Type\n\ntype ContentIndexEntry = typeof ContentIndexEntry.Type\n\nasync function writeContentDirectory(\n directory: string,\n sources: ReadonlyArray<ContentSnapshotSource>,\n): Promise<CmsContentSourceSet> {\n try {\n const root = resolve(directory)\n const indexPath = await safeContentFile(root, '.cms-content.json')\n let previous: ContentIndex | undefined\n\n try {\n previous = parseIndex(await readFile(indexPath, 'utf8'))\n } catch (cause) {\n if (!isMissingFile(cause)) throw cause\n }\n\n const previousById = new Map(previous?.sources.map((entry) => [entry.identity.documentId, entry]))\n const paths = exportPaths(sources, previousById)\n\n if (previous) {\n const metadata = { version: previous.version, sources: previous.sources }\n\n if (sha256(JSON.stringify(metadata)) !== previous.exportSha256)\n throw new CmsContentError('filesystem-error', 'The local .cms-content.json file has been edited.')\n\n const incomingIds = new Set(sources.map((source) => source.identity.documentId))\n\n for (const entry of previous.sources)\n if (!incomingIds.has(entry.identity.documentId))\n throw new CmsContentError(\n 'filesystem-error',\n `CMS document ${entry.filePath} no longer exists; resolve the local file before exporting again.`,\n )\n }\n\n for (const source of sources) {\n const filePath = paths.get(source.identity.documentId)\n\n if (!filePath)\n throw new CmsContentError(\n 'filesystem-error',\n `Could not allocate an export path for ${source.identity.documentId}.`,\n )\n\n try {\n const local = await readFile(await safeContentFile(root, filePath), 'utf8')\n const before = previousById.get(source.identity.documentId)\n\n if (before ? sha256(local) !== before.sha256 : local !== source.markdown)\n throw new CmsContentError('filesystem-error', `Local edits in ${filePath}; export was stopped.`)\n } catch (cause) {\n if (!isMissingFile(cause)) throw cause\n }\n }\n\n await mkdir(root, { recursive: true })\n const entries: ContentIndexEntry[] = []\n\n for (const source of sources) {\n const filePath = paths.get(source.identity.documentId)\n\n if (!filePath)\n throw new CmsContentError(\n 'filesystem-error',\n `Could not allocate an export path for ${source.identity.documentId}.`,\n )\n const file = await safeContentFile(root, filePath)\n await mkdir(dirname(file), { recursive: true })\n await safeContentFile(root, filePath)\n await writeFile(file, source.markdown)\n entries.push({\n filePath,\n identity: source.identity,\n placement: source.placement,\n published: source.published,\n revisionId: source.revisionId,\n sha256: sha256(source.markdown),\n })\n }\n\n const metadata = { version: 2 as const, sources: entries }\n const index: ContentIndex = { ...metadata, exportSha256: sha256(JSON.stringify(metadata)) }\n await safeContentFile(root, '.cms-content.json')\n await writeFile(indexPath, `${JSON.stringify(index, undefined, 2)}\\n`)\n\n return {\n sources: sources.map((source) =>\n ContentSourceSchema.make({\n filePath: paths.get(source.identity.documentId)!,\n identity: source.identity,\n markdown: source.markdown,\n placement: source.placement,\n published: source.published,\n revisionId: source.revisionId,\n }),\n ),\n }\n } catch (cause) {\n throw new CmsContentError('filesystem-error', `Could not export CMS content to ${directory}.`, { cause })\n }\n}\n\nfunction diffSources(\n local: ReadonlyArray<ContentSource>,\n target: ReadonlyArray<ContentSource | ContentSnapshotSource>,\n): CmsContentDiff {\n const targetById = new Map(\n target.flatMap((source) => (source.identity ? [[source.identity.documentId, source] as const] : [])),\n )\n\n const targetByFile = new Map(\n target.flatMap((source) => ('filePath' in source ? [[source.filePath, source] as const] : [])),\n )\n\n const localIds = new Set(local.flatMap((source) => (source.identity ? [source.identity.documentId] : [])))\n const localFiles = new Set(local.map((source) => source.filePath))\n\n return {\n changes: local.flatMap((source) => {\n const current = source.identity ? targetById.get(source.identity.documentId) : targetByFile.get(source.filePath)\n const markdownChanged = current?.markdown !== source.markdown\n const publicationChanged = current !== undefined && current.published !== source.published\n\n return markdownChanged || publicationChanged\n ? [{ filePath: source.filePath, local: source, target: current, markdownChanged, publicationChanged }]\n : []\n }),\n targetOnly: target.filter((source) =>\n source.identity\n ? !localIds.has(source.identity.documentId)\n : 'filePath' in source && !localFiles.has(source.filePath),\n ),\n }\n}\n\nfunction exportPaths(\n sources: ReadonlyArray<ContentSnapshotSource>,\n previous: ReadonlyMap<string, ContentIndexEntry>,\n): ReadonlyMap<string, ContentFilePath> {\n const byId = new Map(sources.map((source) => [source.identity.documentId, source]))\n const allocated = new Set<string>()\n const result = new Map<string, ContentFilePath>()\n\n const segmentsFor = (source: ContentSnapshotSource, visited = new Set<string>()): ReadonlyArray<string> => {\n if (source.placement.kind === 'home') return []\n\n if (visited.has(source.identity.documentId)) return [source.placement.slug]\n const parent = byId.get(source.placement.parentDocumentId)\n\n return parent\n ? [...segmentsFor(parent, new Set([...visited, source.identity.documentId])), source.placement.slug]\n : [source.placement.slug]\n }\n\n for (const source of sources) {\n const retained = previous.get(source.identity.documentId)?.filePath\n const base = [source.identity.collection, ...(source.identity.locale ? [source.identity.locale] : [])]\n const placement = segmentsFor(source)\n\n const generated =\n source.placement.kind === 'home'\n ? [...base, 'index.md'].join('/')\n : [...base, ...placement.slice(0, -1), `${placement.at(-1) ?? 'document'}.md`].join('/')\n\n let candidate = retained ?? ContentFilePath.make(generated)\n\n if (allocated.has(candidate)) {\n candidate = ContentFilePath.make(generated.replace(/\\.md$/u, `-${source.identity.documentId.slice(0, 8)}.md`))\n }\n\n allocated.add(candidate)\n result.set(source.identity.documentId, candidate)\n }\n\n return result\n}\n\nasync function markdownFiles(directory: string): Promise<ReadonlyArray<string>> {\n const entries = await readdir(directory, { withFileTypes: true })\n\n const nested = await Promise.all(\n entries.map(async (entry) => {\n const path = resolve(directory, entry.name)\n\n if (entry.isDirectory()) return markdownFiles(path)\n\n return entry.isFile() && ['.md', '.mdc'].includes(extname(path)) ? [path] : []\n }),\n )\n\n return nested.flat().sort((left, right) => left.localeCompare(right))\n}\n\nfunction safeContentPath(root: string, filePath: string): string {\n const path = resolve(root, filePath)\n\n if (!path.startsWith(`${root}${sep}`))\n throw new CmsContentError('filesystem-error', `Unsafe content path: ${filePath}`)\n\n return path\n}\n\nasync function safeContentFile(root: string, filePath: string): Promise<string> {\n const path = safeContentPath(root, filePath)\n const segments = relative(root, path).split(sep)\n let current = root\n\n for (const segment of ['', ...segments]) {\n current = segment ? resolve(current, segment) : current\n\n try {\n if ((await lstat(current)).isSymbolicLink())\n throw new CmsContentError('filesystem-error', `Symlinks are not allowed in CMS content paths: ${filePath}`)\n } catch (cause) {\n if (!isMissingFile(cause)) throw cause\n }\n }\n\n return path\n}\n\nfunction contentBaseUrl(value: string): URL {\n let url: URL\n\n try {\n url = new URL(value)\n } catch (cause) {\n throw new CmsContentError('network-error', 'CMS baseUrl is invalid.', { cause })\n }\n\n if (url.username || url.password || url.search || url.hash)\n throw new CmsContentError('network-error', 'CMS baseUrl must be an origin without credentials, query, or fragment.')\n\n if (\n url.protocol !== 'https:' &&\n !(url.protocol === 'http:' && ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname))\n )\n throw new CmsContentError('network-error', 'Use HTTPS for CMS credentials; HTTP is allowed only on localhost.')\n\n return new URL(url.origin)\n}\n\nasync function request(fetch: typeof globalThis.fetch, input: URL, init: RequestInit): Promise<Response> {\n try {\n return await fetch(input, init)\n } catch (cause) {\n throw new CmsContentError('network-error', `Could not reach ${input.origin}.`, { cause })\n }\n}\n\nasync function decodeResponse<SchemaType extends Schema.ConstraintDecoder<unknown>>(\n response: Response,\n schema: SchemaType,\n label: string,\n): Promise<SchemaType['Type']> {\n try {\n return decode(schema, await response.json(), label)\n } catch (cause) {\n if (cause instanceof CmsContentError) throw cause\n throw new CmsContentError('invalid-response', 'CMS returned an invalid JSON response.', { cause })\n }\n}\n\n/* oxlint-disable anti-slop/no-unknown-parameters -- Untrusted JSON and filesystem values enter their explicit Schema decoder here. */\nfunction decode<SchemaType extends Schema.ConstraintDecoder<unknown>>(\n schema: SchemaType,\n value: unknown,\n label: string,\n): SchemaType['Type'] {\n const decoded = Schema.decodeUnknownResult(schema)(value)\n\n if (Result.isFailure(decoded))\n throw new CmsContentError('invalid-response', `CMS returned an invalid ${label}.`, { cause: decoded.failure })\n\n return decoded.success\n}\n/* oxlint-enable anti-slop/no-unknown-parameters */\n\nfunction sha256(value: string): string {\n return Encoding.encodeHex(\n Effect.runSync(NodeCrypto.make.digest('SHA-256', new TextEncoder().encode(value)).pipe(Effect.orDie)),\n )\n}\n\nfunction parseIndex(value: string): ContentIndex {\n const decoded = Schema.decodeUnknownResult(ContentIndex)(JSON.parse(value))\n\n if (Result.isFailure(decoded))\n throw new CmsContentError('filesystem-error', 'The .cms-content.json index is invalid.')\n\n const filePaths = new Set(decoded.success.sources.map((entry) => entry.filePath))\n\n if (filePaths.size !== decoded.success.sources.length)\n throw new CmsContentError('filesystem-error', 'The .cms-content.json index contains duplicate file paths.')\n\n return decoded.success\n}\n\nfunction isMissingFile(cause: unknown): boolean {\n return cause instanceof Error && 'code' in cause && cause.code === 'ENOENT'\n}\n\nexport type { ContentApplyResult, ContentSource }\n"],"mappings":";;;;;;;;;AAmCA,IAAa,kBAAb,cAAqC,MAAM;CACzC,AAAS;CACT,AAAS;CACT,AAAS;CAET,YACE,MACA,SACA,UAII,CAAC,GACL;EACA,MAAM,SAAS,QAAQ,UAAU,SAAY,SAAY,EAAE,OAAO,QAAQ,MAAM,CAAC;EACjF,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,YAAY,QAAQ;EACzB,KAAK,SAAS,QAAQ;CACxB;AACF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AM,IAAI,gBAAgB,oBAAoB,yCAAyC;CAIzF,IAAI,IAFkB,IAAI,QAAQ,QAAQ,QAAQ,KAAK,UAAU,MAAM,QAAQ,CAEnE,CAAC,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAC7C,MAAM,IAAI,gBAAgB,oBAAoB,4DAA4D;CAE5G,OAAO,QAAQ;AACjB;AAEA,SAAS,cAAc,OAAyB;CAC9C,OAAO,iBAAiB,SAAS,UAAU,SAAS,MAAM,SAAS;AACrE"}
@@ -1,86 +0,0 @@
1
- import { i as DocumentVersion, o as PublicPath, r as DocumentId, s as RevisionId, t as DocumentGeneration } from "./scalars-CVZqT3L0.js";
2
- import { T as PublishedDocumentLookup, c as DocumentIdentity, l as DocumentIssue, p as DocumentPlacement } from "./models-VmGmG19-.js";
3
- import { p as MediaObjectKey } from "./Media-j1bTritO.js";
4
- import { Schema } from "effect";
5
-
6
- //#region ../protocol/src/internal/documents/errors.ts
7
- var DocumentNotFound = class extends Schema.TaggedError()("Document.NotFound", {
8
- documentId: DocumentId,
9
- revisionId: Schema.optionalKey(RevisionId)
10
- }) {};
11
- var DocumentRouteConflict = class extends Schema.TaggedError()("Document.RouteConflict", { route: PublicPath }) {};
12
- var DocumentVersionConflict = class extends Schema.TaggedError()("Document.VersionConflict", {
13
- documentId: DocumentId,
14
- expectedVersion: DocumentVersion,
15
- actualVersion: DocumentVersion
16
- }) {};
17
- var DocumentMediaUnavailable = class extends Schema.TaggedError()("Document.MediaUnavailable", {
18
- documentId: DocumentId,
19
- mediaKeys: Schema.Array(MediaObjectKey).check(Schema.isMinLength(1))
20
- }) {};
21
- var DocumentValidationFailed = class extends Schema.TaggedError()("Document.ValidationFailed", { issues: Schema.Array(DocumentIssue) }) {};
22
- var PublishedDocumentNotFound = class extends Schema.TaggedError()("PublishedDocument.NotFound", { lookup: PublishedDocumentLookup }) {};
23
-
24
- //#endregion
25
- //#region ../protocol/src/ContentTransfer.ts
26
- const contentFilePathPattern = /^(?!\.)[^/?#\\]+(?:\/(?!\.)[^/?#\\]+)*\.(?:md|mdc)$/u;
27
- const ContentFilePath = Schema.String.check(Schema.isPattern(contentFilePathPattern)).pipe(Schema.brand("ContentFilePath"));
28
- const ContentSource = Schema.Struct({
29
- filePath: ContentFilePath,
30
- identity: Schema.optionalKey(DocumentIdentity),
31
- placement: Schema.optionalKey(DocumentPlacement),
32
- revisionId: Schema.optionalKey(RevisionId),
33
- markdown: Schema.String,
34
- /** True only when this exact authored revision is published. */
35
- published: Schema.Boolean
36
- });
37
- const ContentSnapshotSource = Schema.Struct({
38
- identity: DocumentIdentity,
39
- placement: DocumentPlacement,
40
- revisionId: RevisionId,
41
- markdown: Schema.String,
42
- published: Schema.Boolean
43
- });
44
- const ContentSnapshot = Schema.Struct({
45
- version: Schema.Literal(2),
46
- sources: Schema.Array(ContentSnapshotSource)
47
- });
48
- const ContentTransferInput = Schema.Struct({
49
- sources: Schema.Array(ContentSource),
50
- overwrite: Schema.Boolean,
51
- publish: Schema.Boolean
52
- });
53
- const ContentPlanEntry = Schema.Struct({
54
- filePath: ContentFilePath,
55
- action: Schema.Literals([
56
- "create",
57
- "update",
58
- "publish",
59
- "unpublish",
60
- "unchanged",
61
- "conflict"
62
- ]),
63
- currentRevisionId: Schema.NullOr(RevisionId)
64
- });
65
- const ContentPlan = Schema.Struct({
66
- generation: DocumentGeneration,
67
- entries: Schema.Array(ContentPlanEntry),
68
- issues: Schema.Array(DocumentIssue),
69
- valid: Schema.Boolean
70
- });
71
- const ContentApplyInput = Schema.Struct({
72
- ...ContentTransferInput.fields,
73
- expectedGeneration: DocumentGeneration
74
- });
75
- const ContentApplyResult = Schema.Struct({
76
- created: Schema.Int,
77
- updated: Schema.Int,
78
- published: Schema.Int,
79
- unchanged: Schema.Int,
80
- generation: DocumentGeneration
81
- });
82
- var ContentTransferConflict = class extends Schema.TaggedError()("Content.TransferConflict", { message: Schema.NonEmptyString }) {};
83
-
84
- //#endregion
85
- export { ContentSnapshot as a, ContentTransferConflict as c, DocumentNotFound as d, DocumentRouteConflict as f, PublishedDocumentNotFound as h, ContentPlan as i, ContentTransferInput as l, DocumentVersionConflict as m, ContentApplyResult as n, ContentSnapshotSource as o, DocumentValidationFailed as p, ContentFilePath as r, ContentSource as s, ContentApplyInput as t, DocumentMediaUnavailable as u };
86
- //# sourceMappingURL=ContentTransfer-BxwswWn3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentTransfer-BxwswWn3.js","names":[],"sources":["../../../../protocol/src/internal/documents/errors.ts","../../../../protocol/src/ContentTransfer.ts"],"sourcesContent":["import { Schema } from 'effect'\nimport { DocumentIssue, PublishedDocumentLookup } from './models'\nimport { DocumentId, DocumentVersion, PublicPath, RevisionId } from './scalars'\nimport { MediaObjectKey } from '../../Media'\n\nexport class DocumentNotFound extends Schema.TaggedError<DocumentNotFound>()('Document.NotFound', {\n documentId: DocumentId,\n revisionId: Schema.optionalKey(RevisionId),\n}) {}\n\nexport class DocumentRouteConflict extends Schema.TaggedError<DocumentRouteConflict>()('Document.RouteConflict', {\n route: PublicPath,\n}) {}\n\nexport class DocumentVersionConflict extends Schema.TaggedError<DocumentVersionConflict>()('Document.VersionConflict', {\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n actualVersion: DocumentVersion,\n}) {}\n\nexport class DocumentMediaUnavailable extends Schema.TaggedError<DocumentMediaUnavailable>()(\n 'Document.MediaUnavailable',\n {\n documentId: DocumentId,\n mediaKeys: Schema.Array(MediaObjectKey).check(Schema.isMinLength(1)),\n },\n) {}\n\nexport class DocumentValidationFailed extends Schema.TaggedError<DocumentValidationFailed>()(\n 'Document.ValidationFailed',\n {\n issues: Schema.Array(DocumentIssue),\n },\n) {}\n\nexport class PublishedDocumentNotFound extends Schema.TaggedError<PublishedDocumentNotFound>()(\n 'PublishedDocument.NotFound',\n { lookup: PublishedDocumentLookup },\n) {}\n","import { Schema } from 'effect'\nimport { DocumentGeneration, DocumentIdentity, DocumentIssue, DocumentPlacement, RevisionId } from './Documents'\n\nconst contentFilePathPattern = /^(?!\\.)[^/?#\\\\]+(?:\\/(?!\\.)[^/?#\\\\]+)*\\.(?:md|mdc)$/u\n\nexport const ContentFilePath = Schema.String.check(Schema.isPattern(contentFilePathPattern)).pipe(\n Schema.brand('ContentFilePath'),\n)\n\nexport type ContentFilePath = typeof ContentFilePath.Type\n\nexport const ContentSource = Schema.Struct({\n filePath: ContentFilePath,\n identity: Schema.optionalKey(DocumentIdentity),\n placement: Schema.optionalKey(DocumentPlacement),\n revisionId: Schema.optionalKey(RevisionId),\n markdown: Schema.String,\n /** True only when this exact authored revision is published. */\n published: Schema.Boolean,\n})\n\nexport interface ContentSource extends Schema.Schema.Type<typeof ContentSource> {}\n\nexport const ContentSnapshotSource = Schema.Struct({\n identity: DocumentIdentity,\n placement: DocumentPlacement,\n revisionId: RevisionId,\n markdown: Schema.String,\n published: Schema.Boolean,\n})\n\nexport interface ContentSnapshotSource extends Schema.Schema.Type<typeof ContentSnapshotSource> {}\n\nexport const ContentSnapshot = Schema.Struct({\n version: Schema.Literal(2),\n sources: Schema.Array(ContentSnapshotSource),\n})\n\nexport interface ContentSnapshot extends Schema.Schema.Type<typeof ContentSnapshot> {}\n\nexport const ContentTransferInput = Schema.Struct({\n sources: Schema.Array(ContentSource),\n overwrite: Schema.Boolean,\n publish: Schema.Boolean,\n})\n\nexport interface ContentTransferInput extends Schema.Schema.Type<typeof ContentTransferInput> {}\n\nexport const ContentPlanEntry = Schema.Struct({\n filePath: ContentFilePath,\n action: Schema.Literals(['create', 'update', 'publish', 'unpublish', 'unchanged', 'conflict']),\n currentRevisionId: Schema.NullOr(RevisionId),\n})\n\nexport interface ContentPlanEntry extends Schema.Schema.Type<typeof ContentPlanEntry> {}\n\nexport const ContentPlan = Schema.Struct({\n generation: DocumentGeneration,\n entries: Schema.Array(ContentPlanEntry),\n issues: Schema.Array(DocumentIssue),\n valid: Schema.Boolean,\n})\n\nexport interface ContentPlan extends Schema.Schema.Type<typeof ContentPlan> {}\n\nexport const ContentApplyInput = Schema.Struct({\n ...ContentTransferInput.fields,\n expectedGeneration: DocumentGeneration,\n})\n\nexport interface ContentApplyInput extends Schema.Schema.Type<typeof ContentApplyInput> {}\n\nexport const ContentApplyResult = Schema.Struct({\n created: Schema.Int,\n updated: Schema.Int,\n published: Schema.Int,\n unchanged: Schema.Int,\n generation: DocumentGeneration,\n})\n\nexport interface ContentApplyResult extends Schema.Schema.Type<typeof ContentApplyResult> {}\n\nexport class ContentTransferConflict extends Schema.TaggedError<ContentTransferConflict>()('Content.TransferConflict', {\n message: Schema.NonEmptyString,\n}) {}\n"],"mappings":";;;;;;AAKA,IAAa,mBAAb,cAAsC,OAAO,YAA8B,CAAC,CAAC,qBAAqB;CAChG,YAAY;CACZ,YAAY,OAAO,YAAY,UAAU;AAC3C,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,wBAAb,cAA2C,OAAO,YAAmC,CAAC,CAAC,0BAA0B,EAC/G,OAAO,WACT,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,0BAAb,cAA6C,OAAO,YAAqC,CAAC,CAAC,4BAA4B;CACrH,YAAY;CACZ,iBAAiB;CACjB,eAAe;AACjB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,2BAAb,cAA8C,OAAO,YAAsC,CAAC,CAC1F,6BACA;CACE,YAAY;CACZ,WAAW,OAAO,MAAM,cAAc,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AACrE,CACF,CAAC,CAAC,CAAC;AAEH,IAAa,2BAAb,cAA8C,OAAO,YAAsC,CAAC,CAC1F,6BACA,EACE,QAAQ,OAAO,MAAM,aAAa,EACpC,CACF,CAAC,CAAC,CAAC;AAEH,IAAa,4BAAb,cAA+C,OAAO,YAAuC,CAAC,CAC5F,8BACA,EAAE,QAAQ,wBAAwB,CACpC,CAAC,CAAC,CAAC;;;;ACnCH,MAAM,yBAAyB;AAE/B,MAAa,kBAAkB,OAAO,OAAO,MAAM,OAAO,UAAU,sBAAs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.js";
2
- import { Schema } from "effect";
3
- //#region ../protocol/src/internal/documents/models.d.ts
4
- declare const DocumentIssue: Schema.Struct<{
5
- readonly code: Schema.Literals<readonly ["document.collision", "document.id", "document.invalid", "i18n.missing-translation", "markdown.parse", "reference.document", "reference.component", "reference.media", "seo.invalid", "schema.option", "schema.constraint", "schema.required", "schema.type", "schema.unknown"]>;
6
- readonly severity: Schema.Literals<readonly ["error", "warning"]>;
7
- readonly message: Schema.NonEmptyString;
8
- readonly component: Schema.optionalKey<Schema.NonEmptyString>;
9
- readonly documentId: Schema.optionalKey<Schema.brand<Schema.String, "DocumentId">>;
10
- readonly collection: Schema.optionalKey<Schema.brand<Schema.String, "CollectionName">>;
11
- readonly field: Schema.optionalKey<Schema.NonEmptyString>;
12
- readonly key: Schema.optionalKey<Schema.brand<Schema.String, "PublicPath">>;
13
- readonly locale: Schema.optionalKey<Schema.brand<Schema.String, "Locale">>;
14
- }>;
15
- interface DocumentIssue extends Schema.Schema.Type<typeof DocumentIssue> {}
16
- //#endregion
17
- //#region ../protocol/src/ContentTransfer.d.ts
18
- declare const ContentSource: Schema.Struct<{
19
- readonly filePath: Schema.brand<Schema.String, "ContentFilePath">;
20
- readonly identity: Schema.optionalKey<Schema.Struct<{
21
- readonly documentId: Schema.brand<Schema.String, "DocumentId">;
22
- readonly collection: Schema.brand<Schema.String, "CollectionName">;
23
- readonly locale: Schema.optionalKey<Schema.brand<Schema.String, "Locale">>;
24
- }>>;
25
- readonly placement: Schema.optionalKey<Schema.toTaggedUnion<"kind", readonly [Schema.Struct<{
26
- readonly kind: Schema.tag<"home">;
27
- }>, Schema.Struct<{
28
- readonly kind: Schema.tag<"entry">;
29
- readonly parentDocumentId: Schema.brand<Schema.String, "DocumentId">;
30
- readonly slug: Schema.brand<Schema.String, "Slug">;
31
- }>]>>;
32
- readonly revisionId: Schema.optionalKey<Schema.brand<Schema.String, "RevisionId">>;
33
- readonly markdown: Schema.String;
34
- /** True only when this exact authored revision is published. */
35
- readonly published: Schema.Boolean;
36
- }>;
37
- interface ContentSource extends Schema.Schema.Type<typeof ContentSource> {}
38
- declare const ContentSnapshotSource: Schema.Struct<{
39
- readonly identity: Schema.Struct<{
40
- readonly documentId: Schema.brand<Schema.String, "DocumentId">;
41
- readonly collection: Schema.brand<Schema.String, "CollectionName">;
42
- readonly locale: Schema.optionalKey<Schema.brand<Schema.String, "Locale">>;
43
- }>;
44
- readonly placement: Schema.toTaggedUnion<"kind", readonly [Schema.Struct<{
45
- readonly kind: Schema.tag<"home">;
46
- }>, Schema.Struct<{
47
- readonly kind: Schema.tag<"entry">;
48
- readonly parentDocumentId: Schema.brand<Schema.String, "DocumentId">;
49
- readonly slug: Schema.brand<Schema.String, "Slug">;
50
- }>]>;
51
- readonly revisionId: Schema.brand<Schema.String, "RevisionId">;
52
- readonly markdown: Schema.String;
53
- readonly published: Schema.Boolean;
54
- }>;
55
- interface ContentSnapshotSource extends Schema.Schema.Type<typeof ContentSnapshotSource> {}
56
- declare const ContentPlanEntry: Schema.Struct<{
57
- readonly filePath: Schema.brand<Schema.String, "ContentFilePath">;
58
- readonly action: Schema.Literals<readonly ["create", "update", "publish", "unpublish", "unchanged", "conflict"]>;
59
- readonly currentRevisionId: Schema.NullOr<Schema.brand<Schema.String, "RevisionId">>;
60
- }>;
61
- interface ContentPlanEntry extends Schema.Schema.Type<typeof ContentPlanEntry> {}
62
- declare const ContentApplyResult: Schema.Struct<{
63
- readonly created: Schema.Int;
64
- readonly updated: Schema.Int;
65
- readonly published: Schema.Int;
66
- readonly unchanged: Schema.Int;
67
- readonly generation: Schema.brand<Schema.String, "DocumentGeneration">;
68
- }>;
69
- interface ContentApplyResult extends Schema.Schema.Type<typeof ContentApplyResult> {}
70
- //#endregion
71
- export { DocumentIssue as a, ContentSource as i, ContentPlanEntry as n, ContentSnapshotSource as r, ContentApplyResult as t };
72
- //# sourceMappingURL=ContentTransfer-Z9FHyLez.d.ts.map