@heyo-sh/heyo-cms 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -2
  3. package/dist/access/index.d.ts +9 -0
  4. package/dist/access/index.d.ts.map +1 -0
  5. package/dist/access/permissions.d.ts +54 -0
  6. package/dist/access/permissions.d.ts.map +1 -0
  7. package/dist/adapters/astro.d.ts +45 -0
  8. package/dist/adapters/astro.d.ts.map +1 -0
  9. package/dist/adapters/astro.js +1 -0
  10. package/dist/adapters/deliver.d.ts +26 -0
  11. package/dist/adapters/deliver.d.ts.map +1 -0
  12. package/dist/adapters/next.d.ts +45 -0
  13. package/dist/adapters/next.d.ts.map +1 -0
  14. package/dist/adapters/next.js +1 -0
  15. package/dist/adapters/nuxt.d.ts +51 -0
  16. package/dist/adapters/nuxt.d.ts.map +1 -0
  17. package/dist/adapters/nuxt.js +1 -0
  18. package/dist/adapters/react-router.d.ts +36 -0
  19. package/dist/adapters/react-router.d.ts.map +1 -0
  20. package/dist/adapters/react-router.js +1 -0
  21. package/dist/adapters/sveltekit.d.ts +41 -0
  22. package/dist/adapters/sveltekit.d.ts.map +1 -0
  23. package/dist/adapters/sveltekit.js +1 -0
  24. package/dist/ai/assistant/context.d.ts +64 -0
  25. package/dist/ai/assistant/context.d.ts.map +1 -0
  26. package/dist/ai/assistant/limits.d.ts +10 -0
  27. package/dist/ai/assistant/limits.d.ts.map +1 -0
  28. package/dist/ai/assistant/plans.d.ts +83 -0
  29. package/dist/ai/assistant/plans.d.ts.map +1 -0
  30. package/dist/ai/assistant/prompt.d.ts +22 -0
  31. package/dist/ai/assistant/prompt.d.ts.map +1 -0
  32. package/dist/ai/assistant/run.d.ts +59 -0
  33. package/dist/ai/assistant/run.d.ts.map +1 -0
  34. package/dist/ai/assistant/runtime.d.ts +35 -0
  35. package/dist/ai/assistant/runtime.d.ts.map +1 -0
  36. package/dist/ai/assistant/schema.d.ts +66 -0
  37. package/dist/ai/assistant/schema.d.ts.map +1 -0
  38. package/dist/ai/assistant/tools.d.ts +41 -0
  39. package/dist/ai/assistant/tools.d.ts.map +1 -0
  40. package/dist/ai/assistant/values.d.ts +33 -0
  41. package/dist/ai/assistant/values.d.ts.map +1 -0
  42. package/dist/ai/crypto.d.ts +12 -0
  43. package/dist/ai/crypto.d.ts.map +1 -0
  44. package/dist/ai/index.d.ts +19 -0
  45. package/dist/ai/index.d.ts.map +1 -0
  46. package/dist/ai/pi.d.ts +89 -0
  47. package/dist/ai/pi.d.ts.map +1 -0
  48. package/dist/ai/registry.d.ts +66 -0
  49. package/dist/ai/registry.d.ts.map +1 -0
  50. package/dist/ai/service.d.ts +31 -0
  51. package/dist/ai/service.d.ts.map +1 -0
  52. package/dist/ai/variant-translation.d.ts +6 -0
  53. package/dist/ai/variant-translation.d.ts.map +1 -0
  54. package/dist/ai.d.ts +12 -0
  55. package/dist/ai.d.ts.map +1 -0
  56. package/dist/ai.js +1 -0
  57. package/dist/auth/config.d.ts +65 -0
  58. package/dist/auth/config.d.ts.map +1 -0
  59. package/dist/auth/crypto.d.ts +44 -0
  60. package/dist/auth/crypto.d.ts.map +1 -0
  61. package/dist/auth/index.d.ts +15 -0
  62. package/dist/auth/index.d.ts.map +1 -0
  63. package/dist/auth/oauth.d.ts +93 -0
  64. package/dist/auth/oauth.d.ts.map +1 -0
  65. package/dist/auth/service.d.ts +38 -0
  66. package/dist/auth/service.d.ts.map +1 -0
  67. package/dist/auth/totp.d.ts +34 -0
  68. package/dist/auth/totp.d.ts.map +1 -0
  69. package/dist/auth.d.ts +9 -0
  70. package/dist/auth.d.ts.map +1 -0
  71. package/dist/auth.js +1 -0
  72. package/dist/cli.d.ts +3 -0
  73. package/dist/cli.d.ts.map +1 -0
  74. package/dist/cli.js +30 -0
  75. package/dist/client/index.d.ts +51 -0
  76. package/dist/client/index.d.ts.map +1 -0
  77. package/dist/client/types.d.ts +363 -0
  78. package/dist/client/types.d.ts.map +1 -0
  79. package/dist/client.d.ts +46 -0
  80. package/dist/client.d.ts.map +1 -0
  81. package/dist/client.js +1 -0
  82. package/dist/config.d.ts +31 -0
  83. package/dist/config.d.ts.map +1 -0
  84. package/dist/config.js +1 -0
  85. package/dist/content/export.d.ts +28 -0
  86. package/dist/content/export.d.ts.map +1 -0
  87. package/dist/content/import.d.ts +65 -0
  88. package/dist/content/import.d.ts.map +1 -0
  89. package/dist/content/records.d.ts +73 -0
  90. package/dist/content/records.d.ts.map +1 -0
  91. package/dist/content.d.ts +12 -0
  92. package/dist/content.d.ts.map +1 -0
  93. package/dist/content.js +1 -0
  94. package/dist/db/d1.d.ts +29 -0
  95. package/dist/db/d1.d.ts.map +1 -0
  96. package/dist/db/d1.js +1 -0
  97. package/dist/db/mongodb.d.ts +128 -0
  98. package/dist/db/mongodb.d.ts.map +1 -0
  99. package/dist/db/mongodb.js +2 -0
  100. package/dist/db/postgres.d.ts +37 -0
  101. package/dist/db/postgres.d.ts.map +1 -0
  102. package/dist/db/postgres.js +1 -0
  103. package/dist/db/sql/adapter.d.ts +57 -0
  104. package/dist/db/sql/adapter.d.ts.map +1 -0
  105. package/dist/db/sql/compile.d.ts +50 -0
  106. package/dist/db/sql/compile.d.ts.map +1 -0
  107. package/dist/db/sql/ddl.d.ts +34 -0
  108. package/dist/db/sql/ddl.d.ts.map +1 -0
  109. package/dist/db/sql/dialect.d.ts +37 -0
  110. package/dist/db/sql/dialect.d.ts.map +1 -0
  111. package/dist/db/sql/driver.d.ts +34 -0
  112. package/dist/db/sql/driver.d.ts.map +1 -0
  113. package/dist/db/sql/introspect.d.ts +15 -0
  114. package/dist/db/sql/introspect.d.ts.map +1 -0
  115. package/dist/db/sqlite.d.ts +50 -0
  116. package/dist/db/sqlite.d.ts.map +1 -0
  117. package/dist/db/sqlite.js +1 -0
  118. package/dist/defaults.d.ts +5 -0
  119. package/dist/defaults.d.ts.map +1 -0
  120. package/dist/duration.d.ts +12 -0
  121. package/dist/duration.d.ts.map +1 -0
  122. package/dist/editor/builtin.d.ts +45 -0
  123. package/dist/editor/builtin.d.ts.map +1 -0
  124. package/dist/editor/index.d.ts +14 -0
  125. package/dist/editor/index.d.ts.map +1 -0
  126. package/dist/editor/markdown.d.ts +19 -0
  127. package/dist/editor/markdown.d.ts.map +1 -0
  128. package/dist/editor/registry.d.ts +30 -0
  129. package/dist/editor/registry.d.ts.map +1 -0
  130. package/dist/editor/serialize.d.ts +41 -0
  131. package/dist/editor/serialize.d.ts.map +1 -0
  132. package/dist/editor.d.ts +10 -0
  133. package/dist/editor.d.ts.map +1 -0
  134. package/dist/editor.js +1 -0
  135. package/dist/engine/access.d.ts +33 -0
  136. package/dist/engine/access.d.ts.map +1 -0
  137. package/dist/engine/activity.d.ts +16 -0
  138. package/dist/engine/activity.d.ts.map +1 -0
  139. package/dist/engine/cursor.d.ts +19 -0
  140. package/dist/engine/cursor.d.ts.map +1 -0
  141. package/dist/engine/documents.d.ts +81 -0
  142. package/dist/engine/documents.d.ts.map +1 -0
  143. package/dist/engine/engine.d.ts +295 -0
  144. package/dist/engine/engine.d.ts.map +1 -0
  145. package/dist/engine/field-access.d.ts +21 -0
  146. package/dist/engine/field-access.d.ts.map +1 -0
  147. package/dist/engine/hooks.d.ts +58 -0
  148. package/dist/engine/hooks.d.ts.map +1 -0
  149. package/dist/engine/index.d.ts +20 -0
  150. package/dist/engine/index.d.ts.map +1 -0
  151. package/dist/engine/jobs.d.ts +63 -0
  152. package/dist/engine/jobs.d.ts.map +1 -0
  153. package/dist/engine/locales.d.ts +40 -0
  154. package/dist/engine/locales.d.ts.map +1 -0
  155. package/dist/engine/outbox.d.ts +81 -0
  156. package/dist/engine/outbox.d.ts.map +1 -0
  157. package/dist/engine/relations.d.ts +60 -0
  158. package/dist/engine/relations.d.ts.map +1 -0
  159. package/dist/engine/scoped-db.d.ts +13 -0
  160. package/dist/engine/scoped-db.d.ts.map +1 -0
  161. package/dist/engine/slugs.d.ts +124 -0
  162. package/dist/engine/slugs.d.ts.map +1 -0
  163. package/dist/engine/trash.d.ts +25 -0
  164. package/dist/engine/trash.d.ts.map +1 -0
  165. package/dist/errors.d.ts +42 -0
  166. package/dist/errors.d.ts.map +1 -0
  167. package/dist/fields/builtin.d.ts +169 -0
  168. package/dist/fields/builtin.d.ts.map +1 -0
  169. package/dist/fields/index.d.ts +3 -0
  170. package/dist/fields/index.d.ts.map +1 -0
  171. package/dist/fields/registry.d.ts +35 -0
  172. package/dist/fields/registry.d.ts.map +1 -0
  173. package/dist/fields.d.ts +9 -0
  174. package/dist/fields.d.ts.map +1 -0
  175. package/dist/fields.js +1 -0
  176. package/dist/http/guard.d.ts +45 -0
  177. package/dist/http/guard.d.ts.map +1 -0
  178. package/dist/http/handler.d.ts +31 -0
  179. package/dist/http/handler.d.ts.map +1 -0
  180. package/dist/http/index.d.ts +13 -0
  181. package/dist/http/index.d.ts.map +1 -0
  182. package/dist/http/openapi.d.ts +5 -0
  183. package/dist/http/openapi.d.ts.map +1 -0
  184. package/dist/http/params.d.ts +32 -0
  185. package/dist/http/params.d.ts.map +1 -0
  186. package/dist/http/request-db.d.ts +19 -0
  187. package/dist/http/request-db.d.ts.map +1 -0
  188. package/dist/http/respond.d.ts +48 -0
  189. package/dist/http/respond.d.ts.map +1 -0
  190. package/dist/http/rich-text.d.ts +41 -0
  191. package/dist/http/rich-text.d.ts.map +1 -0
  192. package/dist/http/router.d.ts +55 -0
  193. package/dist/http/router.d.ts.map +1 -0
  194. package/dist/http/routes/access.d.ts +13 -0
  195. package/dist/http/routes/access.d.ts.map +1 -0
  196. package/dist/http/routes/admin.d.ts +28 -0
  197. package/dist/http/routes/admin.d.ts.map +1 -0
  198. package/dist/http/routes/ai.d.ts +26 -0
  199. package/dist/http/routes/ai.d.ts.map +1 -0
  200. package/dist/http/routes/auth.d.ts +13 -0
  201. package/dist/http/routes/auth.d.ts.map +1 -0
  202. package/dist/http/routes/documents.d.ts +24 -0
  203. package/dist/http/routes/documents.d.ts.map +1 -0
  204. package/dist/http/routes/generate.d.ts +5 -0
  205. package/dist/http/routes/generate.d.ts.map +1 -0
  206. package/dist/http/routes/media.d.ts +58 -0
  207. package/dist/http/routes/media.d.ts.map +1 -0
  208. package/dist/http/routes/panel.d.ts +20 -0
  209. package/dist/http/routes/panel.d.ts.map +1 -0
  210. package/dist/http/routes/system.d.ts +25 -0
  211. package/dist/http/routes/system.d.ts.map +1 -0
  212. package/dist/http/routes/webhooks.d.ts +17 -0
  213. package/dist/http/routes/webhooks.d.ts.map +1 -0
  214. package/dist/http/spec.d.ts +28 -0
  215. package/dist/http/spec.d.ts.map +1 -0
  216. package/dist/http.d.ts +17 -0
  217. package/dist/http.d.ts.map +1 -0
  218. package/dist/http.js +1 -0
  219. package/dist/i18n/index.d.ts +12 -0
  220. package/dist/i18n/index.d.ts.map +1 -0
  221. package/dist/i18n/names.d.ts +25 -0
  222. package/dist/i18n/names.d.ts.map +1 -0
  223. package/dist/ids.d.ts +28 -0
  224. package/dist/ids.d.ts.map +1 -0
  225. package/dist/index-2ddk43me.js +2 -0
  226. package/dist/index-2prbs05k.js +2 -0
  227. package/dist/index-385ggnge.js +2 -0
  228. package/dist/index-466cwb0b.js +2 -0
  229. package/dist/index-4qrep5f0.js +26 -0
  230. package/dist/index-67e458ws.js +2 -0
  231. package/dist/index-6m1kjq9g.js +2 -0
  232. package/dist/index-6w10rch0.js +3 -0
  233. package/dist/index-761dec5z.js +2 -0
  234. package/dist/index-8nzmqy0f.js +2 -0
  235. package/dist/index-8x2em6c8.js +14 -0
  236. package/dist/index-91fa1gzf.js +2 -0
  237. package/dist/index-9g2n7xa6.js +2 -0
  238. package/dist/index-a8jcwqsf.js +2 -0
  239. package/dist/index-abfzb1ve.js +2 -0
  240. package/dist/index-cv0hpz3d.js +2 -0
  241. package/dist/index-ebtj6ebd.js +0 -0
  242. package/dist/index-g041kfa5.js +18 -0
  243. package/dist/index-g4crf47y.js +0 -0
  244. package/dist/index-hbx67b20.js +7 -0
  245. package/dist/index-hpast878.js +40 -0
  246. package/dist/index-kc1j3h6z.js +2 -0
  247. package/dist/index-p2cqsmvw.js +2 -0
  248. package/dist/index-rg9tpg3p.js +5 -0
  249. package/dist/index-rw0hze6x.js +2 -0
  250. package/dist/index-s9x07zb3.js +2 -0
  251. package/dist/index-sgdnp83t.js +2 -0
  252. package/dist/index-szaq03qq.js +2 -0
  253. package/dist/index-vkwzdfte.js +5 -0
  254. package/dist/index-vzhxn50e.js +2 -0
  255. package/dist/index-x72d1hzh.js +2 -0
  256. package/dist/index-y8kzzn94.js +2 -0
  257. package/dist/index-ypcmns0v.js +2 -0
  258. package/dist/index.d.ts +25 -0
  259. package/dist/index.d.ts.map +1 -0
  260. package/dist/index.js +1 -0
  261. package/dist/jobs/runner.d.ts +77 -0
  262. package/dist/jobs/runner.d.ts.map +1 -0
  263. package/dist/jobs.d.ts +11 -0
  264. package/dist/jobs.d.ts.map +1 -0
  265. package/dist/jobs.js +1 -0
  266. package/dist/media/cloudflare.d.ts +58 -0
  267. package/dist/media/cloudflare.d.ts.map +1 -0
  268. package/dist/media/document.d.ts +29 -0
  269. package/dist/media/document.d.ts.map +1 -0
  270. package/dist/media/gc.d.ts +46 -0
  271. package/dist/media/gc.d.ts.map +1 -0
  272. package/dist/media/index.d.ts +20 -0
  273. package/dist/media/index.d.ts.map +1 -0
  274. package/dist/media/pipeline.d.ts +55 -0
  275. package/dist/media/pipeline.d.ts.map +1 -0
  276. package/dist/media/probe.d.ts +6 -0
  277. package/dist/media/probe.d.ts.map +1 -0
  278. package/dist/media/service.d.ts +26 -0
  279. package/dist/media/service.d.ts.map +1 -0
  280. package/dist/media/sharp.d.ts +28 -0
  281. package/dist/media/sharp.d.ts.map +1 -0
  282. package/dist/media/strip.d.ts +16 -0
  283. package/dist/media/strip.d.ts.map +1 -0
  284. package/dist/media/urls.d.ts +77 -0
  285. package/dist/media/urls.d.ts.map +1 -0
  286. package/dist/media/usages.d.ts +77 -0
  287. package/dist/media/usages.d.ts.map +1 -0
  288. package/dist/media/variants.d.ts +61 -0
  289. package/dist/media/variants.d.ts.map +1 -0
  290. package/dist/migrations.d.ts +115 -0
  291. package/dist/migrations.d.ts.map +1 -0
  292. package/dist/migrations.js +1 -0
  293. package/dist/panel.d.ts +31 -0
  294. package/dist/panel.d.ts.map +1 -0
  295. package/dist/plugins/indexnow.d.ts +82 -0
  296. package/dist/plugins/indexnow.d.ts.map +1 -0
  297. package/dist/plugins.d.ts +9 -0
  298. package/dist/plugins.d.ts.map +1 -0
  299. package/dist/plugins.js +1 -0
  300. package/dist/query.d.ts +40 -0
  301. package/dist/query.d.ts.map +1 -0
  302. package/dist/query.js +1 -0
  303. package/dist/run-bjge3v8e.js +6 -0
  304. package/dist/schema/describe.d.ts +19 -0
  305. package/dist/schema/describe.d.ts.map +1 -0
  306. package/dist/schema/index.d.ts +5 -0
  307. package/dist/schema/index.d.ts.map +1 -0
  308. package/dist/schema/plan.d.ts +20 -0
  309. package/dist/schema/plan.d.ts.map +1 -0
  310. package/dist/schema/snapshot.d.ts +24 -0
  311. package/dist/schema/snapshot.d.ts.map +1 -0
  312. package/dist/schema/system.d.ts +31 -0
  313. package/dist/schema/system.d.ts.map +1 -0
  314. package/dist/schema.d.ts +7 -0
  315. package/dist/schema.d.ts.map +1 -0
  316. package/dist/schema.js +1 -0
  317. package/dist/slugify.d.ts +31 -0
  318. package/dist/slugify.d.ts.map +1 -0
  319. package/dist/storage/bytes.d.ts +17 -0
  320. package/dist/storage/bytes.d.ts.map +1 -0
  321. package/dist/storage/http.d.ts +43 -0
  322. package/dist/storage/http.d.ts.map +1 -0
  323. package/dist/storage/local.d.ts +31 -0
  324. package/dist/storage/local.d.ts.map +1 -0
  325. package/dist/storage/providers.d.ts +95 -0
  326. package/dist/storage/providers.d.ts.map +1 -0
  327. package/dist/storage/sign.d.ts +53 -0
  328. package/dist/storage/sign.d.ts.map +1 -0
  329. package/dist/strings.d.ts +13 -0
  330. package/dist/strings.d.ts.map +1 -0
  331. package/dist/telemetry.d.ts +137 -0
  332. package/dist/telemetry.d.ts.map +1 -0
  333. package/dist/telemetry.js +1 -0
  334. package/dist/types/activity.d.ts +68 -0
  335. package/dist/types/activity.d.ts.map +1 -0
  336. package/dist/types/actor.d.ts +26 -0
  337. package/dist/types/actor.d.ts.map +1 -0
  338. package/dist/types/ai.d.ts +357 -0
  339. package/dist/types/ai.d.ts.map +1 -0
  340. package/dist/types/api.d.ts +268 -0
  341. package/dist/types/api.d.ts.map +1 -0
  342. package/dist/types/auth.d.ts +310 -0
  343. package/dist/types/auth.d.ts.map +1 -0
  344. package/dist/types/config.d.ts +647 -0
  345. package/dist/types/config.d.ts.map +1 -0
  346. package/dist/types/database.d.ts +75 -0
  347. package/dist/types/database.d.ts.map +1 -0
  348. package/dist/types/editor.d.ts +166 -0
  349. package/dist/types/editor.d.ts.map +1 -0
  350. package/dist/types/events.d.ts +72 -0
  351. package/dist/types/events.d.ts.map +1 -0
  352. package/dist/types/fields.d.ts +142 -0
  353. package/dist/types/fields.d.ts.map +1 -0
  354. package/dist/types/hooks.d.ts +142 -0
  355. package/dist/types/hooks.d.ts.map +1 -0
  356. package/dist/types/index.d.ts +25 -0
  357. package/dist/types/index.d.ts.map +1 -0
  358. package/dist/types/instance.d.ts +263 -0
  359. package/dist/types/instance.d.ts.map +1 -0
  360. package/dist/types/jobs.d.ts +78 -0
  361. package/dist/types/jobs.d.ts.map +1 -0
  362. package/dist/types/json.d.ts +24 -0
  363. package/dist/types/json.d.ts.map +1 -0
  364. package/dist/types/locales.d.ts +30 -0
  365. package/dist/types/locales.d.ts.map +1 -0
  366. package/dist/types/media.d.ts +342 -0
  367. package/dist/types/media.d.ts.map +1 -0
  368. package/dist/types/panel.d.ts +249 -0
  369. package/dist/types/panel.d.ts.map +1 -0
  370. package/dist/types/plugin.d.ts +194 -0
  371. package/dist/types/plugin.d.ts.map +1 -0
  372. package/dist/types/query.d.ts +101 -0
  373. package/dist/types/query.d.ts.map +1 -0
  374. package/dist/types/schema.d.ts +203 -0
  375. package/dist/types/schema.d.ts.map +1 -0
  376. package/dist/types/storage.d.ts +61 -0
  377. package/dist/types/storage.d.ts.map +1 -0
  378. package/dist/types/telemetry.d.ts +14 -0
  379. package/dist/types/telemetry.d.ts.map +1 -0
  380. package/dist/types/trash.d.ts +42 -0
  381. package/dist/types/trash.d.ts.map +1 -0
  382. package/dist/types/webhooks.d.ts +133 -0
  383. package/dist/types/webhooks.d.ts.map +1 -0
  384. package/dist/types.d.ts +8 -0
  385. package/dist/types.d.ts.map +1 -0
  386. package/dist/types.js +1 -0
  387. package/dist/uploads.d.ts +22 -0
  388. package/dist/uploads.d.ts.map +1 -0
  389. package/dist/uploads.js +9 -0
  390. package/dist/webhooks/index.d.ts +10 -0
  391. package/dist/webhooks/index.d.ts.map +1 -0
  392. package/dist/webhooks/job.d.ts +17 -0
  393. package/dist/webhooks/job.d.ts.map +1 -0
  394. package/dist/webhooks/service.d.ts +53 -0
  395. package/dist/webhooks/service.d.ts.map +1 -0
  396. package/dist/webhooks/sign.d.ts +26 -0
  397. package/dist/webhooks/sign.d.ts.map +1 -0
  398. package/dist/webhooks.d.ts +10 -0
  399. package/dist/webhooks.d.ts.map +1 -0
  400. package/dist/webhooks.js +1 -0
  401. package/package.json +187 -4
@@ -0,0 +1,133 @@
1
+ import type { Actor, OperationSource } from "./actor";
2
+ import type { AnyEventType, CmsEvent } from "./events";
3
+ import type { JsonObject } from "./json";
4
+ /**
5
+ * Webhooks (stage 9, section 7).
6
+ *
7
+ * The delivery half of the outbox. An event is written inside the
8
+ * transaction that caused it and delivered afterwards, so a rolled back
9
+ * write sends nothing and a committed one sends even if the process dies a
10
+ * line later — and a subscriber that is down does not slow a save down, it
11
+ * accumulates retries.
12
+ */
13
+ export interface WebhookFilters {
14
+ collections?: string[];
15
+ locales?: string[];
16
+ }
17
+ export interface WebhookSubscription {
18
+ id: string;
19
+ url: string;
20
+ /** Event types, or prefixes: `document.*`, or `*` for everything. */
21
+ events: string[];
22
+ filters: WebhookFilters | null;
23
+ headers: Record<string, string> | null;
24
+ /** Whether this subscription signs with its own secret rather than the global one. */
25
+ hasSecret: boolean;
26
+ active: boolean;
27
+ createdAt: string | null;
28
+ updatedAt: string | null;
29
+ }
30
+ /**
31
+ * One attempt to hand one event to one subscriber.
32
+ *
33
+ * `pending` is waiting or being retried, `delivered` succeeded, `failed` is
34
+ * out of attempts — the dead-letter queue is a status rather than a second
35
+ * table, because a replay has to be able to put the same row back in flight.
36
+ */
37
+ export type WebhookDeliveryStatus = "pending" | "delivered" | "failed";
38
+ export interface WebhookDelivery {
39
+ id: string;
40
+ webhookId: string;
41
+ eventId: string;
42
+ eventType: string;
43
+ status: WebhookDeliveryStatus;
44
+ attempt: number;
45
+ responseStatus: number | null;
46
+ responseBody: string | null;
47
+ error: string | null;
48
+ nextAttemptAt: string | null;
49
+ deliveredAt: string | null;
50
+ createdAt: string | null;
51
+ /** The exact body that was signed and sent. Present when asked for. */
52
+ requestBody?: JsonObject | null;
53
+ }
54
+ export interface WebhookCreateArgs {
55
+ url: string;
56
+ events: string[];
57
+ filters?: WebhookFilters;
58
+ headers?: Record<string, string>;
59
+ /** Overrides `webhooks.signing.secret` for this subscription. */
60
+ secret?: string;
61
+ active?: boolean;
62
+ actor?: Actor | null;
63
+ source?: OperationSource;
64
+ }
65
+ export interface WebhookUpdateArgs extends Partial<WebhookCreateArgs> {
66
+ id: string;
67
+ }
68
+ export interface WebhookListArgs {
69
+ /** Includes inactive subscriptions. They are included by default. */
70
+ active?: boolean;
71
+ }
72
+ export interface WebhookDeliveryListArgs {
73
+ webhookId?: string;
74
+ status?: WebhookDeliveryStatus;
75
+ eventId?: string;
76
+ limit?: number;
77
+ cursor?: string;
78
+ /** Includes the request body, which can be large. */
79
+ includeBody?: boolean;
80
+ }
81
+ export interface WebhookDeliveryPage {
82
+ entries: WebhookDelivery[];
83
+ limit: number;
84
+ hasNextPage: boolean;
85
+ cursor: string | null;
86
+ }
87
+ export interface WebhookTestArgs {
88
+ id: string;
89
+ actor?: Actor | null;
90
+ }
91
+ export interface WebhookRetryArgs {
92
+ /** A delivery id. The replay is a new attempt carrying the same event id. */
93
+ id: string;
94
+ actor?: Actor | null;
95
+ }
96
+ /** What one sweep of the retry queue did. */
97
+ export interface WebhookDispatchReport {
98
+ attempted: number;
99
+ delivered: number;
100
+ failed: number;
101
+ }
102
+ export interface CmsWebhooks {
103
+ readonly enabled: boolean;
104
+ list(args?: WebhookListArgs): Promise<WebhookSubscription[]>;
105
+ get(id: string): Promise<WebhookSubscription | null>;
106
+ create(args: WebhookCreateArgs): Promise<WebhookSubscription>;
107
+ update(args: WebhookUpdateArgs): Promise<WebhookSubscription>;
108
+ remove(args: {
109
+ id: string;
110
+ actor?: Actor | null;
111
+ }): Promise<boolean>;
112
+ deliveries(args?: WebhookDeliveryListArgs): Promise<WebhookDeliveryPage>;
113
+ /** Sends a synthetic `webhook.test` event to one subscription, now. */
114
+ test(args: WebhookTestArgs): Promise<WebhookDelivery>;
115
+ /** Replays a delivery: same event, new attempt, new row. */
116
+ retry(args: WebhookRetryArgs): Promise<WebhookDelivery>;
117
+ /**
118
+ * Fans one committed event out to its subscribers.
119
+ *
120
+ * Called by the outbox worker after the commit. It never throws: a
121
+ * subscriber that is down is a retry, not a failed event — making the
122
+ * outbox row fail would replay the event to every *other* subscriber too.
123
+ */
124
+ dispatch(event: CmsEvent): Promise<void>;
125
+ /** The `webhook-retries` sweep, also registered in `cms.jobs`. */
126
+ drain(args?: {
127
+ now?: Date;
128
+ limit?: number;
129
+ }): Promise<WebhookDispatchReport>;
130
+ /** Whether any active subscription wants this event type. */
131
+ wants(type: AnyEventType): Promise<boolean>;
132
+ }
133
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/types/webhooks.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The frozen contracts: every type the engine, the adapters and the plugins
3
+ * agree on. Implementations live elsewhere; this entry point is importable
4
+ * from anywhere, including a Worker that only needs the shapes.
5
+ */
6
+ export type * from "./types/index";
7
+ export { CmsError, CmsConfigError } from "./errors";
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mBAAmB,eAAe,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ import{e,n}from"./index-x72d1hzh.js";export{n as CmsConfigError,e as CmsError};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `@heyo-sh/heyo-cms/uploads`.
3
+ *
4
+ * Storage adapters, the image processor contract, and the two pieces of image
5
+ * work the engine does without a codec. Separate from the main entry point so
6
+ * a Worker bundle that never touches a file does not carry any of it.
7
+ *
8
+ * The lifecycle itself — reference counting, orphaning, collection — is not
9
+ * here: it is part of the engine, because it happens inside the transaction
10
+ * that saves a document (section 6).
11
+ */
12
+ export { local, memory } from "./storage/local";
13
+ export type { LocalStorageOptions, MemoryStorageOptions } from "./storage/local";
14
+ export { azure, gcs, r2, s3, type AzureStorageOptions, type GcsStorageOptions, type R2Binding, type R2StorageOptions, type S3StorageOptions, } from "./storage/providers";
15
+ export { encodeKey, httpStorage, type FetchLike, type HttpStorageOptions, type SignableRequest, } from "./storage/http";
16
+ export { signAwsV4, signAzure, type AwsCredentials, type AwsSignRequest, type AzureSignRequest, } from "./storage/sign";
17
+ export { sharpImages, type SharpImagesOptions } from "./media/sharp";
18
+ export { cloudflareImages, type CloudflareImageOutput, type CloudflareImagesBinding, type CloudflareImagesSource, type CloudflareImageTransformer, } from "./media/cloudflare";
19
+ export { extensionFor, imageContentType, probeImage, stripImageMetadata, } from "./media/index";
20
+ export type { ObjectMeta, SignedUrlOptions, StorageAdapter, StorageAdapterFactory, StorageConfig, StoredObject, } from "./types/storage";
21
+ export type { CropRect, FocalPoint, ImageFormat, ImageInfo, ImageProcessor, ImageTransform, MediaDocument, MediaStatus, MediaUsage, ProcessedImage, } from "./types/media";
22
+ //# sourceMappingURL=uploads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../src/uploads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EACL,KAAK,EACL,GAAG,EACH,EAAE,EACF,EAAE,EACF,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACd,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,GACf,MAAM,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ import"./index-sgdnp83t.js";import"./index-abfzb1ve.js";import"./index-6m1kjq9g.js";import{xo,Ee,Me,xe,wt,Ve,Yn,vt,Ge}from"./index-kc1j3h6z.js";import"./index-g4crf47y.js";import"./index-91fa1gzf.js";import{w}from"./index-rw0hze6x.js";import{x}from"./index-2ddk43me.js";import{e,n}from"./index-x72d1hzh.js";function j(t={}){let r=new Map,i=x(t.baseUrl??"memory://media");return{id:"memory",async put(s,a,o){r.set(s,{body:await xe(a),meta:o,lastModified:new Date})},async get(s){let a=r.get(s);if(!a)return null;return wt(a.body)},async delete(s){for(let a of s)r.delete(a)},url(s){return`${i}/${s}`},async head(s){let a=r.get(s);if(!a)return null;return{key:s,size:a.body.byteLength,contentType:a.meta.contentType,lastModified:a.lastModified}}}}function L(t){let r=x(t.baseUrl??"/media"),i=async(s)=>{let{join:a,normalize:o,resolve:c}=await import("node:path"),g=c(t.directory),d=c(a(g,o(s)));if(d!==g&&!d.startsWith(`${g}/`))throw new e(`Refusing to write outside the storage root: ${s}`,{status:400,code:"invalid_storage_key"});return d};return{id:"local",...t.prefix===void 0?{}:{prefix:t.prefix},async put(s,a){let{mkdir:o,writeFile:c}=await import("node:fs/promises"),{dirname:g}=await import("node:path"),d=await i(s);await o(g(d),{recursive:!0}),await c(d,await xe(a))},async get(s){let{readFile:a}=await import("node:fs/promises");try{let o=await a(await i(s));return wt(new Uint8Array(o))}catch{return null}},async delete(s){let{rm:a}=await import("node:fs/promises");for(let o of s)await a(await i(o),{force:!0})},url(s){return`${r}/${s}`},async head(s){let{stat:a}=await import("node:fs/promises");try{let o=await a(await i(s));return{key:s,size:o.size,contentType:"application/octet-stream",lastModified:o.mtime}}catch{return null}}}}function I(t){let r=t.fetch??((...a)=>fetch(...a)),i=async(a,o,c={})=>{let g=t.endpoint(o),d=c.body,u=await t.sign({method:a,url:g,headers:{...t.defaultHeaders,...c.headers},payload:d??new Uint8Array(0),contentLength:d?.byteLength??0});return r(g,{method:a,headers:u,...d===void 0?{}:{body:d}})},s=async(a,o,c)=>{let g=(await a.text().catch(()=>"")).slice(0,512);throw new e(`${t.id}: could not ${o} "${c}" (${a.status})${g?`: ${g}`:""}`,{status:502,code:"storage_request_failed"})};return{id:t.id,...t.prefix===void 0?{}:{prefix:t.prefix},async put(a,o,c){let g=await xe(o),d=await i("PUT",a,{body:g,headers:{"content-type":c.contentType,"content-length":String(g.byteLength),...c.cacheControl?{"cache-control":c.cacheControl}:{},...c.contentDisposition?{"content-disposition":c.contentDisposition}:{},...E(t.id,c.metadata)}});if(!d.ok)await s(d,"store",a)},async get(a){let o=await i("GET",a);if(o.status===404)return null;if(!o.ok)await s(o,"read",a);return o.body},async delete(a){for(let o of a){let c=await i("DELETE",o);if(!c.ok&&c.status!==404)await s(c,"delete",o)}},url(a){return t.publicUrl(a)},...t.signedUrl===void 0?{}:{signedUrl:t.signedUrl.bind(t)},async head(a){let o=await i("HEAD",a);if(o.status===404)return null;if(!o.ok)await s(o,"stat",a);let c=o.headers.get("last-modified");return{key:a,size:Number(o.headers.get("content-length")??0),contentType:o.headers.get("content-type")??"application/octet-stream",...c?{lastModified:new Date(c)}:{}}}}}function E(t,r){if(!r)return{};let i=t==="azure"?"x-ms-meta-":"x-amz-meta-";return Object.fromEntries(Object.entries(r).map(([s,a])=>[`${i}${s.toLowerCase()}`,a]))}function h(t){return t.split("/").map((r)=>encodeURIComponent(r)).join("/")}var P="UNSIGNED-PAYLOAD";async function A(t){let i=(t.now??new Date).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),s=i.slice(0,8),a=t.payload===P?P:Ve(await vt(t.payload)),o={...t.headers,host:t.url.host,"x-amz-date":i,"x-amz-content-sha256":a,...t.credentials.sessionToken?{"x-amz-security-token":t.credentials.sessionToken}:{}},c=Object.entries(o).map(([m,y])=>[m.toLowerCase(),y.trim().replace(/\s+/g," ")]).sort((m,y)=>m[0]<y[0]?-1:m[0]>y[0]?1:0),g=c.map(([m])=>m).join(";"),d=[t.method.toUpperCase(),_(t.url.pathname),B(t.url),`${c.map(([m,y])=>`${m}:${y}`).join(`
2
+ `)}
3
+ `,g,a].join(`
4
+ `),u=`${s}/${t.region}/${t.service}/aws4_request`,l=["AWS4-HMAC-SHA256",i,u,Ve(await vt(d))].join(`
5
+ `),p=await z(t.credentials.secretAccessKey,s,t.region,t.service),T=Ve(await S(p,l));return{...o,authorization:`AWS4-HMAC-SHA256 Credential=${t.credentials.accessKeyId}/${u}, SignedHeaders=${g}, Signature=${T}`}}async function O(t){let r=t.now??new Date,i={...t.headers,"x-ms-date":r.toUTCString(),"x-ms-version":"2021-08-06"},s=Object.entries(i).map(([d,u])=>[d.toLowerCase(),u.trim()]).filter(([d])=>d.startsWith("x-ms-")).sort((d,u)=>d[0]<u[0]?-1:1).map(([d,u])=>`${d}:${u}`).join(`
6
+ `),a=[...t.url.searchParams.keys()].map((d)=>d.toLowerCase()).sort().map((d)=>`${d}:${t.url.searchParams.getAll(d).sort().join(",")}`).join(`
7
+ `),o=`/${t.account}${decodeURIComponent(t.url.pathname)}`+(a?`
8
+ ${a}`:""),c=[t.method.toUpperCase(),i["content-encoding"]??"",i["content-language"]??"",t.contentLength?String(t.contentLength):"",i["content-md5"]??"",i["content-type"]??"","","","","","","",s,o].join(`
9
+ `),g=Yn(await S(K(t.key),c));return{...i,authorization:`SharedKey ${t.account}:${g}`}}async function z(t,r,i,s){let o=await S(new TextEncoder().encode(`AWS4${t}`),r);return o=await S(o,i),o=await S(o,s),S(o,"aws4_request")}async function S(t,r){let i=await crypto.subtle.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",i,new TextEncoder().encode(r));return new Uint8Array(s)}function _(t){return t.split("/").map((r)=>R(decodeURIComponent(r))).join("/")}function B(t){return[...t.searchParams.entries()].map(([r,i])=>[R(r),R(i)]).sort((r,i)=>r[0]<i[0]?-1:1).map(([r,i])=>`${r}=${i}`).join("&")}function R(t){return encodeURIComponent(t).replace(/[!'()*]/g,(r)=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`)}function K(t){let r=atob(t);return Uint8Array.from(r,(i)=>i.charCodeAt(0))}var D="1h";function F(t){if(!t.bucket)throw new n("uploads.storage","s3() needs a bucket");if(!t.region&&!t.endpoint)throw new n("uploads.storage","s3() needs a region, or an endpoint for an S3-compatible service");if(t.signedUrls?.expiresIn)w(t.signedUrls.expiresIn,"uploads.storage.signedUrls");return()=>C("s3",t,"s3")}function H(t){if(Y(t))return()=>G(t);let r=t;if(!r.accountId)throw new n("uploads.storage","r2() needs an accountId, or an R2 bucket binding");return()=>C("r2",{...r,region:"auto",endpoint:`https://${r.accountId}.r2.cloudflarestorage.com`,forcePathStyle:!0},"s3")}function v(t){if(!t.bucket)throw new n("uploads.storage","gcs() needs a bucket");return()=>C("gcs",{...t,region:t.region??"auto",endpoint:"https://storage.googleapis.com",forcePathStyle:!0},"s3")}function W(t){if(!t.account||!t.container)throw new n("uploads.storage","azure() needs an account and a container");return()=>{let r=U(t.accountKey??b("AZURE_STORAGE_KEY"),"azure()","an account key","AZURE_STORAGE_KEY"),i=`https://${t.account}.blob.core.windows.net/${t.container}`,s=x(t.publicUrl??i);return I({id:"azure",...t.fetch===void 0?{}:{fetch:t.fetch},...t.prefix===void 0?{}:{prefix:t.prefix},endpoint:(a)=>new URL(`${i}/${h(a)}`),publicUrl:(a)=>`${s}/${h(a)}`,defaultHeaders:{"x-ms-blob-type":"BlockBlob"},sign:(a)=>O({method:a.method,url:a.url,headers:a.headers,account:t.account,key:r,contentLength:a.contentLength})})}}function C(t,r,i){let s={accessKeyId:U(r.accessKeyId??b("AWS_ACCESS_KEY_ID"),`${t}()`,"an access key id","AWS_ACCESS_KEY_ID"),secretAccessKey:U(r.secretAccessKey??b("AWS_SECRET_ACCESS_KEY"),`${t}()`,"a secret access key","AWS_SECRET_ACCESS_KEY"),...r.sessionToken??b("AWS_SESSION_TOKEN")?{sessionToken:r.sessionToken??b("AWS_SESSION_TOKEN")}:{}},a=r.region??"us-east-1",o=r.forcePathStyle===!0||Boolean(r.endpoint),c=r.endpoint?x(r.endpoint):`https://s3.${a}.amazonaws.com`,g=o?`${c}/${r.bucket}`:X(c,r.bucket),d=x(r.publicUrl??g),u=()=>Math.floor(w(r.signedUrls?.expiresIn??D)/1000);return I({id:t,...r.fetch===void 0?{}:{fetch:r.fetch},...r.prefix===void 0?{}:{prefix:r.prefix},endpoint:(l)=>new URL(`${g}/${h(l)}`),publicUrl:(l)=>`${d}/${h(l)}`,...r.acl===void 0?{}:{defaultHeaders:{"x-amz-acl":r.acl}},sign:(l)=>A({method:l.method,url:l.url,headers:l.headers,payload:l.payload,region:a,service:i,credentials:s}),signedUrl:(l,p)=>N({url:new URL(`${g}/${h(l)}`),region:a,service:i,credentials:s,expiresIn:V(p?.expiresIn)??u(),...p?.download===!0?{disposition:`attachment${p.filename?`; filename="${p.filename}"`:""}`}:{}})})}async function N(t){let r=new Date,i=r.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),s=`${i.slice(0,8)}/${t.region}/${t.service}/aws4_request`,a=new URL(t.url.toString());if(a.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),a.searchParams.set("X-Amz-Credential",`${t.credentials.accessKeyId}/${s}`),a.searchParams.set("X-Amz-Date",i),a.searchParams.set("X-Amz-Expires",String(t.expiresIn)),a.searchParams.set("X-Amz-SignedHeaders","host"),t.credentials.sessionToken)a.searchParams.set("X-Amz-Security-Token",t.credentials.sessionToken);if(t.disposition)a.searchParams.set("response-content-disposition",t.disposition);let o=await A({method:"GET",url:a,headers:{},payload:"UNSIGNED-PAYLOAD",region:t.region,service:t.service,credentials:{...t.credentials,sessionToken:void 0},now:r}),c=/Signature=([a-f0-9]+)/.exec(o.authorization??"")?.[1];return a.searchParams.set("X-Amz-Signature",c??""),a.toString()}function G(t){return{id:"r2",async put(r,i,s){await t.put(r,i,{httpMetadata:{contentType:s.contentType,...s.cacheControl?{cacheControl:s.cacheControl}:{}},...s.metadata?{customMetadata:s.metadata}:{}})},async get(r){let i=await t.get(r);return i?i.body:null},async delete(r){if(r.length>0)await t.delete(r)},url(r){return`/${r}`},async head(r){let i=await t.head(r);if(!i)return null;return{key:r,size:i.size,contentType:i.httpMetadata?.contentType??"application/octet-stream",...i.uploaded?{lastModified:i.uploaded}:{}}}}}function Y(t){return typeof t==="object"&&t!==null&&typeof t.get==="function"&&typeof t.put==="function"&&typeof t.head==="function"}function X(t,r){let i=new URL(t);return i.host=`${r}.${i.host}`,i.toString().replace(/\/+$/,"")}function b(t){return globalThis.process?.env?.[t]}function U(t,r,i,s){if(t)return t;throw new e(`${r} needs ${i}; pass it in the configuration or set ${s}`,{status:500,code:"storage_credentials_missing"})}function V(t){if(t===void 0)return;return typeof t==="number"?t:Math.floor(w(t)/1000)}var Z=new Set(["image/jpeg","image/png","image/webp","image/avif","image/gif","image/tiff"]),k;async function Q(){return k??=(async()=>{try{let r=await import("sharp");return r.default??r}catch{throw new e("sharpImages() needs the optional `sharp` package; install it, or configure uploads.images without transformations.",{status:500,code:"image_processor_missing"})}})(),k}function J(t={}){return{id:"sharp",supports:(r)=>Z.has(r.toLowerCase()),async transform(r,i,s){let o=(await Q())(r,{...t.limitInputPixels===void 0?{}:{limitInputPixels:t.limitInputPixels}});if(t.autoOrient!==!1)o=o.rotate();let{width:c,height:g}=s,d=M(c,g,i);if(d)o=o.extract(d),c=d.width,g=d.height;if(i.width!==void 0||i.height!==void 0)o=o.resize({...i.width===void 0?{}:{width:i.width},...i.height===void 0?{}:{height:i.height},fit:i.fit??"inside",withoutEnlargement:!0});let u=i.format??te(s.contentType);if(o=o.toFormat(u,{...i.quality===void 0?{}:{quality:i.quality}}),i.stripMetadata===!1)o=o.keepMetadata();let l=await o.toBuffer({resolveWithObject:!0});return{data:l.data,contentType:`image/${l.info.format}`,width:l.info.width,height:l.info.height}}}}function M(t,r,i){if(t<=0||r<=0)return null;let s=i.crop&&ee(i.crop,t,r),a=s||{left:0,top:0,width:t,height:r},o=i.fit==="cover"&&i.position&&i.width&&i.height?q(a.width,a.height,i.width/i.height,{x:(i.position.x*t-a.left)/a.width,y:(i.position.y*r-a.top)/a.height}):null;if(!o)return s||null;return{left:a.left+o.left,top:a.top+o.top,width:o.width,height:o.height}}function q(t,r,i,s){if(t<=0||r<=0||!Number.isFinite(i)||i<=0)return null;let a=t/r,o=a>i?f(Math.round(r*i),1,t):t,c=a>i?r:f(Math.round(t/i),1,r);if(o>=t&&c>=r)return null;return{left:f(Math.round(s.x*t-o/2),0,t-o),top:f(Math.round(s.y*r-c/2),0,r-c),width:o,height:c}}function ee(t,r,i){let s=f(Math.round(t.x),0,Math.max(r-1,0)),a=f(Math.round(t.y),0,Math.max(i-1,0)),o=f(Math.round(t.width),1,r-s),c=f(Math.round(t.height),1,i-a);if(o<=0||c<=0)return null;return{left:s,top:a,width:o,height:c}}function f(t,r,i){return Math.min(Math.max(t,r),Math.max(r,i))}function te(t){let r=t.split("/")[1]??"jpeg";return r==="jpg"?"jpeg":r}var ne=new Set(["image/jpeg","image/png","image/gif","image/webp"]);function re(t){return{id:"cloudflare-images",supports:(r)=>ne.has(r.toLowerCase()),async transform(r,i,s){let a=typeof t==="function"?await t():t;if(!a)throw new e('cloudflareImages() has no Images binding: add `"images": { "binding": "IMAGES" }` to wrangler.json and pass the binding (or a function returning it) to cloudflareImages().',{status:500,code:"image_processor_missing"});let o=ie(s,i),c=a.input(oe(r));if(o.options)c=c.transform(o.options);let g=await c.output({format:i.format?`image/${i.format}`:ae(s.contentType),...i.quality===void 0?{}:{quality:i.quality}}),d=new Uint8Array(await new Response(g.image()).arrayBuffer()),u=Ee(d);return{data:d,contentType:g.contentType(),width:u?.width??o.width,height:u?.height??o.height}}}}function ie(t,r){let i={},s=M(t.width,t.height,r),a=s?.width??t.width,o=s?.height??t.height;if(s)i.trim={top:s.top,left:s.left,width:s.width,height:s.height};let c=a,g=o,{width:d,height:u}=r,l=r.fit??"inside";if(d!==void 0||u!==void 0)if(l==="cover"&&d!==void 0&&u!==void 0){let p=Math.max(d/a,u/o);c=p>1?Math.max(1,Math.round(d/p)):d,g=p>1?Math.max(1,Math.round(u/p)):u,Object.assign(i,{width:c,height:g,fit:"cover"})}else if(l==="contain"&&d!==void 0&&u!==void 0)c=d,g=u,Object.assign(i,{width:c,height:g,fit:"pad"});else if(l==="outside"){let p=Math.min(1,Math.max(d===void 0?0:d/a,u===void 0?0:u/o));c=Math.max(1,Math.round(a*p)),g=Math.max(1,Math.round(o*p)),Object.assign(i,{width:c,height:g,fit:"scale-down"})}else{let p=Math.min(d===void 0?1/0:d/a,u===void 0?1/0:u/o,1);c=Math.max(1,Math.round(a*p)),g=Math.max(1,Math.round(o*p)),Object.assign(i,{...d===void 0?{}:{width:d},...u===void 0?{}:{height:u},fit:"scale-down"})}return{options:Object.keys(i).length>0?i:null,width:c,height:g}}function ae(t){let r=t.toLowerCase().split(";")[0]?.trim()??"";return r==="image/jpg"?"image/jpeg":r}function oe(t){return new ReadableStream({start(r){r.enqueue(t),r.close()}})}export{W as azure,re as cloudflareImages,h as encodeKey,Me as extensionFor,v as gcs,I as httpStorage,xo as imageContentType,L as local,j as memory,Ee as probeImage,H as r2,F as s3,J as sharpImages,A as signAwsV4,O as signAzure,Ge as stripImageMetadata};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Webhook delivery (section 7).
3
+ *
4
+ * The outbox decides *that* an event happened; this directory decides who
5
+ * hears about it and keeps trying until they do.
6
+ */
7
+ export { createWebhooks, type WebhookRuntime } from "./service";
8
+ export { webhookRetryJob } from "./job";
9
+ export { signatureHeader, signPayload, verifySignature } from "./sign";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { JobDefinition } from "../engine/jobs";
2
+ import type { WebhookRuntime } from "./service";
3
+ /**
4
+ * The retry sweep.
5
+ *
6
+ * Registered in `cms.jobs` only when webhooks are enabled, so
7
+ * `cms.inspect().jobs` lists what will actually run. The first attempt
8
+ * happens inline, right after the commit: this is for the ones that did not
9
+ * land, and it is the reason an outage at a subscriber costs them a delay
10
+ * rather than the event.
11
+ *
12
+ * `exists` next to `lte` for the same reason the scheduled-change sweep needs
13
+ * it: on MongoDB a missing `next_attempt_at` compares below a date, so a
14
+ * delivery that has never been attempted would look due on every pass.
15
+ */
16
+ export declare function webhookRetryJob(webhooks: WebhookRuntime): JobDefinition;
17
+ //# sourceMappingURL=job.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/webhooks/job.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa,CAgCvE"}
@@ -0,0 +1,53 @@
1
+ import type { ResolvedCmsConfig } from "../types/config";
2
+ import type { DatabaseAdapter } from "../types/database";
3
+ import type { Tx } from "../types/query";
4
+ import type { CmsWebhooks, WebhookDelivery } from "../types/webhooks";
5
+ import type { BufferedEvent, OutboxEntryMeta } from "../engine/outbox";
6
+ /**
7
+ * The service, plus the one operation only a sweep needs.
8
+ *
9
+ * `cms.webhooks` is the public `CmsWebhooks`; the runner holds this. Keeping
10
+ * "re-attempt this exact row" off the public type is deliberate: a caller
11
+ * that wants to re-send something wants `retry()`, which records a new
12
+ * attempt instead of quietly rewriting the history of an old one.
13
+ */
14
+ export interface WebhookRuntime extends CmsWebhooks {
15
+ attemptDelivery(id: string, at?: Date): Promise<WebhookDelivery | null>;
16
+ }
17
+ /**
18
+ * What the service needs from `fetch`, and no more.
19
+ *
20
+ * Narrower than `typeof fetch` on purpose: that type carries whatever the
21
+ * host runtime bolted on — Bun adds `preconnect` — and a package that has to
22
+ * build the same way on Node, Bun and Workers cannot depend on which one is
23
+ * compiling it.
24
+ */
25
+ export type WebhookFetch = (url: string, init: RequestInit) => Promise<Response>;
26
+ export interface WebhookServiceOptions {
27
+ config: ResolvedCmsConfig;
28
+ database(): Promise<DatabaseAdapter>;
29
+ emit(tx: Tx, events: BufferedEvent[], meta: OutboxEntryMeta): Promise<void>;
30
+ deliver(): void;
31
+ /** Injectable so a test does not need a socket. Defaults to `fetch`. */
32
+ fetch?: WebhookFetch;
33
+ now?: () => Date;
34
+ }
35
+ /**
36
+ * `cms.webhooks`.
37
+ *
38
+ * The contract, in one place, is section 7:
39
+ *
40
+ * - **Signed.** Every request carries an HMAC over `timestamp.body`, so a
41
+ * receiver can tell a delivery from a stranger with a URL.
42
+ * - **Identified.** `x-heyo-event-id` and `x-heyo-delivery-id` let a consumer
43
+ * be idempotent, which matters because retries are a promise rather than an
44
+ * accident.
45
+ * - **Retried, then parked.** Five attempts with exponential backoff, then
46
+ * the delivery is `failed` and stays in the table for replay. A dead letter
47
+ * that disappears is a dead letter nobody can act on.
48
+ * - **Ordered per document, not globally.** The outbox is drained in
49
+ * insertion order and a document's events are inserted in the order they
50
+ * happened; across documents, parallel delivery is the point.
51
+ */
52
+ export declare function createWebhooks(options: WebhookServiceOptions): WebhookRuntime;
53
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/webhooks/service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAgB,EAAE,EAAS,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EACV,WAAW,EAEX,eAAe,EAUhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAUvE;;;;;;;GAOG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CACzE;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,KACd,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,OAAO,IAAI,IAAI,CAAC;IAChB,wEAAwE;IACxE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CA4gB7E"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The signature a consumer verifies.
3
+ *
4
+ * `t=<unix seconds>,v1=<hex hmac>` over `${t}.${body}`, which is the shape
5
+ * Stripe popularised and most receivers already have code for. The timestamp
6
+ * is inside the signed string on purpose: without it a captured delivery can
7
+ * be replayed forever, and the consumer has no way to notice.
8
+ */
9
+ export declare const signatureHeader = "x-heyo-signature";
10
+ export declare function signPayload(body: string, secret: string, timestamp?: number): Promise<string>;
11
+ /**
12
+ * Verifies a signature the way a consumer should.
13
+ *
14
+ * Exported because the first thing anybody writes after subscribing is this
15
+ * function, and the second thing they do is get it subtly wrong — comparing
16
+ * with `===`, or forgetting that the timestamp is part of the signed string.
17
+ */
18
+ export declare function verifySignature(options: {
19
+ body: string;
20
+ header: string;
21
+ secret: string;
22
+ /** Rejects a delivery older than this. Defaults to five minutes. */
23
+ toleranceSeconds?: number;
24
+ now?: number;
25
+ }): Promise<boolean>;
26
+ //# sourceMappingURL=sign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/webhooks/sign.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAElD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,SAAgC,GACxC,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBnB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `@heyo-sh/heyo-cms/webhooks`.
3
+ *
4
+ * Subscriptions are managed through `cms.webhooks` and the routes under
5
+ * `/webhooks`. What is here is the part a *consumer* needs: the signature
6
+ * scheme, and a verifier so nobody has to write the HMAC comparison again.
7
+ */
8
+ export { signatureHeader, signPayload, verifySignature } from "./webhooks/sign";
9
+ export type { CmsWebhooks, WebhookCreateArgs, WebhookDelivery, WebhookDeliveryListArgs, WebhookDeliveryPage, WebhookDeliveryStatus, WebhookDispatchReport, WebhookFilters, WebhookListArgs, WebhookRetryArgs, WebhookSubscription, WebhookTestArgs, WebhookUpdateArgs, } from "./types/webhooks";
10
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ import{Ae,ke,Cn}from"./index-466cwb0b.js";export{ke as signPayload,Ae as signatureHeader,Cn as verifySignature};
package/package.json CHANGED
@@ -1,6 +1,189 @@
1
1
  {
2
2
  "name": "@heyo-sh/heyo-cms",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Framework-agnostic, TypeScript-first headless CMS with its own panel, RBAC, i18n, native AI and first-class media.",
5
+ "keywords": [
6
+ "cms",
7
+ "headless-cms",
8
+ "typescript",
9
+ "postgres",
10
+ "mongodb",
11
+ "sqlite",
12
+ "cloudflare-workers",
13
+ "vercel"
14
+ ],
15
+ "homepage": "https://heyo.sh",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/heyo-sh/heyo-cms.git",
19
+ "directory": "packages/heyo-cms"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/heyo-sh/heyo-cms/issues"
23
+ },
24
+ "license": "MIT",
25
+ "type": "module",
26
+ "files": [
27
+ "dist",
28
+ "LICENSE",
29
+ "README.md"
30
+ ],
31
+ "bin": {
32
+ "heyo-cms": "./dist/cli.js"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "typebox": "1.4.2",
39
+ "zod": "4.6.7"
40
+ },
41
+ "peerDependencies": {
42
+ "@mariozechner/pi-agent-core": "^0.73.0",
43
+ "@mariozechner/pi-ai": "^0.73.0",
44
+ "mongodb": "^6.0.0 || ^7.0.0",
45
+ "pg": "^8.0.0",
46
+ "sharp": "^0.33.0 || ^0.34.0 || ^0.35.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@mariozechner/pi-agent-core": {
50
+ "optional": true
51
+ },
52
+ "@mariozechner/pi-ai": {
53
+ "optional": true
54
+ },
55
+ "mongodb": {
56
+ "optional": true
57
+ },
58
+ "pg": {
59
+ "optional": true
60
+ },
61
+ "sharp": {
62
+ "optional": true
63
+ }
64
+ },
65
+ "devDependencies": {
66
+ "@electric-sql/pglite": "0.5.10",
67
+ "@mariozechner/pi-agent-core": "0.73.1",
68
+ "@mariozechner/pi-ai": "0.73.1",
69
+ "pg": "8.16.3"
70
+ },
71
+ "exports": {
72
+ ".": {
73
+ "types": "./dist/index.d.ts",
74
+ "default": "./dist/index.js"
75
+ },
76
+ "./types": {
77
+ "types": "./dist/types.d.ts",
78
+ "default": "./dist/types.js"
79
+ },
80
+ "./config": {
81
+ "types": "./dist/config.d.ts",
82
+ "default": "./dist/config.js"
83
+ },
84
+ "./fields": {
85
+ "types": "./dist/fields.d.ts",
86
+ "default": "./dist/fields.js"
87
+ },
88
+ "./http": {
89
+ "types": "./dist/http.d.ts",
90
+ "default": "./dist/http.js"
91
+ },
92
+ "./client": {
93
+ "types": "./dist/client.d.ts",
94
+ "default": "./dist/client.js"
95
+ },
96
+ "./content": {
97
+ "types": "./dist/content.d.ts",
98
+ "default": "./dist/content.js"
99
+ },
100
+ "./telemetry": {
101
+ "types": "./dist/telemetry.d.ts",
102
+ "default": "./dist/telemetry.js"
103
+ },
104
+ "./next": {
105
+ "types": "./dist/adapters/next.d.ts",
106
+ "default": "./dist/adapters/next.js"
107
+ },
108
+ "./astro": {
109
+ "types": "./dist/adapters/astro.d.ts",
110
+ "default": "./dist/adapters/astro.js"
111
+ },
112
+ "./react-router": {
113
+ "types": "./dist/adapters/react-router.d.ts",
114
+ "default": "./dist/adapters/react-router.js"
115
+ },
116
+ "./sveltekit": {
117
+ "types": "./dist/adapters/sveltekit.d.ts",
118
+ "default": "./dist/adapters/sveltekit.js"
119
+ },
120
+ "./nuxt": {
121
+ "types": "./dist/adapters/nuxt.d.ts",
122
+ "default": "./dist/adapters/nuxt.js"
123
+ },
124
+ "./schema": {
125
+ "types": "./dist/schema.d.ts",
126
+ "default": "./dist/schema.js"
127
+ },
128
+ "./query": {
129
+ "types": "./dist/query.d.ts",
130
+ "default": "./dist/query.js"
131
+ },
132
+ "./migrations": {
133
+ "types": "./dist/migrations.d.ts",
134
+ "default": "./dist/migrations.js"
135
+ },
136
+ "./auth": {
137
+ "types": "./dist/auth.d.ts",
138
+ "default": "./dist/auth.js"
139
+ },
140
+ "./uploads": {
141
+ "types": "./dist/uploads.d.ts",
142
+ "default": "./dist/uploads.js"
143
+ },
144
+ "./editor": {
145
+ "types": "./dist/editor.d.ts",
146
+ "default": "./dist/editor.js"
147
+ },
148
+ "./ai": {
149
+ "types": "./dist/ai.d.ts",
150
+ "default": "./dist/ai.js"
151
+ },
152
+ "./webhooks": {
153
+ "types": "./dist/webhooks.d.ts",
154
+ "default": "./dist/webhooks.js"
155
+ },
156
+ "./plugins": {
157
+ "types": "./dist/plugins.d.ts",
158
+ "default": "./dist/plugins.js"
159
+ },
160
+ "./jobs": {
161
+ "types": "./dist/jobs.d.ts",
162
+ "default": "./dist/jobs.js"
163
+ },
164
+ "./postgres": {
165
+ "types": "./dist/db/postgres.d.ts",
166
+ "default": "./dist/db/postgres.js"
167
+ },
168
+ "./sqlite": {
169
+ "types": "./dist/db/sqlite.d.ts",
170
+ "default": "./dist/db/sqlite.js"
171
+ },
172
+ "./d1": {
173
+ "types": "./dist/db/d1.d.ts",
174
+ "default": "./dist/db/d1.js"
175
+ },
176
+ "./mongodb": {
177
+ "types": "./dist/db/mongodb.d.ts",
178
+ "default": "./dist/db/mongodb.js"
179
+ }
180
+ },
181
+ "scripts": {
182
+ "dev": "bun run build --watch",
183
+ "build": "rm -rf dist && bun run build:core && bun run build:types",
184
+ "build:core": "bun build src/index.ts src/types.ts src/config.ts src/fields.ts src/schema.ts src/query.ts src/migrations.ts src/auth.ts src/uploads.ts src/editor.ts src/ai.ts src/webhooks.ts src/plugins.ts src/jobs.ts src/http.ts src/client.ts src/content.ts src/telemetry.ts src/cli.ts src/adapters/next.ts src/adapters/astro.ts src/adapters/react-router.ts src/adapters/sveltekit.ts src/adapters/nuxt.ts src/db/postgres.ts src/db/sqlite.ts src/db/d1.ts src/db/mongodb.ts --outdir dist --root src --target node --production --splitting --external zod --external pg --external mongodb --external sharp --external @mariozechner/pi-ai --external @mariozechner/pi-agent-core --external typebox",
185
+ "build:types": "tsc -p tsconfig.build.json",
186
+ "typecheck": "tsc -p tsconfig.json",
187
+ "test": "bun test"
188
+ }
189
+ }