@chipmobilesdk/rn-notification 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -0
- package/README.md +8 -6
- 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 +72 -26
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The persisted state record.
|
|
3
|
+
*
|
|
4
|
+
* Six collections, holding only what the platform will not tell us. No
|
|
5
|
+
* notification content, no push token, no desired set. The interaction buffer
|
|
6
|
+
* is the sole content-bearing exception, and it evicts on delivery.
|
|
7
|
+
*
|
|
8
|
+
* Corrupt or incompatible state is discarded and rebuilt rather than blocking:
|
|
9
|
+
* everything already scheduled lives in the OS and is unaffected, which is what
|
|
10
|
+
* makes discarding safe rather than destructive.
|
|
11
|
+
*/
|
|
12
|
+
import type { StateStore } from './store.js';
|
|
13
|
+
import { type CollectionName, type Timestamped } from './caps.js';
|
|
14
|
+
import type { AnchoringMode, RoutingPayload } from '../contract/notification.js';
|
|
15
|
+
import type { StateHealth } from '../contract/diagnostics.js';
|
|
16
|
+
import { type DiagnosticCode } from '../contract/errors.js';
|
|
17
|
+
/**
|
|
18
|
+
* Bumped whenever the shape below changes. A mismatch discards and rebuilds —
|
|
19
|
+
* never a migration, because none of this data is worth migrating and all of it
|
|
20
|
+
* is reconstructible.
|
|
21
|
+
*/
|
|
22
|
+
export declare const STATE_SCHEMA_VERSION = 1;
|
|
23
|
+
export interface DedupEntry extends Timestamped {
|
|
24
|
+
readonly dedupId: string;
|
|
25
|
+
readonly ownerTag?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BufferedInteraction extends Timestamped {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly kind: 'tap' | 'action' | 'dismiss';
|
|
30
|
+
readonly notificationId: string;
|
|
31
|
+
readonly actionId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Only ever present in a record written before 0.5: typed replies are no
|
|
34
|
+
* longer persisted (interaction-buffer.ts).
|
|
35
|
+
*/
|
|
36
|
+
readonly inputText?: string;
|
|
37
|
+
/** The one content-bearing thing persisted. Evicted the moment it is delivered. */
|
|
38
|
+
readonly routing?: RoutingPayload;
|
|
39
|
+
readonly ownerTag?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface MigrationEntry extends Timestamped {
|
|
42
|
+
readonly toneId: string;
|
|
43
|
+
readonly appliedVersion: number;
|
|
44
|
+
readonly channelId: string;
|
|
45
|
+
readonly retired: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Fingerprint of the labels last pushed to the platform.
|
|
48
|
+
*
|
|
49
|
+
* Optional because records written before labels were carried at all have
|
|
50
|
+
* none — and their absence is exactly right: an unknown fingerprint refreshes
|
|
51
|
+
* once, which is the one-time correction every existing device needs, since
|
|
52
|
+
* every existing channel currently carries the tone id as its name.
|
|
53
|
+
*
|
|
54
|
+
* A fingerprint rather than the labels themselves. Persisted state holds no
|
|
55
|
+
* consumer text, and a hash answers the only question asked of it.
|
|
56
|
+
*/
|
|
57
|
+
readonly labelFingerprint?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface SeriesEntry extends Timestamped {
|
|
60
|
+
readonly seriesId: string;
|
|
61
|
+
readonly anchoring: AnchoringMode;
|
|
62
|
+
readonly expandedThrough: number;
|
|
63
|
+
readonly emittedCount: number;
|
|
64
|
+
readonly exhausted: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Calendar key of the latest occurrence counted into `emittedCount`. Absent in
|
|
67
|
+
* entries written before 0.4.0; recovered from the device on next expansion.
|
|
68
|
+
*/
|
|
69
|
+
readonly lastEmittedKey?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PermissionHistoryEntry extends Timestamped {
|
|
72
|
+
readonly key: string;
|
|
73
|
+
readonly requested: boolean;
|
|
74
|
+
/** Requests the user refused, so a permanent denial can be told apart (0.6.0). */
|
|
75
|
+
readonly denials?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface StateRecord {
|
|
78
|
+
readonly schemaVersion: number;
|
|
79
|
+
readonly dedupLedger: readonly DedupEntry[];
|
|
80
|
+
readonly interactionBuffer: readonly BufferedInteraction[];
|
|
81
|
+
readonly migrationLedger: readonly MigrationEntry[];
|
|
82
|
+
readonly seriesLedger: readonly SeriesEntry[];
|
|
83
|
+
readonly permissionHistory: readonly PermissionHistoryEntry[];
|
|
84
|
+
readonly lastReconcileSummary?: Readonly<Record<string, unknown>>;
|
|
85
|
+
readonly lastMaintenanceSummary?: Readonly<Record<string, unknown>>;
|
|
86
|
+
}
|
|
87
|
+
export declare function emptyRecord(): StateRecord;
|
|
88
|
+
export interface StateEvent {
|
|
89
|
+
readonly code: DiagnosticCode;
|
|
90
|
+
readonly context?: Readonly<Record<string, unknown>>;
|
|
91
|
+
}
|
|
92
|
+
export interface StateManagerOptions {
|
|
93
|
+
readonly store: StateStore;
|
|
94
|
+
readonly now: () => number;
|
|
95
|
+
readonly emit?: (event: StateEvent) => void;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Owns the record's lifecycle. Reads are synchronous and cheap; writes are
|
|
99
|
+
* best-effort and never propagate a failure to the caller's operation.
|
|
100
|
+
*/
|
|
101
|
+
export declare class StateManager {
|
|
102
|
+
private record;
|
|
103
|
+
private rebuilt;
|
|
104
|
+
private readonly store;
|
|
105
|
+
private readonly now;
|
|
106
|
+
private readonly emit;
|
|
107
|
+
constructor(options: StateManagerOptions);
|
|
108
|
+
private load;
|
|
109
|
+
/** Reads the pre-0.6.0 single record, writes it out per collection, and drops it. */
|
|
110
|
+
private migrateLegacy;
|
|
111
|
+
private discardAndRebuild;
|
|
112
|
+
private deleteAll;
|
|
113
|
+
/** Never throws. A storage failure degrades the affected guarantee, nothing more. */
|
|
114
|
+
private write;
|
|
115
|
+
/** Writes one collection, and only that one. */
|
|
116
|
+
private persist;
|
|
117
|
+
/** The schema version and summaries. Present whenever any collection is stored. */
|
|
118
|
+
private persistMeta;
|
|
119
|
+
read(): StateRecord;
|
|
120
|
+
/** Applies a change, evicts the touched collection, and persists. */
|
|
121
|
+
update<K extends CollectionName>(collection: K, mutate: (current: StateRecord[K]) => StateRecord[K]): void;
|
|
122
|
+
setSummary(key: 'lastReconcileSummary' | 'lastMaintenanceSummary', value: Readonly<Record<string, unknown>>): void;
|
|
123
|
+
/** Clears everything. Public through `resetState()`. */
|
|
124
|
+
reset(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Clears one owner tag's entries, leaving every other tag untouched.
|
|
127
|
+
*
|
|
128
|
+
* Collections without an owner tag are left alone: a migration ledger and a
|
|
129
|
+
* series ledger describe the device, not an account.
|
|
130
|
+
*/
|
|
131
|
+
clearOwner(ownerTag: string): void;
|
|
132
|
+
health(): StateHealth;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../src/state/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAC1C,OAAO,EAA0B,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,WAAQ,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,6BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,4BAAyB,CAAC;AAC7E,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,uBAAoB,CAAC;AAoB3E;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,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IAAI,CAA8B;gBAEvC,OAAO,EAAE,mBAAmB;IAOxC,OAAO,CAAC,IAAI;IAgCZ,qFAAqF;IACrF,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,SAAS;IAQjB,qFAAqF;IACrF,OAAO,CAAC,KAAK;IAWb,gDAAgD;IAChD,OAAO,CAAC,OAAO;IAIf,mFAAmF;IACnF,OAAO,CAAC,WAAW;IAQnB,IAAI,IAAI,WAAW;IAInB,qEAAqE;IACrE,MAAM,CAAC,CAAC,SAAS,cAAc,EAC9B,UAAU,EAAE,CAAC,EACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,GACjD,IAAI;IA4BP,UAAU,CACT,GAAG,EAAE,sBAAsB,GAAG,wBAAwB,EACtD,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACtC,IAAI;IAKP,wDAAwD;IACxD,KAAK,IAAI,IAAI;IAOb;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAclC,MAAM,IAAI,WAAW;CAoBrB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public state reset and per-owner clearing.
|
|
3
|
+
*
|
|
4
|
+
* These are the only two ways a consumer may touch the persisted record. The
|
|
5
|
+
* record itself is unreachable — a consumer can discard state, but can never
|
|
6
|
+
* read or write it.
|
|
7
|
+
*/
|
|
8
|
+
import type { StateManager } from './record.js';
|
|
9
|
+
export interface ResetOutcome {
|
|
10
|
+
readonly clearedCollections: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Discards the entire record. Nothing already scheduled with the OS is affected. */
|
|
13
|
+
export declare function resetState(state: StateManager): ResetOutcome;
|
|
14
|
+
/**
|
|
15
|
+
* Clears one owner tag's entries on sign-out.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately narrower than a full reset: the migration and series ledgers
|
|
18
|
+
* describe the device rather than an account, so signing one account out must
|
|
19
|
+
* not discard channel migration history that every account depends on.
|
|
20
|
+
*/
|
|
21
|
+
export declare function clearOwner(state: StateManager, ownerTag: string): ResetOutcome;
|
|
22
|
+
//# sourceMappingURL=reset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../../src/state/reset.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC;AAE7C,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAW5D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAK9E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The recurrence series ledger.
|
|
3
|
+
*
|
|
4
|
+
* What makes automatic maintenance possible without a desired set from the
|
|
5
|
+
* consumer: the package remembers which series it owns, how far each has been
|
|
6
|
+
* expanded, and how many occurrences a count-limited series has already
|
|
7
|
+
* emitted. None of that is derivable from the platform's pending set, which
|
|
8
|
+
* knows only about individual notifications.
|
|
9
|
+
*
|
|
10
|
+
* It also defines what maintenance is allowed to touch. An occurrence belongs
|
|
11
|
+
* to a series in this ledger, so cancelling it is within scope; anything else
|
|
12
|
+
* is a directly-scheduled notification the package does not own.
|
|
13
|
+
*/
|
|
14
|
+
import type { StateManager } from './record.js';
|
|
15
|
+
import type { RecurrenceRule } from '../contract/recurrence.js';
|
|
16
|
+
import type { AnchoringMode } from '../contract/notification.js';
|
|
17
|
+
export interface SeriesRecord {
|
|
18
|
+
readonly seriesId: string;
|
|
19
|
+
readonly anchoring: AnchoringMode;
|
|
20
|
+
readonly expandedThrough: number;
|
|
21
|
+
readonly emittedCount: number;
|
|
22
|
+
readonly exhausted: boolean;
|
|
23
|
+
readonly lastEmittedKey?: string;
|
|
24
|
+
readonly at: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function readSeries(state: StateManager, seriesId: string): SeriesRecord | undefined;
|
|
27
|
+
export declare function listSeries(state: StateManager): readonly SeriesRecord[];
|
|
28
|
+
/** Records or updates a series. Replaces in place so a re-registration cannot duplicate. */
|
|
29
|
+
export declare function upsertSeries(state: StateManager, rule: RecurrenceRule, update: {
|
|
30
|
+
readonly expandedThrough: number;
|
|
31
|
+
readonly emittedCount: number;
|
|
32
|
+
readonly exhausted: boolean;
|
|
33
|
+
readonly lastEmittedKey?: string;
|
|
34
|
+
}, now: number): void;
|
|
35
|
+
export declare function removeSeries(state: StateManager, seriesId: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Identifiers the package owns.
|
|
38
|
+
*
|
|
39
|
+
* An occurrence identifier is `<seriesId>#<instant>`, so ownership is decided
|
|
40
|
+
* by prefix rather than by an enumeration the ledger would have to keep in sync
|
|
41
|
+
* with the device. That keeps the check correct even for occurrences scheduled
|
|
42
|
+
* before the app last restarted.
|
|
43
|
+
*/
|
|
44
|
+
export declare function ownsIdentifier(state: StateManager, id: string): boolean;
|
|
45
|
+
/** Every occurrence identifier currently attributable to a tracked series. */
|
|
46
|
+
export declare function ownedIdentifiers(state: StateManager, pendingIds: readonly string[]): ReadonlySet<string>;
|
|
47
|
+
//# sourceMappingURL=series-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series-ledger.d.ts","sourceRoot":"","sources":["../../../../src/state/series-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,aAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2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AM,CAAC,CAErB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The storage port behind the persisted state record.
|
|
3
|
+
*
|
|
4
|
+
* Kept as a port so the pure state logic is testable with no native module,
|
|
5
|
+
* and so MMKV stays confined to one file. This is internal — a consumer can
|
|
6
|
+
* reset or clear state, but can never read or write the record directly.
|
|
7
|
+
*/
|
|
8
|
+
export interface StateStore {
|
|
9
|
+
getString(key: string): string | undefined;
|
|
10
|
+
setString(key: string, value: string): void;
|
|
11
|
+
delete(key: string): void;
|
|
12
|
+
clearAll(): void;
|
|
13
|
+
/** Approximate on-disk size, for the health report. */
|
|
14
|
+
approximateBytes(): number;
|
|
15
|
+
/** False when writes do not survive a restart (the memory fallback). */
|
|
16
|
+
readonly durable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** In-memory store, used by tests and as the fallback when MMKV is unavailable. */
|
|
19
|
+
export declare function createMemoryStore(): StateStore;
|
|
20
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/state/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,UAAU;IAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,IAAI,IAAI,CAAC;IACjB,uDAAuD;IACvD,gBAAgB,IAAI,MAAM,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,IAAI,UAAU,CAsB9C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared conformance suite.
|
|
3
|
+
*
|
|
4
|
+
* The executable definition of what an engine adapter must do. Run against the
|
|
5
|
+
* real engine and against the fake, it is what backs the claim that testing
|
|
6
|
+
* with fakes proves something about production — if the two ever diverge, this
|
|
7
|
+
* is where it shows up rather than on a user's device.
|
|
8
|
+
*
|
|
9
|
+
* Written as a plain async function rather than a Jest suite so it can be
|
|
10
|
+
* driven from the demo app on a real device as well as from continuous
|
|
11
|
+
* integration.
|
|
12
|
+
*/
|
|
13
|
+
import type { NotificationEngineAdapter } from '../../engine/adapter.js';
|
|
14
|
+
export interface ConformanceCheck {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly passed: boolean;
|
|
17
|
+
readonly detail?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ConformanceReport {
|
|
20
|
+
readonly adapter: string;
|
|
21
|
+
readonly checks: readonly ConformanceCheck[];
|
|
22
|
+
readonly passed: number;
|
|
23
|
+
readonly failed: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ConformanceOptions {
|
|
26
|
+
/** Injected so the suite never depends on wall-clock time. */
|
|
27
|
+
readonly now?: () => number;
|
|
28
|
+
/** Identifier prefix, so a device run cannot collide with real notifications. */
|
|
29
|
+
readonly prefix?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function runConformanceSuite(adapter: NotificationEngineAdapter, options?: ConformanceOptions): Promise<ConformanceReport>;
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/testing/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAsB,CAAC;AAwBtE,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,yBAAyB,EAClC,OAAO,GAAE,kBAAuB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAqM5B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory engine for tests.
|
|
3
|
+
*
|
|
4
|
+
* Exists so every decision path is provable with no device, no emulator, and
|
|
5
|
+
* no live provider. Its controls simulate the conditions that are otherwise
|
|
6
|
+
* only reachable on hardware: virtual time, time-zone travel, permission
|
|
7
|
+
* transitions, process death, boot-restoration gaps, and platform truncation.
|
|
8
|
+
*/
|
|
9
|
+
import type { NotificationEngineAdapter } from '../engine/adapter.js';
|
|
10
|
+
import type { PermissionKind, PermissionState, RestrictionReport } from '../contract/permission.js';
|
|
11
|
+
import type { InteractionEvent } from '../contract/interaction.js';
|
|
12
|
+
export interface FakeEngineOptions {
|
|
13
|
+
readonly pendingCeiling?: number;
|
|
14
|
+
readonly supportsExactAlarms?: boolean;
|
|
15
|
+
readonly supportsDoNotDisturbBypass?: boolean;
|
|
16
|
+
readonly supportsRepeatingAlert?: boolean;
|
|
17
|
+
readonly backgroundWindowMs?: number;
|
|
18
|
+
readonly initialPermissions?: Partial<Record<PermissionKind, PermissionState>>;
|
|
19
|
+
readonly timeZone?: string;
|
|
20
|
+
readonly now?: number;
|
|
21
|
+
}
|
|
22
|
+
/** Every platform operation the engine was asked to perform, in order. */
|
|
23
|
+
export interface RecordedOperation {
|
|
24
|
+
readonly kind: 'schedule' | 'cancel' | 'cancelAll' | 'declareTone' | 'retireTone' | 'silence';
|
|
25
|
+
readonly id?: string;
|
|
26
|
+
readonly at: number;
|
|
27
|
+
}
|
|
28
|
+
/** A notification the fake has delivered to the tray. */
|
|
29
|
+
export interface DisplayedNotification {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly tone: string;
|
|
32
|
+
/** Whether its alert is still sounding — the property repeat expiry is about. */
|
|
33
|
+
readonly alerting: boolean;
|
|
34
|
+
readonly deliveredAt: number;
|
|
35
|
+
}
|
|
36
|
+
export interface FakeControls {
|
|
37
|
+
/** Operations recorded since the last reset. The idempotence assertion reads this. */
|
|
38
|
+
readonly operations: readonly RecordedOperation[];
|
|
39
|
+
clearOperations(): void;
|
|
40
|
+
/** Virtual clock, so tests never sleep. */
|
|
41
|
+
now(): number;
|
|
42
|
+
advanceTime(ms: number): void;
|
|
43
|
+
setTime(epochMs: number): void;
|
|
44
|
+
/** Simulates the user travelling. */
|
|
45
|
+
timeZone(): string;
|
|
46
|
+
setTimeZone(zone: string): void;
|
|
47
|
+
setPermission(kind: PermissionKind, state: PermissionState): void;
|
|
48
|
+
setRestrictions(report: Partial<RestrictionReport>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Drops entries the platform would have silently discarded past its ceiling,
|
|
51
|
+
* so truncation behavior is testable without an iOS device.
|
|
52
|
+
*/
|
|
53
|
+
applyPlatformCeiling(): readonly string[];
|
|
54
|
+
/**
|
|
55
|
+
* Simulates the process dying: in-memory listeners are lost while scheduled
|
|
56
|
+
* notifications survive, which is exactly what happens on a real device.
|
|
57
|
+
*/
|
|
58
|
+
simulateProcessDeath(): void;
|
|
59
|
+
/** Simulates a manufacturer losing notifications across a reboot. */
|
|
60
|
+
simulateBootGap(ids: readonly string[]): void;
|
|
61
|
+
/** Queues an interaction that arrived before any handler existed. */
|
|
62
|
+
emitInteraction(event: InteractionEvent): void;
|
|
63
|
+
/**
|
|
64
|
+
* An interaction while the app is not in front: live `subscribeToInteractions`
|
|
65
|
+
* handlers get it, otherwise the registered background handler does.
|
|
66
|
+
*/
|
|
67
|
+
emitBackgroundInteraction(event: InteractionEvent): Promise<void>;
|
|
68
|
+
queueInitialInteraction(event: InteractionEvent): void;
|
|
69
|
+
/** The labels a declared channel currently carries, so a label refresh is assertable. */
|
|
70
|
+
channelLabels(channelId: string): {
|
|
71
|
+
name: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
} | undefined;
|
|
74
|
+
/** Whether a delivered notification's alert is still sounding. */
|
|
75
|
+
isAlerting(id: string): boolean;
|
|
76
|
+
/** The tray. Distinct from the pending set: expiry is about what is *displayed*. */
|
|
77
|
+
displayed(): readonly DisplayedNotification[];
|
|
78
|
+
/**
|
|
79
|
+
* Fires every trigger whose instant has passed, in order, on the virtual clock.
|
|
80
|
+
*
|
|
81
|
+
* The fake modelled time, process death, and boot gaps but never modelled
|
|
82
|
+
* delivery — and expiry is a delivery-ordering property. Without this, proving
|
|
83
|
+
* that an alert stops on its own would need a real device or a real wait.
|
|
84
|
+
*/
|
|
85
|
+
deliverDue(): Promise<readonly string[]>;
|
|
86
|
+
/** Simulates the user acting on a delivered notification: the alert stops, the entry goes. */
|
|
87
|
+
handleDisplayed(id: string): void;
|
|
88
|
+
}
|
|
89
|
+
export type FakeEngine = NotificationEngineAdapter & FakeControls;
|
|
90
|
+
export declare function createFakeEngine(options?: FakeEngineOptions): FakeEngine;
|
|
91
|
+
//# sourceMappingURL=fake-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-engine.d.ts","sourceRoot":"","sources":["../../../../src/testing/fake-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,yBAAyB,EAMzB,MAAM,sBAAmB,CAAC;AAE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,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,MAAM,UAAU,GAAG,yBAAyB,GAAG,YAAY,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAyW5E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory push provider for tests.
|
|
3
|
+
*
|
|
4
|
+
* Exists so the entire push surface — token lifecycle, receipt in every app
|
|
5
|
+
* state, malformed payloads, redelivery, and provider unavailability — is
|
|
6
|
+
* provable with no live provider and no device.
|
|
7
|
+
*
|
|
8
|
+
* It is also the second adapter that proves the swap costs a consumer nothing:
|
|
9
|
+
* running the full push suite against this instead of the real provider must
|
|
10
|
+
* pass with zero changes to consuming code.
|
|
11
|
+
*/
|
|
12
|
+
import type { PushAvailability, PushProviderAdapter } from '../push/provider-adapter.js';
|
|
13
|
+
export interface FakeProviderOptions {
|
|
14
|
+
readonly name?: string;
|
|
15
|
+
readonly availability?: PushAvailability;
|
|
16
|
+
readonly initialToken?: string;
|
|
17
|
+
/** When true, `getToken` resolves only after `releaseToken()` is called. */
|
|
18
|
+
readonly withholdToken?: boolean;
|
|
19
|
+
readonly invalidationSucceeds?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface FakeProviderControls {
|
|
22
|
+
/** Delivers a raw payload as the provider would. */
|
|
23
|
+
deliver(raw: unknown): void;
|
|
24
|
+
/** Queues the payload that launched the app. */
|
|
25
|
+
queueInitial(raw: unknown): void;
|
|
26
|
+
/** Simulates the platform rotating the registration token. */
|
|
27
|
+
rotateToken(token: string): void;
|
|
28
|
+
/** Resolves a withheld token, so "waits for availability" is testable. */
|
|
29
|
+
releaseToken(token: string): void;
|
|
30
|
+
setAvailability(availability: PushAvailability): void;
|
|
31
|
+
readonly invalidated: boolean;
|
|
32
|
+
}
|
|
33
|
+
export type FakeProvider = PushProviderAdapter & FakeProviderControls;
|
|
34
|
+
export declare function createFakeProvider(options?: FakeProviderOptions): FakeProvider;
|
|
35
|
+
//# sourceMappingURL=fake-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-provider.d.ts","sourceRoot":"","sources":["../../../../src/testing/fake-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,6BAA0B,CAAC;AAGtF,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,oBAAoB;IACpC,oDAAoD;IACpD,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,gDAAgD;IAChD,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,8DAA8D;IAC9D,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,0EAA0E;IAC1E,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,CAAC,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,YAAY,CAsFlF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fault injection.
|
|
3
|
+
*
|
|
4
|
+
* Every documented failure condition must be reachable on demand, or the claim
|
|
5
|
+
* that each has its own distinct diagnostic is untestable. This is what the
|
|
6
|
+
* demo app's fault panel and the conformance suite both drive.
|
|
7
|
+
*/
|
|
8
|
+
import { type DiagnosticCode } from '../contract/errors.js';
|
|
9
|
+
export type FaultKind = DiagnosticCode;
|
|
10
|
+
export interface FaultRecord {
|
|
11
|
+
readonly code: DiagnosticCode;
|
|
12
|
+
readonly at: number;
|
|
13
|
+
}
|
|
14
|
+
export interface Disposable {
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface FaultInjectorOptions {
|
|
18
|
+
readonly now?: () => number;
|
|
19
|
+
readonly emit?: (code: string, message: string, context?: Record<string, unknown>) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Triggers a named condition and records that it fired.
|
|
23
|
+
*
|
|
24
|
+
* Deliberately a thin mechanism: it proves each identifier is reachable and
|
|
25
|
+
* distinct, which is the property under test. Making the *real* condition occur
|
|
26
|
+
* is each module's own test's job.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createFaultInjector(options?: FaultInjectorOptions): {
|
|
29
|
+
/** Every condition a consumer can reach from the fault panel. */
|
|
30
|
+
available: readonly DiagnosticCode[];
|
|
31
|
+
inject(kind: FaultKind): Disposable;
|
|
32
|
+
readonly fired: readonly FaultRecord[];
|
|
33
|
+
/** Which documented conditions have not yet been exercised. */
|
|
34
|
+
unexercised(): readonly DiagnosticCode[];
|
|
35
|
+
reset(): void;
|
|
36
|
+
};
|
|
37
|
+
export type FaultInjector = ReturnType<typeof createFaultInjector>;
|
|
38
|
+
//# sourceMappingURL=faults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faults.d.ts","sourceRoot":"","sources":["../../../../src/testing/faults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,uBAAoB,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC;AAEvC,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IAC1B,OAAO,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,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;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB;IAMpE,iEAAiE;;iBAGpD,SAAS,GAAG,UAAU;oBAatB,SAAS,WAAW,EAAE;IAInC,+DAA+D;mBAChD,SAAS,cAAc,EAAE;aAK/B,IAAI;EAId;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only surface: `@chipmobilesdk/rn-notification/testing`
|
|
3
|
+
*
|
|
4
|
+
* Kept behind its own subpath so fakes and fault injection never reach a
|
|
5
|
+
* production bundle. Everything here exists so that scheduling, reconciliation,
|
|
6
|
+
* permission transitions, tone mapping, and interaction routing are provable
|
|
7
|
+
* with no device, no emulator, and no live provider.
|
|
8
|
+
*/
|
|
9
|
+
export { createFakeEngine } from './fake-engine.js';
|
|
10
|
+
export { createFakeProvider } from './fake-provider.js';
|
|
11
|
+
export { createFaultInjector } from './faults.js';
|
|
12
|
+
export { runConformanceSuite } from './conformance/index.js';
|
|
13
|
+
export { runMeasurementHarness, PERF_BUDGETS } from './measure.js';
|
|
14
|
+
export type { MeasurementReport, Measurement, BudgetName, MeasureOptions } from './measure.js';
|
|
15
|
+
export type { ConformanceReport, ConformanceCheck, ConformanceOptions } from './conformance/index.js';
|
|
16
|
+
export type { FaultInjector, FaultKind, FaultRecord, Disposable } from './faults.js';
|
|
17
|
+
export type { FakeProvider, FakeProviderOptions, FakeProviderControls } from './fake-provider.js';
|
|
18
|
+
export type { FakeEngine, FakeEngineOptions, FakeControls, RecordedOperation } from './fake-engine.js';
|
|
19
|
+
/** In-memory state store, for testing state behavior without a native module. */
|
|
20
|
+
export { createMemoryStore } from '../state/store.js';
|
|
21
|
+
export type { StateStore } from '../state/store.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAe,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAU,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAe,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,cAAW,CAAC;AAChE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAW,CAAC;AAC5F,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AAC7F,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAU,CAAC;AAClF,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAiB,CAAC;AAC/F,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAe,CAAC;AAEpG,iFAAiF;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAgB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PERF-001 measurement harness.
|
|
3
|
+
*
|
|
4
|
+
* Every budget in the specification, measured against the real code paths and
|
|
5
|
+
* reported as pass or fail with the number that produced the verdict. Written
|
|
6
|
+
* as a plain async function rather than a Jest suite so the same harness runs
|
|
7
|
+
* in continuous integration and from the demo app on a physical device — which
|
|
8
|
+
* matters, because PERF-003 forbids emulator numbers standing in as evidence.
|
|
9
|
+
*
|
|
10
|
+
* Five budgets are deliberately absent and reported as such: delivery accuracy,
|
|
11
|
+
* cold-start latency, startup delta and frame rate cannot be measured
|
|
12
|
+
* in-process. The first needs the OS to actually fire an alarm, the second a
|
|
13
|
+
* real process death. Pretending to measure them here would be worse than
|
|
14
|
+
* leaving the gap visible.
|
|
15
|
+
*/
|
|
16
|
+
import type { NotificationEngineAdapter } from '../engine/adapter.js';
|
|
17
|
+
/** Every budget PERF-001 states, in milliseconds unless the name says otherwise. */
|
|
18
|
+
export declare const PERF_BUDGETS: {
|
|
19
|
+
readonly scheduleOne: 50;
|
|
20
|
+
readonly readPending100: 200;
|
|
21
|
+
readonly reconcileNoChange100: 150;
|
|
22
|
+
readonly reconcile500With100Changes: 1500;
|
|
23
|
+
readonly maintenanceIdleCycle: 300;
|
|
24
|
+
readonly windowRefresh32Series: 500;
|
|
25
|
+
readonly reAnchor100: 1000;
|
|
26
|
+
readonly reAnchorNoChangeCheck: 20;
|
|
27
|
+
readonly permissionRead: 50;
|
|
28
|
+
readonly dedupCheck: 20;
|
|
29
|
+
readonly interfaceThreadUnit: 16;
|
|
30
|
+
readonly stateFootprintBytes: 1048576;
|
|
31
|
+
};
|
|
32
|
+
export type BudgetName = keyof typeof PERF_BUDGETS;
|
|
33
|
+
export interface Measurement {
|
|
34
|
+
readonly name: BudgetName;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
/** Milliseconds, or bytes for the footprint budget. */
|
|
37
|
+
readonly measured: number;
|
|
38
|
+
readonly budget: number;
|
|
39
|
+
readonly unit: 'ms' | 'bytes';
|
|
40
|
+
readonly passed: boolean;
|
|
41
|
+
/** Present where the budget also demands zero platform operations. */
|
|
42
|
+
readonly operationCount?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface MeasurementReport {
|
|
45
|
+
readonly measurements: readonly Measurement[];
|
|
46
|
+
readonly passed: number;
|
|
47
|
+
readonly failed: number;
|
|
48
|
+
/** Budgets this harness structurally cannot measure. Never silently omitted. */
|
|
49
|
+
readonly requiresDevice: readonly string[];
|
|
50
|
+
readonly ranAt: number;
|
|
51
|
+
}
|
|
52
|
+
export interface MeasureOptions {
|
|
53
|
+
/** Defaults to the real clock, which is what a device run needs. */
|
|
54
|
+
readonly clock?: () => number;
|
|
55
|
+
/** Identifier prefix, so a device run cannot collide with real notifications. */
|
|
56
|
+
readonly prefix?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function runMeasurementHarness(engine: NotificationEngineAdapter, options?: MeasureOptions): Promise<MeasurementReport>;
|
|
59
|
+
//# sourceMappingURL=measure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../../../src/testing/measure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAmB,CAAC;AAenE,oFAAoF;AACpF,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,YAAY,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,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