@ovok/native 0.4.2 → 0.4.4
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/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/custom-device-brand.js +12 -0
- package/lib/commonjs/modules/bt-management/constants/custom-device-brand.js.map +1 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +111 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -0
- package/lib/commonjs/modules/bt-management/index.js +209 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +116 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js +83 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js +64 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-monitor.js +76 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-monitor.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/custom-device-error.js +13 -0
- package/lib/commonjs/modules/bt-management/services/custom/custom-device-error.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +120 -0
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/normalize-ble-uuid.js +32 -0
- package/lib/commonjs/modules/bt-management/services/custom/normalize-ble-uuid.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/device-creator.js +52 -26
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +22 -5
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +103 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/accepted-device.js +6 -0
- package/lib/commonjs/modules/bt-management/types/accepted-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/compiled-custom-field.js +6 -0
- package/lib/commonjs/modules/bt-management/types/compiled-custom-field.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-byte-order.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-byte-order.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-case-kind.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-case-kind.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-case-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-case-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-device-definition.js +4 -0
- package/lib/commonjs/modules/bt-management/types/custom-device-definition.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-device-id.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-device-id.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-device-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-device-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-field-encoding.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-field-encoding.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-field-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-field-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-frame-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-frame-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-measurement.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-measurement.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-monitor-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-monitor-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-service-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-service-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-key-of.js +6 -0
- package/lib/commonjs/modules/bt-management/types/device-key-of.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-key.js +6 -0
- package/lib/commonjs/modules/bt-management/types/device-key.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +54 -0
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js +40 -0
- package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/decode-medical-float.js +38 -0
- package/lib/commonjs/modules/bt-management/utils/decode-medical-float.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/is-custom-device-definition.js +15 -0
- package/lib/commonjs/modules/bt-management/utils/is-custom-device-definition.js.map +1 -0
- package/lib/commonjs/modules/data-sync/components/android/android-health-sync.js +11 -1
- package/lib/commonjs/modules/data-sync/components/android/android-health-sync.js.map +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-sync.js +33 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-sync.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +4 -0
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/storage-manager.js +30 -2
- package/lib/commonjs/modules/data-sync/services/managers/storage-manager.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/sync-state-manager.js +19 -0
- package/lib/commonjs/modules/data-sync/services/managers/sync-state-manager.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider.js.map +1 -1
- package/lib/module/modules/bt-management/constants/custom-device-brand.js +8 -0
- package/lib/module/modules/bt-management/constants/custom-device-brand.js.map +1 -0
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +108 -0
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +19 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +112 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +78 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js +59 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-monitor.js +71 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-monitor.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/custom-device-error.js +8 -0
- package/lib/module/modules/bt-management/services/custom/custom-device-error.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +115 -0
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/normalize-ble-uuid.js +27 -0
- package/lib/module/modules/bt-management/services/custom/normalize-ble-uuid.js.map +1 -0
- package/lib/module/modules/bt-management/services/device-creator.js +52 -26
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +22 -5
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +98 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -0
- package/lib/module/modules/bt-management/types/accepted-device.js +4 -0
- package/lib/module/modules/bt-management/types/accepted-device.js.map +1 -0
- package/lib/module/modules/bt-management/types/compiled-custom-field.js +4 -0
- package/lib/module/modules/bt-management/types/compiled-custom-field.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-byte-order.js +2 -0
- package/lib/module/modules/bt-management/types/custom-byte-order.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-case-kind.js +2 -0
- package/lib/module/modules/bt-management/types/custom-case-kind.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-case-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-case-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-device-definition.js +8 -0
- package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-device-id.js +2 -0
- package/lib/module/modules/bt-management/types/custom-device-id.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-device-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-device-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-field-encoding.js +2 -0
- package/lib/module/modules/bt-management/types/custom-field-encoding.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-field-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-field-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-frame-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-frame-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-measurement.js +4 -0
- package/lib/module/modules/bt-management/types/custom-measurement.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-monitor-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-monitor-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-service-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-service-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-key-of.js +4 -0
- package/lib/module/modules/bt-management/types/device-key-of.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-key.js +4 -0
- package/lib/module/modules/bt-management/types/device-key.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js +5 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +49 -0
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -0
- package/lib/module/modules/bt-management/utils/create-frame-validator.js +35 -0
- package/lib/module/modules/bt-management/utils/create-frame-validator.js.map +1 -0
- package/lib/module/modules/bt-management/utils/decode-medical-float.js +33 -0
- package/lib/module/modules/bt-management/utils/decode-medical-float.js.map +1 -0
- package/lib/module/modules/bt-management/utils/is-custom-device-definition.js +10 -0
- package/lib/module/modules/bt-management/utils/is-custom-device-definition.js.map +1 -0
- package/lib/module/modules/data-sync/components/android/android-health-sync.js +11 -1
- package/lib/module/modules/data-sync/components/android/android-health-sync.js.map +1 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-sync.js +33 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-sync.js.map +1 -1
- package/lib/module/modules/data-sync/services/base-health-sync-service.js +4 -0
- package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/storage-manager.js +30 -2
- package/lib/module/modules/data-sync/services/managers/storage-manager.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/sync-state-manager.js +19 -0
- package/lib/module/modules/data-sync/services/managers/sync-state-manager.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/custom-device-brand.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/custom-device-brand.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-frame.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-monitor.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-monitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/custom-device-error.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/custom-device-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/normalize-ble-uuid.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/normalize-ble-uuid.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts +12 -5
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +12 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +43 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/accepted-device.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/accepted-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-props.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/compiled-custom-field.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/compiled-custom-field.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-byte-order.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-byte-order.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-kind.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-kind.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-id.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-spec.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-monitor-spec.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-monitor-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-service-spec.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-service-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-key-of.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-key-of.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-key.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-key.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +10 -5
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-frame-validator.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/decode-medical-float.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/decode-medical-float.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/is-custom-device-definition.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/is-custom-device-definition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/storage-manager.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/storage-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-state-manager.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-state-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/custom-device-brand.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/constants/custom-device-brand.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +5 -4
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-frame.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-monitor.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-monitor.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/custom-device-error.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/custom-device-error.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/normalize-ble-uuid.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/normalize-ble-uuid.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts +12 -5
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +12 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +2 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +43 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/accepted-device.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/types/accepted-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +5 -4
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-props.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/compiled-custom-field.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/types/compiled-custom-field.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-byte-order.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-byte-order.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-kind.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-kind.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-id.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-id.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-spec.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts +27 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-monitor-spec.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-monitor-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-service-spec.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-service-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-key-of.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-key-of.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-key.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-key.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +10 -5
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/create-frame-validator.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/decode-medical-float.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/utils/decode-medical-float.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/is-custom-device-definition.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/utils/is-custom-device-definition.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/components/android/android-health-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts +2 -0
- package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/storage-manager.d.ts +20 -0
- package/lib/typescript/module/src/modules/data-sync/services/managers/storage-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-state-manager.d.ts +13 -0
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-state-manager.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,11 @@ export class BaseHealthSyncService {
|
|
|
15
15
|
this.storageManager = new StorageManager(props.client, this.getProviderName());
|
|
16
16
|
this.dataProcessor = new DataProcessor(props.client, props.patientId, this.getProviderName(), props.chunkSize ?? 5000, this.storageManager, this.getTotalCountsFunction(), this.getDataFromProviderFunction(), this.getConverterFunction());
|
|
17
17
|
}
|
|
18
|
+
/** One run at a time; see `SyncStateManager.once` for why that matters. */
|
|
18
19
|
async startSync() {
|
|
20
|
+
return this.stateManager.once(() => this.runSync());
|
|
21
|
+
}
|
|
22
|
+
async runSync() {
|
|
19
23
|
try {
|
|
20
24
|
if (!this.client.isInitialized) {
|
|
21
25
|
this.onSyncError(new Error("Client not initialized"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DataProcessor","StorageManager","SyncProgressManager","SyncStateManager","BaseHealthSyncService","constructor","props","client","patientId","dataToSync","onSyncError","progressManager","updateProgress","stateManager","storageManager","getProviderName","dataProcessor","chunkSize","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","startSync","isInitialized","Error","resume","setNotStartedStatuses","initialDataFetched","initializeSync","processAllDataTypes","setPauseStatuses","error","stopSync","resetAll","reset","shouldStopSync","pauseSync","pause","latestObservationDates","getLatestObservationDates","calculateTotalCounts","key","Object","keys","measurementTypeKey","data","getDataForMeasurementType","latestValidStartDate","getLatestValidStartDate","totalCount","getTotalRecordsCountForType","setTotalObservations","setStatus","syncDataByType","hasAnchor","observationBodies","currentHasAnchor","getObservationBodiesForType","entries","generateObservationEntries","incrementSyncedObservations","length","result","saveObservations","addResult"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/services/base-health-sync-service.ts"],"mappings":";;AAkBA,SAASA,aAAa,QAAQ,8BAA2B;AACzD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,qCAAkC;AACtE,SAASC,gBAAgB,QAAQ,kCAA+B;AAEhE,OAAO,MAAeC,qBAAqB,CAUzC;EAeAC,WAAWA,CAACC,KAAoC,EAAE;IAChD,IAAI,CAACC,MAAM,GAAGD,KAAK,CAACC,MAAM;IAC1B,IAAI,CAACC,SAAS,GAAGF,KAAK,CAACE,SAAS;IAChC,IAAI,CAACC,UAAU,GAAGH,KAAK,CAACG,UAAU;IAClC,IAAI,CAACC,WAAW,GAAGJ,KAAK,CAACI,WAAW;IAEpC,IAAI,CAACC,eAAe,GAAG,IAAIT,mBAAmB,CAC5CI,KAAK,CAACM,cAAc,EACpBN,KAAK,CAACG,UACR,CAAC;IACD,IAAI,CAACI,YAAY,GAAG,IAAIV,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAACW,cAAc,GAAG,IAAIb,cAAc,CACtCK,KAAK,CAACC,MAAM,EACZ,IAAI,CAACQ,eAAe,CAAC,CACvB,CAAC;IACD,IAAI,CAACC,aAAa,GAAG,IAAIhB,aAAa,CACpCM,KAAK,CAACC,MAAM,EACZD,KAAK,CAACE,SAAS,EACf,IAAI,CAACO,eAAe,CAAC,CAAC,EACtBT,KAAK,CAACW,SAAS,IAAI,IAAI,EACvB,IAAI,CAACH,cAAc,EACnB,IAAI,CAACI,sBAAsB,CAAC,CAAC,EAC7B,IAAI,CAACC,2BAA2B,CAAC,CAAC,EAClC,IAAI,CAACC,oBAAoB,CAAC,CAC5B,CAAC;EACH;EAgBA,MAAaC,SAASA,CAAA,EAAkB;IACtC,IAAI;MACF,IAAI,CAAC,IAAI,
|
|
1
|
+
{"version":3,"names":["DataProcessor","StorageManager","SyncProgressManager","SyncStateManager","BaseHealthSyncService","constructor","props","client","patientId","dataToSync","onSyncError","progressManager","updateProgress","stateManager","storageManager","getProviderName","dataProcessor","chunkSize","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","startSync","once","runSync","isInitialized","Error","resume","setNotStartedStatuses","initialDataFetched","initializeSync","processAllDataTypes","setPauseStatuses","error","stopSync","resetAll","reset","shouldStopSync","pauseSync","pause","latestObservationDates","getLatestObservationDates","calculateTotalCounts","key","Object","keys","measurementTypeKey","data","getDataForMeasurementType","latestValidStartDate","getLatestValidStartDate","totalCount","getTotalRecordsCountForType","setTotalObservations","setStatus","syncDataByType","hasAnchor","observationBodies","currentHasAnchor","getObservationBodiesForType","entries","generateObservationEntries","incrementSyncedObservations","length","result","saveObservations","addResult"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/services/base-health-sync-service.ts"],"mappings":";;AAkBA,SAASA,aAAa,QAAQ,8BAA2B;AACzD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,qCAAkC;AACtE,SAASC,gBAAgB,QAAQ,kCAA+B;AAEhE,OAAO,MAAeC,qBAAqB,CAUzC;EAeAC,WAAWA,CAACC,KAAoC,EAAE;IAChD,IAAI,CAACC,MAAM,GAAGD,KAAK,CAACC,MAAM;IAC1B,IAAI,CAACC,SAAS,GAAGF,KAAK,CAACE,SAAS;IAChC,IAAI,CAACC,UAAU,GAAGH,KAAK,CAACG,UAAU;IAClC,IAAI,CAACC,WAAW,GAAGJ,KAAK,CAACI,WAAW;IAEpC,IAAI,CAACC,eAAe,GAAG,IAAIT,mBAAmB,CAC5CI,KAAK,CAACM,cAAc,EACpBN,KAAK,CAACG,UACR,CAAC;IACD,IAAI,CAACI,YAAY,GAAG,IAAIV,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAACW,cAAc,GAAG,IAAIb,cAAc,CACtCK,KAAK,C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,CAACuB,cAAc,EAAE;QAC7D,IAAI;UACF,MAAM2B,MAAM,GAAG,MAAM,IAAI,CAACjD,cAAc,CAACkD,gBAAgB,CAACL,OAAO,CAAC;UAElE,IAAI,CAAC9C,YAAY,CAACoD,SAAS,CAACF,MAAM,CAAC;QACrC,CAAC,CAAC,OAAO/B,KAAK,EAAE;UACd,IAAI,CAACtB,WAAW,CAACsB,KAAc,CAAC;UAEhC;QACF;MACF;IACF;IAEA,IAAI,CAACrB,eAAe,CAAC0C,SAAS,CAC5BR,kBAAkB,EAClB,IAAI,CAAChC,YAAY,CAACuB,cAAc,GAAG,MAAM,GAAG,WAC9C,CAAC;EACH;EAEQW,yBAAyBA,CAACF,kBAAkC,EAAE;IACpE,OAAO,IAAI,CAACpC,UAAU,CAACoC,kBAAkB,CAAC;EAC5C;AACF","ignoreList":[]}
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import { saveBundleObservations } from "../../utils/save-bundle-observations.js";
|
|
4
4
|
export class StorageManager {
|
|
5
|
+
/**
|
|
6
|
+
* Where an anchor goes when the host client has no storage.
|
|
7
|
+
*
|
|
8
|
+
* `clientStorage` is assigned from `OvokClient`'s `storage` option and from
|
|
9
|
+
* nowhere else, so a host that constructs its client without one leaves it
|
|
10
|
+
* `undefined` — and the `?.` below then swallowed every write while
|
|
11
|
+
* `getAnchor` answered `undefined` for ever. That is not a lost
|
|
12
|
+
* optimisation: `getObservationBodiesForType` reports `hasAnchor` from the
|
|
13
|
+
* anchor the provider just returned, and `syncDataByType` loops while it is
|
|
14
|
+
* true. An anchor that never advances means the next read starts from the
|
|
15
|
+
* beginning again, returns the same first chunk and the same anchor, and
|
|
16
|
+
* uploads it — for ever.
|
|
17
|
+
*
|
|
18
|
+
* The sync must not depend on what the host passed. This map keeps the
|
|
19
|
+
* anchor for the life of the service instance, which is what lets the loop
|
|
20
|
+
* end; when the host DOES provide storage the anchor also survives a
|
|
21
|
+
* restart, which is what keeps the next cold start short.
|
|
22
|
+
*/
|
|
23
|
+
inMemoryAnchors = new Map();
|
|
5
24
|
constructor(client, provider) {
|
|
6
25
|
this.client = client;
|
|
7
26
|
this.provider = provider;
|
|
@@ -13,10 +32,19 @@ export class StorageManager {
|
|
|
13
32
|
});
|
|
14
33
|
}
|
|
15
34
|
saveAnchor(typeIdentifier, anchor) {
|
|
16
|
-
this.
|
|
35
|
+
const key = this.anchorKey(typeIdentifier);
|
|
36
|
+
if (this.client.clientStorage) {
|
|
37
|
+
this.client.clientStorage.setString(key, anchor);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.inMemoryAnchors.set(key, anchor);
|
|
17
41
|
}
|
|
18
42
|
getAnchor(typeIdentifier) {
|
|
19
|
-
|
|
43
|
+
const key = this.anchorKey(typeIdentifier);
|
|
44
|
+
return this.client.clientStorage ? this.client.clientStorage.getString(key) : this.inMemoryAnchors.get(key);
|
|
45
|
+
}
|
|
46
|
+
anchorKey(typeIdentifier) {
|
|
47
|
+
return `${this.provider}-sync-${typeIdentifier}-anchor`;
|
|
20
48
|
}
|
|
21
49
|
saveAnchors(anchors) {
|
|
22
50
|
anchors.forEach(({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["saveBundleObservations","StorageManager","constructor","client","provider","saveObservations","entries","saveAnchor","typeIdentifier","anchor","clientStorage","setString","getAnchor","getString","saveAnchors","anchors","forEach"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/storage-manager.ts"],"mappings":";;AAIA,SAASA,sBAAsB,QAAQ,yCAAsC;AAE7E,OAAO,MAAMC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"names":["saveBundleObservations","StorageManager","inMemoryAnchors","Map","constructor","client","provider","saveObservations","entries","saveAnchor","typeIdentifier","anchor","key","anchorKey","clientStorage","setString","set","getAnchor","getString","get","saveAnchors","anchors","forEach"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/storage-manager.ts"],"mappings":";;AAIA,SAASA,sBAAs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AAO,CAAC,KAAK;MAC9C,IAAI,CAACF,UAAU,CAACC,cAAc,EAAEC,MAAM,CAAC;IACzC,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export class SyncStateManager {
|
|
4
|
+
/**
|
|
5
|
+
* A sync in flight, so a second caller joins it rather than starting another.
|
|
6
|
+
*
|
|
7
|
+
* There are three callers and they overlap by construction:
|
|
8
|
+
* `InstanceManager.getInstanceInternal` starts one as a side effect of
|
|
9
|
+
* handing back the instance, the component starts one on mount, and the
|
|
10
|
+
* change subscription starts one whenever the provider reports new samples.
|
|
11
|
+
* Two runs over one data type read the same chunk and upload it twice,
|
|
12
|
+
* because the read cursor only advances once a read has returned.
|
|
13
|
+
*/
|
|
14
|
+
|
|
4
15
|
shouldStopSync = false;
|
|
5
16
|
initialDataFetched = false;
|
|
6
17
|
latestObservationDates = [];
|
|
@@ -8,6 +19,14 @@ export class SyncStateManager {
|
|
|
8
19
|
addResult(result) {
|
|
9
20
|
this.results.push(result);
|
|
10
21
|
}
|
|
22
|
+
|
|
23
|
+
/** Runs `sync`, or joins the run already under way. */
|
|
24
|
+
async once(sync) {
|
|
25
|
+
this.inFlight ??= sync().finally(() => {
|
|
26
|
+
this.inFlight = undefined;
|
|
27
|
+
});
|
|
28
|
+
return this.inFlight;
|
|
29
|
+
}
|
|
11
30
|
reset() {
|
|
12
31
|
this.shouldStopSync = false;
|
|
13
32
|
this.initialDataFetched = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SyncStateManager","shouldStopSync","initialDataFetched","latestObservationDates","results","addResult","result","push","reset","pause","resume"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/sync-state-manager.ts"],"mappings":";;AAEA,OAAO,MAAMA,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"names":["SyncStateManager","shouldStopSync","initialDataFetched","latestObservationDates","results","addResult","result","push","once","sync","inFlight","finally","undefined","reset","pause","resume"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/services/managers/sync-state-manager.ts"],"mappings":";;AAEA,OAAO,MAAMA,gBAAgB,CAAC;EAC5B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGSC,cAAc,GAAG,KAAK;EACtBC,kBAAkB,GAAG,KAAK;EAC1BC,sBAAsB,GAGxB,EAAE;EACAC,OAAO,GAA0B,EAAE;EAE1CC,SAASA,CAACC,MAA2B,EAAQ;IAC3C,IAAI,CAACF,OAAO,CAACG,IAAI,CAACD,MAAM,CAAC;EAC3B;;EAEA;EACA,MAAME,IAAIA,CAACC,IAAyB,EAAiB;IACnD,IAAI,CAACC,QAAQ,KAAKD,IAAI,CAAC,CAAC,CAACE,OAAO,CAAC,MAAM;MACrC,IAAI,CAACD,QAAQ,GAAGE,SAAS;IAC3B,CAAC,CAAC;IAEF,OAAO,IAAI,CAACF,QAAQ;EACtB;EAEAG,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACZ,cAAc,GAAG,KAAK;IAC3B,IAAI,CAACC,kBAAkB,GAAG,KAAK;IAC/B,IAAI,CAACC,sBAAsB,GAAG,EAAE;IAChC,IAAI,CAACC,OAAO,GAAG,EAAE;EACnB;EAEAU,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACb,cAAc,GAAG,IAAI;EAC5B;EAEAc,MAAMA,CAAA,EAAS;IACb,IAAI,CAACd,cAAc,GAAG,KAAK;EAC7B;AACF","ignoreList":[]}
|
package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { AcceptedDevice } from "../types/accepted-device";
|
|
2
3
|
import { BTProviderChildWrapperProps } from "../types/btprovider-children-props";
|
|
3
|
-
|
|
4
|
-
export declare const BTProviderChildWrapper: <T extends readonly IntegratedDevices[]>(props: React.PropsWithChildren<BTProviderChildWrapperProps<T>>) => React.JSX.Element;
|
|
4
|
+
export declare const BTProviderChildWrapper: <T extends readonly AcceptedDevice[]>(props: React.PropsWithChildren<BTProviderChildWrapperProps<T>>) => React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=bt-provider-child-wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-provider-child-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/components/bt-provider-child-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bt-provider-child-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/components/bt-provider-child-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEjF,eAAO,MAAM,sBAAsB,EA+G9B,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE,EACvC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,KAC3D,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { AcceptedDevice } from "../types/accepted-device";
|
|
2
3
|
import { BTProviderProps } from "../types/btprovider-props";
|
|
3
|
-
|
|
4
|
-
export declare const BTProvider: <T extends readonly IntegratedDevices[]>({ permissionFallback, onAccessPermissionChanged, ...props }: React.PropsWithChildren<BTProviderProps<T>>) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
4
|
+
export declare const BTProvider: <T extends readonly AcceptedDevice[]>({ permissionFallback, onAccessPermissionChanged, ...props }: React.PropsWithChildren<BTProviderProps<T>>) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
5
5
|
//# sourceMappingURL=bt-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-provider.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/components/bt-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bt-provider.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/components/bt-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAK5D,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,cAAc,EAAE,EAAE,6DAI7D,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,oSAkB7C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks an object as the output of defineCustomDevice. A hand-rolled definition that
|
|
3
|
+
* skipped registration validation therefore cannot be passed to acceptedDevices.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CUSTOM_DEVICE_BRAND: unique symbol;
|
|
6
|
+
//# sourceMappingURL=custom-device-brand.d.ts.map
|
package/lib/typescript/commonjs/src/modules/bt-management/constants/custom-device-brand.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-device-brand.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/custom-device-brand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,MAAwC,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
2
|
+
/**
|
|
3
|
+
* The measurement types a declaration may produce, the properties each one accepts, the
|
|
4
|
+
* canonical unit of every property, and the physiological envelope outside which a decoded
|
|
5
|
+
* value is treated as a decoding fault rather than a reading.
|
|
6
|
+
*
|
|
7
|
+
* A measurement type absent from this catalog cannot be declared. ECG, urine analysis and
|
|
8
|
+
* the cosinuss multi-parameter stream are absent on purpose: they are assembled across
|
|
9
|
+
* several notifications and need a device class, not a declaration.
|
|
10
|
+
*
|
|
11
|
+
* The property names mirror the measurement types in @ovok/core. A typo would otherwise
|
|
12
|
+
* produce an object the backend silently drops, so it is rejected at registration instead.
|
|
13
|
+
*
|
|
14
|
+
* `required` marks the properties without which the reading is not that measurement. Every
|
|
15
|
+
* property in @ovok/core is optional, so a declaration that named only `systolic` would
|
|
16
|
+
* otherwise compile and then post a blood pressure with no diastolic - a plausible clinical
|
|
17
|
+
* record of something that was never measured. A "result" case must declare all of them.
|
|
18
|
+
*/
|
|
19
|
+
export interface CatalogField {
|
|
20
|
+
unit: string;
|
|
21
|
+
min: number;
|
|
22
|
+
max: number;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const measurementFieldCatalog: Readonly<Partial<Record<MeasurementTypeKey, Readonly<Record<string, CatalogField>>>>>;
|
|
26
|
+
//# sourceMappingURL=measurement-field-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measurement-field-catalog.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/measurement-field-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CA4B5E,CAAC"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
export * from "./types/i-bt-managed-device";
|
|
2
|
+
export * from "./types/accepted-device";
|
|
3
|
+
export * from "./types/compiled-custom-field";
|
|
4
|
+
export * from "./types/custom-byte-order";
|
|
5
|
+
export * from "./types/custom-case-kind";
|
|
6
|
+
export * from "./types/custom-case-spec";
|
|
7
|
+
export * from "./types/custom-device-definition";
|
|
8
|
+
export * from "./types/custom-device-id";
|
|
9
|
+
export * from "./types/custom-device-spec";
|
|
10
|
+
export * from "./types/custom-field-encoding";
|
|
11
|
+
export * from "./types/custom-field-spec";
|
|
12
|
+
export * from "./types/custom-frame-spec";
|
|
13
|
+
export * from "./types/custom-measurement";
|
|
14
|
+
export * from "./types/custom-monitor-spec";
|
|
15
|
+
export * from "./types/custom-service-spec";
|
|
16
|
+
export * from "./types/device-key";
|
|
17
|
+
export * from "./types/device-key-of";
|
|
2
18
|
export * from "./types/device-data";
|
|
3
19
|
export * from "./types/device-status";
|
|
4
20
|
export * from "./types/integrated-devices";
|
|
@@ -11,7 +27,10 @@ export * from "./types/result-callback";
|
|
|
11
27
|
export * from "./types/error-callback";
|
|
12
28
|
export * from "./types/device-status-change-callback";
|
|
13
29
|
export * from "./services/devices/bt-managed-device";
|
|
30
|
+
export * from "./services/devices/custom/custom.device";
|
|
14
31
|
export * from "./services/bt-manager";
|
|
32
|
+
export * from "./services/custom/define-custom-device";
|
|
33
|
+
export * from "./constants/measurement-field-catalog";
|
|
15
34
|
export * from "./components/bt-provider";
|
|
16
35
|
export * from "./components/default-permission-fallback";
|
|
17
36
|
export * from "./hooks/use-request-permissions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-management/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AAEtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-management/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AAEtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AAEvD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BleManager } from "react-native-ble-plx";
|
|
2
|
+
import { AcceptedDevice } from "../types/accepted-device";
|
|
3
|
+
import { DeviceKeyOf } from "../types/device-key-of";
|
|
2
4
|
import { DeviceStatusChangeCallback } from "../types/device-status-change-callback";
|
|
3
5
|
import { ErrorCallback } from "../types/error-callback";
|
|
4
|
-
import { IntegratedDevices } from "../types/integrated-devices";
|
|
5
6
|
import { ResultCallback } from "../types/result-callback";
|
|
6
7
|
import { BTManagedDevice } from "./devices/bt-managed-device";
|
|
7
|
-
export declare class BTManager<T extends readonly
|
|
8
|
+
export declare class BTManager<T extends readonly AcceptedDevice[]> {
|
|
8
9
|
private readonly bleManager;
|
|
9
10
|
private readonly acceptedDevices;
|
|
10
11
|
private static readonly MAX_DEVICES;
|
|
@@ -17,10 +18,10 @@ export declare class BTManager<T extends readonly IntegratedDevices[]> {
|
|
|
17
18
|
destroy: () => void;
|
|
18
19
|
startScan: () => void;
|
|
19
20
|
stopScan: () => void;
|
|
20
|
-
onDeviceFound: (callback?: (device: BTManagedDevice<T
|
|
21
|
+
onDeviceFound: (callback?: (device: BTManagedDevice<DeviceKeyOf<T>>, manager: BTManager<T>) => Promise<void>) => void;
|
|
21
22
|
onError: (callback?: (data: ErrorCallback) => void) => void;
|
|
22
23
|
onDeviceStatusChanged: (callback?: (data: DeviceStatusChangeCallback) => void) => void;
|
|
23
|
-
onResult: (callback?: (data: ResultCallback<T
|
|
24
|
+
onResult: (callback?: (data: ResultCallback<DeviceKeyOf<T>>) => void) => void;
|
|
24
25
|
private onResultCallback?;
|
|
25
26
|
private onErrorCallback?;
|
|
26
27
|
private onDeviceFoundCallback?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-manager.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/bt-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAKX,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bt-manager.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/bt-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAKX,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBAAa,SAAS,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAWtD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAXlC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAM;IACzC,OAAO,CAAC,OAAO,CAAsD;IAErE,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,kBAAkB,CAAsB;IAEhD,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,iBAAiB,CAAa;gBAGnB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,CAAC;IAK9B,OAAO,aAyBZ;IAEK,SAAS,aA0Dd;IAEK,QAAQ,aAmBb;IAEK,aAAa,GAClB,WAAW,CACT,MAAM,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACvC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,KAClB,OAAO,CAAC,IAAI,CAAC,UAIlB;IAEK,OAAO,GAAI,WAAW,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,UAGxD;IAEK,qBAAqB,GAC1B,WAAW,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,UAIrD;IAEK,QAAQ,GACb,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,UAIzD;IAGF,OAAO,CAAC,gBAAgB,CAAC,CAAiD;IAC1E,OAAO,CAAC,eAAe,CAAC,CAAgC;IACxD,OAAO,CAAC,qBAAqB,CAAC,CAGX;IACnB,OAAO,CAAC,6BAA6B,CAAC,CAE5B;IAEV,OAAO,CAAC,YAAY,CAsElB;IAEF,OAAO,CAAC,8BAA8B,CAUpC;CACH"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CompiledCustomField } from "../../types/compiled-custom-field";
|
|
2
|
+
import { CustomCaseSpec } from "../../types/custom-case-spec";
|
|
3
|
+
import { ParsingCase } from "../../types/parsing-case";
|
|
4
|
+
/** Validates one declared frame shape and turns it into a parsing case. */
|
|
5
|
+
export declare const compileCustomCase: (id: string, path: string, caseSpec: CustomCaseSpec, minLengthBytes: number, fields: Map<string, CompiledCustomField>) => ParsingCase;
|
|
6
|
+
//# sourceMappingURL=compile-custom-case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-custom-case.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-case.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgJvD,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,GAC5B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,gBAAgB,MAAM,EACtB,QAAQ,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,KACvC,WA4DF,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
2
|
+
import { CompiledCustomField } from "../../types/compiled-custom-field";
|
|
3
|
+
import { CustomFieldSpec } from "../../types/custom-field-spec";
|
|
4
|
+
/** Validates one declared field against the measurement catalog and resolves its defaults. */
|
|
5
|
+
export declare const compileCustomField: (id: string, path: string, field: CustomFieldSpec, measurementTypeKey: MeasurementTypeKey, minLengthBytes: number) => CompiledCustomField;
|
|
6
|
+
//# sourceMappingURL=compile-custom-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-custom-field.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAsGhE,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,eAAe,EACtB,oBAAoB,kBAAkB,EACtC,gBAAgB,MAAM,KACrB,mBAyDF,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-frame.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CustomFrameSpec } from "../../types/custom-frame-spec";
|
|
2
|
+
/**
|
|
3
|
+
* Checks that a frame declaration can actually recognise a complete package, and returns a
|
|
4
|
+
* frozen, lower-cased copy of it.
|
|
5
|
+
*
|
|
6
|
+
* The copy matters twice. The received buffer is always lower-case hex, so a header declared
|
|
7
|
+
* as ["AA","55"] would never match and the device would silently produce nothing until the
|
|
8
|
+
* stuck-data timeout. And the runtime must not read an object the caller still holds a
|
|
9
|
+
* reference to: mutating the declaration after registration would otherwise move byte offsets
|
|
10
|
+
* that were bounds-checked at registration.
|
|
11
|
+
*/
|
|
12
|
+
export declare const compileCustomFrame: (id: string, path: string, frame: CustomFrameSpec) => CustomFrameSpec;
|
|
13
|
+
//# sourceMappingURL=compile-custom-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-custom-frame.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAMhE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,eAAe,KACrB,eA6EF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CompiledCustomField } from "../../types/compiled-custom-field";
|
|
2
|
+
import { CustomFrameSpec } from "../../types/custom-frame-spec";
|
|
3
|
+
import { CustomMonitorSpec } from "../../types/custom-monitor-spec";
|
|
4
|
+
import { IMonitorCharacteristic } from "../../types/monitor-characteristic";
|
|
5
|
+
/** Validates one notify characteristic and turns it into a parsing model and a frame. */
|
|
6
|
+
export declare const compileCustomMonitor: (id: string, path: string, monitor: CustomMonitorSpec, fields: Map<string, CompiledCustomField>) => {
|
|
7
|
+
characteristic: IMonitorCharacteristic;
|
|
8
|
+
frame: CustomFrameSpec;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=compile-custom-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-custom-monitor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AA2F5E,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,GAC/B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,SAAS,iBAAiB,EAC1B,QAAQ,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,KACvC;IAAE,cAAc,EAAE,sBAAsB,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CA+ClE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/custom-device-error.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every registration failure names the exact position in the declaration, because the
|
|
3
|
+
* author is looking at a datasheet and needs to know which line of it is wrong.
|
|
4
|
+
*/
|
|
5
|
+
export declare const customDeviceError: (id: string, path: string, message: string) => Error;
|
|
6
|
+
//# sourceMappingURL=custom-device-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-device-error.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/custom-device-error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,SAAS,MAAM,KACd,KAA+D,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomDeviceDefinition } from "../../types/custom-device-definition";
|
|
2
|
+
import { CustomDeviceSpec } from "../../types/custom-device-spec";
|
|
3
|
+
/**
|
|
4
|
+
* Validates a declaration and compiles it into a runnable device.
|
|
5
|
+
*
|
|
6
|
+
* Every rule the declarative decoder relies on is checked here, at registration, because the
|
|
7
|
+
* alternative is a plausible wrong number at read time. Registration fails loudly - it
|
|
8
|
+
* throws, naming the exact position in the declaration - and a device that fails to compile
|
|
9
|
+
* is never scanned for.
|
|
10
|
+
*/
|
|
11
|
+
export declare const defineCustomDevice: (spec: CustomDeviceSpec) => CustomDeviceDefinition;
|
|
12
|
+
//# sourceMappingURL=define-custom-device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-custom-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/define-custom-device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAwGlE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,gBAAgB,KACrB,sBAqEF,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/normalize-ble-uuid.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accepts a 16-bit, 32-bit or 128-bit UUID and returns the 128-bit form, because that is
|
|
3
|
+
* what react-native-ble-plx reports back on a notification and what the parsing model is
|
|
4
|
+
* matched against.
|
|
5
|
+
*/
|
|
6
|
+
export declare const normalizeBleUuid: (id: string, path: string, value: unknown) => string;
|
|
7
|
+
//# sourceMappingURL=normalize-ble-uuid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-ble-uuid.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/normalize-ble-uuid.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,OAAO,KACb,MAoBF,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { AcceptedDevice } from "../types/accepted-device";
|
|
1
2
|
import { CreateDeviceParams } from "../types/create-device-params";
|
|
2
|
-
import {
|
|
3
|
+
import { DeviceKey } from "../types/device-key";
|
|
4
|
+
import { DeviceKeyOf } from "../types/device-key-of";
|
|
3
5
|
import { BTManagedDevice } from "./devices/bt-managed-device";
|
|
4
|
-
export declare class DeviceCreator<T extends readonly
|
|
6
|
+
export declare class DeviceCreator<T extends readonly AcceptedDevice[]> {
|
|
5
7
|
private readonly acceptedDeviceNames;
|
|
6
8
|
private deviceNameCache;
|
|
7
9
|
private readonly CACHE_MAX_SIZE;
|
|
10
|
+
private readonly customDevices;
|
|
8
11
|
constructor(acceptedDeviceNames: T);
|
|
9
|
-
getDeviceName: (foundName: string) =>
|
|
10
|
-
createDevice<
|
|
12
|
+
getDeviceName: (foundName: string) => DeviceKeyOf<T> | undefined;
|
|
13
|
+
createDevice<K extends DeviceKey>(params: CreateDeviceParams<K>): BTManagedDevice<K>;
|
|
11
14
|
destroy: () => void;
|
|
12
|
-
|
|
15
|
+
/**
|
|
16
|
+
* A built-in device always wins over a declaration: its decoder is compiled and tested,
|
|
17
|
+
* and a declaration that happens to match the same advertised name must not displace it.
|
|
18
|
+
*/
|
|
19
|
+
private matchDeviceName;
|
|
13
20
|
private cacheDeviceName;
|
|
14
21
|
}
|
|
15
22
|
//# sourceMappingURL=device-creator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAyC9D,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAKhD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJhD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;gBAEvC,mBAAmB,EAAE,CAAC;IAI5C,aAAa,GAAI,WAAW,MAAM,KAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAkBpE;IAEK,YAAY,CAAC,CAAC,SAAS,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;IAwCd,OAAO,aAEZ;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAmBrB;IAEF,OAAO,CAAC,eAAe;CAexB"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts
CHANGED
|
@@ -18,10 +18,21 @@ export declare class BTDataProcessor<T extends Measurement> {
|
|
|
18
18
|
private readonly mainServices;
|
|
19
19
|
private readonly stuckDataTimeoutDuration;
|
|
20
20
|
private readonly callbacks;
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* One buffer per characteristic.
|
|
23
|
+
*
|
|
24
|
+
* A frame that is still incomplete stays buffered until the rest of it arrives, so a
|
|
25
|
+
* shared buffer would prepend one characteristic's leftover bytes to the next
|
|
26
|
+
* characteristic's notification. Every declared byte offset is absolute, so that frame
|
|
27
|
+
* would then be decoded at a shifted offset - a plausible wrong reading rather than an
|
|
28
|
+
* error. Keeping the buffers apart makes that impossible.
|
|
29
|
+
*/
|
|
30
|
+
private buffers;
|
|
22
31
|
private isMeasuring;
|
|
23
32
|
private stuckDataTimeout;
|
|
24
33
|
constructor(device: Device, mainServices: IMedicalDevice["mainService"], stuckDataTimeoutDuration: number, callbacks: DataProcessorCallbacks<T>);
|
|
34
|
+
private get collectedValues();
|
|
35
|
+
private currentUuid;
|
|
25
36
|
destroy: () => void;
|
|
26
37
|
processData: (uuid: string, hexValue: string[]) => void;
|
|
27
38
|
private extractData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-data-processor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/bt-data-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAKjF,UAAU,sBAAsB,CAAC,CAAC,SAAS,WAAW;IACpD,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1D,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,YAAY,EACpB,kBAAkB,CAAC,EAAE,kBAAkB,KACpC,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,uBAAuB,CAAC,WAAW,CAAC,EAChD,eAAe,EAAE,MAAM,EAAE,KACtB,OAAO,GAAG,IAAI,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,qBAAqB,CAAC,EAAE,CACtB,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAClC,4BAA4B,CAAC,CAAC,CAAC,CAAC;CACtC;AAED,qBAAa,eAAe,CAAC,CAAC,SAAS,WAAW;
|
|
1
|
+
{"version":3,"file":"bt-data-processor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/bt-data-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAKjF,UAAU,sBAAsB,CAAC,CAAC,SAAS,WAAW;IACpD,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1D,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,YAAY,EACpB,kBAAkB,CAAC,EAAE,kBAAkB,KACpC,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,MAAM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ANGED
|
@@ -3,13 +3,14 @@ import { BleError, Device } from "react-native-ble-plx";
|
|
|
3
3
|
import { CreateDeviceParams } from "../../types/create-device-params";
|
|
4
4
|
import { DependentResultHandlerParams } from "../../types/dependent-result-handler-params";
|
|
5
5
|
import { DeviceData } from "../../types/device-data";
|
|
6
|
+
import { DeviceKey } from "../../types/device-key";
|
|
6
7
|
import { MeasurementTypeForDevices } from "../../types/device-measurement-map";
|
|
7
8
|
import { DeviceStatus } from "../../types/device-status";
|
|
8
9
|
import { IBTManagedDevice } from "../../types/i-bt-managed-device";
|
|
9
10
|
import { IMedicalDevice } from "../../types/i-medical-device";
|
|
10
11
|
import { IntegratedDevices } from "../../types/integrated-devices";
|
|
11
12
|
import { MeasurementWithCaseType } from "../../types/measurement-with-case-type";
|
|
12
|
-
export declare abstract class BTManagedDevice<T extends
|
|
13
|
+
export declare abstract class BTManagedDevice<T extends DeviceKey = IntegratedDevices.BP2> implements IBTManagedDevice {
|
|
13
14
|
readonly device: Device;
|
|
14
15
|
id: string;
|
|
15
16
|
private connectionHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-managed-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/bt-managed-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAKjF,8BAAsB,eAAe,
|
|
1
|
+
{"version":3,"file":"bt-managed-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/bt-managed-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAKjF,8BAAsB,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAC/E,YAAW,gBAAgB;aA8CT,MAAM,EAAE,MAAM;IA5CzB,EAAE,EAAE,MAAM,CAAC;IAElB,OAAO,CAAC,iBAAiB,CAAkC;IAC3D,OAAO,CAAC,aAAa,CAEP;IACP,UAAU,EAAE,UAAU,CAAC;IAE9B;;OAEG;IACH,SAAS,CAAC,QAAQ,C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IAEF,OAAO,CAAC,+BAA+B,CAarC;CACH"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Device } from "react-native-ble-plx";
|
|
2
|
+
import { CreateDeviceParams } from "../../../types/create-device-params";
|
|
3
|
+
import { CustomDeviceDefinition } from "../../../types/custom-device-definition";
|
|
4
|
+
import { CustomDeviceId } from "../../../types/custom-device-id";
|
|
5
|
+
import { DependentResultHandlerParams } from "../../../types/dependent-result-handler-params";
|
|
6
|
+
import { MeasurementTypeForDevices } from "../../../types/device-measurement-map";
|
|
7
|
+
import { IService } from "../../../types/service.type";
|
|
8
|
+
import { BTManagedDevice } from "../bt-managed-device";
|
|
9
|
+
type CustomMeasurementOf = MeasurementTypeForDevices<[CustomDeviceId]>;
|
|
10
|
+
/**
|
|
11
|
+
* Runs a device registered with defineCustomDevice.
|
|
12
|
+
*
|
|
13
|
+
* Everything specific to the device is data: the services and characteristics it exposes,
|
|
14
|
+
* how a complete frame is recognised, which frame carries which reading, and how each byte
|
|
15
|
+
* range becomes a number. What is left here is the safety net - a reading is reported only
|
|
16
|
+
* when every property the declaration named decoded to a finite number inside the range the
|
|
17
|
+
* catalog accepts. Anything else is reported through onError and no measurement is emitted.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CustomDevice extends BTManagedDevice<CustomDeviceId> {
|
|
20
|
+
protected mainServices: IService[];
|
|
21
|
+
protected stuckDataTimeout: number;
|
|
22
|
+
protected onStreamStart?: (() => void) | undefined;
|
|
23
|
+
private readonly definition;
|
|
24
|
+
private readonly validators;
|
|
25
|
+
constructor(device: Device, params: CreateDeviceParams<CustomDeviceId>, definition: CustomDeviceDefinition);
|
|
26
|
+
protected validatePackage: (pkg: string[], uuid: string) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Every declared "result" frame arrives here, whether or not the device streamed first.
|
|
29
|
+
* The reading is checked and reported, and the frame is then handed back as OTHER so the
|
|
30
|
+
* processor returns the device to CONNECTED without reporting it a second time.
|
|
31
|
+
*/
|
|
32
|
+
protected handleDependentResult: (data: DependentResultHandlerParams<CustomMeasurementOf>) => DependentResultHandlerParams<CustomMeasurementOf>;
|
|
33
|
+
/**
|
|
34
|
+
* Stream frames reach this while the device is measuring. They carry no fields, and the
|
|
35
|
+
* readings themselves are reported from handleDependentResult, so there is nothing to do.
|
|
36
|
+
*/
|
|
37
|
+
protected handleSuccessResult(): void | boolean;
|
|
38
|
+
private report;
|
|
39
|
+
private reject;
|
|
40
|
+
private fail;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=custom.device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,KAAK,mBAAmB,GAAG,yBAAyB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;AAKvE;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,cAAc,CAAC;IAC/D,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAEnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiD;gBAG1E,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,cAAc,CAAC,EAC1C,UAAU,EAAE,sBAAsB;IAapC,SAAS,CAAC,eAAe,GAAI,KAAK,MAAM,EAAE,EAAE,MAAM,MAAM,KAAG,OAAO,CAQhE;IAEF;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,GAC7B,MAAM,4BAA4B,CAAC,mBAAmB,CAAC,KACtD,4BAA4B,CAAC,mBAAmB,CAAC,CAWlD;IAEF;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI,GAAG,OAAO;IAI/C,OAAO,CAAC,MAAM;IAgCd,OAAO,CAAC,MAAM;IAsBd,OAAO,CAAC,IAAI;CAOb"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomDeviceDefinition } from "./custom-device-definition";
|
|
2
|
+
import { IntegratedDevices } from "./integrated-devices";
|
|
3
|
+
/** An entry of BTProvider's `acceptedDevices`: a built-in device, or a declared one. */
|
|
4
|
+
export type AcceptedDevice = IntegratedDevices | CustomDeviceDefinition;
|
|
5
|
+
//# sourceMappingURL=accepted-device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accepted-device.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/types/accepted-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,sBAAsB,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { BleManager } from "react-native-ble-plx";
|
|
2
2
|
import { BTManager } from "../services/bt-manager";
|
|
3
3
|
import { BTManagedDevice } from "../services/devices/bt-managed-device";
|
|
4
|
+
import { AcceptedDevice } from "./accepted-device";
|
|
5
|
+
import { DeviceKeyOf } from "./device-key-of";
|
|
4
6
|
import { DeviceStatusChangeCallback } from "./device-status-change-callback";
|
|
5
7
|
import { ErrorCallback } from "./error-callback";
|
|
6
|
-
import { IntegratedDevices } from "./integrated-devices";
|
|
7
8
|
import { ResultCallback } from "./result-callback";
|
|
8
|
-
export interface BTProviderChildWrapperProps<T extends readonly
|
|
9
|
+
export interface BTProviderChildWrapperProps<T extends readonly AcceptedDevice[]> {
|
|
9
10
|
bleManager: BleManager;
|
|
10
11
|
acceptedDevices: T;
|
|
11
|
-
onDeviceFound?: (device: BTManagedDevice<T
|
|
12
|
+
onDeviceFound?: (device: BTManagedDevice<DeviceKeyOf<T>>, manager: BTManager<T>) => Promise<void>;
|
|
12
13
|
onError?: (data: ErrorCallback) => void;
|
|
13
14
|
onDeviceStatusChanged?: (data: DeviceStatusChangeCallback) => void;
|
|
14
|
-
onResult?: (data: ResultCallback<T
|
|
15
|
+
onResult?: (data: ResultCallback<DeviceKeyOf<T>>) => void;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=btprovider-children-props.d.ts.map
|