@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
package/package.json
CHANGED
|
@@ -1,25 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipmobilesdk/rn-notification",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"source": "./src/index.ts",
|
|
7
|
+
"main": "./lib/commonjs/index.js",
|
|
8
|
+
"module": "./lib/module/index.js",
|
|
9
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
8
10
|
"exports": {
|
|
9
11
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
12
|
+
"chipmobilesdk-source": "./src/index.ts",
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./lib/typescript/module/index.d.ts",
|
|
15
|
+
"default": "./lib/module/index.js"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
19
|
+
"default": "./lib/commonjs/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"./advanced": {
|
|
23
|
+
"chipmobilesdk-source": "./src/advanced.ts",
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./lib/typescript/module/advanced.d.ts",
|
|
26
|
+
"default": "./lib/module/advanced.js"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./lib/typescript/commonjs/advanced.d.ts",
|
|
30
|
+
"default": "./lib/commonjs/advanced.js"
|
|
31
|
+
}
|
|
13
32
|
},
|
|
14
33
|
"./push": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
34
|
+
"chipmobilesdk-source": "./src/push/index.ts",
|
|
35
|
+
"import": {
|
|
36
|
+
"types": "./lib/typescript/module/push/index.d.ts",
|
|
37
|
+
"default": "./lib/module/push/index.js"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./lib/typescript/commonjs/push/index.d.ts",
|
|
41
|
+
"default": "./lib/commonjs/push/index.js"
|
|
42
|
+
}
|
|
18
43
|
},
|
|
19
44
|
"./testing": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
45
|
+
"chipmobilesdk-source": "./src/testing/index.ts",
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./lib/typescript/module/testing/index.d.ts",
|
|
48
|
+
"default": "./lib/module/testing/index.js"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./lib/typescript/commonjs/testing/index.d.ts",
|
|
52
|
+
"default": "./lib/commonjs/testing/index.js"
|
|
53
|
+
}
|
|
23
54
|
}
|
|
24
55
|
},
|
|
25
56
|
"files": [
|
|
@@ -27,35 +58,55 @@
|
|
|
27
58
|
"!src/**/__tests__",
|
|
28
59
|
"skills",
|
|
29
60
|
"README.md",
|
|
30
|
-
"CHANGELOG.md"
|
|
61
|
+
"CHANGELOG.md",
|
|
62
|
+
"lib"
|
|
31
63
|
],
|
|
32
64
|
"sideEffects": false,
|
|
33
65
|
"scripts": {
|
|
66
|
+
"build": "bob build",
|
|
34
67
|
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
35
|
-
"pack:check": "npm pack --dry-run"
|
|
68
|
+
"pack:check": "npm pack --dry-run",
|
|
69
|
+
"prepack": "npm run build"
|
|
36
70
|
},
|
|
37
71
|
"dependencies": {
|
|
38
|
-
"@chipmobilesdk/rn-core": "^0.
|
|
72
|
+
"@chipmobilesdk/rn-core": "^0.2.0"
|
|
39
73
|
},
|
|
40
74
|
"peerDependencies": {
|
|
41
|
-
"@react-native-firebase/
|
|
42
|
-
"@react-native-firebase/messaging": ">=26.0.0",
|
|
43
|
-
"react": ">=19",
|
|
75
|
+
"@react-native-firebase/messaging": "^26.0.0",
|
|
44
76
|
"react-native": ">=0.85",
|
|
45
|
-
"react-native-localize": "
|
|
46
|
-
"react-native-mmkv": "
|
|
47
|
-
"react-native-notify-kit": "
|
|
77
|
+
"react-native-localize": "^3.7.0",
|
|
78
|
+
"react-native-mmkv": "^4.0.0",
|
|
79
|
+
"react-native-notify-kit": "^10.5.0"
|
|
48
80
|
},
|
|
49
81
|
"peerDependenciesMeta": {
|
|
50
|
-
"@react-native-firebase/
|
|
82
|
+
"@react-native-firebase/messaging": {
|
|
51
83
|
"optional": true
|
|
52
84
|
},
|
|
53
|
-
"
|
|
85
|
+
"react-native-localize": {
|
|
54
86
|
"optional": true
|
|
55
87
|
}
|
|
56
88
|
},
|
|
57
89
|
"publishConfig": {
|
|
58
90
|
"access": "public",
|
|
59
91
|
"registry": "https://registry.npmjs.org/"
|
|
92
|
+
},
|
|
93
|
+
"react-native-builder-bob": {
|
|
94
|
+
"source": "src",
|
|
95
|
+
"output": "lib",
|
|
96
|
+
"targets": [
|
|
97
|
+
[
|
|
98
|
+
"commonjs",
|
|
99
|
+
{
|
|
100
|
+
"esm": true
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"module",
|
|
105
|
+
{
|
|
106
|
+
"esm": true
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"typescript"
|
|
110
|
+
]
|
|
60
111
|
}
|
|
61
112
|
}
|
|
@@ -35,11 +35,12 @@ Three things cause most of the bugs, and none is visible in the type signatures:
|
|
|
35
35
|
2. **Wall-clock is the default anchoring mode** — an 08:00 reminder stays 08:00 after the
|
|
36
36
|
user changes time zone. One case re-anchoring cannot fix: read
|
|
37
37
|
`### What re-anchoring cannot fix` before promising exact behaviour to anyone.
|
|
38
|
-
3. **Reconciliation is never automatic.**
|
|
39
|
-
|
|
40
|
-
on every foreground return
|
|
41
|
-
and you did not call `reconcile()` means the device is stale, by
|
|
42
|
-
|
|
38
|
+
3. **Reconciliation is never automatic.** Start from `createNotifications(config, deps)`:
|
|
39
|
+
it registers re-anchoring and the permission re-read, plus window refresh when you pass
|
|
40
|
+
`recurrenceRules`, and runs them on every foreground return. It never invents a desired
|
|
41
|
+
set: data changed and you did not call `reconcile()` means the device is stale, by
|
|
42
|
+
design. Wiring with `initialize()` and the factories from `./advanced` leaves step
|
|
43
|
+
registration to you.
|
|
43
44
|
|
|
44
45
|
Read `## Choosing identifiers`, `## Choosing an anchoring mode`, and
|
|
45
46
|
`## Maintenance versus reconciliation` before designing anything.
|
package/src/advanced.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@chipmobilesdk/rn-notification/advanced`: the individual factories, for an app
|
|
3
|
+
* that wires the package itself instead of using `createNotifications` (NOT-07).
|
|
4
|
+
*
|
|
5
|
+
* The package root still exports them too, for compatibility; new code that needs
|
|
6
|
+
* them should import from here, where they are documented as the advanced path.
|
|
7
|
+
*/
|
|
8
|
+
export { initialize } from './initialize';
|
|
9
|
+
export type { NotificationRuntime, RuntimeDependencies } from './initialize';
|
|
10
|
+
export { createScheduler } from './schedule';
|
|
11
|
+
export type { Scheduler, ScheduleDependencies } from './schedule';
|
|
12
|
+
export { createReconciler } from './reconcile';
|
|
13
|
+
export type { Reconciler, ReconcileDependencies } from './reconcile';
|
|
14
|
+
export { createRecurrence } from './recurrence';
|
|
15
|
+
export type { Recurrence, RecurrenceDependencies } from './recurrence';
|
|
16
|
+
export { createChannels } from './channel/migrate';
|
|
17
|
+
export type { ChannelDependencies, Channels } from './channel/migrate';
|
|
18
|
+
export { createToneResolver } from './channel/tone-map';
|
|
19
|
+
export { createInteractions } from './interaction';
|
|
20
|
+
export type { InteractionDependencies, Interactions } from './interaction';
|
|
21
|
+
export { createSnapshot } from './diagnostics/snapshot';
|
|
22
|
+
export type { Snapshot, SnapshotDependencies } from './diagnostics/snapshot';
|
|
23
|
+
export { createBurstDetector } from './diagnostics/burst';
|
|
24
|
+
export { createPermissions } from './permission';
|
|
25
|
+
export type { PermissionDependencies, Permissions } from './permission';
|
|
26
|
+
export { createPermissionRefreshStep } from './maintenance/permission-refresh';
|
|
27
|
+
export { createReAnchorStep } from './maintenance/reanchor';
|
|
28
|
+
export { createVerifyStep } from './maintenance/verify';
|
|
29
|
+
export { createWindowRefreshStep } from './maintenance/window-refresh';
|
|
30
|
+
export { MaintenanceController } from './maintenance/toggle';
|
|
31
|
+
export { MaintenanceRegistry } from './maintenance/cycle';
|
|
32
|
+
export type { MaintenanceContext, MaintenanceStep, MaintenanceTrigger } from './maintenance/cycle';
|
|
33
|
+
export { StateManager } from './state/record';
|
|
34
|
+
export { createMmkvStore } from './state/mmkv-store';
|
|
35
|
+
export { createPlatformTimeZoneReader } from './schedule/anchor';
|
package/src/channel/migrate.ts
CHANGED
|
@@ -74,192 +74,202 @@ export function createChannels(deps: ChannelDependencies) {
|
|
|
74
74
|
// has to follow, or it would retire with the old channel.
|
|
75
75
|
const writer = createScheduleWriter(deps.engine);
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
tones: readonly ToneDeclaration[],
|
|
86
|
-
groups: readonly ChannelGroup[] = [],
|
|
87
|
-
): Promise<ChannelApplyResult> {
|
|
88
|
-
// Validation completes before the first engine call, so a rejected
|
|
89
|
-
// declaration leaves the device exactly as it was — the same order the
|
|
90
|
-
// scheduler has always used.
|
|
91
|
-
validateToneDeclarations(tones);
|
|
77
|
+
const applyTones = async (
|
|
78
|
+
tones: readonly ToneDeclaration[],
|
|
79
|
+
groups: readonly ChannelGroup[],
|
|
80
|
+
): Promise<ChannelApplyResult> => {
|
|
81
|
+
// Validation completes before the first engine call, so a rejected
|
|
82
|
+
// declaration leaves the device exactly as it was — the same order the
|
|
83
|
+
// scheduler has always used.
|
|
84
|
+
validateToneDeclarations(tones);
|
|
92
85
|
|
|
93
|
-
|
|
86
|
+
const now = deps.now();
|
|
94
87
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
88
|
+
const created: string[] = [];
|
|
89
|
+
const migrated: { toneId: string; from: number; to: number }[] = [];
|
|
90
|
+
const labelsRefreshed: string[] = [];
|
|
91
|
+
const retired: string[] = [];
|
|
92
|
+
const reHomed: string[] = [];
|
|
93
|
+
const cancelled: string[] = [];
|
|
94
|
+
const bypassUnavailable: string[] = [];
|
|
95
|
+
const repeatUnavailable: string[] = [];
|
|
96
|
+
const unchanged: string[] = [];
|
|
104
97
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
if (groups.length > 0) {
|
|
99
|
+
await deps.engine.declareGroups(groups);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const capabilities = await deps.engine.getCapabilities();
|
|
108
103
|
|
|
109
|
-
|
|
104
|
+
for (const tone of tones) {
|
|
105
|
+
const previous = ledgerFor(deps.state, tone.id);
|
|
106
|
+
const resolved = resolveTone(tone);
|
|
107
|
+
const fingerprint = toneLabelFingerprint(tone);
|
|
110
108
|
|
|
111
|
-
for
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
// Refusals are reported for every tone that asked, whether or not
|
|
110
|
+
// anything else about it moved. A platform declining an attribute
|
|
111
|
+
// says nothing about whether the channel is new.
|
|
112
|
+
if (tone.bypassDoNotDisturb === true && !capabilities.supportsDoNotDisturbBypass) {
|
|
113
|
+
// Reported honestly rather than silently dropped — a consumer that
|
|
114
|
+
// asked for a bypass deserves to know the platform refused.
|
|
115
|
+
bypassUnavailable.push(tone.id);
|
|
116
|
+
emit(
|
|
117
|
+
DIAGNOSTIC_CODES.DND_BYPASS_UNAVAILABLE,
|
|
118
|
+
`Tone "${tone.id}" requested a Do Not Disturb bypass, which this platform does not permit.`,
|
|
119
|
+
{ toneId: tone.id },
|
|
120
|
+
);
|
|
121
|
+
}
|
|
115
122
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (tone.bypassDoNotDisturb === true && !capabilities.supportsDoNotDisturbBypass) {
|
|
120
|
-
// Reported honestly rather than silently dropped — a consumer that
|
|
121
|
-
// asked for a bypass deserves to know the platform refused.
|
|
122
|
-
bypassUnavailable.push(tone.id);
|
|
123
|
+
if (tone.repeatAlert !== undefined) {
|
|
124
|
+
if (!capabilities.supportsRepeatingAlert) {
|
|
125
|
+
repeatUnavailable.push(tone.id);
|
|
123
126
|
emit(
|
|
124
|
-
DIAGNOSTIC_CODES.
|
|
125
|
-
`Tone "${tone.id}" requested a
|
|
127
|
+
DIAGNOSTIC_CODES.REPEAT_ALERT_UNAVAILABLE,
|
|
128
|
+
`Tone "${tone.id}" requested a repeating alert, which this platform does not offer. The notification still delivers and still sounds once.`,
|
|
129
|
+
{ toneId: tone.id },
|
|
130
|
+
);
|
|
131
|
+
} else if (!deps.engine.hasBackgroundDeliveryHandler()) {
|
|
132
|
+
// Said out loud at declaration time, because the alternative is a
|
|
133
|
+
// user meeting it as a phone that will not stop ringing.
|
|
134
|
+
emit(
|
|
135
|
+
DIAGNOSTIC_CODES.REPEAT_STOP_HANDLER_MISSING,
|
|
136
|
+
`Tone "${tone.id}" declares a repeating alert, but no background notification handler is registered. Its alert will not stop on its own while the app is not running. Call registerBackgroundNotificationHandler at module scope in index.js.`,
|
|
126
137
|
{ toneId: tone.id },
|
|
127
138
|
);
|
|
128
139
|
}
|
|
140
|
+
}
|
|
129
141
|
|
|
130
|
-
|
|
131
|
-
if (!capabilities.supportsRepeatingAlert) {
|
|
132
|
-
repeatUnavailable.push(tone.id);
|
|
133
|
-
emit(
|
|
134
|
-
DIAGNOSTIC_CODES.REPEAT_ALERT_UNAVAILABLE,
|
|
135
|
-
`Tone "${tone.id}" requested a repeating alert, which this platform does not offer. The notification still delivers and still sounds once.`,
|
|
136
|
-
{ toneId: tone.id },
|
|
137
|
-
);
|
|
138
|
-
} else if (!deps.engine.hasBackgroundDeliveryHandler()) {
|
|
139
|
-
// Said out loud at declaration time, because the alternative is a
|
|
140
|
-
// user meeting it as a phone that will not stop ringing.
|
|
141
|
-
emit(
|
|
142
|
-
DIAGNOSTIC_CODES.REPEAT_STOP_HANDLER_MISSING,
|
|
143
|
-
`Tone "${tone.id}" declares a repeating alert, but no background notification handler is registered. Its alert will not stop on its own while the app is not running. Call registerBackgroundNotificationHandler at module scope in index.js.`,
|
|
144
|
-
{ toneId: tone.id },
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const versionMoved = previous !== undefined && previous.appliedVersion !== tone.version;
|
|
150
|
-
|
|
151
|
-
if (previous !== undefined && !versionMoved) {
|
|
152
|
-
// The version is the same, so nothing the platform freezes has
|
|
153
|
-
// changed. Only the labels can still be stale — and correcting
|
|
154
|
-
// those must cost the user nothing, so the platform is touched
|
|
155
|
-
// only when the fingerprint actually moved.
|
|
156
|
-
if (previous.labelFingerprint === fingerprint) {
|
|
157
|
-
unchanged.push(tone.id);
|
|
158
|
-
continue;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const outcome = await deps.engine.declareTone(resolved);
|
|
162
|
-
if (outcome === 'created') {
|
|
163
|
-
// The channel was gone — deleted by the user, or lost with the
|
|
164
|
-
// app's data — so this is a first declaration rather than a
|
|
165
|
-
// refresh, whatever our ledger believed.
|
|
166
|
-
created.push(resolved.android.channelId);
|
|
167
|
-
} else if (outcome === 'labelsRefreshed') {
|
|
168
|
-
labelsRefreshed.push(tone.id);
|
|
169
|
-
emit(
|
|
170
|
-
DIAGNOSTIC_CODES.TONE_LABELS_REFRESHED,
|
|
171
|
-
`Tone "${tone.id}" had its name and description updated in place. No channel was recreated, so every setting the user adjusted on it is untouched.`,
|
|
172
|
-
{ toneId: tone.id },
|
|
173
|
-
);
|
|
174
|
-
} else {
|
|
175
|
-
unchanged.push(tone.id);
|
|
176
|
-
}
|
|
142
|
+
const versionMoved = previous !== undefined && previous.appliedVersion !== tone.version;
|
|
177
143
|
|
|
178
|
-
|
|
144
|
+
if (previous !== undefined && !versionMoved) {
|
|
145
|
+
// The version is the same, so nothing the platform freezes has
|
|
146
|
+
// changed. Only the labels can still be stale — and correcting
|
|
147
|
+
// those must cost the user nothing, so the platform is touched
|
|
148
|
+
// only when the fingerprint actually moved.
|
|
149
|
+
if (previous.labelFingerprint === fingerprint) {
|
|
150
|
+
unchanged.push(tone.id);
|
|
179
151
|
continue;
|
|
180
152
|
}
|
|
181
153
|
|
|
182
154
|
const outcome = await deps.engine.declareTone(resolved);
|
|
183
155
|
if (outcome === 'created') {
|
|
156
|
+
// The channel was gone — deleted by the user, or lost with the
|
|
157
|
+
// app's data — so this is a first declaration rather than a
|
|
158
|
+
// refresh, whatever our ledger believed.
|
|
184
159
|
created.push(resolved.android.channelId);
|
|
160
|
+
} else if (outcome === 'labelsRefreshed') {
|
|
161
|
+
labelsRefreshed.push(tone.id);
|
|
162
|
+
emit(
|
|
163
|
+
DIAGNOSTIC_CODES.TONE_LABELS_REFRESHED,
|
|
164
|
+
`Tone "${tone.id}" had its name and description updated in place. No channel was recreated, so every setting the user adjusted on it is untouched.`,
|
|
165
|
+
{ toneId: tone.id },
|
|
166
|
+
);
|
|
167
|
+
} else {
|
|
168
|
+
unchanged.push(tone.id);
|
|
185
169
|
}
|
|
186
170
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
171
|
+
recordApplied(deps.state, tone, now, undefined, fingerprint);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
191
174
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
DIAGNOSTIC_CODES.CHANNEL_MIGRATION_REQUIRED,
|
|
197
|
-
`Tone "${tone.id}" moved from version ${previous.appliedVersion} to ${tone.version}. Android channels are immutable, so a new channel was created and the old one is being retired.`,
|
|
198
|
-
{ toneId: tone.id, from: previous.appliedVersion, to: tone.version },
|
|
199
|
-
);
|
|
175
|
+
const outcome = await deps.engine.declareTone(resolved);
|
|
176
|
+
if (outcome === 'created') {
|
|
177
|
+
created.push(resolved.android.channelId);
|
|
178
|
+
}
|
|
200
179
|
|
|
201
|
-
|
|
202
|
-
|
|
180
|
+
if (previous === undefined) {
|
|
181
|
+
recordApplied(deps.state, tone, now, undefined, fingerprint);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
203
184
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
actions: entry.actions,
|
|
213
|
-
ownerTag: entry.ownerTag,
|
|
214
|
-
groupTag: entry.groupTag,
|
|
215
|
-
},
|
|
216
|
-
resolvedAt: entry.resolvedAt,
|
|
217
|
-
tone: resolved,
|
|
218
|
-
// Re-homing changes the channel, not the anchoring — preserve it.
|
|
219
|
-
anchoringGeneration: entry.anchoringGeneration,
|
|
220
|
-
approximate: entry.mayBeDelayed,
|
|
221
|
-
seriesId: entry.seriesId,
|
|
222
|
-
pushCreated: entry.pushCreated,
|
|
223
|
-
});
|
|
224
|
-
reHomed.push(entry.id);
|
|
225
|
-
}
|
|
185
|
+
// A version moved, so this is a migration rather than a first
|
|
186
|
+
// declaration. Re-home before retiring: the reverse order would leave
|
|
187
|
+
// live notifications attached to a channel that no longer exists.
|
|
188
|
+
emit(
|
|
189
|
+
DIAGNOSTIC_CODES.CHANNEL_MIGRATION_REQUIRED,
|
|
190
|
+
`Tone "${tone.id}" moved from version ${previous.appliedVersion} to ${tone.version}. Android channels are immutable, so a new channel was created and the old one is being retired.`,
|
|
191
|
+
{ toneId: tone.id, from: previous.appliedVersion, to: tone.version },
|
|
192
|
+
);
|
|
226
193
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
retired.push(previous.channelId);
|
|
230
|
-
}
|
|
194
|
+
const pending = await deps.engine.getPending();
|
|
195
|
+
const affected = pending.filter(entry => entry.tone === tone.id);
|
|
231
196
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
197
|
+
for (const entry of affected) {
|
|
198
|
+
await writer.write({
|
|
199
|
+
request: {
|
|
200
|
+
id: entry.id,
|
|
201
|
+
content: entry.content,
|
|
202
|
+
tone: entry.tone,
|
|
203
|
+
moment: { at: entry.resolvedAt, anchoring: entry.anchoring },
|
|
204
|
+
routing: entry.routing,
|
|
205
|
+
actions: entry.actions,
|
|
206
|
+
ownerTag: entry.ownerTag,
|
|
207
|
+
groupTag: entry.groupTag,
|
|
208
|
+
},
|
|
209
|
+
resolvedAt: entry.resolvedAt,
|
|
210
|
+
tone: resolved,
|
|
211
|
+
// Re-homing changes the channel, not the anchoring — preserve it.
|
|
212
|
+
anchoringGeneration: entry.anchoringGeneration,
|
|
213
|
+
approximate: entry.mayBeDelayed,
|
|
214
|
+
seriesId: entry.seriesId,
|
|
215
|
+
pushCreated: entry.pushCreated,
|
|
216
|
+
});
|
|
217
|
+
reHomed.push(entry.id);
|
|
237
218
|
}
|
|
238
219
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (orphans.length > 0) {
|
|
243
|
-
await deps.engine.cancelMany(orphans);
|
|
244
|
-
cancelled.push(...orphans);
|
|
245
|
-
emit(
|
|
246
|
-
DIAGNOSTIC_CODES.CHANNEL_ORPHANS_FOUND,
|
|
247
|
-
`${orphans.length} notification(s) remained on a retired channel and were cancelled, rather than left uncontrollable from system settings.`,
|
|
248
|
-
{ count: orphans.length },
|
|
249
|
-
);
|
|
220
|
+
const didRetire = await deps.engine.retireTone(previous.channelId);
|
|
221
|
+
if (didRetire) {
|
|
222
|
+
retired.push(previous.channelId);
|
|
250
223
|
}
|
|
251
224
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
225
|
+
// A version move outranks a label change: the new channel simply
|
|
226
|
+
// carries the new labels, and reporting it as a refresh would hide a
|
|
227
|
+
// migration the consumer needs to know about.
|
|
228
|
+
migrated.push({ toneId: tone.id, from: previous.appliedVersion, to: tone.version });
|
|
229
|
+
recordApplied(deps.state, tone, now, previous.channelId, fingerprint);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Anything left on a retired channel would be an orphan — a notification
|
|
233
|
+
// the user can no longer control from system settings.
|
|
234
|
+
const orphans = await findOrphans(deps, tones);
|
|
235
|
+
if (orphans.length > 0) {
|
|
236
|
+
await deps.engine.cancelMany(orphans);
|
|
237
|
+
cancelled.push(...orphans);
|
|
238
|
+
emit(
|
|
239
|
+
DIAGNOSTIC_CODES.CHANNEL_ORPHANS_FOUND,
|
|
240
|
+
`${orphans.length} notification(s) remained on a retired channel and were cancelled, rather than left uncontrollable from system settings.`,
|
|
241
|
+
{ count: orphans.length },
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
created,
|
|
247
|
+
migrated,
|
|
248
|
+
labelsRefreshed,
|
|
249
|
+
retired,
|
|
250
|
+
reHomed,
|
|
251
|
+
cancelled,
|
|
252
|
+
bypassUnavailable,
|
|
253
|
+
repeatUnavailable,
|
|
254
|
+
unchanged,
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
return {
|
|
259
|
+
/**
|
|
260
|
+
* Applies a tone configuration, migrating any tone whose version moved.
|
|
261
|
+
*
|
|
262
|
+
* Applying an unchanged configuration performs no work at all: no channel
|
|
263
|
+
* is recreated and no migration is triggered.
|
|
264
|
+
*/
|
|
265
|
+
apply(
|
|
266
|
+
tones: readonly ToneDeclaration[],
|
|
267
|
+
groups: readonly ChannelGroup[] = [],
|
|
268
|
+
): Promise<ChannelApplyResult> {
|
|
269
|
+
// The declared channels are read once for the whole apply rather than once
|
|
270
|
+
// per tone, when the engine can hold them (NOT-08).
|
|
271
|
+
const run = () => applyTones(tones, groups);
|
|
272
|
+
return deps.engine.withChannelSnapshot ? deps.engine.withChannelSnapshot(run) : run();
|
|
263
273
|
},
|
|
264
274
|
|
|
265
275
|
/** Which version of each tone this device actually holds. */
|
|
@@ -278,8 +288,16 @@ async function findOrphans(
|
|
|
278
288
|
tones: readonly ToneDeclaration[],
|
|
279
289
|
): Promise<readonly string[]> {
|
|
280
290
|
const declared = new Set(tones.map(tone => tone.id));
|
|
291
|
+
// Only tones this package once applied can leave orphans (NOT-05). An entry
|
|
292
|
+
// with no tone metadata was scheduled by other code through the same engine,
|
|
293
|
+
// and a tone the ledger has never seen is not ours to judge either: cancelling
|
|
294
|
+
// on "not in this call's list" silently deleted other libraries' notifications,
|
|
295
|
+
// and a feature module's own when it applied only its subset of tones.
|
|
296
|
+
const onceApplied = new Set(deps.state.read().migrationLedger.map(entry => entry.toneId));
|
|
281
297
|
const pending = await deps.engine.getPending();
|
|
282
|
-
return pending
|
|
298
|
+
return pending
|
|
299
|
+
.filter(entry => entry.tone !== '' && onceApplied.has(entry.tone) && !declared.has(entry.tone))
|
|
300
|
+
.map(entry => entry.id);
|
|
283
301
|
}
|
|
284
302
|
|
|
285
303
|
export type Channels = ReturnType<typeof createChannels>;
|
package/src/channel/tone-map.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import type { ResolvedTone, ToneDeclaration, ToneUrgency } from '../contract/channel';
|
|
16
|
+
import { fnv1a, hex8 } from '../contract/hash';
|
|
16
17
|
|
|
17
18
|
type AndroidImportance = ResolvedTone['android']['importance'];
|
|
18
19
|
type IosInterruption = ResolvedTone['ios']['interruptionLevel'];
|
|
@@ -109,16 +110,7 @@ export function toneLabelFingerprint(tone: ToneDeclaration): string {
|
|
|
109
110
|
// of the two would never get its correction.
|
|
110
111
|
const source = `${tone.name}\u0000${tone.description ?? ''}`;
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
// arithmetic equivalents would not wrap to 32 bits and the hash would drift.
|
|
114
|
-
/* eslint-disable no-bitwise */
|
|
115
|
-
let hash = 0x811c9dc5;
|
|
116
|
-
for (let index = 0; index < source.length; index += 1) {
|
|
117
|
-
hash ^= source.codePointAt(index) ?? 0;
|
|
118
|
-
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
119
|
-
}
|
|
120
|
-
return (hash >>> 0).toString(16).padStart(8, '0');
|
|
121
|
-
/* eslint-enable no-bitwise */
|
|
113
|
+
return hex8(fnv1a(source));
|
|
122
114
|
}
|
|
123
115
|
|
|
124
116
|
/** Builds a lookup over a declared configuration. */
|
package/src/contract/errors.ts
CHANGED
|
@@ -73,6 +73,12 @@ export const DIAGNOSTIC_CODES = {
|
|
|
73
73
|
/** The durable store could not open; state lasts for this session only. */
|
|
74
74
|
STATE_STORE_DEGRADED: 'STATE_STORE_DEGRADED',
|
|
75
75
|
STATE_CAP_EVICTED: 'STATE_CAP_EVICTED',
|
|
76
|
+
/**
|
|
77
|
+
* A ledger holds more live entries than its cap (0.6.0). They are all kept:
|
|
78
|
+
* dropping a live series or channel record would lose a migration or reset a
|
|
79
|
+
* series count. Reported so the cap can be raised or the app's use reviewed.
|
|
80
|
+
*/
|
|
81
|
+
STATE_CAP_EXCEEDED: 'STATE_CAP_EXCEEDED',
|
|
76
82
|
|
|
77
83
|
// --- Volume --------------------------------------------------------------
|
|
78
84
|
BURST_THRESHOLD_EXCEEDED: 'BURST_THRESHOLD_EXCEEDED',
|
|
@@ -129,6 +135,7 @@ export const NON_FAILURE_CODES: readonly DiagnosticCode[] = Object.freeze([
|
|
|
129
135
|
DIAGNOSTIC_CODES.PAYLOAD_VERSION_SKEW,
|
|
130
136
|
DIAGNOSTIC_CODES.PAYLOAD_DUPLICATE,
|
|
131
137
|
DIAGNOSTIC_CODES.STATE_CAP_EVICTED,
|
|
138
|
+
DIAGNOSTIC_CODES.STATE_CAP_EXCEEDED,
|
|
132
139
|
DIAGNOSTIC_CODES.STATE_CORRUPT_REBUILT,
|
|
133
140
|
DIAGNOSTIC_CODES.BACKGROUND_RESTRICTION_UNKNOWN,
|
|
134
141
|
DIAGNOSTIC_CODES.DND_BYPASS_UNAVAILABLE,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FNV-1a, 32-bit: the package's one hash (NOT-19). Deterministic,
|
|
3
|
+
* dependency-free, and stable across releases.
|
|
4
|
+
*
|
|
5
|
+
* Bitwise operators are the algorithm, not a micro-optimisation: arithmetic
|
|
6
|
+
* equivalents would not wrap to 32 bits. Stability matters: a marker id or a
|
|
7
|
+
* label fingerprint that changed between releases would orphan every marker
|
|
8
|
+
* already scheduled, or refresh every channel label once more.
|
|
9
|
+
*/
|
|
10
|
+
export const FNV_OFFSET_BASIS = 0x811c9dc5;
|
|
11
|
+
|
|
12
|
+
/* eslint-disable no-bitwise */
|
|
13
|
+
export function fnv1a(value: string, basis: number = FNV_OFFSET_BASIS): number {
|
|
14
|
+
let hash = basis;
|
|
15
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
16
|
+
hash ^= value.codePointAt(index) ?? 0;
|
|
17
|
+
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
18
|
+
}
|
|
19
|
+
return hash >>> 0;
|
|
20
|
+
}
|
|
21
|
+
/* eslint-enable no-bitwise */
|
|
22
|
+
|
|
23
|
+
/** Eight lowercase hex digits. */
|
|
24
|
+
export function hex8(value: number): string {
|
|
25
|
+
return value.toString(16).padStart(8, '0');
|
|
26
|
+
}
|