@chipmobilesdk/rn-notification 0.5.0 → 0.7.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 (681) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/README.md +108 -16
  3. package/lib/commonjs/advanced.js +139 -0
  4. package/lib/commonjs/advanced.js.map +1 -0
  5. package/lib/commonjs/channel/migrate.js +246 -0
  6. package/lib/commonjs/channel/migrate.js.map +1 -0
  7. package/lib/commonjs/channel/tone-map.js +120 -0
  8. package/lib/commonjs/channel/tone-map.js.map +1 -0
  9. package/lib/commonjs/channel/validate-tone.js +61 -0
  10. package/lib/commonjs/channel/validate-tone.js.map +1 -0
  11. package/lib/commonjs/contract/channel.js +52 -0
  12. package/lib/commonjs/contract/channel.js.map +1 -0
  13. package/lib/commonjs/contract/diagnostics.js +25 -0
  14. package/lib/commonjs/contract/diagnostics.js.map +1 -0
  15. package/lib/commonjs/contract/errors.js +126 -0
  16. package/lib/commonjs/contract/errors.js.map +1 -0
  17. package/lib/commonjs/contract/hash.js +35 -0
  18. package/lib/commonjs/contract/hash.js.map +1 -0
  19. package/lib/commonjs/contract/index.js +94 -0
  20. package/lib/commonjs/contract/index.js.map +1 -0
  21. package/lib/commonjs/contract/interaction.js +37 -0
  22. package/lib/commonjs/contract/interaction.js.map +1 -0
  23. package/lib/commonjs/contract/notification.js +42 -0
  24. package/lib/commonjs/contract/notification.js.map +1 -0
  25. package/lib/commonjs/contract/permission.js +2 -0
  26. package/lib/commonjs/contract/permission.js.map +1 -0
  27. package/lib/commonjs/contract/reconcile.js +6 -0
  28. package/lib/commonjs/contract/reconcile.js.map +1 -0
  29. package/lib/commonjs/contract/recurrence.js +53 -0
  30. package/lib/commonjs/contract/recurrence.js.map +1 -0
  31. package/lib/commonjs/diagnostics/burst.js +89 -0
  32. package/lib/commonjs/diagnostics/burst.js.map +1 -0
  33. package/lib/commonjs/diagnostics/events.js +63 -0
  34. package/lib/commonjs/diagnostics/events.js.map +1 -0
  35. package/lib/commonjs/diagnostics/redact.js +48 -0
  36. package/lib/commonjs/diagnostics/redact.js.map +1 -0
  37. package/lib/commonjs/diagnostics/snapshot.js +68 -0
  38. package/lib/commonjs/diagnostics/snapshot.js.map +1 -0
  39. package/lib/commonjs/engine/adapter.js +6 -0
  40. package/lib/commonjs/engine/adapter.js.map +1 -0
  41. package/lib/commonjs/engine/codec.js +84 -0
  42. package/lib/commonjs/engine/codec.js.map +1 -0
  43. package/lib/commonjs/engine/notify-kit/events.js +148 -0
  44. package/lib/commonjs/engine/notify-kit/events.js.map +1 -0
  45. package/lib/commonjs/engine/notify-kit/module.js +119 -0
  46. package/lib/commonjs/engine/notify-kit/module.js.map +1 -0
  47. package/lib/commonjs/engine/notify-kit/platform/android.js +159 -0
  48. package/lib/commonjs/engine/notify-kit/platform/android.js.map +1 -0
  49. package/lib/commonjs/engine/notify-kit/platform/index.js +57 -0
  50. package/lib/commonjs/engine/notify-kit/platform/index.js.map +1 -0
  51. package/lib/commonjs/engine/notify-kit/platform/ios.js +54 -0
  52. package/lib/commonjs/engine/notify-kit/platform/ios.js.map +1 -0
  53. package/lib/commonjs/engine/notify-kit/platform/types.js +6 -0
  54. package/lib/commonjs/engine/notify-kit/platform/types.js.map +1 -0
  55. package/lib/commonjs/engine/notify-kit-engine.js +260 -0
  56. package/lib/commonjs/engine/notify-kit-engine.js.map +1 -0
  57. package/lib/commonjs/index.js +367 -0
  58. package/lib/commonjs/index.js.map +1 -0
  59. package/lib/commonjs/initialize.js +187 -0
  60. package/lib/commonjs/initialize.js.map +1 -0
  61. package/lib/commonjs/interaction/index.js +120 -0
  62. package/lib/commonjs/interaction/index.js.map +1 -0
  63. package/lib/commonjs/maintenance/cycle.js +108 -0
  64. package/lib/commonjs/maintenance/cycle.js.map +1 -0
  65. package/lib/commonjs/maintenance/permission-refresh.js +39 -0
  66. package/lib/commonjs/maintenance/permission-refresh.js.map +1 -0
  67. package/lib/commonjs/maintenance/reanchor.js +99 -0
  68. package/lib/commonjs/maintenance/reanchor.js.map +1 -0
  69. package/lib/commonjs/maintenance/toggle.js +50 -0
  70. package/lib/commonjs/maintenance/toggle.js.map +1 -0
  71. package/lib/commonjs/maintenance/verify.js +70 -0
  72. package/lib/commonjs/maintenance/verify.js.map +1 -0
  73. package/lib/commonjs/maintenance/window-refresh.js +53 -0
  74. package/lib/commonjs/maintenance/window-refresh.js.map +1 -0
  75. package/lib/commonjs/notifications.js +161 -0
  76. package/lib/commonjs/notifications.js.map +1 -0
  77. package/lib/commonjs/package.json +1 -0
  78. package/lib/commonjs/permission/index.js +182 -0
  79. package/lib/commonjs/permission/index.js.map +1 -0
  80. package/lib/commonjs/permission/state.js +92 -0
  81. package/lib/commonjs/permission/state.js.map +1 -0
  82. package/lib/commonjs/push/envelope.js +141 -0
  83. package/lib/commonjs/push/envelope.js.map +1 -0
  84. package/lib/commonjs/push/fcm-provider.js +122 -0
  85. package/lib/commonjs/push/fcm-provider.js.map +1 -0
  86. package/lib/commonjs/push/gate.js +162 -0
  87. package/lib/commonjs/push/gate.js.map +1 -0
  88. package/lib/commonjs/push/index.js +47 -0
  89. package/lib/commonjs/push/index.js.map +1 -0
  90. package/lib/commonjs/push/instructions.js +101 -0
  91. package/lib/commonjs/push/instructions.js.map +1 -0
  92. package/lib/commonjs/push/provider-adapter.js +6 -0
  93. package/lib/commonjs/push/provider-adapter.js.map +1 -0
  94. package/lib/commonjs/push/signout.js +55 -0
  95. package/lib/commonjs/push/signout.js.map +1 -0
  96. package/lib/commonjs/reconcile/chunk.js +49 -0
  97. package/lib/commonjs/reconcile/chunk.js.map +1 -0
  98. package/lib/commonjs/reconcile/diff.js +105 -0
  99. package/lib/commonjs/reconcile/diff.js.map +1 -0
  100. package/lib/commonjs/reconcile/duplicates.js +60 -0
  101. package/lib/commonjs/reconcile/duplicates.js.map +1 -0
  102. package/lib/commonjs/reconcile/index.js +164 -0
  103. package/lib/commonjs/reconcile/index.js.map +1 -0
  104. package/lib/commonjs/reconcile/truncate.js +50 -0
  105. package/lib/commonjs/reconcile/truncate.js.map +1 -0
  106. package/lib/commonjs/recurrence/clock-guard.js +65 -0
  107. package/lib/commonjs/recurrence/clock-guard.js.map +1 -0
  108. package/lib/commonjs/recurrence/expand.js +254 -0
  109. package/lib/commonjs/recurrence/expand.js.map +1 -0
  110. package/lib/commonjs/recurrence/index.js +212 -0
  111. package/lib/commonjs/recurrence/index.js.map +1 -0
  112. package/lib/commonjs/repeat/expiry.js +41 -0
  113. package/lib/commonjs/repeat/expiry.js.map +1 -0
  114. package/lib/commonjs/repeat/index.js +100 -0
  115. package/lib/commonjs/repeat/index.js.map +1 -0
  116. package/lib/commonjs/repeat/marker.js +58 -0
  117. package/lib/commonjs/repeat/marker.js.map +1 -0
  118. package/lib/commonjs/repeat/place.js +83 -0
  119. package/lib/commonjs/repeat/place.js.map +1 -0
  120. package/lib/commonjs/schedule/anchor.js +243 -0
  121. package/lib/commonjs/schedule/anchor.js.map +1 -0
  122. package/lib/commonjs/schedule/index.js +142 -0
  123. package/lib/commonjs/schedule/index.js.map +1 -0
  124. package/lib/commonjs/schedule/partition.js +59 -0
  125. package/lib/commonjs/schedule/partition.js.map +1 -0
  126. package/lib/commonjs/schedule/resolve-moment.js +72 -0
  127. package/lib/commonjs/schedule/resolve-moment.js.map +1 -0
  128. package/lib/commonjs/schedule/validate-content.js +101 -0
  129. package/lib/commonjs/schedule/validate-content.js.map +1 -0
  130. package/lib/commonjs/schedule/validate-identifier.js +126 -0
  131. package/lib/commonjs/schedule/validate-identifier.js.map +1 -0
  132. package/lib/commonjs/schedule/writer.js +44 -0
  133. package/lib/commonjs/schedule/writer.js.map +1 -0
  134. package/lib/commonjs/state/caps.js +101 -0
  135. package/lib/commonjs/state/caps.js.map +1 -0
  136. package/lib/commonjs/state/dedup-ledger.js +39 -0
  137. package/lib/commonjs/state/dedup-ledger.js.map +1 -0
  138. package/lib/commonjs/state/interaction-buffer.js +98 -0
  139. package/lib/commonjs/state/interaction-buffer.js.map +1 -0
  140. package/lib/commonjs/state/mmkv-store.js +75 -0
  141. package/lib/commonjs/state/mmkv-store.js.map +1 -0
  142. package/lib/commonjs/state/permission-history.js +64 -0
  143. package/lib/commonjs/state/permission-history.js.map +1 -0
  144. package/lib/commonjs/state/record.js +269 -0
  145. package/lib/commonjs/state/record.js.map +1 -0
  146. package/lib/commonjs/state/reset.js +37 -0
  147. package/lib/commonjs/state/reset.js.map +1 -0
  148. package/lib/commonjs/state/series-ledger.js +71 -0
  149. package/lib/commonjs/state/series-ledger.js.map +1 -0
  150. package/lib/commonjs/state/store.js +39 -0
  151. package/lib/commonjs/state/store.js.map +1 -0
  152. package/lib/commonjs/testing/conformance/index.js +218 -0
  153. package/lib/commonjs/testing/conformance/index.js.map +1 -0
  154. package/lib/commonjs/testing/fake-engine.js +338 -0
  155. package/lib/commonjs/testing/fake-engine.js.map +1 -0
  156. package/lib/commonjs/testing/fake-provider.js +93 -0
  157. package/lib/commonjs/testing/fake-provider.js.map +1 -0
  158. package/lib/commonjs/testing/faults.js +59 -0
  159. package/lib/commonjs/testing/faults.js.map +1 -0
  160. package/lib/commonjs/testing/index.js +54 -0
  161. package/lib/commonjs/testing/index.js.map +1 -0
  162. package/lib/commonjs/testing/measure.js +298 -0
  163. package/lib/commonjs/testing/measure.js.map +1 -0
  164. package/lib/module/advanced.js +29 -0
  165. package/lib/module/advanced.js.map +1 -0
  166. package/lib/module/channel/migrate.js +242 -0
  167. package/lib/module/channel/migrate.js.map +1 -0
  168. package/lib/module/channel/tone-map.js +112 -0
  169. package/lib/module/channel/tone-map.js.map +1 -0
  170. package/lib/module/channel/validate-tone.js +57 -0
  171. package/lib/module/channel/validate-tone.js.map +1 -0
  172. package/lib/module/contract/channel.js +48 -0
  173. package/lib/module/contract/channel.js.map +1 -0
  174. package/lib/module/contract/diagnostics.js +21 -0
  175. package/lib/module/contract/diagnostics.js.map +1 -0
  176. package/lib/module/contract/errors.js +119 -0
  177. package/lib/module/contract/errors.js.map +1 -0
  178. package/lib/module/contract/hash.js +29 -0
  179. package/lib/module/contract/hash.js.map +1 -0
  180. package/lib/module/contract/index.js +13 -0
  181. package/lib/module/contract/index.js.map +1 -0
  182. package/lib/module/contract/interaction.js +33 -0
  183. package/lib/module/contract/interaction.js.map +1 -0
  184. package/lib/module/contract/notification.js +38 -0
  185. package/lib/module/contract/notification.js.map +1 -0
  186. package/lib/module/contract/permission.js +2 -0
  187. package/lib/module/contract/permission.js.map +1 -0
  188. package/lib/module/contract/reconcile.js +4 -0
  189. package/lib/module/contract/reconcile.js.map +1 -0
  190. package/lib/module/contract/recurrence.js +49 -0
  191. package/lib/module/contract/recurrence.js.map +1 -0
  192. package/lib/module/diagnostics/burst.js +85 -0
  193. package/lib/module/diagnostics/burst.js.map +1 -0
  194. package/lib/module/diagnostics/events.js +58 -0
  195. package/lib/module/diagnostics/events.js.map +1 -0
  196. package/lib/module/diagnostics/redact.js +44 -0
  197. package/lib/module/diagnostics/redact.js.map +1 -0
  198. package/lib/module/diagnostics/snapshot.js +64 -0
  199. package/lib/module/diagnostics/snapshot.js.map +1 -0
  200. package/lib/module/engine/adapter.js +4 -0
  201. package/lib/module/engine/adapter.js.map +1 -0
  202. package/lib/module/engine/codec.js +79 -0
  203. package/lib/module/engine/codec.js.map +1 -0
  204. package/lib/module/engine/notify-kit/events.js +139 -0
  205. package/lib/module/engine/notify-kit/events.js.map +1 -0
  206. package/lib/module/engine/notify-kit/module.js +113 -0
  207. package/lib/module/engine/notify-kit/module.js.map +1 -0
  208. package/lib/module/engine/notify-kit/platform/android.js +155 -0
  209. package/lib/module/engine/notify-kit/platform/android.js.map +1 -0
  210. package/lib/module/engine/notify-kit/platform/index.js +51 -0
  211. package/lib/module/engine/notify-kit/platform/index.js.map +1 -0
  212. package/lib/module/engine/notify-kit/platform/ios.js +49 -0
  213. package/lib/module/engine/notify-kit/platform/ios.js.map +1 -0
  214. package/lib/module/engine/notify-kit/platform/types.js +4 -0
  215. package/lib/module/engine/notify-kit/platform/types.js.map +1 -0
  216. package/lib/module/engine/notify-kit-engine.js +257 -0
  217. package/lib/module/engine/notify-kit-engine.js.map +1 -0
  218. package/lib/module/index.js +98 -0
  219. package/lib/module/index.js.map +1 -0
  220. package/lib/module/initialize.js +182 -0
  221. package/lib/module/initialize.js.map +1 -0
  222. package/lib/module/interaction/index.js +116 -0
  223. package/lib/module/interaction/index.js.map +1 -0
  224. package/lib/module/maintenance/cycle.js +102 -0
  225. package/lib/module/maintenance/cycle.js.map +1 -0
  226. package/lib/module/maintenance/permission-refresh.js +34 -0
  227. package/lib/module/maintenance/permission-refresh.js.map +1 -0
  228. package/lib/module/maintenance/reanchor.js +94 -0
  229. package/lib/module/maintenance/reanchor.js.map +1 -0
  230. package/lib/module/maintenance/toggle.js +45 -0
  231. package/lib/module/maintenance/toggle.js.map +1 -0
  232. package/lib/module/maintenance/verify.js +65 -0
  233. package/lib/module/maintenance/verify.js.map +1 -0
  234. package/lib/module/maintenance/window-refresh.js +48 -0
  235. package/lib/module/maintenance/window-refresh.js.map +1 -0
  236. package/lib/module/notifications.js +157 -0
  237. package/lib/module/notifications.js.map +1 -0
  238. package/lib/module/package.json +1 -0
  239. package/lib/module/permission/index.js +178 -0
  240. package/lib/module/permission/index.js.map +1 -0
  241. package/lib/module/permission/state.js +83 -0
  242. package/lib/module/permission/state.js.map +1 -0
  243. package/lib/module/push/envelope.js +137 -0
  244. package/lib/module/push/envelope.js.map +1 -0
  245. package/lib/module/push/fcm-provider.js +119 -0
  246. package/lib/module/push/fcm-provider.js.map +1 -0
  247. package/lib/module/push/gate.js +158 -0
  248. package/lib/module/push/gate.js.map +1 -0
  249. package/lib/module/push/index.js +16 -0
  250. package/lib/module/push/index.js.map +1 -0
  251. package/lib/module/push/instructions.js +97 -0
  252. package/lib/module/push/instructions.js.map +1 -0
  253. package/lib/module/push/provider-adapter.js +4 -0
  254. package/lib/module/push/provider-adapter.js.map +1 -0
  255. package/lib/module/push/signout.js +51 -0
  256. package/lib/module/push/signout.js.map +1 -0
  257. package/lib/module/reconcile/chunk.js +43 -0
  258. package/lib/module/reconcile/chunk.js.map +1 -0
  259. package/lib/module/reconcile/diff.js +101 -0
  260. package/lib/module/reconcile/diff.js.map +1 -0
  261. package/lib/module/reconcile/duplicates.js +56 -0
  262. package/lib/module/reconcile/duplicates.js.map +1 -0
  263. package/lib/module/reconcile/index.js +161 -0
  264. package/lib/module/reconcile/index.js.map +1 -0
  265. package/lib/module/reconcile/truncate.js +46 -0
  266. package/lib/module/reconcile/truncate.js.map +1 -0
  267. package/lib/module/recurrence/clock-guard.js +60 -0
  268. package/lib/module/recurrence/clock-guard.js.map +1 -0
  269. package/lib/module/recurrence/expand.js +248 -0
  270. package/lib/module/recurrence/expand.js.map +1 -0
  271. package/lib/module/recurrence/index.js +208 -0
  272. package/lib/module/recurrence/index.js.map +1 -0
  273. package/lib/module/repeat/expiry.js +37 -0
  274. package/lib/module/repeat/expiry.js.map +1 -0
  275. package/lib/module/repeat/index.js +67 -0
  276. package/lib/module/repeat/index.js.map +1 -0
  277. package/lib/module/repeat/marker.js +51 -0
  278. package/lib/module/repeat/marker.js.map +1 -0
  279. package/lib/module/repeat/place.js +79 -0
  280. package/lib/module/repeat/place.js.map +1 -0
  281. package/lib/module/schedule/anchor.js +234 -0
  282. package/lib/module/schedule/anchor.js.map +1 -0
  283. package/lib/module/schedule/index.js +137 -0
  284. package/lib/module/schedule/index.js.map +1 -0
  285. package/lib/module/schedule/partition.js +53 -0
  286. package/lib/module/schedule/partition.js.map +1 -0
  287. package/lib/module/schedule/resolve-moment.js +66 -0
  288. package/lib/module/schedule/resolve-moment.js.map +1 -0
  289. package/lib/module/schedule/validate-content.js +95 -0
  290. package/lib/module/schedule/validate-content.js.map +1 -0
  291. package/lib/module/schedule/validate-identifier.js +119 -0
  292. package/lib/module/schedule/validate-identifier.js.map +1 -0
  293. package/lib/module/schedule/writer.js +40 -0
  294. package/lib/module/schedule/writer.js.map +1 -0
  295. package/lib/module/state/caps.js +96 -0
  296. package/lib/module/state/caps.js.map +1 -0
  297. package/lib/module/state/dedup-ledger.js +34 -0
  298. package/lib/module/state/dedup-ledger.js.map +1 -0
  299. package/lib/module/state/interaction-buffer.js +92 -0
  300. package/lib/module/state/interaction-buffer.js.map +1 -0
  301. package/lib/module/state/mmkv-store.js +71 -0
  302. package/lib/module/state/mmkv-store.js.map +1 -0
  303. package/lib/module/state/permission-history.js +56 -0
  304. package/lib/module/state/permission-history.js.map +1 -0
  305. package/lib/module/state/record.js +264 -0
  306. package/lib/module/state/record.js.map +1 -0
  307. package/lib/module/state/reset.js +32 -0
  308. package/lib/module/state/reset.js.map +1 -0
  309. package/lib/module/state/series-ledger.js +62 -0
  310. package/lib/module/state/series-ledger.js.map +1 -0
  311. package/lib/module/state/store.js +35 -0
  312. package/lib/module/state/store.js.map +1 -0
  313. package/lib/module/testing/conformance/index.js +214 -0
  314. package/lib/module/testing/conformance/index.js.map +1 -0
  315. package/lib/module/testing/fake-engine.js +335 -0
  316. package/lib/module/testing/fake-engine.js.map +1 -0
  317. package/lib/module/testing/fake-provider.js +89 -0
  318. package/lib/module/testing/fake-provider.js.map +1 -0
  319. package/lib/module/testing/faults.js +55 -0
  320. package/lib/module/testing/faults.js.map +1 -0
  321. package/lib/module/testing/index.js +19 -0
  322. package/lib/module/testing/index.js.map +1 -0
  323. package/lib/module/testing/measure.js +294 -0
  324. package/lib/module/testing/measure.js.map +1 -0
  325. package/lib/typescript/commonjs/advanced.d.ts +36 -0
  326. package/lib/typescript/commonjs/advanced.d.ts.map +1 -0
  327. package/lib/typescript/commonjs/channel/migrate.d.ts +38 -0
  328. package/lib/typescript/commonjs/channel/migrate.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/channel/tone-map.d.ts +34 -0
  330. package/lib/typescript/commonjs/channel/tone-map.d.ts.map +1 -0
  331. package/lib/typescript/commonjs/channel/validate-tone.d.ts +23 -0
  332. package/lib/typescript/commonjs/channel/validate-tone.d.ts.map +1 -0
  333. package/lib/typescript/commonjs/contract/channel.d.ts +185 -0
  334. package/lib/typescript/commonjs/contract/channel.d.ts.map +1 -0
  335. package/lib/typescript/commonjs/contract/diagnostics.d.ts +92 -0
  336. package/lib/typescript/commonjs/contract/diagnostics.d.ts.map +1 -0
  337. package/lib/typescript/commonjs/contract/errors.d.ts +91 -0
  338. package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
  339. package/lib/typescript/commonjs/contract/hash.d.ts +14 -0
  340. package/lib/typescript/commonjs/contract/hash.d.ts.map +1 -0
  341. package/lib/typescript/commonjs/contract/index.d.ts +10 -0
  342. package/lib/typescript/commonjs/contract/index.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/contract/interaction.d.ts +53 -0
  344. package/lib/typescript/commonjs/contract/interaction.d.ts.map +1 -0
  345. package/lib/typescript/commonjs/contract/notification.d.ts +110 -0
  346. package/lib/typescript/commonjs/contract/notification.d.ts.map +1 -0
  347. package/lib/typescript/commonjs/contract/permission.d.ts +49 -0
  348. package/lib/typescript/commonjs/contract/permission.d.ts.map +1 -0
  349. package/lib/typescript/commonjs/contract/reconcile.d.ts +82 -0
  350. package/lib/typescript/commonjs/contract/reconcile.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/contract/recurrence.d.ts +118 -0
  352. package/lib/typescript/commonjs/contract/recurrence.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/diagnostics/burst.d.ts +39 -0
  354. package/lib/typescript/commonjs/diagnostics/burst.d.ts.map +1 -0
  355. package/lib/typescript/commonjs/diagnostics/events.d.ts +28 -0
  356. package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/diagnostics/redact.d.ts +22 -0
  358. package/lib/typescript/commonjs/diagnostics/redact.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/diagnostics/snapshot.d.ts +40 -0
  360. package/lib/typescript/commonjs/diagnostics/snapshot.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/engine/adapter.d.ts +172 -0
  362. package/lib/typescript/commonjs/engine/adapter.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/engine/codec.d.ts +20 -0
  364. package/lib/typescript/commonjs/engine/codec.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/engine/notify-kit/events.d.ts +37 -0
  366. package/lib/typescript/commonjs/engine/notify-kit/events.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/engine/notify-kit/module.d.ts +103 -0
  368. package/lib/typescript/commonjs/engine/notify-kit/module.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/engine/notify-kit/platform/android.d.ts +3 -0
  370. package/lib/typescript/commonjs/engine/notify-kit/platform/android.d.ts.map +1 -0
  371. package/lib/typescript/commonjs/engine/notify-kit/platform/index.d.ts +12 -0
  372. package/lib/typescript/commonjs/engine/notify-kit/platform/index.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/engine/notify-kit/platform/ios.d.ts +3 -0
  374. package/lib/typescript/commonjs/engine/notify-kit/platform/ios.d.ts.map +1 -0
  375. package/lib/typescript/commonjs/engine/notify-kit/platform/types.d.ts +33 -0
  376. package/lib/typescript/commonjs/engine/notify-kit/platform/types.d.ts.map +1 -0
  377. package/lib/typescript/commonjs/engine/notify-kit-engine.d.ts +25 -0
  378. package/lib/typescript/commonjs/engine/notify-kit-engine.d.ts.map +1 -0
  379. package/lib/typescript/commonjs/index.d.ts +106 -0
  380. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/initialize.d.ts +74 -0
  382. package/lib/typescript/commonjs/initialize.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/interaction/index.d.ts +53 -0
  384. package/lib/typescript/commonjs/interaction/index.d.ts.map +1 -0
  385. package/lib/typescript/commonjs/maintenance/cycle.d.ts +77 -0
  386. package/lib/typescript/commonjs/maintenance/cycle.d.ts.map +1 -0
  387. package/lib/typescript/commonjs/maintenance/permission-refresh.d.ts +19 -0
  388. package/lib/typescript/commonjs/maintenance/permission-refresh.d.ts.map +1 -0
  389. package/lib/typescript/commonjs/maintenance/reanchor.d.ts +26 -0
  390. package/lib/typescript/commonjs/maintenance/reanchor.d.ts.map +1 -0
  391. package/lib/typescript/commonjs/maintenance/toggle.d.ts +35 -0
  392. package/lib/typescript/commonjs/maintenance/toggle.d.ts.map +1 -0
  393. package/lib/typescript/commonjs/maintenance/verify.d.ts +32 -0
  394. package/lib/typescript/commonjs/maintenance/verify.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/maintenance/window-refresh.d.ts +29 -0
  396. package/lib/typescript/commonjs/maintenance/window-refresh.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/notifications.d.ts +78 -0
  398. package/lib/typescript/commonjs/notifications.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/package.json +1 -0
  400. package/lib/typescript/commonjs/permission/index.d.ts +57 -0
  401. package/lib/typescript/commonjs/permission/index.d.ts.map +1 -0
  402. package/lib/typescript/commonjs/permission/state.d.ts +41 -0
  403. package/lib/typescript/commonjs/permission/state.d.ts.map +1 -0
  404. package/lib/typescript/commonjs/push/envelope.d.ts +33 -0
  405. package/lib/typescript/commonjs/push/envelope.d.ts.map +1 -0
  406. package/lib/typescript/commonjs/push/fcm-provider.d.ts +43 -0
  407. package/lib/typescript/commonjs/push/fcm-provider.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/push/gate.d.ts +57 -0
  409. package/lib/typescript/commonjs/push/gate.d.ts.map +1 -0
  410. package/lib/typescript/commonjs/push/index.d.ts +19 -0
  411. package/lib/typescript/commonjs/push/index.d.ts.map +1 -0
  412. package/lib/typescript/commonjs/push/instructions.d.ts +45 -0
  413. package/lib/typescript/commonjs/push/instructions.d.ts.map +1 -0
  414. package/lib/typescript/commonjs/push/provider-adapter.d.ts +50 -0
  415. package/lib/typescript/commonjs/push/provider-adapter.d.ts.map +1 -0
  416. package/lib/typescript/commonjs/push/signout.d.ts +33 -0
  417. package/lib/typescript/commonjs/push/signout.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/reconcile/chunk.d.ts +24 -0
  419. package/lib/typescript/commonjs/reconcile/chunk.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/reconcile/diff.d.ts +54 -0
  421. package/lib/typescript/commonjs/reconcile/diff.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/reconcile/duplicates.d.ts +32 -0
  423. package/lib/typescript/commonjs/reconcile/duplicates.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/reconcile/index.d.ts +35 -0
  425. package/lib/typescript/commonjs/reconcile/index.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/reconcile/truncate.d.ts +26 -0
  427. package/lib/typescript/commonjs/reconcile/truncate.d.ts.map +1 -0
  428. package/lib/typescript/commonjs/recurrence/clock-guard.d.ts +37 -0
  429. package/lib/typescript/commonjs/recurrence/clock-guard.d.ts.map +1 -0
  430. package/lib/typescript/commonjs/recurrence/expand.d.ts +75 -0
  431. package/lib/typescript/commonjs/recurrence/expand.d.ts.map +1 -0
  432. package/lib/typescript/commonjs/recurrence/index.d.ts +40 -0
  433. package/lib/typescript/commonjs/recurrence/index.d.ts.map +1 -0
  434. package/lib/typescript/commonjs/repeat/expiry.d.ts +23 -0
  435. package/lib/typescript/commonjs/repeat/expiry.d.ts.map +1 -0
  436. package/lib/typescript/commonjs/repeat/index.d.ts +49 -0
  437. package/lib/typescript/commonjs/repeat/index.d.ts.map +1 -0
  438. package/lib/typescript/commonjs/repeat/marker.d.ts +36 -0
  439. package/lib/typescript/commonjs/repeat/marker.d.ts.map +1 -0
  440. package/lib/typescript/commonjs/repeat/place.d.ts +39 -0
  441. package/lib/typescript/commonjs/repeat/place.d.ts.map +1 -0
  442. package/lib/typescript/commonjs/schedule/anchor.d.ts +118 -0
  443. package/lib/typescript/commonjs/schedule/anchor.d.ts.map +1 -0
  444. package/lib/typescript/commonjs/schedule/index.d.ts +40 -0
  445. package/lib/typescript/commonjs/schedule/index.d.ts.map +1 -0
  446. package/lib/typescript/commonjs/schedule/partition.d.ts +29 -0
  447. package/lib/typescript/commonjs/schedule/partition.d.ts.map +1 -0
  448. package/lib/typescript/commonjs/schedule/resolve-moment.d.ts +35 -0
  449. package/lib/typescript/commonjs/schedule/resolve-moment.d.ts.map +1 -0
  450. package/lib/typescript/commonjs/schedule/validate-content.d.ts +42 -0
  451. package/lib/typescript/commonjs/schedule/validate-content.d.ts.map +1 -0
  452. package/lib/typescript/commonjs/schedule/validate-identifier.d.ts +30 -0
  453. package/lib/typescript/commonjs/schedule/validate-identifier.d.ts.map +1 -0
  454. package/lib/typescript/commonjs/schedule/writer.d.ts +36 -0
  455. package/lib/typescript/commonjs/schedule/writer.d.ts.map +1 -0
  456. package/lib/typescript/commonjs/state/caps.d.ts +51 -0
  457. package/lib/typescript/commonjs/state/caps.d.ts.map +1 -0
  458. package/lib/typescript/commonjs/state/dedup-ledger.d.ts +21 -0
  459. package/lib/typescript/commonjs/state/dedup-ledger.d.ts.map +1 -0
  460. package/lib/typescript/commonjs/state/interaction-buffer.d.ts +30 -0
  461. package/lib/typescript/commonjs/state/interaction-buffer.d.ts.map +1 -0
  462. package/lib/typescript/commonjs/state/mmkv-store.d.ts +33 -0
  463. package/lib/typescript/commonjs/state/mmkv-store.d.ts.map +1 -0
  464. package/lib/typescript/commonjs/state/permission-history.d.ts +20 -0
  465. package/lib/typescript/commonjs/state/permission-history.d.ts.map +1 -0
  466. package/lib/typescript/commonjs/state/record.d.ts +134 -0
  467. package/lib/typescript/commonjs/state/record.d.ts.map +1 -0
  468. package/lib/typescript/commonjs/state/reset.d.ts +22 -0
  469. package/lib/typescript/commonjs/state/reset.d.ts.map +1 -0
  470. package/lib/typescript/commonjs/state/series-ledger.d.ts +47 -0
  471. package/lib/typescript/commonjs/state/series-ledger.d.ts.map +1 -0
  472. package/lib/typescript/commonjs/state/store.d.ts +20 -0
  473. package/lib/typescript/commonjs/state/store.d.ts.map +1 -0
  474. package/lib/typescript/commonjs/testing/conformance/index.d.ts +32 -0
  475. package/lib/typescript/commonjs/testing/conformance/index.d.ts.map +1 -0
  476. package/lib/typescript/commonjs/testing/fake-engine.d.ts +91 -0
  477. package/lib/typescript/commonjs/testing/fake-engine.d.ts.map +1 -0
  478. package/lib/typescript/commonjs/testing/fake-provider.d.ts +35 -0
  479. package/lib/typescript/commonjs/testing/fake-provider.d.ts.map +1 -0
  480. package/lib/typescript/commonjs/testing/faults.d.ts +38 -0
  481. package/lib/typescript/commonjs/testing/faults.d.ts.map +1 -0
  482. package/lib/typescript/commonjs/testing/index.d.ts +22 -0
  483. package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
  484. package/lib/typescript/commonjs/testing/measure.d.ts +59 -0
  485. package/lib/typescript/commonjs/testing/measure.d.ts.map +1 -0
  486. package/lib/typescript/module/advanced.d.ts +36 -0
  487. package/lib/typescript/module/advanced.d.ts.map +1 -0
  488. package/lib/typescript/module/channel/migrate.d.ts +38 -0
  489. package/lib/typescript/module/channel/migrate.d.ts.map +1 -0
  490. package/lib/typescript/module/channel/tone-map.d.ts +34 -0
  491. package/lib/typescript/module/channel/tone-map.d.ts.map +1 -0
  492. package/lib/typescript/module/channel/validate-tone.d.ts +23 -0
  493. package/lib/typescript/module/channel/validate-tone.d.ts.map +1 -0
  494. package/lib/typescript/module/contract/channel.d.ts +185 -0
  495. package/lib/typescript/module/contract/channel.d.ts.map +1 -0
  496. package/lib/typescript/module/contract/diagnostics.d.ts +92 -0
  497. package/lib/typescript/module/contract/diagnostics.d.ts.map +1 -0
  498. package/lib/typescript/module/contract/errors.d.ts +91 -0
  499. package/lib/typescript/module/contract/errors.d.ts.map +1 -0
  500. package/lib/typescript/module/contract/hash.d.ts +14 -0
  501. package/lib/typescript/module/contract/hash.d.ts.map +1 -0
  502. package/lib/typescript/module/contract/index.d.ts +10 -0
  503. package/lib/typescript/module/contract/index.d.ts.map +1 -0
  504. package/lib/typescript/module/contract/interaction.d.ts +53 -0
  505. package/lib/typescript/module/contract/interaction.d.ts.map +1 -0
  506. package/lib/typescript/module/contract/notification.d.ts +110 -0
  507. package/lib/typescript/module/contract/notification.d.ts.map +1 -0
  508. package/lib/typescript/module/contract/permission.d.ts +49 -0
  509. package/lib/typescript/module/contract/permission.d.ts.map +1 -0
  510. package/lib/typescript/module/contract/reconcile.d.ts +82 -0
  511. package/lib/typescript/module/contract/reconcile.d.ts.map +1 -0
  512. package/lib/typescript/module/contract/recurrence.d.ts +118 -0
  513. package/lib/typescript/module/contract/recurrence.d.ts.map +1 -0
  514. package/lib/typescript/module/diagnostics/burst.d.ts +39 -0
  515. package/lib/typescript/module/diagnostics/burst.d.ts.map +1 -0
  516. package/lib/typescript/module/diagnostics/events.d.ts +28 -0
  517. package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
  518. package/lib/typescript/module/diagnostics/redact.d.ts +22 -0
  519. package/lib/typescript/module/diagnostics/redact.d.ts.map +1 -0
  520. package/lib/typescript/module/diagnostics/snapshot.d.ts +40 -0
  521. package/lib/typescript/module/diagnostics/snapshot.d.ts.map +1 -0
  522. package/lib/typescript/module/engine/adapter.d.ts +172 -0
  523. package/lib/typescript/module/engine/adapter.d.ts.map +1 -0
  524. package/lib/typescript/module/engine/codec.d.ts +20 -0
  525. package/lib/typescript/module/engine/codec.d.ts.map +1 -0
  526. package/lib/typescript/module/engine/notify-kit/events.d.ts +37 -0
  527. package/lib/typescript/module/engine/notify-kit/events.d.ts.map +1 -0
  528. package/lib/typescript/module/engine/notify-kit/module.d.ts +103 -0
  529. package/lib/typescript/module/engine/notify-kit/module.d.ts.map +1 -0
  530. package/lib/typescript/module/engine/notify-kit/platform/android.d.ts +3 -0
  531. package/lib/typescript/module/engine/notify-kit/platform/android.d.ts.map +1 -0
  532. package/lib/typescript/module/engine/notify-kit/platform/index.d.ts +12 -0
  533. package/lib/typescript/module/engine/notify-kit/platform/index.d.ts.map +1 -0
  534. package/lib/typescript/module/engine/notify-kit/platform/ios.d.ts +3 -0
  535. package/lib/typescript/module/engine/notify-kit/platform/ios.d.ts.map +1 -0
  536. package/lib/typescript/module/engine/notify-kit/platform/types.d.ts +33 -0
  537. package/lib/typescript/module/engine/notify-kit/platform/types.d.ts.map +1 -0
  538. package/lib/typescript/module/engine/notify-kit-engine.d.ts +25 -0
  539. package/lib/typescript/module/engine/notify-kit-engine.d.ts.map +1 -0
  540. package/lib/typescript/module/index.d.ts +106 -0
  541. package/lib/typescript/module/index.d.ts.map +1 -0
  542. package/lib/typescript/module/initialize.d.ts +74 -0
  543. package/lib/typescript/module/initialize.d.ts.map +1 -0
  544. package/lib/typescript/module/interaction/index.d.ts +53 -0
  545. package/lib/typescript/module/interaction/index.d.ts.map +1 -0
  546. package/lib/typescript/module/maintenance/cycle.d.ts +77 -0
  547. package/lib/typescript/module/maintenance/cycle.d.ts.map +1 -0
  548. package/lib/typescript/module/maintenance/permission-refresh.d.ts +19 -0
  549. package/lib/typescript/module/maintenance/permission-refresh.d.ts.map +1 -0
  550. package/lib/typescript/module/maintenance/reanchor.d.ts +26 -0
  551. package/lib/typescript/module/maintenance/reanchor.d.ts.map +1 -0
  552. package/lib/typescript/module/maintenance/toggle.d.ts +35 -0
  553. package/lib/typescript/module/maintenance/toggle.d.ts.map +1 -0
  554. package/lib/typescript/module/maintenance/verify.d.ts +32 -0
  555. package/lib/typescript/module/maintenance/verify.d.ts.map +1 -0
  556. package/lib/typescript/module/maintenance/window-refresh.d.ts +29 -0
  557. package/lib/typescript/module/maintenance/window-refresh.d.ts.map +1 -0
  558. package/lib/typescript/module/notifications.d.ts +78 -0
  559. package/lib/typescript/module/notifications.d.ts.map +1 -0
  560. package/lib/typescript/module/package.json +1 -0
  561. package/lib/typescript/module/permission/index.d.ts +57 -0
  562. package/lib/typescript/module/permission/index.d.ts.map +1 -0
  563. package/lib/typescript/module/permission/state.d.ts +41 -0
  564. package/lib/typescript/module/permission/state.d.ts.map +1 -0
  565. package/lib/typescript/module/push/envelope.d.ts +33 -0
  566. package/lib/typescript/module/push/envelope.d.ts.map +1 -0
  567. package/lib/typescript/module/push/fcm-provider.d.ts +43 -0
  568. package/lib/typescript/module/push/fcm-provider.d.ts.map +1 -0
  569. package/lib/typescript/module/push/gate.d.ts +57 -0
  570. package/lib/typescript/module/push/gate.d.ts.map +1 -0
  571. package/lib/typescript/module/push/index.d.ts +19 -0
  572. package/lib/typescript/module/push/index.d.ts.map +1 -0
  573. package/lib/typescript/module/push/instructions.d.ts +45 -0
  574. package/lib/typescript/module/push/instructions.d.ts.map +1 -0
  575. package/lib/typescript/module/push/provider-adapter.d.ts +50 -0
  576. package/lib/typescript/module/push/provider-adapter.d.ts.map +1 -0
  577. package/lib/typescript/module/push/signout.d.ts +33 -0
  578. package/lib/typescript/module/push/signout.d.ts.map +1 -0
  579. package/lib/typescript/module/reconcile/chunk.d.ts +24 -0
  580. package/lib/typescript/module/reconcile/chunk.d.ts.map +1 -0
  581. package/lib/typescript/module/reconcile/diff.d.ts +54 -0
  582. package/lib/typescript/module/reconcile/diff.d.ts.map +1 -0
  583. package/lib/typescript/module/reconcile/duplicates.d.ts +32 -0
  584. package/lib/typescript/module/reconcile/duplicates.d.ts.map +1 -0
  585. package/lib/typescript/module/reconcile/index.d.ts +35 -0
  586. package/lib/typescript/module/reconcile/index.d.ts.map +1 -0
  587. package/lib/typescript/module/reconcile/truncate.d.ts +26 -0
  588. package/lib/typescript/module/reconcile/truncate.d.ts.map +1 -0
  589. package/lib/typescript/module/recurrence/clock-guard.d.ts +37 -0
  590. package/lib/typescript/module/recurrence/clock-guard.d.ts.map +1 -0
  591. package/lib/typescript/module/recurrence/expand.d.ts +75 -0
  592. package/lib/typescript/module/recurrence/expand.d.ts.map +1 -0
  593. package/lib/typescript/module/recurrence/index.d.ts +40 -0
  594. package/lib/typescript/module/recurrence/index.d.ts.map +1 -0
  595. package/lib/typescript/module/repeat/expiry.d.ts +23 -0
  596. package/lib/typescript/module/repeat/expiry.d.ts.map +1 -0
  597. package/lib/typescript/module/repeat/index.d.ts +49 -0
  598. package/lib/typescript/module/repeat/index.d.ts.map +1 -0
  599. package/lib/typescript/module/repeat/marker.d.ts +36 -0
  600. package/lib/typescript/module/repeat/marker.d.ts.map +1 -0
  601. package/lib/typescript/module/repeat/place.d.ts +39 -0
  602. package/lib/typescript/module/repeat/place.d.ts.map +1 -0
  603. package/lib/typescript/module/schedule/anchor.d.ts +118 -0
  604. package/lib/typescript/module/schedule/anchor.d.ts.map +1 -0
  605. package/lib/typescript/module/schedule/index.d.ts +40 -0
  606. package/lib/typescript/module/schedule/index.d.ts.map +1 -0
  607. package/lib/typescript/module/schedule/partition.d.ts +29 -0
  608. package/lib/typescript/module/schedule/partition.d.ts.map +1 -0
  609. package/lib/typescript/module/schedule/resolve-moment.d.ts +35 -0
  610. package/lib/typescript/module/schedule/resolve-moment.d.ts.map +1 -0
  611. package/lib/typescript/module/schedule/validate-content.d.ts +42 -0
  612. package/lib/typescript/module/schedule/validate-content.d.ts.map +1 -0
  613. package/lib/typescript/module/schedule/validate-identifier.d.ts +30 -0
  614. package/lib/typescript/module/schedule/validate-identifier.d.ts.map +1 -0
  615. package/lib/typescript/module/schedule/writer.d.ts +36 -0
  616. package/lib/typescript/module/schedule/writer.d.ts.map +1 -0
  617. package/lib/typescript/module/state/caps.d.ts +51 -0
  618. package/lib/typescript/module/state/caps.d.ts.map +1 -0
  619. package/lib/typescript/module/state/dedup-ledger.d.ts +21 -0
  620. package/lib/typescript/module/state/dedup-ledger.d.ts.map +1 -0
  621. package/lib/typescript/module/state/interaction-buffer.d.ts +30 -0
  622. package/lib/typescript/module/state/interaction-buffer.d.ts.map +1 -0
  623. package/lib/typescript/module/state/mmkv-store.d.ts +33 -0
  624. package/lib/typescript/module/state/mmkv-store.d.ts.map +1 -0
  625. package/lib/typescript/module/state/permission-history.d.ts +20 -0
  626. package/lib/typescript/module/state/permission-history.d.ts.map +1 -0
  627. package/lib/typescript/module/state/record.d.ts +134 -0
  628. package/lib/typescript/module/state/record.d.ts.map +1 -0
  629. package/lib/typescript/module/state/reset.d.ts +22 -0
  630. package/lib/typescript/module/state/reset.d.ts.map +1 -0
  631. package/lib/typescript/module/state/series-ledger.d.ts +47 -0
  632. package/lib/typescript/module/state/series-ledger.d.ts.map +1 -0
  633. package/lib/typescript/module/state/store.d.ts +20 -0
  634. package/lib/typescript/module/state/store.d.ts.map +1 -0
  635. package/lib/typescript/module/testing/conformance/index.d.ts +32 -0
  636. package/lib/typescript/module/testing/conformance/index.d.ts.map +1 -0
  637. package/lib/typescript/module/testing/fake-engine.d.ts +91 -0
  638. package/lib/typescript/module/testing/fake-engine.d.ts.map +1 -0
  639. package/lib/typescript/module/testing/fake-provider.d.ts +35 -0
  640. package/lib/typescript/module/testing/fake-provider.d.ts.map +1 -0
  641. package/lib/typescript/module/testing/faults.d.ts +38 -0
  642. package/lib/typescript/module/testing/faults.d.ts.map +1 -0
  643. package/lib/typescript/module/testing/index.d.ts +22 -0
  644. package/lib/typescript/module/testing/index.d.ts.map +1 -0
  645. package/lib/typescript/module/testing/measure.d.ts +59 -0
  646. package/lib/typescript/module/testing/measure.d.ts.map +1 -0
  647. package/package.json +74 -23
  648. package/skills/sdk-rn-notification/SKILL.md +6 -5
  649. package/src/advanced.ts +35 -0
  650. package/src/channel/migrate.ts +176 -158
  651. package/src/channel/tone-map.ts +2 -10
  652. package/src/contract/errors.ts +7 -0
  653. package/src/contract/hash.ts +26 -0
  654. package/src/engine/adapter.ts +21 -1
  655. package/src/engine/notify-kit/events.ts +155 -0
  656. package/src/engine/notify-kit/module.ts +148 -0
  657. package/src/engine/notify-kit/platform/android.ts +172 -0
  658. package/src/engine/notify-kit/platform/index.ts +55 -0
  659. package/src/engine/notify-kit/platform/ios.ts +54 -0
  660. package/src/engine/notify-kit/platform/types.ts +40 -0
  661. package/src/engine/notify-kit-engine.ts +96 -477
  662. package/src/index.ts +9 -0
  663. package/src/notifications.ts +195 -0
  664. package/src/permission/index.ts +65 -4
  665. package/src/push/fcm-provider.ts +14 -4
  666. package/src/push/gate.ts +27 -5
  667. package/src/reconcile/diff.ts +38 -27
  668. package/src/reconcile/index.ts +13 -4
  669. package/src/recurrence/index.ts +2 -1
  670. package/src/repeat/expiry.ts +2 -6
  671. package/src/repeat/index.ts +45 -1
  672. package/src/repeat/marker.ts +1 -22
  673. package/src/repeat/place.ts +74 -35
  674. package/src/schedule/index.ts +10 -4
  675. package/src/schedule/partition.ts +0 -19
  676. package/src/schedule/validate-identifier.ts +8 -6
  677. package/src/schedule/writer.ts +13 -4
  678. package/src/state/caps.ts +28 -3
  679. package/src/state/permission-history.ts +25 -0
  680. package/src/state/record.ts +110 -20
  681. package/src/testing/fake-engine.ts +17 -1
@@ -27,47 +27,86 @@ export interface StopPlacement {
27
27
  sync(targetId: string, tone: ResolvedTone, deliversAt: number): Promise<void>;
28
28
  /** Drops any marker still guarding an identifier. */
29
29
  release(targetId: string): Promise<void>;
30
+ /** How many markers are outstanding: platform capacity they hold. */
31
+ count(): Promise<number>;
32
+ /**
33
+ * A placement for one pass of many operations (NOT-08). It reads the
34
+ * outstanding markers once and keeps that view current as it places and
35
+ * releases, instead of reading every pending trigger across the bridge for
36
+ * each operation — which made a reconcile of a few hundred changes do a few
37
+ * hundred full reads.
38
+ */
39
+ pass(): StopPlacement;
30
40
  }
31
41
 
32
42
  export function createStopPlacement(engine: NotificationEngineAdapter): StopPlacement {
33
- const release = async (targetId: string): Promise<void> => {
34
- const outstanding = await engine.listRepeatStops();
35
- const held = outstanding.find(stop => stop.targetId === targetId);
36
- if (held !== undefined) {
37
- await engine.cancel(held.markerId);
38
- }
39
- };
43
+ /** `snapshot`: read once and kept current, for a pass; otherwise read on every call. */
44
+ function placement(snapshot: boolean): StopPlacement {
45
+ let known: Map<string, string> | undefined;
46
+
47
+ /** targetId → markerId of every outstanding stop. */
48
+ const outstanding = async (): Promise<Map<string, string>> => {
49
+ if (snapshot && known) {
50
+ return known;
51
+ }
52
+ const read = new Map(
53
+ (await engine.listRepeatStops()).map(stop => [stop.targetId, stop.markerId] as const),
54
+ );
55
+ if (snapshot) {
56
+ known = read;
57
+ }
58
+ return read;
59
+ };
60
+
61
+ const release = async (targetId: string): Promise<void> => {
62
+ const stops = await outstanding();
63
+ const markerId = stops.get(targetId);
64
+ if (markerId !== undefined) {
65
+ await engine.cancel(markerId);
66
+ stops.delete(targetId);
67
+ }
68
+ };
69
+
70
+ return {
71
+ release,
72
+
73
+ async count() {
74
+ return (await outstanding()).size;
75
+ },
76
+
77
+ async sync(targetId, tone, deliversAt) {
78
+ await release(targetId);
40
79
 
41
- return {
42
- release,
80
+ const forMs = tone.android.repeatForMs;
81
+ if (!tone.android.loopSound || forMs === undefined) return;
43
82
 
44
- async sync(targetId, tone, deliversAt) {
45
- await release(targetId);
83
+ const capabilities = await engine.getCapabilities();
84
+ if (!capabilities.supportsRepeatingAlert) return;
46
85
 
47
- const forMs = tone.android.repeatForMs;
48
- if (!tone.android.loopSound || forMs === undefined) return;
86
+ const stop = repeatStopFor(targetId, deliversAt, forMs);
87
+ await engine.schedule({
88
+ request: {
89
+ id: stop.markerId,
90
+ // Deliberately empty. A marker is delivered and removed within the
91
+ // same handler invocation; anything readable here would be text a
92
+ // user might glimpse and be confused by.
93
+ content: { title: '', body: '' },
94
+ tone: tone.toneId,
95
+ // Absolute: the bound is a duration from a known instant, not a
96
+ // wall-clock time that should follow the user across time zones.
97
+ moment: { at: stop.dueAt, anchoring: 'absolute' },
98
+ },
99
+ resolvedAt: stop.dueAt,
100
+ tone,
101
+ approximate: false,
102
+ repeatStop: stop,
103
+ });
104
+ known?.set(targetId, stop.markerId);
105
+ },
49
106
 
50
- const capabilities = await engine.getCapabilities();
51
- if (!capabilities.supportsRepeatingAlert) return;
107
+ pass: () => placement(true),
108
+ };
109
+ }
52
110
 
53
- const stop = repeatStopFor(targetId, deliversAt, forMs);
54
- await engine.schedule({
55
- request: {
56
- id: stop.markerId,
57
- // Deliberately empty. A marker is delivered and removed within the
58
- // same handler invocation; anything readable here would be text a
59
- // user might glimpse and be confused by.
60
- content: { title: '', body: '' },
61
- tone: tone.toneId,
62
- // Absolute: the bound is a duration from a known instant, not a
63
- // wall-clock time that should follow the user across time zones.
64
- moment: { at: stop.dueAt, anchoring: 'absolute' },
65
- },
66
- resolvedAt: stop.dueAt,
67
- tone,
68
- approximate: false,
69
- repeatStop: stop,
70
- });
71
- },
72
- };
111
+ return placement(false);
73
112
  }
@@ -97,8 +97,12 @@ export function createScheduler(deps: ScheduleDependencies) {
97
97
  const anchored = anchorMoment(request.moment, zone);
98
98
  const resolution = resolveMoment(anchored.resolvedAt, deps.now());
99
99
 
100
- const existing = await deps.engine.getPending();
101
- const replaced = existing.some(entry => entry.id === request.id);
100
+ // Identifiers only where the engine can list them cheaply: reading every
101
+ // pending payload across the bridge just to answer "was this one already
102
+ // there" cost a full read per schedule (NOT-08).
103
+ const replaced = deps.engine.pendingIds
104
+ ? (await deps.engine.pendingIds()).includes(request.id)
105
+ : (await deps.engine.getPending()).some(entry => entry.id === request.id);
102
106
 
103
107
  // Approximate mode is a degradation, not a refusal: the notification is
104
108
  // still scheduled and the caller is told it may arrive late.
@@ -149,7 +153,8 @@ export function createScheduler(deps: ScheduleDependencies) {
149
153
  validateIdentifier(groupTag, 'groupTag');
150
154
  const ids = idsForTag(await deps.engine.getPending(), 'group', groupTag);
151
155
  await deps.engine.cancelMany(ids);
152
- for (const id of ids) await writer.releaseStop(id);
156
+ const pass = writer.pass();
157
+ for (const id of ids) await pass.releaseStop(id);
153
158
  return ids;
154
159
  },
155
160
 
@@ -157,7 +162,8 @@ export function createScheduler(deps: ScheduleDependencies) {
157
162
  validateIdentifier(ownerTag, 'ownerTag');
158
163
  const ids = idsForTag(await deps.engine.getPending(), 'owner', ownerTag);
159
164
  await deps.engine.cancelMany(ids);
160
- for (const id of ids) await writer.releaseStop(id);
165
+ const pass = writer.pass();
166
+ for (const id of ids) await pass.releaseStop(id);
161
167
  return ids;
162
168
  },
163
169
 
@@ -67,22 +67,3 @@ export function partition(
67
67
 
68
68
  return { tagged, untagged };
69
69
  }
70
-
71
- /**
72
- * True when cancelling `tag` would affect any entry outside it.
73
- *
74
- * Exists so isolation can be asserted directly rather than inferred from a
75
- * count — the property that matters is that one account's sign-out changes
76
- * exactly zero of another account's notifications.
77
- */
78
- export function wouldAffectOtherTags(
79
- entries: readonly PendingEntry[],
80
- kind: PartitionKind,
81
- tag: string,
82
- ): boolean {
83
- const selected = new Set(idsForTag(entries, kind, tag));
84
- return entries.some(entry => {
85
- const entryTag = kind === 'owner' ? entry.ownerTag : entry.groupTag;
86
- return selected.has(entry.id) && entryTag !== tag;
87
- });
88
- }
@@ -108,12 +108,14 @@ export function validateIdentifier(value: unknown, kind: IdentifierKind = 'id'):
108
108
 
109
109
  /** Non-throwing form, for validating a batch without unwinding on the first failure. */
110
110
  export function isValidIdentifier(value: unknown): value is string {
111
- return (
112
- typeof value === 'string' &&
113
- value.length > 0 &&
114
- value.length <= MAX_IDENTIFIER_LENGTH &&
115
- IDENTIFIER_PATTERN.test(value)
116
- );
111
+ // The throwing form is the rule; this one only reports whether it holds, so
112
+ // the two cannot disagree (the reserved marker prefix was missing here).
113
+ try {
114
+ validateIdentifier(value);
115
+ return true;
116
+ } catch {
117
+ return false;
118
+ }
117
119
  }
118
120
 
119
121
  /** Validates an optional tag, returning undefined when absent rather than failing. */
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  import type { NotificationEngineAdapter, EngineScheduleRequest } from '../engine/adapter';
17
- import { createStopPlacement } from '../repeat/place';
17
+ import { createStopPlacement, type StopPlacement } from '../repeat/place';
18
18
 
19
19
  export interface ScheduleWriter {
20
20
  /** Writes one notification and brings its stop marker in line with it. */
@@ -28,11 +28,19 @@ export interface ScheduleWriter {
28
28
  * real capacity, so the usable ceiling is the platform's minus theirs.
29
29
  */
30
30
  capacity(): Promise<number>;
31
+ /**
32
+ * A writer for one pass of many writes (NOT-08): it reads the outstanding stop
33
+ * markers once and keeps that view current, instead of a full read of every
34
+ * pending trigger per operation.
35
+ */
36
+ pass(): ScheduleWriter;
31
37
  }
32
38
 
33
39
  export function createScheduleWriter(engine: NotificationEngineAdapter): ScheduleWriter {
34
- const stops = createStopPlacement(engine);
40
+ return writerOver(engine, createStopPlacement(engine));
41
+ }
35
42
 
43
+ function writerOver(engine: NotificationEngineAdapter, stops: StopPlacement): ScheduleWriter {
36
44
  return {
37
45
  async write(input) {
38
46
  await engine.schedule(input);
@@ -48,8 +56,9 @@ export function createScheduleWriter(engine: NotificationEngineAdapter): Schedul
48
56
 
49
57
  async capacity() {
50
58
  const capabilities = await engine.getCapabilities();
51
- const markerCost = (await engine.listRepeatStops()).length;
52
- return Math.max(0, capabilities.pendingCeiling - markerCost);
59
+ return Math.max(0, capabilities.pendingCeiling - (await stops.count()));
53
60
  },
61
+
62
+ pass: () => writerOver(engine, stops.pass()),
54
63
  };
55
64
  }
package/src/state/caps.ts CHANGED
@@ -26,8 +26,21 @@ export interface EvictionOutcome<T> {
26
26
  readonly kept: readonly T[];
27
27
  readonly evicted: readonly T[];
28
28
  readonly reason: 'none' | 'cap' | 'retention' | 'cap+retention';
29
+ /** Entries kept beyond the cap because none of them may be evicted (NOT-16). */
30
+ readonly overCap: number;
29
31
  }
30
32
 
33
+ /**
34
+ * Which entries a cap may drop (NOT-16). The migration and series ledgers record
35
+ * live facts: an active channel's applied version, a series' count. Dropping one
36
+ * makes the package treat a migrated tone as new and restart a series from zero,
37
+ * so only retired and exhausted entries go; the rest are kept and reported.
38
+ */
39
+ const EVICTABLE: Partial<Record<CollectionName, (entry: unknown) => boolean>> = {
40
+ migrationLedger: entry => (entry as { retired?: boolean }).retired === true,
41
+ seriesLedger: entry => (entry as { exhausted?: boolean }).exhausted === true,
42
+ };
43
+
31
44
  /**
32
45
  * Applies retention first, then the size cap.
33
46
  *
@@ -55,8 +68,15 @@ export function evict<T extends Timestamped>(
55
68
  // Oldest first, so the tail is what we keep when trimming.
56
69
  live.sort((a, b) => a.at - b.at);
57
70
 
58
- const overflow = live.length > maxEntries ? live.slice(0, live.length - maxEntries) : [];
59
- const kept = live.length > maxEntries ? live.slice(live.length - maxEntries) : live;
71
+ const evictable = EVICTABLE[collection] ?? (() => true);
72
+ const excess = Math.max(0, live.length - maxEntries);
73
+ const overflow: T[] = [];
74
+ for (const entry of live) {
75
+ if (overflow.length === excess) break;
76
+ if (evictable(entry)) overflow.push(entry);
77
+ }
78
+ const dropped = new Set(overflow);
79
+ const kept = overflow.length === 0 ? live : live.filter(entry => !dropped.has(entry));
60
80
 
61
81
  let reason: EvictionOutcome<T>['reason'] = 'none';
62
82
  if (expired.length > 0 && overflow.length > 0) {
@@ -67,5 +87,10 @@ export function evict<T extends Timestamped>(
67
87
  reason = 'retention';
68
88
  }
69
89
 
70
- return { kept, evicted: [...expired, ...overflow], reason };
90
+ return {
91
+ kept,
92
+ evicted: [...expired, ...overflow],
93
+ reason,
94
+ overCap: Math.max(0, kept.length - maxEntries),
95
+ };
71
96
  }
@@ -39,3 +39,28 @@ export function recordRequested(
39
39
  { at: now, key: target, requested: true },
40
40
  ]);
41
41
  }
42
+
43
+ /** The device-wide key: a refusal is the user's answer to the app, not to one account. */
44
+ const DEVICE = '#device';
45
+
46
+ /** How many requests for `kind` the user has refused on this device. */
47
+ export function denialCount(state: StateManager, kind: PermissionKind): number {
48
+ const target = key(kind, DEVICE);
49
+ return state.read().permissionHistory.find(entry => entry.key === target)?.denials ?? 0;
50
+ }
51
+
52
+ export function recordDenial(state: StateManager, kind: PermissionKind, now: number): void {
53
+ const target = key(kind, DEVICE);
54
+ const denials = denialCount(state, kind) + 1;
55
+ state.update('permissionHistory', current => [
56
+ ...current.filter(entry => entry.key !== target),
57
+ { at: now, key: target, requested: true, denials },
58
+ ]);
59
+ }
60
+
61
+ /** Forgets refusals once the permission is seen granted: the next refusal starts over. */
62
+ export function clearDenials(state: StateManager, kind: PermissionKind): void {
63
+ if (denialCount(state, kind) === 0) return;
64
+ const target = key(kind, DEVICE);
65
+ state.update('permissionHistory', current => current.filter(entry => entry.key !== target));
66
+ }
@@ -16,7 +16,23 @@ import type { AnchoringMode, RoutingPayload } from '../contract/notification';
16
16
  import type { CollectionHealth, StateHealth } from '../contract/diagnostics';
17
17
  import { DIAGNOSTIC_CODES, type DiagnosticCode } from '../contract/errors';
18
18
 
19
+ /** The single record before 0.6.0; read once to migrate, then deleted. */
19
20
  const STATE_KEY = 'chipmobilesdk.notification.state';
21
+ /**
22
+ * Since 0.6.0 each collection has its own key, plus one for the schema version and
23
+ * summaries, so recording one dedup entry writes the dedup ledger and nothing else
24
+ * (NOT-16). Before, every update serialized the whole record — the 500-entry dedup
25
+ * ledger included — synchronously on the JS thread.
26
+ */
27
+ const META_KEY = `${STATE_KEY}:meta`;
28
+ const COLLECTIONS: readonly CollectionName[] = [
29
+ 'dedupLedger',
30
+ 'interactionBuffer',
31
+ 'migrationLedger',
32
+ 'seriesLedger',
33
+ 'permissionHistory',
34
+ ];
35
+ const keyFor = (collection: CollectionName) => `${STATE_KEY}:${collection}`;
20
36
 
21
37
  /**
22
38
  * Bumped whenever the shape below changes. A mismatch discards and rebuilds —
@@ -80,6 +96,8 @@ export interface SeriesEntry extends Timestamped {
80
96
  export interface PermissionHistoryEntry extends Timestamped {
81
97
  readonly key: string;
82
98
  readonly requested: boolean;
99
+ /** Requests the user refused, so a permanent denial can be told apart (0.6.0). */
100
+ readonly denials?: number;
83
101
  }
84
102
 
85
103
  export interface StateRecord {
@@ -134,40 +152,77 @@ export class StateManager {
134
152
  }
135
153
 
136
154
  private load(): StateRecord {
137
- const raw = this.store.getString(STATE_KEY);
138
- if (raw === undefined) {
139
- return emptyRecord();
140
- }
141
-
142
155
  try {
143
- const parsed = JSON.parse(raw) as Partial<StateRecord>;
156
+ const meta = this.store.getString(META_KEY);
157
+ if (meta === undefined) {
158
+ return this.migrateLegacy();
159
+ }
160
+ const parsed = JSON.parse(meta) as Partial<StateRecord>;
144
161
  if (parsed.schemaVersion !== STATE_SCHEMA_VERSION) {
145
162
  return this.discardAndRebuild('schema-version-mismatch', {
146
163
  found: parsed.schemaVersion,
147
164
  expected: STATE_SCHEMA_VERSION,
148
165
  });
149
166
  }
150
- return {
167
+ const record: Record<string, unknown> = {
151
168
  schemaVersion: STATE_SCHEMA_VERSION,
152
- dedupLedger: parsed.dedupLedger ?? [],
153
- interactionBuffer: parsed.interactionBuffer ?? [],
154
- migrationLedger: parsed.migrationLedger ?? [],
155
- seriesLedger: parsed.seriesLedger ?? [],
156
- permissionHistory: parsed.permissionHistory ?? [],
157
169
  lastReconcileSummary: parsed.lastReconcileSummary,
158
170
  lastMaintenanceSummary: parsed.lastMaintenanceSummary,
159
171
  };
172
+ for (const collection of COLLECTIONS) {
173
+ const raw = this.store.getString(keyFor(collection));
174
+ const entries: unknown = raw === undefined ? [] : JSON.parse(raw);
175
+ if (!Array.isArray(entries)) {
176
+ return this.discardAndRebuild('unparseable', { collection });
177
+ }
178
+ record[collection] = entries;
179
+ }
180
+ return record as unknown as StateRecord;
160
181
  } catch {
161
182
  return this.discardAndRebuild('unparseable');
162
183
  }
163
184
  }
164
185
 
186
+ /** Reads the pre-0.6.0 single record, writes it out per collection, and drops it. */
187
+ private migrateLegacy(): StateRecord {
188
+ const raw = this.store.getString(STATE_KEY);
189
+ if (raw === undefined) {
190
+ const fresh = emptyRecord();
191
+ this.persistMeta(fresh);
192
+ return fresh;
193
+ }
194
+ const parsed = JSON.parse(raw) as Partial<StateRecord>;
195
+ if (parsed.schemaVersion !== STATE_SCHEMA_VERSION) {
196
+ return this.discardAndRebuild('schema-version-mismatch', {
197
+ found: parsed.schemaVersion,
198
+ expected: STATE_SCHEMA_VERSION,
199
+ });
200
+ }
201
+ this.record = {
202
+ schemaVersion: STATE_SCHEMA_VERSION,
203
+ dedupLedger: parsed.dedupLedger ?? [],
204
+ interactionBuffer: parsed.interactionBuffer ?? [],
205
+ migrationLedger: parsed.migrationLedger ?? [],
206
+ seriesLedger: parsed.seriesLedger ?? [],
207
+ permissionHistory: parsed.permissionHistory ?? [],
208
+ lastReconcileSummary: parsed.lastReconcileSummary,
209
+ lastMaintenanceSummary: parsed.lastMaintenanceSummary,
210
+ };
211
+ for (const collection of COLLECTIONS) {
212
+ this.persist(collection);
213
+ }
214
+ this.persistMeta(this.record);
215
+ this.store.delete(STATE_KEY);
216
+ return this.record;
217
+ }
218
+
165
219
  private discardAndRebuild(
166
220
  reason: string,
167
221
  extra?: Readonly<Record<string, unknown>>,
168
222
  ): StateRecord {
169
223
  this.rebuilt = true;
170
- this.store.delete(STATE_KEY);
224
+ this.deleteAll();
225
+ this.persistMeta(emptyRecord());
171
226
  this.emit({
172
227
  code: DIAGNOSTIC_CODES.STATE_CORRUPT_REBUILT,
173
228
  // Note what is actually lost, so the consequence is stated rather than implied.
@@ -176,10 +231,18 @@ export class StateManager {
176
231
  return emptyRecord();
177
232
  }
178
233
 
234
+ private deleteAll(): void {
235
+ this.store.delete(STATE_KEY);
236
+ this.store.delete(META_KEY);
237
+ for (const collection of COLLECTIONS) {
238
+ this.store.delete(keyFor(collection));
239
+ }
240
+ }
241
+
179
242
  /** Never throws. A storage failure degrades the affected guarantee, nothing more. */
180
- private persist(): void {
243
+ private write(key: string, value: unknown): void {
181
244
  try {
182
- this.store.setString(STATE_KEY, JSON.stringify(this.record));
245
+ this.store.setString(key, JSON.stringify(value));
183
246
  } catch (error) {
184
247
  this.emit({
185
248
  code: DIAGNOSTIC_CODES.STATE_WRITE_FAILED,
@@ -188,6 +251,20 @@ export class StateManager {
188
251
  }
189
252
  }
190
253
 
254
+ /** Writes one collection, and only that one. */
255
+ private persist(collection: CollectionName): void {
256
+ this.write(keyFor(collection), this.record[collection]);
257
+ }
258
+
259
+ /** The schema version and summaries. Present whenever any collection is stored. */
260
+ private persistMeta(record: StateRecord = this.record): void {
261
+ this.write(META_KEY, {
262
+ schemaVersion: STATE_SCHEMA_VERSION,
263
+ lastReconcileSummary: record.lastReconcileSummary,
264
+ lastMaintenanceSummary: record.lastMaintenanceSummary,
265
+ });
266
+ }
267
+
191
268
  read(): StateRecord {
192
269
  return this.record;
193
270
  }
@@ -198,7 +275,17 @@ export class StateManager {
198
275
  mutate: (current: StateRecord[K]) => StateRecord[K],
199
276
  ): void {
200
277
  const next = mutate(this.record[collection]);
201
- const { kept, evicted, reason } = evict(next as readonly Timestamped[], collection, this.now());
278
+ const { kept, evicted, reason, overCap } = evict(
279
+ next as readonly Timestamped[],
280
+ collection,
281
+ this.now(),
282
+ );
283
+ if (overCap > 0) {
284
+ this.emit({
285
+ code: DIAGNOSTIC_CODES.STATE_CAP_EXCEEDED,
286
+ context: { collection, overCap, cap: COLLECTION_CAPS[collection].maxEntries },
287
+ });
288
+ }
202
289
 
203
290
  if (evicted.length > 0) {
204
291
  this.emit({
@@ -211,7 +298,7 @@ export class StateManager {
211
298
  }
212
299
 
213
300
  this.record = { ...this.record, [collection]: kept } as StateRecord;
214
- this.persist();
301
+ this.persist(collection);
215
302
  }
216
303
 
217
304
  setSummary(
@@ -219,14 +306,15 @@ export class StateManager {
219
306
  value: Readonly<Record<string, unknown>>,
220
307
  ): void {
221
308
  this.record = { ...this.record, [key]: value };
222
- this.persist();
309
+ this.persistMeta();
223
310
  }
224
311
 
225
312
  /** Clears everything. Public through `resetState()`. */
226
313
  reset(): void {
227
314
  this.record = emptyRecord();
228
315
  this.rebuilt = false;
229
- this.store.delete(STATE_KEY);
316
+ this.deleteAll();
317
+ this.persistMeta();
230
318
  }
231
319
 
232
320
  /**
@@ -244,7 +332,9 @@ export class StateManager {
244
332
  e => !e.key.startsWith(`${ownerTag}:`),
245
333
  ),
246
334
  };
247
- this.persist();
335
+ this.persist('dedupLedger');
336
+ this.persist('interactionBuffer');
337
+ this.persist('permissionHistory');
248
338
  }
249
339
 
250
340
  health(): StateHealth {
@@ -83,6 +83,11 @@ export interface FakeControls {
83
83
 
84
84
  /** Queues an interaction that arrived before any handler existed. */
85
85
  emitInteraction(event: InteractionEvent): void;
86
+ /**
87
+ * An interaction while the app is not in front: live `subscribeToInteractions`
88
+ * handlers get it, otherwise the registered background handler does.
89
+ */
90
+ emitBackgroundInteraction(event: InteractionEvent): Promise<void>;
86
91
  queueInitialInteraction(event: InteractionEvent): void;
87
92
 
88
93
  /** The labels a declared channel currently carries, so a label refresh is assertable. */
@@ -119,6 +124,7 @@ export function createFakeEngine(options: FakeEngineOptions = {}): FakeEngine {
119
124
  let listeners: ((event: InteractionEvent) => void)[] = [];
120
125
  let deliveryListeners: ((event: DeliveryEvent) => void)[] = [];
121
126
  let backgroundHandler: ((event: DeliveryEvent) => Promise<void>) | undefined;
127
+ let backgroundInteractionHandler: ((event: InteractionEvent) => Promise<void>) | undefined;
122
128
  let initialInteraction: InteractionEvent | undefined;
123
129
 
124
130
  let currentTime = options.now ?? Date.UTC(2026, 0, 1, 12, 0, 0);
@@ -313,8 +319,9 @@ export function createFakeEngine(options: FakeEngineOptions = {}): FakeEngine {
313
319
  };
314
320
  },
315
321
 
316
- registerBackgroundDeliveryHandler(handler) {
322
+ registerBackgroundDeliveryHandler(handler, onInteraction) {
317
323
  backgroundHandler = handler;
324
+ backgroundInteractionHandler = onInteraction;
318
325
  },
319
326
 
320
327
  hasBackgroundDeliveryHandler() {
@@ -385,6 +392,15 @@ export function createFakeEngine(options: FakeEngineOptions = {}): FakeEngine {
385
392
  }
386
393
  },
387
394
 
395
+ async emitBackgroundInteraction(event) {
396
+ const background: InteractionEvent = { ...event, appState: 'background' };
397
+ if (listeners.length > 0) {
398
+ for (const listener of [...listeners]) listener(background);
399
+ return;
400
+ }
401
+ await backgroundInteractionHandler?.(background);
402
+ },
403
+
388
404
  emitInteraction(event) {
389
405
  for (const listener of listeners) {
390
406
  listener(event);