@chipmobilesdk/rn-notification 0.6.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 (647) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +8 -6
  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 +72 -26
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The automatic-maintenance switch.
3
+ *
4
+ * A package that acts on its own must offer a way to stop it — and a consumer
5
+ * that takes control must not lose a feature as the price. Disabling automatic
6
+ * maintenance leaves every operation explicitly invocable through
7
+ * `runMaintenance()`, producing identical device state.
8
+ */
9
+ import type { MaintenanceResult } from '../contract/reconcile.js';
10
+ import type { MaintenanceRegistry, MaintenanceTrigger } from './cycle.js';
11
+ export interface MaintenanceControllerOptions {
12
+ readonly registry: MaintenanceRegistry;
13
+ readonly now: () => number;
14
+ /**
15
+ * Identifiers the package owns at the start of a cycle. May read the device,
16
+ * since ownership is decided per pending occurrence, not per series.
17
+ */
18
+ readonly ownedIds: () => ReadonlySet<string> | Promise<ReadonlySet<string>>;
19
+ readonly enabled?: boolean;
20
+ }
21
+ export declare class MaintenanceController {
22
+ private enabled;
23
+ private readonly registry;
24
+ private readonly now;
25
+ private readonly ownedIds;
26
+ constructor(options: MaintenanceControllerOptions);
27
+ get isEnabled(): boolean;
28
+ setEnabled(enabled: boolean): void;
29
+ /** Called by lifecycle observers. A no-op when automatic maintenance is off. */
30
+ runAutomatic(trigger: Exclude<MaintenanceTrigger, 'explicit'>): Promise<MaintenanceResult | undefined>;
31
+ /** Always runs, regardless of the switch. This is what preserves capability parity. */
32
+ runExplicit(): Promise<MaintenanceResult>;
33
+ private execute;
34
+ }
35
+ //# sourceMappingURL=toggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../src/maintenance/toggle.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAAuB,CAAC;AAC/D,OAAO,KAAK,EAAsB,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAS,CAAC;AAE3F,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,qBAAqB;IACjC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2D;gBAExE,OAAO,EAAE,4BAA4B;IAOjD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,gFAAgF;IAC1E,YAAY,CACjB,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAC9C,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAKzC,uFAAuF;IACjF,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;YAIjC,OAAO;CAQrB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Pending-set verification.
3
+ *
4
+ * Engine boot restoration coverage varies by manufacturer, so after a restart
5
+ * the device may hold fewer notifications than the package expects. This step
6
+ * notices that.
7
+ *
8
+ * It **detects and reports only**. It never re-registers, cancels, or repairs
9
+ * anything — the package deliberately does not persist a desired set, so it
10
+ * cannot tell a restoration gap from an intentional consumer change. Guessing
11
+ * would mean either resurrecting notifications the user cancelled or deleting
12
+ * ones they still want. Repair is consumer-invoked reconciliation.
13
+ *
14
+ * Runs at order 20, after re-anchoring (order 10): re-anchoring rewrites firing
15
+ * instants, and verifying first would compare against instants that are about
16
+ * to change.
17
+ */
18
+ import type { MaintenanceStep } from './cycle.js';
19
+ import type { NotificationEngineAdapter } from '../engine/adapter.js';
20
+ export declare const VERIFY_ORDER = 20;
21
+ export interface VerifyStepDependencies {
22
+ readonly engine: NotificationEngineAdapter;
23
+ /**
24
+ * Identifiers the package expects the device to hold — the union of series
25
+ * occurrences and the last reconciliation's result. Absent expectations mean
26
+ * nothing to verify, which is different from expecting nothing.
27
+ */
28
+ readonly expectedIds: () => ReadonlySet<string> | undefined;
29
+ readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
30
+ }
31
+ export declare function createVerifyStep(deps: VerifyStepDependencies): MaintenanceStep;
32
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/maintenance/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,YAAS,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAmB,CAAC;AAInE,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC3F;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,GAAG,eAAe,CA8C9E"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The window-refresh maintenance step.
3
+ *
4
+ * Runs at order 15 — after re-anchoring (10) so it expands against corrected
5
+ * instants, before verification (20) so verification sees the refreshed set
6
+ * rather than reporting occurrences the refresh was about to add.
7
+ *
8
+ * This step is the reason automatic maintenance exists at all: only the package
9
+ * knows when a series' horizon has moved, and it can act on that without ever
10
+ * needing a desired set from the consumer.
11
+ */
12
+ import type { MaintenanceStep } from './cycle.js';
13
+ import type { RecurrenceRule } from '../contract/recurrence.js';
14
+ import type { Recurrence } from '../recurrence/index.js';
15
+ export declare const WINDOW_REFRESH_ORDER = 15;
16
+ export interface WindowRefreshDependencies {
17
+ readonly recurrence: Recurrence;
18
+ /**
19
+ * Rules the consumer has registered, supplied as a lookup rather than stored.
20
+ *
21
+ * The ledger records what the package expanded; the rule itself belongs to
22
+ * the consumer, because persisting a rule would mean persisting its content
23
+ * template — and FR-096a forbids the package holding notification content.
24
+ */
25
+ readonly registeredRules: () => readonly RecurrenceRule[];
26
+ readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
27
+ }
28
+ export declare function createWindowRefreshStep(deps: WindowRefreshDependencies): MaintenanceStep;
29
+ //# sourceMappingURL=window-refresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-refresh.d.ts","sourceRoot":"","sources":["../../../../src/maintenance/window-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,YAAS,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAe,CAAC;AAEhD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,SAAS,cAAc,EAAE,CAAC;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC3F;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,yBAAyB,GAAG,eAAe,CAgCxF"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * One call that assembles the whole package (NOT-07).
3
+ *
4
+ * Until 0.5.0 an app wired a dozen factories itself — scheduler, reconciler,
5
+ * recurrence, permissions, channels, interactions, snapshot, maintenance steps
6
+ * — repeating the engine, tone resolver, clock and time-zone reader for each,
7
+ * and usually hard-coding `canScheduleExactly: () => true`. `createNotifications`
8
+ * does that wiring once, the way the package means it:
9
+ *
10
+ * - every part reports through the one redacting diagnostic emitter;
11
+ * - `canScheduleExactly` follows the exact-alarm permission the package last
12
+ * read, instead of a guess;
13
+ * - automatic maintenance has the standard steps registered (re-anchoring after
14
+ * a time-zone change, refreshing permissions, and refreshing recurrence
15
+ * windows when the app supplies its rules), so it does something on every
16
+ * return to the foreground.
17
+ *
18
+ * The individual factories stay exported for an app that needs a different
19
+ * wiring; they are also available from `@chipmobilesdk/rn-notification/advanced`.
20
+ */
21
+ import type { Channels } from './channel/migrate.js';
22
+ import type { InitializeResult, NotificationConfig } from './contract/index.js';
23
+ import type { MaintenanceResult } from './contract/reconcile.js';
24
+ import type { RecurrenceRule } from './contract/recurrence.js';
25
+ import { type Snapshot } from './diagnostics/snapshot.js';
26
+ import type { NotificationEngineAdapter } from './engine/adapter.js';
27
+ import { type NotificationRuntime } from './initialize.js';
28
+ import { type Interactions } from './interaction/index.js';
29
+ import { type Permissions } from './permission/index.js';
30
+ import type { PlatformInfo } from './permission/state.js';
31
+ import { type Reconciler } from './reconcile/index.js';
32
+ import { type Recurrence } from './recurrence/index.js';
33
+ import { type Scheduler } from './schedule/index.js';
34
+ import { type TimeZoneReader } from './schedule/anchor.js';
35
+ import type { StateStore } from './state/store.js';
36
+ export interface NotificationsDependencies {
37
+ /** Defaults to the notify-kit engine. Inject a fake in tests. */
38
+ readonly engine?: NotificationEngineAdapter;
39
+ /** Defaults to MMKV-backed state. */
40
+ readonly store?: StateStore;
41
+ readonly timeZone?: TimeZoneReader;
42
+ readonly now?: () => number;
43
+ /** Defaults to the running OS and, on Android, its API level. */
44
+ readonly platform?: PlatformInfo;
45
+ /**
46
+ * The recurrence rules the app has registered. With it, maintenance refreshes
47
+ * their windows on every foreground return; the package never stores a rule
48
+ * itself, because a rule carries notification content (FR-096a).
49
+ */
50
+ readonly recurrenceRules?: () => readonly RecurrenceRule[];
51
+ /** Whether the app holds a push token, for the snapshot. Presence only. */
52
+ readonly hasPushToken?: () => boolean;
53
+ }
54
+ export interface Notifications {
55
+ readonly scheduler: Scheduler;
56
+ readonly reconciler: Reconciler;
57
+ readonly recurrence: Recurrence;
58
+ readonly permissions: Permissions;
59
+ readonly channels: Channels;
60
+ readonly interactions: Interactions;
61
+ readonly snapshot: Snapshot;
62
+ /** State, diagnostics and the maintenance controller `initialize` assembled. */
63
+ readonly runtime: NotificationRuntime;
64
+ /** What initialization did: tones applied, migrations run, how long it took. */
65
+ readonly initialization: InitializeResult;
66
+ /** The time-zone reader every part schedules against. */
67
+ readonly timeZone: TimeZoneReader;
68
+ /** Handles a tap or action; a shortcut for `interactions.onInteraction`. */
69
+ onInteraction: Interactions['onInteraction'];
70
+ /** Runs maintenance now, whatever the app state. */
71
+ runMaintenance(): Promise<MaintenanceResult>;
72
+ /** Whether the exact-alarm capability is granted, as last read. */
73
+ canScheduleExactly(): boolean;
74
+ /** Stops the lifecycle observer and every listener. */
75
+ dispose(): void;
76
+ }
77
+ export declare function createNotifications(config: NotificationConfig, deps?: NotificationsDependencies): Promise<Notifications>;
78
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAmB,CAAC;AAElD,OAAO,KAAK,EAAkB,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAY,CAAC;AAGvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAAuB,CAAC;AAC5D,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAkB,CAAC;AAGlE,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,iBAAc,CAAC;AACpE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,wBAAe,CAAC;AAItE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAc,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AACvD,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,sBAAa,CAAC;AAChE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,uBAAc,CAAC;AACjE,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,qBAAY,CAAC;AAC7D,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,sBAAmB,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAe,CAAC;AAEhD,MAAM,WAAW,yBAAyB;IACzC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAC5C,qCAAqC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,SAAS,cAAc,EAAE,CAAC;IAC3D,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,gFAAgF;IAChF,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAC1C,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,4EAA4E;IAC5E,aAAa,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC7C,oDAAoD;IACpD,cAAc,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7C,mEAAmE;IACnE,kBAAkB,IAAI,OAAO,CAAC;IAC9B,uDAAuD;IACvD,OAAO,IAAI,IAAI,CAAC;CAChB;AAOD,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,kBAAkB,EAC1B,IAAI,GAAE,yBAA8B,GAClC,OAAO,CAAC,aAAa,CAAC,CAkGxB"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Permission coordination.
3
+ *
4
+ * Two rules shape everything here. Reading state never prompts, so the consumer
5
+ * decides when the user is asked — a prompt at the wrong moment is a permanent
6
+ * denial. And a refusal never fails the caller's business operation: the user's
7
+ * actual work completes, and the lost capability is reported separately.
8
+ */
9
+ import type { PermissionKind, PermissionReport, PermissionState, RestrictionReport } from '../contract/permission.js';
10
+ import type { NotificationEngineAdapter } from '../engine/adapter.js';
11
+ import type { StateManager } from '../state/record.js';
12
+ import { type PlatformInfo } from './state.js';
13
+ export interface PermissionDependencies {
14
+ readonly engine: NotificationEngineAdapter;
15
+ readonly state: StateManager;
16
+ readonly platform: PlatformInfo;
17
+ readonly now: () => number;
18
+ readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
19
+ /**
20
+ * Calls back when the app returns from the background. Defaults to rn-core's
21
+ * shared lifecycle; injected in tests.
22
+ */
23
+ readonly onForeground?: (listener: () => void) => () => void;
24
+ }
25
+ export type PermissionChangeHandler = (report: PermissionReport) => void;
26
+ export declare function createPermissions(deps: PermissionDependencies): {
27
+ /** Reads every permission state without triggering any dialog. */
28
+ getPermissions(): Promise<PermissionReport>;
29
+ /** Requested independently — an app may need one and not the other. */
30
+ requestDisplayPermission(ownerTag?: string): Promise<PermissionState>;
31
+ requestExactAlarmPermission(ownerTag?: string): Promise<PermissionState>;
32
+ /** Whether the package has ever asked — the platform cannot answer this. */
33
+ hasEverRequested(kind: PermissionKind, ownerTag?: string): boolean;
34
+ /**
35
+ * Opens the settings screen for one specific permission.
36
+ *
37
+ * Telling a user to "find it in settings" is how you lose them, so a
38
+ * platform with no reachable screen is an error rather than a silent no-op.
39
+ */
40
+ openSettings(kind: PermissionKind): Promise<void>;
41
+ onPermissionChange(handler: PermissionChangeHandler): () => void;
42
+ /**
43
+ * Manufacturer background restrictions, reported for information only.
44
+ *
45
+ * `unknown` is a first-class answer: some vendors stop apps in ways with no
46
+ * detection API, and guessing would be worse than admitting it. The package
47
+ * changes none of these settings on the user's behalf.
48
+ */
49
+ getBackgroundRestrictions(): Promise<RestrictionReport>;
50
+ /** Called by the permission-refresh maintenance step. */
51
+ refresh(): Promise<{
52
+ readonly report: PermissionReport;
53
+ readonly changed: boolean;
54
+ }>;
55
+ };
56
+ export type Permissions = ReturnType<typeof createPermissions>;
57
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/permission/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,MAAM,2BAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAEpD,OAAO,EAAiC,KAAK,YAAY,EAAE,MAAM,YAAS,CAAC;AAW3E,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3F;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAC7D;AAUD,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEzE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,sBAAsB;IA+G5D,kEAAkE;sBAC1C,OAAO,CAAC,gBAAgB,CAAC;IAMjD,uEAAuE;wCACnC,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;2CAI9B,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIxE,4EAA4E;2BACrD,cAAc,aAAa,MAAM,GAAG,OAAO;IAIlE;;;;;OAKG;uBACsB,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;gCAW3B,uBAAuB,GAAG,MAAM,IAAI;IAOhE;;;;;;OAMG;iCACgC,OAAO,CAAC,iBAAiB,CAAC;IAoB7D,yDAAyD;eACxC,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;EAK3F;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The permission state model.
3
+ *
4
+ * Six states, never collapsed. The two that matter most are the ones a naive
5
+ * model loses: `notAsked` must stay distinguishable from `denied`, or reading
6
+ * state without prompting buys nothing; and `notRequired` must never be
7
+ * reported as `denied`, because a platform version with no such concept never
8
+ * refused anything.
9
+ */
10
+ import type { PermissionCapability, PermissionKind, PermissionState } from '../contract/permission.js';
11
+ /** Android runtime notification permission arrived in API 33. */
12
+ export declare const ANDROID_DISPLAY_PERMISSION_API = 33;
13
+ /** Android exact-alarm permission arrived in API 31. */
14
+ export declare const ANDROID_EXACT_ALARM_API = 31;
15
+ export interface PlatformInfo {
16
+ readonly os: 'ios' | 'android' | 'other';
17
+ /** Android API level. Ignored on iOS. */
18
+ readonly apiLevel?: number;
19
+ }
20
+ /**
21
+ * Whether a permission concept exists at all on this platform version.
22
+ *
23
+ * Returning `supported: false` is what lets `notRequired` be reported honestly
24
+ * rather than inventing a refusal.
25
+ */
26
+ export declare function capabilityFor(kind: PermissionKind, platform: PlatformInfo): PermissionCapability;
27
+ /** Normalizes a platform reading into the six-state model. */
28
+ export declare function normalizeState(kind: PermissionKind, raw: PermissionState, platform: PlatformInfo): PermissionState;
29
+ /**
30
+ * Whether a state means the package can still show notifications.
31
+ *
32
+ * `provisional` counts: iOS quiet delivery still reaches the user, just without
33
+ * interrupting them. Treating it as denied would suppress notifications the
34
+ * user is in fact receiving.
35
+ */
36
+ export declare function canDisplay(state: PermissionState): boolean;
37
+ /** Whether asking again could produce a dialog, or whether settings is the only route. */
38
+ export declare function isTerminal(state: PermissionState): boolean;
39
+ /** Whether the package has ever asked, which the platform cannot answer after the fact. */
40
+ export declare function shouldOfferSettings(state: PermissionState): boolean;
41
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/permission/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAAwB,CAAC;AAEpG,iEAAiE;AACjE,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,wDAAwD;AACxD,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;IACzC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,GAAG,oBAAoB,CAchG;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAC7B,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,eAAe,EACpB,QAAQ,EAAE,YAAY,GACpB,eAAe,CAKjB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAE1D;AAED,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAE1D;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAEnE"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Payload normalization.
3
+ *
4
+ * Every provider's payload is reduced to one envelope shape before it reaches
5
+ * the consumer, so changing provider costs consumer code nothing.
6
+ *
7
+ * Version handling is best-effort: a payload declaring a version this build
8
+ * does not implement is still processed, honouring the fields it understands
9
+ * and ignoring the rest. Servers deploy ahead of app adoption and old app
10
+ * versions live on devices for months, so gating every server-side change on
11
+ * app rollout is the more expensive failure.
12
+ *
13
+ * That is only safe under an append-only discipline — a released field's
14
+ * meaning must never be repurposed. The version-skew diagnostic exists so a
15
+ * misprocessing incident is traceable to the skew rather than investigated as a
16
+ * logic defect.
17
+ */
18
+ import type { PushEnvelope } from './provider-adapter.js';
19
+ /** The contract version this build implements. */
20
+ export declare const IMPLEMENTED_PAYLOAD_VERSION = 1;
21
+ export interface NormalizeResult {
22
+ readonly envelope: PushEnvelope;
23
+ readonly versionSkew: boolean;
24
+ }
25
+ /**
26
+ * Normalizes a raw provider payload.
27
+ *
28
+ * Throws only for a **structurally unparseable** payload — a broken message.
29
+ * An unrecognized version is a healthy message from a newer contract and must
30
+ * never collapse into the same condition.
31
+ */
32
+ export declare function normalizeEnvelope(raw: unknown, receivedAt: number): NormalizeResult;
33
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../../src/push/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AAGvD,kDAAkD;AAClD,eAAO,MAAM,2BAA2B,IAAI,CAAC;AA2F7C,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAuCnF"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The Firebase Cloud Messaging provider.
3
+ *
4
+ * Every `@react-native-firebase/messaging` import is confined to this file, so
5
+ * the rest of the package — and every consuming app — stays free of provider
6
+ * types. Substituting a provider is an adapter swap, not a rewrite.
7
+ *
8
+ * The module is required **lazily**. That matters more here than for the
9
+ * engine: messaging is an *optional* peer dependency, and an app that never
10
+ * enables push must not fail at import time for a package it deliberately did
11
+ * not install.
12
+ */
13
+ import type { PushProviderAdapter } from './provider-adapter.js';
14
+ /** Minimal shape used from the SDK, so its full surface never leaks into typing. */
15
+ interface MessagingModule {
16
+ (): MessagingInstance;
17
+ AuthorizationStatus?: Record<string, number>;
18
+ }
19
+ interface MessagingInstance {
20
+ getToken(): Promise<string>;
21
+ deleteToken(): Promise<void>;
22
+ onTokenRefresh(handler: (token: string) => void): () => void;
23
+ onMessage(handler: (message: unknown) => Promise<void> | void): () => void;
24
+ setBackgroundMessageHandler(handler: (message: unknown) => Promise<void>): void;
25
+ getInitialNotification(): Promise<unknown | null>;
26
+ hasPermission?(): Promise<number>;
27
+ isDeviceRegisteredForRemoteMessages?: boolean;
28
+ }
29
+ export interface FcmProviderOptions {
30
+ /** Injected in tests; production resolves the real module. */
31
+ readonly module?: MessagingModule;
32
+ /**
33
+ * Registers the background message handler.
34
+ *
35
+ * Left to the consumer by default because the SDK requires it to be
36
+ * registered at module scope in `index.js`, outside React's lifecycle — a
37
+ * constraint the package documents rather than works around.
38
+ */
39
+ readonly onBackgroundMessage?: (message: unknown) => Promise<void>;
40
+ }
41
+ export declare function createFcmProvider(options?: FcmProviderOptions): PushProviderAdapter;
42
+ export {};
43
+ //# sourceMappingURL=fcm-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fcm-provider.d.ts","sourceRoot":"","sources":["../../../../src/push/fcm-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAoB,mBAAmB,EAAE,MAAM,uBAAoB,CAAC;AAGhF,oFAAoF;AACpF,UAAU,eAAe;IACxB,IAAI,iBAAiB,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED,UAAU,iBAAiB;IAC1B,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,cAAc,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC7D,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,IAAI,CAAC;IAC3E,2BAA2B,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChF,sBAAsB,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAClD,aAAa,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,mCAAmC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAkBD,MAAM,WAAW,kBAAkB;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,mBAAmB,CA+FvF"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The push gate.
3
+ *
4
+ * Everything a consumer sees about push comes through here, in one normalized
5
+ * shape with zero provider types. Substituting a provider is therefore an
6
+ * adapter swap rather than a consumer rewrite.
7
+ *
8
+ * Two behaviours are deliberate and easy to get wrong. A push arriving in the
9
+ * **foreground is never auto-displayed** — presentation is the app's decision,
10
+ * and a library that decided for it would fight every consumer's design. And a
11
+ * malformed payload is **dropped safely**, because a broken message from a
12
+ * server must not be able to crash an installed app.
13
+ */
14
+ import type { PushEnvelope, PushProviderAdapter, PushAvailability } from './provider-adapter.js';
15
+ import type { StateManager } from '../state/record.js';
16
+ import type { Unsubscribe } from '../contract/interaction.js';
17
+ export type PushHandler = (envelope: PushEnvelope) => void | Promise<void>;
18
+ export interface PushGateDependencies {
19
+ readonly provider: PushProviderAdapter;
20
+ readonly state: StateManager;
21
+ readonly now: () => number;
22
+ readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
23
+ }
24
+ export type UndeliverableCause = 'missingPermission' | 'expiredToken' | 'platformRestriction' | 'malformedPayload' | 'suspectedRateLimit';
25
+ export declare function createPushGate(deps: PushGateDependencies): {
26
+ /** Reports whether platform push services exist, so degradation is controlled. */
27
+ getAvailability(): Promise<PushAvailability>;
28
+ /** Waits for a genuine token. Never returns a placeholder presented as one. */
29
+ getToken(): Promise<string>;
30
+ onTokenChange(handler: (token: string) => void): Unsubscribe;
31
+ invalidateToken(): Promise<boolean>;
32
+ /**
33
+ * Subscribes to inbound payloads.
34
+ *
35
+ * Nothing is displayed automatically — the consumer decides whether and how
36
+ * to present a foreground push.
37
+ */
38
+ onPushReceived(handler: PushHandler): Unsubscribe;
39
+ /**
40
+ * Processes a payload delivered while the app was in the background, from
41
+ * the module-scope handler `setBackgroundMessageHandler` requires (NOT-24).
42
+ *
43
+ * The same normalization and the same persisted deduplication as a
44
+ * foreground payload, so a redelivery after the process restarted is
45
+ * suppressed rather than handled twice. Resolves once every handler has run.
46
+ */
47
+ handleBackground(raw: unknown): Promise<PushEnvelope | undefined>;
48
+ /** Processes the payload that launched the app, if any. */
49
+ collectInitial(): Promise<PushEnvelope | undefined>;
50
+ /** Reports a specific cause rather than leaving a non-delivery unexplained. */
51
+ reportUndeliverable(cause: UndeliverableCause, context?: Record<string, unknown>): void;
52
+ /** Exposed for tests and orderly shutdown. */
53
+ flush(): Promise<void>;
54
+ dispose(): void;
55
+ };
56
+ export type PushGate = ReturnType<typeof createPushGate>;
57
+ //# sourceMappingURL=gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../../src/push/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAAyB,CAAC;AAK3D,MAAM,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE3E,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC3F;AAED,MAAM,MAAM,kBAAkB,GAC3B,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,GAClB,oBAAoB,CAAC;AAExB,wBAAgB,cAAc,CAAC,IAAI,EAAE,oBAAoB;IA+DvD,kFAAkF;uBACzD,OAAO,CAAC,gBAAgB,CAAC;IAYlD,+EAA+E;gBAC7D,OAAO,CAAC,MAAM,CAAC;2BAcV,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,WAAW;uBAUnC,OAAO,CAAC,OAAO,CAAC;IAYzC;;;;;OAKG;4BACqB,WAAW,GAAG,WAAW;IASjD;;;;;;;OAOG;0BACyB,OAAO,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAMvE,2DAA2D;sBACnC,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAKzD,+EAA+E;+BACpD,kBAAkB,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAQvF,8CAA8C;aAC/B,OAAO,CAAC,IAAI,CAAC;eAIjB,IAAI;EAUhB;AAED,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Push surface: `@chipmobilesdk/rn-notification/push`
3
+ *
4
+ * Separate from the default entrypoint so an app that never imports this ships
5
+ * zero provider code, zero push permissions, and zero entitlements — and takes
6
+ * on none of the provider's data-collection declarations.
7
+ */
8
+ export { createPushGate } from './gate.js';
9
+ export type { PushGate, PushGateDependencies, PushHandler, UndeliverableCause } from './gate.js';
10
+ export { createFcmProvider } from './fcm-provider.js';
11
+ export type { FcmProviderOptions } from './fcm-provider.js';
12
+ export { createSignOut } from './signout.js';
13
+ export type { SignOut, SignOutDependencies, SignOutResult } from './signout.js';
14
+ export { createInstructionHandler } from './instructions.js';
15
+ export type { InstructionHandler, InstructionDependencies, InstructionOutcome, } from './instructions.js';
16
+ export { normalizeEnvelope, IMPLEMENTED_PAYLOAD_VERSION } from './envelope.js';
17
+ export type { NormalizeResult } from './envelope.js';
18
+ export type { PushProviderAdapter, PushEnvelope, PushConfig, PushAvailability, } from './provider-adapter.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/push/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAQ,CAAC;AACxC,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAQ,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAgB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAW,CAAC;AAC1C,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAW,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAgB,CAAC;AAC1D,YAAY,EACX,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GAClB,MAAM,mBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,eAAY,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,eAAY,CAAC;AAElD,YAAY,EACX,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,gBAAgB,GAChB,MAAM,uBAAoB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Push-driven local scheduling.
3
+ *
4
+ * Where the two paths meet. A server can schedule or cancel a local
5
+ * notification, and it gets **no privileged path**: an instruction arriving by
6
+ * push passes exactly the same identifier validation, moment validation, tone
7
+ * resolution, and permission rules as a request from app code.
8
+ *
9
+ * That symmetry is the point. A server that could bypass validation would be
10
+ * able to put the device into a state the app itself could not produce, and no
11
+ * amount of local correctness would survive it.
12
+ */
13
+ import type { PushEnvelope } from './provider-adapter.js';
14
+ import type { Scheduler } from '../schedule/index.js';
15
+ import type { NotificationEngineAdapter } from '../engine/adapter.js';
16
+ export interface InstructionDependencies {
17
+ readonly scheduler: Scheduler;
18
+ readonly engine: NotificationEngineAdapter;
19
+ readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
20
+ }
21
+ export type InstructionOutcome = {
22
+ readonly kind: 'scheduled';
23
+ readonly id: string;
24
+ readonly replaced: boolean;
25
+ } | {
26
+ readonly kind: 'cancelled';
27
+ readonly id: string;
28
+ } | {
29
+ readonly kind: 'suppressed';
30
+ readonly id: string;
31
+ readonly reason: string;
32
+ } | {
33
+ readonly kind: 'rejected';
34
+ readonly id: string;
35
+ readonly code: string;
36
+ readonly reason: string;
37
+ } | {
38
+ readonly kind: 'ignored';
39
+ readonly id: string;
40
+ };
41
+ export declare function createInstructionHandler(deps: InstructionDependencies): {
42
+ handle(envelope: PushEnvelope): Promise<InstructionOutcome>;
43
+ };
44
+ export type InstructionHandler = ReturnType<typeof createInstructionHandler>;
45
+ //# sourceMappingURL=instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../src/push/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAmB,CAAC;AAGnE,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC3F;AAED,MAAM,MAAM,kBAAkB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC7E;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACvB,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,uBAAuB;qBAkB7C,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;EAyDlE;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The port every push provider satisfies.
3
+ *
4
+ * No provider type appears in any signature, which is what makes swapping the
5
+ * provider cost the consumer nothing.
6
+ */
7
+ import type { RoutingPayload, NotificationContent } from '../contract/notification.js';
8
+ import type { Unsubscribe } from '../contract/interaction.js';
9
+ /** The single normalized shape every provider's payload is reduced to. */
10
+ export interface PushEnvelope {
11
+ /** Contract version carried by the payload. See contracts/push-payload.md. */
12
+ readonly version: number;
13
+ readonly kind: 'display' | 'data' | 'schedule' | 'cancel';
14
+ readonly id: string;
15
+ readonly ownerTag?: string;
16
+ readonly content?: NotificationContent;
17
+ readonly tone?: string;
18
+ readonly moment?: {
19
+ readonly at: number;
20
+ readonly anchoring?: 'wallClock' | 'absolute';
21
+ };
22
+ readonly routing?: RoutingPayload;
23
+ /** De-duplication key, falling back to `id` when absent. */
24
+ readonly dedupId: string;
25
+ readonly receivedAt: number;
26
+ /**
27
+ * True when the payload declared a version this build does not implement and
28
+ * was processed best-effort, honouring known fields and ignoring the rest.
29
+ */
30
+ readonly versionSkew: boolean;
31
+ }
32
+ export interface PushConfig {
33
+ /** Called when the provider reports a new or refreshed registration token. */
34
+ readonly onTokenChange?: (token: string) => void;
35
+ }
36
+ export type PushAvailability = 'available' | 'unavailable' | 'unknown';
37
+ export interface PushProviderAdapter {
38
+ readonly name: string;
39
+ /** Reports whether platform push services exist, so degradation is controlled rather than opaque. */
40
+ getAvailability(): Promise<PushAvailability>;
41
+ /** Waits for a genuine token. Never returns a placeholder presented as a token. */
42
+ getToken(): Promise<string>;
43
+ onTokenChange(handler: (token: string) => void): Unsubscribe;
44
+ invalidateToken(): Promise<boolean>;
45
+ /** Raw provider payloads, normalized by the gate rather than by the adapter. */
46
+ subscribeToMessages(handler: (raw: unknown) => void): Unsubscribe;
47
+ /** A payload that launched the app, consumed exactly once. */
48
+ takeInitialMessage(): Promise<unknown | undefined>;
49
+ }
50
+ //# sourceMappingURL=provider-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-adapter.d.ts","sourceRoot":"","sources":["../../../../src/push/provider-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,6BAA0B,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAAyB,CAAC;AAE3D,0EAA0E;AAC1E,MAAM,WAAW,YAAY;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,UAAU,CAAA;KAAE,CAAC;IACzF,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,qGAAqG;IACrG,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7C,mFAAmF;IACnF,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,aAAa,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,WAAW,CAAC;IAC7D,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpC,gFAAgF;IAChF,mBAAmB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,WAAW,CAAC;IAClE,8DAA8D;IAC9D,kBAAkB,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACnD"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Sign-out cleanup.
3
+ *
4
+ * Three things must happen together, and the order matters: invalidate the
5
+ * token first so no further messages arrive for the account being left, then
6
+ * cancel its notifications, then clear its persisted state.
7
+ *
8
+ * Deliberately **scoped to one owner tag**. On a shared device, signing one
9
+ * account out must not clear another's deduplication history or cancel their
10
+ * reminders — and must not discard the channel migration ledger, which
11
+ * describes the device rather than any account.
12
+ */
13
+ import type { PushGate } from './gate.js';
14
+ import type { Scheduler } from '../schedule/index.js';
15
+ import type { StateManager } from '../state/record.js';
16
+ export interface SignOutDependencies {
17
+ readonly scheduler: Scheduler;
18
+ readonly state: StateManager;
19
+ /** Absent for a local-only app, which still needs the rest of the cleanup. */
20
+ readonly push?: PushGate;
21
+ readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
22
+ }
23
+ export interface SignOutResult {
24
+ readonly ownerTag: string;
25
+ readonly tokenInvalidated: boolean;
26
+ readonly cancelledIds: readonly string[];
27
+ readonly clearedCollections: readonly string[];
28
+ }
29
+ export declare function createSignOut(deps: SignOutDependencies): {
30
+ signOut(ownerTag: string): Promise<SignOutResult>;
31
+ };
32
+ export type SignOut = ReturnType<typeof createSignOut>;
33
+ //# sourceMappingURL=signout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signout.d.ts","sourceRoot":"","sources":["../../../../src/push/signout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAGpD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC3F;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,mBAAmB;sBAE7B,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;EA2BxD;AAED,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}