@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CaseType","DeviceStatus","parseMeasurement","BTDataProcessor","
|
|
1
|
+
{"version":3,"names":["CaseType","DeviceStatus","parseMeasurement","BTDataProcessor","buffers","Map","isMeasuring","constructor","device","mainServices","stuckDataTimeoutDuration","callbacks","collectedValues","get","currentUuid","destroy","clear","clearTimeout","stuckDataTimeout","undefined","processData","uuid","hexValue","String","toLowerCase","buffer","push","set","startStuckTimeout","isValid","validatePackage","data","extractData","resetDataAndSendCommandToDevice","dependentData","parsingCase","caseType","DEPENDENT","handleDependentResult","handleStatusChanges","parsingModel","findParsingModel","value","caseValuePosition","map","index","join","findParsingCase","parsedData","parseData","measurementTypeKey","mainService","characteristic","monitorUuids","find","e","caseValue","cases","successResult","STREAM","onStreamStart","onStatusChanged","MEASURING","OTHER","CONNECTED","skipConnectedChange","onResult","RESULT","onSendCommandToDevice","setTimeout","onError","Error","cause","message","cancelConnection"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-data-processor.ts"],"mappings":";;AAGA,SAASA,QAAQ,QAAQ,0BAAuB;AAEhD,SAASC,YAAY,QAAQ,8BAA2B;AAKxD,SAASC,gBAAgB,QAAQ,kCAA+B;AAoBhE,OAAO,MAAMC,eAAe,CAAwB;EAClD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACUC,OAAO,GAAG,IAAIC,GAAG,CAAmB,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,WAAW,GAAG,KAAK;IAC1B;IAEA,IAAI2D,mBAAmB,GAAG,KAAK;IAE/B,IAAI,IAAI,CAAC3D,WAAW,EAAE;MACpB2D,mBAAmB,GACjB,IAAI,CAACtD,SAAS,CAACuD,QAAQ,GAAGlB,UAAU,EAAE,IAAI,CAACpC,eAAe,CAAC,IAAI,KAAK;IACxE;IAEA,IACEuB,WAAW,CAACC,QAAQ,KAAKpC,QAAQ,CAACmE,MAAM,IACxC,IAAI,CAAC7D,WAAW,IAChB,CAAC2D,mBAAmB,EACpB;MACA,IAAI,CAAC3D,WAAW,GAAG,KAAK;MACxB,IAAI,CAACK,SAAS,CAACkD,eAAe,GAC5B5D,YAAY,CAAC+D,SAAS,EACtBd,kBACF,CAAC;IACH;EACF;EAEQjB,+BAA+B,GAAGA,CAAA,KAAM;IAC9C,IAAI,CAAC7B,OAAO,CAACuB,GAAG,CAAC,IAAI,CAACb,WAAW,EAAE,EAAE,CAAC;IACtC,IAAI,CAACH,SAAS,CAACyD,qBAAqB,GAAG,CAAC;EAC1C,CAAC;EAEOxC,iBAAiB,GAAGA,CAAA,KAAM;IAChC,IAAI,IAAI,CAACV,gBAAgB,EAAE;MACzBD,YAAY,CAAC,IAAI,CAACC,gBAAgB,CAAC;IACrC;IAEA,IAAI,CAACA,gBAAgB,GAAGmD,UAAU,CAAC,MAAM;MACvC,IAAI,CAAC1D,SAAS,CAAC2D,OAAO,GACpB,IAAIC,KAAK,CAAC,2CAA2C,EAAE;QACrDC,KAAK,EAAE;UACLC,OAAO,EAAE;QACX;MACF,CAAC,CACH,CAAC;MACD,IAAI,CAACjE,MAAM,CAACkE,gBAAgB,GAAG,CAAC;IAClC,CAAC,EAAE,IAAI,CAAChE,wBAAwB,CAAC;EACnC,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentryLogger","DeviceStatus","BTConnectionHandler","BTDataProcessor","BTManagedDevice","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResult","onResultCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","deviceId","id","deviceData","name","localName","manufacturerData","sn","measurementTypes","status","measurementTypeKey","error","Error","message","caseType","_","data","diagramPoints","length","undefined","destroy","connectionHandler","dataProcessor","connect","getSupportedMeasurementTypeKeys","mainServices","onStatusChanged","bind","DISCONNECTED","onDataReceived","uuid","hexValue","processData","stuckDataTimeout","onStreamStart","validatePackage","parsedData","collectedValues","handleSuccessResult","onSendCommandToDevice","sendCommandToDevice","handleDependentResult","flatMap","service","monitorUuids","parsingModel","cases","map","c","filter","type","uniqueMeasurementTypes","Set","flat"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;AAGA,SAASA,YAAY,QAAQ,yCAAsC;
|
|
1
|
+
{"version":3,"names":["sentryLogger","DeviceStatus","BTConnectionHandler","BTDataProcessor","BTManagedDevice","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResult","onResultCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","deviceId","id","deviceData","name","localName","manufacturerData","sn","measurementTypes","status","measurementTypeKey","error","Error","message","caseType","_","data","diagramPoints","length","undefined","destroy","connectionHandler","dataProcessor","connect","getSupportedMeasurementTypeKeys","mainServices","onStatusChanged","bind","DISCONNECTED","onDataReceived","uuid","hexValue","processData","stuckDataTimeout","onStreamStart","validatePackage","parsedData","collectedValues","handleSuccessResult","onSendCommandToDevice","sendCommandToDevice","handleDependentResult","flatMap","service","monitorUuids","parsingModel","cases","map","c","filter","type","uniqueMeasurementTypes","Set","flat"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;AAGA,SAASA,YAAY,QAAQ,yCAAsC;AAMnE,SAASC,YAAY,QAAQ,8BAA2B;AAMxD,SAASC,mBAAmB,QAAQ,4BAAyB;AAC7D,SAASC,eAAe,QAAQ,wBAAqB;AAEr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ACd,IAAI,CAAClB,OAAO,EAAEkC,IAAI,CAAC,IAAI,CAAC,CAAChB,KAAyB,CAAC;QACrD;MACF,CAAC;MACD4B,qBAAqB,EACnB,IAAI,CAAClB,iBAAiB,EAAEmB,mBAAmB,EAAEb,IAAI,CAAC,IAAI,CAAC;MACzDlC,OAAO,EAAE,IAAI,CAACA,OAAO,EAAEkC,IAAI,CAAC,IAAI,CAAC;MACjCc,qBAAqB,EAAE,IAAI,CAACA,qBAAqB,EAAEd,IAAI,CAAC,IAAI;IAC9D,CACF,CAAC;IAED,MAAM,IAAI,CAACN,iBAAiB,CAACE,OAAO,CAAC,CAAC;EACxC,CAAC;EAEOC,+BAA+B,GAAGA,CAAA,KAA4B;IACpE,MAAMhB,gBAAgB,GAAG,IAAI,CAACiB,YAAY,CACvCiB,OAAO,CAAEC,OAAO,IAAK;MACpB,OAAOA,OAAO,CAACC,YAAY,CAACF,OAAO,CAChCZ,IAAI,IACHA,IAAI,CAACe,YAAY,CAACC,KAAK,CAACC,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACtC,kBAAkB,CAAC,IAAI,EAChE,CAAC;IACH,CAAC,CAAC,CACDuC,MAAM,CAAEC,IAAI,IAAKA,IAAI,KAAK/B,SAAS,CAAC;IAEvC,MAAMgC,sBAAsB,GAAG,CAAC,GAAG,IAAIC,GAAG,CAAC5C,gBAAgB,CAAC6C,IAAI,CAAC,CAAC,CAAC,CAAC;IAEpE,OAAOF,sBAAsB;EAC/B,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { CaseType } from "../../../types/case-type.js";
|
|
4
|
+
import { createFrameValidator } from "../../../utils/create-frame-validator.js";
|
|
5
|
+
import { BTManagedDevice } from "../bt-managed-device.js";
|
|
6
|
+
const RESERVED_KEYS = ["measurementTypeKey", "caseType"];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Runs a device registered with defineCustomDevice.
|
|
10
|
+
*
|
|
11
|
+
* Everything specific to the device is data: the services and characteristics it exposes,
|
|
12
|
+
* how a complete frame is recognised, which frame carries which reading, and how each byte
|
|
13
|
+
* range becomes a number. What is left here is the safety net - a reading is reported only
|
|
14
|
+
* when every property the declaration named decoded to a finite number inside the range the
|
|
15
|
+
* catalog accepts. Anything else is reported through onError and no measurement is emitted.
|
|
16
|
+
*/
|
|
17
|
+
export class CustomDevice extends BTManagedDevice {
|
|
18
|
+
validators = new Map();
|
|
19
|
+
constructor(device, params, definition) {
|
|
20
|
+
super(device, params);
|
|
21
|
+
this.definition = definition;
|
|
22
|
+
this.mainServices = definition.mainServices;
|
|
23
|
+
this.stuckDataTimeout = definition.stuckDataTimeout;
|
|
24
|
+
definition.frames.forEach((frame, uuid) => {
|
|
25
|
+
this.validators.set(uuid, createFrameValidator(frame));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
validatePackage = (pkg, uuid) => {
|
|
29
|
+
const validate = this.validators.get(String(uuid ?? "").toLowerCase());
|
|
30
|
+
if (!validate) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return validate(pkg);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Every declared "result" frame arrives here, whether or not the device streamed first.
|
|
38
|
+
* The reading is checked and reported, and the frame is then handed back as OTHER so the
|
|
39
|
+
* processor returns the device to CONNECTED without reporting it a second time.
|
|
40
|
+
*/
|
|
41
|
+
handleDependentResult = data => {
|
|
42
|
+
try {
|
|
43
|
+
this.report(data.parsedData);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
this.onError?.(error);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...data,
|
|
49
|
+
parsingCase: {
|
|
50
|
+
...data.parsingCase,
|
|
51
|
+
caseType: CaseType.OTHER
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Stream frames reach this while the device is measuring. They carry no fields, and the
|
|
58
|
+
* readings themselves are reported from handleDependentResult, so there is nothing to do.
|
|
59
|
+
*/
|
|
60
|
+
handleSuccessResult() {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
report(parsedData) {
|
|
64
|
+
const measurementTypeKey = parsedData.measurementTypeKey;
|
|
65
|
+
if (!measurementTypeKey) {
|
|
66
|
+
this.fail("a result frame carries no measurement type", parsedData);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const names = Object.keys(parsedData).filter(key => !RESERVED_KEYS.includes(key));
|
|
70
|
+
if (names.length === 0) {
|
|
71
|
+
this.fail("a result frame decoded no properties", parsedData);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const rejection = names.map(name => this.reject(measurementTypeKey, name, parsedData[name])).find(message => message !== undefined);
|
|
75
|
+
if (rejection) {
|
|
76
|
+
this.fail(rejection, parsedData);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.onResult?.(parsedData);
|
|
80
|
+
}
|
|
81
|
+
reject(measurementTypeKey, name, value) {
|
|
82
|
+
const field = this.definition.fields.get(`${measurementTypeKey}:${name}`);
|
|
83
|
+
if (!field) {
|
|
84
|
+
return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
|
|
85
|
+
}
|
|
86
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
87
|
+
return `could not decode ${name}; the frame was shorter than the declaration expects`;
|
|
88
|
+
}
|
|
89
|
+
if (value < field.min || value > field.max) {
|
|
90
|
+
return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
fail(reason, parsedData) {
|
|
95
|
+
this.onError?.(new Error(`Custom device "${this.definition.id}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=custom.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CaseType","createFrameValidator","BTManagedDevice","RESERVED_KEYS","CustomDevice","validators","Map","constructor","device","params","definition","mainServices","stuckDataTimeout","frames","forEach","frame","uuid","set","validatePackage","pkg","validate","get","String","toLowerCase","handleDependentResult","data","report","parsedData","error","onError","parsingCase","caseType","OTHER","handleSuccessResult","measurementTypeKey","fail","names","Object","keys","filter","key","includes","length","rejection","map","name","reject","find","message","undefined","onResult","value","field","fields","Number","isFinite","min","max","unit","reason","Error","id","JSON","stringify"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom.device.ts"],"mappings":";;AAEA,SAASA,QAAQ,QAAQ,6BAA0B;AAQnD,SAASC,oBAAoB,QAAQ,0CAAuC;AAC5E,SAASC,eAAe,QAAQ,yBAAsB;AAKtD,MAAMC,aAAa,GAAG,CAAC,oBAAoB,EAAE,UAAU,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASF,eAAe,CAAiB;EAM/CG,UAAU,GAAG,IAAIC,GAAG,CAAqC,CAAC;EAE3EC,WAAWA,CACTC,MAAc,EACdC,MAA0C,EAC1CC,UAAkC,EAClC;IACA,KAAK,CAACF,MAAM,EAAEC,MAAM,CAAC;IAErB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,YAAY,GAAGD,UAAU,CAACC,YAAY;IAC3C,IAAI,CAACC,gBAAgB,GAAGF,UAAU,CAACE,gBAAgB;IAEnDF,UAAU,CAACG,MAAM,CAACC,OAAO,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAK;MACzC,IAAI,CAACX,UAAU,CAACY,GAAG,CAACD,IAAI,EAAEf,oBAAoB,CAACc,KAAK,CAAC,CAAC;IACxD,CAAC,CAAC;EACJ;EAEUG,eAAe,GAAGA,CAACC,GAAa,EAAEH,IAAY,KAAc;IACpE,MAAMI,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epted-device.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/compiled-custom-field.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-byte-order.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-case-kind.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-case-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,qCAAkC;;AAQtE;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-id.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-field-encoding.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-field-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-frame-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-measurement.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-monitor-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-service-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-key-of.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-key.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { IntegratedDevices } from "./integrated-devices.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A built-in device has a measurement type the SDK knows statically. A device registered
|
|
7
|
+
* through defineCustomDevice reports the catalog-checked properties its declaration named.
|
|
8
|
+
*/
|
|
4
9
|
//# sourceMappingURL=device-measurement-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;AAwBxD;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { decodeMedicalFloat } from "./decode-medical-float.js";
|
|
4
|
+
const HEX_ONLY = /^[0-9a-f]+$/;
|
|
5
|
+
const toRaw = (hex, field) => {
|
|
6
|
+
const raw = parseInt(hex, 16);
|
|
7
|
+
const bits = hex.length * 4;
|
|
8
|
+
if (field.encoding === "int") {
|
|
9
|
+
const sign = 2 ** (bits - 1);
|
|
10
|
+
return raw >= sign ? raw - sign * 2 : raw;
|
|
11
|
+
}
|
|
12
|
+
if (field.encoding === "sfloat") {
|
|
13
|
+
return decodeMedicalFloat(raw, 4, 12);
|
|
14
|
+
}
|
|
15
|
+
if (field.encoding === "float") {
|
|
16
|
+
return decodeMedicalFloat(raw, 8, 24);
|
|
17
|
+
}
|
|
18
|
+
return raw;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Builds the parser a compiled field contributes to the parsing model.
|
|
23
|
+
*
|
|
24
|
+
* It receives the hex bytes parse-measurement assembled for the field. Anything that is not
|
|
25
|
+
* exactly the declared width of clean hex returns undefined - notably the string
|
|
26
|
+
* parse-measurement produces when a byte index falls off the end of a short frame, which
|
|
27
|
+
* would otherwise be parsed as a plausible truncated number. The device turns an undefined
|
|
28
|
+
* field into an error and reports no reading.
|
|
29
|
+
*/
|
|
30
|
+
export const createCustomFieldParser = field => assembledHex => {
|
|
31
|
+
const hex = (assembledHex ?? "").toLowerCase();
|
|
32
|
+
if (hex.length !== field.byteIndexes.length * 2 || !HEX_ONLY.test(hex)) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const raw = toRaw(hex, field);
|
|
36
|
+
if (raw === undefined || !Number.isFinite(raw)) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const value = raw * field.scale + field.offset;
|
|
40
|
+
if (!Number.isFinite(value)) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
if (field.decimals === undefined) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
const factor = 10 ** field.decimals;
|
|
47
|
+
return Math.round(value * factor) / factor;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=create-custom-field-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decodeMedicalFloat","HEX_ONLY","toRaw","hex","field","raw","parseInt","bits","length","encoding","sign","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","undefined","Number","isFinite","value","scale","offset","decimals","factor","Math","round"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,2BAAwB;AAE3D,MAAMC,QAAQ,GAAG,aAAa;AAE9B,MAAMC,KAAK,GAAGA,CACZC,GAAW,EACXC,KAA0B,KACH;EACvB,MAAMC,GAAG,GAAGC,QAAQ,CAACH,GAAG,EAAE,EAAE,CAAC;EAC7B,MAAMI,IAAI,GAAGJ,GAAG,CAACK,MAAM,GAAG,CAAC;EAE3B,IAAIJ,KAAK,CAACK,QAAQ,KAAK,KAAK,EAAE;IAC5B,MAAMC,IAAI,GAAG,CAAC,KAAKH,IAAI,GAAG,CAAC,CAAC;IAE5B,OAAOF,GAAG,IAAIK,IAAI,GAAGL,GAAG,GAAGK,IAAI,GAAG,CAAC,GAAGL,GAAG;EAC3C;EAEA,IAAID,KAAK,CAACK,QAAQ,KAAK,QAAQ,EAAE;IAC/B,OAAOT,kBAAkB,CAACK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,IAAID,KAAK,CAACK,QAAQ,KAAK,OAAO,EAAE;IAC9B,OAAOT,kBAAkB,CAACK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,OAAOA,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,uBAAuB,GACjCP,KAA0B,IAC1BQ,YAAoB,IAAyB;EAC5C,MAAMT,GAAG,GAAG,CAACS,YAAY,IAAI,EAAE,EAAEC,WAAW,CAAC,CAAC;EAE9C,IACEV,GAAG,CAACK,MAAM,KAAKJ,KAAK,CAACU,WAAW,CAACN,MAAM,GAAG,CAAC,IAC3C,CAACP,QAAQ,CAACc,IAAI,CAACZ,GAAG,CAAC,EACnB;IACA,OAAOa,SAAS;EAClB;EAEA,MAAMX,GAAG,GAAGH,KAAK,CAACC,GAAG,EAAEC,KAAK,CAAC;EAE7B,IAAIC,GAAG,KAAKW,SAAS,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACb,GAAG,CAAC,EAAE;IAC9C,OAAOW,SAAS;EAClB;EAEA,MAAMG,KAAK,GAAGd,GAAG,GAAGD,KAAK,CAACgB,KAAK,GAAGhB,KAAK,CAACiB,MAAM;EAE9C,IAAI,CAACJ,MAAM,CAACC,QAAQ,CAACC,KAAK,CAAC,EAAE;IAC3B,OAAOH,SAAS;EAClB;EAEA,IAAIZ,KAAK,CAACkB,QAAQ,KAAKN,SAAS,EAAE;IAChC,OAAOG,KAAK;EACd;EAEA,MAAMI,MAAM,GAAG,EAAE,IAAInB,KAAK,CAACkB,QAAQ;EAEnC,OAAOE,IAAI,CAACC,KAAK,CAACN,KAAK,GAAGI,MAAM,CAAC,GAAGA,MAAM;AAC5C,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const byteAt = (pkg, index) => parseInt(pkg[index] ?? "0", 16);
|
|
4
|
+
const announcedLength = (pkg, length) => {
|
|
5
|
+
const bytes = [];
|
|
6
|
+
for (let i = 0; i < length.widthBytes; i++) {
|
|
7
|
+
bytes.push(byteAt(pkg, length.index + i));
|
|
8
|
+
}
|
|
9
|
+
const ordered = length.byteOrder === "little" ? bytes.reverse() : bytes;
|
|
10
|
+
return ordered.reduce((total, byte) => total * 256 + byte, 0);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Builds the package validator for a declared device.
|
|
15
|
+
*
|
|
16
|
+
* The buffer must start with the declared header. The SDK never scans forward for it,
|
|
17
|
+
* because every declared byte index is absolute: a buffer that arrived misaligned is left
|
|
18
|
+
* to the stuck-data timeout instead of being decoded at a shifted offset.
|
|
19
|
+
*/
|
|
20
|
+
export const createFrameValidator = frame => pkg => {
|
|
21
|
+
if (pkg.length < frame.minLengthBytes) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const header = frame.header ?? [];
|
|
25
|
+
for (let i = 0; i < header.length; i++) {
|
|
26
|
+
if ((pkg[i] ?? "").toLowerCase() !== header[i]) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (!frame.length) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return pkg.length >= frame.length.overheadBytes + announcedLength(pkg, frame.length);
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=create-frame-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["byteAt","pkg","index","parseInt","announcedLength","length","bytes","i","widthBytes","push","ordered","byteOrder","reverse","reduce","total","byte","createFrameValidator","frame","minLengthBytes","header","toLowerCase","overheadBytes"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-frame-validator.ts"],"mappings":";;AAEA,MAAMA,MAAM,GAAGA,CAACC,GAAa,EAAEC,KAAa,KAC1CC,QAAQ,CAACF,GAAG,CAACC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAEjC,MAAME,eAAe,GAAGA,CACtBH,GAAa,EACbI,MAA8C,KACnC;EACX,MAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,UAAU,EAAED,CAAC,EAAE,EAAE;IAC1CD,KAAK,CAACG,IAAI,CAACT,MAAM,CAACC,GAAG,EAAEI,MAAM,CAACH,KAAK,GAAGK,CAAC,CAAC,CAAC;EAC3C;EAEA,MAAMG,OAAO,GAAGL,MAAM,CAACM,SAAS,KAAK,QAAQ,GAAGL,KAAK,CAACM,OAAO,CAAC,CAAC,GAAGN,KAAK;EAEvE,OAAOI,OAAO,CAACG,MAAM,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAKD,KAAK,GAAG,GAAG,GAAGC,IAAI,EAAE,CAAC,CAAC;AAC/D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAC9BC,KAAsB,IACtBhB,GAAa,IAAc;EAC1B,IAAIA,GAAG,CAACI,MAAM,GAAGY,KAAK,CAACC,cAAc,EAAE;IACrC,OAAO,KAAK;EACd;EAEA,MAAMC,MAAM,GAAGF,KAAK,CAACE,MAAM,IAAI,EAAE;EAEjC,KAAK,IAAIZ,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGY,MAAM,CAACd,MAAM,EAAEE,CAAC,EAAE,EAAE;IACtC,IAAI,CAACN,GAAG,CAACM,CAAC,CAAC,IAAI,EAAE,EAAEa,WAAW,CAAC,CAAC,KAAKD,MAAM,CAACZ,CAAC,CAAC,EAAE;MAC9C,OAAO,KAAK;IACd;EACF;EAEA,IAAI,CAACU,KAAK,CAACZ,MAAM,EAAE;IACjB,OAAO,IAAI;EACb;EAEA,OACEJ,GAAG,CAACI,MAAM,IACVY,KAAK,CAACZ,MAAM,CAACgB,aAAa,GAAGjB,eAAe,CAACH,GAAG,EAAEgB,KAAK,CAACZ,MAAM,CAAC;AAEnE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* IEEE-11073 personal-health float decoding, shared by SFLOAT (16 bit) and FLOAT (32 bit).
|
|
5
|
+
*
|
|
6
|
+
* Both encodings reserve five mantissa values for NaN, NRes, the two infinities and one
|
|
7
|
+
* reserved code. They are returned as undefined rather than as a number: a device that
|
|
8
|
+
* reports "no result" must not turn into a plausible reading.
|
|
9
|
+
*/
|
|
10
|
+
export const decodeMedicalFloat = (raw, exponentBits, mantissaBits) => {
|
|
11
|
+
const mantissaMask = 2 ** mantissaBits - 1;
|
|
12
|
+
const mantissaSign = 2 ** (mantissaBits - 1);
|
|
13
|
+
const exponentSign = 2 ** (exponentBits - 1);
|
|
14
|
+
const rawMantissa = raw & mantissaMask;
|
|
15
|
+
const reserved = [mantissaSign - 1,
|
|
16
|
+
// NaN
|
|
17
|
+
mantissaSign,
|
|
18
|
+
// NRes
|
|
19
|
+
mantissaSign - 2,
|
|
20
|
+
// +INFINITY
|
|
21
|
+
mantissaSign + 2,
|
|
22
|
+
// -INFINITY
|
|
23
|
+
mantissaSign + 1 // reserved for future use
|
|
24
|
+
];
|
|
25
|
+
if (reserved.includes(rawMantissa)) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const mantissa = rawMantissa >= mantissaSign ? rawMantissa - mantissaSign * 2 : rawMantissa;
|
|
29
|
+
const rawExponent = Math.floor(raw / 2 ** mantissaBits);
|
|
30
|
+
const exponent = rawExponent >= exponentSign ? rawExponent - exponentSign * 2 : rawExponent;
|
|
31
|
+
return mantissa * 10 ** exponent;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=decode-medical-float.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decodeMedicalFloat","raw","exponentBits","mantissaBits","mantissaMask","mantissaSign","exponentSign","rawMantissa","reserved","includes","undefined","mantissa","rawExponent","Math","floor","exponent"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/decode-medical-float.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,kBAAkB,GAAGA,CAChCC,GAAW,EACXC,YAAoB,EACpBC,YAAoB,KACG;EACvB,MAAMC,YAAY,GAAG,CAAC,IAAID,YAAY,GAAG,CAAC;EAC1C,MAAME,YAAY,GAAG,CAAC,KAAKF,YAAY,GAAG,CAAC,CAAC;EAC5C,MAAMG,YAAY,GAAG,CAAC,KAAKJ,YAAY,GAAG,CAAC,CAAC;EAE5C,MAAMK,WAAW,GAAGN,GAAG,GAAGG,YAAY;EAEtC,MAAMI,QAAQ,GAAG,CACfH,YAAY,GAAG,CAAC;EAAE;EAClBA,YAAY;EAAE;EACdA,YAAY,GAAG,CAAC;EAAE;EAClBA,YAAY,GAAG,CAAC;EAAE;EAClBA,YAAY,GAAG,CAAC,CAAE;EAAA,CACnB;EAED,IAAIG,QAAQ,CAACC,QAAQ,CAACF,WAAW,CAAC,EAAE;IAClC,OAAOG,SAAS;EAClB;EAEA,MAAMC,QAAQ,GACZJ,WAAW,IAAIF,YAAY,GAAGE,WAAW,GAAGF,YAAY,GAAG,CAAC,GAAGE,WAAW;EAE5E,MAAMK,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACb,GAAG,GAAG,CAAC,IAAIE,YAAY,CAAC;EAEvD,MAAMY,QAAQ,GACZH,WAAW,IAAIN,YAAY,GAAGM,WAAW,GAAGN,YAAY,GAAG,CAAC,GAAGM,WAAW;EAE5E,OAAOD,QAAQ,GAAG,EAAE,IAAII,QAAQ;AAClC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { CUSTOM_DEVICE_BRAND } from "../constants/custom-device-brand.js";
|
|
4
|
+
/**
|
|
5
|
+
* True only for the output of defineCustomDevice. A hand-assembled object that never went
|
|
6
|
+
* through registration validation is not accepted, so no declaration can reach the decoder
|
|
7
|
+
* without having been checked.
|
|
8
|
+
*/
|
|
9
|
+
export const isCustomDeviceDefinition = entry => typeof entry === "object" && entry !== null && entry[CUSTOM_DEVICE_BRAND] === true;
|
|
10
|
+
//# sourceMappingURL=is-custom-device-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CUSTOM_DEVICE_BRAND","isCustomDeviceDefinition","entry"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/is-custom-device-definition.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,qCAAkC;AAItE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GACnCC,KAAiC,IAEjC,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACbA,KAAK,CAA4BF,mBAAmB,CAAC,KAAK,IAAI","ignoreList":[]}
|
|
@@ -58,7 +58,17 @@ export const AndroidHealthSync = /*#__PURE__*/React.memo(({
|
|
|
58
58
|
}, [onError, onProgress]);
|
|
59
59
|
React.useEffect(() => {
|
|
60
60
|
return () => {
|
|
61
|
-
|
|
61
|
+
/*
|
|
62
|
+
* A teardown that throws takes the unmount with it, and React has no
|
|
63
|
+
* boundary for a cleanup function — so a sync that fails to stop
|
|
64
|
+
* became a crash on the way out of a screen. The error goes to the
|
|
65
|
+
* app's own handler, which is what `onError` is for.
|
|
66
|
+
*/
|
|
67
|
+
try {
|
|
68
|
+
serviceRef.current?.stopSync();
|
|
69
|
+
} catch (error) {
|
|
70
|
+
onErrorRef.current?.(error);
|
|
71
|
+
}
|
|
62
72
|
serviceRef.current = null;
|
|
63
73
|
};
|
|
64
74
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useClient","useMedplumProfile","useNetInfo","React","AndroidHealthSyncService","AndroidHealthSync","memo","dataToSync","chunkSize","onError","onProgress","client","patient","serviceRef","useRef","isConnected","type","onErrorRef","onProgressRef","progressRef","updateProgress","useCallback","progress","current","measurementTypeKey","syncData","getInstance","patientId","id","onSyncError","error","startSync","useEffect","pauseSync","stopSync"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/android/android-health-sync.tsx"],"mappings":";;AAAA,SAEEA,SAAS,EACTC,iBAAiB,QACZ,YAAY;AACnB,SAASC,UAAU,QAAQ,iCAAiC;AAC5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AAC,CAAC;IACtC,CAAC,CAAC,OAAOD,KAAK,EAAE;MACdb,UAAU,CAACM,OAAO,GAAGO,KAAc,CAAC;IACtC;EACF,CAAC,EAAE,CAACnB,MAAM,EAAEJ,UAAU,EAAEC,SAAS,EAAEI,OAAO,EAAEgB,EAAE,EAAER,cAAc,CAAC,CAAC;EAEhEjB,KAAK,CAAC6B,SAAS,CAAC,MAAM;IACpBP,QAAQ,CAAC,CAAC;EACZ,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEdtB,KAAK,CAAC6B,SAAS,CAAC,MAAM;IACpB,IAAI,CAACnB,UAAU,CAACU,OAAO,EAAE;MACvB;IACF;IAEA,IAAI,CAACR,WAAW,IAAIC,IAAI,KAAK,MAAM,EAAE;MACnCH,UAAU,CAACU,OAAO,CAACU,SAAS,CAAC,CAAC;MAE9B;IACF;IAEApB,UAAU,CAACU,OAAO,CAACQ,SAAS,CAAC,CAAC;EAChC,CAAC,EAAE,CAAChB,WAAW,EAAEC,IAAI,CAAC,CAAC;EAEvBb,KAAK,CAAC6B,SAAS,CAAC,MAAM;IACpBf,UAAU,CAACM,OAAO,GAAGd,OAAO;IAC5BS,aAAa,CAACK,OAAO,GAAGb,UAAU;EACpC,CAAC,EAAE,CAACD,OAAO,EAAEC,UAAU,CAAC,CAAC;EAEzBP,KAAK,CAAC6B,SAAS,CAAC,MAAM;IACpB,OAAO,MAAM;
|
|
1
|
+
{"version":3,"names":["useClient","useMedplumProfile","useNetInfo","React","AndroidHealthSyncService","AndroidHealthSync","memo","dataToSync","chunkSize","onError","onProgress","client","patient","serviceRef","useRef","isConnected","type","onErrorRef","onProgressRef","progressRef","updateProgress","useCallback","progress","current","measurementTypeKey","syncData","getInstance","patientId","id","onSyncError","error","startSync","useEffect","pauseSync","stopSync"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/android/android-health-sync.tsx"],"mappings":";;AAAA,SAEEA,SAAS,EACTC,iBAAiB,QACZ,YAAY;AACnB,SAASC,UA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HealthSync = /*#__PURE__*/React.memo(({
|
|
|
40
40
|
onErrorRef.current?.(error);
|
|
41
41
|
}
|
|
42
42
|
}, [client, dataToSync, chunkSize, patient?.id, updateProgress]);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The first sync, which nothing used to start.
|
|
46
|
+
*
|
|
47
|
+
* `useListenChanges` subscribes to HealthKit observer queries, and the
|
|
48
|
+
* native side scopes those to samples that start from NOW —
|
|
49
|
+
* `HKQuery.predicateForSamples(withStart: Date.init(), …)` in
|
|
50
|
+
* `@kingstinct/react-native-healthkit`. So the subscription can never fire
|
|
51
|
+
* for data that already exists, and the only other caller, the network
|
|
52
|
+
* effect below, returns early while `serviceRef.current` is null — which
|
|
53
|
+
* only this path assigns. A patient installed the app, granted HealthKit
|
|
54
|
+
* and saw nothing: their existing history was never read, and nothing new
|
|
55
|
+
* arrived unless they moved with the app open.
|
|
56
|
+
*
|
|
57
|
+
* `startSync` reads the per-code watermark off the server and pages
|
|
58
|
+
* forward from it, so it IS the initial sync; it just had no caller here.
|
|
59
|
+
* `AndroidHealthSync` has had this effect all along — this is the platform
|
|
60
|
+
* catching up with its sibling, not a new mechanism.
|
|
61
|
+
*/
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
syncData();
|
|
64
|
+
}, [syncData]);
|
|
43
65
|
useListenChanges(dataToSync, () => {
|
|
44
66
|
syncData();
|
|
45
67
|
});
|
|
@@ -59,7 +81,17 @@ export const AppleHealthSync = /*#__PURE__*/React.memo(({
|
|
|
59
81
|
}, [onError, onProgress]);
|
|
60
82
|
React.useEffect(() => {
|
|
61
83
|
return () => {
|
|
62
|
-
|
|
84
|
+
/*
|
|
85
|
+
* A teardown that throws takes the unmount with it, and React has no
|
|
86
|
+
* boundary for a cleanup function — so a sync that fails to stop
|
|
87
|
+
* became a crash on the way out of a screen. The error goes to the
|
|
88
|
+
* app's own handler, which is what `onError` is for.
|
|
89
|
+
*/
|
|
90
|
+
try {
|
|
91
|
+
serviceRef.current?.stopSync();
|
|
92
|
+
} catch (error) {
|
|
93
|
+
onErrorRef.current?.(error);
|
|
94
|
+
}
|
|
63
95
|
serviceRef.current = null;
|
|
64
96
|
};
|
|
65
97
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useClient","useMedplumProfile","useNetInfo","React","useListenChanges","AppleHealthSyncService","AppleHealthSync","memo","dataToSync","chunkSize","onError","onProgress","client","patient","serviceRef","useRef","isConnected","type","onErrorRef","onProgressRef","progressRef","updateProgress","useCallback","progress","current","measurementTypeKey","syncData","getInstance","patientId","id","onSyncError","error","startSync","useEffect","pauseSync","stopSync"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/apple/apple-health-sync.tsx"],"mappings":";;AAAA,SAEEA,SAAS,EACTC,iBAAiB,QACZ,YAAY;AACnB,SAASC,UAAU,QAAQ,iCAAiC;AAC5D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,gBAAgB,QAAQ,mCAAgC;AACjE,SAASC,sBAAsB,QAAQ,6CAA0C;AAIjF,OAAO,MAAMC,eAAe,gBAAGH,KAAK,CAACI,IAAI,CACvC,CAAC;EAAEC,UAAU;EAAEC,SAAS;EAAEC,OAAO;EAAEC;AAAiC,CAAC,KAAK;EACxE,MAAMC,MAAM,GAAGZ,SAAS,CAAC,CAAC;EAC1B,MAAMa,OAAO,GAAGZ,iBAAiB,CAAC,CAAC;EACnC,MAAMa,UAAU,GAAGX,KAAK,CAACY,MAAM,CAAgC,IAAI,CAAC;EACpE,MAAM;IAAEC,WAAW;IAAEC;EAAK,CAAC,GAAGf,UAAU,CAAC,CAAC;EAE1C,MAAMgB,UAAU,GAAGf,KAAK,CAACY,MAAM,CAACL,OAAO,CAAC;EACxC,MAAMS,aAAa,GAAGhB,KAAK,CAACY,MAAM,CAACJ,UAAU,CAAC;EAE9C,MAAMS,WAAW,GAAGjB,KAAK,CAACY,MAAM,CAE9B,CAAC,CAAC,CAAC;EAEL,MAAMM,cAAc,GAAGlB,KAAK,CAACmB,WAAW,CAAEC,QAAsB,IAAK;IACnEH,WAAW,CAACI,OAAO,CAACD,QAAQ,CAACE,kBAAkB,CAAC,GAAGF,QAAQ;IAE3DJ,aAAa,CAACK,OAAO,GAAGJ,WAAW,CAACI,OAAO,CAAC;EAC9C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,QAAQ,GAAGvB,KAAK,CAACmB,WAAW,CAAC,YAAY;IAC7C,IAAI;MACFR,UAAU,CAACU,OAAO,GAAGnB,sBAAsB,CAACsB,WAAW,CAAC;QACtDf,MAAM;QACNgB,SAAS,EAAEf,OAAO,EAAEgB,EAAE,IAAI,EAAE;QAC5BrB,UAAU;QACVC,SAAS;QACTqB,WAAW,EAAGC,KAAK,IAAKb,UAAU,CAACM,OAAO,GAAGO,KAAc,CAAC;QAC5DV;MACF,CAAC,CAAC;MAEF,MAAMP,UAAU,CAACU,OAAO,CAACQ,SAAS,CAAC,CAAC;IACtC,CAAC,CAAC,OAAOD,KAAK,EAAE;MACdb,UAAU,CAACM,OAAO,GAAGO,KAAc,CAAC;IACtC;EACF,CAAC,EAAE,CAACnB,MAAM,EAAEJ,UAAU,EAAEC,SAAS,EAAEI,OAAO,EAAEgB,EAAE,EAAER,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["useClient","useMedplumProfile","useNetInfo","React","useListenChanges","AppleHealthSyncService","AppleHealthSync","memo","dataToSync","chunkSize","onError","onProgress","client","patient","serviceRef","useRef","isConnected","type","onErrorRef","onProgressRef","progressRef","updateProgress","useCallback","progress","current","measurementTypeKey","syncData","getInstance","patientId","id","onSyncError","error","startSync","useEffect","pauseSync","stopSync"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/apple/apple-health-sync.tsx"],"mappings":";;AAAA,SAEEA,SAAS,EACTC,iBAAiB,QACZ,YAAY;AACnB,SAASC,UAAU,QAAQ,iCAAiC;AAC5D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,g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