@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.
- package/CHANGELOG.md +184 -0
- package/README.md +108 -16
- package/lib/commonjs/advanced.js +139 -0
- package/lib/commonjs/advanced.js.map +1 -0
- package/lib/commonjs/channel/migrate.js +246 -0
- package/lib/commonjs/channel/migrate.js.map +1 -0
- package/lib/commonjs/channel/tone-map.js +120 -0
- package/lib/commonjs/channel/tone-map.js.map +1 -0
- package/lib/commonjs/channel/validate-tone.js +61 -0
- package/lib/commonjs/channel/validate-tone.js.map +1 -0
- package/lib/commonjs/contract/channel.js +52 -0
- package/lib/commonjs/contract/channel.js.map +1 -0
- package/lib/commonjs/contract/diagnostics.js +25 -0
- package/lib/commonjs/contract/diagnostics.js.map +1 -0
- package/lib/commonjs/contract/errors.js +126 -0
- package/lib/commonjs/contract/errors.js.map +1 -0
- package/lib/commonjs/contract/hash.js +35 -0
- package/lib/commonjs/contract/hash.js.map +1 -0
- package/lib/commonjs/contract/index.js +94 -0
- package/lib/commonjs/contract/index.js.map +1 -0
- package/lib/commonjs/contract/interaction.js +37 -0
- package/lib/commonjs/contract/interaction.js.map +1 -0
- package/lib/commonjs/contract/notification.js +42 -0
- package/lib/commonjs/contract/notification.js.map +1 -0
- package/lib/commonjs/contract/permission.js +2 -0
- package/lib/commonjs/contract/permission.js.map +1 -0
- package/lib/commonjs/contract/reconcile.js +6 -0
- package/lib/commonjs/contract/reconcile.js.map +1 -0
- package/lib/commonjs/contract/recurrence.js +53 -0
- package/lib/commonjs/contract/recurrence.js.map +1 -0
- package/lib/commonjs/diagnostics/burst.js +89 -0
- package/lib/commonjs/diagnostics/burst.js.map +1 -0
- package/lib/commonjs/diagnostics/events.js +63 -0
- package/lib/commonjs/diagnostics/events.js.map +1 -0
- package/lib/commonjs/diagnostics/redact.js +48 -0
- package/lib/commonjs/diagnostics/redact.js.map +1 -0
- package/lib/commonjs/diagnostics/snapshot.js +68 -0
- package/lib/commonjs/diagnostics/snapshot.js.map +1 -0
- package/lib/commonjs/engine/adapter.js +6 -0
- package/lib/commonjs/engine/adapter.js.map +1 -0
- package/lib/commonjs/engine/codec.js +84 -0
- package/lib/commonjs/engine/codec.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/events.js +148 -0
- package/lib/commonjs/engine/notify-kit/events.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/module.js +119 -0
- package/lib/commonjs/engine/notify-kit/module.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/android.js +159 -0
- package/lib/commonjs/engine/notify-kit/platform/android.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/index.js +57 -0
- package/lib/commonjs/engine/notify-kit/platform/index.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/ios.js +54 -0
- package/lib/commonjs/engine/notify-kit/platform/ios.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/types.js +6 -0
- package/lib/commonjs/engine/notify-kit/platform/types.js.map +1 -0
- package/lib/commonjs/engine/notify-kit-engine.js +260 -0
- package/lib/commonjs/engine/notify-kit-engine.js.map +1 -0
- package/lib/commonjs/index.js +367 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/initialize.js +187 -0
- package/lib/commonjs/initialize.js.map +1 -0
- package/lib/commonjs/interaction/index.js +120 -0
- package/lib/commonjs/interaction/index.js.map +1 -0
- package/lib/commonjs/maintenance/cycle.js +108 -0
- package/lib/commonjs/maintenance/cycle.js.map +1 -0
- package/lib/commonjs/maintenance/permission-refresh.js +39 -0
- package/lib/commonjs/maintenance/permission-refresh.js.map +1 -0
- package/lib/commonjs/maintenance/reanchor.js +99 -0
- package/lib/commonjs/maintenance/reanchor.js.map +1 -0
- package/lib/commonjs/maintenance/toggle.js +50 -0
- package/lib/commonjs/maintenance/toggle.js.map +1 -0
- package/lib/commonjs/maintenance/verify.js +70 -0
- package/lib/commonjs/maintenance/verify.js.map +1 -0
- package/lib/commonjs/maintenance/window-refresh.js +53 -0
- package/lib/commonjs/maintenance/window-refresh.js.map +1 -0
- package/lib/commonjs/notifications.js +161 -0
- package/lib/commonjs/notifications.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/permission/index.js +182 -0
- package/lib/commonjs/permission/index.js.map +1 -0
- package/lib/commonjs/permission/state.js +92 -0
- package/lib/commonjs/permission/state.js.map +1 -0
- package/lib/commonjs/push/envelope.js +141 -0
- package/lib/commonjs/push/envelope.js.map +1 -0
- package/lib/commonjs/push/fcm-provider.js +122 -0
- package/lib/commonjs/push/fcm-provider.js.map +1 -0
- package/lib/commonjs/push/gate.js +162 -0
- package/lib/commonjs/push/gate.js.map +1 -0
- package/lib/commonjs/push/index.js +47 -0
- package/lib/commonjs/push/index.js.map +1 -0
- package/lib/commonjs/push/instructions.js +101 -0
- package/lib/commonjs/push/instructions.js.map +1 -0
- package/lib/commonjs/push/provider-adapter.js +6 -0
- package/lib/commonjs/push/provider-adapter.js.map +1 -0
- package/lib/commonjs/push/signout.js +55 -0
- package/lib/commonjs/push/signout.js.map +1 -0
- package/lib/commonjs/reconcile/chunk.js +49 -0
- package/lib/commonjs/reconcile/chunk.js.map +1 -0
- package/lib/commonjs/reconcile/diff.js +105 -0
- package/lib/commonjs/reconcile/diff.js.map +1 -0
- package/lib/commonjs/reconcile/duplicates.js +60 -0
- package/lib/commonjs/reconcile/duplicates.js.map +1 -0
- package/lib/commonjs/reconcile/index.js +164 -0
- package/lib/commonjs/reconcile/index.js.map +1 -0
- package/lib/commonjs/reconcile/truncate.js +50 -0
- package/lib/commonjs/reconcile/truncate.js.map +1 -0
- package/lib/commonjs/recurrence/clock-guard.js +65 -0
- package/lib/commonjs/recurrence/clock-guard.js.map +1 -0
- package/lib/commonjs/recurrence/expand.js +254 -0
- package/lib/commonjs/recurrence/expand.js.map +1 -0
- package/lib/commonjs/recurrence/index.js +212 -0
- package/lib/commonjs/recurrence/index.js.map +1 -0
- package/lib/commonjs/repeat/expiry.js +41 -0
- package/lib/commonjs/repeat/expiry.js.map +1 -0
- package/lib/commonjs/repeat/index.js +100 -0
- package/lib/commonjs/repeat/index.js.map +1 -0
- package/lib/commonjs/repeat/marker.js +58 -0
- package/lib/commonjs/repeat/marker.js.map +1 -0
- package/lib/commonjs/repeat/place.js +83 -0
- package/lib/commonjs/repeat/place.js.map +1 -0
- package/lib/commonjs/schedule/anchor.js +243 -0
- package/lib/commonjs/schedule/anchor.js.map +1 -0
- package/lib/commonjs/schedule/index.js +142 -0
- package/lib/commonjs/schedule/index.js.map +1 -0
- package/lib/commonjs/schedule/partition.js +59 -0
- package/lib/commonjs/schedule/partition.js.map +1 -0
- package/lib/commonjs/schedule/resolve-moment.js +72 -0
- package/lib/commonjs/schedule/resolve-moment.js.map +1 -0
- package/lib/commonjs/schedule/validate-content.js +101 -0
- package/lib/commonjs/schedule/validate-content.js.map +1 -0
- package/lib/commonjs/schedule/validate-identifier.js +126 -0
- package/lib/commonjs/schedule/validate-identifier.js.map +1 -0
- package/lib/commonjs/schedule/writer.js +44 -0
- package/lib/commonjs/schedule/writer.js.map +1 -0
- package/lib/commonjs/state/caps.js +101 -0
- package/lib/commonjs/state/caps.js.map +1 -0
- package/lib/commonjs/state/dedup-ledger.js +39 -0
- package/lib/commonjs/state/dedup-ledger.js.map +1 -0
- package/lib/commonjs/state/interaction-buffer.js +98 -0
- package/lib/commonjs/state/interaction-buffer.js.map +1 -0
- package/lib/commonjs/state/mmkv-store.js +75 -0
- package/lib/commonjs/state/mmkv-store.js.map +1 -0
- package/lib/commonjs/state/permission-history.js +64 -0
- package/lib/commonjs/state/permission-history.js.map +1 -0
- package/lib/commonjs/state/record.js +269 -0
- package/lib/commonjs/state/record.js.map +1 -0
- package/lib/commonjs/state/reset.js +37 -0
- package/lib/commonjs/state/reset.js.map +1 -0
- package/lib/commonjs/state/series-ledger.js +71 -0
- package/lib/commonjs/state/series-ledger.js.map +1 -0
- package/lib/commonjs/state/store.js +39 -0
- package/lib/commonjs/state/store.js.map +1 -0
- package/lib/commonjs/testing/conformance/index.js +218 -0
- package/lib/commonjs/testing/conformance/index.js.map +1 -0
- package/lib/commonjs/testing/fake-engine.js +338 -0
- package/lib/commonjs/testing/fake-engine.js.map +1 -0
- package/lib/commonjs/testing/fake-provider.js +93 -0
- package/lib/commonjs/testing/fake-provider.js.map +1 -0
- package/lib/commonjs/testing/faults.js +59 -0
- package/lib/commonjs/testing/faults.js.map +1 -0
- package/lib/commonjs/testing/index.js +54 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/commonjs/testing/measure.js +298 -0
- package/lib/commonjs/testing/measure.js.map +1 -0
- package/lib/module/advanced.js +29 -0
- package/lib/module/advanced.js.map +1 -0
- package/lib/module/channel/migrate.js +242 -0
- package/lib/module/channel/migrate.js.map +1 -0
- package/lib/module/channel/tone-map.js +112 -0
- package/lib/module/channel/tone-map.js.map +1 -0
- package/lib/module/channel/validate-tone.js +57 -0
- package/lib/module/channel/validate-tone.js.map +1 -0
- package/lib/module/contract/channel.js +48 -0
- package/lib/module/contract/channel.js.map +1 -0
- package/lib/module/contract/diagnostics.js +21 -0
- package/lib/module/contract/diagnostics.js.map +1 -0
- package/lib/module/contract/errors.js +119 -0
- package/lib/module/contract/errors.js.map +1 -0
- package/lib/module/contract/hash.js +29 -0
- package/lib/module/contract/hash.js.map +1 -0
- package/lib/module/contract/index.js +13 -0
- package/lib/module/contract/index.js.map +1 -0
- package/lib/module/contract/interaction.js +33 -0
- package/lib/module/contract/interaction.js.map +1 -0
- package/lib/module/contract/notification.js +38 -0
- package/lib/module/contract/notification.js.map +1 -0
- package/lib/module/contract/permission.js +2 -0
- package/lib/module/contract/permission.js.map +1 -0
- package/lib/module/contract/reconcile.js +4 -0
- package/lib/module/contract/reconcile.js.map +1 -0
- package/lib/module/contract/recurrence.js +49 -0
- package/lib/module/contract/recurrence.js.map +1 -0
- package/lib/module/diagnostics/burst.js +85 -0
- package/lib/module/diagnostics/burst.js.map +1 -0
- package/lib/module/diagnostics/events.js +58 -0
- package/lib/module/diagnostics/events.js.map +1 -0
- package/lib/module/diagnostics/redact.js +44 -0
- package/lib/module/diagnostics/redact.js.map +1 -0
- package/lib/module/diagnostics/snapshot.js +64 -0
- package/lib/module/diagnostics/snapshot.js.map +1 -0
- package/lib/module/engine/adapter.js +4 -0
- package/lib/module/engine/adapter.js.map +1 -0
- package/lib/module/engine/codec.js +79 -0
- package/lib/module/engine/codec.js.map +1 -0
- package/lib/module/engine/notify-kit/events.js +139 -0
- package/lib/module/engine/notify-kit/events.js.map +1 -0
- package/lib/module/engine/notify-kit/module.js +113 -0
- package/lib/module/engine/notify-kit/module.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/android.js +155 -0
- package/lib/module/engine/notify-kit/platform/android.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/index.js +51 -0
- package/lib/module/engine/notify-kit/platform/index.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/ios.js +49 -0
- package/lib/module/engine/notify-kit/platform/ios.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/types.js +4 -0
- package/lib/module/engine/notify-kit/platform/types.js.map +1 -0
- package/lib/module/engine/notify-kit-engine.js +257 -0
- package/lib/module/engine/notify-kit-engine.js.map +1 -0
- package/lib/module/index.js +98 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/initialize.js +182 -0
- package/lib/module/initialize.js.map +1 -0
- package/lib/module/interaction/index.js +116 -0
- package/lib/module/interaction/index.js.map +1 -0
- package/lib/module/maintenance/cycle.js +102 -0
- package/lib/module/maintenance/cycle.js.map +1 -0
- package/lib/module/maintenance/permission-refresh.js +34 -0
- package/lib/module/maintenance/permission-refresh.js.map +1 -0
- package/lib/module/maintenance/reanchor.js +94 -0
- package/lib/module/maintenance/reanchor.js.map +1 -0
- package/lib/module/maintenance/toggle.js +45 -0
- package/lib/module/maintenance/toggle.js.map +1 -0
- package/lib/module/maintenance/verify.js +65 -0
- package/lib/module/maintenance/verify.js.map +1 -0
- package/lib/module/maintenance/window-refresh.js +48 -0
- package/lib/module/maintenance/window-refresh.js.map +1 -0
- package/lib/module/notifications.js +157 -0
- package/lib/module/notifications.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/permission/index.js +178 -0
- package/lib/module/permission/index.js.map +1 -0
- package/lib/module/permission/state.js +83 -0
- package/lib/module/permission/state.js.map +1 -0
- package/lib/module/push/envelope.js +137 -0
- package/lib/module/push/envelope.js.map +1 -0
- package/lib/module/push/fcm-provider.js +119 -0
- package/lib/module/push/fcm-provider.js.map +1 -0
- package/lib/module/push/gate.js +158 -0
- package/lib/module/push/gate.js.map +1 -0
- package/lib/module/push/index.js +16 -0
- package/lib/module/push/index.js.map +1 -0
- package/lib/module/push/instructions.js +97 -0
- package/lib/module/push/instructions.js.map +1 -0
- package/lib/module/push/provider-adapter.js +4 -0
- package/lib/module/push/provider-adapter.js.map +1 -0
- package/lib/module/push/signout.js +51 -0
- package/lib/module/push/signout.js.map +1 -0
- package/lib/module/reconcile/chunk.js +43 -0
- package/lib/module/reconcile/chunk.js.map +1 -0
- package/lib/module/reconcile/diff.js +101 -0
- package/lib/module/reconcile/diff.js.map +1 -0
- package/lib/module/reconcile/duplicates.js +56 -0
- package/lib/module/reconcile/duplicates.js.map +1 -0
- package/lib/module/reconcile/index.js +161 -0
- package/lib/module/reconcile/index.js.map +1 -0
- package/lib/module/reconcile/truncate.js +46 -0
- package/lib/module/reconcile/truncate.js.map +1 -0
- package/lib/module/recurrence/clock-guard.js +60 -0
- package/lib/module/recurrence/clock-guard.js.map +1 -0
- package/lib/module/recurrence/expand.js +248 -0
- package/lib/module/recurrence/expand.js.map +1 -0
- package/lib/module/recurrence/index.js +208 -0
- package/lib/module/recurrence/index.js.map +1 -0
- package/lib/module/repeat/expiry.js +37 -0
- package/lib/module/repeat/expiry.js.map +1 -0
- package/lib/module/repeat/index.js +67 -0
- package/lib/module/repeat/index.js.map +1 -0
- package/lib/module/repeat/marker.js +51 -0
- package/lib/module/repeat/marker.js.map +1 -0
- package/lib/module/repeat/place.js +79 -0
- package/lib/module/repeat/place.js.map +1 -0
- package/lib/module/schedule/anchor.js +234 -0
- package/lib/module/schedule/anchor.js.map +1 -0
- package/lib/module/schedule/index.js +137 -0
- package/lib/module/schedule/index.js.map +1 -0
- package/lib/module/schedule/partition.js +53 -0
- package/lib/module/schedule/partition.js.map +1 -0
- package/lib/module/schedule/resolve-moment.js +66 -0
- package/lib/module/schedule/resolve-moment.js.map +1 -0
- package/lib/module/schedule/validate-content.js +95 -0
- package/lib/module/schedule/validate-content.js.map +1 -0
- package/lib/module/schedule/validate-identifier.js +119 -0
- package/lib/module/schedule/validate-identifier.js.map +1 -0
- package/lib/module/schedule/writer.js +40 -0
- package/lib/module/schedule/writer.js.map +1 -0
- package/lib/module/state/caps.js +96 -0
- package/lib/module/state/caps.js.map +1 -0
- package/lib/module/state/dedup-ledger.js +34 -0
- package/lib/module/state/dedup-ledger.js.map +1 -0
- package/lib/module/state/interaction-buffer.js +92 -0
- package/lib/module/state/interaction-buffer.js.map +1 -0
- package/lib/module/state/mmkv-store.js +71 -0
- package/lib/module/state/mmkv-store.js.map +1 -0
- package/lib/module/state/permission-history.js +56 -0
- package/lib/module/state/permission-history.js.map +1 -0
- package/lib/module/state/record.js +264 -0
- package/lib/module/state/record.js.map +1 -0
- package/lib/module/state/reset.js +32 -0
- package/lib/module/state/reset.js.map +1 -0
- package/lib/module/state/series-ledger.js +62 -0
- package/lib/module/state/series-ledger.js.map +1 -0
- package/lib/module/state/store.js +35 -0
- package/lib/module/state/store.js.map +1 -0
- package/lib/module/testing/conformance/index.js +214 -0
- package/lib/module/testing/conformance/index.js.map +1 -0
- package/lib/module/testing/fake-engine.js +335 -0
- package/lib/module/testing/fake-engine.js.map +1 -0
- package/lib/module/testing/fake-provider.js +89 -0
- package/lib/module/testing/fake-provider.js.map +1 -0
- package/lib/module/testing/faults.js +55 -0
- package/lib/module/testing/faults.js.map +1 -0
- package/lib/module/testing/index.js +19 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/module/testing/measure.js +294 -0
- package/lib/module/testing/measure.js.map +1 -0
- package/lib/typescript/commonjs/advanced.d.ts +36 -0
- package/lib/typescript/commonjs/advanced.d.ts.map +1 -0
- package/lib/typescript/commonjs/channel/migrate.d.ts +38 -0
- package/lib/typescript/commonjs/channel/migrate.d.ts.map +1 -0
- package/lib/typescript/commonjs/channel/tone-map.d.ts +34 -0
- package/lib/typescript/commonjs/channel/tone-map.d.ts.map +1 -0
- package/lib/typescript/commonjs/channel/validate-tone.d.ts +23 -0
- package/lib/typescript/commonjs/channel/validate-tone.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/channel.d.ts +185 -0
- package/lib/typescript/commonjs/contract/channel.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/diagnostics.d.ts +92 -0
- package/lib/typescript/commonjs/contract/diagnostics.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/errors.d.ts +91 -0
- package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/hash.d.ts +14 -0
- package/lib/typescript/commonjs/contract/hash.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/index.d.ts +10 -0
- package/lib/typescript/commonjs/contract/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/interaction.d.ts +53 -0
- package/lib/typescript/commonjs/contract/interaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/notification.d.ts +110 -0
- package/lib/typescript/commonjs/contract/notification.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/permission.d.ts +49 -0
- package/lib/typescript/commonjs/contract/permission.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/reconcile.d.ts +82 -0
- package/lib/typescript/commonjs/contract/reconcile.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/recurrence.d.ts +118 -0
- package/lib/typescript/commonjs/contract/recurrence.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/burst.d.ts +39 -0
- package/lib/typescript/commonjs/diagnostics/burst.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts +28 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts +22 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/snapshot.d.ts +40 -0
- package/lib/typescript/commonjs/diagnostics/snapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/adapter.d.ts +172 -0
- package/lib/typescript/commonjs/engine/adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/codec.d.ts +20 -0
- package/lib/typescript/commonjs/engine/codec.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/events.d.ts +37 -0
- package/lib/typescript/commonjs/engine/notify-kit/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/module.d.ts +103 -0
- package/lib/typescript/commonjs/engine/notify-kit/module.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/android.d.ts +3 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/android.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/index.d.ts +12 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/ios.d.ts +3 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/types.d.ts +33 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit-engine.d.ts +25 -0
- package/lib/typescript/commonjs/engine/notify-kit-engine.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +106 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/initialize.d.ts +74 -0
- package/lib/typescript/commonjs/initialize.d.ts.map +1 -0
- package/lib/typescript/commonjs/interaction/index.d.ts +53 -0
- package/lib/typescript/commonjs/interaction/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/cycle.d.ts +77 -0
- package/lib/typescript/commonjs/maintenance/cycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/permission-refresh.d.ts +19 -0
- package/lib/typescript/commonjs/maintenance/permission-refresh.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/reanchor.d.ts +26 -0
- package/lib/typescript/commonjs/maintenance/reanchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/toggle.d.ts +35 -0
- package/lib/typescript/commonjs/maintenance/toggle.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/verify.d.ts +32 -0
- package/lib/typescript/commonjs/maintenance/verify.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/window-refresh.d.ts +29 -0
- package/lib/typescript/commonjs/maintenance/window-refresh.d.ts.map +1 -0
- package/lib/typescript/commonjs/notifications.d.ts +78 -0
- package/lib/typescript/commonjs/notifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/permission/index.d.ts +57 -0
- package/lib/typescript/commonjs/permission/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/permission/state.d.ts +41 -0
- package/lib/typescript/commonjs/permission/state.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/envelope.d.ts +33 -0
- package/lib/typescript/commonjs/push/envelope.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/fcm-provider.d.ts +43 -0
- package/lib/typescript/commonjs/push/fcm-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/gate.d.ts +57 -0
- package/lib/typescript/commonjs/push/gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/index.d.ts +19 -0
- package/lib/typescript/commonjs/push/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/instructions.d.ts +45 -0
- package/lib/typescript/commonjs/push/instructions.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/provider-adapter.d.ts +50 -0
- package/lib/typescript/commonjs/push/provider-adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/signout.d.ts +33 -0
- package/lib/typescript/commonjs/push/signout.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/chunk.d.ts +24 -0
- package/lib/typescript/commonjs/reconcile/chunk.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/diff.d.ts +54 -0
- package/lib/typescript/commonjs/reconcile/diff.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/duplicates.d.ts +32 -0
- package/lib/typescript/commonjs/reconcile/duplicates.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/index.d.ts +35 -0
- package/lib/typescript/commonjs/reconcile/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/truncate.d.ts +26 -0
- package/lib/typescript/commonjs/reconcile/truncate.d.ts.map +1 -0
- package/lib/typescript/commonjs/recurrence/clock-guard.d.ts +37 -0
- package/lib/typescript/commonjs/recurrence/clock-guard.d.ts.map +1 -0
- package/lib/typescript/commonjs/recurrence/expand.d.ts +75 -0
- package/lib/typescript/commonjs/recurrence/expand.d.ts.map +1 -0
- package/lib/typescript/commonjs/recurrence/index.d.ts +40 -0
- package/lib/typescript/commonjs/recurrence/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/expiry.d.ts +23 -0
- package/lib/typescript/commonjs/repeat/expiry.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/index.d.ts +49 -0
- package/lib/typescript/commonjs/repeat/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/marker.d.ts +36 -0
- package/lib/typescript/commonjs/repeat/marker.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/place.d.ts +39 -0
- package/lib/typescript/commonjs/repeat/place.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/anchor.d.ts +118 -0
- package/lib/typescript/commonjs/schedule/anchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/index.d.ts +40 -0
- package/lib/typescript/commonjs/schedule/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/partition.d.ts +29 -0
- package/lib/typescript/commonjs/schedule/partition.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/resolve-moment.d.ts +35 -0
- package/lib/typescript/commonjs/schedule/resolve-moment.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/validate-content.d.ts +42 -0
- package/lib/typescript/commonjs/schedule/validate-content.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/validate-identifier.d.ts +30 -0
- package/lib/typescript/commonjs/schedule/validate-identifier.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/writer.d.ts +36 -0
- package/lib/typescript/commonjs/schedule/writer.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/caps.d.ts +51 -0
- package/lib/typescript/commonjs/state/caps.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/dedup-ledger.d.ts +21 -0
- package/lib/typescript/commonjs/state/dedup-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/interaction-buffer.d.ts +30 -0
- package/lib/typescript/commonjs/state/interaction-buffer.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/mmkv-store.d.ts +33 -0
- package/lib/typescript/commonjs/state/mmkv-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/permission-history.d.ts +20 -0
- package/lib/typescript/commonjs/state/permission-history.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/record.d.ts +134 -0
- package/lib/typescript/commonjs/state/record.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/reset.d.ts +22 -0
- package/lib/typescript/commonjs/state/reset.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/series-ledger.d.ts +47 -0
- package/lib/typescript/commonjs/state/series-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/store.d.ts +20 -0
- package/lib/typescript/commonjs/state/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts +32 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/fake-engine.d.ts +91 -0
- package/lib/typescript/commonjs/testing/fake-engine.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/fake-provider.d.ts +35 -0
- package/lib/typescript/commonjs/testing/fake-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/faults.d.ts +38 -0
- package/lib/typescript/commonjs/testing/faults.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +22 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/measure.d.ts +59 -0
- package/lib/typescript/commonjs/testing/measure.d.ts.map +1 -0
- package/lib/typescript/module/advanced.d.ts +36 -0
- package/lib/typescript/module/advanced.d.ts.map +1 -0
- package/lib/typescript/module/channel/migrate.d.ts +38 -0
- package/lib/typescript/module/channel/migrate.d.ts.map +1 -0
- package/lib/typescript/module/channel/tone-map.d.ts +34 -0
- package/lib/typescript/module/channel/tone-map.d.ts.map +1 -0
- package/lib/typescript/module/channel/validate-tone.d.ts +23 -0
- package/lib/typescript/module/channel/validate-tone.d.ts.map +1 -0
- package/lib/typescript/module/contract/channel.d.ts +185 -0
- package/lib/typescript/module/contract/channel.d.ts.map +1 -0
- package/lib/typescript/module/contract/diagnostics.d.ts +92 -0
- package/lib/typescript/module/contract/diagnostics.d.ts.map +1 -0
- package/lib/typescript/module/contract/errors.d.ts +91 -0
- package/lib/typescript/module/contract/errors.d.ts.map +1 -0
- package/lib/typescript/module/contract/hash.d.ts +14 -0
- package/lib/typescript/module/contract/hash.d.ts.map +1 -0
- package/lib/typescript/module/contract/index.d.ts +10 -0
- package/lib/typescript/module/contract/index.d.ts.map +1 -0
- package/lib/typescript/module/contract/interaction.d.ts +53 -0
- package/lib/typescript/module/contract/interaction.d.ts.map +1 -0
- package/lib/typescript/module/contract/notification.d.ts +110 -0
- package/lib/typescript/module/contract/notification.d.ts.map +1 -0
- package/lib/typescript/module/contract/permission.d.ts +49 -0
- package/lib/typescript/module/contract/permission.d.ts.map +1 -0
- package/lib/typescript/module/contract/reconcile.d.ts +82 -0
- package/lib/typescript/module/contract/reconcile.d.ts.map +1 -0
- package/lib/typescript/module/contract/recurrence.d.ts +118 -0
- package/lib/typescript/module/contract/recurrence.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/burst.d.ts +39 -0
- package/lib/typescript/module/diagnostics/burst.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/events.d.ts +28 -0
- package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/redact.d.ts +22 -0
- package/lib/typescript/module/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/snapshot.d.ts +40 -0
- package/lib/typescript/module/diagnostics/snapshot.d.ts.map +1 -0
- package/lib/typescript/module/engine/adapter.d.ts +172 -0
- package/lib/typescript/module/engine/adapter.d.ts.map +1 -0
- package/lib/typescript/module/engine/codec.d.ts +20 -0
- package/lib/typescript/module/engine/codec.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/events.d.ts +37 -0
- package/lib/typescript/module/engine/notify-kit/events.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/module.d.ts +103 -0
- package/lib/typescript/module/engine/notify-kit/module.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/android.d.ts +3 -0
- package/lib/typescript/module/engine/notify-kit/platform/android.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/index.d.ts +12 -0
- package/lib/typescript/module/engine/notify-kit/platform/index.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/ios.d.ts +3 -0
- package/lib/typescript/module/engine/notify-kit/platform/ios.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/types.d.ts +33 -0
- package/lib/typescript/module/engine/notify-kit/platform/types.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit-engine.d.ts +25 -0
- package/lib/typescript/module/engine/notify-kit-engine.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +106 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/initialize.d.ts +74 -0
- package/lib/typescript/module/initialize.d.ts.map +1 -0
- package/lib/typescript/module/interaction/index.d.ts +53 -0
- package/lib/typescript/module/interaction/index.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/cycle.d.ts +77 -0
- package/lib/typescript/module/maintenance/cycle.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/permission-refresh.d.ts +19 -0
- package/lib/typescript/module/maintenance/permission-refresh.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/reanchor.d.ts +26 -0
- package/lib/typescript/module/maintenance/reanchor.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/toggle.d.ts +35 -0
- package/lib/typescript/module/maintenance/toggle.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/verify.d.ts +32 -0
- package/lib/typescript/module/maintenance/verify.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/window-refresh.d.ts +29 -0
- package/lib/typescript/module/maintenance/window-refresh.d.ts.map +1 -0
- package/lib/typescript/module/notifications.d.ts +78 -0
- package/lib/typescript/module/notifications.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/permission/index.d.ts +57 -0
- package/lib/typescript/module/permission/index.d.ts.map +1 -0
- package/lib/typescript/module/permission/state.d.ts +41 -0
- package/lib/typescript/module/permission/state.d.ts.map +1 -0
- package/lib/typescript/module/push/envelope.d.ts +33 -0
- package/lib/typescript/module/push/envelope.d.ts.map +1 -0
- package/lib/typescript/module/push/fcm-provider.d.ts +43 -0
- package/lib/typescript/module/push/fcm-provider.d.ts.map +1 -0
- package/lib/typescript/module/push/gate.d.ts +57 -0
- package/lib/typescript/module/push/gate.d.ts.map +1 -0
- package/lib/typescript/module/push/index.d.ts +19 -0
- package/lib/typescript/module/push/index.d.ts.map +1 -0
- package/lib/typescript/module/push/instructions.d.ts +45 -0
- package/lib/typescript/module/push/instructions.d.ts.map +1 -0
- package/lib/typescript/module/push/provider-adapter.d.ts +50 -0
- package/lib/typescript/module/push/provider-adapter.d.ts.map +1 -0
- package/lib/typescript/module/push/signout.d.ts +33 -0
- package/lib/typescript/module/push/signout.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/chunk.d.ts +24 -0
- package/lib/typescript/module/reconcile/chunk.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/diff.d.ts +54 -0
- package/lib/typescript/module/reconcile/diff.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/duplicates.d.ts +32 -0
- package/lib/typescript/module/reconcile/duplicates.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/index.d.ts +35 -0
- package/lib/typescript/module/reconcile/index.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/truncate.d.ts +26 -0
- package/lib/typescript/module/reconcile/truncate.d.ts.map +1 -0
- package/lib/typescript/module/recurrence/clock-guard.d.ts +37 -0
- package/lib/typescript/module/recurrence/clock-guard.d.ts.map +1 -0
- package/lib/typescript/module/recurrence/expand.d.ts +75 -0
- package/lib/typescript/module/recurrence/expand.d.ts.map +1 -0
- package/lib/typescript/module/recurrence/index.d.ts +40 -0
- package/lib/typescript/module/recurrence/index.d.ts.map +1 -0
- package/lib/typescript/module/repeat/expiry.d.ts +23 -0
- package/lib/typescript/module/repeat/expiry.d.ts.map +1 -0
- package/lib/typescript/module/repeat/index.d.ts +49 -0
- package/lib/typescript/module/repeat/index.d.ts.map +1 -0
- package/lib/typescript/module/repeat/marker.d.ts +36 -0
- package/lib/typescript/module/repeat/marker.d.ts.map +1 -0
- package/lib/typescript/module/repeat/place.d.ts +39 -0
- package/lib/typescript/module/repeat/place.d.ts.map +1 -0
- package/lib/typescript/module/schedule/anchor.d.ts +118 -0
- package/lib/typescript/module/schedule/anchor.d.ts.map +1 -0
- package/lib/typescript/module/schedule/index.d.ts +40 -0
- package/lib/typescript/module/schedule/index.d.ts.map +1 -0
- package/lib/typescript/module/schedule/partition.d.ts +29 -0
- package/lib/typescript/module/schedule/partition.d.ts.map +1 -0
- package/lib/typescript/module/schedule/resolve-moment.d.ts +35 -0
- package/lib/typescript/module/schedule/resolve-moment.d.ts.map +1 -0
- package/lib/typescript/module/schedule/validate-content.d.ts +42 -0
- package/lib/typescript/module/schedule/validate-content.d.ts.map +1 -0
- package/lib/typescript/module/schedule/validate-identifier.d.ts +30 -0
- package/lib/typescript/module/schedule/validate-identifier.d.ts.map +1 -0
- package/lib/typescript/module/schedule/writer.d.ts +36 -0
- package/lib/typescript/module/schedule/writer.d.ts.map +1 -0
- package/lib/typescript/module/state/caps.d.ts +51 -0
- package/lib/typescript/module/state/caps.d.ts.map +1 -0
- package/lib/typescript/module/state/dedup-ledger.d.ts +21 -0
- package/lib/typescript/module/state/dedup-ledger.d.ts.map +1 -0
- package/lib/typescript/module/state/interaction-buffer.d.ts +30 -0
- package/lib/typescript/module/state/interaction-buffer.d.ts.map +1 -0
- package/lib/typescript/module/state/mmkv-store.d.ts +33 -0
- package/lib/typescript/module/state/mmkv-store.d.ts.map +1 -0
- package/lib/typescript/module/state/permission-history.d.ts +20 -0
- package/lib/typescript/module/state/permission-history.d.ts.map +1 -0
- package/lib/typescript/module/state/record.d.ts +134 -0
- package/lib/typescript/module/state/record.d.ts.map +1 -0
- package/lib/typescript/module/state/reset.d.ts +22 -0
- package/lib/typescript/module/state/reset.d.ts.map +1 -0
- package/lib/typescript/module/state/series-ledger.d.ts +47 -0
- package/lib/typescript/module/state/series-ledger.d.ts.map +1 -0
- package/lib/typescript/module/state/store.d.ts +20 -0
- package/lib/typescript/module/state/store.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/index.d.ts +32 -0
- package/lib/typescript/module/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/fake-engine.d.ts +91 -0
- package/lib/typescript/module/testing/fake-engine.d.ts.map +1 -0
- package/lib/typescript/module/testing/fake-provider.d.ts +35 -0
- package/lib/typescript/module/testing/fake-provider.d.ts.map +1 -0
- package/lib/typescript/module/testing/faults.d.ts +38 -0
- package/lib/typescript/module/testing/faults.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +22 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/measure.d.ts +59 -0
- package/lib/typescript/module/testing/measure.d.ts.map +1 -0
- package/package.json +74 -23
- package/skills/sdk-rn-notification/SKILL.md +6 -5
- package/src/advanced.ts +35 -0
- package/src/channel/migrate.ts +176 -158
- package/src/channel/tone-map.ts +2 -10
- package/src/contract/errors.ts +7 -0
- package/src/contract/hash.ts +26 -0
- package/src/engine/adapter.ts +21 -1
- package/src/engine/notify-kit/events.ts +155 -0
- package/src/engine/notify-kit/module.ts +148 -0
- package/src/engine/notify-kit/platform/android.ts +172 -0
- package/src/engine/notify-kit/platform/index.ts +55 -0
- package/src/engine/notify-kit/platform/ios.ts +54 -0
- package/src/engine/notify-kit/platform/types.ts +40 -0
- package/src/engine/notify-kit-engine.ts +96 -477
- package/src/index.ts +9 -0
- package/src/notifications.ts +195 -0
- package/src/permission/index.ts +65 -4
- package/src/push/fcm-provider.ts +14 -4
- package/src/push/gate.ts +27 -5
- package/src/reconcile/diff.ts +38 -27
- package/src/reconcile/index.ts +13 -4
- package/src/recurrence/index.ts +2 -1
- package/src/repeat/expiry.ts +2 -6
- package/src/repeat/index.ts +45 -1
- package/src/repeat/marker.ts +1 -22
- package/src/repeat/place.ts +74 -35
- package/src/schedule/index.ts +10 -4
- package/src/schedule/partition.ts +0 -19
- package/src/schedule/validate-identifier.ts +8 -6
- package/src/schedule/writer.ts +13 -4
- package/src/state/caps.ts +28 -3
- package/src/state/permission-history.ts +25 -0
- package/src/state/record.ts +110 -20
- package/src/testing/fake-engine.ts +17 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Duplicate identifier resolution.
|
|
3
|
+
*
|
|
4
|
+
* An identifier appearing twice in one desired set means the caller's key
|
|
5
|
+
* derivation produced two notifications for one identity. That is a bug, not a
|
|
6
|
+
* preference, so the package refuses rather than silently picking a winner.
|
|
7
|
+
*
|
|
8
|
+
* **Every** copy is rejected — no entry wins. Order-independence then follows
|
|
9
|
+
* for free rather than having to be engineered: there is no "first" or "last"
|
|
10
|
+
* to depend on.
|
|
11
|
+
*
|
|
12
|
+
* The rule applies even to byte-identical duplicates. Treating those as
|
|
13
|
+
* mergeable would require a deep-equality definition that becomes a contract of
|
|
14
|
+
* its own, and a repeated identifier is a key-derivation bug either way.
|
|
15
|
+
*/
|
|
16
|
+
import type { NotificationRequest } from '../contract/notification';
|
|
17
|
+
import type { RejectedEntry } from '../contract/reconcile';
|
|
18
|
+
export interface DuplicateSplit {
|
|
19
|
+
/** Entries whose identifier appeared exactly once. */
|
|
20
|
+
readonly unique: readonly NotificationRequest[];
|
|
21
|
+
/** One rejection record per repeated identifier, not per copy. */
|
|
22
|
+
readonly rejected: readonly RejectedEntry[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Splits a desired set into applicable entries and rejections.
|
|
26
|
+
*
|
|
27
|
+
* `existingIds` lets the rejection state whether a notification already
|
|
28
|
+
* scheduled under that identifier was left in place — without it a caller could
|
|
29
|
+
* reasonably read "rejected" as "cancelled".
|
|
30
|
+
*/
|
|
31
|
+
export declare function splitDuplicates(desired: readonly NotificationRequest[], existingIds?: ReadonlySet<string>): DuplicateSplit;
|
|
32
|
+
//# sourceMappingURL=duplicates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicates.d.ts","sourceRoot":"","sources":["../../../../src/reconcile/duplicates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,WAAW,cAAc;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChD,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,WAAW,GAAE,WAAW,CAAC,MAAM,CAAa,GAC1C,cAAc,CAmChB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reconciliation operation.
|
|
3
|
+
*
|
|
4
|
+
* A caller hands over the complete set its data implies; the package works out
|
|
5
|
+
* what to add, replace, and remove. This is **never** run automatically — only
|
|
6
|
+
* the caller knows what its data implies, and a package that guessed a desired
|
|
7
|
+
* set would cancel notifications it does not understand.
|
|
8
|
+
*
|
|
9
|
+
* Overlapping calls are serialized rather than run concurrently, because two
|
|
10
|
+
* passes interleaving their cancels and creates is exactly how duplicates
|
|
11
|
+
* appear.
|
|
12
|
+
*/
|
|
13
|
+
import type { ReconcileInput, ReconcileResult } from '../contract/reconcile';
|
|
14
|
+
import type { ResolvedTone } from '../contract/channel';
|
|
15
|
+
import type { NotificationEngineAdapter } from '../engine/adapter';
|
|
16
|
+
import { type TimeZoneReader } from '../schedule/anchor';
|
|
17
|
+
export interface ReconcileDependencies {
|
|
18
|
+
readonly engine: NotificationEngineAdapter;
|
|
19
|
+
readonly resolveTone: (toneId: string) => ResolvedTone | undefined;
|
|
20
|
+
readonly timeZone: TimeZoneReader;
|
|
21
|
+
readonly now: () => number;
|
|
22
|
+
readonly canScheduleExactly: () => boolean;
|
|
23
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
24
|
+
/** Overridable for tests that need to observe chunk boundaries. */
|
|
25
|
+
readonly chunkSize?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function createReconciler(deps: ReconcileDependencies): {
|
|
28
|
+
/**
|
|
29
|
+
* Serialized against itself: a second call waits for the first rather than
|
|
30
|
+
* interleaving with it.
|
|
31
|
+
*/
|
|
32
|
+
reconcile(input: ReconcileInput): Promise<ReconcileResult>;
|
|
33
|
+
};
|
|
34
|
+
export type Reconciler = ReturnType<typeof createReconciler>;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/reconcile/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAWvE,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IACnE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,OAAO,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;IAC3F,mEAAmE;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAcD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,qBAAqB;IAyH1D;;;OAGG;qBACoB,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;EASjE;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-ceiling truncation.
|
|
3
|
+
*
|
|
4
|
+
* iOS keeps only the 64 soonest pending notifications and silently discards the
|
|
5
|
+
* rest. The package computes the same cut deliberately, so the outcome is
|
|
6
|
+
* reported rather than discovered as missing notifications.
|
|
7
|
+
*
|
|
8
|
+
* Soonest-first is the only rule that degrades gracefully: dropped entries are
|
|
9
|
+
* not lost, they are simply not yet registered, and each window refresh
|
|
10
|
+
* registers those that have moved into range.
|
|
11
|
+
*/
|
|
12
|
+
import type { NotificationRequest } from '../contract/notification';
|
|
13
|
+
import type { TruncationReport } from '../contract/reconcile';
|
|
14
|
+
export interface TruncationOutcome {
|
|
15
|
+
readonly kept: readonly NotificationRequest[];
|
|
16
|
+
readonly report?: TruncationReport;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Keeps the `ceiling` soonest entries.
|
|
20
|
+
*
|
|
21
|
+
* Ties on the delivery instant are broken by identifier so the cut is
|
|
22
|
+
* deterministic — otherwise two runs over the same data could drop different
|
|
23
|
+
* entries and the idempotence guarantee would not hold.
|
|
24
|
+
*/
|
|
25
|
+
export declare function truncateToCeiling(desired: readonly NotificationRequest[], resolvedAt: ReadonlyMap<string, number>, ceiling: number): TruncationOutcome;
|
|
26
|
+
//# sourceMappingURL=truncate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../../../src/reconcile/truncate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,OAAO,EAAE,MAAM,GACb,iBAAiB,CAwBnB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clock-discontinuity bounding.
|
|
3
|
+
*
|
|
4
|
+
* A device clock moved backwards makes past occurrences look future again. Left
|
|
5
|
+
* alone, the next expansion would re-register every occurrence the user already
|
|
6
|
+
* received, and moving the clock forward again would fire them all at once.
|
|
7
|
+
*
|
|
8
|
+
* The guard is deliberately blunt: occurrences at or before the last horizon the
|
|
9
|
+
* series already expanded through are never re-emitted. The package would
|
|
10
|
+
* rather lose an occurrence after a manual clock change than deliver a burst of
|
|
11
|
+
* notifications for events that already happened.
|
|
12
|
+
*/
|
|
13
|
+
import type { Occurrence } from './expand';
|
|
14
|
+
/** A jump larger than this is treated as a clock change rather than ordinary drift. */
|
|
15
|
+
export declare const CLOCK_DISCONTINUITY_THRESHOLD_MS: number;
|
|
16
|
+
export interface ClockGuardInput {
|
|
17
|
+
readonly occurrences: readonly Occurrence[];
|
|
18
|
+
/** Horizon this series had already expanded through before now. */
|
|
19
|
+
readonly previousHorizon: number | undefined;
|
|
20
|
+
readonly now: number;
|
|
21
|
+
/** The clock reading when the series was last expanded, if known. */
|
|
22
|
+
readonly previousNow: number | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface ClockGuardResult {
|
|
25
|
+
readonly occurrences: readonly Occurrence[];
|
|
26
|
+
readonly suppressed: number;
|
|
27
|
+
readonly discontinuity: 'none' | 'backwards' | 'forwards';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Drops occurrences that a clock discontinuity would otherwise resurrect.
|
|
31
|
+
*
|
|
32
|
+
* Forward jumps are detected and reported but not filtered: an occurrence that
|
|
33
|
+
* became due because time genuinely passed is legitimate, and the platform's
|
|
34
|
+
* own delivery is the right place for it to be resolved.
|
|
35
|
+
*/
|
|
36
|
+
export declare function guardAgainstClockChange(input: ClockGuardInput): ClockGuardResult;
|
|
37
|
+
//# sourceMappingURL=clock-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock-guard.d.ts","sourceRoot":"","sources":["../../../../src/recurrence/clock-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,uFAAuF;AACvF,eAAO,MAAM,gCAAgC,QAAiB,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,mEAAmE;IACnE,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;CAC1D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAgChF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recurrence expansion.
|
|
3
|
+
*
|
|
4
|
+
* Written first-party rather than delegated to an RFC 5545 library, because the
|
|
5
|
+
* daylight-saving rules here are specified behaviour (FR-008) rather than a
|
|
6
|
+
* dependency's opinion, and because expansion must be provable with no device.
|
|
7
|
+
*
|
|
8
|
+
* Determinism is the hard requirement: the same rule, anchoring mode, zone, and
|
|
9
|
+
* evaluation moment must produce exactly the same occurrences in the same order
|
|
10
|
+
* on every run and on both platforms. Without that, reconciliation could not be
|
|
11
|
+
* idempotent over a recurring series.
|
|
12
|
+
*/
|
|
13
|
+
import type { RecurrenceRule, LookaheadConfig } from '../contract/recurrence';
|
|
14
|
+
import type { AnchoringMode } from '../contract/notification';
|
|
15
|
+
import { type WallClockParts } from '../schedule/anchor';
|
|
16
|
+
export interface Occurrence {
|
|
17
|
+
/** Derived from the series id and the occurrence's calendar slot — never random. */
|
|
18
|
+
readonly id: string;
|
|
19
|
+
/** The calendar slot, `YYYYMMDDTHHmm`. Orders occurrences and survives a zone change. */
|
|
20
|
+
readonly key: string;
|
|
21
|
+
readonly seriesId: string;
|
|
22
|
+
readonly at: number;
|
|
23
|
+
readonly anchoring: AnchoringMode;
|
|
24
|
+
/** True when an earlier expansion already counted this occurrence. */
|
|
25
|
+
readonly previouslyEmitted: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The calendar slot of an occurrence: the date and clock time the rule asked
|
|
29
|
+
* for, in the frame the series is anchored in. Fixed-width, so comparing two
|
|
30
|
+
* keys as strings compares them in time.
|
|
31
|
+
*/
|
|
32
|
+
export declare function occurrenceKey(parts: WallClockParts): string;
|
|
33
|
+
/**
|
|
34
|
+
* Occurrence identity.
|
|
35
|
+
*
|
|
36
|
+
* Derived from the series and the calendar slot, not the instant. Re-expanding
|
|
37
|
+
* the same series produces the same identifiers, which is what lets a refresh
|
|
38
|
+
* recognize an occurrence it already scheduled. Until 0.4.0 the instant was
|
|
39
|
+
* used, so after a time-zone change re-anchoring kept the old identifier while
|
|
40
|
+
* the window refresh derived a new one, and the occurrence was scheduled twice.
|
|
41
|
+
*/
|
|
42
|
+
export declare function occurrenceId(seriesId: string, slot: WallClockParts | string): string;
|
|
43
|
+
export interface ExpandInput {
|
|
44
|
+
readonly rule: RecurrenceRule;
|
|
45
|
+
/** Occurrences strictly after this instant are produced. */
|
|
46
|
+
readonly from: number;
|
|
47
|
+
readonly lookahead: LookaheadConfig;
|
|
48
|
+
/** Zone the series is anchored against. Ignored for absolute anchoring. */
|
|
49
|
+
readonly timeZone: string;
|
|
50
|
+
/** How many occurrences the series has already emitted, for count-limited rules. */
|
|
51
|
+
readonly alreadyEmitted?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Key of the latest occurrence an earlier expansion emitted. Occurrences at or
|
|
54
|
+
* before it are produced again — they are still in the window — but are not
|
|
55
|
+
* counted again. Counting them on every refresh is what ended count-limited
|
|
56
|
+
* series early.
|
|
57
|
+
*/
|
|
58
|
+
readonly lastEmittedKey?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ExpandResult {
|
|
61
|
+
readonly occurrences: readonly Occurrence[];
|
|
62
|
+
/** The horizon expansion reached. */
|
|
63
|
+
readonly expandedThrough: number;
|
|
64
|
+
/** True when the series produced its final occurrence. */
|
|
65
|
+
readonly exhausted: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Expands a rule inside the lookahead window.
|
|
69
|
+
*
|
|
70
|
+
* Bounded by both a duration and a count, because either alone fails: a
|
|
71
|
+
* duration alone lets a frequent series exhaust the platform ceiling, and a
|
|
72
|
+
* count alone leaves an annual series scheduled a decade out.
|
|
73
|
+
*/
|
|
74
|
+
export declare function expand(input: ExpandInput): ExpandResult;
|
|
75
|
+
//# sourceMappingURL=expand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/recurrence/expand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACX,cAAc,EAKd,eAAe,EAEf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvF,MAAM,WAAW,UAAU;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,sEAAsE;IACtE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;CACpC;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAEpF;AAmGD,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,qCAAqC;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAgEvD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Series registration and the lookahead window.
|
|
3
|
+
*
|
|
4
|
+
* A caller declares a rule once. The package expands it inside a finite window
|
|
5
|
+
* and refreshes that window on its own, because only it knows when the horizon
|
|
6
|
+
* has moved — that is the one piece of recurrence knowledge the consumer does
|
|
7
|
+
* not have.
|
|
8
|
+
*
|
|
9
|
+
* Occurrences carry derived identifiers, so re-expanding a series recognises
|
|
10
|
+
* what it already scheduled instead of creating duplicates. That is what makes
|
|
11
|
+
* a window refresh with nothing to do cost zero platform operations.
|
|
12
|
+
*
|
|
13
|
+
* Occurrences are written through the shared `ScheduleWriter`, like every other
|
|
14
|
+
* consumer notification, so a repeating tone gets its stop marker and the
|
|
15
|
+
* platform ceiling is respected here too.
|
|
16
|
+
*/
|
|
17
|
+
import type { RecurrenceRule, SeriesResult, SeriesSummary, LookaheadConfig } from '../contract/recurrence';
|
|
18
|
+
import type { ResolvedTone } from '../contract/channel';
|
|
19
|
+
import type { NotificationEngineAdapter } from '../engine/adapter';
|
|
20
|
+
import type { StateManager } from '../state/record';
|
|
21
|
+
import { type TimeZoneReader } from '../schedule/anchor';
|
|
22
|
+
export interface RecurrenceDependencies {
|
|
23
|
+
readonly engine: NotificationEngineAdapter;
|
|
24
|
+
readonly state: StateManager;
|
|
25
|
+
readonly resolveTone: (toneId: string) => ResolvedTone | undefined;
|
|
26
|
+
readonly timeZone: TimeZoneReader;
|
|
27
|
+
readonly now: () => number;
|
|
28
|
+
readonly lookahead: LookaheadConfig;
|
|
29
|
+
readonly canScheduleExactly: () => boolean;
|
|
30
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare function createRecurrence(deps: RecurrenceDependencies): {
|
|
33
|
+
registerSeries(rule: RecurrenceRule): Promise<SeriesResult>;
|
|
34
|
+
/** Re-expands a tracked series. Called by the window-refresh maintenance step. */
|
|
35
|
+
refreshSeries(rule: RecurrenceRule): Promise<SeriesResult>;
|
|
36
|
+
cancelSeries(seriesId: string): Promise<readonly string[]>;
|
|
37
|
+
listSeries(): Promise<readonly SeriesSummary[]>;
|
|
38
|
+
};
|
|
39
|
+
export type Recurrence = ReturnType<typeof createRecurrence>;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/recurrence/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACX,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AActE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IACnE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,OAAO,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;AAkCD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,sBAAsB;yBAkJhC,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAKjE,kFAAkF;wBACxD,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;2BAInC,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;kBAgB5C,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC;EAYtD;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeat expiry.
|
|
3
|
+
*
|
|
4
|
+
* When a stop marker is delivered, the alert it guards has run its declared
|
|
5
|
+
* course. This handler ends the sound and leaves the notification exactly where
|
|
6
|
+
* it is, then removes the marker.
|
|
7
|
+
*
|
|
8
|
+
* Nothing here imports the engine. It talks to the port, which is what lets the
|
|
9
|
+
* whole mechanism be proven on a virtual clock with no device.
|
|
10
|
+
*/
|
|
11
|
+
import type { DeliveryEvent, NotificationEngineAdapter } from '../engine/adapter';
|
|
12
|
+
export interface RepeatExpiryDependencies {
|
|
13
|
+
readonly engine: NotificationEngineAdapter;
|
|
14
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface RepeatExpiryHandler {
|
|
17
|
+
/** Reacts to one delivery. Ignores anything that is not a stop marker. */
|
|
18
|
+
handle(event: DeliveryEvent): Promise<void>;
|
|
19
|
+
/** Removes the marker guarding a target, when the target is cancelled or replaced. */
|
|
20
|
+
release(targetId: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare function createRepeatExpiryHandler(deps: RepeatExpiryDependencies): RepeatExpiryHandler;
|
|
23
|
+
//# sourceMappingURL=expiry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expiry.d.ts","sourceRoot":"","sources":["../../../../src/repeat/expiry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGlF,MAAM,WAAW,wBAAwB;IACxC,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,WAAW,mBAAmB;IACnC,0EAA0E;IAC1E,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,sFAAsF;IACtF,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,wBAAwB,GAAG,mBAAmB,CAsB7F"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeat expiry — bounding an alert that repeats until it is handled.
|
|
3
|
+
*
|
|
4
|
+
* The one piece of this package a consumer has to wire up themselves. The
|
|
5
|
+
* engine registers its background task at module scope, outside the React tree,
|
|
6
|
+
* and no library can perform that registration on an app's behalf.
|
|
7
|
+
*
|
|
8
|
+
* An app that declares no repeating tone needs none of this.
|
|
9
|
+
*/
|
|
10
|
+
import type { InteractionEvent } from '../contract/interaction';
|
|
11
|
+
import type { NotificationEngineAdapter } from '../engine/adapter';
|
|
12
|
+
import type { StateStore } from '../state/store';
|
|
13
|
+
export { createRepeatExpiryHandler } from './expiry';
|
|
14
|
+
export type { RepeatExpiryHandler, RepeatExpiryDependencies } from './expiry';
|
|
15
|
+
export { REPEAT_STOP_PREFIX, isRepeatStopId, markerIdFor, repeatStopFor } from './marker';
|
|
16
|
+
export interface BackgroundHandlerRegistration {
|
|
17
|
+
readonly engine: NotificationEngineAdapter;
|
|
18
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Handles a tap, action or dismissal that arrives while no part of the app is
|
|
21
|
+
* listening — typically a background action in a process the system started
|
|
22
|
+
* just for it (0.6.0). Runs inside the platform's background window, so keep
|
|
23
|
+
* it short. When the app's own `onInteraction` handlers are alive they get the
|
|
24
|
+
* event instead, with `appState: 'background'`.
|
|
25
|
+
*/
|
|
26
|
+
readonly onInteraction?: (event: InteractionEvent) => Promise<void> | void;
|
|
27
|
+
/**
|
|
28
|
+
* Where to keep an interaction nobody handled, so `onInteraction` delivers it
|
|
29
|
+
* when the app next starts: the same store the runtime uses
|
|
30
|
+
* (`createMmkvStore()`). Used when `onInteraction` is absent or throws.
|
|
31
|
+
*/
|
|
32
|
+
readonly store?: StateStore;
|
|
33
|
+
/** The clock for what is kept. Defaults to the system clock; injected in tests. */
|
|
34
|
+
readonly now?: () => number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Registers the handler that ends a repeating alert while the app is dead.
|
|
38
|
+
*
|
|
39
|
+
* Call this at module scope in `index.js`, beside the app registration — not
|
|
40
|
+
* inside a component, and not inside an effect. By the time a component mounts,
|
|
41
|
+
* the process that needed this handler has already been asked to run it.
|
|
42
|
+
*
|
|
43
|
+
* Without it a repeating alert still starts and still stops when the user
|
|
44
|
+
* handles it, but nothing ends it on a device left face-down on a table. That
|
|
45
|
+
* is the whole reason the feature exists, so `apply()` reports its absence
|
|
46
|
+
* rather than letting anyone find out the hard way.
|
|
47
|
+
*/
|
|
48
|
+
export declare function registerBackgroundNotificationHandler(registration: BackgroundHandlerRegistration): void;
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/repeat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1F,MAAM,WAAW,6BAA6B;IAC7C,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;IAC3F;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3E;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qCAAqC,CACpD,YAAY,EAAE,6BAA6B,GACzC,IAAI,CAyCN"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stop-marker identity.
|
|
3
|
+
*
|
|
4
|
+
* A repeating alert has to end without the app being alive, and no platform
|
|
5
|
+
* offers "stop the sound at time T but keep the notification". So the package
|
|
6
|
+
* schedules its own notification at T and reacts to its delivery. That
|
|
7
|
+
* notification is a *marker*: it exists to be delivered and immediately
|
|
8
|
+
* removed, never to be read.
|
|
9
|
+
*
|
|
10
|
+
* The marker's identifier is derived from the target's by hashing rather than by
|
|
11
|
+
* concatenation. Concatenation would overflow the package's 128-character
|
|
12
|
+
* identifier limit for any target already near it, and would make the marker's
|
|
13
|
+
* identity a function of a value the consumer controls — which is how a
|
|
14
|
+
* consumer identifier ends up colliding with an internal one.
|
|
15
|
+
*/
|
|
16
|
+
import type { RepeatStop } from '../engine/adapter';
|
|
17
|
+
/**
|
|
18
|
+
* Reserved identifier namespace.
|
|
19
|
+
*
|
|
20
|
+
* Rejected as a consumer identifier prefix. A consumer id colliding with a
|
|
21
|
+
* marker would not merely confuse a listing: the expiry handler cancels
|
|
22
|
+
* markers, so the collision would delete a real notification.
|
|
23
|
+
*/
|
|
24
|
+
export declare const REPEAT_STOP_PREFIX = "cms.stop:";
|
|
25
|
+
/**
|
|
26
|
+
* The marker identifier for a target notification.
|
|
27
|
+
*
|
|
28
|
+
* Two independent hashes rather than one: a single 32-bit hash collides often
|
|
29
|
+
* enough to matter once a device holds a handful of alarms, and a collision here
|
|
30
|
+
* means one alarm's marker silences the other alarm and never silences its own.
|
|
31
|
+
*/
|
|
32
|
+
export declare function markerIdFor(targetId: string): string;
|
|
33
|
+
export declare function isRepeatStopId(id: string): boolean;
|
|
34
|
+
/** Describes the stop for a target whose alert must end at a known instant. */
|
|
35
|
+
export declare function repeatStopFor(targetId: string, deliveredAt: number, forMs: number): RepeatStop;
|
|
36
|
+
//# sourceMappingURL=marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../../../src/repeat/marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAM9F"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeping a notification's stop marker in step with the notification.
|
|
3
|
+
*
|
|
4
|
+
* Shared by the scheduler and the reconciler rather than written twice. They are
|
|
5
|
+
* two doors into the same act — reconciliation is how most consumers schedule —
|
|
6
|
+
* and a bound that only existed on one path would be a bound that mostly did not
|
|
7
|
+
* exist.
|
|
8
|
+
*/
|
|
9
|
+
import type { NotificationEngineAdapter } from '../engine/adapter';
|
|
10
|
+
import type { ResolvedTone } from '../contract/channel';
|
|
11
|
+
export interface StopPlacement {
|
|
12
|
+
/**
|
|
13
|
+
* Places the marker for a repeating notification, replacing any it already
|
|
14
|
+
* had.
|
|
15
|
+
*
|
|
16
|
+
* Called on every schedule, replacements included: re-scheduling under an
|
|
17
|
+
* identifier that already had one must leave exactly one entry and exactly
|
|
18
|
+
* one marker, and the old marker's instant is no longer the right one.
|
|
19
|
+
*
|
|
20
|
+
* Nothing is placed when the tone does not repeat or the platform will not
|
|
21
|
+
* honour repetition, so a non-repeating notification costs no extra platform
|
|
22
|
+
* capacity at all.
|
|
23
|
+
*/
|
|
24
|
+
sync(targetId: string, tone: ResolvedTone, deliversAt: number): Promise<void>;
|
|
25
|
+
/** Drops any marker still guarding an identifier. */
|
|
26
|
+
release(targetId: string): Promise<void>;
|
|
27
|
+
/** How many markers are outstanding: platform capacity they hold. */
|
|
28
|
+
count(): Promise<number>;
|
|
29
|
+
/**
|
|
30
|
+
* A placement for one pass of many operations (NOT-08). It reads the
|
|
31
|
+
* outstanding markers once and keeps that view current as it places and
|
|
32
|
+
* releases, instead of reading every pending trigger across the bridge for
|
|
33
|
+
* each operation — which made a reconcile of a few hundred changes do a few
|
|
34
|
+
* hundred full reads.
|
|
35
|
+
*/
|
|
36
|
+
pass(): StopPlacement;
|
|
37
|
+
}
|
|
38
|
+
export declare function createStopPlacement(engine: NotificationEngineAdapter): StopPlacement;
|
|
39
|
+
//# sourceMappingURL=place.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../../../src/repeat/place.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,WAAW,aAAa;IAC7B;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,qDAAqD;IACrD,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,qEAAqE;IACrE,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB;;;;;;OAMG;IACH,IAAI,IAAI,aAAa,CAAC;CACtB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,aAAa,CAsEpF"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-zone anchoring and re-anchoring.
|
|
3
|
+
*
|
|
4
|
+
* Wall-clock is the default because reminders are wall-clock things: an 08:00
|
|
5
|
+
* reminder should stay 08:00 after the user crosses a time zone, and a caller
|
|
6
|
+
* who does not choose should get what their users expect rather than a silent
|
|
7
|
+
* shift.
|
|
8
|
+
*
|
|
9
|
+
* The cost is re-anchoring. When the device zone changes, every scheduled
|
|
10
|
+
* wall-clock entry must be rewritten to preserve the clock time it named, and
|
|
11
|
+
* every absolute entry must be left completely alone.
|
|
12
|
+
*
|
|
13
|
+
* The limit this cannot fix is stated rather than hidden: a wall-clock
|
|
14
|
+
* notification whose moment arrives while the app has not run since the zone
|
|
15
|
+
* changed fires at the previously anchored instant. The anchoring generation on
|
|
16
|
+
* each entry is what makes that detectable instead of invisible.
|
|
17
|
+
*/
|
|
18
|
+
import type { AnchoringMode, PendingEntry } from '../contract/notification';
|
|
19
|
+
/** Reads the platform time zone. Injected so the pure logic needs no native module. */
|
|
20
|
+
export type TimeZoneReader = () => string;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the platform zone via `react-native-localize`.
|
|
23
|
+
*
|
|
24
|
+
* Pure JavaScript is not sufficient here: `Intl.DateTimeFormat().resolvedOptions().timeZone`
|
|
25
|
+
* is documented in React Native as not reliably updating when the device zone
|
|
26
|
+
* changes, so it cannot back re-anchoring. Falls back to `Intl` only when the
|
|
27
|
+
* module is absent, which is better than failing outright.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createPlatformTimeZoneReader(): TimeZoneReader;
|
|
30
|
+
/** The calendar fields a wall-clock moment actually names. */
|
|
31
|
+
export interface WallClockParts {
|
|
32
|
+
readonly year: number;
|
|
33
|
+
readonly month: number;
|
|
34
|
+
readonly day: number;
|
|
35
|
+
readonly hour: number;
|
|
36
|
+
readonly minute: number;
|
|
37
|
+
readonly second: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether a zone name is one the runtime can actually format against.
|
|
41
|
+
*
|
|
42
|
+
* Hermes throws a hard `JSRangeErrorException: Invalid timezone name!` for a
|
|
43
|
+
* bad zone, which kills the JavaScript thread rather than returning an error.
|
|
44
|
+
* A stored anchoring generation is data that can be wrong — a corrupted record,
|
|
45
|
+
* an entry written by an older build, or a defect like the one that stored a
|
|
46
|
+
* tone id here — so it must be checked before it reaches `Intl`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isValidTimeZone(timeZone: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Decomposes an instant into the clock reading it produces in a given zone.
|
|
51
|
+
*
|
|
52
|
+
* Falls back to UTC for an unusable zone rather than throwing: a bad stored
|
|
53
|
+
* value should degrade one entry's anchoring, not crash the app.
|
|
54
|
+
*/
|
|
55
|
+
export declare function partsInZone(instant: number, timeZone: string): WallClockParts;
|
|
56
|
+
/**
|
|
57
|
+
* Finds the instant at which a zone shows the given clock reading.
|
|
58
|
+
*
|
|
59
|
+
* Two passes, because the offset itself depends on the instant: the first guess
|
|
60
|
+
* uses the offset at the naive UTC interpretation, the second corrects for a
|
|
61
|
+
* daylight-saving boundary crossed by that guess.
|
|
62
|
+
*
|
|
63
|
+
* Daylight-saving resolution, per the documented rule:
|
|
64
|
+
* - a clock time that does not exist resolves **forward** to the next valid instant;
|
|
65
|
+
* - a clock time that occurs twice resolves to its **first** occurrence, so
|
|
66
|
+
* exactly one notification results rather than two.
|
|
67
|
+
*/
|
|
68
|
+
export declare function instantForParts(parts: WallClockParts, timeZone: string): number;
|
|
69
|
+
export interface AnchorInput {
|
|
70
|
+
readonly at: number;
|
|
71
|
+
readonly anchoring?: AnchoringMode;
|
|
72
|
+
}
|
|
73
|
+
export interface AnchoredMoment {
|
|
74
|
+
readonly resolvedAt: number;
|
|
75
|
+
readonly anchoring: AnchoringMode;
|
|
76
|
+
/** The zone this was anchored against. Absent for absolute-instant moments. */
|
|
77
|
+
readonly generation?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Resolves a caller-supplied moment into a firing instant.
|
|
81
|
+
*
|
|
82
|
+
* An absolute moment passes through untouched — that is the entire distinction.
|
|
83
|
+
*/
|
|
84
|
+
export declare function anchorMoment(input: AnchorInput, timeZone: string): AnchoredMoment;
|
|
85
|
+
export interface ReAnchorPlan {
|
|
86
|
+
/** Entries whose firing instant must be rewritten, with their new instant. */
|
|
87
|
+
readonly rewrites: readonly {
|
|
88
|
+
readonly entry: PendingEntry;
|
|
89
|
+
readonly resolvedAt: number;
|
|
90
|
+
}[];
|
|
91
|
+
readonly fromZone: string | undefined;
|
|
92
|
+
readonly toZone: string;
|
|
93
|
+
readonly zoneChanged: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Entries carrying an anchoring generation the runtime cannot interpret.
|
|
96
|
+
*
|
|
97
|
+
* Left alone rather than re-anchored against a guess. Reported so a corrupted
|
|
98
|
+
* or older-build record is visible instead of quietly producing wrong firing
|
|
99
|
+
* instants.
|
|
100
|
+
*/
|
|
101
|
+
readonly unreadableGeneration: readonly string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Computes what a zone change requires.
|
|
105
|
+
*
|
|
106
|
+
* Returns an empty plan when the zone has not moved, which is what makes
|
|
107
|
+
* re-anchoring idempotent: the no-change check costs one comparison per entry
|
|
108
|
+
* and issues zero platform operations.
|
|
109
|
+
*/
|
|
110
|
+
export declare function planReAnchor(pending: readonly PendingEntry[], currentZone: string): ReAnchorPlan;
|
|
111
|
+
/**
|
|
112
|
+
* True when an entry was anchored against a zone the device has since left.
|
|
113
|
+
*
|
|
114
|
+
* This is the FR-007c condition: the entry will fire at its old instant, and a
|
|
115
|
+
* consumer can detect and explain that rather than being told nothing happened.
|
|
116
|
+
*/
|
|
117
|
+
export declare function isStaleAnchor(entry: PendingEntry, currentZone: string): boolean;
|
|
118
|
+
//# sourceMappingURL=anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../../../src/schedule/anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG5E,uFAAuF;AACvF,MAAM,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC;AAW1C;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,IAAI,cAAc,CAc7D;AAED,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIzD;AAaD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAsB7E;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkC/E;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAQjF;AAED,MAAM,WAAW,YAAY;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5F,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;CACjD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY,CAsChG;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAM/E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scheduling operations.
|
|
3
|
+
*
|
|
4
|
+
* Validation runs in a fixed order and completes entirely before any platform
|
|
5
|
+
* call: identifier, tags, content, moment shape, tone, actions, routing size.
|
|
6
|
+
* A caller therefore never sees a native-level error surface through the
|
|
7
|
+
* package, and a rejected request leaves the device untouched.
|
|
8
|
+
*
|
|
9
|
+
* Scheduling an identifier that already has a notification **replaces** it.
|
|
10
|
+
* That is the defined semantic rather than a side effect, which is what lets a
|
|
11
|
+
* caller stop tracking whether it has already scheduled something.
|
|
12
|
+
*/
|
|
13
|
+
import type { NotificationRequest, PendingEntry, ScheduleResult } from '../contract/notification';
|
|
14
|
+
import type { ResolvedTone } from '../contract/channel';
|
|
15
|
+
import type { NotificationEngineAdapter } from '../engine/adapter';
|
|
16
|
+
import { type TimeZoneReader } from './anchor';
|
|
17
|
+
export interface ScheduleDependencies {
|
|
18
|
+
readonly engine: NotificationEngineAdapter;
|
|
19
|
+
readonly resolveTone: (toneId: string) => ResolvedTone | undefined;
|
|
20
|
+
readonly timeZone: TimeZoneReader;
|
|
21
|
+
readonly now: () => number;
|
|
22
|
+
/** False when exact-alarm capability is unavailable, forcing approximate mode. */
|
|
23
|
+
readonly canScheduleExactly: () => boolean;
|
|
24
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
25
|
+
}
|
|
26
|
+
/** Validates a request completely, before the engine is touched at all. */
|
|
27
|
+
export declare function validateRequest(request: NotificationRequest, resolveTone: (toneId: string) => ResolvedTone | undefined): ResolvedTone;
|
|
28
|
+
export declare function createScheduler(deps: ScheduleDependencies): {
|
|
29
|
+
schedule: (request: NotificationRequest, options?: {
|
|
30
|
+
readonly seriesId?: string;
|
|
31
|
+
readonly pushCreated?: boolean;
|
|
32
|
+
}) => Promise<ScheduleResult>;
|
|
33
|
+
cancel(id: string): Promise<void>;
|
|
34
|
+
cancelByGroup(groupTag: string): Promise<readonly string[]>;
|
|
35
|
+
cancelByOwner(ownerTag: string): Promise<readonly string[]>;
|
|
36
|
+
cancelAll(): Promise<void>;
|
|
37
|
+
getPending(): Promise<readonly PendingEntry[]>;
|
|
38
|
+
};
|
|
39
|
+
export type Scheduler = ReturnType<typeof createScheduler>;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schedule/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAMnE,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAI7D,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IACnE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,kBAAkB,EAAE,MAAM,OAAO,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,2EAA2E;AAC3E,wBAAgB,eAAe,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,GACvD,YAAY,CA2Cd;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,oBAAoB;wBAM/C,mBAAmB,YACnB;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,KACrE,OAAO,CAAC,cAAc,CAAC;eAmDR,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;4BAQT,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;4BASnC,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;iBAS9C,OAAO,CAAC,IAAI,CAAC;kBAIZ,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;EAIrD;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|