@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
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ALL_DIAGNOSTIC_CODES", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _index.ALL_DIAGNOSTIC_CODES;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "CONTENT_LIMITS", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _validateContent.CONTENT_LIMITS;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "DEFAULT_ANCHORING_MODE", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _index.DEFAULT_ANCHORING_MODE;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "DEFAULT_BURST_THRESHOLD", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _index.DEFAULT_BURST_THRESHOLD;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "DEFAULT_LOOKAHEAD", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _index.DEFAULT_LOOKAHEAD;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "DIAGNOSTIC_CODES", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _index.DIAGNOSTIC_CODES;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "DiagnosticEmitter", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _events.DiagnosticEmitter;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "INTERACTION_BUFFER_LIMITS", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _index.INTERACTION_BUFFER_LIMITS;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "LOOKAHEAD_BOUNDS", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _index.LOOKAHEAD_BOUNDS;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "MAX_ACTIONS_PER_NOTIFICATION", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _index.MAX_ACTIONS_PER_NOTIFICATION;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "MAX_IDENTIFIER_LENGTH", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _validateIdentifier.MAX_IDENTIFIER_LENGTH;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "MAX_ROUTING_PAYLOAD_BYTES", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _index.MAX_ROUTING_PAYLOAD_BYTES;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "MaintenanceController", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _toggle.MaintenanceController;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "MaintenanceRegistry", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _cycle.MaintenanceRegistry;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "MaintenanceScopeViolation", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _cycle.MaintenanceScopeViolation;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "NotificationError", {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _index.NotificationError;
100
+ }
101
+ });
102
+ Object.defineProperty(exports, "PAST_TOLERANCE_MS", {
103
+ enumerable: true,
104
+ get: function () {
105
+ return _resolveMoment.PAST_TOLERANCE_MS;
106
+ }
107
+ });
108
+ Object.defineProperty(exports, "REPEAT_ALERT_BOUNDS", {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _index.REPEAT_ALERT_BOUNDS;
112
+ }
113
+ });
114
+ Object.defineProperty(exports, "REPEAT_STOP_PREFIX", {
115
+ enumerable: true,
116
+ get: function () {
117
+ return _index5.REPEAT_STOP_PREFIX;
118
+ }
119
+ });
120
+ Object.defineProperty(exports, "StateManager", {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _record.StateManager;
124
+ }
125
+ });
126
+ Object.defineProperty(exports, "canDisplay", {
127
+ enumerable: true,
128
+ get: function () {
129
+ return _state.canDisplay;
130
+ }
131
+ });
132
+ Object.defineProperty(exports, "capabilityFor", {
133
+ enumerable: true,
134
+ get: function () {
135
+ return _state.capabilityFor;
136
+ }
137
+ });
138
+ Object.defineProperty(exports, "channelIdFor", {
139
+ enumerable: true,
140
+ get: function () {
141
+ return _toneMap.channelIdFor;
142
+ }
143
+ });
144
+ Object.defineProperty(exports, "clearOwner", {
145
+ enumerable: true,
146
+ get: function () {
147
+ return _reset.clearOwner;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, "createBurstDetector", {
151
+ enumerable: true,
152
+ get: function () {
153
+ return _burst.createBurstDetector;
154
+ }
155
+ });
156
+ Object.defineProperty(exports, "createChannels", {
157
+ enumerable: true,
158
+ get: function () {
159
+ return _migrate.createChannels;
160
+ }
161
+ });
162
+ Object.defineProperty(exports, "createInteractions", {
163
+ enumerable: true,
164
+ get: function () {
165
+ return _index6.createInteractions;
166
+ }
167
+ });
168
+ Object.defineProperty(exports, "createMmkvStore", {
169
+ enumerable: true,
170
+ get: function () {
171
+ return _mmkvStore.createMmkvStore;
172
+ }
173
+ });
174
+ Object.defineProperty(exports, "createNotifications", {
175
+ enumerable: true,
176
+ get: function () {
177
+ return _notifications.createNotifications;
178
+ }
179
+ });
180
+ Object.defineProperty(exports, "createNotifyKitEngine", {
181
+ enumerable: true,
182
+ get: function () {
183
+ return _notifyKitEngine.createNotifyKitEngine;
184
+ }
185
+ });
186
+ Object.defineProperty(exports, "createPermissionRefreshStep", {
187
+ enumerable: true,
188
+ get: function () {
189
+ return _permissionRefresh.createPermissionRefreshStep;
190
+ }
191
+ });
192
+ Object.defineProperty(exports, "createPermissions", {
193
+ enumerable: true,
194
+ get: function () {
195
+ return _index7.createPermissions;
196
+ }
197
+ });
198
+ Object.defineProperty(exports, "createPlatformTimeZoneReader", {
199
+ enumerable: true,
200
+ get: function () {
201
+ return _anchor.createPlatformTimeZoneReader;
202
+ }
203
+ });
204
+ Object.defineProperty(exports, "createReAnchorStep", {
205
+ enumerable: true,
206
+ get: function () {
207
+ return _reanchor.createReAnchorStep;
208
+ }
209
+ });
210
+ Object.defineProperty(exports, "createReconciler", {
211
+ enumerable: true,
212
+ get: function () {
213
+ return _index3.createReconciler;
214
+ }
215
+ });
216
+ Object.defineProperty(exports, "createRecurrence", {
217
+ enumerable: true,
218
+ get: function () {
219
+ return _index4.createRecurrence;
220
+ }
221
+ });
222
+ Object.defineProperty(exports, "createRepeatExpiryHandler", {
223
+ enumerable: true,
224
+ get: function () {
225
+ return _index5.createRepeatExpiryHandler;
226
+ }
227
+ });
228
+ Object.defineProperty(exports, "createScheduler", {
229
+ enumerable: true,
230
+ get: function () {
231
+ return _index2.createScheduler;
232
+ }
233
+ });
234
+ Object.defineProperty(exports, "createSnapshot", {
235
+ enumerable: true,
236
+ get: function () {
237
+ return _snapshot.createSnapshot;
238
+ }
239
+ });
240
+ Object.defineProperty(exports, "createToneResolver", {
241
+ enumerable: true,
242
+ get: function () {
243
+ return _toneMap.createToneResolver;
244
+ }
245
+ });
246
+ Object.defineProperty(exports, "createVerifyStep", {
247
+ enumerable: true,
248
+ get: function () {
249
+ return _verify.createVerifyStep;
250
+ }
251
+ });
252
+ Object.defineProperty(exports, "createWindowRefreshStep", {
253
+ enumerable: true,
254
+ get: function () {
255
+ return _windowRefresh.createWindowRefreshStep;
256
+ }
257
+ });
258
+ Object.defineProperty(exports, "initialize", {
259
+ enumerable: true,
260
+ get: function () {
261
+ return _initialize.initialize;
262
+ }
263
+ });
264
+ Object.defineProperty(exports, "isNonFailure", {
265
+ enumerable: true,
266
+ get: function () {
267
+ return _index.isNonFailure;
268
+ }
269
+ });
270
+ Object.defineProperty(exports, "isNotificationError", {
271
+ enumerable: true,
272
+ get: function () {
273
+ return _index.isNotificationError;
274
+ }
275
+ });
276
+ Object.defineProperty(exports, "isTerminal", {
277
+ enumerable: true,
278
+ get: function () {
279
+ return _state.isTerminal;
280
+ }
281
+ });
282
+ Object.defineProperty(exports, "isValidTimeZone", {
283
+ enumerable: true,
284
+ get: function () {
285
+ return _anchor.isValidTimeZone;
286
+ }
287
+ });
288
+ Object.defineProperty(exports, "occurrenceId", {
289
+ enumerable: true,
290
+ get: function () {
291
+ return _expand.occurrenceId;
292
+ }
293
+ });
294
+ Object.defineProperty(exports, "parseChannelId", {
295
+ enumerable: true,
296
+ get: function () {
297
+ return _toneMap.parseChannelId;
298
+ }
299
+ });
300
+ Object.defineProperty(exports, "registerBackgroundNotificationHandler", {
301
+ enumerable: true,
302
+ get: function () {
303
+ return _index5.registerBackgroundNotificationHandler;
304
+ }
305
+ });
306
+ Object.defineProperty(exports, "resetState", {
307
+ enumerable: true,
308
+ get: function () {
309
+ return _reset.resetState;
310
+ }
311
+ });
312
+ Object.defineProperty(exports, "resolveTone", {
313
+ enumerable: true,
314
+ get: function () {
315
+ return _toneMap.resolveTone;
316
+ }
317
+ });
318
+ Object.defineProperty(exports, "shouldOfferSettings", {
319
+ enumerable: true,
320
+ get: function () {
321
+ return _state.shouldOfferSettings;
322
+ }
323
+ });
324
+ Object.defineProperty(exports, "validateToneDeclaration", {
325
+ enumerable: true,
326
+ get: function () {
327
+ return _validateTone.validateToneDeclaration;
328
+ }
329
+ });
330
+ Object.defineProperty(exports, "validateToneDeclarations", {
331
+ enumerable: true,
332
+ get: function () {
333
+ return _validateTone.validateToneDeclarations;
334
+ }
335
+ });
336
+ var _index = require("./contract/index.js");
337
+ var _notifyKitEngine = require("./engine/notify-kit-engine.js");
338
+ var _notifications = require("./notifications.js");
339
+ var _initialize = require("./initialize.js");
340
+ var _index2 = require("./schedule/index.js");
341
+ var _index3 = require("./reconcile/index.js");
342
+ var _index4 = require("./recurrence/index.js");
343
+ var _expand = require("./recurrence/expand.js");
344
+ var _migrate = require("./channel/migrate.js");
345
+ var _toneMap = require("./channel/tone-map.js");
346
+ var _validateTone = require("./channel/validate-tone.js");
347
+ var _index5 = require("./repeat/index.js");
348
+ var _index6 = require("./interaction/index.js");
349
+ var _snapshot = require("./diagnostics/snapshot.js");
350
+ var _burst = require("./diagnostics/burst.js");
351
+ var _events = require("./diagnostics/events.js");
352
+ var _index7 = require("./permission/index.js");
353
+ var _state = require("./permission/state.js");
354
+ var _permissionRefresh = require("./maintenance/permission-refresh.js");
355
+ var _reanchor = require("./maintenance/reanchor.js");
356
+ var _verify = require("./maintenance/verify.js");
357
+ var _windowRefresh = require("./maintenance/window-refresh.js");
358
+ var _cycle = require("./maintenance/cycle.js");
359
+ var _toggle = require("./maintenance/toggle.js");
360
+ var _reset = require("./state/reset.js");
361
+ var _mmkvStore = require("./state/mmkv-store.js");
362
+ var _record = require("./state/record.js");
363
+ var _validateIdentifier = require("./schedule/validate-identifier.js");
364
+ var _validateContent = require("./schedule/validate-content.js");
365
+ var _resolveMoment = require("./schedule/resolve-moment.js");
366
+ var _anchor = require("./schedule/anchor.js");
367
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_index","require","_notifyKitEngine","_notifications","_initialize","_index2","_index3","_index4","_expand","_migrate","_toneMap","_validateTone","_index5","_index6","_snapshot","_burst","_events","_index7","_state","_permissionRefresh","_reanchor","_verify","_windowRefresh","_cycle","_toggle","_reset","_mmkvStore","_record","_validateIdentifier","_validateContent","_resolveMoment","_anchor"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAA7B,OAAA;AAUA,IAAA8B,OAAA,GAAA9B,OAAA","ignoreList":[]}
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.initialize = initialize;
7
+ exports.resolveLookahead = resolveLookahead;
8
+ exports.validateConfig = validateConfig;
9
+ var _rnCore = require("@chipmobilesdk/rn-core");
10
+ var _recurrence = require("./contract/recurrence.js");
11
+ var _errors = require("./contract/errors.js");
12
+ var _events = require("./diagnostics/events.js");
13
+ var _cycle = require("./maintenance/cycle.js");
14
+ var _toggle = require("./maintenance/toggle.js");
15
+ var _record = require("./state/record.js");
16
+ var _seriesLedger = require("./state/series-ledger.js");
17
+ var _migrate = require("./channel/migrate.js");
18
+ var _anchor = require("./schedule/anchor.js");
19
+ /**
20
+ * Package initialization.
21
+ *
22
+ * Composes the parts that must be in place before the first schedule call:
23
+ * validate configuration, load persisted state, apply tone declarations, run
24
+ * any pending channel migration, and start the maintenance registry.
25
+ *
26
+ * Budgeted at 100 ms of app startup, which is why state loading is synchronous
27
+ * and tone declaration is the only platform round-trip.
28
+ *
29
+ * Automatic maintenance is started here too: whatever steps are registered on
30
+ * `runtime.registry` run when the app returns to the foreground, with the
31
+ * trigger reported as `timeZoneChange` when the device zone moved meanwhile.
32
+ * Until 0.4.0 nothing ever called `runAutomatic`, so "automatic" maintenance
33
+ * only ran when the app invoked it by hand.
34
+ */
35
+
36
+ /** The slice of React Native's `AppState` the lifecycle observer uses. */
37
+
38
+ /** rn-core's shared lifecycle port in the observer's shape: one native subscription for every package (PERF-07). */
39
+ const sharedLifecycle = {
40
+ addEventListener: (_type, listener) => ({
41
+ remove: (0, _rnCore.appLifecycle)().subscribe(state => listener(state))
42
+ })
43
+ };
44
+
45
+ /** Everything assembled at initialization, shared by the operation modules. */
46
+
47
+ /**
48
+ * Clamps the lookahead into its documented bounds.
49
+ *
50
+ * Bounded on adjustment because the platform ceiling is not negotiable: a
51
+ * consumer asking for a five-year window would silently exhaust the 64-entry
52
+ * iOS ceiling on the first frequent series.
53
+ */
54
+ function resolveLookahead(partial) {
55
+ const days = partial?.days ?? _recurrence.DEFAULT_LOOKAHEAD.days;
56
+ const occurrencesPerSeries = partial?.occurrencesPerSeries ?? _recurrence.DEFAULT_LOOKAHEAD.occurrencesPerSeries;
57
+ return {
58
+ days: Math.min(Math.max(days, _recurrence.LOOKAHEAD_BOUNDS.minDays), _recurrence.LOOKAHEAD_BOUNDS.maxDays),
59
+ occurrencesPerSeries: Math.min(Math.max(occurrencesPerSeries, _recurrence.LOOKAHEAD_BOUNDS.minOccurrences), _recurrence.LOOKAHEAD_BOUNDS.maxOccurrences)
60
+ };
61
+ }
62
+
63
+ /** Fails before any platform call, so a bad configuration never half-applies. */
64
+ function validateConfig(config) {
65
+ if (config.tones.length === 0) {
66
+ throw new _errors.NotificationError(_errors.DIAGNOSTIC_CODES.UNDECLARED_TONE, 'At least one tone must be declared before notifications can be scheduled.');
67
+ }
68
+ const seen = new Set();
69
+ for (const tone of config.tones) {
70
+ if (seen.has(tone.id)) {
71
+ throw new _errors.NotificationError(_errors.DIAGNOSTIC_CODES.UNDECLARED_TONE, `Tone "${tone.id}" is declared more than once.`, {
72
+ toneId: tone.id
73
+ });
74
+ }
75
+ seen.add(tone.id);
76
+ if (!Number.isInteger(tone.version) || tone.version < 1) {
77
+ throw new _errors.NotificationError(_errors.DIAGNOSTIC_CODES.CHANNEL_MIGRATION_REQUIRED, `Tone "${tone.id}" must carry an integer version of 1 or greater, because a channel configuration change is a migration rather than an assignment.`, {
78
+ toneId: tone.id,
79
+ version: tone.version
80
+ });
81
+ }
82
+ }
83
+ const groupIds = new Set((config.channelGroups ?? []).map(group => group.id));
84
+ for (const tone of config.tones) {
85
+ if (tone.groupId !== undefined && !groupIds.has(tone.groupId)) {
86
+ throw new _errors.NotificationError(_errors.DIAGNOSTIC_CODES.UNDECLARED_TONE, `Tone "${tone.id}" references undeclared channel group "${tone.groupId}".`, {
87
+ toneId: tone.id,
88
+ groupId: tone.groupId
89
+ });
90
+ }
91
+ }
92
+ }
93
+ async function initialize(config, deps) {
94
+ const now = deps.now ?? (() => Date.now());
95
+ const startedAt = now();
96
+ validateConfig(config);
97
+ const emitter = new _events.DiagnosticEmitter({
98
+ sink: config.eventSink,
99
+ verbose: config.verboseDiagnostics,
100
+ now
101
+ });
102
+ const state = new _record.StateManager({
103
+ store: deps.store,
104
+ now,
105
+ emit: event => emitter.emit(event.code, describeStateEvent(event.code), event.context)
106
+ });
107
+ const channels = (0, _migrate.createChannels)({
108
+ engine: deps.engine,
109
+ state,
110
+ now,
111
+ // The channel module emits only DIAGNOSTIC_CODES values; its port types the
112
+ // code as a string so it stays usable without the emitter.
113
+ emit: (code, message, context) => emitter.emit(code, message, context)
114
+ });
115
+ // Declares groups and tones, and runs any version migration. An unchanged
116
+ // configuration costs no platform work, so doing this on every launch is free.
117
+ const applied = await channels.apply(config.tones, config.channelGroups ?? []);
118
+ const registry = new _cycle.MaintenanceRegistry({
119
+ clock: now
120
+ });
121
+ const maintenance = new _toggle.MaintenanceController({
122
+ registry,
123
+ now,
124
+ // Occurrence identifiers, not series identifiers. Maintenance cancels
125
+ // occurrences, so a set of series ids made every legitimate cancel look
126
+ // like a scope violation.
127
+ ownedIds: async () => (0, _seriesLedger.ownedIdentifiers)(state, (await deps.engine.getPending()).map(entry => entry.id)),
128
+ enabled: config.automaticMaintenance ?? true
129
+ });
130
+ const timeZone = deps.timeZone ?? (0, _anchor.createPlatformTimeZoneReader)();
131
+ let lastZone = timeZone();
132
+ let lastAutomatic;
133
+ const onAppState = next => {
134
+ if (next !== 'active') return;
135
+ const zone = timeZone();
136
+ const trigger = zone !== lastZone ? 'timeZoneChange' : 'foreground';
137
+ lastZone = zone;
138
+ maintenance.runAutomatic(trigger).then(result => {
139
+ if (result !== undefined) lastAutomatic = result;
140
+ }, error => {
141
+ // Nothing awaits an automatic cycle, so a failure is reported here or
142
+ // not at all.
143
+ emitter.emit(_errors.DIAGNOSTIC_CODES.MAINTENANCE_FAILED, `Automatic maintenance (${trigger}) failed: ${error instanceof Error ? error.name : 'unknown error'}.`, {
144
+ trigger
145
+ });
146
+ });
147
+ };
148
+ const subscription = (deps.appState ?? sharedLifecycle).addEventListener('change', onAppState);
149
+ const runtime = {
150
+ engine: deps.engine,
151
+ state,
152
+ emitter,
153
+ registry,
154
+ maintenance,
155
+ channels,
156
+ lookahead: resolveLookahead(config.lookahead),
157
+ config,
158
+ now,
159
+ lastAutomaticMaintenance: () => lastAutomatic,
160
+ dispose: () => subscription.remove()
161
+ };
162
+ return {
163
+ runtime,
164
+ result: {
165
+ tonesApplied: config.tones.length,
166
+ migrationsRun: applied.migrated.length,
167
+ stateRebuilt: state.health().rebuilt,
168
+ automaticMaintenance: maintenance.isEnabled,
169
+ durationMs: now() - startedAt
170
+ }
171
+ };
172
+ }
173
+ function describeStateEvent(code) {
174
+ switch (code) {
175
+ case _errors.DIAGNOSTIC_CODES.STATE_CORRUPT_REBUILT:
176
+ return 'Persisted state was unreadable and has been rebuilt. Deduplication history and buffered interactions from before the loss are gone; scheduled notifications are unaffected.';
177
+ case _errors.DIAGNOSTIC_CODES.STATE_WRITE_FAILED:
178
+ return 'Persisted state could not be written. The affected guarantee degrades to this session only.';
179
+ case _errors.DIAGNOSTIC_CODES.STATE_CAP_EVICTED:
180
+ return 'A persisted collection reached its cap and the oldest entries were evicted.';
181
+ case _errors.DIAGNOSTIC_CODES.INTERACTION_BUFFER_EVICTED:
182
+ return 'Buffered interactions were evicted at the cap or retention limit.';
183
+ default:
184
+ return 'Persisted state event.';
185
+ }
186
+ }
187
+ //# sourceMappingURL=initialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_rnCore","require","_recurrence","_errors","_events","_cycle","_toggle","_record","_seriesLedger","_migrate","_anchor","sharedLifecycle","addEventListener","_type","listener","remove","appLifecycle","subscribe","state","resolveLookahead","partial","days","DEFAULT_LOOKAHEAD","occurrencesPerSeries","Math","min","max","LOOKAHEAD_BOUNDS","minDays","maxDays","minOccurrences","maxOccurrences","validateConfig","config","tones","length","NotificationError","DIAGNOSTIC_CODES","UNDECLARED_TONE","seen","Set","tone","has","id","toneId","add","Number","isInteger","version","CHANNEL_MIGRATION_REQUIRED","groupIds","channelGroups","map","group","groupId","undefined","initialize","deps","now","Date","startedAt","emitter","DiagnosticEmitter","sink","eventSink","verbose","verboseDiagnostics","StateManager","store","emit","event","code","describeStateEvent","context","channels","createChannels","engine","message","applied","apply","registry","MaintenanceRegistry","clock","maintenance","MaintenanceController","ownedIds","ownedIdentifiers","getPending","entry","enabled","automaticMaintenance","timeZone","createPlatformTimeZoneReader","lastZone","lastAutomatic","onAppState","next","zone","trigger","runAutomatic","then","result","error","MAINTENANCE_FAILED","Error","name","subscription","appState","runtime","lookahead","lastAutomaticMaintenance","dispose","tonesApplied","migrationsRun","migrated","stateRebuilt","health","rebuilt","isEnabled","durationMs","STATE_CORRUPT_REBUILT","STATE_WRITE_FAILED","STATE_CAP_EVICTED","INTERACTION_BUFFER_EVICTED"],"sourceRoot":"../../src","sources":["initialize.ts"],"mappings":";;;;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAGA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AA9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;;AAKA;AACA,MAAMU,eAA+B,GAAG;EACvCC,gBAAgB,EAAEA,CAACC,KAAK,EAAEC,QAAQ,MAAM;IACvCC,MAAM,EAAE,IAAAC,oBAAY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OAAO,CAACoC,QAAQ,CAAC/E,MAAM;MACtCgF,YAAY,EAAEjG,KAAK,CAACkG,MAAM,CAAC,CAAC,CAACC,OAAO;MACpC3B,oBAAoB,EAAEP,WAAW,CAACmC,SAAS;MAC3CC,UAAU,EAAE7D,GAAG,CAAC,CAAC,GAAGE;IACrB;EACD,CAAC;AACF;AAEA,SAASY,kBAAkBA,CAACD,IAAY,EAAU;EACjD,QAAQA,IAAI;IACX,KAAKlC,wBAAgB,CAACmF,qBAAqB;MAC1C,OAAO,6KAA6K;IACrL,KAAKnF,wBAAgB,CAACoF,kBAAkB;MACvC,OAAO,6FAA6F;IACrG,KAAKpF,wBAAgB,CAACqF,iBAAiB;MACtC,OAAO,6EAA6E;IACrF,KAAKrF,wBAAgB,CAACsF,0BAA0B;MAC/C,OAAO,mEAAmE;IAC3E;MACC,OAAO,wBAAwB;EACjC;AACD","ignoreList":[]}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createInteractions = createInteractions;
7
+ var _errors = require("../contract/errors.js");
8
+ var _interactionBuffer = require("../state/interaction-buffer.js");
9
+ /**
10
+ * Interaction routing.
11
+ *
12
+ * One handler covers foreground, background, and cold start. The hard case is
13
+ * the last one: the tap happens before any JavaScript exists to receive it, so
14
+ * the event has to wait — durably — until a handler registers.
15
+ *
16
+ * Events are delivered in occurrence order and never dropped for want of a
17
+ * listener. After delivery the notification leaves the tray, because a
18
+ * notification the user has already acted on sitting there is noise.
19
+ */
20
+
21
+ function createInteractions(deps) {
22
+ const emit = deps.emit ?? (() => {});
23
+ let handlers = [];
24
+ let engineSubscription;
25
+ /** Serializes delivery so rapid interactions arrive in order, never interleaved. */
26
+ let deliveryChain = Promise.resolve();
27
+ const deliver = event => {
28
+ deliveryChain = deliveryChain.then(async () => {
29
+ for (const handler of handlers) {
30
+ try {
31
+ await handler(event);
32
+ } catch {
33
+ // A consumer's handler failing must not stop the next event, or one
34
+ // bad tap would silently swallow every tap after it.
35
+ }
36
+ }
37
+
38
+ // Acted on, so it leaves the tray and stops making noise.
39
+ if (event.kind !== 'dismiss') {
40
+ await deps.engine.cancel(event.notificationId).catch(() => undefined);
41
+ }
42
+ });
43
+ };
44
+ const route = event => {
45
+ if (handlers.length === 0) {
46
+ (0, _interactionBuffer.buffer)(deps.state, event);
47
+ return;
48
+ }
49
+ deliver(event);
50
+ };
51
+ const ensureSubscribed = () => {
52
+ engineSubscription ??= deps.engine.subscribeToInteractions(route);
53
+ };
54
+
55
+ // Subscribing immediately rather than on first handler registration: an
56
+ // interaction arriving in the gap would otherwise be lost entirely, which is
57
+ // the exact failure the buffer exists to prevent.
58
+ ensureSubscribed();
59
+ return {
60
+ /**
61
+ * Registers a handler and immediately drains anything that was waiting.
62
+ *
63
+ * The drain is what makes a cold-start tap work: the event was persisted
64
+ * before this handler existed, possibly before this process existed.
65
+ */
66
+ onInteraction(handler) {
67
+ handlers.push(handler);
68
+ for (const event of (0, _interactionBuffer.drain)(deps.state)) {
69
+ deliver(event);
70
+ }
71
+ return () => {
72
+ handlers = handlers.filter(h => h !== handler);
73
+ };
74
+ },
75
+ /**
76
+ * Collects the interaction that launched the app, if any.
77
+ *
78
+ * Called once during startup. If no handler exists yet the event is
79
+ * buffered rather than discarded.
80
+ */
81
+ async collectInitial() {
82
+ const initial = await deps.engine.takeInitialInteraction();
83
+ if (initial === undefined) return;
84
+ route(initial);
85
+ },
86
+ /**
87
+ * Signals that a routing target no longer exists.
88
+ *
89
+ * The consumer chooses its own fallback screen. No platform error is ever
90
+ * shown to the user for this — a notification pointing at deleted data is
91
+ * an ordinary condition, not a crash.
92
+ */
93
+ reportTargetMissing(signal) {
94
+ emit(_errors.DIAGNOSTIC_CODES.TARGET_MISSING, 'The routing target no longer exists. The consumer chooses a fallback; no platform error is shown to the user.', {
95
+ notificationId: signal.notificationId
96
+ });
97
+ },
98
+ /** Reports that a background action exceeded the platform's execution window. */
99
+ reportBackgroundTimeout(notificationId, windowMs) {
100
+ emit(_errors.DIAGNOSTIC_CODES.BACKGROUND_WINDOW_EXCEEDED, `A background action exceeded the platform's ${windowMs} ms execution window and was cut short.`, {
101
+ notificationId,
102
+ windowMs
103
+ });
104
+ },
105
+ /** How many interactions are waiting for a handler. */
106
+ pendingCount() {
107
+ return (0, _interactionBuffer.bufferedCount)(deps.state);
108
+ },
109
+ /** Settles outstanding deliveries. Exists for tests and orderly shutdown. */
110
+ async flush() {
111
+ await deliveryChain;
112
+ },
113
+ dispose() {
114
+ engineSubscription?.();
115
+ engineSubscription = undefined;
116
+ handlers = [];
117
+ }
118
+ };
119
+ }
120
+ //# sourceMappingURL=index.js.map