@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,103 @@
|
|
|
1
|
+
/** Both platforms bound background execution for a silent payload or background action. */
|
|
2
|
+
export declare const BACKGROUND_WINDOW_MS = 30000;
|
|
3
|
+
/**
|
|
4
|
+
* The engine's own enum values, mirrored as literals.
|
|
5
|
+
*
|
|
6
|
+
* These are **numeric** enums in the engine's type definitions, and its native
|
|
7
|
+
* validator rejects the string names — `importance: 'default'` fails with
|
|
8
|
+
* "expected a valid Importance". Mirroring them here rather than importing the
|
|
9
|
+
* enums keeps the engine out of the module graph, which is what lets the
|
|
10
|
+
* package load without the native module present.
|
|
11
|
+
*
|
|
12
|
+
* The package's own `ResolvedTone` deliberately stays platform-neutral strings;
|
|
13
|
+
* translating to the engine's representation is this adapter's job and nobody
|
|
14
|
+
* else's.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ANDROID_IMPORTANCE: {
|
|
17
|
+
readonly none: 0;
|
|
18
|
+
readonly min: 1;
|
|
19
|
+
readonly low: 2;
|
|
20
|
+
readonly default: 3;
|
|
21
|
+
readonly high: 4;
|
|
22
|
+
};
|
|
23
|
+
/** `TriggerType.TIMESTAMP`. */
|
|
24
|
+
export declare const TRIGGER_TYPE_TIMESTAMP = 0;
|
|
25
|
+
/** `AlarmType.SET_EXACT_AND_ALLOW_WHILE_IDLE` — exact delivery, survives Doze. */
|
|
26
|
+
export declare const ALARM_TYPE_EXACT_AND_ALLOW_WHILE_IDLE = 3;
|
|
27
|
+
/** `AlarmType.SET_AND_ALLOW_WHILE_IDLE` — the approximate degradation of the above. */
|
|
28
|
+
export declare const ALARM_TYPE_INEXACT_AND_ALLOW_WHILE_IDLE = 1;
|
|
29
|
+
/**
|
|
30
|
+
* `EventType` values that represent a real user interaction.
|
|
31
|
+
*
|
|
32
|
+
* The engine emits far more than interactions on this channel — `DELIVERED`,
|
|
33
|
+
* `TRIGGER_NOTIFICATION_CREATED`, `CHANNEL_BLOCKED` and others all arrive here.
|
|
34
|
+
* Treating anything that is not a dismissal as a press would report a
|
|
35
|
+
* notification *arriving* while the app is open as the user having tapped it,
|
|
36
|
+
* and the interaction path cancels on tap — so the notification would vanish
|
|
37
|
+
* from the tray in front of the user, unread.
|
|
38
|
+
*/
|
|
39
|
+
export declare const EVENT_TYPE_DISMISSED = 0;
|
|
40
|
+
export declare const EVENT_TYPE_PRESS = 1;
|
|
41
|
+
export declare const EVENT_TYPE_ACTION_PRESS = 2;
|
|
42
|
+
/** `EventType.DELIVERED` — an arrival, which is emphatically not an interaction. */
|
|
43
|
+
export declare const EVENT_TYPE_DELIVERED = 3;
|
|
44
|
+
/**
|
|
45
|
+
* `AndroidCategory.ALARM`, the engine's marking for a time-sensitive alert.
|
|
46
|
+
*
|
|
47
|
+
* A per-notification property, not channel configuration — which is why
|
|
48
|
+
* declaring `timeSensitive` on an existing tone never obliges a version bump.
|
|
49
|
+
*/
|
|
50
|
+
export declare const ANDROID_CATEGORY_ALARM = "alarm";
|
|
51
|
+
/**
|
|
52
|
+
* The channel stop markers are posted on.
|
|
53
|
+
*
|
|
54
|
+
* A marker exists to be delivered and immediately removed, so it is given the
|
|
55
|
+
* quietest configuration the platform offers: minimum importance, no sound, no
|
|
56
|
+
* vibration. Its version is fixed because nothing about it is consumer-declared,
|
|
57
|
+
* so it never migrates.
|
|
58
|
+
*/
|
|
59
|
+
export declare const MARKER_CHANNEL_ID = "cms.internal.stop.v1";
|
|
60
|
+
/** Minimal shape used from the engine, so its full surface never leaks into typing. */
|
|
61
|
+
export interface NotifyKitModule {
|
|
62
|
+
createChannel(channel: Record<string, unknown>): Promise<string>;
|
|
63
|
+
deleteChannel(channelId: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Labels come back with the id. That is what makes a label refresh decidable
|
|
66
|
+
* against the device rather than against a ledger of our own — and a ledger
|
|
67
|
+
* drifts after a restore, a reinstall, or a change the user made themselves.
|
|
68
|
+
*/
|
|
69
|
+
getChannels(): Promise<{
|
|
70
|
+
id: string;
|
|
71
|
+
name?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
}[]>;
|
|
74
|
+
createChannelGroup(group: Record<string, unknown>): Promise<string>;
|
|
75
|
+
createTriggerNotification(notification: Record<string, unknown>, trigger: Record<string, unknown>): Promise<string>;
|
|
76
|
+
displayNotification(notification: Record<string, unknown>): Promise<string>;
|
|
77
|
+
getDisplayedNotifications(): Promise<Record<string, unknown>[]>;
|
|
78
|
+
cancelNotification(id: string): Promise<void>;
|
|
79
|
+
cancelAllNotifications(): Promise<void>;
|
|
80
|
+
getTriggerNotifications(): Promise<Record<string, unknown>[]>;
|
|
81
|
+
/** Identifiers only. Optional, because not every release of the binding has it. */
|
|
82
|
+
getTriggerNotificationIds?(): Promise<string[]>;
|
|
83
|
+
onBackgroundEvent(handler: (event: Record<string, unknown>) => Promise<void>): void;
|
|
84
|
+
requestPermission(options?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
85
|
+
getNotificationSettings(): Promise<Record<string, unknown>>;
|
|
86
|
+
openNotificationSettings(): Promise<void>;
|
|
87
|
+
openAlarmPermissionSettings(): Promise<void>;
|
|
88
|
+
isBatteryOptimizationEnabled(): Promise<boolean>;
|
|
89
|
+
onForegroundEvent(handler: (event: Record<string, unknown>) => void): () => void;
|
|
90
|
+
getInitialNotification(): Promise<Record<string, unknown> | null>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Drops keys whose value is `undefined`.
|
|
94
|
+
*
|
|
95
|
+
* The engine validates its arguments by key presence, not by value: passing
|
|
96
|
+
* `{ groupId: undefined }` fails with "expected a string value", while omitting
|
|
97
|
+
* the key entirely is accepted. JavaScript treats the two as interchangeable
|
|
98
|
+
* almost everywhere, which is exactly why this is easy to get wrong — and why
|
|
99
|
+
* it only surfaces on a real device, where the native validator runs.
|
|
100
|
+
*/
|
|
101
|
+
export declare function compact<T extends Record<string, unknown>>(value: T): Partial<T>;
|
|
102
|
+
export declare function loadEngine(): NotifyKitModule;
|
|
103
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/engine/notify-kit/module.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,CAAC;CAClE;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAM/E;AAWD,wBAAgB,UAAU,IAAI,eAAe,CAS5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notify-kit/platform/android.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAS,CAAC;AAWlE,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,eAAe,GAAG,iBAAiB,CA0J9F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlatformInfo } from '../../../permission/state.js';
|
|
2
|
+
import type { NotifyKitModule } from '../module.js';
|
|
3
|
+
import type { NotifyKitPlatform } from './types.js';
|
|
4
|
+
export type { NotifyKitPlatform } from './types.js';
|
|
5
|
+
/** The running OS and, on Android, its API level. */
|
|
6
|
+
export declare function detectPlatform(): PlatformInfo;
|
|
7
|
+
/**
|
|
8
|
+
* The strategy for `platform`, or for the running one. Only Android gets the
|
|
9
|
+
* Android strategy; anywhere else nothing channel- or alarm-specific is called.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createNotifyKitPlatform(engine: () => NotifyKitModule, platform?: PlatformInfo): NotifyKitPlatform;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notify-kit/platform/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAEjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAYjD,qDAAqD;AACrD,wBAAgB,cAAc,IAAI,YAAY,CAQ7C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,MAAM,eAAe,EAC7B,QAAQ,CAAC,EAAE,YAAY,GACrB,iBAAiB,CAUnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notify-kit/platform/ios.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AASjD,wBAAgB,iBAAiB,IAAI,iBAAiB,CAsCrD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What differs between Android and iOS in the notify-kit engine (NOT-18, IOS-08).
|
|
3
|
+
*
|
|
4
|
+
* The engine picks one implementation when it is created and never branches on
|
|
5
|
+
* the OS again. Changing iOS behaviour touches `ios.ts` only, and the Android
|
|
6
|
+
* file that runs in production stays as it is.
|
|
7
|
+
*/
|
|
8
|
+
import type { ChannelGroup, ResolvedTone } from '../../../contract/channel.js';
|
|
9
|
+
import type { PermissionKind, PermissionState, RestrictionReport } from '../../../contract/permission.js';
|
|
10
|
+
import type { EngineCapabilities, ToneDeclarationOutcome } from '../../adapter.js';
|
|
11
|
+
import type { NotifyKitModule } from '../module.js';
|
|
12
|
+
export interface NotifyKitPlatform {
|
|
13
|
+
capabilities(): EngineCapabilities;
|
|
14
|
+
/** Creates the channel stop markers are posted on, the first time one is needed. */
|
|
15
|
+
ensureMarkerChannel(): Promise<void>;
|
|
16
|
+
withChannelSnapshot<T>(work: () => Promise<T>): Promise<T>;
|
|
17
|
+
declareTone(tone: ResolvedTone): Promise<ToneDeclarationOutcome>;
|
|
18
|
+
retireTone(channelId: string): Promise<boolean>;
|
|
19
|
+
declareGroups(groups: readonly ChannelGroup[]): Promise<void>;
|
|
20
|
+
listDeclaredChannels(): Promise<readonly string[]>;
|
|
21
|
+
/** The state of `kind`, from the engine's settings as just read. */
|
|
22
|
+
permissionFrom(kind: PermissionKind, settings: Record<string, unknown>): PermissionState;
|
|
23
|
+
/** Whether exact alarms are a capability the user grants here. */
|
|
24
|
+
gatesExactAlarms(): boolean;
|
|
25
|
+
restrictions(now: () => number): Promise<RestrictionReport>;
|
|
26
|
+
}
|
|
27
|
+
export interface PlatformContext {
|
|
28
|
+
/** The engine module, resolved lazily. */
|
|
29
|
+
readonly engine: () => NotifyKitModule;
|
|
30
|
+
/** Android API level, read when asked; undefined elsewhere or when unknown. */
|
|
31
|
+
readonly apiLevel: () => number | undefined;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notify-kit/platform/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA2B,CAAC;AAC5E,OAAO,KAAK,EACX,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,MAAM,iCAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAe,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAW,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IACjC,YAAY,IAAI,kBAAkB,CAAC;IACnC,oFAAoF;IACpF,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3D,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACjE,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,aAAa,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,oBAAoB,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAEnD,oEAAoE;IACpE,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,CAAC;IACzF,kEAAkE;IAClE,gBAAgB,IAAI,OAAO,CAAC;IAC5B,YAAY,CAAC,GAAG,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,eAAe;IAC/B,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,eAAe,CAAC;IACvC,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC5C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `react-native-notify-kit` engine implementation.
|
|
3
|
+
*
|
|
4
|
+
* Nothing above this adapter knows which engine is in use — which is what
|
|
5
|
+
* allowed the original Notifee choice to be swapped for its maintained fork
|
|
6
|
+
* without touching a requirement, a test, or a line of consumer code.
|
|
7
|
+
*
|
|
8
|
+
* This file is what both platforms share: scheduling, cancelling, reading the
|
|
9
|
+
* pending set, and routing events. The engine module and its constants live in
|
|
10
|
+
* `notify-kit/module.ts`, decoding in `notify-kit/events.ts`, and everything
|
|
11
|
+
* that differs between Android and iOS in `notify-kit/platform/` — chosen once
|
|
12
|
+
* when the engine is created (NOT-18, IOS-08).
|
|
13
|
+
*/
|
|
14
|
+
import type { NotificationEngineAdapter } from './adapter.js';
|
|
15
|
+
import type { PlatformInfo } from '../permission/state.js';
|
|
16
|
+
import { type NotifyKitModule } from './notify-kit/module.js';
|
|
17
|
+
export interface NotifyKitEngineOptions {
|
|
18
|
+
/** Injected in tests; production resolves the real module. */
|
|
19
|
+
readonly module?: NotifyKitModule;
|
|
20
|
+
readonly now?: () => number;
|
|
21
|
+
/** Defaults to the running platform. Injected to test one platform's behaviour. */
|
|
22
|
+
readonly platform?: PlatformInfo;
|
|
23
|
+
}
|
|
24
|
+
export declare function createNotifyKitEngine(options?: NotifyKitEngineOptions): NotificationEngineAdapter;
|
|
25
|
+
//# sourceMappingURL=notify-kit-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-kit-engine.d.ts","sourceRoot":"","sources":["../../../../src/engine/notify-kit-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACX,yBAAyB,EAIzB,MAAM,cAAW,CAAC;AAOnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAqB,CAAC;AAQxD,OAAO,EASN,KAAK,eAAe,EACpB,MAAM,wBAAqB,CAAC;AAqB7B,MAAM,WAAW,sBAAsB;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CACjC;AAED,wBAAgB,qBAAqB,CACpC,OAAO,GAAE,sBAA2B,GAClC,yBAAyB,CAkQ3B"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chipmobilesdk/rn-notification
|
|
3
|
+
*
|
|
4
|
+
* Default entrypoint: scheduling, recurrence, reconciliation, permissions,
|
|
5
|
+
* channels, interaction, and diagnostics.
|
|
6
|
+
*
|
|
7
|
+
* Push lives behind `@chipmobilesdk/rn-notification/push` so an app that never
|
|
8
|
+
* enables it ships no provider code, no push permissions, and no entitlements.
|
|
9
|
+
* Test doubles live behind `@chipmobilesdk/rn-notification/testing` so they
|
|
10
|
+
* never reach a production bundle.
|
|
11
|
+
*
|
|
12
|
+
* No engine, provider, or storage type is reachable from here — that is what
|
|
13
|
+
* makes each of them replaceable.
|
|
14
|
+
*/
|
|
15
|
+
export type { AnchoringMode, DeliveryMoment, NotificationContent, RoutingPayload, Action, NotificationRequest, PendingEntry, ScheduleResult, Weekday, DailyPattern, WeeklyPattern, MonthlyByDayPattern, RecurrencePattern, EndCondition, OccurrenceTemplate, RecurrenceRule, LookaheadConfig, SeriesResult, SeriesSummary, ReconcileInput, ReconcileResult, RejectedEntry, TruncationReport, PendingDiscrepancy, MaintenanceResult, PermissionKind, PermissionState, PermissionReport, PermissionCapability, RestrictionStatus, RestrictionReport, ToneUrgency, ToneSound, ToneRepeatAlert, ToneDeclaration, ChannelGroup, ChannelApplyResult, ResolvedTone, InteractionKind, AppStateAtInteraction, InteractionEvent, InteractionHandler, TargetMissingSignal, Unsubscribe, DiagnosticSeverity, DiagnosticEvent, EventSink, CollectionHealth, StateHealth, StateSnapshot, BurstThreshold, NotificationConfig, InitializeResult, } from './contract/index.js';
|
|
16
|
+
export { DEFAULT_ANCHORING_MODE, DEFAULT_LOOKAHEAD, REPEAT_ALERT_BOUNDS, LOOKAHEAD_BOUNDS, INTERACTION_BUFFER_LIMITS, MAX_ROUTING_PAYLOAD_BYTES, MAX_ACTIONS_PER_NOTIFICATION, DEFAULT_BURST_THRESHOLD, DIAGNOSTIC_CODES, ALL_DIAGNOSTIC_CODES, NotificationError, isNotificationError, isNonFailure, } from './contract/index.js';
|
|
17
|
+
export type { DiagnosticCode } from './contract/index.js';
|
|
18
|
+
/**
|
|
19
|
+
* The engine port. Exported so a consuming app can supply its own engine, which
|
|
20
|
+
* is the mechanism behind provider and engine substitution.
|
|
21
|
+
*/
|
|
22
|
+
export type { NotificationEngineAdapter, DeliveryEvent, EngineCapabilities, EngineScheduleRequest, RepeatStop, ToneDeclarationOutcome, } from './engine/adapter.js';
|
|
23
|
+
/** The default engine. Consumers may substitute their own via the port above. */
|
|
24
|
+
export { createNotifyKitEngine } from './engine/notify-kit-engine.js';
|
|
25
|
+
/**
|
|
26
|
+
* The whole package, assembled (0.6.0): scheduler, reconciler, recurrence,
|
|
27
|
+
* permissions, channels, interactions, snapshot and maintenance, wired the way the
|
|
28
|
+
* package means them to be. Start here; the factories below are for an app that
|
|
29
|
+
* needs a different wiring, and are also exported from `./advanced`.
|
|
30
|
+
*/
|
|
31
|
+
export { createNotifications } from './notifications.js';
|
|
32
|
+
export type { Notifications, NotificationsDependencies } from './notifications.js';
|
|
33
|
+
/** Initialization and the assembled runtime. */
|
|
34
|
+
export { initialize } from './initialize.js';
|
|
35
|
+
export type { RuntimeDependencies, NotificationRuntime } from './initialize.js';
|
|
36
|
+
/** Scheduling operations. */
|
|
37
|
+
export { createScheduler } from './schedule/index.js';
|
|
38
|
+
export type { Scheduler, ScheduleDependencies } from './schedule/index.js';
|
|
39
|
+
/** Reconciliation — always consumer-invoked, never automatic. */
|
|
40
|
+
export { createReconciler } from './reconcile/index.js';
|
|
41
|
+
export type { Reconciler, ReconcileDependencies } from './reconcile/index.js';
|
|
42
|
+
/** Recurrence — declare a rule once; the package maintains a bounded window. */
|
|
43
|
+
export { createRecurrence } from './recurrence/index.js';
|
|
44
|
+
export type { Recurrence, RecurrenceDependencies } from './recurrence/index.js';
|
|
45
|
+
export { occurrenceId } from './recurrence/expand.js';
|
|
46
|
+
/** Channels and tones — declared once, mapped to each platform, migrated on change. */
|
|
47
|
+
export { createChannels } from './channel/migrate.js';
|
|
48
|
+
export type { Channels, ChannelDependencies } from './channel/migrate.js';
|
|
49
|
+
export { channelIdFor, createToneResolver, parseChannelId, resolveTone } from './channel/tone-map.js';
|
|
50
|
+
export { validateToneDeclaration, validateToneDeclarations } from './channel/validate-tone.js';
|
|
51
|
+
/**
|
|
52
|
+
* Repeat expiry — what bounds an alert that repeats until it is handled.
|
|
53
|
+
*
|
|
54
|
+
* `registerBackgroundNotificationHandler` is the one piece a consumer wires up
|
|
55
|
+
* themselves, at module scope in `index.js`. An app that declares no repeating
|
|
56
|
+
* tone needs none of this.
|
|
57
|
+
*/
|
|
58
|
+
export { createRepeatExpiryHandler, registerBackgroundNotificationHandler, REPEAT_STOP_PREFIX, } from './repeat/index.js';
|
|
59
|
+
export type { BackgroundHandlerRegistration, RepeatExpiryHandler, RepeatExpiryDependencies, } from './repeat/index.js';
|
|
60
|
+
/** Interaction routing — one handler for foreground, background, and cold start. */
|
|
61
|
+
export { createInteractions } from './interaction/index.js';
|
|
62
|
+
export type { Interactions, InteractionDependencies } from './interaction/index.js';
|
|
63
|
+
/** Observability — snapshot and burst detection. */
|
|
64
|
+
export { createSnapshot } from './diagnostics/snapshot.js';
|
|
65
|
+
export type { Snapshot, SnapshotDependencies } from './diagnostics/snapshot.js';
|
|
66
|
+
export { createBurstDetector } from './diagnostics/burst.js';
|
|
67
|
+
export type { BurstDetector, BurstStatus } from './diagnostics/burst.js';
|
|
68
|
+
export { DiagnosticEmitter } from './diagnostics/events.js';
|
|
69
|
+
/** Permission coordination — reading never prompts; a refusal never fails the caller. */
|
|
70
|
+
export { createPermissions } from './permission/index.js';
|
|
71
|
+
export type { Permissions, PermissionDependencies, PermissionChangeHandler } from './permission/index.js';
|
|
72
|
+
export { canDisplay, capabilityFor, isTerminal, shouldOfferSettings } from './permission/state.js';
|
|
73
|
+
export type { PlatformInfo } from './permission/state.js';
|
|
74
|
+
/** Maintenance steps, registered with the runtime's registry. */
|
|
75
|
+
export { createPermissionRefreshStep } from './maintenance/permission-refresh.js';
|
|
76
|
+
export { createReAnchorStep } from './maintenance/reanchor.js';
|
|
77
|
+
export { createVerifyStep } from './maintenance/verify.js';
|
|
78
|
+
export { createWindowRefreshStep } from './maintenance/window-refresh.js';
|
|
79
|
+
export type { MaintenanceStep, MaintenanceTrigger, MaintenanceContext } from './maintenance/cycle.js';
|
|
80
|
+
export { MaintenanceRegistry, MaintenanceScopeViolation } from './maintenance/cycle.js';
|
|
81
|
+
export { MaintenanceController } from './maintenance/toggle.js';
|
|
82
|
+
/** Public state controls — the only two ways a consumer may touch persisted state. */
|
|
83
|
+
export { resetState, clearOwner } from './state/reset.js';
|
|
84
|
+
export type { ResetOutcome } from './state/reset.js';
|
|
85
|
+
/**
|
|
86
|
+
* State plumbing. The record's *schema* stays private — a consumer can create
|
|
87
|
+
* and reset the store, but has no way to read or write what is inside it.
|
|
88
|
+
*/
|
|
89
|
+
export { createMmkvStore } from './state/mmkv-store.js';
|
|
90
|
+
export { StateManager } from './state/record.js';
|
|
91
|
+
export type { StateStore } from './state/store.js';
|
|
92
|
+
/** Documented limits, exported so a consumer can validate before calling. */
|
|
93
|
+
export { MAX_IDENTIFIER_LENGTH } from './schedule/validate-identifier.js';
|
|
94
|
+
export { CONTENT_LIMITS } from './schedule/validate-content.js';
|
|
95
|
+
export { PAST_TOLERANCE_MS } from './schedule/resolve-moment.js';
|
|
96
|
+
/**
|
|
97
|
+
* Reads the platform time zone, which anchoring depends on.
|
|
98
|
+
*
|
|
99
|
+
* Exported because every consumer needs it and pure JavaScript cannot provide
|
|
100
|
+
* it reliably — `Intl.DateTimeFormat().resolvedOptions().timeZone` does not
|
|
101
|
+
* update when the device zone changes. Leaving consumers to write this
|
|
102
|
+
* themselves is how a subtly wrong version ends up in each of them.
|
|
103
|
+
*/
|
|
104
|
+
export { createPlatformTimeZoneReader, isValidTimeZone } from './schedule/anchor.js';
|
|
105
|
+
export type { TimeZoneReader } from './schedule/anchor.js';
|
|
106
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,YAAY,EAEX,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,cAAc,EAEd,OAAO,EACP,YAAY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,qBAAqB,EAAE,MAAM,mCAAgC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAA6B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA2B,CAAC;AAE9D;;;;;;;GAOG;AACH,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAClF,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package initialization.
|
|
3
|
+
*
|
|
4
|
+
* Composes the parts that must be in place before the first schedule call:
|
|
5
|
+
* validate configuration, load persisted state, apply tone declarations, run
|
|
6
|
+
* any pending channel migration, and start the maintenance registry.
|
|
7
|
+
*
|
|
8
|
+
* Budgeted at 100 ms of app startup, which is why state loading is synchronous
|
|
9
|
+
* and tone declaration is the only platform round-trip.
|
|
10
|
+
*
|
|
11
|
+
* Automatic maintenance is started here too: whatever steps are registered on
|
|
12
|
+
* `runtime.registry` run when the app returns to the foreground, with the
|
|
13
|
+
* trigger reported as `timeZoneChange` when the device zone moved meanwhile.
|
|
14
|
+
* Until 0.4.0 nothing ever called `runAutomatic`, so "automatic" maintenance
|
|
15
|
+
* only ran when the app invoked it by hand.
|
|
16
|
+
*/
|
|
17
|
+
import type { InitializeResult, NotificationConfig } from './contract/diagnostics.js';
|
|
18
|
+
import { type LookaheadConfig } from './contract/recurrence.js';
|
|
19
|
+
import type { MaintenanceResult } from './contract/reconcile.js';
|
|
20
|
+
import { DiagnosticEmitter } from './diagnostics/events.js';
|
|
21
|
+
import { MaintenanceRegistry } from './maintenance/cycle.js';
|
|
22
|
+
import { MaintenanceController } from './maintenance/toggle.js';
|
|
23
|
+
import { StateManager } from './state/record.js';
|
|
24
|
+
import type { StateStore } from './state/store.js';
|
|
25
|
+
import type { NotificationEngineAdapter } from './engine/adapter.js';
|
|
26
|
+
import { type Channels } from './channel/migrate.js';
|
|
27
|
+
import { type TimeZoneReader } from './schedule/anchor.js';
|
|
28
|
+
/** The slice of React Native's `AppState` the lifecycle observer uses. */
|
|
29
|
+
export interface AppStateSource {
|
|
30
|
+
addEventListener(type: 'change', listener: (state: string) => void): {
|
|
31
|
+
remove(): void;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface RuntimeDependencies {
|
|
35
|
+
readonly engine: NotificationEngineAdapter;
|
|
36
|
+
readonly store: StateStore;
|
|
37
|
+
readonly now?: () => number;
|
|
38
|
+
/** Injected in tests; defaults to rn-core's shared `appLifecycle()`. */
|
|
39
|
+
readonly appState?: AppStateSource;
|
|
40
|
+
/** Injected in tests; defaults to the platform zone reader. */
|
|
41
|
+
readonly timeZone?: TimeZoneReader;
|
|
42
|
+
}
|
|
43
|
+
/** Everything assembled at initialization, shared by the operation modules. */
|
|
44
|
+
export interface NotificationRuntime {
|
|
45
|
+
readonly engine: NotificationEngineAdapter;
|
|
46
|
+
readonly state: StateManager;
|
|
47
|
+
readonly emitter: DiagnosticEmitter;
|
|
48
|
+
readonly registry: MaintenanceRegistry;
|
|
49
|
+
readonly maintenance: MaintenanceController;
|
|
50
|
+
/** The channel module that applied `config.tones`. Added in 0.4.0. */
|
|
51
|
+
readonly channels: Channels;
|
|
52
|
+
readonly lookahead: LookaheadConfig;
|
|
53
|
+
readonly config: NotificationConfig;
|
|
54
|
+
readonly now: () => number;
|
|
55
|
+
/** The result of the latest automatic cycle, if one has run. Added in 0.4.0. */
|
|
56
|
+
readonly lastAutomaticMaintenance: () => MaintenanceResult | undefined;
|
|
57
|
+
/** Stops the lifecycle observer. Added in 0.4.0. */
|
|
58
|
+
dispose(): void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Clamps the lookahead into its documented bounds.
|
|
62
|
+
*
|
|
63
|
+
* Bounded on adjustment because the platform ceiling is not negotiable: a
|
|
64
|
+
* consumer asking for a five-year window would silently exhaust the 64-entry
|
|
65
|
+
* iOS ceiling on the first frequent series.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolveLookahead(partial: Partial<LookaheadConfig> | undefined): LookaheadConfig;
|
|
68
|
+
/** Fails before any platform call, so a bad configuration never half-applies. */
|
|
69
|
+
export declare function validateConfig(config: NotificationConfig): void;
|
|
70
|
+
export declare function initialize(config: NotificationConfig, deps: RuntimeDependencies): Promise<{
|
|
71
|
+
runtime: NotificationRuntime;
|
|
72
|
+
result: InitializeResult;
|
|
73
|
+
}>;
|
|
74
|
+
//# sourceMappingURL=initialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,2BAAwB,CAAC;AACnF,OAAO,EAAuC,KAAK,eAAe,EAAE,MAAM,0BAAuB,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAsB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAqB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAsB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAe,CAAC;AAChD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAkB,CAAC;AAClE,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,sBAAmB,CAAC;AAClE,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,sBAAmB,CAAC;AAEtF,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC9B,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG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ACvB,OAAO,CAAC;IAAE,OAAO,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CA8FrE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction routing.
|
|
3
|
+
*
|
|
4
|
+
* One handler covers foreground, background, and cold start. The hard case is
|
|
5
|
+
* the last one: the tap happens before any JavaScript exists to receive it, so
|
|
6
|
+
* the event has to wait — durably — until a handler registers.
|
|
7
|
+
*
|
|
8
|
+
* Events are delivered in occurrence order and never dropped for want of a
|
|
9
|
+
* listener. After delivery the notification leaves the tray, because a
|
|
10
|
+
* notification the user has already acted on sitting there is noise.
|
|
11
|
+
*/
|
|
12
|
+
import type { InteractionHandler, TargetMissingSignal, Unsubscribe } from '../contract/interaction.js';
|
|
13
|
+
import type { NotificationEngineAdapter } from '../engine/adapter.js';
|
|
14
|
+
import type { StateManager } from '../state/record.js';
|
|
15
|
+
export interface InteractionDependencies {
|
|
16
|
+
readonly engine: NotificationEngineAdapter;
|
|
17
|
+
readonly state: StateManager;
|
|
18
|
+
readonly now: () => number;
|
|
19
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function createInteractions(deps: InteractionDependencies): {
|
|
22
|
+
/**
|
|
23
|
+
* Registers a handler and immediately drains anything that was waiting.
|
|
24
|
+
*
|
|
25
|
+
* The drain is what makes a cold-start tap work: the event was persisted
|
|
26
|
+
* before this handler existed, possibly before this process existed.
|
|
27
|
+
*/
|
|
28
|
+
onInteraction(handler: InteractionHandler): Unsubscribe;
|
|
29
|
+
/**
|
|
30
|
+
* Collects the interaction that launched the app, if any.
|
|
31
|
+
*
|
|
32
|
+
* Called once during startup. If no handler exists yet the event is
|
|
33
|
+
* buffered rather than discarded.
|
|
34
|
+
*/
|
|
35
|
+
collectInitial(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Signals that a routing target no longer exists.
|
|
38
|
+
*
|
|
39
|
+
* The consumer chooses its own fallback screen. No platform error is ever
|
|
40
|
+
* shown to the user for this — a notification pointing at deleted data is
|
|
41
|
+
* an ordinary condition, not a crash.
|
|
42
|
+
*/
|
|
43
|
+
reportTargetMissing(signal: TargetMissingSignal): void;
|
|
44
|
+
/** Reports that a background action exceeded the platform's execution window. */
|
|
45
|
+
reportBackgroundTimeout(notificationId: string, windowMs: number): void;
|
|
46
|
+
/** How many interactions are waiting for a handler. */
|
|
47
|
+
pendingCount(): number;
|
|
48
|
+
/** Settles outstanding deliveries. Exists for tests and orderly shutdown. */
|
|
49
|
+
flush(): Promise<void>;
|
|
50
|
+
dispose(): void;
|
|
51
|
+
};
|
|
52
|
+
export type Interactions = ReturnType<typeof createInteractions>;
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interaction/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAEX,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,MAAM,4BAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAIpD,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,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,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,uBAAuB;IA2C9D;;;;;OAKG;2BACoB,kBAAkB,GAAG,WAAW;IAYvD;;;;;OAKG;sBACqB,OAAO,CAAC,IAAI,CAAC;IAMrC;;;;;;OAMG;gCACyB,mBAAmB,GAAG,IAAI;IAQtD,iFAAiF;4CACzC,MAAM,YAAY,MAAM,GAAG,IAAI;IAQvE,uDAAuD;oBACvC,MAAM;IAItB,6EAA6E;aAC9D,OAAO,CAAC,IAAI,CAAC;eAIjB,IAAI;EAMhB;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The automatic maintenance cycle.
|
|
3
|
+
*
|
|
4
|
+
* Covers exactly what only the package can know — window refresh, recurrence
|
|
5
|
+
* expansion, wall-clock re-anchoring, pending-set verification, permission
|
|
6
|
+
* re-reads. Full desired-set reconciliation is never automatic, because only
|
|
7
|
+
* the consumer knows what its data implies and a package that guessed would
|
|
8
|
+
* cancel notifications it does not understand.
|
|
9
|
+
*
|
|
10
|
+
* Steps register themselves here rather than being wired in a fixed order. That
|
|
11
|
+
* is what lets scheduling, reconciliation, recurrence, and permissions each
|
|
12
|
+
* contribute a step without importing one another.
|
|
13
|
+
*
|
|
14
|
+
* The rule that makes automatic work safe: a step may act only on notifications
|
|
15
|
+
* the package owns, and may never cancel anything else. It is enforced here
|
|
16
|
+
* rather than trusted to each step.
|
|
17
|
+
*/
|
|
18
|
+
import type { MaintenanceResult, PendingDiscrepancy } from '../contract/reconcile.js';
|
|
19
|
+
export type MaintenanceTrigger = 'foreground' | 'delivery' | 'timeZoneChange' | 'permissionChange' | 'explicit';
|
|
20
|
+
export interface MaintenanceContext {
|
|
21
|
+
readonly trigger: MaintenanceTrigger;
|
|
22
|
+
readonly now: number;
|
|
23
|
+
/**
|
|
24
|
+
* Identifiers the package owns — series occurrences and entries it created.
|
|
25
|
+
* A step may cancel only within this set.
|
|
26
|
+
*/
|
|
27
|
+
readonly ownedIds: ReadonlySet<string>;
|
|
28
|
+
}
|
|
29
|
+
export interface StepOutcome {
|
|
30
|
+
readonly occurrencesScheduled?: number;
|
|
31
|
+
readonly reAnchored?: number;
|
|
32
|
+
readonly windowRefreshed?: boolean;
|
|
33
|
+
readonly timeZoneChanged?: boolean;
|
|
34
|
+
readonly permissionChanged?: boolean;
|
|
35
|
+
readonly discrepancy?: PendingDiscrepancy;
|
|
36
|
+
/** Platform operations issued. Zero on a no-change pass. */
|
|
37
|
+
readonly operationCount?: number;
|
|
38
|
+
/** Identifiers this step cancelled, checked against `ownedIds`. */
|
|
39
|
+
readonly cancelledIds?: readonly string[];
|
|
40
|
+
}
|
|
41
|
+
export interface MaintenanceStep {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
/** Lower runs first. Re-anchoring must precede verification, or verification sees stale instants. */
|
|
44
|
+
readonly order: number;
|
|
45
|
+
run(context: MaintenanceContext): Promise<StepOutcome>;
|
|
46
|
+
}
|
|
47
|
+
export declare class MaintenanceScopeViolation extends Error {
|
|
48
|
+
readonly step: string;
|
|
49
|
+
readonly offendingIds: readonly string[];
|
|
50
|
+
constructor(step: string, offendingIds: readonly string[]);
|
|
51
|
+
}
|
|
52
|
+
export interface MaintenanceRegistryOptions {
|
|
53
|
+
/** Measures `durationMs`. `context.now` is the cycle's logical time and does not move. */
|
|
54
|
+
readonly clock?: () => number;
|
|
55
|
+
}
|
|
56
|
+
export declare class MaintenanceRegistry {
|
|
57
|
+
private steps;
|
|
58
|
+
private inFlight;
|
|
59
|
+
private readonly clock;
|
|
60
|
+
constructor(options?: MaintenanceRegistryOptions);
|
|
61
|
+
register(step: MaintenanceStep): () => void;
|
|
62
|
+
get registered(): readonly string[];
|
|
63
|
+
/**
|
|
64
|
+
* Runs every registered step in order.
|
|
65
|
+
*
|
|
66
|
+
* Overlapping cycles are joined rather than queued or dropped: a second
|
|
67
|
+
* caller arriving mid-cycle wants the work the running cycle is already
|
|
68
|
+
* doing, so it waits for that cycle and gets its result. It used to get an
|
|
69
|
+
* empty result at once. Since `initialize` started running a cycle on every
|
|
70
|
+
* foreground, an app that ran maintenance and then reconciled on the same
|
|
71
|
+
* event got that empty result and reconciled while the window refresh was
|
|
72
|
+
* still writing: a reminder the reconcile cancelled could be scheduled again.
|
|
73
|
+
*/
|
|
74
|
+
run(context: MaintenanceContext): Promise<MaintenanceResult>;
|
|
75
|
+
private runSteps;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=cycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle.d.ts","sourceRoot":"","sources":["../../../../src/maintenance/cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAAuB,CAAC;AAEnF,MAAM,MAAM,kBAAkB,GAC7B,YAAY,GAAG,UAAU,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAC1C,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACvD;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;gBAE7B,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE;CAUzD;AAED,MAAM,WAAW,0BAA0B;IAC1C,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CAC9B;AAED,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;gBAEzB,OAAO,GAAE,0BAA+B;IAIpD,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,IAAI;IAQ3C,IAAI,UAAU,IAAI,SAAS,MAAM,EAAE,CAElC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAW9C,QAAQ;CAgCtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The permission re-read maintenance step.
|
|
3
|
+
*
|
|
4
|
+
* The user can change permission in system settings while the app is
|
|
5
|
+
* backgrounded, and the platform does not tell anyone. Re-reading on foreground
|
|
6
|
+
* is the only way a consumer's interface avoids showing a stale answer.
|
|
7
|
+
*
|
|
8
|
+
* Runs last (order 30): permission state does not affect what the earlier steps
|
|
9
|
+
* expand or re-anchor, and reading it after they have run means the report
|
|
10
|
+
* reflects the device as the cycle leaves it.
|
|
11
|
+
*/
|
|
12
|
+
import type { MaintenanceStep } from './cycle.js';
|
|
13
|
+
import type { Permissions } from '../permission/index.js';
|
|
14
|
+
export declare const PERMISSION_REFRESH_ORDER = 30;
|
|
15
|
+
export interface PermissionRefreshDependencies {
|
|
16
|
+
readonly permissions: Permissions;
|
|
17
|
+
}
|
|
18
|
+
export declare function createPermissionRefreshStep(deps: PermissionRefreshDependencies): MaintenanceStep;
|
|
19
|
+
//# sourceMappingURL=permission-refresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-refresh.d.ts","sourceRoot":"","sources":["../../../../src/maintenance/permission-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,YAAS,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAe,CAAC;AAEjD,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CAClC;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,6BAA6B,GAAG,eAAe,CAiBhG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The re-anchoring maintenance step.
|
|
3
|
+
*
|
|
4
|
+
* Registers itself with the maintenance registry rather than being wired into
|
|
5
|
+
* a fixed sequence, which is what keeps scheduling independent of
|
|
6
|
+
* reconciliation, recurrence, and permissions despite all four contributing a
|
|
7
|
+
* step.
|
|
8
|
+
*
|
|
9
|
+
* Runs early (order 10) because verification compares firing instants: if
|
|
10
|
+
* verification ran first it would compare against instants re-anchoring is
|
|
11
|
+
* about to rewrite, and report discrepancies that do not exist.
|
|
12
|
+
*/
|
|
13
|
+
import type { MaintenanceStep } from './cycle.js';
|
|
14
|
+
import type { NotificationEngineAdapter } from '../engine/adapter.js';
|
|
15
|
+
import type { ResolvedTone } from '../contract/channel.js';
|
|
16
|
+
import { type TimeZoneReader } from '../schedule/anchor.js';
|
|
17
|
+
export interface ReAnchorStepDependencies {
|
|
18
|
+
readonly engine: NotificationEngineAdapter;
|
|
19
|
+
readonly timeZone: TimeZoneReader;
|
|
20
|
+
readonly resolveTone: (toneId: string) => ResolvedTone | undefined;
|
|
21
|
+
readonly canScheduleExactly: () => boolean;
|
|
22
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const RE_ANCHOR_ORDER = 10;
|
|
25
|
+
export declare function createReAnchorStep(deps: ReAnchorStepDependencies): MaintenanceStep;
|
|
26
|
+
//# sourceMappingURL=reanchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reanchor.d.ts","sourceRoot":"","sources":["../../../../src/maintenance/reanchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,YAAS,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAqB,CAAC;AACxD,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,uBAAoB,CAAC;AAGvE,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IACnE,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,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,wBAAwB,GAAG,eAAe,CAuElF"}
|