@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 @@
1
+ {"version":3,"names":["_errors","require","_interactionBuffer","createInteractions","deps","emit","handlers","engineSubscription","deliveryChain","Promise","resolve","deliver","event","then","handler","kind","engine","cancel","notificationId","catch","undefined","route","length","buffer","state","ensureSubscribed","subscribeToInteractions","onInteraction","push","drain","filter","h","collectInitial","initial","takeInitialInteraction","reportTargetMissing","signal","DIAGNOSTIC_CODES","TARGET_MISSING","reportBackgroundTimeout","windowMs","BACKGROUND_WINDOW_EXCEEDED","pendingCount","bufferedCount","flush","dispose"],"sourceRoot":"../../../src","sources":["interaction/index.ts"],"mappings":";;;;;;AAoBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBO,SAASE,kBAAkBA,CAACC,IAA6B,EAAE;EACjE,MAAMC,IAAI,GAAGD,IAAI,CAACC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;EACpC,IAAIC,QAA8B,GAAG,EAAE;EACvC,IAAIC,kBAA2C;EAC/C;EACA,IAAIC,aAA4B,GAAGC,OAAO,CAACC,OAAO,CAAC,CAAC;EAEpD,MAAMC,OAAO,GAAIC,KAAuB,IAAW;IAClDJ,aAAa,GAAGA,aAAa,CAACK,IAAI,CAAC,YAAY;MAC9C,KAAK,MAAMC,OAAO,IAAIR,QAAQ,EAAE;QAC/B,IAAI;UACH,MAA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AAC;IACf,CAAC;IAED;AACF;AACA;AACA;AACA;AACA;AACA;IACEE,mBAAmBA,CAACC,MAA2B,EAAQ;MACtD/B,IAAI,CACHgC,wBAAgB,CAACC,cAAc,EAC/B,+GAA+G,EAC/G;QAAEpB,cAAc,EAAEkB,MAAM,CAAClB;MAAe,CACzC,CAAC;IACF,CAAC;IAED;IACAqB,uBAAuBA,CAACrB,cAAsB,EAAEsB,QAAgB,EAAQ;MACvEnC,IAAI,CACHgC,wBAAgB,CAACI,0BAA0B,EAC3C,+CAA+CD,QAAQ,yCAAyC,EAChG;QAAEtB,cAAc;QAAEsB;MAAS,CAC5B,CAAC;IACF,CAAC;IAED;IACAE,YAAYA,CAAA,EAAW;MACtB,OAAO,IAAAC,gCAAa,EAACvC,IAAI,CAACoB,KAAK,CAAC;IACjC,CAAC;IAED;IACA,MAAMoB,KAAKA,CAAA,EAAkB;MAC5B,MAAMpC,aAAa;IACpB,CAAC;IAEDqC,OAAOA,CAAA,EAAS;MACftC,kBAAkB,GAAG,CAAC;MACtBA,kBAAkB,GAAGa,SAAS;MAC9Bd,QAAQ,GAAG,EAAE;IACd;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MaintenanceScopeViolation = exports.MaintenanceRegistry = void 0;
7
+ /**
8
+ * The automatic maintenance cycle.
9
+ *
10
+ * Covers exactly what only the package can know — window refresh, recurrence
11
+ * expansion, wall-clock re-anchoring, pending-set verification, permission
12
+ * re-reads. Full desired-set reconciliation is never automatic, because only
13
+ * the consumer knows what its data implies and a package that guessed would
14
+ * cancel notifications it does not understand.
15
+ *
16
+ * Steps register themselves here rather than being wired in a fixed order. That
17
+ * is what lets scheduling, reconciliation, recurrence, and permissions each
18
+ * contribute a step without importing one another.
19
+ *
20
+ * The rule that makes automatic work safe: a step may act only on notifications
21
+ * the package owns, and may never cancel anything else. It is enforced here
22
+ * rather than trusted to each step.
23
+ */
24
+
25
+ class MaintenanceScopeViolation extends Error {
26
+ constructor(step, offendingIds) {
27
+ super(`Maintenance step "${step}" attempted to cancel ${offendingIds.length} notification(s) it does not own. ` + 'Automatic maintenance may never cancel a directly-scheduled notification.');
28
+ this.name = 'MaintenanceScopeViolation';
29
+ this.step = step;
30
+ this.offendingIds = offendingIds;
31
+ Object.setPrototypeOf(this, MaintenanceScopeViolation.prototype);
32
+ }
33
+ }
34
+ exports.MaintenanceScopeViolation = MaintenanceScopeViolation;
35
+ class MaintenanceRegistry {
36
+ steps = [];
37
+ inFlight = null;
38
+ constructor(options = {}) {
39
+ this.clock = options.clock ?? (() => Date.now());
40
+ }
41
+ register(step) {
42
+ this.steps.push(step);
43
+ this.steps.sort((a, b) => a.order - b.order);
44
+ return () => {
45
+ this.steps = this.steps.filter(s => s !== step);
46
+ };
47
+ }
48
+ get registered() {
49
+ return this.steps.map(s => s.name);
50
+ }
51
+
52
+ /**
53
+ * Runs every registered step in order.
54
+ *
55
+ * Overlapping cycles are joined rather than queued or dropped: a second
56
+ * caller arriving mid-cycle wants the work the running cycle is already
57
+ * doing, so it waits for that cycle and gets its result. It used to get an
58
+ * empty result at once. Since `initialize` started running a cycle on every
59
+ * foreground, an app that ran maintenance and then reconciled on the same
60
+ * event got that empty result and reconciled while the window refresh was
61
+ * still writing: a reminder the reconcile cancelled could be scheduled again.
62
+ */
63
+ run(context) {
64
+ if (this.inFlight) {
65
+ return this.inFlight;
66
+ }
67
+ const cycle = this.runSteps(context).finally(() => {
68
+ if (this.inFlight === cycle) this.inFlight = null;
69
+ });
70
+ this.inFlight = cycle;
71
+ return cycle;
72
+ }
73
+ async runSteps(context) {
74
+ const started = context.now;
75
+ const clockStart = this.clock();
76
+ const aggregate = {
77
+ windowRefreshed: false,
78
+ occurrencesScheduled: 0,
79
+ reAnchored: 0,
80
+ timeZoneChanged: false,
81
+ permissionChanged: false,
82
+ operationCount: 0
83
+ };
84
+ let discrepancy;
85
+ for (const step of this.steps) {
86
+ const outcome = await step.run(context);
87
+ const offending = (outcome.cancelledIds ?? []).filter(id => !context.ownedIds.has(id));
88
+ if (offending.length > 0) {
89
+ throw new MaintenanceScopeViolation(step.name, offending);
90
+ }
91
+ aggregate.windowRefreshed ||= outcome.windowRefreshed ?? false;
92
+ aggregate.occurrencesScheduled += outcome.occurrencesScheduled ?? 0;
93
+ aggregate.reAnchored += outcome.reAnchored ?? 0;
94
+ aggregate.timeZoneChanged ||= outcome.timeZoneChanged ?? false;
95
+ aggregate.permissionChanged ||= outcome.permissionChanged ?? false;
96
+ aggregate.operationCount += outcome.operationCount ?? 0;
97
+ discrepancy ??= outcome.discrepancy;
98
+ }
99
+ return {
100
+ ranAt: started,
101
+ ...aggregate,
102
+ discrepancy,
103
+ durationMs: this.clock() - clockStart
104
+ };
105
+ }
106
+ }
107
+ exports.MaintenanceRegistry = MaintenanceRegistry;
108
+ //# sourceMappingURL=cycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MaintenanceScopeViolation","Error","constructor","step","offendingIds","length","name","Object","setPrototypeOf","prototype","exports","MaintenanceRegistry","steps","inFlight","options","clock","Date","now","register","push","sort","a","b","order","filter","s","registered","map","run","context","cycle","runSteps","finally","started","clockStart","aggregate","windowRefreshed","occurrencesScheduled","reAnchored","timeZoneChanged","permissionChanged","operationCount","discrepancy","outcome","offending","cancelledIds","id","ownedIds","has","ranAt","durationMs"],"sourceRoot":"../../../src","sources":["maintenance/cycle.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCO,MAAMA,yBAAyB,SAASC,KAAK,CAAC;EAIpDC,WAAWA,CAACC,IAAY,EAAEC,YAA+B,EAAE;IAC1D,KAAK,CACJ,qBAAqBD,IAAI,yBAAyBC,YAAY,CAACC,MAAM,oCAAoC,GACxG,2EACF,CAAC;IACD,IAAI,CAACC,IAAI,GAAG,2BAA2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ACM,cAAc,IAAIE,OAAO,CAACF,cAAc,IAAI,CAAC;MACvDC,WAAW,KAAKC,OAAO,CAACD,WAAW;IACpC;IAEA,OAAO;MAAEO,KAAK,EAAEhB,OAAO;MAAE,GAAGE,SAAS;MAAEO,WAAW;MAAEQ,UAAU,EAAE,IAAI,CAACnC,KAAK,CAAC,CAAC,GAAGmB;IAAW,CAAC;EAC5F;AACD;AAACxB,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PERMISSION_REFRESH_ORDER = void 0;
7
+ exports.createPermissionRefreshStep = createPermissionRefreshStep;
8
+ /**
9
+ * The permission re-read maintenance step.
10
+ *
11
+ * The user can change permission in system settings while the app is
12
+ * backgrounded, and the platform does not tell anyone. Re-reading on foreground
13
+ * is the only way a consumer's interface avoids showing a stale answer.
14
+ *
15
+ * Runs last (order 30): permission state does not affect what the earlier steps
16
+ * expand or re-anchor, and reading it after they have run means the report
17
+ * reflects the device as the cycle leaves it.
18
+ */
19
+
20
+ const PERMISSION_REFRESH_ORDER = exports.PERMISSION_REFRESH_ORDER = 30;
21
+ function createPermissionRefreshStep(deps) {
22
+ return {
23
+ name: 'permission-refresh',
24
+ order: PERMISSION_REFRESH_ORDER,
25
+ async run(_context) {
26
+ const {
27
+ changed
28
+ } = await deps.permissions.refresh();
29
+ return {
30
+ // Reading permission is not a platform mutation, so it never counts
31
+ // toward the zero-operation guarantee.
32
+ operationCount: 0,
33
+ permissionChanged: changed,
34
+ cancelledIds: []
35
+ };
36
+ }
37
+ };
38
+ }
39
+ //# sourceMappingURL=permission-refresh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PERMISSION_REFRESH_ORDER","exports","createPermissionRefreshStep","deps","name","order","run","_context","changed","permissions","refresh","operationCount","permissionChanged","cancelledIds"],"sourceRoot":"../../../src","sources":["maintenance/permission-refresh.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,MAAMA,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,EAAE;AAMnC,SAASE,2BAA2BA,CAACC,IAAmC,EAAmB;EACjG,OAAO;IACNC,IAAI,EAAE,oBAAoB;IAC1BC,KAAK,EAAEL,wBAAwB;IAE/B,MAAMM,GAAGA,CAACC,QAA4B,EAAwB;MAC7D,MAAM;QAAEC;MAAQ,CAAC,GAAG,MAAML,IAAI,CAACM,WAAW,CAACC,OAAO,CAAC,CAAC;MAEpD,OAAO;QACN;QACA;QACAC,cAAc,EAAE,CAAC;QACjBC,iBAAiB,EAAEJ,OAAO;QAC1BK,YAAY,EAAE;MACf,CAAC;IACF;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RE_ANCHOR_ORDER = void 0;
7
+ exports.createReAnchorStep = createReAnchorStep;
8
+ var _anchor = require("../schedule/anchor.js");
9
+ var _writer = require("../schedule/writer.js");
10
+ /**
11
+ * The re-anchoring maintenance step.
12
+ *
13
+ * Registers itself with the maintenance registry rather than being wired into
14
+ * a fixed sequence, which is what keeps scheduling independent of
15
+ * reconciliation, recurrence, and permissions despite all four contributing a
16
+ * step.
17
+ *
18
+ * Runs early (order 10) because verification compares firing instants: if
19
+ * verification ran first it would compare against instants re-anchoring is
20
+ * about to rewrite, and report discrepancies that do not exist.
21
+ */
22
+
23
+ const RE_ANCHOR_ORDER = exports.RE_ANCHOR_ORDER = 10;
24
+ function createReAnchorStep(deps) {
25
+ // Through the shared writer so a repeating alert's stop marker moves with it;
26
+ // written directly, the marker kept the old instant and cut the alert short
27
+ // or let it run past its bound.
28
+ const writer = (0, _writer.createScheduleWriter)(deps.engine);
29
+ return {
30
+ name: 'reanchor',
31
+ order: RE_ANCHOR_ORDER,
32
+ async run(_context) {
33
+ const zone = deps.timeZone();
34
+ const pending = await deps.engine.getPending();
35
+ const plan = (0, _anchor.planReAnchor)(pending, zone);
36
+
37
+ // The no-change path costs one comparison per entry and issues zero
38
+ // platform operations. That is what makes re-anchoring idempotent.
39
+ if (plan.rewrites.length === 0) {
40
+ return {
41
+ operationCount: 0,
42
+ reAnchored: 0,
43
+ timeZoneChanged: false
44
+ };
45
+ }
46
+ deps.emit?.('REANCHOR', `Device time zone changed from ${plan.fromZone ?? 'unknown'} to ${plan.toZone}; re-anchoring ${plan.rewrites.length} wall-clock notification(s).`, {
47
+ from: plan.fromZone,
48
+ to: plan.toZone,
49
+ count: plan.rewrites.length
50
+ });
51
+ let operationCount = 0;
52
+ for (const {
53
+ entry,
54
+ resolvedAt
55
+ } of plan.rewrites) {
56
+ const tone = deps.resolveTone(entry.tone);
57
+ if (tone === undefined) {
58
+ // A tone that no longer exists means this entry belongs to a
59
+ // configuration the app has since dropped. Leaving it alone is
60
+ // correct: re-anchoring must never repair, only preserve.
61
+ continue;
62
+ }
63
+ await writer.write({
64
+ request: {
65
+ id: entry.id,
66
+ content: entry.content,
67
+ tone: entry.tone,
68
+ moment: {
69
+ at: resolvedAt,
70
+ anchoring: 'wallClock'
71
+ },
72
+ routing: entry.routing,
73
+ actions: entry.actions,
74
+ ownerTag: entry.ownerTag,
75
+ groupTag: entry.groupTag
76
+ },
77
+ resolvedAt,
78
+ tone,
79
+ // Re-anchored against the zone the device is in now — this is the
80
+ // value that stops the entry being reported as stale next time.
81
+ anchoringGeneration: zone,
82
+ approximate: !deps.canScheduleExactly(),
83
+ seriesId: entry.seriesId,
84
+ pushCreated: entry.pushCreated
85
+ });
86
+ operationCount += 1;
87
+ }
88
+ return {
89
+ operationCount,
90
+ reAnchored: operationCount,
91
+ timeZoneChanged: true,
92
+ // Re-anchoring replaces in place and cancels nothing, so it can never
93
+ // touch a notification outside what it was handed.
94
+ cancelledIds: []
95
+ };
96
+ }
97
+ };
98
+ }
99
+ //# sourceMappingURL=reanchor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_anchor","require","_writer","RE_ANCHOR_ORDER","exports","createReAnchorStep","deps","writer","createScheduleWriter","engine","name","order","run","_context","zone","timeZone","pending","getPending","plan","planReAnchor","rewrites","length","operationCount","reAnchored","timeZoneChanged","emit","fromZone","toZone","from","to","count","entry","resolvedAt","tone","resolveTone","undefined","write","request","id","content","moment","at","anchoring","routing","actions","ownerTag","groupTag","anchoringGeneration","approximate","canScheduleExactly","seriesId","pushCreated","cancelledIds"],"sourceRoot":"../../../src","sources":["maintenance/reanchor.ts"],"mappings":";;;;;;;AAgBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,EAAE;AAE1B,SAASE,kBAAkBA,CAACC,IAA8B,EAAmB;EACnF;EACA;EACA;EACA,MAAMC,MAAM,GAAG,IAAAC,4BAAoB,EAACF,IAAI,CAACG,MAAM,CAAC;EAEhD,OAAO;IACNC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAER,eAAe;IAEtB,MAAMS,GAAGA,CAACC,QAA4B,EAAwB;MAC7D,MAAMC,IAAI,GAAGR,IAAI,CAACS,QAAQ,CAAC,CAAC;MAC5B,MAAMC,OAAO,GAAG,MAAMV,IAAI,CAACG,MAAM,CAACQ,UAAU,CAAC,CAAC;MAC9C,MAAMC,IAAI,GAAG,IAAAC,oBAAY,EAACH,OAAO,EAAEF,IAAI,CAAC;;MAExC;MACA;MACA,IAAII,IAAI,CAACE,QAAQ,CAACC,MAAM,KAAK,CAAC,EAAE;QAC/B,OAAO;UAAEC,cAAc,EAAE,CAAC;UAAEC,UAAU,EAAE,CAAC;UAAEC,eAAe,EAAE;QAAM,CAAC;MACpE;MAEAlB,IAAI,CAACmB,IAAI,GACR,UAAU,EACV,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,cAAc;QAC1BE,eAAe,EAAE,IAAI;QACrB;QACA;QACA4B,YAAY,EAAE;MACf,CAAC;IACF;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MaintenanceController = void 0;
7
+ /**
8
+ * The automatic-maintenance switch.
9
+ *
10
+ * A package that acts on its own must offer a way to stop it — and a consumer
11
+ * that takes control must not lose a feature as the price. Disabling automatic
12
+ * maintenance leaves every operation explicitly invocable through
13
+ * `runMaintenance()`, producing identical device state.
14
+ */
15
+
16
+ class MaintenanceController {
17
+ constructor(options) {
18
+ this.registry = options.registry;
19
+ this.now = options.now;
20
+ this.ownedIds = options.ownedIds;
21
+ this.enabled = options.enabled ?? true;
22
+ }
23
+ get isEnabled() {
24
+ return this.enabled;
25
+ }
26
+ setEnabled(enabled) {
27
+ this.enabled = enabled;
28
+ }
29
+
30
+ /** Called by lifecycle observers. A no-op when automatic maintenance is off. */
31
+ async runAutomatic(trigger) {
32
+ if (!this.enabled) return undefined;
33
+ return this.execute(trigger);
34
+ }
35
+
36
+ /** Always runs, regardless of the switch. This is what preserves capability parity. */
37
+ async runExplicit() {
38
+ return this.execute('explicit');
39
+ }
40
+ async execute(trigger) {
41
+ const context = {
42
+ trigger,
43
+ now: this.now(),
44
+ ownedIds: await this.ownedIds()
45
+ };
46
+ return this.registry.run(context);
47
+ }
48
+ }
49
+ exports.MaintenanceController = MaintenanceController;
50
+ //# sourceMappingURL=toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MaintenanceController","constructor","options","registry","now","ownedIds","enabled","isEnabled","setEnabled","runAutomatic","trigger","undefined","execute","runExplicit","context","run","exports"],"sourceRoot":"../../../src","sources":["maintenance/toggle.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBO,MAAMA,qBAAqB,CAAC;EAMlCC,WAAWA,CAACC,OAAqC,EAAE;IAClD,IAAI,CAACC,QAAQ,GAAGD,OAAO,CAACC,QAAQ;IAChC,IAAI,CAACC,GAAG,GAAGF,OAAO,CAACE,GAAG;IACtB,IAAI,CAACC,QAAQ,GAAGH,OAAO,CAACG,QAAQ;IAChC,IAAI,CAACC,OAAO,GAAGJ,OAAO,CAACI,OAAO,IAAI,IAAI;EACvC;EAEA,IAAIC,SAASA,CAAA,EAAY;IACxB,OAAO,IAAI,CAACD,OAAO;EACpB;EAEAE,UAAUA,CAACF,OAAgB,EAAQ;IAClC,IAAI,CAACA,OAAO,GAAGA,OAAO;EACvB;;EAEA;EACA,MAAMG,YAAYA,CACjBC,OAAgD,EACP;IACzC,IAAI,CAAC,IAAI,CAACJ,OAAO,EAAE,OAAOK,SAAS;IACnC,OAAO,IAAI,CAACC,OAAO,CAACF,OAAO,CAAC;EAC7B;;EAEA;EACA,MAAMG,WAAWA,CAAA,EAA+B;IAC/C,OAAO,IAAI,CAACD,OAAO,CAAC,UAAU,CAAC;EAChC;EAEA,MAAcA,OAAOA,CAACF,OAA2B,EAA8B;IAC9E,MAAMI,OAA2B,GAAG;MACnCJ,OAAO;MACPN,GAAG,EAAE,IAAI,CAACA,GAAG,CAAC,CAAC;MACfC,QAAQ,EAAE,MAAM,IAAI,CAACA,QAAQ,CAAC;IAC/B,CAAC;IACD,OAAO,IAAI,CAACF,QAAQ,CAACY,GAAG,CAACD,OAAO,CAAC;EAClC;AACD;AAACE,OAAA,CAAAhB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VERIFY_ORDER = void 0;
7
+ exports.createVerifyStep = createVerifyStep;
8
+ var _errors = require("../contract/errors.js");
9
+ /**
10
+ * Pending-set verification.
11
+ *
12
+ * Engine boot restoration coverage varies by manufacturer, so after a restart
13
+ * the device may hold fewer notifications than the package expects. This step
14
+ * notices that.
15
+ *
16
+ * It **detects and reports only**. It never re-registers, cancels, or repairs
17
+ * anything — the package deliberately does not persist a desired set, so it
18
+ * cannot tell a restoration gap from an intentional consumer change. Guessing
19
+ * would mean either resurrecting notifications the user cancelled or deleting
20
+ * ones they still want. Repair is consumer-invoked reconciliation.
21
+ *
22
+ * Runs at order 20, after re-anchoring (order 10): re-anchoring rewrites firing
23
+ * instants, and verifying first would compare against instants that are about
24
+ * to change.
25
+ */
26
+
27
+ const VERIFY_ORDER = exports.VERIFY_ORDER = 20;
28
+ function createVerifyStep(deps) {
29
+ return {
30
+ name: 'verify',
31
+ order: VERIFY_ORDER,
32
+ async run(context) {
33
+ const expected = deps.expectedIds();
34
+
35
+ // No recorded expectation is not the same as expecting an empty device.
36
+ // Reporting every pending entry as "unrecognized" on a fresh install
37
+ // would be noise, not a finding.
38
+ if (expected === undefined) {
39
+ return {
40
+ operationCount: 0
41
+ };
42
+ }
43
+ const pending = await deps.engine.getPending();
44
+ const actual = new Set(pending.map(entry => entry.id));
45
+ const missing = [...expected].filter(id => !actual.has(id)).sort();
46
+ const unrecognized = [...actual].filter(id => !expected.has(id)).sort();
47
+ if (missing.length === 0 && unrecognized.length === 0) {
48
+ return {
49
+ operationCount: 0
50
+ };
51
+ }
52
+ const discrepancy = {
53
+ missing,
54
+ unrecognized,
55
+ detectedAt: context.now
56
+ };
57
+ deps.emit?.(_errors.DIAGNOSTIC_CODES.PENDING_SET_DISCREPANCY, `Pending set differs from expectation: ${missing.length} expected but absent, ${unrecognized.length} present but unrecognized. ` + 'Reported only — run reconciliation to repair, since the package cannot distinguish a restoration gap from an intentional change.', {
58
+ missing: missing.length,
59
+ unrecognized: unrecognized.length
60
+ });
61
+ return {
62
+ operationCount: 0,
63
+ discrepancy,
64
+ // Verification repairs nothing, so it cancels nothing.
65
+ cancelledIds: []
66
+ };
67
+ }
68
+ };
69
+ }
70
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","VERIFY_ORDER","exports","createVerifyStep","deps","name","order","run","context","expected","expectedIds","undefined","operationCount","pending","engine","getPending","actual","Set","map","entry","id","missing","filter","has","sort","unrecognized","length","discrepancy","detectedAt","now","emit","DIAGNOSTIC_CODES","PENDING_SET_DISCREPANCY","cancelledIds"],"sourceRoot":"../../../src","sources":["maintenance/verify.ts"],"mappings":";;;;;;;AAqBA,IAAAA,OAAA,GAAAC,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,EAAE;AAavB,SAASE,gBAAgBA,CAACC,IAA4B,EAAmB;EAC/E,OAAO;IACNC,IAAI,EAAE,QAAQ;IACdC,KAAK,EAAEL,YAAY;IAEnB,MAAMM,GAAGA,CAACC,OAA2B,EAAwB;MAC5D,MAAMC,QAAQ,GAAGL,IAAI,CAACM,WAAW,CAAC,CAAC;;MAEnC;MACA;MACA;MACA,IAAID,QAAQ,KAAKE,SAAS,EAAE;QAC3B,OAAO;UAAEC,cAAc,EAAE;QAAE,CAAC;MAC7B;MAEA,MAAMC,OAAO,GAAG,MAAMT,IAAI,CAACU,MAAM,CAACC,UAAU,CAAC,CAAC;MAC9C,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAACJ,OAAO,CAACK,GAAG,CAACC,KAAK,IAAIA,KAAK,CAACC,EAAE,CAAC,CAAC;MAEtD,MAAMC,OAAO,GAAG,CAAC,GAAGZ,QAAQ,CAAC,CAACa,MAAM,CAACF,EAAE,IAAI,CAACJ,MAAM,CAACO,GAAG,CAACH,EAAE,CAAC,CAAC,CAACI,IAAI,CAAC,CAAC;MAClE,MAAMC,YAAY,GAAG,CAAC,GAAGT,MAAM,CAAC,CAACM,MAAM,CAACF,EAAE,IAAI,CAACX,QAAQ,CAACc,GAAG,CAACH,EAAE,CAAC,CAAC,CAACI,IAAI,CAAC,CAAC;MAEvE,IAAIH,OAAO,CAACK,MAAM,KAAK,CAAC,IAAID,YAAY,CAACC,MAAM,KAAK,CAAC,EAAE;QACtD,OAAO;UAAEd,cAAc,EAAE;QAAE,CAAC;MAC7B;MAEA,MAAMe,WAA+B,GAAG;QACvCN,OAAO;QACPI,YAAY;QACZG,UAAU,EAAEpB,OAAO,CAACqB;MACrB,CAAC;MAEDzB,IAAI,CAAC0B,IAAI,GACRC,wBAAgB,CAACC,uBAAuB,EACxC,yCAAyCX,OAAO,CAACK,MAAM,yBAAyBD,YAAY,CAACC,MAAM,6BAA6B,GAC/H,kIAAkI,EACnI;QAAEL,OAAO,EAAEA,OAAO,CAACK,MAAM;QAAED,YAAY,EAAEA,YAAY,CAACC;MAAO,CAC9D,CAAC;MAED,OAAO;QACNd,cAAc,EAAE,CAAC;QACjBe,WAAW;QACX;QACAM,YAAY,EAAE;MACf,CAAC;IACF;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WINDOW_REFRESH_ORDER = void 0;
7
+ exports.createWindowRefreshStep = createWindowRefreshStep;
8
+ /**
9
+ * The window-refresh maintenance step.
10
+ *
11
+ * Runs at order 15 — after re-anchoring (10) so it expands against corrected
12
+ * instants, before verification (20) so verification sees the refreshed set
13
+ * rather than reporting occurrences the refresh was about to add.
14
+ *
15
+ * This step is the reason automatic maintenance exists at all: only the package
16
+ * knows when a series' horizon has moved, and it can act on that without ever
17
+ * needing a desired set from the consumer.
18
+ */
19
+
20
+ const WINDOW_REFRESH_ORDER = exports.WINDOW_REFRESH_ORDER = 15;
21
+ function createWindowRefreshStep(deps) {
22
+ return {
23
+ name: 'window-refresh',
24
+ order: WINDOW_REFRESH_ORDER,
25
+ async run(_context) {
26
+ const rules = deps.registeredRules();
27
+ if (rules.length === 0) {
28
+ return {
29
+ operationCount: 0,
30
+ windowRefreshed: false
31
+ };
32
+ }
33
+ let scheduled = 0;
34
+ const cancelled = [];
35
+ for (const rule of rules) {
36
+ const result = await deps.recurrence.refreshSeries(rule);
37
+ scheduled += result.scheduled;
38
+ cancelled.push(...(result.cancelled ?? []));
39
+ }
40
+ return {
41
+ operationCount: scheduled + cancelled.length,
42
+ occurrencesScheduled: scheduled,
43
+ // A refresh that found nothing to add still ran; reporting it as
44
+ // refreshed distinguishes "nothing due" from "step never executed".
45
+ windowRefreshed: true,
46
+ // Only stale occurrences of series the package owns; reported so the
47
+ // registry's scope guard checks them rather than taking it on trust.
48
+ cancelledIds: cancelled
49
+ };
50
+ }
51
+ };
52
+ }
53
+ //# sourceMappingURL=window-refresh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WINDOW_REFRESH_ORDER","exports","createWindowRefreshStep","deps","name","order","run","_context","rules","registeredRules","length","operationCount","windowRefreshed","scheduled","cancelled","rule","result","recurrence","refreshSeries","push","occurrencesScheduled","cancelledIds"],"sourceRoot":"../../../src","sources":["maintenance/window-refresh.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,EAAE;AAe/B,SAASE,uBAAuBA,CAACC,IAA+B,EAAmB;EACzF,OAAO;IACNC,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAEL,oBAAoB;IAE3B,MAAMM,GAAGA,CAACC,QAA4B,EAAwB;MAC7D,MAAMC,KAAK,GAAGL,IAAI,CAACM,eAAe,CAAC,CAAC;MACpC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;QACvB,OAAO;UAAEC,cAAc,EAAE,CAAC;UAAEC,eAAe,EAAE;QAAM,CAAC;MACrD;MAEA,IAAIC,SAAS,GAAG,CAAC;MACjB,MAAMC,SAAmB,GAAG,EAAE;MAE9B,KAAK,MAAMC,IAAI,IAAIP,KAAK,EAAE;QACzB,MAAMQ,MAAM,GAAG,MAAMb,IAAI,CAACc,UAAU,CAACC,aAAa,CAACH,IAAI,CAAC;QACxDF,SAAS,IAAIG,MAAM,CAACH,SAAS;QAC7BC,SAAS,CAACK,IAAI,CAAC,IAAIH,MAAM,CAACF,SAAS,IAAI,EAAE,CAAC,CAAC;MAC5C;MAEA,OAAO;QACNH,cAAc,EAAEE,SAAS,GAAGC,SAAS,CAACJ,MAAM;QAC5CU,oBAAoB,EAAEP,SAAS;QAC/B;QACA;QACAD,eAAe,EAAE,IAAI;QACrB;QACA;QACAS,YAAY,EAAEP;MACf,CAAC;IACF;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createNotifications = createNotifications;
7
+ var _toneMap = require("./channel/tone-map.js");
8
+ var _snapshot = require("./diagnostics/snapshot.js");
9
+ var _notifyKitEngine = require("./engine/notify-kit-engine.js");
10
+ var _index = require("./engine/notify-kit/platform/index.js");
11
+ var _initialize = require("./initialize.js");
12
+ var _index2 = require("./interaction/index.js");
13
+ var _permissionRefresh = require("./maintenance/permission-refresh.js");
14
+ var _reanchor = require("./maintenance/reanchor.js");
15
+ var _windowRefresh = require("./maintenance/window-refresh.js");
16
+ var _index3 = require("./permission/index.js");
17
+ var _index4 = require("./reconcile/index.js");
18
+ var _index5 = require("./recurrence/index.js");
19
+ var _index6 = require("./schedule/index.js");
20
+ var _anchor = require("./schedule/anchor.js");
21
+ var _mmkvStore = require("./state/mmkv-store.js");
22
+ /**
23
+ * One call that assembles the whole package (NOT-07).
24
+ *
25
+ * Until 0.5.0 an app wired a dozen factories itself — scheduler, reconciler,
26
+ * recurrence, permissions, channels, interactions, snapshot, maintenance steps
27
+ * — repeating the engine, tone resolver, clock and time-zone reader for each,
28
+ * and usually hard-coding `canScheduleExactly: () => true`. `createNotifications`
29
+ * does that wiring once, the way the package means it:
30
+ *
31
+ * - every part reports through the one redacting diagnostic emitter;
32
+ * - `canScheduleExactly` follows the exact-alarm permission the package last
33
+ * read, instead of a guess;
34
+ * - automatic maintenance has the standard steps registered (re-anchoring after
35
+ * a time-zone change, refreshing permissions, and refreshing recurrence
36
+ * windows when the app supplies its rules), so it does something on every
37
+ * return to the foreground.
38
+ *
39
+ * The individual factories stay exported for an app that needs a different
40
+ * wiring; they are also available from `@chipmobilesdk/rn-notification/advanced`.
41
+ */
42
+
43
+ /** Exact scheduling only on a positive answer; unknown degrades to approximate, never fails. */
44
+ function allowsExact(state) {
45
+ return state === 'granted' || state === 'notRequired';
46
+ }
47
+ async function createNotifications(config, deps = {}) {
48
+ const engine = deps.engine ?? (0, _notifyKitEngine.createNotifyKitEngine)();
49
+ const now = deps.now ?? (() => Date.now());
50
+ const timeZone = deps.timeZone ?? (0, _anchor.createPlatformTimeZoneReader)();
51
+ const {
52
+ runtime,
53
+ result
54
+ } = await (0, _initialize.initialize)(config, {
55
+ engine,
56
+ store: deps.store ?? (0, _mmkvStore.createMmkvStore)(),
57
+ now,
58
+ timeZone
59
+ });
60
+ const {
61
+ state
62
+ } = runtime;
63
+ const emit = (code, message, context) => runtime.emitter.emit(code, message, context);
64
+ const resolveTone = (0, _toneMap.createToneResolver)(config.tones);
65
+ const permissions = (0, _index3.createPermissions)({
66
+ engine,
67
+ state,
68
+ platform: deps.platform ?? (0, _index.detectPlatform)(),
69
+ now,
70
+ emit
71
+ });
72
+ let exactAlarm;
73
+ const stopWatchingPermissions = permissions.onPermissionChange(report => {
74
+ exactAlarm = report.exactAlarm;
75
+ });
76
+ // Seeds the answer before anything is scheduled. A failed read leaves it
77
+ // unknown, which schedules in approximate mode rather than failing.
78
+ await permissions.getPermissions().catch(() => undefined);
79
+ const canScheduleExactly = () => allowsExact(exactAlarm);
80
+ const scheduling = {
81
+ engine,
82
+ resolveTone,
83
+ timeZone,
84
+ now,
85
+ canScheduleExactly,
86
+ emit
87
+ };
88
+ const scheduler = (0, _index6.createScheduler)(scheduling);
89
+ const reconcilerCore = (0, _index4.createReconciler)(scheduling);
90
+ let lastReconcile;
91
+ const reconciler = {
92
+ ...reconcilerCore,
93
+ async reconcile(input) {
94
+ lastReconcile = await reconcilerCore.reconcile(input);
95
+ return lastReconcile;
96
+ }
97
+ };
98
+ const recurrence = (0, _index5.createRecurrence)({
99
+ ...scheduling,
100
+ state,
101
+ lookahead: runtime.lookahead
102
+ });
103
+ const interactions = (0, _index2.createInteractions)({
104
+ engine,
105
+ state,
106
+ now,
107
+ emit
108
+ });
109
+ let lastExplicit;
110
+ const snapshot = (0, _snapshot.createSnapshot)({
111
+ engine,
112
+ state,
113
+ now,
114
+ permissions: () => permissions.getPermissions(),
115
+ restrictions: () => permissions.getBackgroundRestrictions(),
116
+ appliedTones: () => runtime.channels.appliedVersions(),
117
+ lastReconcile: () => lastReconcile,
118
+ lastMaintenance: () => runtime.lastAutomaticMaintenance() ?? lastExplicit,
119
+ hasPushToken: deps.hasPushToken ?? (() => false)
120
+ });
121
+ const unregister = [runtime.registry.register((0, _reanchor.createReAnchorStep)({
122
+ engine,
123
+ timeZone,
124
+ resolveTone,
125
+ canScheduleExactly,
126
+ emit
127
+ })), runtime.registry.register((0, _permissionRefresh.createPermissionRefreshStep)({
128
+ permissions
129
+ })), ...(deps.recurrenceRules ? [runtime.registry.register((0, _windowRefresh.createWindowRefreshStep)({
130
+ recurrence,
131
+ registeredRules: deps.recurrenceRules,
132
+ emit
133
+ }))] : [])];
134
+ return {
135
+ scheduler,
136
+ reconciler,
137
+ recurrence,
138
+ permissions,
139
+ channels: runtime.channels,
140
+ interactions,
141
+ snapshot,
142
+ runtime,
143
+ initialization: result,
144
+ timeZone,
145
+ onInteraction: handler => interactions.onInteraction(handler),
146
+ async runMaintenance() {
147
+ lastExplicit = await runtime.maintenance.runExplicit();
148
+ return lastExplicit;
149
+ },
150
+ canScheduleExactly,
151
+ dispose() {
152
+ stopWatchingPermissions();
153
+ for (const remove of unregister) {
154
+ remove();
155
+ }
156
+ interactions.dispose();
157
+ runtime.dispose();
158
+ }
159
+ };
160
+ }
161
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_toneMap","require","_snapshot","_notifyKitEngine","_index","_initialize","_index2","_permissionRefresh","_reanchor","_windowRefresh","_index3","_index4","_index5","_index6","_anchor","_mmkvStore","allowsExact","state","createNotifications","config","deps","engine","createNotifyKitEngine","now","Date","timeZone","createPlatformTimeZoneReader","runtime","result","initialize","store","createMmkvStore","emit","code","message","context","emitter","resolveTone","createToneResolver","tones","permissions","createPermissions","platform","detectPlatform","exactAlarm","stopWatchingPermissions","onPermissionChange","report","getPermissions","catch","undefined","canScheduleExactly","scheduling","scheduler","createScheduler","reconcilerCore","createReconciler","lastReconcile","reconciler","reconcile","input","recurrence","createRecurrence","lookahead","interactions","createInteractions","lastExplicit","snapshot","createSnapshot","restrictions","getBackgroundRestrictions","appliedTones","channels","appliedVersions","lastMaintenance","lastAutomaticMaintenance","hasPushToken","unregister","registry","register","createReAnchorStep","createPermissionRefreshStep","recurrenceRules","createWindowRefreshStep","registeredRules","initialization","onInteraction","handler","runMaintenance","maintenance","runExplicit","dispose","remove"],"sourceRoot":"../../src","sources":["notifications.ts"],"mappings":";;;;;;AAqBA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAEA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,UAAA,GAAAd,OAAA;AA1CA;AACA;AACA;AAC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