sendwend 0.0.0-stage → 12.7.3

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 (680) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2082 -2
  3. package/dist/_virtual/_rolldown/runtime.cjs +22 -0
  4. package/dist/apns-relay.cjs +91 -0
  5. package/dist/apns-relay.cjs.map +1 -0
  6. package/dist/apns-relay.d.cts +26 -0
  7. package/dist/apns-relay.d.cts.map +1 -0
  8. package/dist/apns-relay.d.mts +26 -0
  9. package/dist/apns-relay.d.mts.map +1 -0
  10. package/dist/apns-relay.mjs +90 -0
  11. package/dist/apns-relay.mjs.map +1 -0
  12. package/dist/apns.cjs +215 -0
  13. package/dist/apns.cjs.map +1 -0
  14. package/dist/apns.d.cts +110 -0
  15. package/dist/apns.d.cts.map +1 -0
  16. package/dist/apns.d.mts +110 -0
  17. package/dist/apns.d.mts.map +1 -0
  18. package/dist/apns.mjs +207 -0
  19. package/dist/apns.mjs.map +1 -0
  20. package/dist/aws/engine-step.cjs +105 -0
  21. package/dist/aws/engine-step.cjs.map +1 -0
  22. package/dist/aws/engine-step.d.cts +42 -0
  23. package/dist/aws/engine-step.d.cts.map +1 -0
  24. package/dist/aws/engine-step.d.mts +42 -0
  25. package/dist/aws/engine-step.d.mts.map +1 -0
  26. package/dist/aws/engine-step.mjs +103 -0
  27. package/dist/aws/engine-step.mjs.map +1 -0
  28. package/dist/aws/function-url.cjs +53 -0
  29. package/dist/aws/function-url.cjs.map +1 -0
  30. package/dist/aws/function-url.d.cts +36 -0
  31. package/dist/aws/function-url.d.cts.map +1 -0
  32. package/dist/aws/function-url.d.mts +36 -0
  33. package/dist/aws/function-url.d.mts.map +1 -0
  34. package/dist/aws/function-url.mjs +50 -0
  35. package/dist/aws/function-url.mjs.map +1 -0
  36. package/dist/aws/index.cjs +232 -0
  37. package/dist/aws/index.cjs.map +1 -0
  38. package/dist/aws/index.d.cts +73 -0
  39. package/dist/aws/index.d.cts.map +1 -0
  40. package/dist/aws/index.d.mts +73 -0
  41. package/dist/aws/index.d.mts.map +1 -0
  42. package/dist/aws/index.mjs +218 -0
  43. package/dist/aws/index.mjs.map +1 -0
  44. package/dist/aws/instances.cjs +218 -0
  45. package/dist/aws/instances.cjs.map +1 -0
  46. package/dist/aws/instances.d.cts +102 -0
  47. package/dist/aws/instances.d.cts.map +1 -0
  48. package/dist/aws/instances.d.mts +102 -0
  49. package/dist/aws/instances.d.mts.map +1 -0
  50. package/dist/aws/instances.mjs +214 -0
  51. package/dist/aws/instances.mjs.map +1 -0
  52. package/dist/aws/lambda-api.cjs +86 -0
  53. package/dist/aws/lambda-api.cjs.map +1 -0
  54. package/dist/aws/lambda-api.d.cts +41 -0
  55. package/dist/aws/lambda-api.d.cts.map +1 -0
  56. package/dist/aws/lambda-api.d.mts +41 -0
  57. package/dist/aws/lambda-api.d.mts.map +1 -0
  58. package/dist/aws/lambda-api.mjs +85 -0
  59. package/dist/aws/lambda-api.mjs.map +1 -0
  60. package/dist/client.cjs +216 -0
  61. package/dist/client.cjs.map +1 -0
  62. package/dist/client.d.cts +193 -0
  63. package/dist/client.d.cts.map +1 -0
  64. package/dist/client.d.mts +193 -0
  65. package/dist/client.d.mts.map +1 -0
  66. package/dist/client.mjs +212 -0
  67. package/dist/client.mjs.map +1 -0
  68. package/dist/cloudflare/bindings.cjs +49 -0
  69. package/dist/cloudflare/bindings.cjs.map +1 -0
  70. package/dist/cloudflare/bindings.d.cts +31 -0
  71. package/dist/cloudflare/bindings.d.cts.map +1 -0
  72. package/dist/cloudflare/bindings.d.mts +31 -0
  73. package/dist/cloudflare/bindings.d.mts.map +1 -0
  74. package/dist/cloudflare/bindings.mjs +46 -0
  75. package/dist/cloudflare/bindings.mjs.map +1 -0
  76. package/dist/cloudflare/index.cjs +73 -0
  77. package/dist/cloudflare/index.d.cts +25 -0
  78. package/dist/cloudflare/index.d.mts +25 -0
  79. package/dist/cloudflare/index.mjs +20 -0
  80. package/dist/cloudflare/runner.cjs +200 -0
  81. package/dist/cloudflare/runner.cjs.map +1 -0
  82. package/dist/cloudflare/runner.d.cts +83 -0
  83. package/dist/cloudflare/runner.d.cts.map +1 -0
  84. package/dist/cloudflare/runner.d.mts +83 -0
  85. package/dist/cloudflare/runner.d.mts.map +1 -0
  86. package/dist/cloudflare/runner.mjs +199 -0
  87. package/dist/cloudflare/runner.mjs.map +1 -0
  88. package/dist/cloudflare/worker.cjs +106 -0
  89. package/dist/cloudflare/worker.cjs.map +1 -0
  90. package/dist/cloudflare/worker.d.cts +52 -0
  91. package/dist/cloudflare/worker.d.cts.map +1 -0
  92. package/dist/cloudflare/worker.d.mts +52 -0
  93. package/dist/cloudflare/worker.d.mts.map +1 -0
  94. package/dist/cloudflare/worker.mjs +104 -0
  95. package/dist/cloudflare/worker.mjs.map +1 -0
  96. package/dist/cloudflare/workers.d.cjs +0 -0
  97. package/dist/cloudflare/workers.d.cts +42 -0
  98. package/dist/cloudflare/workers.d.cts.map +1 -0
  99. package/dist/cloudflare/workers.d.mts +42 -0
  100. package/dist/cloudflare/workers.d.mts.map +1 -0
  101. package/dist/config.cjs +257 -0
  102. package/dist/config.cjs.map +1 -0
  103. package/dist/config.d.cts +184 -0
  104. package/dist/config.d.cts.map +1 -0
  105. package/dist/config.d.mts +184 -0
  106. package/dist/config.d.mts.map +1 -0
  107. package/dist/config.mjs +246 -0
  108. package/dist/config.mjs.map +1 -0
  109. package/dist/contract.cjs +222 -0
  110. package/dist/contract.cjs.map +1 -0
  111. package/dist/contract.d.cts +110 -0
  112. package/dist/contract.d.cts.map +1 -0
  113. package/dist/contract.d.mts +110 -0
  114. package/dist/contract.d.mts.map +1 -0
  115. package/dist/contract.mjs +216 -0
  116. package/dist/contract.mjs.map +1 -0
  117. package/dist/date-time.cjs +22 -0
  118. package/dist/date-time.cjs.map +1 -0
  119. package/dist/date-time.d.cts +10 -0
  120. package/dist/date-time.d.cts.map +1 -0
  121. package/dist/date-time.d.mts +10 -0
  122. package/dist/date-time.d.mts.map +1 -0
  123. package/dist/date-time.mjs +21 -0
  124. package/dist/date-time.mjs.map +1 -0
  125. package/dist/dsl/action.cjs +25 -0
  126. package/dist/dsl/action.cjs.map +1 -0
  127. package/dist/dsl/action.d.cts +63 -0
  128. package/dist/dsl/action.d.cts.map +1 -0
  129. package/dist/dsl/action.d.mts +63 -0
  130. package/dist/dsl/action.d.mts.map +1 -0
  131. package/dist/dsl/action.mjs +24 -0
  132. package/dist/dsl/action.mjs.map +1 -0
  133. package/dist/dsl/base.cjs +33 -0
  134. package/dist/dsl/base.cjs.map +1 -0
  135. package/dist/dsl/base.d.cts +43 -0
  136. package/dist/dsl/base.d.cts.map +1 -0
  137. package/dist/dsl/base.d.mts +43 -0
  138. package/dist/dsl/base.d.mts.map +1 -0
  139. package/dist/dsl/base.mjs +29 -0
  140. package/dist/dsl/base.mjs.map +1 -0
  141. package/dist/dsl/bundle.cjs +287 -0
  142. package/dist/dsl/bundle.cjs.map +1 -0
  143. package/dist/dsl/bundle.d.cts +33 -0
  144. package/dist/dsl/bundle.d.cts.map +1 -0
  145. package/dist/dsl/bundle.d.mts +33 -0
  146. package/dist/dsl/bundle.d.mts.map +1 -0
  147. package/dist/dsl/bundle.mjs +284 -0
  148. package/dist/dsl/bundle.mjs.map +1 -0
  149. package/dist/dsl/condition.cjs +200 -0
  150. package/dist/dsl/condition.cjs.map +1 -0
  151. package/dist/dsl/condition.d.cts +151 -0
  152. package/dist/dsl/condition.d.cts.map +1 -0
  153. package/dist/dsl/condition.d.mts +151 -0
  154. package/dist/dsl/condition.d.mts.map +1 -0
  155. package/dist/dsl/condition.mjs +178 -0
  156. package/dist/dsl/condition.mjs.map +1 -0
  157. package/dist/dsl/flow.cjs +335 -0
  158. package/dist/dsl/flow.cjs.map +1 -0
  159. package/dist/dsl/flow.d.cts +278 -0
  160. package/dist/dsl/flow.d.cts.map +1 -0
  161. package/dist/dsl/flow.d.mts +278 -0
  162. package/dist/dsl/flow.d.mts.map +1 -0
  163. package/dist/dsl/flow.mjs +331 -0
  164. package/dist/dsl/flow.mjs.map +1 -0
  165. package/dist/dsl/index.cjs +37 -0
  166. package/dist/dsl/index.d.cts +34 -0
  167. package/dist/dsl/index.d.mts +34 -0
  168. package/dist/dsl/index.mjs +9 -0
  169. package/dist/dsl/refs.cjs +101 -0
  170. package/dist/dsl/refs.cjs.map +1 -0
  171. package/dist/dsl/refs.d.cts +127 -0
  172. package/dist/dsl/refs.d.cts.map +1 -0
  173. package/dist/dsl/refs.d.mts +127 -0
  174. package/dist/dsl/refs.d.mts.map +1 -0
  175. package/dist/dsl/refs.mjs +93 -0
  176. package/dist/dsl/refs.mjs.map +1 -0
  177. package/dist/dsl/template.cjs +19 -0
  178. package/dist/dsl/template.cjs.map +1 -0
  179. package/dist/dsl/template.d.cts +30 -0
  180. package/dist/dsl/template.d.cts.map +1 -0
  181. package/dist/dsl/template.d.mts +30 -0
  182. package/dist/dsl/template.d.mts.map +1 -0
  183. package/dist/dsl/template.mjs +18 -0
  184. package/dist/dsl/template.mjs.map +1 -0
  185. package/dist/dsl/trigger.cjs +53 -0
  186. package/dist/dsl/trigger.cjs.map +1 -0
  187. package/dist/dsl/trigger.d.cts +112 -0
  188. package/dist/dsl/trigger.d.cts.map +1 -0
  189. package/dist/dsl/trigger.d.mts +112 -0
  190. package/dist/dsl/trigger.d.mts.map +1 -0
  191. package/dist/dsl/trigger.mjs +52 -0
  192. package/dist/dsl/trigger.mjs.map +1 -0
  193. package/dist/dsl/workflow.cjs +143 -0
  194. package/dist/dsl/workflow.cjs.map +1 -0
  195. package/dist/dsl/workflow.d.cts +88 -0
  196. package/dist/dsl/workflow.d.cts.map +1 -0
  197. package/dist/dsl/workflow.d.mts +88 -0
  198. package/dist/dsl/workflow.d.mts.map +1 -0
  199. package/dist/dsl/workflow.mjs +142 -0
  200. package/dist/dsl/workflow.mjs.map +1 -0
  201. package/dist/email-context.cjs +28 -0
  202. package/dist/email-context.cjs.map +1 -0
  203. package/dist/email-context.d.cts +9 -0
  204. package/dist/email-context.d.cts.map +1 -0
  205. package/dist/email-context.d.mts +9 -0
  206. package/dist/email-context.d.mts.map +1 -0
  207. package/dist/email-context.mjs +26 -0
  208. package/dist/email-context.mjs.map +1 -0
  209. package/dist/email-sender.cjs +93 -0
  210. package/dist/email-sender.cjs.map +1 -0
  211. package/dist/email-sender.d.cts +88 -0
  212. package/dist/email-sender.d.cts.map +1 -0
  213. package/dist/email-sender.d.mts +88 -0
  214. package/dist/email-sender.d.mts.map +1 -0
  215. package/dist/email-sender.mjs +90 -0
  216. package/dist/email-sender.mjs.map +1 -0
  217. package/dist/email.cjs +73 -0
  218. package/dist/email.cjs.map +1 -0
  219. package/dist/email.d.cts +59 -0
  220. package/dist/email.d.cts.map +1 -0
  221. package/dist/email.d.mts +59 -0
  222. package/dist/email.d.mts.map +1 -0
  223. package/dist/email.mjs +68 -0
  224. package/dist/email.mjs.map +1 -0
  225. package/dist/engine/actions.cjs +19 -0
  226. package/dist/engine/actions.cjs.map +1 -0
  227. package/dist/engine/actions.d.cts +27 -0
  228. package/dist/engine/actions.d.cts.map +1 -0
  229. package/dist/engine/actions.d.mts +27 -0
  230. package/dist/engine/actions.d.mts.map +1 -0
  231. package/dist/engine/actions.mjs +18 -0
  232. package/dist/engine/actions.mjs.map +1 -0
  233. package/dist/engine/bucket.cjs +71 -0
  234. package/dist/engine/bucket.cjs.map +1 -0
  235. package/dist/engine/bucket.d.cts +30 -0
  236. package/dist/engine/bucket.d.cts.map +1 -0
  237. package/dist/engine/bucket.d.mts +30 -0
  238. package/dist/engine/bucket.d.mts.map +1 -0
  239. package/dist/engine/bucket.mjs +68 -0
  240. package/dist/engine/bucket.mjs.map +1 -0
  241. package/dist/engine/condition.cjs +199 -0
  242. package/dist/engine/condition.cjs.map +1 -0
  243. package/dist/engine/condition.d.cts +76 -0
  244. package/dist/engine/condition.d.cts.map +1 -0
  245. package/dist/engine/condition.d.mts +76 -0
  246. package/dist/engine/condition.d.mts.map +1 -0
  247. package/dist/engine/condition.mjs +192 -0
  248. package/dist/engine/condition.mjs.map +1 -0
  249. package/dist/engine/duration.cjs +33 -0
  250. package/dist/engine/duration.cjs.map +1 -0
  251. package/dist/engine/duration.d.cts +3 -0
  252. package/dist/engine/duration.d.cts.map +1 -0
  253. package/dist/engine/duration.d.mts +3 -0
  254. package/dist/engine/duration.d.mts.map +1 -0
  255. package/dist/engine/duration.mjs +32 -0
  256. package/dist/engine/duration.mjs.map +1 -0
  257. package/dist/engine/index.cjs +33 -0
  258. package/dist/engine/index.d.cts +10 -0
  259. package/dist/engine/index.d.mts +10 -0
  260. package/dist/engine/index.mjs +9 -0
  261. package/dist/engine/interpreter.cjs +613 -0
  262. package/dist/engine/interpreter.cjs.map +1 -0
  263. package/dist/engine/interpreter.d.cts +4 -0
  264. package/dist/engine/interpreter.d.cts.map +1 -0
  265. package/dist/engine/interpreter.d.mts +4 -0
  266. package/dist/engine/interpreter.d.mts.map +1 -0
  267. package/dist/engine/interpreter.mjs +612 -0
  268. package/dist/engine/interpreter.mjs.map +1 -0
  269. package/dist/engine/ports.cjs +0 -0
  270. package/dist/engine/ports.d.cts +373 -0
  271. package/dist/engine/ports.d.cts.map +1 -0
  272. package/dist/engine/ports.d.mts +373 -0
  273. package/dist/engine/ports.d.mts.map +1 -0
  274. package/dist/engine/ports.mjs +1 -0
  275. package/dist/engine/recipient.cjs +22 -0
  276. package/dist/engine/recipient.cjs.map +1 -0
  277. package/dist/engine/recipient.d.cts +11 -0
  278. package/dist/engine/recipient.d.cts.map +1 -0
  279. package/dist/engine/recipient.d.mts +11 -0
  280. package/dist/engine/recipient.d.mts.map +1 -0
  281. package/dist/engine/recipient.mjs +21 -0
  282. package/dist/engine/recipient.mjs.map +1 -0
  283. package/dist/engine/retry.cjs +106 -0
  284. package/dist/engine/retry.cjs.map +1 -0
  285. package/dist/engine/retry.d.cts +73 -0
  286. package/dist/engine/retry.d.cts.map +1 -0
  287. package/dist/engine/retry.d.mts +73 -0
  288. package/dist/engine/retry.d.mts.map +1 -0
  289. package/dist/engine/retry.mjs +98 -0
  290. package/dist/engine/retry.mjs.map +1 -0
  291. package/dist/engine/time-scale.cjs +153 -0
  292. package/dist/engine/time-scale.cjs.map +1 -0
  293. package/dist/engine/time-scale.d.cts +41 -0
  294. package/dist/engine/time-scale.d.cts.map +1 -0
  295. package/dist/engine/time-scale.d.mts +41 -0
  296. package/dist/engine/time-scale.d.mts.map +1 -0
  297. package/dist/engine/time-scale.mjs +150 -0
  298. package/dist/engine/time-scale.mjs.map +1 -0
  299. package/dist/engine/time-window.cjs +148 -0
  300. package/dist/engine/time-window.cjs.map +1 -0
  301. package/dist/engine/time-window.d.cts +20 -0
  302. package/dist/engine/time-window.d.cts.map +1 -0
  303. package/dist/engine/time-window.d.mts +20 -0
  304. package/dist/engine/time-window.d.mts.map +1 -0
  305. package/dist/engine/time-window.mjs +146 -0
  306. package/dist/engine/time-window.mjs.map +1 -0
  307. package/dist/fcm.cjs +208 -0
  308. package/dist/fcm.cjs.map +1 -0
  309. package/dist/fcm.d.cts +89 -0
  310. package/dist/fcm.d.cts.map +1 -0
  311. package/dist/fcm.d.mts +89 -0
  312. package/dist/fcm.d.mts.map +1 -0
  313. package/dist/fcm.mjs +202 -0
  314. package/dist/fcm.mjs.map +1 -0
  315. package/dist/hash.cjs +244 -0
  316. package/dist/hash.cjs.map +1 -0
  317. package/dist/hash.d.cts +28 -0
  318. package/dist/hash.d.cts.map +1 -0
  319. package/dist/hash.d.mts +28 -0
  320. package/dist/hash.d.mts.map +1 -0
  321. package/dist/hash.mjs +238 -0
  322. package/dist/hash.mjs.map +1 -0
  323. package/dist/host/auth.cjs +48 -0
  324. package/dist/host/auth.cjs.map +1 -0
  325. package/dist/host/auth.d.cts +33 -0
  326. package/dist/host/auth.d.cts.map +1 -0
  327. package/dist/host/auth.d.mts +33 -0
  328. package/dist/host/auth.d.mts.map +1 -0
  329. package/dist/host/auth.mjs +45 -0
  330. package/dist/host/auth.mjs.map +1 -0
  331. package/dist/host/batch.cjs +178 -0
  332. package/dist/host/batch.cjs.map +1 -0
  333. package/dist/host/batch.d.cts +92 -0
  334. package/dist/host/batch.d.cts.map +1 -0
  335. package/dist/host/batch.d.mts +92 -0
  336. package/dist/host/batch.d.mts.map +1 -0
  337. package/dist/host/batch.mjs +169 -0
  338. package/dist/host/batch.mjs.map +1 -0
  339. package/dist/host/channels.cjs +256 -0
  340. package/dist/host/channels.cjs.map +1 -0
  341. package/dist/host/channels.d.cts +66 -0
  342. package/dist/host/channels.d.cts.map +1 -0
  343. package/dist/host/channels.d.mts +66 -0
  344. package/dist/host/channels.d.mts.map +1 -0
  345. package/dist/host/channels.mjs +252 -0
  346. package/dist/host/channels.mjs.map +1 -0
  347. package/dist/host/execute.cjs +102 -0
  348. package/dist/host/execute.cjs.map +1 -0
  349. package/dist/host/execute.d.cts +38 -0
  350. package/dist/host/execute.d.cts.map +1 -0
  351. package/dist/host/execute.d.mts +38 -0
  352. package/dist/host/execute.d.mts.map +1 -0
  353. package/dist/host/execute.mjs +101 -0
  354. package/dist/host/execute.mjs.map +1 -0
  355. package/dist/host/fresh-read.cjs +29 -0
  356. package/dist/host/fresh-read.cjs.map +1 -0
  357. package/dist/host/fresh-read.d.cts +16 -0
  358. package/dist/host/fresh-read.d.cts.map +1 -0
  359. package/dist/host/fresh-read.d.mts +16 -0
  360. package/dist/host/fresh-read.d.mts.map +1 -0
  361. package/dist/host/fresh-read.mjs +28 -0
  362. package/dist/host/fresh-read.mjs.map +1 -0
  363. package/dist/host/http.cjs +393 -0
  364. package/dist/host/http.cjs.map +1 -0
  365. package/dist/host/http.d.cts +61 -0
  366. package/dist/host/http.d.cts.map +1 -0
  367. package/dist/host/http.d.mts +61 -0
  368. package/dist/host/http.d.mts.map +1 -0
  369. package/dist/host/http.mjs +389 -0
  370. package/dist/host/http.mjs.map +1 -0
  371. package/dist/host/ingest.cjs +1210 -0
  372. package/dist/host/ingest.cjs.map +1 -0
  373. package/dist/host/ingest.d.cts +497 -0
  374. package/dist/host/ingest.d.cts.map +1 -0
  375. package/dist/host/ingest.d.mts +497 -0
  376. package/dist/host/ingest.d.mts.map +1 -0
  377. package/dist/host/ingest.mjs +1172 -0
  378. package/dist/host/ingest.mjs.map +1 -0
  379. package/dist/host/journey-host.cjs +223 -0
  380. package/dist/host/journey-host.cjs.map +1 -0
  381. package/dist/host/journey-host.d.cts +118 -0
  382. package/dist/host/journey-host.d.cts.map +1 -0
  383. package/dist/host/journey-host.d.mts +118 -0
  384. package/dist/host/journey-host.d.mts.map +1 -0
  385. package/dist/host/journey-host.mjs +219 -0
  386. package/dist/host/journey-host.mjs.map +1 -0
  387. package/dist/host/platform.cjs +20 -0
  388. package/dist/host/platform.cjs.map +1 -0
  389. package/dist/host/platform.d.cts +120 -0
  390. package/dist/host/platform.d.cts.map +1 -0
  391. package/dist/host/platform.d.mts +120 -0
  392. package/dist/host/platform.d.mts.map +1 -0
  393. package/dist/host/platform.mjs +18 -0
  394. package/dist/host/platform.mjs.map +1 -0
  395. package/dist/host/senders.cjs +71 -0
  396. package/dist/host/senders.cjs.map +1 -0
  397. package/dist/host/senders.d.cts +34 -0
  398. package/dist/host/senders.d.cts.map +1 -0
  399. package/dist/host/senders.d.mts +34 -0
  400. package/dist/host/senders.d.mts.map +1 -0
  401. package/dist/host/senders.mjs +67 -0
  402. package/dist/host/senders.mjs.map +1 -0
  403. package/dist/host/workflow-cache.cjs +47 -0
  404. package/dist/host/workflow-cache.cjs.map +1 -0
  405. package/dist/host/workflow-cache.d.cts +21 -0
  406. package/dist/host/workflow-cache.d.cts.map +1 -0
  407. package/dist/host/workflow-cache.d.mts +21 -0
  408. package/dist/host/workflow-cache.d.mts.map +1 -0
  409. package/dist/host/workflow-cache.mjs +46 -0
  410. package/dist/host/workflow-cache.mjs.map +1 -0
  411. package/dist/http2-client.cjs +89 -0
  412. package/dist/http2-client.cjs.map +1 -0
  413. package/dist/http2-client.d.cts +45 -0
  414. package/dist/http2-client.d.cts.map +1 -0
  415. package/dist/http2-client.d.mts +45 -0
  416. package/dist/http2-client.d.mts.map +1 -0
  417. package/dist/http2-client.mjs +87 -0
  418. package/dist/http2-client.mjs.map +1 -0
  419. package/dist/index.cjs +130 -0
  420. package/dist/index.d.cts +21 -0
  421. package/dist/index.d.mts +21 -0
  422. package/dist/index.mjs +20 -0
  423. package/dist/inflight.cjs +116 -0
  424. package/dist/inflight.cjs.map +1 -0
  425. package/dist/inflight.d.cts +49 -0
  426. package/dist/inflight.d.cts.map +1 -0
  427. package/dist/inflight.d.mts +49 -0
  428. package/dist/inflight.d.mts.map +1 -0
  429. package/dist/inflight.mjs +113 -0
  430. package/dist/inflight.mjs.map +1 -0
  431. package/dist/ir.cjs +429 -0
  432. package/dist/ir.cjs.map +1 -0
  433. package/dist/ir.d.cts +593 -0
  434. package/dist/ir.d.cts.map +1 -0
  435. package/dist/ir.d.mts +593 -0
  436. package/dist/ir.d.mts.map +1 -0
  437. package/dist/ir.mjs +404 -0
  438. package/dist/ir.mjs.map +1 -0
  439. package/dist/jwt.cjs +17 -0
  440. package/dist/jwt.cjs.map +1 -0
  441. package/dist/jwt.d.cts +7 -0
  442. package/dist/jwt.d.cts.map +1 -0
  443. package/dist/jwt.d.mts +7 -0
  444. package/dist/jwt.d.mts.map +1 -0
  445. package/dist/jwt.mjs +15 -0
  446. package/dist/jwt.mjs.map +1 -0
  447. package/dist/node/index.cjs +231 -0
  448. package/dist/node/index.cjs.map +1 -0
  449. package/dist/node/index.d.cts +59 -0
  450. package/dist/node/index.d.cts.map +1 -0
  451. package/dist/node/index.d.mts +59 -0
  452. package/dist/node/index.d.mts.map +1 -0
  453. package/dist/node/index.mjs +225 -0
  454. package/dist/node/index.mjs.map +1 -0
  455. package/dist/node/runs.cjs +222 -0
  456. package/dist/node/runs.cjs.map +1 -0
  457. package/dist/node/runs.d.cts +93 -0
  458. package/dist/node/runs.d.cts.map +1 -0
  459. package/dist/node/runs.d.mts +93 -0
  460. package/dist/node/runs.d.mts.map +1 -0
  461. package/dist/node/runs.mjs +221 -0
  462. package/dist/node/runs.mjs.map +1 -0
  463. package/dist/node/runtime.cjs +351 -0
  464. package/dist/node/runtime.cjs.map +1 -0
  465. package/dist/node/runtime.d.cts +96 -0
  466. package/dist/node/runtime.d.cts.map +1 -0
  467. package/dist/node/runtime.d.mts +96 -0
  468. package/dist/node/runtime.d.mts.map +1 -0
  469. package/dist/node/runtime.mjs +348 -0
  470. package/dist/node/runtime.mjs.map +1 -0
  471. package/dist/plan.cjs +221 -0
  472. package/dist/plan.cjs.map +1 -0
  473. package/dist/plan.d.cts +68 -0
  474. package/dist/plan.d.cts.map +1 -0
  475. package/dist/plan.d.mts +68 -0
  476. package/dist/plan.d.mts.map +1 -0
  477. package/dist/plan.mjs +218 -0
  478. package/dist/plan.mjs.map +1 -0
  479. package/dist/postgres-js.cjs +51 -0
  480. package/dist/postgres-js.cjs.map +1 -0
  481. package/dist/postgres-js.d.cts +32 -0
  482. package/dist/postgres-js.d.cts.map +1 -0
  483. package/dist/postgres-js.d.mts +32 -0
  484. package/dist/postgres-js.d.mts.map +1 -0
  485. package/dist/postgres-js.mjs +46 -0
  486. package/dist/postgres-js.mjs.map +1 -0
  487. package/dist/provenance.cjs +66 -0
  488. package/dist/provenance.cjs.map +1 -0
  489. package/dist/provenance.d.cts +40 -0
  490. package/dist/provenance.d.cts.map +1 -0
  491. package/dist/provenance.d.mts +40 -0
  492. package/dist/provenance.d.mts.map +1 -0
  493. package/dist/provenance.mjs +64 -0
  494. package/dist/provenance.mjs.map +1 -0
  495. package/dist/push.cjs +11 -0
  496. package/dist/push.cjs.map +1 -0
  497. package/dist/push.d.cts +14 -0
  498. package/dist/push.d.cts.map +1 -0
  499. package/dist/push.d.mts +14 -0
  500. package/dist/push.d.mts.map +1 -0
  501. package/dist/push.mjs +10 -0
  502. package/dist/push.mjs.map +1 -0
  503. package/dist/react-email.cjs +56 -0
  504. package/dist/react-email.cjs.map +1 -0
  505. package/dist/react-email.d.cts +5 -0
  506. package/dist/react-email.d.cts.map +1 -0
  507. package/dist/react-email.d.mts +5 -0
  508. package/dist/react-email.d.mts.map +1 -0
  509. package/dist/react-email.mjs +55 -0
  510. package/dist/react-email.mjs.map +1 -0
  511. package/dist/reporting/classify.cjs +46 -0
  512. package/dist/reporting/classify.cjs.map +1 -0
  513. package/dist/reporting/classify.d.cts +65 -0
  514. package/dist/reporting/classify.d.cts.map +1 -0
  515. package/dist/reporting/classify.d.mts +65 -0
  516. package/dist/reporting/classify.d.mts.map +1 -0
  517. package/dist/reporting/classify.mjs +42 -0
  518. package/dist/reporting/classify.mjs.map +1 -0
  519. package/dist/reporting/observer.cjs +137 -0
  520. package/dist/reporting/observer.cjs.map +1 -0
  521. package/dist/reporting/observer.d.cts +31 -0
  522. package/dist/reporting/observer.d.cts.map +1 -0
  523. package/dist/reporting/observer.d.mts +31 -0
  524. package/dist/reporting/observer.d.mts.map +1 -0
  525. package/dist/reporting/observer.mjs +134 -0
  526. package/dist/reporting/observer.mjs.map +1 -0
  527. package/dist/reporting/tracking.cjs +185 -0
  528. package/dist/reporting/tracking.cjs.map +1 -0
  529. package/dist/reporting/tracking.d.cts +63 -0
  530. package/dist/reporting/tracking.d.cts.map +1 -0
  531. package/dist/reporting/tracking.d.mts +63 -0
  532. package/dist/reporting/tracking.d.mts.map +1 -0
  533. package/dist/reporting/tracking.mjs +182 -0
  534. package/dist/reporting/tracking.mjs.map +1 -0
  535. package/dist/runtime.cjs +18 -0
  536. package/dist/runtime.cjs.map +1 -0
  537. package/dist/runtime.d.cts +44 -0
  538. package/dist/runtime.d.cts.map +1 -0
  539. package/dist/runtime.d.mts +44 -0
  540. package/dist/runtime.d.mts.map +1 -0
  541. package/dist/runtime.mjs +17 -0
  542. package/dist/runtime.mjs.map +1 -0
  543. package/dist/store/condition-sql.cjs +145 -0
  544. package/dist/store/condition-sql.cjs.map +1 -0
  545. package/dist/store/condition-sql.d.cts +38 -0
  546. package/dist/store/condition-sql.d.cts.map +1 -0
  547. package/dist/store/condition-sql.d.mts +38 -0
  548. package/dist/store/condition-sql.d.mts.map +1 -0
  549. package/dist/store/condition-sql.mjs +144 -0
  550. package/dist/store/condition-sql.mjs.map +1 -0
  551. package/dist/store/erasure.cjs +21 -0
  552. package/dist/store/erasure.cjs.map +1 -0
  553. package/dist/store/erasure.d.cts +16 -0
  554. package/dist/store/erasure.d.cts.map +1 -0
  555. package/dist/store/erasure.d.mts +16 -0
  556. package/dist/store/erasure.d.mts.map +1 -0
  557. package/dist/store/erasure.mjs +20 -0
  558. package/dist/store/erasure.mjs.map +1 -0
  559. package/dist/store/facts.cjs +79 -0
  560. package/dist/store/facts.cjs.map +1 -0
  561. package/dist/store/facts.d.cts +41 -0
  562. package/dist/store/facts.d.cts.map +1 -0
  563. package/dist/store/facts.d.mts +41 -0
  564. package/dist/store/facts.d.mts.map +1 -0
  565. package/dist/store/facts.mjs +77 -0
  566. package/dist/store/facts.mjs.map +1 -0
  567. package/dist/store/identity.cjs +34 -0
  568. package/dist/store/identity.cjs.map +1 -0
  569. package/dist/store/identity.d.cts +13 -0
  570. package/dist/store/identity.d.cts.map +1 -0
  571. package/dist/store/identity.d.mts +13 -0
  572. package/dist/store/identity.d.mts.map +1 -0
  573. package/dist/store/identity.mjs +30 -0
  574. package/dist/store/identity.mjs.map +1 -0
  575. package/dist/store/index.cjs +35 -0
  576. package/dist/store/index.cjs.map +1 -0
  577. package/dist/store/index.d.cts +766 -0
  578. package/dist/store/index.d.cts.map +1 -0
  579. package/dist/store/index.d.mts +766 -0
  580. package/dist/store/index.d.mts.map +1 -0
  581. package/dist/store/index.mjs +22 -0
  582. package/dist/store/index.mjs.map +1 -0
  583. package/dist/store/postgres-reporting.cjs +327 -0
  584. package/dist/store/postgres-reporting.cjs.map +1 -0
  585. package/dist/store/postgres-reporting.d.cts +95 -0
  586. package/dist/store/postgres-reporting.d.cts.map +1 -0
  587. package/dist/store/postgres-reporting.d.mts +95 -0
  588. package/dist/store/postgres-reporting.d.mts.map +1 -0
  589. package/dist/store/postgres-reporting.mjs +326 -0
  590. package/dist/store/postgres-reporting.mjs.map +1 -0
  591. package/dist/store/postgres.cjs +1173 -0
  592. package/dist/store/postgres.cjs.map +1 -0
  593. package/dist/store/postgres.d.cts +199 -0
  594. package/dist/store/postgres.d.cts.map +1 -0
  595. package/dist/store/postgres.d.mts +199 -0
  596. package/dist/store/postgres.d.mts.map +1 -0
  597. package/dist/store/postgres.mjs +1170 -0
  598. package/dist/store/postgres.mjs.map +1 -0
  599. package/dist/store/sql.cjs +24 -0
  600. package/dist/store/sql.cjs.map +1 -0
  601. package/dist/store/sql.d.cts +26 -0
  602. package/dist/store/sql.d.cts.map +1 -0
  603. package/dist/store/sql.d.mts +26 -0
  604. package/dist/store/sql.d.mts.map +1 -0
  605. package/dist/store/sql.mjs +23 -0
  606. package/dist/store/sql.mjs.map +1 -0
  607. package/dist/store/tables.cjs +660 -0
  608. package/dist/store/tables.cjs.map +1 -0
  609. package/dist/store/tables.d.cts +103 -0
  610. package/dist/store/tables.d.cts.map +1 -0
  611. package/dist/store/tables.d.mts +103 -0
  612. package/dist/store/tables.d.mts.map +1 -0
  613. package/dist/store/tables.mjs +653 -0
  614. package/dist/store/tables.mjs.map +1 -0
  615. package/dist/store/user-lock.cjs +42 -0
  616. package/dist/store/user-lock.cjs.map +1 -0
  617. package/dist/store/user-lock.d.cts +30 -0
  618. package/dist/store/user-lock.d.cts.map +1 -0
  619. package/dist/store/user-lock.d.mts +30 -0
  620. package/dist/store/user-lock.d.mts.map +1 -0
  621. package/dist/store/user-lock.mjs +39 -0
  622. package/dist/store/user-lock.mjs.map +1 -0
  623. package/dist/template-rules.cjs +94 -0
  624. package/dist/template-rules.cjs.map +1 -0
  625. package/dist/template-rules.d.cts +80 -0
  626. package/dist/template-rules.d.cts.map +1 -0
  627. package/dist/template-rules.d.mts +80 -0
  628. package/dist/template-rules.d.mts.map +1 -0
  629. package/dist/template-rules.mjs +86 -0
  630. package/dist/template-rules.mjs.map +1 -0
  631. package/dist/templates.cjs +375 -0
  632. package/dist/templates.cjs.map +1 -0
  633. package/dist/templates.d.cts +358 -0
  634. package/dist/templates.d.cts.map +1 -0
  635. package/dist/templates.d.mts +358 -0
  636. package/dist/templates.d.mts.map +1 -0
  637. package/dist/templates.mjs +353 -0
  638. package/dist/templates.mjs.map +1 -0
  639. package/dist/transports/cloudflare-email.cjs +69 -0
  640. package/dist/transports/cloudflare-email.cjs.map +1 -0
  641. package/dist/transports/cloudflare-email.d.cts +63 -0
  642. package/dist/transports/cloudflare-email.d.cts.map +1 -0
  643. package/dist/transports/cloudflare-email.d.mts +63 -0
  644. package/dist/transports/cloudflare-email.d.mts.map +1 -0
  645. package/dist/transports/cloudflare-email.mjs +67 -0
  646. package/dist/transports/cloudflare-email.mjs.map +1 -0
  647. package/dist/transports/ses.cjs +142 -0
  648. package/dist/transports/ses.cjs.map +1 -0
  649. package/dist/transports/ses.d.cts +49 -0
  650. package/dist/transports/ses.d.cts.map +1 -0
  651. package/dist/transports/ses.d.mts +49 -0
  652. package/dist/transports/ses.d.mts.map +1 -0
  653. package/dist/transports/ses.mjs +139 -0
  654. package/dist/transports/ses.mjs.map +1 -0
  655. package/dist/transports/sigv4.cjs +86 -0
  656. package/dist/transports/sigv4.cjs.map +1 -0
  657. package/dist/transports/sigv4.d.cts +25 -0
  658. package/dist/transports/sigv4.d.cts.map +1 -0
  659. package/dist/transports/sigv4.d.mts +25 -0
  660. package/dist/transports/sigv4.d.mts.map +1 -0
  661. package/dist/transports/sigv4.mjs +85 -0
  662. package/dist/transports/sigv4.mjs.map +1 -0
  663. package/dist/webhooks.cjs +97 -0
  664. package/dist/webhooks.cjs.map +1 -0
  665. package/dist/webhooks.d.cts +23 -0
  666. package/dist/webhooks.d.cts.map +1 -0
  667. package/dist/webhooks.d.mts +23 -0
  668. package/dist/webhooks.d.mts.map +1 -0
  669. package/dist/webhooks.mjs +95 -0
  670. package/dist/webhooks.mjs.map +1 -0
  671. package/dist/webpush.cjs +361 -0
  672. package/dist/webpush.cjs.map +1 -0
  673. package/dist/webpush.d.cts +135 -0
  674. package/dist/webpush.d.cts.map +1 -0
  675. package/dist/webpush.d.mts +135 -0
  676. package/dist/webpush.d.mts.map +1 -0
  677. package/dist/webpush.mjs +350 -0
  678. package/dist/webpush.mjs.map +1 -0
  679. package/package.json +279 -3
  680. package/src/cloudflare/workers.d.ts +44 -0
@@ -0,0 +1,134 @@
1
+ // src/reporting/observer.ts
2
+ /**
3
+ * The observer journeyWorker installs when the store keeps reporting: every node arrival, copy
4
+ * and outcome recorded through `store.reporting`.
5
+ *
6
+ * A copy is recorded before it goes out, so its id can travel with it: with a tracking origin,
7
+ * an email's links become `<origin>/t/l/<message>/<position>` — `/t/u/...` for its unsubscribe
8
+ * link, so what a click means is fixed when it is sent — and an open pixel `<origin>/t/o/<message>`
9
+ * (served by the Worker, ./tracking.ts); the renderer gets the id too, for the email's
10
+ * preferences link (`email.preferencesUrl?m=<message>`), and a push carries
11
+ * `message_id` in its payload for the app to report the tap (`JourneyClient.messageOpened`),
12
+ * plus `delivered_url` / `opened_url` for a client that reports straight to the Worker.
13
+ * The links are recorded when the sender commits the rewritten email, before it goes out.
14
+ */
15
+ function reportingObserver(reporting, origin) {
16
+ const base = origin?.replace(/\/$/, "");
17
+ return {
18
+ started: (event) => reporting.instanceStarted(event),
19
+ nodeReached: (event) => reporting.nodeReached(event),
20
+ messageSettled: (message) => reporting.messageSettled(message.idempotencyKey),
21
+ messageClaimed: (message) => reporting.claimMessage(message.idempotencyKey, Date.now()),
22
+ messageReleased: (message) => reporting.releaseMessage(message.idempotencyKey),
23
+ async messagePrepared(message) {
24
+ const id = await reporting.recordMessage({
25
+ idempotencyKey: message.idempotencyKey,
26
+ workflow: message.workflow,
27
+ instanceId: message.instanceId,
28
+ nodeId: message.nodeId,
29
+ template: message.template,
30
+ channel: channelOf(message),
31
+ userId: message.userId,
32
+ topic: message.channel === "email" || message.channel === "push" ? message.topic ?? null : null,
33
+ sentAt: Date.now()
34
+ });
35
+ if (message.channel === "email" && base !== void 0) {
36
+ const links = [];
37
+ return {
38
+ messageId: id,
39
+ link: (url, purpose) => {
40
+ links.push({
41
+ url,
42
+ purpose
43
+ });
44
+ return `${base}/t/${purpose === "unsubscribe" ? "u" : "l"}/${id}/${links.length - 1}`;
45
+ },
46
+ pixel: `${base}/t/o/${id}`,
47
+ unsubscribe: `${base}/t/u/${id}`,
48
+ commit: () => reporting.recordLinks(id, links)
49
+ };
50
+ }
51
+ if (message.channel === "push") return { data: {
52
+ message_id: id,
53
+ ...base === void 0 ? {} : {
54
+ delivered_url: `${base}/t/d/${id}`,
55
+ opened_url: `${base}/t/p/${id}`
56
+ }
57
+ } };
58
+ },
59
+ async messageSent(message, result) {
60
+ await reporting.settleMessage(message.idempotencyKey, result, Date.now());
61
+ },
62
+ finished: (event) => reporting.instanceFinished(event)
63
+ };
64
+ }
65
+ /** Where the copy lands — the Studio's metric channel: a push is reported per platform. */
66
+ function channelOf(message) {
67
+ if (message.channel !== "push") return message.channel;
68
+ return `push_${message.device?.platform ?? "unknown"}`;
69
+ }
70
+ /**
71
+ * Whether the observer keeps the delivery record itself: it implements one of the three hooks
72
+ * that decide if a copy reaches the transport (see `JourneyObserver`).
73
+ */
74
+ function decidesDelivery(observer) {
75
+ return observer.messageSettled !== void 0 || observer.messageClaimed !== void 0 || observer.messageReleased !== void 0;
76
+ }
77
+ /**
78
+ * `extra`'s hooks added to `base`'s: every report reaches both, `base` first. `base` keeps the
79
+ * delivery record — at-most-once delivery is its claim, which a host adding a hook of its own
80
+ * must not lose — so `extra` is one that does not decide delivery (`decidesDelivery`). The
81
+ * tracking `extra` prepares is laid over `base`'s: its fields win, the push `data` of both is
82
+ * sent, and both commits run before the transport takes the copy.
83
+ */
84
+ function composeObservers(base, extra) {
85
+ return {
86
+ async started(event) {
87
+ await base.started?.(event);
88
+ await extra.started?.(event);
89
+ },
90
+ async nodeReached(event) {
91
+ await base.nodeReached?.(event);
92
+ await extra.nodeReached?.(event);
93
+ },
94
+ messageSettled: async (message) => await base.messageSettled?.(message) ?? false,
95
+ async messagePrepared(message) {
96
+ return mergeTracking(await base.messagePrepared?.(message), await extra.messagePrepared?.(message));
97
+ },
98
+ messageClaimed: async (message) => await base.messageClaimed?.(message) ?? true,
99
+ messageReleased: async (message) => base.messageReleased?.(message),
100
+ async messageSent(message, result) {
101
+ await base.messageSent?.(message, result);
102
+ await extra.messageSent?.(message, result);
103
+ },
104
+ async finished(event) {
105
+ await base.finished?.(event);
106
+ await extra.finished?.(event);
107
+ }
108
+ };
109
+ }
110
+ function mergeTracking(base, extra) {
111
+ if (base === void 0 || extra === void 0) return base ?? extra;
112
+ const merged = { ...base };
113
+ for (const key of [
114
+ "messageId",
115
+ "link",
116
+ "pixel",
117
+ "unsubscribe"
118
+ ]) if (extra[key] !== void 0) Object.assign(merged, { [key]: extra[key] });
119
+ if (extra.data !== void 0) merged.data = {
120
+ ...base.data,
121
+ ...extra.data
122
+ };
123
+ const first = base.commit;
124
+ const second = extra.commit;
125
+ if (first !== void 0 && second !== void 0) merged.commit = async () => {
126
+ await first();
127
+ await second();
128
+ };
129
+ else if (second !== void 0) merged.commit = second;
130
+ return merged;
131
+ }
132
+ export { composeObservers, decidesDelivery, reportingObserver };
133
+
134
+ //# sourceMappingURL=observer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observer.mjs","names":[],"sources":["../../src/reporting/observer.ts"],"sourcesContent":["import type { JourneyObserver, MessageTracking, OutboundMessage } from '../engine';\nimport type { JourneyReporting, TrackedLink } from '../store';\n\n/**\n * The observer journeyWorker installs when the store keeps reporting: every node arrival, copy\n * and outcome recorded through `store.reporting`.\n *\n * A copy is recorded before it goes out, so its id can travel with it: with a tracking origin,\n * an email's links become `<origin>/t/l/<message>/<position>` — `/t/u/...` for its unsubscribe\n * link, so what a click means is fixed when it is sent — and an open pixel `<origin>/t/o/<message>`\n * (served by the Worker, ./tracking.ts); the renderer gets the id too, for the email's\n * preferences link (`email.preferencesUrl?m=<message>`), and a push carries\n * `message_id` in its payload for the app to report the tap (`JourneyClient.messageOpened`),\n * plus `delivered_url` / `opened_url` for a client that reports straight to the Worker.\n * The links are recorded when the sender commits the rewritten email, before it goes out.\n */\nexport function reportingObserver(\n reporting: JourneyReporting,\n origin: string | undefined\n): JourneyObserver {\n const base = origin?.replace(/\\/$/, '');\n\n return {\n started: (event) => reporting.instanceStarted(event),\n\n nodeReached: (event) => reporting.nodeReached(event),\n\n messageSettled: (message) => reporting.messageSettled(message.idempotencyKey),\n\n messageClaimed: (message) => reporting.claimMessage(message.idempotencyKey, Date.now()),\n\n messageReleased: (message) => reporting.releaseMessage(message.idempotencyKey),\n\n async messagePrepared(message) {\n const id = await reporting.recordMessage({\n idempotencyKey: message.idempotencyKey,\n workflow: message.workflow,\n instanceId: message.instanceId,\n nodeId: message.nodeId,\n template: message.template,\n channel: channelOf(message),\n userId: message.userId,\n topic:\n message.channel === 'email' || message.channel === 'push'\n ? (message.topic ?? null)\n : null,\n sentAt: Date.now(),\n });\n if (message.channel === 'email' && base !== undefined) {\n const links: TrackedLink[] = [];\n return {\n messageId: id,\n link: (url, purpose) => {\n links.push({ url, purpose });\n return `${base}/t/${purpose === 'unsubscribe' ? 'u' : 'l'}/${id}/${links.length - 1}`;\n },\n pixel: `${base}/t/o/${id}`,\n unsubscribe: `${base}/t/u/${id}`,\n // Before the transport takes it, so no click can reach a link not yet recorded\n commit: () => reporting.recordLinks(id, links),\n };\n }\n if (message.channel === 'push') {\n // The app reports the tap with `message_id`; a client that can reach the Worker on its\n // own (iOS's notification service extension, a browser's service worker) posts to these\n return {\n data: {\n message_id: id,\n ...(base === undefined\n ? {}\n : { delivered_url: `${base}/t/d/${id}`, opened_url: `${base}/t/p/${id}` }),\n },\n };\n }\n return undefined;\n },\n\n async messageSent(message, result) {\n await reporting.settleMessage(message.idempotencyKey, result, Date.now());\n },\n\n finished: (event) => reporting.instanceFinished(event),\n };\n}\n\n/** Where the copy lands — the Studio's metric channel: a push is reported per platform. */\nfunction channelOf(message: OutboundMessage): string {\n if (message.channel !== 'push') return message.channel;\n return `push_${message.device?.platform ?? 'unknown'}`;\n}\n\n/**\n * Whether the observer keeps the delivery record itself: it implements one of the three hooks\n * that decide if a copy reaches the transport (see `JourneyObserver`).\n */\nexport function decidesDelivery(observer: JourneyObserver): boolean {\n return (\n observer.messageSettled !== undefined ||\n observer.messageClaimed !== undefined ||\n observer.messageReleased !== undefined\n );\n}\n\n/**\n * `extra`'s hooks added to `base`'s: every report reaches both, `base` first. `base` keeps the\n * delivery record — at-most-once delivery is its claim, which a host adding a hook of its own\n * must not lose — so `extra` is one that does not decide delivery (`decidesDelivery`). The\n * tracking `extra` prepares is laid over `base`'s: its fields win, the push `data` of both is\n * sent, and both commits run before the transport takes the copy.\n */\nexport function composeObservers(base: JourneyObserver, extra: JourneyObserver): JourneyObserver {\n return {\n async started(event) {\n await base.started?.(event);\n await extra.started?.(event);\n },\n async nodeReached(event) {\n await base.nodeReached?.(event);\n await extra.nodeReached?.(event);\n },\n messageSettled: async (message) => (await base.messageSettled?.(message)) ?? false,\n async messagePrepared(message) {\n const prepared = await base.messagePrepared?.(message);\n return mergeTracking(prepared, await extra.messagePrepared?.(message));\n },\n messageClaimed: async (message) => (await base.messageClaimed?.(message)) ?? true,\n messageReleased: async (message) => base.messageReleased?.(message),\n async messageSent(message, result) {\n // The settle first: a report of the host's own that throws must not leave the copy claimed\n // and unsettled, which a replay reads as possibly delivered\n await base.messageSent?.(message, result);\n await extra.messageSent?.(message, result);\n },\n async finished(event) {\n await base.finished?.(event);\n await extra.finished?.(event);\n },\n };\n}\n\nfunction mergeTracking(\n base: MessageTracking | undefined,\n extra: MessageTracking | undefined\n): MessageTracking | undefined {\n if (base === undefined || extra === undefined) return base ?? extra;\n const merged: MessageTracking = { ...base };\n for (const key of ['messageId', 'link', 'pixel', 'unsubscribe'] as const) {\n if (extra[key] !== undefined) Object.assign(merged, { [key]: extra[key] });\n }\n if (extra.data !== undefined) merged.data = { ...base.data, ...extra.data };\n const first = base.commit;\n const second = extra.commit;\n if (first !== undefined && second !== undefined) {\n merged.commit = async () => {\n await first();\n await second();\n };\n } else if (second !== undefined) {\n merged.commit = second;\n }\n return merged;\n}\n"],"mappings":"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"}
@@ -0,0 +1,185 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_reporting_classify = require("./classify.cjs");
3
+ // src/reporting/tracking.ts
4
+ const GIF = Uint8Array.from(atob("R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"), (char) => char.charCodeAt(0));
5
+ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6
+ /** Whether `id` has the shape of a message id (a UUID); anything else names no copy. */
7
+ const isMessageId = (id) => UUID.test(id);
8
+ function requester(request) {
9
+ const cf = request.cf;
10
+ return {
11
+ method: request.method,
12
+ userAgent: request.headers.get("user-agent"),
13
+ asn: cf?.asn ?? null,
14
+ organization: cf?.asOrganization ?? null,
15
+ country: cf?.country ?? null
16
+ };
17
+ }
18
+ /** A `/t/...` request's response, or undefined when the path is not a tracking route. */
19
+ async function handleTracking(request, reporting, options = {}) {
20
+ const url = new URL(request.url);
21
+ const path = url.pathname.split("/");
22
+ const root = path.at(1);
23
+ const kind = path.at(2);
24
+ const id = path.at(3);
25
+ const position = path.at(4);
26
+ if (root !== "t" || id === void 0 || !UUID.test(id)) return void 0;
27
+ const who = requester(request);
28
+ const read = who.method === "GET" || who.method === "HEAD";
29
+ if (kind === "o" && read) {
30
+ await recordOpen(reporting, id, who, options);
31
+ return new Response(who.method === "HEAD" ? null : GIF, { headers: {
32
+ "content-type": "image/gif",
33
+ "cache-control": "no-store, max-age=0"
34
+ } });
35
+ }
36
+ if ((kind === "l" || kind === "u") && position !== void 0 && read) {
37
+ const target = await recordClick(reporting, id, Number(position), who, options);
38
+ if (target === void 0) return page(options, "This link has expired.", 404);
39
+ if (kind === "u") return confirmUnsubscribe(reporting, options, id);
40
+ return Response.redirect(target, 302);
41
+ }
42
+ if (kind === "u" && position === void 0 && read) return confirmUnsubscribe(reporting, options, id);
43
+ if (kind === "d" && who.method === "POST") {
44
+ const known = await reporting.recordDeviceDelivered(id, Date.now());
45
+ return new Response(null, { status: known ? 204 : 404 });
46
+ }
47
+ if (kind === "p" && who.method === "POST") {
48
+ const at = Date.now();
49
+ let userId;
50
+ const known = await reporting.recordOpen(id, (message) => {
51
+ if (!message.channel.startsWith("push")) return void 0;
52
+ userId = message.userId;
53
+ return {
54
+ at,
55
+ machine: false,
56
+ reason: null,
57
+ ...network(who)
58
+ };
59
+ });
60
+ if (known && userId === void 0) return new Response(null, { status: 404 });
61
+ if (known && userId !== void 0 && options.pushOpened !== void 0) try {
62
+ await options.pushOpened({
63
+ messageId: id,
64
+ userId,
65
+ at
66
+ });
67
+ } catch (error) {
68
+ console.error(`[workflow] recording push open ${id} as an event failed`, error);
69
+ }
70
+ return new Response(null, { status: known ? 204 : 404 });
71
+ }
72
+ if (kind === "u" && who.method === "POST") {
73
+ const at = Date.now();
74
+ const all = url.searchParams.get("scope") === "all";
75
+ const unsubscribed = await reporting.recordUnsubscribe(id, at, all ? "all" : "topic");
76
+ if (unsubscribed === void 0) return page(options, "You won't get these emails anymore.");
77
+ if (unsubscribed.topic === null) return page(options, "This link has expired.", 404);
78
+ if (options.onUnsubscribed !== void 0) try {
79
+ await options.onUnsubscribed({
80
+ messageId: id,
81
+ userId: unsubscribed.userId,
82
+ at,
83
+ topic: unsubscribed.topic,
84
+ all
85
+ });
86
+ } catch (error) {
87
+ console.error(`[workflow] acting on the unsubscribe of ${id} failed`, error);
88
+ }
89
+ const from = options.product === void 0 ? "" : ` from ${escape(options.product)}`;
90
+ return page(options, all ? `You won't get emails${from} anymore.` : `You won't get ${escape(topicName(unsubscribed.topic))} emails${from} anymore.`);
91
+ }
92
+ }
93
+ /** A topic id as the page shows it: `product_updates` reads as "product updates". */
94
+ function topicName(topic) {
95
+ return topic.replace(/[_-]+/g, " ");
96
+ }
97
+ /**
98
+ * The question an unsubscribe link, or the List-Unsubscribe URL opened in a browser, asks: the
99
+ * email's topic (the default), or every email. A copy nobody knows, or a transactional one (the
100
+ * link was never in it), is an expired link.
101
+ */
102
+ async function confirmUnsubscribe(reporting, options, id) {
103
+ const message = await reporting.lookupMessage(id);
104
+ if (message?.channel !== "email" || message.topic === null) return page(options, "This link has expired.", 404);
105
+ const product = options.product === void 0 ? "" : ` from ${escape(options.product)}`;
106
+ const topic = escape(topicName(message.topic));
107
+ return page(options, `Unsubscribe from ${topic} emails${product}?`, 200, `<form method="post" action="/t/u/${id}"><button type="submit">Unsubscribe from ${topic}</button></form><form method="post" action="/t/u/${id}?scope=all"><button type="submit" class="secondary">Unsubscribe from all emails</button></form>`);
108
+ }
109
+ /**
110
+ * A journey push tapped open, as the app reports it (`JourneyClient.messageOpened`): an open on
111
+ * the copy — only the recipient's own, and never a machine, since no proxy or scanner taps a
112
+ * notification. False when the message is unknown or not the user's.
113
+ */
114
+ async function recordPushOpen(reporting, userId, messageId, at = Date.now()) {
115
+ if (!UUID.test(messageId)) return false;
116
+ let recorded = false;
117
+ await reporting.recordOpen(messageId, (message) => {
118
+ if (message.userId !== userId) return void 0;
119
+ recorded = true;
120
+ return {
121
+ at,
122
+ machine: false,
123
+ reason: null,
124
+ userAgent: null,
125
+ asn: null,
126
+ organization: null,
127
+ country: null
128
+ };
129
+ });
130
+ return recorded;
131
+ }
132
+ async function recordOpen(reporting, id, who, options) {
133
+ const at = Date.now();
134
+ await reporting.recordOpen(id, (message) => ({
135
+ at,
136
+ ...require_reporting_classify.classifyOpen({
137
+ ...who,
138
+ sinceDeliveredMs: at - message.deliveredAt
139
+ }, { quickMs: options.quickMs }),
140
+ ...network(who)
141
+ }));
142
+ }
143
+ const network = (who) => ({
144
+ userAgent: who.userAgent,
145
+ asn: who.asn,
146
+ organization: who.organization,
147
+ country: who.country
148
+ });
149
+ /** Records the click and answers the URL to send the visitor to, or undefined for an unknown link. */
150
+ async function recordClick(reporting, id, position, who, options) {
151
+ if (!Number.isInteger(position) || position < 0) return void 0;
152
+ const at = Date.now();
153
+ return (await reporting.recordClick(id, position, at, require_reporting_classify.BURST_WINDOW_MS, (link) => {
154
+ const linksInBurst = (/* @__PURE__ */ new Set([position, ...link.recent.map((click) => click.position)])).size;
155
+ const verdict = require_reporting_classify.classifyClick({
156
+ ...who,
157
+ sinceDeliveredMs: at - link.deliveredAt,
158
+ linksInBurst,
159
+ linkCount: link.linkCount
160
+ }, { quickMs: options.quickMs });
161
+ return {
162
+ engagement: {
163
+ at,
164
+ ...verdict,
165
+ ...network(who)
166
+ },
167
+ backdate: verdict.reason === "link_burst" || (verdict.reason ?? "").endsWith("link_pair")
168
+ };
169
+ }))?.url;
170
+ }
171
+ function escape(text) {
172
+ return text.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
173
+ }
174
+ function page(options, message, status = 200, extra = "") {
175
+ const html = `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escape(options.product ?? "Email")}</title><style>body{font:16px system-ui;margin:0;display:grid;place-items:center;min-height:100vh;background:#fafafa;color:#18181b}main{text-align:center;padding:24px}form{margin:12px 0}button{font:inherit;padding:10px 20px;border-radius:9999px;border:0;background:#18181b;color:#fff;cursor:pointer}button.secondary{background:#e4e4e7;color:#18181b}</style></head><body><main><p>${message}</p>${extra}</main></body></html>`;
176
+ return new Response(html, {
177
+ status,
178
+ headers: { "content-type": "text/html; charset=utf-8" }
179
+ });
180
+ }
181
+ exports.handleTracking = handleTracking;
182
+ exports.isMessageId = isMessageId;
183
+ exports.recordPushOpen = recordPushOpen;
184
+
185
+ //# sourceMappingURL=tracking.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.cjs","names":["classifyOpen","BURST_WINDOW_MS","classifyClick"],"sources":["../../src/reporting/tracking.ts"],"sourcesContent":["import type { JourneyReporting } from '../store';\nimport { BURST_WINDOW_MS, classifyClick, classifyOpen } from './classify';\n\n/**\n * The endpoints a journey email's tracking points at (see ./observer.ts), served by journeyWorker\n * without a bearer — recipients open them:\n *\n * GET /t/o/<message> the open pixel: records the open, answers a 1×1 GIF\n * GET /t/l/<message>/<position> a link: records the click, redirects to the recorded URL\n * GET /t/u/<message>/<position> the unsubscribe link: records the click, asks to confirm\n * GET /t/u/<message> the List-Unsubscribe header's URL, opened: asks to confirm\n * POST /t/u/<message> the unsubscribe confirmation, and the header's one-click\n * unsubscribe (RFC 8058: a mail client's button posts here):\n * opts out of the email's topic; `?scope=all` (the page's\n * second button) of every email\n * POST /t/d/<message> a push the device received (iOS's notification service\n * extension, a browser's service worker)\n * POST /t/p/<message> a push opened, reported by a browser's service worker\n *\n * Every open and click is recorded with its verdict (./classify.ts), and the message keeps its\n * first open and click of each kind. The redirect goes only to the URL recorded for that position,\n * never to one the request carries, so the endpoint cannot bounce visitors anywhere else. An\n * email's unsubscribe link is a tracked link too, and which link it is was fixed when the email was\n * sent (its route): following it shows a confirmation page, and only the confirmation — a POST,\n * which no link scanner sends — counts. The page offers the email's topic (the default, and what\n * a mail client's one-click POST does) and every email. Changing a template's or the config's\n * unsubscribe URL, or removing the template, changes nothing for emails already sent. A\n * transactional email (no topic) never carried the link: every `/t/u` variant answers 404 for it.\n */\n\nexport interface TrackingOptions {\n /** The name the confirmation pages show (the config's `title`). */\n product?: string | undefined;\n /** `email.tracking.quickClickMs`: how soon after delivery an open or click is a weak machine signal. */\n quickMs?: number | undefined;\n /** A browser reported a push tapped (`/t/p`): the host records it as an event too (`webPush.openedEvent`). */\n pushOpened?:\n | ((open: { messageId: string; userId: string; at: number }) => Promise<void>)\n | undefined;\n /**\n * An unsubscribe was recorded (`POST /t/u`): from the email's `topic`, or with `all` from every\n * email — then the host wakes the user's waits that read email reachability, so an\n * `exitWhen: not(reachable('email'))` takes effect at once. Its failure is logged, never a\n * reason to fail the unsubscribe.\n */\n onUnsubscribed?:\n | ((unsubscribe: {\n messageId: string;\n userId: string;\n at: number;\n topic: string;\n all: boolean;\n }) => Promise<void>)\n | undefined;\n}\n\nconst GIF = Uint8Array.from(\n atob('R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'),\n (char) => char.charCodeAt(0)\n);\nconst UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/** Whether `id` has the shape of a message id (a UUID); anything else names no copy. */\nexport const isMessageId = (id: string): boolean => UUID.test(id);\n\ninterface Requester {\n method: string;\n userAgent: string | null;\n asn: number | null;\n organization: string | null;\n country: string | null;\n}\n\nfunction requester(request: Request): Requester {\n const cf = (\n request as Request & { cf?: { asn?: number; asOrganization?: string; country?: string } }\n ).cf;\n return {\n method: request.method,\n userAgent: request.headers.get('user-agent'),\n asn: cf?.asn ?? null,\n organization: cf?.asOrganization ?? null,\n country: cf?.country ?? null,\n };\n}\n\n/** A `/t/...` request's response, or undefined when the path is not a tracking route. */\nexport async function handleTracking(\n request: Request,\n reporting: JourneyReporting,\n options: TrackingOptions = {}\n): Promise<Response | undefined> {\n const url = new URL(request.url);\n const path = url.pathname.split('/');\n const root = path.at(1);\n const kind = path.at(2);\n const id = path.at(3);\n const position = path.at(4);\n if (root !== 't' || id === undefined || !UUID.test(id)) return undefined;\n const who = requester(request);\n const read = who.method === 'GET' || who.method === 'HEAD';\n if (kind === 'o' && read) {\n await recordOpen(reporting, id, who, options);\n return new Response(who.method === 'HEAD' ? null : GIF, {\n headers: { 'content-type': 'image/gif', 'cache-control': 'no-store, max-age=0' },\n });\n }\n if ((kind === 'l' || kind === 'u') && position !== undefined && read) {\n const target = await recordClick(reporting, id, Number(position), who, options);\n if (target === undefined) return page(options, 'This link has expired.', 404);\n if (kind === 'u') return confirmUnsubscribe(reporting, options, id);\n return Response.redirect(target, 302);\n }\n // The List-Unsubscribe URL opened in a browser (a client without one-click): the same question\n if (kind === 'u' && position === undefined && read)\n return confirmUnsubscribe(reporting, options, id);\n if (kind === 'd' && who.method === 'POST') {\n const known = await reporting.recordDeviceDelivered(id, Date.now());\n return new Response(null, { status: known ? 204 : 404 });\n }\n if (kind === 'p' && who.method === 'POST') {\n // A notification tap: a person, as the message id is what proves it is theirs. Only a push\n // copy's id proves that: an email's id is in every link of the email (forwarded, scanned,\n // logged by proxies), and taking it here would let anyone holding one forge a human open and\n // have the host ingest an event as the recipient\n const at = Date.now();\n let userId: string | undefined;\n const known = await reporting.recordOpen(id, (message) => {\n // A push copy is recorded per platform (`push_ios`, `push_web`, ...)\n if (!message.channel.startsWith('push')) return undefined;\n userId = message.userId;\n return { at, machine: false, reason: null, ...network(who) };\n });\n if (known && userId === undefined) return new Response(null, { status: 404 });\n if (known && userId !== undefined && options.pushOpened !== undefined) {\n try {\n await options.pushOpened({ messageId: id, userId, at });\n } catch (error) {\n // The open is recorded; the event is the host's extra, never a reason to fail the beacon\n console.error(`[workflow] recording push open ${id} as an event failed`, error);\n }\n }\n return new Response(null, { status: known ? 204 : 404 });\n }\n if (kind === 'u' && who.method === 'POST') {\n const at = Date.now();\n // The page's \"all emails\" button; a mail client's one-click POST carries no scope\n const all = url.searchParams.get('scope') === 'all';\n const unsubscribed = await reporting.recordUnsubscribe(id, at, all ? 'all' : 'topic');\n // A mail client's one-click POST must succeed: for a copy no longer on record (its user\n // erased) there is nothing left to send to, so the answer is the same\n if (unsubscribed === undefined) return page(options, \"You won't get these emails anymore.\");\n // A transactional email never carried the link\n if (unsubscribed.topic === null) return page(options, 'This link has expired.', 404);\n if (options.onUnsubscribed !== undefined) {\n try {\n await options.onUnsubscribed({\n messageId: id,\n userId: unsubscribed.userId,\n at,\n topic: unsubscribed.topic,\n all,\n });\n } catch (error) {\n console.error(`[workflow] acting on the unsubscribe of ${id} failed`, error);\n }\n }\n const from = options.product === undefined ? '' : ` from ${escape(options.product)}`;\n return page(\n options,\n all\n ? `You won't get emails${from} anymore.`\n : `You won't get ${escape(topicName(unsubscribed.topic))} emails${from} anymore.`\n );\n }\n return undefined;\n}\n\n/** A topic id as the page shows it: `product_updates` reads as \"product updates\". */\nfunction topicName(topic: string): string {\n return topic.replace(/[_-]+/g, ' ');\n}\n\n/**\n * The question an unsubscribe link, or the List-Unsubscribe URL opened in a browser, asks: the\n * email's topic (the default), or every email. A copy nobody knows, or a transactional one (the\n * link was never in it), is an expired link.\n */\nasync function confirmUnsubscribe(\n reporting: JourneyReporting,\n options: TrackingOptions,\n id: string\n): Promise<Response> {\n const message = await reporting.lookupMessage(id);\n if (message?.channel !== 'email' || message.topic === null) {\n return page(options, 'This link has expired.', 404);\n }\n const product = options.product === undefined ? '' : ` from ${escape(options.product)}`;\n const topic = escape(topicName(message.topic));\n return page(\n options,\n `Unsubscribe from ${topic} emails${product}?`,\n 200,\n `<form method=\"post\" action=\"/t/u/${id}\"><button type=\"submit\">Unsubscribe from ${topic}</button></form>` +\n `<form method=\"post\" action=\"/t/u/${id}?scope=all\"><button type=\"submit\" class=\"secondary\">Unsubscribe from all emails</button></form>`\n );\n}\n\n/**\n * A journey push tapped open, as the app reports it (`JourneyClient.messageOpened`): an open on\n * the copy — only the recipient's own, and never a machine, since no proxy or scanner taps a\n * notification. False when the message is unknown or not the user's.\n */\nexport async function recordPushOpen(\n reporting: JourneyReporting,\n userId: string,\n messageId: string,\n at = Date.now()\n): Promise<boolean> {\n if (!UUID.test(messageId)) return false;\n let recorded = false;\n await reporting.recordOpen(messageId, (message) => {\n if (message.userId !== userId) return undefined;\n recorded = true;\n return {\n at,\n machine: false,\n reason: null,\n userAgent: null,\n asn: null,\n organization: null,\n country: null,\n };\n });\n return recorded;\n}\n\nasync function recordOpen(\n reporting: JourneyReporting,\n id: string,\n who: Requester,\n options: TrackingOptions\n) {\n const at = Date.now();\n await reporting.recordOpen(id, (message) => ({\n at,\n ...classifyOpen(\n { ...who, sinceDeliveredMs: at - message.deliveredAt },\n { quickMs: options.quickMs }\n ),\n ...network(who),\n }));\n}\n\nconst network = (who: Requester) => ({\n userAgent: who.userAgent,\n asn: who.asn,\n organization: who.organization,\n country: who.country,\n});\n\n/** Records the click and answers the URL to send the visitor to, or undefined for an unknown link. */\nasync function recordClick(\n reporting: JourneyReporting,\n id: string,\n position: number,\n who: Requester,\n options: TrackingOptions\n): Promise<string | undefined> {\n if (!Number.isInteger(position) || position < 0) return undefined;\n const at = Date.now();\n const recorded = await reporting.recordClick(id, position, at, BURST_WINDOW_MS, (link) => {\n const linksInBurst = new Set([position, ...link.recent.map((click) => click.position)]).size;\n const verdict = classifyClick(\n { ...who, sinceDeliveredMs: at - link.deliveredAt, linksInBurst, linkCount: link.linkCount },\n { quickMs: options.quickMs }\n );\n return {\n engagement: { at, ...verdict, ...network(who) },\n // The earlier click of a pair was judged before its other half arrived\n backdate: verdict.reason === 'link_burst' || (verdict.reason ?? '').endsWith('link_pair'),\n };\n });\n return recorded?.url;\n}\n\nfunction escape(text: string): string {\n return text.replace(/[&<>\"']/g, (c) => `&#${c.charCodeAt(0)};`);\n}\n\nfunction page(options: TrackingOptions, message: string, status = 200, extra = ''): Response {\n const title = escape(options.product ?? 'Email');\n const html = `<!doctype html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>${title}</title><style>body{font:16px system-ui;margin:0;display:grid;place-items:center;min-height:100vh;background:#fafafa;color:#18181b}main{text-align:center;padding:24px}form{margin:12px 0}button{font:inherit;padding:10px 20px;border-radius:9999px;border:0;background:#18181b;color:#fff;cursor:pointer}button.secondary{background:#e4e4e7;color:#18181b}</style></head><body><main><p>${message}</p>${extra}</main></body></html>`;\n return new Response(html, { status, headers: { 'content-type': 'text/html; charset=utf-8' } });\n}\n"],"mappings":"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"}
@@ -0,0 +1,63 @@
1
+ import { JourneyReporting } from "../store/index.cjs";
2
+ /**
3
+ * The endpoints a journey email's tracking points at (see ./observer.ts), served by journeyWorker
4
+ * without a bearer — recipients open them:
5
+ *
6
+ * GET /t/o/<message> the open pixel: records the open, answers a 1×1 GIF
7
+ * GET /t/l/<message>/<position> a link: records the click, redirects to the recorded URL
8
+ * GET /t/u/<message>/<position> the unsubscribe link: records the click, asks to confirm
9
+ * GET /t/u/<message> the List-Unsubscribe header's URL, opened: asks to confirm
10
+ * POST /t/u/<message> the unsubscribe confirmation, and the header's one-click
11
+ * unsubscribe (RFC 8058: a mail client's button posts here):
12
+ * opts out of the email's topic; `?scope=all` (the page's
13
+ * second button) of every email
14
+ * POST /t/d/<message> a push the device received (iOS's notification service
15
+ * extension, a browser's service worker)
16
+ * POST /t/p/<message> a push opened, reported by a browser's service worker
17
+ *
18
+ * Every open and click is recorded with its verdict (./classify.ts), and the message keeps its
19
+ * first open and click of each kind. The redirect goes only to the URL recorded for that position,
20
+ * never to one the request carries, so the endpoint cannot bounce visitors anywhere else. An
21
+ * email's unsubscribe link is a tracked link too, and which link it is was fixed when the email was
22
+ * sent (its route): following it shows a confirmation page, and only the confirmation — a POST,
23
+ * which no link scanner sends — counts. The page offers the email's topic (the default, and what
24
+ * a mail client's one-click POST does) and every email. Changing a template's or the config's
25
+ * unsubscribe URL, or removing the template, changes nothing for emails already sent. A
26
+ * transactional email (no topic) never carried the link: every `/t/u` variant answers 404 for it.
27
+ */
28
+ export interface TrackingOptions {
29
+ /** The name the confirmation pages show (the config's `title`). */
30
+ product?: string | undefined;
31
+ /** `email.tracking.quickClickMs`: how soon after delivery an open or click is a weak machine signal. */
32
+ quickMs?: number | undefined;
33
+ /** A browser reported a push tapped (`/t/p`): the host records it as an event too (`webPush.openedEvent`). */
34
+ pushOpened?: ((open: {
35
+ messageId: string;
36
+ userId: string;
37
+ at: number;
38
+ }) => Promise<void>) | undefined;
39
+ /**
40
+ * An unsubscribe was recorded (`POST /t/u`): from the email's `topic`, or with `all` from every
41
+ * email — then the host wakes the user's waits that read email reachability, so an
42
+ * `exitWhen: not(reachable('email'))` takes effect at once. Its failure is logged, never a
43
+ * reason to fail the unsubscribe.
44
+ */
45
+ onUnsubscribed?: ((unsubscribe: {
46
+ messageId: string;
47
+ userId: string;
48
+ at: number;
49
+ topic: string;
50
+ all: boolean;
51
+ }) => Promise<void>) | undefined;
52
+ }
53
+ /** Whether `id` has the shape of a message id (a UUID); anything else names no copy. */
54
+ export declare const isMessageId: (id: string) => boolean;
55
+ /** A `/t/...` request's response, or undefined when the path is not a tracking route. */
56
+ export declare function handleTracking(request: Request, reporting: JourneyReporting, options?: TrackingOptions): Promise<Response | undefined>;
57
+ /**
58
+ * A journey push tapped open, as the app reports it (`JourneyClient.messageOpened`): an open on
59
+ * the copy — only the recipient's own, and never a machine, since no proxy or scanner taps a
60
+ * notification. False when the message is unknown or not the user's.
61
+ */
62
+ export declare function recordPushOpen(reporting: JourneyReporting, userId: string, messageId: string, at?: number): Promise<boolean>;
63
+ //# sourceMappingURL=tracking.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.d.cts","names":[],"sources":["../../src/reporting/tracking.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BiB;;EAEf;;EAEA;;EAEA,eACM;IAAQ;IAAmB;IAAgB;QAAiB;;;;;;;EAQlE,mBACM;IACA;IACA;IACA;IACA;IACA;QACI;;;qBAWC,cAAW;;wBAwBF,eACpB,SAAS,SACT,WAAW,kBACX,UAAS,kBACR,QAAQ;;;;;;wBA0HW,eACpB,WAAW,kBACX,gBACA,mBACA,cACC"}
@@ -0,0 +1,63 @@
1
+ import { JourneyReporting } from "../store/index.mjs";
2
+ /**
3
+ * The endpoints a journey email's tracking points at (see ./observer.ts), served by journeyWorker
4
+ * without a bearer — recipients open them:
5
+ *
6
+ * GET /t/o/<message> the open pixel: records the open, answers a 1×1 GIF
7
+ * GET /t/l/<message>/<position> a link: records the click, redirects to the recorded URL
8
+ * GET /t/u/<message>/<position> the unsubscribe link: records the click, asks to confirm
9
+ * GET /t/u/<message> the List-Unsubscribe header's URL, opened: asks to confirm
10
+ * POST /t/u/<message> the unsubscribe confirmation, and the header's one-click
11
+ * unsubscribe (RFC 8058: a mail client's button posts here):
12
+ * opts out of the email's topic; `?scope=all` (the page's
13
+ * second button) of every email
14
+ * POST /t/d/<message> a push the device received (iOS's notification service
15
+ * extension, a browser's service worker)
16
+ * POST /t/p/<message> a push opened, reported by a browser's service worker
17
+ *
18
+ * Every open and click is recorded with its verdict (./classify.ts), and the message keeps its
19
+ * first open and click of each kind. The redirect goes only to the URL recorded for that position,
20
+ * never to one the request carries, so the endpoint cannot bounce visitors anywhere else. An
21
+ * email's unsubscribe link is a tracked link too, and which link it is was fixed when the email was
22
+ * sent (its route): following it shows a confirmation page, and only the confirmation — a POST,
23
+ * which no link scanner sends — counts. The page offers the email's topic (the default, and what
24
+ * a mail client's one-click POST does) and every email. Changing a template's or the config's
25
+ * unsubscribe URL, or removing the template, changes nothing for emails already sent. A
26
+ * transactional email (no topic) never carried the link: every `/t/u` variant answers 404 for it.
27
+ */
28
+ export interface TrackingOptions {
29
+ /** The name the confirmation pages show (the config's `title`). */
30
+ product?: string | undefined;
31
+ /** `email.tracking.quickClickMs`: how soon after delivery an open or click is a weak machine signal. */
32
+ quickMs?: number | undefined;
33
+ /** A browser reported a push tapped (`/t/p`): the host records it as an event too (`webPush.openedEvent`). */
34
+ pushOpened?: ((open: {
35
+ messageId: string;
36
+ userId: string;
37
+ at: number;
38
+ }) => Promise<void>) | undefined;
39
+ /**
40
+ * An unsubscribe was recorded (`POST /t/u`): from the email's `topic`, or with `all` from every
41
+ * email — then the host wakes the user's waits that read email reachability, so an
42
+ * `exitWhen: not(reachable('email'))` takes effect at once. Its failure is logged, never a
43
+ * reason to fail the unsubscribe.
44
+ */
45
+ onUnsubscribed?: ((unsubscribe: {
46
+ messageId: string;
47
+ userId: string;
48
+ at: number;
49
+ topic: string;
50
+ all: boolean;
51
+ }) => Promise<void>) | undefined;
52
+ }
53
+ /** Whether `id` has the shape of a message id (a UUID); anything else names no copy. */
54
+ export declare const isMessageId: (id: string) => boolean;
55
+ /** A `/t/...` request's response, or undefined when the path is not a tracking route. */
56
+ export declare function handleTracking(request: Request, reporting: JourneyReporting, options?: TrackingOptions): Promise<Response | undefined>;
57
+ /**
58
+ * A journey push tapped open, as the app reports it (`JourneyClient.messageOpened`): an open on
59
+ * the copy — only the recipient's own, and never a machine, since no proxy or scanner taps a
60
+ * notification. False when the message is unknown or not the user's.
61
+ */
62
+ export declare function recordPushOpen(reporting: JourneyReporting, userId: string, messageId: string, at?: number): Promise<boolean>;
63
+ //# sourceMappingURL=tracking.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.d.mts","names":[],"sources":["../../src/reporting/tracking.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BiB;;EAEf;;EAEA;;EAEA,eACM;IAAQ;IAAmB;IAAgB;QAAiB;;;;;;;EAQlE,mBACM;IACA;IACA;IACA;IACA;IACA;QACI;;;qBAWC,cAAW;;wBAwBF,eACpB,SAAS,SACT,WAAW,kBACX,UAAS,kBACR,QAAQ;;;;;;wBA0HW,eACpB,WAAW,kBACX,gBACA,mBACA,cACC"}