@chipmobilesdk/rn-notification 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -0
- package/README.md +108 -16
- package/lib/commonjs/advanced.js +139 -0
- package/lib/commonjs/advanced.js.map +1 -0
- package/lib/commonjs/channel/migrate.js +246 -0
- package/lib/commonjs/channel/migrate.js.map +1 -0
- package/lib/commonjs/channel/tone-map.js +120 -0
- package/lib/commonjs/channel/tone-map.js.map +1 -0
- package/lib/commonjs/channel/validate-tone.js +61 -0
- package/lib/commonjs/channel/validate-tone.js.map +1 -0
- package/lib/commonjs/contract/channel.js +52 -0
- package/lib/commonjs/contract/channel.js.map +1 -0
- package/lib/commonjs/contract/diagnostics.js +25 -0
- package/lib/commonjs/contract/diagnostics.js.map +1 -0
- package/lib/commonjs/contract/errors.js +126 -0
- package/lib/commonjs/contract/errors.js.map +1 -0
- package/lib/commonjs/contract/hash.js +35 -0
- package/lib/commonjs/contract/hash.js.map +1 -0
- package/lib/commonjs/contract/index.js +94 -0
- package/lib/commonjs/contract/index.js.map +1 -0
- package/lib/commonjs/contract/interaction.js +37 -0
- package/lib/commonjs/contract/interaction.js.map +1 -0
- package/lib/commonjs/contract/notification.js +42 -0
- package/lib/commonjs/contract/notification.js.map +1 -0
- package/lib/commonjs/contract/permission.js +2 -0
- package/lib/commonjs/contract/permission.js.map +1 -0
- package/lib/commonjs/contract/reconcile.js +6 -0
- package/lib/commonjs/contract/reconcile.js.map +1 -0
- package/lib/commonjs/contract/recurrence.js +53 -0
- package/lib/commonjs/contract/recurrence.js.map +1 -0
- package/lib/commonjs/diagnostics/burst.js +89 -0
- package/lib/commonjs/diagnostics/burst.js.map +1 -0
- package/lib/commonjs/diagnostics/events.js +63 -0
- package/lib/commonjs/diagnostics/events.js.map +1 -0
- package/lib/commonjs/diagnostics/redact.js +48 -0
- package/lib/commonjs/diagnostics/redact.js.map +1 -0
- package/lib/commonjs/diagnostics/snapshot.js +68 -0
- package/lib/commonjs/diagnostics/snapshot.js.map +1 -0
- package/lib/commonjs/engine/adapter.js +6 -0
- package/lib/commonjs/engine/adapter.js.map +1 -0
- package/lib/commonjs/engine/codec.js +84 -0
- package/lib/commonjs/engine/codec.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/events.js +148 -0
- package/lib/commonjs/engine/notify-kit/events.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/module.js +119 -0
- package/lib/commonjs/engine/notify-kit/module.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/android.js +159 -0
- package/lib/commonjs/engine/notify-kit/platform/android.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/index.js +57 -0
- package/lib/commonjs/engine/notify-kit/platform/index.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/ios.js +54 -0
- package/lib/commonjs/engine/notify-kit/platform/ios.js.map +1 -0
- package/lib/commonjs/engine/notify-kit/platform/types.js +6 -0
- package/lib/commonjs/engine/notify-kit/platform/types.js.map +1 -0
- package/lib/commonjs/engine/notify-kit-engine.js +260 -0
- package/lib/commonjs/engine/notify-kit-engine.js.map +1 -0
- package/lib/commonjs/index.js +367 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/initialize.js +187 -0
- package/lib/commonjs/initialize.js.map +1 -0
- package/lib/commonjs/interaction/index.js +120 -0
- package/lib/commonjs/interaction/index.js.map +1 -0
- package/lib/commonjs/maintenance/cycle.js +108 -0
- package/lib/commonjs/maintenance/cycle.js.map +1 -0
- package/lib/commonjs/maintenance/permission-refresh.js +39 -0
- package/lib/commonjs/maintenance/permission-refresh.js.map +1 -0
- package/lib/commonjs/maintenance/reanchor.js +99 -0
- package/lib/commonjs/maintenance/reanchor.js.map +1 -0
- package/lib/commonjs/maintenance/toggle.js +50 -0
- package/lib/commonjs/maintenance/toggle.js.map +1 -0
- package/lib/commonjs/maintenance/verify.js +70 -0
- package/lib/commonjs/maintenance/verify.js.map +1 -0
- package/lib/commonjs/maintenance/window-refresh.js +53 -0
- package/lib/commonjs/maintenance/window-refresh.js.map +1 -0
- package/lib/commonjs/notifications.js +161 -0
- package/lib/commonjs/notifications.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/permission/index.js +182 -0
- package/lib/commonjs/permission/index.js.map +1 -0
- package/lib/commonjs/permission/state.js +92 -0
- package/lib/commonjs/permission/state.js.map +1 -0
- package/lib/commonjs/push/envelope.js +141 -0
- package/lib/commonjs/push/envelope.js.map +1 -0
- package/lib/commonjs/push/fcm-provider.js +122 -0
- package/lib/commonjs/push/fcm-provider.js.map +1 -0
- package/lib/commonjs/push/gate.js +162 -0
- package/lib/commonjs/push/gate.js.map +1 -0
- package/lib/commonjs/push/index.js +47 -0
- package/lib/commonjs/push/index.js.map +1 -0
- package/lib/commonjs/push/instructions.js +101 -0
- package/lib/commonjs/push/instructions.js.map +1 -0
- package/lib/commonjs/push/provider-adapter.js +6 -0
- package/lib/commonjs/push/provider-adapter.js.map +1 -0
- package/lib/commonjs/push/signout.js +55 -0
- package/lib/commonjs/push/signout.js.map +1 -0
- package/lib/commonjs/reconcile/chunk.js +49 -0
- package/lib/commonjs/reconcile/chunk.js.map +1 -0
- package/lib/commonjs/reconcile/diff.js +105 -0
- package/lib/commonjs/reconcile/diff.js.map +1 -0
- package/lib/commonjs/reconcile/duplicates.js +60 -0
- package/lib/commonjs/reconcile/duplicates.js.map +1 -0
- package/lib/commonjs/reconcile/index.js +164 -0
- package/lib/commonjs/reconcile/index.js.map +1 -0
- package/lib/commonjs/reconcile/truncate.js +50 -0
- package/lib/commonjs/reconcile/truncate.js.map +1 -0
- package/lib/commonjs/recurrence/clock-guard.js +65 -0
- package/lib/commonjs/recurrence/clock-guard.js.map +1 -0
- package/lib/commonjs/recurrence/expand.js +254 -0
- package/lib/commonjs/recurrence/expand.js.map +1 -0
- package/lib/commonjs/recurrence/index.js +212 -0
- package/lib/commonjs/recurrence/index.js.map +1 -0
- package/lib/commonjs/repeat/expiry.js +41 -0
- package/lib/commonjs/repeat/expiry.js.map +1 -0
- package/lib/commonjs/repeat/index.js +100 -0
- package/lib/commonjs/repeat/index.js.map +1 -0
- package/lib/commonjs/repeat/marker.js +58 -0
- package/lib/commonjs/repeat/marker.js.map +1 -0
- package/lib/commonjs/repeat/place.js +83 -0
- package/lib/commonjs/repeat/place.js.map +1 -0
- package/lib/commonjs/schedule/anchor.js +243 -0
- package/lib/commonjs/schedule/anchor.js.map +1 -0
- package/lib/commonjs/schedule/index.js +142 -0
- package/lib/commonjs/schedule/index.js.map +1 -0
- package/lib/commonjs/schedule/partition.js +59 -0
- package/lib/commonjs/schedule/partition.js.map +1 -0
- package/lib/commonjs/schedule/resolve-moment.js +72 -0
- package/lib/commonjs/schedule/resolve-moment.js.map +1 -0
- package/lib/commonjs/schedule/validate-content.js +101 -0
- package/lib/commonjs/schedule/validate-content.js.map +1 -0
- package/lib/commonjs/schedule/validate-identifier.js +126 -0
- package/lib/commonjs/schedule/validate-identifier.js.map +1 -0
- package/lib/commonjs/schedule/writer.js +44 -0
- package/lib/commonjs/schedule/writer.js.map +1 -0
- package/lib/commonjs/state/caps.js +101 -0
- package/lib/commonjs/state/caps.js.map +1 -0
- package/lib/commonjs/state/dedup-ledger.js +39 -0
- package/lib/commonjs/state/dedup-ledger.js.map +1 -0
- package/lib/commonjs/state/interaction-buffer.js +98 -0
- package/lib/commonjs/state/interaction-buffer.js.map +1 -0
- package/lib/commonjs/state/mmkv-store.js +75 -0
- package/lib/commonjs/state/mmkv-store.js.map +1 -0
- package/lib/commonjs/state/permission-history.js +64 -0
- package/lib/commonjs/state/permission-history.js.map +1 -0
- package/lib/commonjs/state/record.js +269 -0
- package/lib/commonjs/state/record.js.map +1 -0
- package/lib/commonjs/state/reset.js +37 -0
- package/lib/commonjs/state/reset.js.map +1 -0
- package/lib/commonjs/state/series-ledger.js +71 -0
- package/lib/commonjs/state/series-ledger.js.map +1 -0
- package/lib/commonjs/state/store.js +39 -0
- package/lib/commonjs/state/store.js.map +1 -0
- package/lib/commonjs/testing/conformance/index.js +218 -0
- package/lib/commonjs/testing/conformance/index.js.map +1 -0
- package/lib/commonjs/testing/fake-engine.js +338 -0
- package/lib/commonjs/testing/fake-engine.js.map +1 -0
- package/lib/commonjs/testing/fake-provider.js +93 -0
- package/lib/commonjs/testing/fake-provider.js.map +1 -0
- package/lib/commonjs/testing/faults.js +59 -0
- package/lib/commonjs/testing/faults.js.map +1 -0
- package/lib/commonjs/testing/index.js +54 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/commonjs/testing/measure.js +298 -0
- package/lib/commonjs/testing/measure.js.map +1 -0
- package/lib/module/advanced.js +29 -0
- package/lib/module/advanced.js.map +1 -0
- package/lib/module/channel/migrate.js +242 -0
- package/lib/module/channel/migrate.js.map +1 -0
- package/lib/module/channel/tone-map.js +112 -0
- package/lib/module/channel/tone-map.js.map +1 -0
- package/lib/module/channel/validate-tone.js +57 -0
- package/lib/module/channel/validate-tone.js.map +1 -0
- package/lib/module/contract/channel.js +48 -0
- package/lib/module/contract/channel.js.map +1 -0
- package/lib/module/contract/diagnostics.js +21 -0
- package/lib/module/contract/diagnostics.js.map +1 -0
- package/lib/module/contract/errors.js +119 -0
- package/lib/module/contract/errors.js.map +1 -0
- package/lib/module/contract/hash.js +29 -0
- package/lib/module/contract/hash.js.map +1 -0
- package/lib/module/contract/index.js +13 -0
- package/lib/module/contract/index.js.map +1 -0
- package/lib/module/contract/interaction.js +33 -0
- package/lib/module/contract/interaction.js.map +1 -0
- package/lib/module/contract/notification.js +38 -0
- package/lib/module/contract/notification.js.map +1 -0
- package/lib/module/contract/permission.js +2 -0
- package/lib/module/contract/permission.js.map +1 -0
- package/lib/module/contract/reconcile.js +4 -0
- package/lib/module/contract/reconcile.js.map +1 -0
- package/lib/module/contract/recurrence.js +49 -0
- package/lib/module/contract/recurrence.js.map +1 -0
- package/lib/module/diagnostics/burst.js +85 -0
- package/lib/module/diagnostics/burst.js.map +1 -0
- package/lib/module/diagnostics/events.js +58 -0
- package/lib/module/diagnostics/events.js.map +1 -0
- package/lib/module/diagnostics/redact.js +44 -0
- package/lib/module/diagnostics/redact.js.map +1 -0
- package/lib/module/diagnostics/snapshot.js +64 -0
- package/lib/module/diagnostics/snapshot.js.map +1 -0
- package/lib/module/engine/adapter.js +4 -0
- package/lib/module/engine/adapter.js.map +1 -0
- package/lib/module/engine/codec.js +79 -0
- package/lib/module/engine/codec.js.map +1 -0
- package/lib/module/engine/notify-kit/events.js +139 -0
- package/lib/module/engine/notify-kit/events.js.map +1 -0
- package/lib/module/engine/notify-kit/module.js +113 -0
- package/lib/module/engine/notify-kit/module.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/android.js +155 -0
- package/lib/module/engine/notify-kit/platform/android.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/index.js +51 -0
- package/lib/module/engine/notify-kit/platform/index.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/ios.js +49 -0
- package/lib/module/engine/notify-kit/platform/ios.js.map +1 -0
- package/lib/module/engine/notify-kit/platform/types.js +4 -0
- package/lib/module/engine/notify-kit/platform/types.js.map +1 -0
- package/lib/module/engine/notify-kit-engine.js +257 -0
- package/lib/module/engine/notify-kit-engine.js.map +1 -0
- package/lib/module/index.js +98 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/initialize.js +182 -0
- package/lib/module/initialize.js.map +1 -0
- package/lib/module/interaction/index.js +116 -0
- package/lib/module/interaction/index.js.map +1 -0
- package/lib/module/maintenance/cycle.js +102 -0
- package/lib/module/maintenance/cycle.js.map +1 -0
- package/lib/module/maintenance/permission-refresh.js +34 -0
- package/lib/module/maintenance/permission-refresh.js.map +1 -0
- package/lib/module/maintenance/reanchor.js +94 -0
- package/lib/module/maintenance/reanchor.js.map +1 -0
- package/lib/module/maintenance/toggle.js +45 -0
- package/lib/module/maintenance/toggle.js.map +1 -0
- package/lib/module/maintenance/verify.js +65 -0
- package/lib/module/maintenance/verify.js.map +1 -0
- package/lib/module/maintenance/window-refresh.js +48 -0
- package/lib/module/maintenance/window-refresh.js.map +1 -0
- package/lib/module/notifications.js +157 -0
- package/lib/module/notifications.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/permission/index.js +178 -0
- package/lib/module/permission/index.js.map +1 -0
- package/lib/module/permission/state.js +83 -0
- package/lib/module/permission/state.js.map +1 -0
- package/lib/module/push/envelope.js +137 -0
- package/lib/module/push/envelope.js.map +1 -0
- package/lib/module/push/fcm-provider.js +119 -0
- package/lib/module/push/fcm-provider.js.map +1 -0
- package/lib/module/push/gate.js +158 -0
- package/lib/module/push/gate.js.map +1 -0
- package/lib/module/push/index.js +16 -0
- package/lib/module/push/index.js.map +1 -0
- package/lib/module/push/instructions.js +97 -0
- package/lib/module/push/instructions.js.map +1 -0
- package/lib/module/push/provider-adapter.js +4 -0
- package/lib/module/push/provider-adapter.js.map +1 -0
- package/lib/module/push/signout.js +51 -0
- package/lib/module/push/signout.js.map +1 -0
- package/lib/module/reconcile/chunk.js +43 -0
- package/lib/module/reconcile/chunk.js.map +1 -0
- package/lib/module/reconcile/diff.js +101 -0
- package/lib/module/reconcile/diff.js.map +1 -0
- package/lib/module/reconcile/duplicates.js +56 -0
- package/lib/module/reconcile/duplicates.js.map +1 -0
- package/lib/module/reconcile/index.js +161 -0
- package/lib/module/reconcile/index.js.map +1 -0
- package/lib/module/reconcile/truncate.js +46 -0
- package/lib/module/reconcile/truncate.js.map +1 -0
- package/lib/module/recurrence/clock-guard.js +60 -0
- package/lib/module/recurrence/clock-guard.js.map +1 -0
- package/lib/module/recurrence/expand.js +248 -0
- package/lib/module/recurrence/expand.js.map +1 -0
- package/lib/module/recurrence/index.js +208 -0
- package/lib/module/recurrence/index.js.map +1 -0
- package/lib/module/repeat/expiry.js +37 -0
- package/lib/module/repeat/expiry.js.map +1 -0
- package/lib/module/repeat/index.js +67 -0
- package/lib/module/repeat/index.js.map +1 -0
- package/lib/module/repeat/marker.js +51 -0
- package/lib/module/repeat/marker.js.map +1 -0
- package/lib/module/repeat/place.js +79 -0
- package/lib/module/repeat/place.js.map +1 -0
- package/lib/module/schedule/anchor.js +234 -0
- package/lib/module/schedule/anchor.js.map +1 -0
- package/lib/module/schedule/index.js +137 -0
- package/lib/module/schedule/index.js.map +1 -0
- package/lib/module/schedule/partition.js +53 -0
- package/lib/module/schedule/partition.js.map +1 -0
- package/lib/module/schedule/resolve-moment.js +66 -0
- package/lib/module/schedule/resolve-moment.js.map +1 -0
- package/lib/module/schedule/validate-content.js +95 -0
- package/lib/module/schedule/validate-content.js.map +1 -0
- package/lib/module/schedule/validate-identifier.js +119 -0
- package/lib/module/schedule/validate-identifier.js.map +1 -0
- package/lib/module/schedule/writer.js +40 -0
- package/lib/module/schedule/writer.js.map +1 -0
- package/lib/module/state/caps.js +96 -0
- package/lib/module/state/caps.js.map +1 -0
- package/lib/module/state/dedup-ledger.js +34 -0
- package/lib/module/state/dedup-ledger.js.map +1 -0
- package/lib/module/state/interaction-buffer.js +92 -0
- package/lib/module/state/interaction-buffer.js.map +1 -0
- package/lib/module/state/mmkv-store.js +71 -0
- package/lib/module/state/mmkv-store.js.map +1 -0
- package/lib/module/state/permission-history.js +56 -0
- package/lib/module/state/permission-history.js.map +1 -0
- package/lib/module/state/record.js +264 -0
- package/lib/module/state/record.js.map +1 -0
- package/lib/module/state/reset.js +32 -0
- package/lib/module/state/reset.js.map +1 -0
- package/lib/module/state/series-ledger.js +62 -0
- package/lib/module/state/series-ledger.js.map +1 -0
- package/lib/module/state/store.js +35 -0
- package/lib/module/state/store.js.map +1 -0
- package/lib/module/testing/conformance/index.js +214 -0
- package/lib/module/testing/conformance/index.js.map +1 -0
- package/lib/module/testing/fake-engine.js +335 -0
- package/lib/module/testing/fake-engine.js.map +1 -0
- package/lib/module/testing/fake-provider.js +89 -0
- package/lib/module/testing/fake-provider.js.map +1 -0
- package/lib/module/testing/faults.js +55 -0
- package/lib/module/testing/faults.js.map +1 -0
- package/lib/module/testing/index.js +19 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/module/testing/measure.js +294 -0
- package/lib/module/testing/measure.js.map +1 -0
- package/lib/typescript/commonjs/advanced.d.ts +36 -0
- package/lib/typescript/commonjs/advanced.d.ts.map +1 -0
- package/lib/typescript/commonjs/channel/migrate.d.ts +38 -0
- package/lib/typescript/commonjs/channel/migrate.d.ts.map +1 -0
- package/lib/typescript/commonjs/channel/tone-map.d.ts +34 -0
- package/lib/typescript/commonjs/channel/tone-map.d.ts.map +1 -0
- package/lib/typescript/commonjs/channel/validate-tone.d.ts +23 -0
- package/lib/typescript/commonjs/channel/validate-tone.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/channel.d.ts +185 -0
- package/lib/typescript/commonjs/contract/channel.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/diagnostics.d.ts +92 -0
- package/lib/typescript/commonjs/contract/diagnostics.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/errors.d.ts +91 -0
- package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/hash.d.ts +14 -0
- package/lib/typescript/commonjs/contract/hash.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/index.d.ts +10 -0
- package/lib/typescript/commonjs/contract/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/interaction.d.ts +53 -0
- package/lib/typescript/commonjs/contract/interaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/notification.d.ts +110 -0
- package/lib/typescript/commonjs/contract/notification.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/permission.d.ts +49 -0
- package/lib/typescript/commonjs/contract/permission.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/reconcile.d.ts +82 -0
- package/lib/typescript/commonjs/contract/reconcile.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/recurrence.d.ts +118 -0
- package/lib/typescript/commonjs/contract/recurrence.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/burst.d.ts +39 -0
- package/lib/typescript/commonjs/diagnostics/burst.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts +28 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts +22 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/snapshot.d.ts +40 -0
- package/lib/typescript/commonjs/diagnostics/snapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/adapter.d.ts +172 -0
- package/lib/typescript/commonjs/engine/adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/codec.d.ts +20 -0
- package/lib/typescript/commonjs/engine/codec.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/events.d.ts +37 -0
- package/lib/typescript/commonjs/engine/notify-kit/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/module.d.ts +103 -0
- package/lib/typescript/commonjs/engine/notify-kit/module.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/android.d.ts +3 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/android.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/index.d.ts +12 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/ios.d.ts +3 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/types.d.ts +33 -0
- package/lib/typescript/commonjs/engine/notify-kit/platform/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/notify-kit-engine.d.ts +25 -0
- package/lib/typescript/commonjs/engine/notify-kit-engine.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +106 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/initialize.d.ts +74 -0
- package/lib/typescript/commonjs/initialize.d.ts.map +1 -0
- package/lib/typescript/commonjs/interaction/index.d.ts +53 -0
- package/lib/typescript/commonjs/interaction/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/cycle.d.ts +77 -0
- package/lib/typescript/commonjs/maintenance/cycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/permission-refresh.d.ts +19 -0
- package/lib/typescript/commonjs/maintenance/permission-refresh.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/reanchor.d.ts +26 -0
- package/lib/typescript/commonjs/maintenance/reanchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/toggle.d.ts +35 -0
- package/lib/typescript/commonjs/maintenance/toggle.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/verify.d.ts +32 -0
- package/lib/typescript/commonjs/maintenance/verify.d.ts.map +1 -0
- package/lib/typescript/commonjs/maintenance/window-refresh.d.ts +29 -0
- package/lib/typescript/commonjs/maintenance/window-refresh.d.ts.map +1 -0
- package/lib/typescript/commonjs/notifications.d.ts +78 -0
- package/lib/typescript/commonjs/notifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/permission/index.d.ts +57 -0
- package/lib/typescript/commonjs/permission/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/permission/state.d.ts +41 -0
- package/lib/typescript/commonjs/permission/state.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/envelope.d.ts +33 -0
- package/lib/typescript/commonjs/push/envelope.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/fcm-provider.d.ts +43 -0
- package/lib/typescript/commonjs/push/fcm-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/gate.d.ts +57 -0
- package/lib/typescript/commonjs/push/gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/index.d.ts +19 -0
- package/lib/typescript/commonjs/push/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/instructions.d.ts +45 -0
- package/lib/typescript/commonjs/push/instructions.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/provider-adapter.d.ts +50 -0
- package/lib/typescript/commonjs/push/provider-adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/push/signout.d.ts +33 -0
- package/lib/typescript/commonjs/push/signout.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/chunk.d.ts +24 -0
- package/lib/typescript/commonjs/reconcile/chunk.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/diff.d.ts +54 -0
- package/lib/typescript/commonjs/reconcile/diff.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/duplicates.d.ts +32 -0
- package/lib/typescript/commonjs/reconcile/duplicates.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/index.d.ts +35 -0
- package/lib/typescript/commonjs/reconcile/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/reconcile/truncate.d.ts +26 -0
- package/lib/typescript/commonjs/reconcile/truncate.d.ts.map +1 -0
- package/lib/typescript/commonjs/recurrence/clock-guard.d.ts +37 -0
- package/lib/typescript/commonjs/recurrence/clock-guard.d.ts.map +1 -0
- package/lib/typescript/commonjs/recurrence/expand.d.ts +75 -0
- package/lib/typescript/commonjs/recurrence/expand.d.ts.map +1 -0
- package/lib/typescript/commonjs/recurrence/index.d.ts +40 -0
- package/lib/typescript/commonjs/recurrence/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/expiry.d.ts +23 -0
- package/lib/typescript/commonjs/repeat/expiry.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/index.d.ts +49 -0
- package/lib/typescript/commonjs/repeat/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/marker.d.ts +36 -0
- package/lib/typescript/commonjs/repeat/marker.d.ts.map +1 -0
- package/lib/typescript/commonjs/repeat/place.d.ts +39 -0
- package/lib/typescript/commonjs/repeat/place.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/anchor.d.ts +118 -0
- package/lib/typescript/commonjs/schedule/anchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/index.d.ts +40 -0
- package/lib/typescript/commonjs/schedule/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/partition.d.ts +29 -0
- package/lib/typescript/commonjs/schedule/partition.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/resolve-moment.d.ts +35 -0
- package/lib/typescript/commonjs/schedule/resolve-moment.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/validate-content.d.ts +42 -0
- package/lib/typescript/commonjs/schedule/validate-content.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/validate-identifier.d.ts +30 -0
- package/lib/typescript/commonjs/schedule/validate-identifier.d.ts.map +1 -0
- package/lib/typescript/commonjs/schedule/writer.d.ts +36 -0
- package/lib/typescript/commonjs/schedule/writer.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/caps.d.ts +51 -0
- package/lib/typescript/commonjs/state/caps.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/dedup-ledger.d.ts +21 -0
- package/lib/typescript/commonjs/state/dedup-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/interaction-buffer.d.ts +30 -0
- package/lib/typescript/commonjs/state/interaction-buffer.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/mmkv-store.d.ts +33 -0
- package/lib/typescript/commonjs/state/mmkv-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/permission-history.d.ts +20 -0
- package/lib/typescript/commonjs/state/permission-history.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/record.d.ts +134 -0
- package/lib/typescript/commonjs/state/record.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/reset.d.ts +22 -0
- package/lib/typescript/commonjs/state/reset.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/series-ledger.d.ts +47 -0
- package/lib/typescript/commonjs/state/series-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/store.d.ts +20 -0
- package/lib/typescript/commonjs/state/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts +32 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/fake-engine.d.ts +91 -0
- package/lib/typescript/commonjs/testing/fake-engine.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/fake-provider.d.ts +35 -0
- package/lib/typescript/commonjs/testing/fake-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/faults.d.ts +38 -0
- package/lib/typescript/commonjs/testing/faults.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +22 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/measure.d.ts +59 -0
- package/lib/typescript/commonjs/testing/measure.d.ts.map +1 -0
- package/lib/typescript/module/advanced.d.ts +36 -0
- package/lib/typescript/module/advanced.d.ts.map +1 -0
- package/lib/typescript/module/channel/migrate.d.ts +38 -0
- package/lib/typescript/module/channel/migrate.d.ts.map +1 -0
- package/lib/typescript/module/channel/tone-map.d.ts +34 -0
- package/lib/typescript/module/channel/tone-map.d.ts.map +1 -0
- package/lib/typescript/module/channel/validate-tone.d.ts +23 -0
- package/lib/typescript/module/channel/validate-tone.d.ts.map +1 -0
- package/lib/typescript/module/contract/channel.d.ts +185 -0
- package/lib/typescript/module/contract/channel.d.ts.map +1 -0
- package/lib/typescript/module/contract/diagnostics.d.ts +92 -0
- package/lib/typescript/module/contract/diagnostics.d.ts.map +1 -0
- package/lib/typescript/module/contract/errors.d.ts +91 -0
- package/lib/typescript/module/contract/errors.d.ts.map +1 -0
- package/lib/typescript/module/contract/hash.d.ts +14 -0
- package/lib/typescript/module/contract/hash.d.ts.map +1 -0
- package/lib/typescript/module/contract/index.d.ts +10 -0
- package/lib/typescript/module/contract/index.d.ts.map +1 -0
- package/lib/typescript/module/contract/interaction.d.ts +53 -0
- package/lib/typescript/module/contract/interaction.d.ts.map +1 -0
- package/lib/typescript/module/contract/notification.d.ts +110 -0
- package/lib/typescript/module/contract/notification.d.ts.map +1 -0
- package/lib/typescript/module/contract/permission.d.ts +49 -0
- package/lib/typescript/module/contract/permission.d.ts.map +1 -0
- package/lib/typescript/module/contract/reconcile.d.ts +82 -0
- package/lib/typescript/module/contract/reconcile.d.ts.map +1 -0
- package/lib/typescript/module/contract/recurrence.d.ts +118 -0
- package/lib/typescript/module/contract/recurrence.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/burst.d.ts +39 -0
- package/lib/typescript/module/diagnostics/burst.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/events.d.ts +28 -0
- package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/redact.d.ts +22 -0
- package/lib/typescript/module/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/snapshot.d.ts +40 -0
- package/lib/typescript/module/diagnostics/snapshot.d.ts.map +1 -0
- package/lib/typescript/module/engine/adapter.d.ts +172 -0
- package/lib/typescript/module/engine/adapter.d.ts.map +1 -0
- package/lib/typescript/module/engine/codec.d.ts +20 -0
- package/lib/typescript/module/engine/codec.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/events.d.ts +37 -0
- package/lib/typescript/module/engine/notify-kit/events.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/module.d.ts +103 -0
- package/lib/typescript/module/engine/notify-kit/module.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/android.d.ts +3 -0
- package/lib/typescript/module/engine/notify-kit/platform/android.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/index.d.ts +12 -0
- package/lib/typescript/module/engine/notify-kit/platform/index.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/ios.d.ts +3 -0
- package/lib/typescript/module/engine/notify-kit/platform/ios.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit/platform/types.d.ts +33 -0
- package/lib/typescript/module/engine/notify-kit/platform/types.d.ts.map +1 -0
- package/lib/typescript/module/engine/notify-kit-engine.d.ts +25 -0
- package/lib/typescript/module/engine/notify-kit-engine.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +106 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/initialize.d.ts +74 -0
- package/lib/typescript/module/initialize.d.ts.map +1 -0
- package/lib/typescript/module/interaction/index.d.ts +53 -0
- package/lib/typescript/module/interaction/index.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/cycle.d.ts +77 -0
- package/lib/typescript/module/maintenance/cycle.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/permission-refresh.d.ts +19 -0
- package/lib/typescript/module/maintenance/permission-refresh.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/reanchor.d.ts +26 -0
- package/lib/typescript/module/maintenance/reanchor.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/toggle.d.ts +35 -0
- package/lib/typescript/module/maintenance/toggle.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/verify.d.ts +32 -0
- package/lib/typescript/module/maintenance/verify.d.ts.map +1 -0
- package/lib/typescript/module/maintenance/window-refresh.d.ts +29 -0
- package/lib/typescript/module/maintenance/window-refresh.d.ts.map +1 -0
- package/lib/typescript/module/notifications.d.ts +78 -0
- package/lib/typescript/module/notifications.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/permission/index.d.ts +57 -0
- package/lib/typescript/module/permission/index.d.ts.map +1 -0
- package/lib/typescript/module/permission/state.d.ts +41 -0
- package/lib/typescript/module/permission/state.d.ts.map +1 -0
- package/lib/typescript/module/push/envelope.d.ts +33 -0
- package/lib/typescript/module/push/envelope.d.ts.map +1 -0
- package/lib/typescript/module/push/fcm-provider.d.ts +43 -0
- package/lib/typescript/module/push/fcm-provider.d.ts.map +1 -0
- package/lib/typescript/module/push/gate.d.ts +57 -0
- package/lib/typescript/module/push/gate.d.ts.map +1 -0
- package/lib/typescript/module/push/index.d.ts +19 -0
- package/lib/typescript/module/push/index.d.ts.map +1 -0
- package/lib/typescript/module/push/instructions.d.ts +45 -0
- package/lib/typescript/module/push/instructions.d.ts.map +1 -0
- package/lib/typescript/module/push/provider-adapter.d.ts +50 -0
- package/lib/typescript/module/push/provider-adapter.d.ts.map +1 -0
- package/lib/typescript/module/push/signout.d.ts +33 -0
- package/lib/typescript/module/push/signout.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/chunk.d.ts +24 -0
- package/lib/typescript/module/reconcile/chunk.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/diff.d.ts +54 -0
- package/lib/typescript/module/reconcile/diff.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/duplicates.d.ts +32 -0
- package/lib/typescript/module/reconcile/duplicates.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/index.d.ts +35 -0
- package/lib/typescript/module/reconcile/index.d.ts.map +1 -0
- package/lib/typescript/module/reconcile/truncate.d.ts +26 -0
- package/lib/typescript/module/reconcile/truncate.d.ts.map +1 -0
- package/lib/typescript/module/recurrence/clock-guard.d.ts +37 -0
- package/lib/typescript/module/recurrence/clock-guard.d.ts.map +1 -0
- package/lib/typescript/module/recurrence/expand.d.ts +75 -0
- package/lib/typescript/module/recurrence/expand.d.ts.map +1 -0
- package/lib/typescript/module/recurrence/index.d.ts +40 -0
- package/lib/typescript/module/recurrence/index.d.ts.map +1 -0
- package/lib/typescript/module/repeat/expiry.d.ts +23 -0
- package/lib/typescript/module/repeat/expiry.d.ts.map +1 -0
- package/lib/typescript/module/repeat/index.d.ts +49 -0
- package/lib/typescript/module/repeat/index.d.ts.map +1 -0
- package/lib/typescript/module/repeat/marker.d.ts +36 -0
- package/lib/typescript/module/repeat/marker.d.ts.map +1 -0
- package/lib/typescript/module/repeat/place.d.ts +39 -0
- package/lib/typescript/module/repeat/place.d.ts.map +1 -0
- package/lib/typescript/module/schedule/anchor.d.ts +118 -0
- package/lib/typescript/module/schedule/anchor.d.ts.map +1 -0
- package/lib/typescript/module/schedule/index.d.ts +40 -0
- package/lib/typescript/module/schedule/index.d.ts.map +1 -0
- package/lib/typescript/module/schedule/partition.d.ts +29 -0
- package/lib/typescript/module/schedule/partition.d.ts.map +1 -0
- package/lib/typescript/module/schedule/resolve-moment.d.ts +35 -0
- package/lib/typescript/module/schedule/resolve-moment.d.ts.map +1 -0
- package/lib/typescript/module/schedule/validate-content.d.ts +42 -0
- package/lib/typescript/module/schedule/validate-content.d.ts.map +1 -0
- package/lib/typescript/module/schedule/validate-identifier.d.ts +30 -0
- package/lib/typescript/module/schedule/validate-identifier.d.ts.map +1 -0
- package/lib/typescript/module/schedule/writer.d.ts +36 -0
- package/lib/typescript/module/schedule/writer.d.ts.map +1 -0
- package/lib/typescript/module/state/caps.d.ts +51 -0
- package/lib/typescript/module/state/caps.d.ts.map +1 -0
- package/lib/typescript/module/state/dedup-ledger.d.ts +21 -0
- package/lib/typescript/module/state/dedup-ledger.d.ts.map +1 -0
- package/lib/typescript/module/state/interaction-buffer.d.ts +30 -0
- package/lib/typescript/module/state/interaction-buffer.d.ts.map +1 -0
- package/lib/typescript/module/state/mmkv-store.d.ts +33 -0
- package/lib/typescript/module/state/mmkv-store.d.ts.map +1 -0
- package/lib/typescript/module/state/permission-history.d.ts +20 -0
- package/lib/typescript/module/state/permission-history.d.ts.map +1 -0
- package/lib/typescript/module/state/record.d.ts +134 -0
- package/lib/typescript/module/state/record.d.ts.map +1 -0
- package/lib/typescript/module/state/reset.d.ts +22 -0
- package/lib/typescript/module/state/reset.d.ts.map +1 -0
- package/lib/typescript/module/state/series-ledger.d.ts +47 -0
- package/lib/typescript/module/state/series-ledger.d.ts.map +1 -0
- package/lib/typescript/module/state/store.d.ts +20 -0
- package/lib/typescript/module/state/store.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/index.d.ts +32 -0
- package/lib/typescript/module/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/fake-engine.d.ts +91 -0
- package/lib/typescript/module/testing/fake-engine.d.ts.map +1 -0
- package/lib/typescript/module/testing/fake-provider.d.ts +35 -0
- package/lib/typescript/module/testing/fake-provider.d.ts.map +1 -0
- package/lib/typescript/module/testing/faults.d.ts +38 -0
- package/lib/typescript/module/testing/faults.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +22 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/measure.d.ts +59 -0
- package/lib/typescript/module/testing/measure.d.ts.map +1 -0
- package/package.json +74 -23
- package/skills/sdk-rn-notification/SKILL.md +6 -5
- package/src/advanced.ts +35 -0
- package/src/channel/migrate.ts +176 -158
- package/src/channel/tone-map.ts +2 -10
- package/src/contract/errors.ts +7 -0
- package/src/contract/hash.ts +26 -0
- package/src/engine/adapter.ts +21 -1
- package/src/engine/notify-kit/events.ts +155 -0
- package/src/engine/notify-kit/module.ts +148 -0
- package/src/engine/notify-kit/platform/android.ts +172 -0
- package/src/engine/notify-kit/platform/index.ts +55 -0
- package/src/engine/notify-kit/platform/ios.ts +54 -0
- package/src/engine/notify-kit/platform/types.ts +40 -0
- package/src/engine/notify-kit-engine.ts +96 -477
- package/src/index.ts +9 -0
- package/src/notifications.ts +195 -0
- package/src/permission/index.ts +65 -4
- package/src/push/fcm-provider.ts +14 -4
- package/src/push/gate.ts +27 -5
- package/src/reconcile/diff.ts +38 -27
- package/src/reconcile/index.ts +13 -4
- package/src/recurrence/index.ts +2 -1
- package/src/repeat/expiry.ts +2 -6
- package/src/repeat/index.ts +45 -1
- package/src/repeat/marker.ts +1 -22
- package/src/repeat/place.ts +74 -35
- package/src/schedule/index.ts +10 -4
- package/src/schedule/partition.ts +0 -19
- package/src/schedule/validate-identifier.ts +8 -6
- package/src/schedule/writer.ts +13 -4
- package/src/state/caps.ts +28 -3
- package/src/state/permission-history.ts +25 -0
- package/src/state/record.ts +110 -20
- package/src/testing/fake-engine.ts +17 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NotificationError = exports.NON_FAILURE_CODES = exports.DIAGNOSTIC_CODES = exports.ALL_DIAGNOSTIC_CODES = void 0;
|
|
7
|
+
exports.isNonFailure = isNonFailure;
|
|
8
|
+
exports.isNotificationError = isNotificationError;
|
|
9
|
+
var _rnCore = require("@chipmobilesdk/rn-core");
|
|
10
|
+
var _redact = require("../diagnostics/redact.js");
|
|
11
|
+
/**
|
|
12
|
+
* Typed error taxonomy and stable diagnostic identifiers.
|
|
13
|
+
*
|
|
14
|
+
* Every failure condition carries its own identifier. None collapses into a
|
|
15
|
+
* generic failure — an error that says only "scheduling failed" reproduces the
|
|
16
|
+
* problem this package exists to solve.
|
|
17
|
+
*
|
|
18
|
+
* Identifiers are stable across releases and safe to switch on. Adding new ones
|
|
19
|
+
* is an additive minor change.
|
|
20
|
+
*
|
|
21
|
+
* See `specs/009-rn-notification-package/contracts/errors.md`.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const DIAGNOSTIC_CODES = exports.DIAGNOSTIC_CODES = {
|
|
25
|
+
// --- Validation: raised before any platform call -------------------------
|
|
26
|
+
INVALID_ID_EMPTY: 'INVALID_ID_EMPTY',
|
|
27
|
+
INVALID_ID_LENGTH: 'INVALID_ID_LENGTH',
|
|
28
|
+
INVALID_ID_CHARSET: 'INVALID_ID_CHARSET',
|
|
29
|
+
INVALID_OWNER_TAG: 'INVALID_OWNER_TAG',
|
|
30
|
+
INVALID_GROUP_TAG: 'INVALID_GROUP_TAG',
|
|
31
|
+
MOMENT_IN_PAST: 'MOMENT_IN_PAST',
|
|
32
|
+
UNDECLARED_TONE: 'UNDECLARED_TONE',
|
|
33
|
+
ROUTING_PAYLOAD_TOO_LARGE: 'ROUTING_PAYLOAD_TOO_LARGE',
|
|
34
|
+
CONTENT_TOO_LARGE: 'CONTENT_TOO_LARGE',
|
|
35
|
+
TOO_MANY_ACTIONS: 'TOO_MANY_ACTIONS',
|
|
36
|
+
INVALID_RECURRENCE: 'INVALID_RECURRENCE',
|
|
37
|
+
INVALID_TONE_REPEAT: 'INVALID_TONE_REPEAT',
|
|
38
|
+
// --- Reconciliation ------------------------------------------------------
|
|
39
|
+
DUPLICATE_IDENTIFIER: 'DUPLICATE_IDENTIFIER',
|
|
40
|
+
TRUNCATED_OVER_CEILING: 'TRUNCATED_OVER_CEILING',
|
|
41
|
+
RECONCILE_INTERRUPTED: 'RECONCILE_INTERRUPTED',
|
|
42
|
+
PENDING_SET_DISCREPANCY: 'PENDING_SET_DISCREPANCY',
|
|
43
|
+
// --- Permissions ---------------------------------------------------------
|
|
44
|
+
DISPLAY_PERMISSION_DENIED: 'DISPLAY_PERMISSION_DENIED',
|
|
45
|
+
DISPLAY_PERMISSION_PERMANENT: 'DISPLAY_PERMISSION_PERMANENT',
|
|
46
|
+
EXACT_ALARM_UNAVAILABLE: 'EXACT_ALARM_UNAVAILABLE',
|
|
47
|
+
SETTINGS_UNAVAILABLE: 'SETTINGS_UNAVAILABLE',
|
|
48
|
+
BACKGROUND_RESTRICTED: 'BACKGROUND_RESTRICTED',
|
|
49
|
+
BACKGROUND_RESTRICTION_UNKNOWN: 'BACKGROUND_RESTRICTION_UNKNOWN',
|
|
50
|
+
// --- Channels ------------------------------------------------------------
|
|
51
|
+
CHANNEL_MIGRATION_REQUIRED: 'CHANNEL_MIGRATION_REQUIRED',
|
|
52
|
+
CHANNEL_MIGRATION_FAILED: 'CHANNEL_MIGRATION_FAILED',
|
|
53
|
+
CHANNEL_ORPHANS_FOUND: 'CHANNEL_ORPHANS_FOUND',
|
|
54
|
+
DND_BYPASS_UNAVAILABLE: 'DND_BYPASS_UNAVAILABLE',
|
|
55
|
+
TONE_LABELS_REFRESHED: 'TONE_LABELS_REFRESHED',
|
|
56
|
+
REPEAT_ALERT_UNAVAILABLE: 'REPEAT_ALERT_UNAVAILABLE',
|
|
57
|
+
REPEAT_STOP_HANDLER_MISSING: 'REPEAT_STOP_HANDLER_MISSING',
|
|
58
|
+
// --- Interaction ---------------------------------------------------------
|
|
59
|
+
TARGET_MISSING: 'TARGET_MISSING',
|
|
60
|
+
INTERACTION_BUFFER_EVICTED: 'INTERACTION_BUFFER_EVICTED',
|
|
61
|
+
BACKGROUND_WINDOW_EXCEEDED: 'BACKGROUND_WINDOW_EXCEEDED',
|
|
62
|
+
// --- Push ----------------------------------------------------------------
|
|
63
|
+
PUSH_UNAVAILABLE: 'PUSH_UNAVAILABLE',
|
|
64
|
+
TOKEN_UNAVAILABLE: 'TOKEN_UNAVAILABLE',
|
|
65
|
+
TOKEN_INVALIDATION_FAILED: 'TOKEN_INVALIDATION_FAILED',
|
|
66
|
+
PAYLOAD_MALFORMED: 'PAYLOAD_MALFORMED',
|
|
67
|
+
PAYLOAD_VERSION_SKEW: 'PAYLOAD_VERSION_SKEW',
|
|
68
|
+
PAYLOAD_DUPLICATE: 'PAYLOAD_DUPLICATE',
|
|
69
|
+
PUSH_UNDELIVERABLE: 'PUSH_UNDELIVERABLE',
|
|
70
|
+
// --- Persisted state -----------------------------------------------------
|
|
71
|
+
STATE_CORRUPT_REBUILT: 'STATE_CORRUPT_REBUILT',
|
|
72
|
+
STATE_WRITE_FAILED: 'STATE_WRITE_FAILED',
|
|
73
|
+
/** The durable store could not open; state lasts for this session only. */
|
|
74
|
+
STATE_STORE_DEGRADED: 'STATE_STORE_DEGRADED',
|
|
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',
|
|
82
|
+
// --- Volume --------------------------------------------------------------
|
|
83
|
+
BURST_THRESHOLD_EXCEEDED: 'BURST_THRESHOLD_EXCEEDED',
|
|
84
|
+
// --- Maintenance (0.4.0) -------------------------------------------------
|
|
85
|
+
/** An automatic maintenance cycle threw. Reported here because no caller awaits it. */
|
|
86
|
+
MAINTENANCE_FAILED: 'MAINTENANCE_FAILED'
|
|
87
|
+
};
|
|
88
|
+
/** Every identifier, for exhaustiveness tests and the documentation table. */
|
|
89
|
+
const ALL_DIAGNOSTIC_CODES = exports.ALL_DIAGNOSTIC_CODES = Object.freeze(Object.values(DIAGNOSTIC_CODES));
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* A typed package failure.
|
|
93
|
+
*
|
|
94
|
+
* Carries enough context to choose a recovery, and never carries notification
|
|
95
|
+
* body text, routing payload values, or token material. Where a value violated
|
|
96
|
+
* a rule, the *shape* of the violation is reported — a length, a character
|
|
97
|
+
* position — rather than the value itself.
|
|
98
|
+
*/
|
|
99
|
+
class NotificationError extends _rnCore.SdkError {
|
|
100
|
+
constructor(code, message, context) {
|
|
101
|
+
super('rn-notification', code, {
|
|
102
|
+
message
|
|
103
|
+
});
|
|
104
|
+
this.name = 'NotificationError';
|
|
105
|
+
// Redacted on the way in: an error object reaches crash reporters, which
|
|
106
|
+
// never run with verbose diagnostics.
|
|
107
|
+
const redacted = (0, _redact.redactContext)(context, false);
|
|
108
|
+
if (redacted !== undefined) {
|
|
109
|
+
this.context = redacted;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.NotificationError = NotificationError;
|
|
114
|
+
function isNotificationError(value) {
|
|
115
|
+
return value instanceof NotificationError;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Conditions that are reported outcomes rather than failures: the operation
|
|
120
|
+
* succeeded, and something the caller needs to know happened alongside it.
|
|
121
|
+
*/
|
|
122
|
+
const NON_FAILURE_CODES = exports.NON_FAILURE_CODES = Object.freeze([DIAGNOSTIC_CODES.TRUNCATED_OVER_CEILING, DIAGNOSTIC_CODES.PENDING_SET_DISCREPANCY, DIAGNOSTIC_CODES.EXACT_ALARM_UNAVAILABLE, DIAGNOSTIC_CODES.TARGET_MISSING, DIAGNOSTIC_CODES.BURST_THRESHOLD_EXCEEDED, DIAGNOSTIC_CODES.PAYLOAD_VERSION_SKEW, DIAGNOSTIC_CODES.PAYLOAD_DUPLICATE, DIAGNOSTIC_CODES.STATE_CAP_EVICTED, DIAGNOSTIC_CODES.STATE_CAP_EXCEEDED, DIAGNOSTIC_CODES.STATE_CORRUPT_REBUILT, DIAGNOSTIC_CODES.BACKGROUND_RESTRICTION_UNKNOWN, DIAGNOSTIC_CODES.DND_BYPASS_UNAVAILABLE, DIAGNOSTIC_CODES.TONE_LABELS_REFRESHED, DIAGNOSTIC_CODES.REPEAT_ALERT_UNAVAILABLE, DIAGNOSTIC_CODES.REPEAT_STOP_HANDLER_MISSING]);
|
|
123
|
+
function isNonFailure(code) {
|
|
124
|
+
return NON_FAILURE_CODES.includes(code);
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_rnCore","require","_redact","DIAGNOSTIC_CODES","exports","INVALID_ID_EMPTY","INVALID_ID_LENGTH","INVALID_ID_CHARSET","INVALID_OWNER_TAG","INVALID_GROUP_TAG","MOMENT_IN_PAST","UNDECLARED_TONE","ROUTING_PAYLOAD_TOO_LARGE","CONTENT_TOO_LARGE","TOO_MANY_ACTIONS","INVALID_RECURRENCE","INVALID_TONE_REPEAT","DUPLICATE_IDENTIFIER","TRUNCATED_OVER_CEILING","RECONCILE_INTERRUPTED","PENDING_SET_DISCREPANCY","DISPLAY_PERMISSION_DENIED","DISPLAY_PERMISSION_PERMANENT","EXACT_ALARM_UNAVAILABLE","SETTINGS_UNAVAILABLE","BACKGROUND_RESTRICTED","BACKGROUND_RESTRICTION_UNKNOWN","CHANNEL_MIGRATION_REQUIRED","CHANNEL_MIGRATION_FAILED","CHANNEL_ORPHANS_FOUND","DND_BYPASS_UNAVAILABLE","TONE_LABELS_REFRESHED","REPEAT_ALERT_UNAVAILABLE","REPEAT_STOP_HANDLER_MISSING","TARGET_MISSING","INTERACTION_BUFFER_EVICTED","BACKGROUND_WINDOW_EXCEEDED","PUSH_UNAVAILABLE","TOKEN_UNAVAILABLE","TOKEN_INVALIDATION_FAILED","PAYLOAD_MALFORMED","PAYLOAD_VERSION_SKEW","PAYLOAD_DUPLICATE","PUSH_UNDELIVERABLE","STATE_CORRUPT_REBUILT","STATE_WRITE_FAILED","STATE_STORE_DEGRADED","STATE_CAP_EVICTED","STATE_CAP_EXCEEDED","BURST_THRESHOLD_EXCEEDED","MAINTENANCE_FAILED","ALL_DIAGNOSTIC_CODES","Object","freeze","values","NotificationError","SdkError","constructor","code","message","context","name","redacted","redactContext","undefined","isNotificationError","value","NON_FAILURE_CODES","isNonFailure","includes"],"sourceRoot":"../../../src","sources":["contract/errors.ts"],"mappings":";;;;;;;;AAaA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAME,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC/B;EACAE,gBAAgB,EAAE,kBAAkB;EACpCC,iBAAiB,EAAE,mBAAmB;EACtCC,kBAAkB,EAAE,oBAAoB;EACxCC,iBAAiB,EAAE,mBAAmB;EACtCC,iBAAiB,EAAE,mBAAmB;EACtCC,cAAc,EAAE,gBAAgB;EAChCC,eAAe,EAAE,iBAAiB;EAClCC,yBAAyB,EAAE,2BAA2B;EACtDC,iBAAiB,EAAE,mBAAmB;EACtCC,gBAAgB,EAAE,kBAAkB;EACpCC,kBAAkB,EAAE,oBAAoB;EACxCC,mBAAmB,EAAE,qBAAqB;EAE1C;EACAC,oBAAoB,EAAE,sBAAsB;EAC5CC,sBAAsB,EAAE,wBAAwB;EAChDC,qBAAqB,EAAE,uBAAuB;EAC9CC,uBAAuB,EAAE,yBAAyB;EAEl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|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FNV_OFFSET_BASIS = void 0;
|
|
7
|
+
exports.fnv1a = fnv1a;
|
|
8
|
+
exports.hex8 = hex8;
|
|
9
|
+
/**
|
|
10
|
+
* FNV-1a, 32-bit: the package's one hash (NOT-19). Deterministic,
|
|
11
|
+
* dependency-free, and stable across releases.
|
|
12
|
+
*
|
|
13
|
+
* Bitwise operators are the algorithm, not a micro-optimisation: arithmetic
|
|
14
|
+
* equivalents would not wrap to 32 bits. Stability matters: a marker id or a
|
|
15
|
+
* label fingerprint that changed between releases would orphan every marker
|
|
16
|
+
* already scheduled, or refresh every channel label once more.
|
|
17
|
+
*/
|
|
18
|
+
const FNV_OFFSET_BASIS = exports.FNV_OFFSET_BASIS = 0x811c9dc5;
|
|
19
|
+
|
|
20
|
+
/* eslint-disable no-bitwise */
|
|
21
|
+
function fnv1a(value, basis = FNV_OFFSET_BASIS) {
|
|
22
|
+
let hash = basis;
|
|
23
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
24
|
+
hash ^= value.codePointAt(index) ?? 0;
|
|
25
|
+
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
26
|
+
}
|
|
27
|
+
return hash >>> 0;
|
|
28
|
+
}
|
|
29
|
+
/* eslint-enable no-bitwise */
|
|
30
|
+
|
|
31
|
+
/** Eight lowercase hex digits. */
|
|
32
|
+
function hex8(value) {
|
|
33
|
+
return value.toString(16).padStart(8, '0');
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FNV_OFFSET_BASIS","exports","fnv1a","value","basis","hash","index","length","codePointAt","Math","imul","hex8","toString","padStart"],"sourceRoot":"../../../src","sources":["contract/hash.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,UAAU;;AAE1C;AACO,SAASE,KAAKA,CAACC,KAAa,EAAEC,KAAa,GAAGJ,gBAAgB,EAAU;EAC9E,IAAIK,IAAI,GAAGD,KAAK;EAChB,KAAK,IAAIE,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGH,KAAK,CAACI,MAAM,EAAED,KAAK,IAAI,CAAC,EAAE;IACrDD,IAAI,IAAIF,KAAK,CAACK,WAAW,CAACF,KAAK,CAAC,IAAI,CAAC;IACrCD,IAAI,GAAGI,IAAI,CAACC,IAAI,CAACL,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC;EACzC;EACA,OAAOA,IAAI,KAAK,CAAC;AAClB;AACA;;AAEA;AACO,SAASM,IAAIA,CAACR,KAAa,EAAU;EAC3C,OAAOA,KAAK,CAACS,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC3C","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _notification = require("./notification.js");
|
|
7
|
+
Object.keys(_notification).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _notification[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _notification[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _recurrence = require("./recurrence.js");
|
|
18
|
+
Object.keys(_recurrence).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _recurrence[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _recurrence[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _reconcile = require("./reconcile.js");
|
|
29
|
+
Object.keys(_reconcile).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _reconcile[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _reconcile[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _permission = require("./permission.js");
|
|
40
|
+
Object.keys(_permission).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _permission[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _permission[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _channel = require("./channel.js");
|
|
51
|
+
Object.keys(_channel).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _channel[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _channel[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _interaction = require("./interaction.js");
|
|
62
|
+
Object.keys(_interaction).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _interaction[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _interaction[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _diagnostics = require("./diagnostics.js");
|
|
73
|
+
Object.keys(_diagnostics).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _diagnostics[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _diagnostics[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _errors = require("./errors.js");
|
|
84
|
+
Object.keys(_errors).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _errors[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _errors[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_notification","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_recurrence","_reconcile","_permission","_channel","_interaction","_diagnostics","_errors"],"sourceRoot":"../../../src","sources":["contract/index.ts"],"mappings":";;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,aAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,aAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,aAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,WAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,WAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EA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
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MAX_ROUTING_PAYLOAD_BYTES = exports.MAX_ACTIONS_PER_NOTIFICATION = exports.INTERACTION_BUFFER_LIMITS = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Interaction types.
|
|
9
|
+
*
|
|
10
|
+
* One event shape covers foreground, background, and cold start, so a consumer
|
|
11
|
+
* writes one handler. Events that occur before a handler registers are buffered
|
|
12
|
+
* durably and delivered on registration — the cold-start case is the one most
|
|
13
|
+
* integrations quietly get wrong.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Which app state the interaction arrived in. Informational; the shape never varies. */
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Signals the routing target no longer exists.
|
|
20
|
+
*
|
|
21
|
+
* The consumer chooses its own fallback screen. A platform error is never
|
|
22
|
+
* shown to the user for this — a notification pointing at deleted data is an
|
|
23
|
+
* ordinary condition, not a crash.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** Limits on the durable interaction buffer, so it can never grow without bound. */
|
|
27
|
+
const INTERACTION_BUFFER_LIMITS = exports.INTERACTION_BUFFER_LIMITS = {
|
|
28
|
+
maxEntries: 50,
|
|
29
|
+
retentionMs: 7 * 24 * 60 * 60 * 1000
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Maximum size of a routing payload, validated at schedule time rather than discovered at tap time. */
|
|
33
|
+
const MAX_ROUTING_PAYLOAD_BYTES = exports.MAX_ROUTING_PAYLOAD_BYTES = 4 * 1024;
|
|
34
|
+
|
|
35
|
+
/** Maximum action buttons on one notification. */
|
|
36
|
+
const MAX_ACTIONS_PER_NOTIFICATION = exports.MAX_ACTIONS_PER_NOTIFICATION = 10;
|
|
37
|
+
//# sourceMappingURL=interaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["INTERACTION_BUFFER_LIMITS","exports","maxEntries","retentionMs","MAX_ROUTING_PAYLOAD_BYTES","MAX_ACTIONS_PER_NOTIFICATION"],"sourceRoot":"../../../src","sources":["contract/interaction.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACO,MAAMA,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG;EACxCE,UAAU,EAAE,EAAE;EACdC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AACjC,CAAU;;AAEV;AACO,MAAMC,yBAAyB,GAAAH,OAAA,CAAAG,yBAAA,GAAG,CAAC,GAAG,IAAI;;AAEjD;AACO,MAAMC,4BAA4B,GAAAJ,OAAA,CAAAI,4BAAA,GAAG,EAAE","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_ANCHORING_MODE = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Core notification request types.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here carries business meaning. The package accepts fully-described
|
|
11
|
+
* requests and is responsible only for delivering them at the right moment.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* How a delivery moment is pinned to the passage of time.
|
|
16
|
+
*
|
|
17
|
+
* - `wallClock` — the local clock time named. An 08:00 reminder stays 08:00
|
|
18
|
+
* after the user crosses a time zone. This is the default, because reminders
|
|
19
|
+
* are wall-clock things and a caller who does not choose should get what
|
|
20
|
+
* their users expect.
|
|
21
|
+
* - `absolute` — one fixed instant worldwide, unaffected by zone changes.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const DEFAULT_ANCHORING_MODE = exports.DEFAULT_ANCHORING_MODE = 'wallClock';
|
|
25
|
+
|
|
26
|
+
/** When a notification should be presented, and how that moment is anchored. */
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Resolved display strings. The package performs no translation, formatting,
|
|
30
|
+
* or locale resolution — only the consuming app knows its content model.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/** Structured data carried to the interaction handler, unchanged. */
|
|
34
|
+
|
|
35
|
+
/** A button on a notification. */
|
|
36
|
+
|
|
37
|
+
/** The complete, self-contained description of one notification. */
|
|
38
|
+
|
|
39
|
+
/** One entry the platform is currently holding, in enough detail to diff against intent. */
|
|
40
|
+
|
|
41
|
+
/** Outcome of a single schedule call. */
|
|
42
|
+
//# sourceMappingURL=notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_ANCHORING_MODE","exports"],"sourceRoot":"../../../src","sources":["contract/notification.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGO,MAAMA,sBAAqC,GAAAC,OAAA,CAAAD,sBAAA,GAAG,WAAW;;AAEhE;;AAQA;AACA;AACA;AACA;;AAQA;;AAGA;;AAiBA;;AAmBA;;AA4BA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["contract/permission.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["contract/reconcile.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LOOKAHEAD_BOUNDS = exports.DEFAULT_LOOKAHEAD = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Recurrence declaration types.
|
|
9
|
+
*
|
|
10
|
+
* A caller declares a rule once; the package expands it inside a finite
|
|
11
|
+
* lookahead window. No caller ever writes an expansion loop, and no unbounded
|
|
12
|
+
* series is ever handed to the platform.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Days of the week, `0` = Sunday, matching `Date.prototype.getDay`. */
|
|
16
|
+
|
|
17
|
+
/** Every day at the declared clock time. */
|
|
18
|
+
|
|
19
|
+
/** Selected weekdays at the declared clock time. */
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A fixed day of the month at the declared clock time.
|
|
23
|
+
*
|
|
24
|
+
* Months shorter than `dayOfMonth` are skipped rather than clamped: a caller
|
|
25
|
+
* asking for the 31st means the 31st, and inventing the 28th would be the
|
|
26
|
+
* package deciding something it was not asked to decide.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** When a series stops producing occurrences. */
|
|
30
|
+
|
|
31
|
+
/** Content shared by every occurrence of a series. Identity and moment are derived. */
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* How far ahead occurrences are registered with the platform.
|
|
35
|
+
*
|
|
36
|
+
* Bounded by both a duration and a count because either alone fails: a duration
|
|
37
|
+
* alone lets a frequent series exhaust the platform ceiling, and a count alone
|
|
38
|
+
* leaves an annual series scheduled a decade out.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const DEFAULT_LOOKAHEAD = exports.DEFAULT_LOOKAHEAD = {
|
|
42
|
+
days: 60,
|
|
43
|
+
occurrencesPerSeries: 32
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** Bounds on consumer adjustment, because the platform ceiling is not negotiable. */
|
|
47
|
+
const LOOKAHEAD_BOUNDS = exports.LOOKAHEAD_BOUNDS = {
|
|
48
|
+
minDays: 1,
|
|
49
|
+
maxDays: 365,
|
|
50
|
+
minOccurrences: 1,
|
|
51
|
+
maxOccurrences: 64
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=recurrence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_LOOKAHEAD","exports","days","occurrencesPerSeries","LOOKAHEAD_BOUNDS","minDays","maxDays","minOccurrences","maxOccurrences"],"sourceRoot":"../../../src","sources":["contract/recurrence.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAGA;;AASA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;;AAMA;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,iBAAkC,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EACjDE,IAAI,EAAE,EAAE;EACRC,oBAAoB,EAAE;AACvB,CAAC;;AAED;AACO,MAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG;EAC/BC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE,GAAG;EACZC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE;AACjB,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createBurstDetector = createBurstDetector;
|
|
7
|
+
var _diagnostics = require("../contract/diagnostics.js");
|
|
8
|
+
var _errors = require("../contract/errors.js");
|
|
9
|
+
/**
|
|
10
|
+
* Burst detection.
|
|
11
|
+
*
|
|
12
|
+
* Both platforms apply undocumented delivery rate limits and will silently drop
|
|
13
|
+
* or delay past them — which is exactly the invisible failure this package
|
|
14
|
+
* exists to eliminate. So volume is watched and reported.
|
|
15
|
+
*
|
|
16
|
+
* It is **not** acted upon. Nothing is throttled, delayed, coalesced, or
|
|
17
|
+
* dropped: deciding which of a user's notifications to suppress is a product
|
|
18
|
+
* decision the package has no basis to make. Noticing that something abnormal
|
|
19
|
+
* is happening is one it can.
|
|
20
|
+
*
|
|
21
|
+
* Counters are in memory only. A burst is a live condition, and persisting it
|
|
22
|
+
* would expand the state contract for no diagnostic gain.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const MINUTE_MS = 60_000;
|
|
26
|
+
const HOUR_MS = 60 * MINUTE_MS;
|
|
27
|
+
function createBurstDetector(deps = {}) {
|
|
28
|
+
const threshold = deps.threshold ?? _diagnostics.DEFAULT_BURST_THRESHOLD;
|
|
29
|
+
const emit = deps.emit ?? (() => {});
|
|
30
|
+
/** Per owner tag, because one busy account should not implicate another. */
|
|
31
|
+
const timestamps = new Map();
|
|
32
|
+
/** Prevents one sustained burst producing a diagnostic per notification. */
|
|
33
|
+
const reportedAt = new Map();
|
|
34
|
+
const prune = (tag, now) => {
|
|
35
|
+
const kept = (timestamps.get(tag) ?? []).filter(at => now - at <= HOUR_MS);
|
|
36
|
+
timestamps.set(tag, kept);
|
|
37
|
+
return kept;
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
/**
|
|
41
|
+
* Records one presented notification and reports if the threshold is crossed.
|
|
42
|
+
*
|
|
43
|
+
* Always returns after recording — the caller delivers regardless of what
|
|
44
|
+
* this says.
|
|
45
|
+
*/
|
|
46
|
+
record(now, ownerTag = '*') {
|
|
47
|
+
const kept = prune(ownerTag, now);
|
|
48
|
+
kept.push(now);
|
|
49
|
+
const lastMinute = kept.filter(at => now - at <= MINUTE_MS).length;
|
|
50
|
+
const lastHour = kept.length;
|
|
51
|
+
const exceeded = lastMinute > threshold.perMinute || lastHour > threshold.perHour;
|
|
52
|
+
if (exceeded) {
|
|
53
|
+
const last = reportedAt.get(ownerTag) ?? 0;
|
|
54
|
+
// One report per minute per tag; a sustained burst is one condition,
|
|
55
|
+
// not a hundred.
|
|
56
|
+
if (now - last >= MINUTE_MS) {
|
|
57
|
+
reportedAt.set(ownerTag, now);
|
|
58
|
+
emit(_errors.DIAGNOSTIC_CODES.BURST_THRESHOLD_EXCEEDED, `Abnormal notification volume: ${lastMinute} in the last minute and ${lastHour} in the last hour (thresholds ${threshold.perMinute}/minute, ${threshold.perHour}/hour). Every notification was still delivered — the package throttles nothing.`, {
|
|
59
|
+
ownerTag,
|
|
60
|
+
lastMinute,
|
|
61
|
+
lastHour,
|
|
62
|
+
threshold
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
ownerTag,
|
|
68
|
+
lastMinute,
|
|
69
|
+
lastHour,
|
|
70
|
+
exceeded
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
status(now, ownerTag = '*') {
|
|
74
|
+
const kept = prune(ownerTag, now);
|
|
75
|
+
const lastMinute = kept.filter(at => now - at <= MINUTE_MS).length;
|
|
76
|
+
return {
|
|
77
|
+
ownerTag,
|
|
78
|
+
lastMinute,
|
|
79
|
+
lastHour: kept.length,
|
|
80
|
+
exceeded: lastMinute > threshold.perMinute || kept.length > threshold.perHour
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
reset() {
|
|
84
|
+
timestamps.clear();
|
|
85
|
+
reportedAt.clear();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=burst.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_diagnostics","require","_errors","MINUTE_MS","HOUR_MS","createBurstDetector","deps","threshold","DEFAULT_BURST_THRESHOLD","emit","timestamps","Map","reportedAt","prune","tag","now","kept","get","filter","at","set","record","ownerTag","push","lastMinute","length","lastHour","exceeded","perMinute","perHour","last","DIAGNOSTIC_CODES","BURST_THRESHOLD_EXCEEDED","status","reset","clear"],"sourceRoot":"../../../src","sources":["diagnostics/burst.ts"],"mappings":";;;;;;AAiBA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,MAAME,SAAS,GAAG,MAAM;AACxB,MAAMC,OAAO,GAAG,EAAE,GAAGD,SAAS;AAcvB,SAAS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AAE;UAC5BS,UAAU,CAACQ,GAAG,CAACE,QAAQ,EAAEP,GAAG,CAAC;UAC7BN,IAAI,CACHsB,wBAAgB,CAACC,wBAAwB,EACzC,iCAAiCR,UAAU,2BAA2BE,QAAQ,iCAAiCnB,SAAS,CAACqB,SAAS,YAAYrB,SAAS,CAACsB,OAAO,iFAAiF,EAChP;YAAEP,QAAQ;YAAEE,UAAU;YAAEE,QAAQ;YAAEnB;UAAU,CAC7C,CAAC;QACF;MACD;MAEA,OAAO;QAAEe,QAAQ;QAAEE,UAAU;QAAEE,QAAQ;QAAEC;MAAS,CAAC;IACpD,CAAC;IAEDM,MAAMA,CAAClB,GAAW,EAAEO,QAAQ,GAAG,GAAG,EAAe;MAChD,MAAMN,IAAI,GAAGH,KAAK,CAACS,QAAQ,EAAEP,GAAG,CAAC;MACjC,MAAMS,UAAU,GAAGR,IAAI,CAACE,MAAM,CAACC,EAAE,IAAIJ,GAAG,GAAGI,EAAE,IAAIhB,SAAS,CAAC,CAACsB,MAAM;MAElE,OAAO;QACNH,QAAQ;QACRE,UAAU;QACVE,QAAQ,EAAEV,IAAI,CAACS,MAAM;QACrBE,QAAQ,EAAEH,UAAU,GAAGjB,SAAS,CAACqB,SAAS,IAAIZ,IAAI,CAACS,MAAM,GAAGlB,SAAS,CAACsB;MACvE,CAAC;IACF,CAAC;IAEDK,KAAKA,CAAA,EAAS;MACbxB,UAAU,CAACyB,KAAK,CAAC,CAAC;MAClBvB,UAAU,CAACuB,KAAK,CAAC,CAAC;IACnB;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DiagnosticEmitter = void 0;
|
|
7
|
+
var _rnCore = require("@chipmobilesdk/rn-core");
|
|
8
|
+
var _errors = require("../contract/errors.js");
|
|
9
|
+
var _redact = require("./redact.js");
|
|
10
|
+
/**
|
|
11
|
+
* The structured event stream.
|
|
12
|
+
*
|
|
13
|
+
* With no sink attached the package emits nothing and buffers nothing. A
|
|
14
|
+
* library that writes to the console in production has decided something for
|
|
15
|
+
* its consumer; this one routes events wherever the app already sends its logs,
|
|
16
|
+
* or stays silent.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const channel = (0, _rnCore.createDiagnosticChannel)('rn-notification');
|
|
20
|
+
class DiagnosticEmitter {
|
|
21
|
+
constructor(options = {}) {
|
|
22
|
+
this.sink = options.sink;
|
|
23
|
+
this.verbose = options.verbose ?? false;
|
|
24
|
+
this.now = options.now ?? (() => Date.now());
|
|
25
|
+
}
|
|
26
|
+
setSink(sink) {
|
|
27
|
+
this.sink = sink;
|
|
28
|
+
}
|
|
29
|
+
setVerbose(verbose) {
|
|
30
|
+
this.verbose = verbose;
|
|
31
|
+
}
|
|
32
|
+
get hasSink() {
|
|
33
|
+
return this.sink !== undefined;
|
|
34
|
+
}
|
|
35
|
+
emit(code, message, context, severity) {
|
|
36
|
+
const resolvedSeverity = severity ?? ((0, _errors.isNonFailure)(code) ? 'info' : 'error');
|
|
37
|
+
// The app's SDK sinks (`installSdkSink`, CORE-08) never get content, even
|
|
38
|
+
// with verbose diagnostics on: verbose is for this package's own sink.
|
|
39
|
+
channel.emit(code, resolvedSeverity, (0, _redact.redactContext)(context, false));
|
|
40
|
+
|
|
41
|
+
// No sink means no work at all — not a buffer that grows until one appears.
|
|
42
|
+
if (this.sink === undefined) return;
|
|
43
|
+
const event = {
|
|
44
|
+
code,
|
|
45
|
+
severity: resolvedSeverity,
|
|
46
|
+
message,
|
|
47
|
+
at: this.now(),
|
|
48
|
+
context: (0, _redact.redactContext)(context, this.verbose)
|
|
49
|
+
};
|
|
50
|
+
try {
|
|
51
|
+
this.sink(event);
|
|
52
|
+
} catch {
|
|
53
|
+
// A failing sink is the consumer's problem and must never become ours.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Lifecycle transitions that are not failures: scheduled, delivered, reconciled. */
|
|
58
|
+
info(code, message, context) {
|
|
59
|
+
this.emit(code, message, context, 'info');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.DiagnosticEmitter = DiagnosticEmitter;
|
|
63
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_rnCore","require","_errors","_redact","channel","createDiagnosticChannel","DiagnosticEmitter","constructor","options","sink","verbose","now","Date","setSink","setVerbose","hasSink","undefined","emit","code","message","context","severity","resolvedSeverity","isNonFailure","redactContext","event","at","info","exports"],"sourceRoot":"../../../src","sources":["diagnostics/events.ts"],"mappings":";;;;;;AASA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,MAAMG,OAAO,GAAG,IAAAC,+BAAuB,EAAiB,iBAAiB,CAAC;AAEnE,MAAMC,iBAAiB,CAAC;EAK9BC,WAAWA,CAACC,OAAuB,GAAG,CAAC,CAAC,EAAE;IACzC,IAAI,CAACC,IAAI,GAAGD,OAAO,CAACC,IAAI;IACxB,IAAI,CAACC,OAAO,GAAGF,OAAO,CAACE,OAAO,IAAI,KAAK;IACvC,IAAI,CAACC,GAAG,GAAGH,OAAO,CAACG,GAAG,KAAK,MAAMC,IAAI,CAACD,GAAG,CAAC,CAAC,CAAC;EAC7C;EAEAE,OAAOA,CAACJ,IAA2B,EAAQ;IAC1C,IAAI,CAACA,IAAI,GAAGA,IAAI;EACjB;EAEAK,UAAUA,CAACJ,OAAgB,EAAQ;IAClC,IAAI,CAACA,OAAO,GAAGA,OAAO;EACvB;EAEA,IAAIK,OAAOA,CAAA,EAAY;IACtB,OAAO,IAAI,CAACN,IAAI,KAAKO,SAAS;EAC/B;EAEAC,IAAIA,CACHC,IAAoB,EACpBC,OAAe,E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