@ovok/native 1.17.0-dev.2287 → 1.17.0-dev.2295
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/data-sync/components/android/android-health-connect-authorization-provider.js +14 -5
- package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +4 -7
- package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +22 -9
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-health-record-sync-id.js +21 -2
- package/lib/commonjs/modules/data-sync/utils/get-health-record-sync-id.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js +2 -1
- package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js +2 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-records-count.js +4 -0
- package/lib/commonjs/modules/data-sync/utils/get-total-records-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js +4 -0
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-connect-series.js +4 -7
- package/lib/commonjs/modules/data-sync/utils/health-connect-series.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/healthkit-series.js +5 -8
- package/lib/commonjs/modules/data-sync/utils/healthkit-series.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/hourly-series.js +42 -2
- package/lib/commonjs/modules/data-sync/utils/hourly-series.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/identify-imported-observations.js +9 -1
- package/lib/commonjs/modules/data-sync/utils/identify-imported-observations.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/{families/finicare/crc.js → codec/crc8-maxim.js} +1 -1
- package/lib/commonjs/modules/next/bluetooth/codec/crc8-maxim.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/built-in.js +3 -2
- package/lib/commonjs/modules/next/bluetooth/families/built-in.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.js +17 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/frame.js +89 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/frame.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/models.js +14 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/models.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.js +30 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/replies.js +104 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/replies.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/session.js +79 -0
- package/lib/commonjs/modules/next/bluetooth/families/famidoc-hearing-aid/session.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/finicare/frame.js +3 -3
- package/lib/commonjs/modules/next/bluetooth/families/finicare/frame.js.map +1 -1
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +15 -6
- package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/services/base-health-sync-service.js +4 -7
- package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/data-processor.js +23 -10
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-health-record-sync-id.js +19 -1
- package/lib/module/modules/data-sync/utils/get-health-record-sync-id.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js +2 -1
- package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js +2 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-records-count.js +4 -0
- package/lib/module/modules/data-sync/utils/get-total-records-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js +4 -0
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-connect-series.js +5 -8
- package/lib/module/modules/data-sync/utils/health-connect-series.js.map +1 -1
- package/lib/module/modules/data-sync/utils/healthkit-series.js +6 -9
- package/lib/module/modules/data-sync/utils/healthkit-series.js.map +1 -1
- package/lib/module/modules/data-sync/utils/hourly-series.js +41 -3
- package/lib/module/modules/data-sync/utils/hourly-series.js.map +1 -1
- package/lib/module/modules/data-sync/utils/identify-imported-observations.js +9 -1
- package/lib/module/modules/data-sync/utils/identify-imported-observations.js.map +1 -1
- package/lib/module/modules/next/bluetooth/{families/finicare/crc.js → codec/crc8-maxim.js} +1 -1
- package/lib/module/modules/next/bluetooth/codec/crc8-maxim.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/built-in.js +3 -2
- package/lib/module/modules/next/bluetooth/families/built-in.js.map +1 -1
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.js +9 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/frame.js +83 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/frame.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/models.js +12 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/models.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.js +28 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/replies.js +96 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/replies.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/session.js +76 -0
- package/lib/module/modules/next/bluetooth/families/famidoc-hearing-aid/session.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/finicare/frame.js +1 -1
- package/lib/module/modules/next/bluetooth/families/finicare/frame.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- 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/data-processor.d.ts +19 -16
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +8 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-health-record-sync-id.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-health-record-sync-id.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-records-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-connect-series.d.ts +9 -5
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-connect-series.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts +10 -6
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/hourly-series.d.ts +24 -4
- package/lib/typescript/commonjs/src/modules/data-sync/utils/hourly-series.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/identify-imported-observations.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/identify-imported-observations.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/{families/finicare/crc.d.ts → codec/crc8-maxim.d.ts} +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/codec/crc8-maxim.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/built-in.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/frame.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/models.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/models.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/replies.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/replies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/session.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/famidoc-hearing-aid/session.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/finicare/frame.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
- 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/data-processor.d.ts +19 -16
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +8 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-health-record-sync-id.d.ts +6 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-health-record-sync-id.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-records-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-connect-series.d.ts +9 -5
- package/lib/typescript/module/src/modules/data-sync/utils/health-connect-series.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts +10 -6
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/hourly-series.d.ts +24 -4
- package/lib/typescript/module/src/modules/data-sync/utils/hourly-series.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/identify-imported-observations.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/utils/identify-imported-observations.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/{families/finicare/crc.d.ts → codec/crc8-maxim.d.ts} +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/codec/crc8-maxim.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/built-in.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/famidoc-hearing-aid.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/frame.d.ts +38 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/models.d.ts +5 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/models.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/replies.d.ts +20 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/replies.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/session.d.ts +19 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/famidoc-hearing-aid/session.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/finicare/frame.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/commonjs/modules/next/bluetooth/families/finicare/crc.js.map +0 -1
- package/lib/module/modules/next/bluetooth/families/finicare/crc.js.map +0 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/finicare/crc.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/next/bluetooth/families/finicare/crc.d.ts.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { u16beBytes } from "../../codec/bytes.js";
|
|
4
|
+
import { crc8Maxim } from "../../codec/crc8-maxim.js";
|
|
5
|
+
import { framingOf } from "../frame-tools/frame-stream.js";
|
|
6
|
+
import { u16be } from "../frame-tools/numbers.js";
|
|
7
|
+
const START = 0xab;
|
|
8
|
+
const LENGTH_AT = 1;
|
|
9
|
+
const TYPE_AT = 3;
|
|
10
|
+
const NUMBER_AT = 4;
|
|
11
|
+
const COMMAND_AT = 5;
|
|
12
|
+
const DATA_AT = 6;
|
|
13
|
+
const CHECKSUM_BYTES = 1;
|
|
14
|
+
|
|
15
|
+
/** The start byte and the two length bytes; the length counts every byte after them. */
|
|
16
|
+
const HEADER_BYTES = 3;
|
|
17
|
+
|
|
18
|
+
/** The type, number and command bytes and the checksum, which every frame holds besides its data. */
|
|
19
|
+
const FIXED_BYTES = 4;
|
|
20
|
+
|
|
21
|
+
/** The protocol document caps the length below 509. */
|
|
22
|
+
const MAX_LENGTH = 508;
|
|
23
|
+
|
|
24
|
+
/** The ear a frame talks to sits in the type byte's top two bits; the protocol version below them is 0. */
|
|
25
|
+
const EAR = {
|
|
26
|
+
main: 0x80,
|
|
27
|
+
left: 0x40,
|
|
28
|
+
right: 0x00
|
|
29
|
+
};
|
|
30
|
+
const EAR_MASK = 0xc0;
|
|
31
|
+
|
|
32
|
+
/** Which ear a frame talks to. */
|
|
33
|
+
|
|
34
|
+
/** The number byte's six low bits count requests, so a reply names the request it answers. */
|
|
35
|
+
const COUNT_MASK = 0x3f;
|
|
36
|
+
|
|
37
|
+
/** A command with this bit set is a request or its reply; without it, a report the aid sends by itself. */
|
|
38
|
+
const REPLY_BIT = 0x80;
|
|
39
|
+
|
|
40
|
+
/** The reads the phone sends; the aid answers each with the same command. */
|
|
41
|
+
const COMMAND = {
|
|
42
|
+
connection: 0x81,
|
|
43
|
+
deviceInformation: 0xc1,
|
|
44
|
+
battery: 0xc2
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** One frame from the aid. */
|
|
48
|
+
|
|
49
|
+
/** A read: `ab`, the length big endian, the ear, the count, the command, and the CRC-8/MAXIM of all of it. */
|
|
50
|
+
const encodeRead = (ear, count, command) => {
|
|
51
|
+
const body = [START, ...u16beBytes(FIXED_BYTES), ear, count & COUNT_MASK, command];
|
|
52
|
+
return Uint8Array.from([...body, crc8Maxim(body)]);
|
|
53
|
+
};
|
|
54
|
+
const isIntact = frame => frame.length >= HEADER_BYTES + FIXED_BYTES && crc8Maxim(frame.subarray(0, frame.length - CHECKSUM_BYTES)) === frame[frame.length - CHECKSUM_BYTES];
|
|
55
|
+
|
|
56
|
+
/** A length past the cap cannot start a frame, so its start byte is cut alone and fails the checksum. */
|
|
57
|
+
const frameLength = held => {
|
|
58
|
+
if (held.length < HEADER_BYTES) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const length = u16be(held, LENGTH_AT);
|
|
62
|
+
return length <= MAX_LENGTH ? HEADER_BYTES + length : HEADER_BYTES;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** Cuts the aid's notifications into frames that start with `ab` and hold their checksum. */
|
|
66
|
+
const AID_FRAMING = framingOf({
|
|
67
|
+
header: [START],
|
|
68
|
+
lengthOf: frameLength,
|
|
69
|
+
accepts: isIntact
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/** Reads a whole frame the framing accepted. */
|
|
73
|
+
const decodeFrame = frame => ({
|
|
74
|
+
ear: (frame[TYPE_AT] ?? 0) & EAR_MASK,
|
|
75
|
+
count: (frame[NUMBER_AT] ?? 0) & COUNT_MASK,
|
|
76
|
+
command: frame[COMMAND_AT] ?? 0,
|
|
77
|
+
data: frame.subarray(DATA_AT, frame.length - CHECKSUM_BYTES)
|
|
78
|
+
});
|
|
79
|
+
const isReply = ({
|
|
80
|
+
command
|
|
81
|
+
}) => (command & REPLY_BIT) !== 0;
|
|
82
|
+
export { AID_FRAMING, COMMAND, COUNT_MASK, decodeFrame, EAR, encodeRead, isReply };
|
|
83
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["u16beBytes","crc8Maxim","framingOf","u16be","START","LENGTH_AT","TYPE_AT","NUMBER_AT","COMMAND_AT","DATA_AT","CHECKSUM_BYTES","HEADER_BYTES","FIXED_BYTES","MAX_LENGTH","EAR","main","left","right","EAR_MASK","COUNT_MASK","REPLY_BIT","COMMAND","connection","deviceInformation","battery","encodeRead","ear","count","command","body","Uint8Array","from","isIntact","frame","length","subarray","frameLength","held","undefined","AID_FRAMING","header","lengthOf","accepts","decodeFrame","data","isReply"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/famidoc-hearing-aid/frame.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,sBAAmB;AAC9C,SAASC,SAAS,QAAQ,2BAAwB;AAClD,SAAkBC,SAAS,QAAQ,gCAA6B;AAChE,SAASC,KAAK,QAAQ,2BAAwB;AAE9C,MAAMC,KAAK,GAAG,IAAI;AAClB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,OAAO,GAAG,CAAC;AACjB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,OAAO,GAAG,CAAC;AACjB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,WAAW,GAAG,CAAC;;AAErB;AACA,MAAMC,UAAU,GAAG,GAAG;;AA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MAAM4B,WAAoB,GAAGrC,SAAS,CAAC;EAAEsC,MAAM,EAAE,CAACpC,KAAK,CAAC;EAAEqC,QAAQ,EAAEL,WAAW;EAAEM,OAAO,EAAEV;AAAS,CAAC,CAAC;;AAErG;AACA,MAAMW,WAAW,GAAIV,KAAiB,KAAuB;EAC3DP,GAAG,EAAE,CAACO,KAAK,CAAC3B,OAAO,CAAC,IAAI,CAAC,IAAIY,QAAQ;EACrCS,KAAK,EAAE,CAACM,KAAK,CAAC1B,SAAS,CAAC,IAAI,CAAC,IAAIY,UAAU;EAC3CS,OAAO,EAAEK,KAAK,CAACzB,UAAU,CAAC,IAAI,CAAC;EAC/BoC,IAAI,EAAEX,KAAK,CAACE,QAAQ,CAAC1B,OAAO,EAAEwB,KAAK,CAACC,MAAM,GAAGxB,cAAc;AAC7D,CAAC,CAAC;AAEF,MAAMmC,OAAO,GAAGA,CAAC;EAAEjB;AAAyB,CAAC,KAAc,CAACA,OAAO,GAAGR,SAAS,MAAM,CAAC;AAEtF,SAASmB,WAAW,EAAElB,OAAO,EAAEF,UAAU,EAAEwB,WAAW,EAAE7B,GAAG,EAAEW,UAAU,EAAEoB,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { modelRows } from "../sig/model-row.js";
|
|
4
|
+
import { FAMIDOC_HEARING_AID } from "./protocol.js";
|
|
5
|
+
|
|
6
|
+
/** A hearing aid measures nothing for the patient's record. */
|
|
7
|
+
const hearingAid = modelRows(FAMIDOC_HEARING_AID.id, []);
|
|
8
|
+
|
|
9
|
+
/** The Famidoc hearing aids, found by the name they advertise. */
|
|
10
|
+
const FAMIDOC_HEARING_AID_MODELS = [hearingAid("Famidoc", "FDHA7200", ["FDHA7200"])];
|
|
11
|
+
export { FAMIDOC_HEARING_AID_MODELS };
|
|
12
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["modelRows","FAMIDOC_HEARING_AID","hearingAid","id","FAMIDOC_HEARING_AID_MODELS"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/famidoc-hearing-aid/models.ts"],"mappings":";;AACA,SAASA,SAAS,QAAQ,qBAAkB;AAE5C,SAASC,mBAAmB,QAAQ,eAAY;;AAEhD;AACA,MAAMC,UAAU,GAAGF,SAAS,CAACC,mBAAmB,CAACE,EAAE,EAAE,EAAE,CAAC;;AAExD;AACA,MAAMC,0BAAkD,GAAG,CAACF,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AAE5G,SAASE,0BAA0B","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { COMMAND } from "./frame.js";
|
|
4
|
+
import { batteryOf, emptiestOf, identityOf, linkedEars } from "./replies.js";
|
|
5
|
+
import { AID_SERVICE, openSession } from "./session.js";
|
|
6
|
+
|
|
7
|
+
/** The Famidoc hearing aids: the pair's identity and battery; they keep no readings to sync. */
|
|
8
|
+
const FAMIDOC_HEARING_AID = {
|
|
9
|
+
id: "famidoc/hearing-aid",
|
|
10
|
+
services: [AID_SERVICE],
|
|
11
|
+
open: openSession,
|
|
12
|
+
identify: async ({
|
|
13
|
+
ears,
|
|
14
|
+
read
|
|
15
|
+
}) => identityOf(await read(ears.main, COMMAND.deviceInformation)),
|
|
16
|
+
battery: async ({
|
|
17
|
+
ears,
|
|
18
|
+
read
|
|
19
|
+
}) => {
|
|
20
|
+
const levels = await Promise.all(linkedEars(ears).map(ear => read(ear, COMMAND.battery)));
|
|
21
|
+
return emptiestOf(levels.map(batteryOf));
|
|
22
|
+
},
|
|
23
|
+
close: async ({
|
|
24
|
+
stop
|
|
25
|
+
}) => stop()
|
|
26
|
+
};
|
|
27
|
+
export { FAMIDOC_HEARING_AID };
|
|
28
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["COMMAND","batteryOf","emptiestOf","identityOf","linkedEars","AID_SERVICE","openSession","FAMIDOC_HEARING_AID","id","services","open","identify","ears","read","main","deviceInformation","battery","levels","Promise","all","map","ear","close","stop"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/famidoc-hearing-aid/protocol.ts"],"mappings":";;AAEA,SAASA,OAAO,QAAQ,YAAS;AACjC,SAASC,SAAS,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAW;AACzE,SAASC,WAAW,EAAwBC,WAAW,QAAQ,cAAW;;AAE1E;AACA,MAAMC,mBAAyD,GAAG;EAChEC,EAAE,EAAE,qBAAqB;EACzBC,QAAQ,EAAE,CAACJ,WAAW,CAAC;EACvBK,IAAI,EAAEJ,WAAW;EACjBK,QAAQ,EAAE,MAAAA,CAAO;IAAEC,IAAI;IAAEC;EAAK,CAAC,KAAKV,UAAU,CAAC,MAAMU,IAAI,CAACD,IAAI,CAACE,IAAI,EAAEd,OAAO,CAACe,iBAAiB,CAAC,CAAC;EAChGC,OAAO,EAAE,MAAAA,CAAO;IAAEJ,IAAI;IAAEC;EAAK,CAAC,KAAK;IACjC,MAAMI,MAAM,GAAG,MAAMC,OAAO,CAACC,GAAG,CAACf,UAAU,CAACQ,IAAI,CAAC,CAACQ,GAAG,CAAEC,GAAG,IAAKR,IAAI,CAACQ,GAAG,EAAErB,OAAO,CAACgB,OAAO,CAAC,CAAC,CAAC;IAE3F,OAAOd,UAAU,CAACe,MAAM,CAACG,GAAG,CAACnB,SAAS,CAAC,CAAC;EAC1C,CAAC;EACDqB,KAAK,EAAE,MAAAA,CAAO;IAAEC;EAAK,CAAC,KAAKA,IAAI,CAAC;AAClC,CAAC;AAED,SAAShB,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { hex } from "../../codec/bytes.js";
|
|
4
|
+
import { EAR } from "./frame.js";
|
|
5
|
+
const MAIN_IS_RIGHT = 0x02;
|
|
6
|
+
const BOTH_EARS = 0x01;
|
|
7
|
+
const CHARGING = 0x80;
|
|
8
|
+
const PERCENT_MASK = 0x7f;
|
|
9
|
+
const FULL = 100;
|
|
10
|
+
|
|
11
|
+
/** Where each field of the device information reply starts and how many bytes it takes. */
|
|
12
|
+
const HARDWARE = {
|
|
13
|
+
at: 0,
|
|
14
|
+
size: 1
|
|
15
|
+
};
|
|
16
|
+
const SOFTWARE = {
|
|
17
|
+
at: 1,
|
|
18
|
+
size: 8
|
|
19
|
+
};
|
|
20
|
+
const SERIAL = {
|
|
21
|
+
at: 9,
|
|
22
|
+
size: 19
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** The software version's eight digit bytes print as `x.y.zz.mmmm`. */
|
|
26
|
+
const SOFTWARE_GROUPS = [1, 1, 2, 4];
|
|
27
|
+
|
|
28
|
+
/** A serial the aid never had written holds only these. */
|
|
29
|
+
const UNWRITTEN = 0xff;
|
|
30
|
+
const PADDING = 0x00;
|
|
31
|
+
|
|
32
|
+
/** The linked ears: the one that speaks for the pair, and the other when both are linked. */
|
|
33
|
+
|
|
34
|
+
/** The connection reply: bit 1 says the main ear is the right one, bit 0 that both ears are linked. */
|
|
35
|
+
const earsOf = data => {
|
|
36
|
+
const flags = data[0] ?? 0;
|
|
37
|
+
const [main, other] = flags & MAIN_IS_RIGHT ? [EAR.right, EAR.left] : [EAR.left, EAR.right];
|
|
38
|
+
return {
|
|
39
|
+
main,
|
|
40
|
+
other: flags & BOTH_EARS ? other : null
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** The ears to read a per-ear value from. */
|
|
45
|
+
const linkedEars = ({
|
|
46
|
+
main,
|
|
47
|
+
other
|
|
48
|
+
}) => other === null ? [main] : [main, other];
|
|
49
|
+
|
|
50
|
+
/** The battery reply: bit 7 says it charges, the seven low bits are the percentage. */
|
|
51
|
+
const batteryOf = data => {
|
|
52
|
+
const level = data[0] ?? 0;
|
|
53
|
+
return {
|
|
54
|
+
percent: Math.min(level & PERCENT_MASK, FULL),
|
|
55
|
+
charging: (level & CHARGING) !== 0
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** The pair runs as long as its emptiest ear, so that ear's battery stands for the pair. */
|
|
60
|
+
const emptiestOf = batteries => batteries.reduce((emptiest, battery) => battery.percent < emptiest.percent ? battery : emptiest);
|
|
61
|
+
const fieldOf = (data, {
|
|
62
|
+
at,
|
|
63
|
+
size
|
|
64
|
+
}) => data.subarray(at, at + size);
|
|
65
|
+
const softwareVersion = digits => {
|
|
66
|
+
const groups = [];
|
|
67
|
+
let at = 0;
|
|
68
|
+
for (const size of SOFTWARE_GROUPS) {
|
|
69
|
+
groups.push(Array.from(digits.subarray(at, at + size)).join(""));
|
|
70
|
+
at += size;
|
|
71
|
+
}
|
|
72
|
+
return groups.join(".");
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** The serial as hex without its zero padding; `null` when the aid never had one written. */
|
|
76
|
+
const serialOf = bytes => {
|
|
77
|
+
if (bytes.length === 0 || bytes.every(byte => byte === UNWRITTEN)) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
let end = bytes.length;
|
|
81
|
+
while (end > 0 && bytes[end - 1] === PADDING) {
|
|
82
|
+
end -= 1;
|
|
83
|
+
}
|
|
84
|
+
return hex(bytes.subarray(0, end));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** The device information reply: hardware revision, software version and serial; the aid names no maker or model. */
|
|
88
|
+
const identityOf = data => ({
|
|
89
|
+
serial: serialOf(fieldOf(data, SERIAL)),
|
|
90
|
+
firmware: softwareVersion(fieldOf(data, SOFTWARE)),
|
|
91
|
+
hardware: String(fieldOf(data, HARDWARE)[0] ?? 0),
|
|
92
|
+
manufacturer: null,
|
|
93
|
+
model: null
|
|
94
|
+
});
|
|
95
|
+
export { batteryOf, earsOf, emptiestOf, identityOf, linkedEars };
|
|
96
|
+
//# sourceMappingURL=replies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hex","EAR","MAIN_IS_RIGHT","BOTH_EARS","CHARGING","PERCENT_MASK","FULL","HARDWARE","at","size","SOFTWARE","SERIAL","SOFTWARE_GROUPS","UNWRITTEN","PADDING","earsOf","data","flags","main","other","right","left","linkedEars","batteryOf","level","percent","Math","min","charging","emptiestOf","batteries","reduce","emptiest","battery","fieldOf","subarray","softwareVersion","digits","groups","push","Array","from","join","serialOf","bytes","length","every","byte","end","identityOf","serial","firmware","hardware","String","manufacturer","model"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/famidoc-hearing-aid/replies.ts"],"mappings":";;AAAA,SAASA,GAAG,QAAQ,sBAAmB;AAGvC,SAAcC,GAAG,QAAQ,YAAS;AAElC,MAAMC,aAAa,GAAG,IAAI;AAC1B,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,QAAQ,GAAG,IAAI;AACrB,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,IAAI,GAAG,GAAG;;AAEhB;AACA,MAAMC,QAAQ,GAAG;EAAEC,EAAE,EAAE,CAAC;EAAEC,IAAI,EAAE;AAAE,CAAC;AACnC,MAAMC,QAAQ,GAAG;EAAEF,EAAE,EAAE,CAAC;EAAEC,IAAI,EAAE;AAAE,CAAC;AACnC,MAAME,MAAM,GAAG;EAAEH,EAAE,EAAE,CAAC;EAAEC,IAAI,EAAE;AAAG,CAAC;;AAElC;AACA,MAAMG,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;AAEpC;AACA,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,OAAO,GAAG,IAAI;;AAEpB;;AAGA;AACA,MAAMC,MAAM,GAAIC,IAAgB,IAAW;EACzC,MAAMC,KAAK,GAAGD,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;EAC1B,MAAM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
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { fullUuid } from "../../core/advertisement.js";
|
|
4
|
+
import { DeviceError } from "../../core/errors.js";
|
|
5
|
+
import { Exchange } from "../../core/exchange.js";
|
|
6
|
+
import { listenToFrames, writeFrame } from "../frame-tools/frame-link.js";
|
|
7
|
+
import { AID_FRAMING, COMMAND, COUNT_MASK, decodeFrame, EAR, encodeRead, isReply } from "./frame.js";
|
|
8
|
+
import { earsOf } from "./replies.js";
|
|
9
|
+
|
|
10
|
+
/** The service the phone talks to the aid through; the OTA and audio services are left alone. */
|
|
11
|
+
const AID_SERVICE = fullUuid("FF00");
|
|
12
|
+
const WRITE = fullUuid("FF01");
|
|
13
|
+
const NOTIFY = fullUuid("FF02");
|
|
14
|
+
|
|
15
|
+
/** The aid answered every read within a second on hardware. */
|
|
16
|
+
const REPLY_TIMING = {
|
|
17
|
+
replyTimeoutMs: 3_000,
|
|
18
|
+
attempts: 2
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** One open link: which ears are linked, and how to read from one. */
|
|
22
|
+
|
|
23
|
+
/** Counts from 1 to 63 and round again, so a reply names the request it answers. */
|
|
24
|
+
const counter = () => {
|
|
25
|
+
let count = 0;
|
|
26
|
+
return () => {
|
|
27
|
+
count = count % COUNT_MASK + 1;
|
|
28
|
+
return count;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Listens to the aid, then asks which ears are linked. */
|
|
33
|
+
const openSession = async ({
|
|
34
|
+
link,
|
|
35
|
+
logger
|
|
36
|
+
}) => {
|
|
37
|
+
const exchange = new Exchange(REPLY_TIMING);
|
|
38
|
+
const nextCount = counter();
|
|
39
|
+
const read = async (ear, command) => {
|
|
40
|
+
const count = nextCount();
|
|
41
|
+
const answers = reply => reply.ear === ear && reply.count === count && reply.command === command;
|
|
42
|
+
const {
|
|
43
|
+
data
|
|
44
|
+
} = await exchange.request(() => writeFrame(link, AID_SERVICE, WRITE, encodeRead(ear, count, command)), answers);
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
const stop = await listenToFrames(link, [{
|
|
48
|
+
service: AID_SERVICE,
|
|
49
|
+
characteristic: NOTIFY,
|
|
50
|
+
framing: AID_FRAMING
|
|
51
|
+
}], {
|
|
52
|
+
onFrame: bytes => {
|
|
53
|
+
const frame = decodeFrame(bytes);
|
|
54
|
+
if (isReply(frame)) {
|
|
55
|
+
exchange.receive(frame);
|
|
56
|
+
} else {
|
|
57
|
+
logger.debug("famidoc-hearing-aid.report.received", {
|
|
58
|
+
command: frame.command
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
onDisconnect: () => exchange.fail(new DeviceError("disconnected", "The hearing aid dropped the link"))
|
|
63
|
+
});
|
|
64
|
+
try {
|
|
65
|
+
return {
|
|
66
|
+
ears: earsOf(await read(EAR.main, COMMAND.connection)),
|
|
67
|
+
read,
|
|
68
|
+
stop
|
|
69
|
+
};
|
|
70
|
+
} catch (error) {
|
|
71
|
+
stop();
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export { AID_SERVICE, openSession };
|
|
76
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fullUuid","DeviceError","Exchange","listenToFrames","writeFrame","AID_FRAMING","COMMAND","COUNT_MASK","decodeFrame","EAR","encodeRead","isReply","earsOf","AID_SERVICE","WRITE","NOTIFY","REPLY_TIMING","replyTimeoutMs","attempts","counter","count","openSession","link","logger","exchange","nextCount","read","ear","command","answers","reply","data","request","stop","service","characteristic","framing","onFrame","bytes","frame","receive","debug","onDisconnect","fail","ears","main","connection","error"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/famidoc-hearing-aid/session.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,6BAA0B;AACnD,SAASC,WAAW,QAAQ,sBAAmB;AAC/C,SAASC,QAAQ,QAAwB,wB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EJ,UAAU,CAACiB,GAAG,EAAEP,KAAK,EAAEQ,OAAO,CAAC,CAAC,EAAEC,OAAO,CAAC;IAE7H,OAAOE,IAAI;EACb,CAAC;EAED,MAAME,IAAI,GAAG,MAAM9B,cAAc,CAACmB,IAAI,EAAE,CAAC;IAAEY,OAAO,EAAErB,WAAW;IAAEsB,cAAc,EAAEpB,MAAM;IAAEqB,OAAO,EAAE/B;EAAY,CAAC,CAAC,EAAE;IAChHgC,OAAO,EAAGC,KAAK,IAAK;MAClB,MAAMC,KAAK,GAAG/B,WAAW,CAAC8B,KAAK,CAAC;MAEhC,IAAI3B,OAAO,CAAC4B,KAAK,CAAC,EAAE;QAClBf,QAAQ,CAACgB,OAAO,CAACD,KAAK,CAAC;MACzB,CAAC,MAAM;QACLhB,MAAM,CAACkB,KAAK,CAAC,qCAAqC,EAAE;UAAEb,OAAO,EAAEW,KAAK,CAACX;QAAQ,CAAC,CAAC;MACjF;IACF,CAAC;IACDc,YAAY,EAAEA,CAAA,KAAMlB,QAAQ,CAACmB,IAAI,CAAC,IAAI1C,WAAW,CAAC,cAAc,EAAE,kCAAkC,CAAC;EACvG,CAAC,CAAC;EAEF,IAAI;IACF,OAAO;MAAE2C,IAAI,EAAEhC,MAAM,CAAC,MAAMc,IAAI,CAACjB,GAAG,CAACoC,IAAI,EAAEvC,OAAO,CAACwC,UAAU,CAAC,CAAC;MAAEpB,IAAI;MAAEO;IAAK,CAAC;EAC/E,CAAC,CAAC,OAAOc,KAAK,EAAE;IACdd,IAAI,CAAC,CAAC;IACN,MAAMc,KAAK;EACb;AACF,CAAC;AAED,SAASlC,WAAW,EAAEQ,WAAW","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { crc8Maxim } from "../../codec/crc8-maxim.js";
|
|
3
4
|
import { framingOf } from "../frame-tools/frame-stream.js";
|
|
4
5
|
import { u16be } from "../frame-tools/numbers.js";
|
|
5
|
-
import { crc8Maxim } from "./crc.js";
|
|
6
6
|
const PHONE_HEADER = [0xbe, 0xb0];
|
|
7
7
|
const MONITOR_HEADER = [0xd0, 0xc2];
|
|
8
8
|
const LENGTH_AT = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["crc8Maxim","framingOf","u16be","PHONE_HEADER","MONITOR_HEADER","LENGTH_AT","DATA_AT","CHECKSUM_BYTES","COMMAND_BYTES","STATUS_BYTES","FRAME_OVERHEAD","COMMAND","handshake","setTime","turnOff","STATUS","ok","busy","MEASUREMENT_MARKER","encodeFrame","command","payload","body","length","Uint8Array","from","isIntact","frame","subarray","MONITOR_FRAMING","header","lengthOf","held","undefined","accepts","dataOf","statusOf","data"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/finicare/frame.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,2BAAwB;AAClD,SAAkBC,SAAS,QAAQ,gCAA6B;AAChE,SAASC,KAAK,QAAQ,2BAAwB;AAG9C,MAAMC,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU;AAC1C,MAAMC,cAAc,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU;AAC5C,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,OAAO,GAAG,CAAC;AACjB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,cAAc,GAAGJ,OAAO,GAAGC,cAAc;;AAE/C;AACA,MAAMI,OAAO,GAAG;EAAEC,SAAS,EAAE,IAAI;EAAEC,OAAO,EAAE,IAAI;EAAEC,OAAO,EAAE;AAAK,CAAU;;AAE1E;AACA,MAAMC,MAAM,GAAG;EAAEC,EAAE,EAAE,MAAM;EAAEC,IAAI,EAAE;AAAO,CAAU;;AAEpD;AACA,MAAMC,kBAAkB,GAAG,IAAI;;AAE/B;AACA,MAAMC,WAA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../../../../../../src/modules/data-sync/components/android/android-health-connect-authorization-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"android-health-connect-authorization-provider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/data-sync/components/android/android-health-connect-authorization-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,OAAO,EAAE,8CAA8C,EAAE,MAAM,iEAAiE,CAAC;AA4MjI,eAAO,MAAM,yCAAyC,4KAUjD,KAAK,CAAC,iBAAiB,CAAC,8CAA8C,CAAC,uBAqE3E,CAAC"}
|
package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-health-sync-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/services/base-health-sync-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,WAAW,EAAE,MAAM,oBAAoB,CAAC;AASzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAWzD,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,CAAC,eAAe,SAAS,MAAM,EAAE,iBAAiB,IAAI;IACjF,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AAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;YAKjD,cAAc;YAUd,oBAAoB;YA0BpB,mBAAmB;YA4BnB,cAAc;
|
|
1
|
+
{"version":3,"file":"base-health-sync-service.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/services/base-health-sync-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,WAAW,EAAE,MAAM,oBAAoB,CAAC;AASzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAWzD,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,CAAC,eAAe,SAAS,MAAM,EAAE,iBAAiB,IAAI;IACjF,QAAQ,EAAE,cAAc,CAAC;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,OAAO,EAAE,CACP,KAAK,EAAE,wBAAwB,CAAC,eAAe,CAAC,KAC7C,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC,CAAC;IACzE,OAAO,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CACjF,CAAC;AAEF,8BAAsB,qBAAqB,CACzC,WAAW,SACT,sBAAsB,CAAC,YAAY,CAAC,GAAG,oBAAoB,CAAC,YAAY,CAAC,EAC3E,eAAe,SAAS,MAAM,EAC9B,iBAAiB,GAAG,OAAO;IAiBzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAf1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyB;IAErD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmC;IACnE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmB;IAChD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAI5B;gBAGA,KAAK,EAAE,gBAAgB,CAAC,WAAW,CAAC,EACnB,OAAO,EAAE,iBAAiB,CAAC,eAAe,EAAE,iBAAiB,CAAC;IA6BjF,2EAA2E;IAC9D,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvC,wFAAwF;IAC3E,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAGvB;YAEU,OAAO;IAyBR,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAMzB,SAAS,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;YAKjD,cAAc;YAUd,oBAAoB;YA0BpB,mBAAmB;YA4BnB,cAAc;IA4F5B;;;OAGG;YACW,YAAY;IA+B1B,OAAO,CAAC,WAAW;IAgCnB,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,yBAAyB;CAGlC"}
|
|
@@ -7,10 +7,25 @@ import { DataFromProviderResult } from "../../types/data-from-provider-result";
|
|
|
7
7
|
import { GetDataFromProviderProps } from "../../types/get-data-from-provider-props";
|
|
8
8
|
import { GetTotalCountProps } from "../../types/get-total-count-props";
|
|
9
9
|
import { HealthProvider } from "../../types/health-provider";
|
|
10
|
-
import { HealthSyncKey } from "../../types/health-sync-keys";
|
|
10
|
+
import { HealthDataMode, HealthSyncKey } from "../../types/health-sync-keys";
|
|
11
11
|
import { getLatestValidStartDate } from "../../utils/get-latest-valid-start-date";
|
|
12
|
-
import { identifyImportedObservations } from "../../utils/identify-imported-observations";
|
|
13
12
|
import { StorageManager } from "./storage-manager";
|
|
13
|
+
/** One page of a data type's readings, as observations, with what names them. */
|
|
14
|
+
export type ObservationPage<TRecord = unknown> = {
|
|
15
|
+
observationBodies: Observation[][];
|
|
16
|
+
observationSyncIds: Array<string | undefined>;
|
|
17
|
+
observationRecordIds: Array<string | undefined>;
|
|
18
|
+
/** The sync id each reading was saved under before, for a day's total its bounds; undefined when none changed. */
|
|
19
|
+
observationFormerSyncIds?: Array<string | undefined>;
|
|
20
|
+
deletedRecordIds: string[];
|
|
21
|
+
hasMore: boolean;
|
|
22
|
+
anchors: Array<{
|
|
23
|
+
typeIdentifier: string;
|
|
24
|
+
anchor: string;
|
|
25
|
+
}>;
|
|
26
|
+
/** Records of readings the next page may add to, kept for it; undefined for a type whose records stand alone. */
|
|
27
|
+
carriedRecords: TRecord[] | undefined;
|
|
28
|
+
};
|
|
14
29
|
export declare class DataProcessor<TDataToSync extends AndroidHealthSyncProps["dataToSync"] | AppleHealthSyncProps["dataToSync"], TTypeIdentifier extends string, TDataFromProvider> {
|
|
15
30
|
private client;
|
|
16
31
|
private patientId;
|
|
@@ -27,20 +42,8 @@ export declare class DataProcessor<TDataToSync extends AndroidHealthSyncProps["d
|
|
|
27
42
|
date: string | undefined;
|
|
28
43
|
}>>;
|
|
29
44
|
getTotalRecordsCountForType(measurementTypeKey: HealthSyncKey, data: NonNullable<TDataToSync[HealthSyncKey]>, latestValidStartDate: Date | undefined): Promise<number>;
|
|
30
|
-
getObservationBodiesForType(measurementTypeKey: HealthSyncKey, data: NonNullable<TDataToSync[HealthSyncKey]>, latestValidStartDate: Date | undefined): Promise<
|
|
31
|
-
|
|
32
|
-
observationSyncIds: Array<string | undefined>;
|
|
33
|
-
observationRecordIds: Array<string | undefined>;
|
|
34
|
-
deletedRecordIds: string[];
|
|
35
|
-
hasMore: boolean;
|
|
36
|
-
anchors: Array<{
|
|
37
|
-
typeIdentifier: string;
|
|
38
|
-
anchor: string;
|
|
39
|
-
}>;
|
|
40
|
-
/** Records of readings the next page may add to, kept for it; undefined for a type whose records stand alone. */
|
|
41
|
-
carriedRecords: TDataFromProvider[] | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
identifyObservations(observationBodies: Observation[][], observationSyncIds?: Array<string | undefined>, observationRecordIds?: Array<string | undefined>, mode?: Parameters<typeof identifyImportedObservations>[0]["mode"]): Observation[][];
|
|
45
|
+
getObservationBodiesForType(measurementTypeKey: HealthSyncKey, data: NonNullable<TDataToSync[HealthSyncKey]>, latestValidStartDate: Date | undefined): Promise<ObservationPage<TDataFromProvider>>;
|
|
46
|
+
identifyObservations(page: ObservationPage, mode?: HealthDataMode): Observation[][];
|
|
44
47
|
getLatestValidStartDate(latestObservationDates: Array<{
|
|
45
48
|
code: string | undefined;
|
|
46
49
|
date: string | undefined;
|
package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-processor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/data-sync/services/managers/data-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"data-processor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/data-sync/services/managers/data-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAEL,cAAc,EACd,aAAa,EACd,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAOlF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAanD,iFAAiF;AACjF,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,IAAI;IAC/C,iBAAiB,EAAE,WAAW,EAAE,EAAE,CAAC;IACnC,kBAAkB,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC9C,oBAAoB,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAEhD,kHAAkH;IAClH,wBAAwB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAA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B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC,CACH;IAWK,2BAA2B,CAC/B,kBAAkB,EAAE,aAAa,EACjC,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAC7C,oBAAoB,EAAE,IAAI,GAAG,SAAS,GACrC,OAAO,CAAC,MAAM,CAAC;IAmBZ,2BAA2B,CAC/B,kBAAkB,EAAE,aAAa,EACjC,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAC7C,oBAAoB,EAAE,IAAI,GAAG,SAAS,GACrC,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;IA4J9C,oBAAoB,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,cAAc;IAWjE,uBAAuB,CACrB,sBAAsB,EAAE,KAAK,CAAC;QAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC,EACF,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAC7C,kBAAkB,EAAE,aAAa,EACjC,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAC3D,IAAI,GAAG,SAAS;CAyBpB"}
|
package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts
CHANGED
|
@@ -24,6 +24,13 @@ type AndroidHealthConnectAuthorizationStatus = {
|
|
|
24
24
|
missingTypes?: readonly string[];
|
|
25
25
|
/** Background access is reported independently; it never blocks foreground import. */
|
|
26
26
|
backgroundAccess?: "authorized" | "shouldRequest" | "refused" | "unsupported";
|
|
27
|
+
/**
|
|
28
|
+
* Whether Health Connect can be used on the device. `updateRequired` means it is installed but too old: offer the
|
|
29
|
+
* update from the Play Store. Set once checked.
|
|
30
|
+
*/
|
|
31
|
+
availability?: HealthConnectAvailability;
|
|
27
32
|
};
|
|
28
|
-
|
|
33
|
+
/** Health Connect on the device: ready, missing, or installed but needing an update. */
|
|
34
|
+
type HealthConnectAvailability = "available" | "notInstalled" | "updateRequired";
|
|
35
|
+
export type { AndroidHealthConnectAuthorizationStatus, AppleHealthAuthorizationStatus, HealthConnectAvailability, };
|
|
29
36
|
//# sourceMappingURL=health-authorization-status.d.ts.map
|
package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health-authorization-status.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/types/health-authorization-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,wCAAwC;AACxC,KAAK,8BAA8B,GAAG;IAEpC,mCAAmC;IACnC,KAAK,EAAE,SAAS,GAAG,eAAe,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC;IAEtE,kEAAkE;IAClE,2BAA2B,EAAE,6BAA6B,EAAE,CAAC;IAE7D,wEAAwE;IACxE,4BAA4B,EAAE,6BAA6B,EAAE,CAAC;IAE9D,iFAAiF;IACjF,4BAA4B,EAAE,aAAa,EAAE,CAAC;IAE9C,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,0CAA0C;AAC1C,KAAK,uCAAuC,GAAG;IAE7C,mCAAmC;IACnC,KAAK,EACD,SAAS,GACT,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,OAAO,CAAC;IAEZ,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAEjC,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,YAAY,GAAG,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"health-authorization-status.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/types/health-authorization-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,wCAAwC;AACxC,KAAK,8BAA8B,GAAG;IAEpC,mCAAmC;IACnC,KAAK,EAAE,SAAS,GAAG,eAAe,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC;IAEtE,kEAAkE;IAClE,2BAA2B,EAAE,6BAA6B,EAAE,CAAC;IAE7D,wEAAwE;IACxE,4BAA4B,EAAE,6BAA6B,EAAE,CAAC;IAE9D,iFAAiF;IACjF,4BAA4B,EAAE,aAAa,EAAE,CAAC;IAE9C,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,0CAA0C;AAC1C,KAAK,uCAAuC,GAAG;IAE7C,mCAAmC;IACnC,KAAK,EACD,SAAS,GACT,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,OAAO,CAAC;IAEZ,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAEjC,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,YAAY,GAAG,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;IAE9E;;;OAGG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C,CAAC;AAEF,wFAAwF;AACxF,KAAK,yBAAyB,GAAG,WAAW,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAEjF,YAAY,EACV,uCAAuC,EACvC,8BAA8B,EAC9B,yBAAyB,GAC1B,CAAC"}
|
|
@@ -10,11 +10,16 @@ declare const getHealthRecordType: (record: unknown) => string | undefined;
|
|
|
10
10
|
* previous total instead of creating a second observation.
|
|
11
11
|
*/
|
|
12
12
|
declare const getHealthRecordSyncId: (record: unknown, measurementTypeKey: string) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Names a day's total by its calendar date where it was read. A re-read after a time zone change bounds the day at
|
|
15
|
+
* other instants, and this keeps it the same total instead of a second one.
|
|
16
|
+
*/
|
|
17
|
+
declare const getHealthDaySyncId: (record: unknown, measurementTypeKey: string) => string | undefined;
|
|
13
18
|
/**
|
|
14
19
|
* The identifier of every observation imported from a source record. A deletion
|
|
15
20
|
* reports only the record's id, so the import marks its observations with this
|
|
16
21
|
* and the deletion looks them up by it.
|
|
17
22
|
*/
|
|
18
23
|
declare const getHealthRecordIdentifier: (provider: HealthProvider, recordId: string) => Identifier;
|
|
19
|
-
export { getHealthRecordIdentifier, getHealthRecordSourceId, getHealthRecordSyncId, getHealthRecordType, };
|
|
24
|
+
export { getHealthDaySyncId, getHealthRecordIdentifier, getHealthRecordSourceId, getHealthRecordSyncId, getHealthRecordType, };
|
|
20
25
|
//# sourceMappingURL=get-health-record-sync-id.d.ts.map
|
package/lib/typescript/commonjs/src/modules/data-sync/utils/get-health-record-sync-id.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-health-record-sync-id.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-health-record-sync-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-health-record-sync-id.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-health-record-sync-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AA4B1D,oFAAoF;AACpF,QAAA,MAAM,uBAAuB,GAAI,QAAQ,OAAO,KAAG,MAAM,GAAG,SAI3D,CAAC;AAEF,2FAA2F;AAC3F,QAAA,MAAM,mBAAmB,GAAI,QAAQ,OAAO,KAAG,MAAM,GAAG,SASvD,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,qBAAqB,GACzB,QAAQ,OAAO,EACf,oBAAoB,MAAM,KACzB,MAAM,GAAG,SAwBX,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,kBAAkB,GACtB,QAAQ,OAAO,EACf,oBAAoB,MAAM,KACzB,MAAM,GAAG,SAWX,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,yBAAyB,GAC7B,UAAU,cAAc,EACxB,UAAU,MAAM,KACf,UAGD,CAAC;AAEH,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GACpB,CAAC"}
|
package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-records-from-health-connect.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-records-from-health-connect.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,YAAY,EACZ,UAAU,EACX,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-records-from-health-connect.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-records-from-health-connect.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,YAAY,EACZ,UAAU,EACX,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ9E,KAAK,iBAAiB,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAO5F,eAAO,MAAM,2BAA2B,GAAU,0EAO/C,wBAAwB,CAAC,UAAU,CAAC,KAAG,OAAO,CAC/C,sBAAsB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAoFtD,CAAC"}
|
|
@@ -5,7 +5,11 @@ declare const getSamplesFromHealth: ({ startDate: _startDate, typeIdentifier, an
|
|
|
5
5
|
anchor: undefined;
|
|
6
6
|
} | {
|
|
7
7
|
data: import("../types/health-data").SeriesHealthData[];
|
|
8
|
-
|
|
8
|
+
hasMore: boolean;
|
|
9
|
+
anchor: {
|
|
10
|
+
typeIdentifier: import("@kingstinct/react-native-healthkit").QuantityTypeIdentifier;
|
|
11
|
+
anchor: string;
|
|
12
|
+
} | undefined;
|
|
9
13
|
} | {
|
|
10
14
|
anchor: {
|
|
11
15
|
typeIdentifier: import("@kingstinct/react-native-healthkit").SampleTypeIdentifier;
|
package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-samples-from-health.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-samples-from-health.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-samples-from-health.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-samples-from-health.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AA4BjF,QAAA,MAAM,oBAAoB,GAAU,qEAMjC,wBAAwB,CAAC,6BAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8GzD,CAAC;AAmBF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-records-count.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-total-records-count.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-total-records-count.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-total-records-count.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-total-records-count.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAMpE,sHAAsH;AACtH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,kBAAkB,CAAC,UAAU,CAAC,KACpC,OAAO,CAAC,MAAM,CAAuC,CAAC"}
|
package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-total-samples-count.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-total-samples-count.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-total-samples-count.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/get-total-samples-count.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASpE,eAAO,MAAM,oBAAoB,GAC/B,OAAO,kBAAkB,CAAC,6BAA6B,CAAC,KACvD,OAAO,CAAC,MAAM,CAgChB,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { RecordType } from "react-native-health-connect";
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
declare const getHealthConnectSeries: (typeIdentifier: RecordType,
|
|
5
|
-
data: SeriesHealthData[];
|
|
6
|
-
|
|
2
|
+
import { SeriesPage } from "./hourly-series";
|
|
3
|
+
/** A page of finished hours, one `series` item an hour, read a day at a time. */
|
|
4
|
+
declare const getHealthConnectSeries: (typeIdentifier: RecordType, page: SeriesPage) => Promise<{
|
|
5
|
+
data: import("../types/health-data").SeriesHealthData[];
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
anchor: {
|
|
8
|
+
typeIdentifier: "ActiveCaloriesBurned" | "BasalBodyTemperature" | "BasalMetabolicRate" | "BloodGlucose" | "BloodPressure" | "BodyFat" | "BodyTemperature" | "BodyWaterMass" | "BoneMass" | "CervicalMucus" | "CyclingPedalingCadence" | "ElevationGained" | "ExerciseSession" | "FloorsClimbed" | "HeartRate" | "RestingHeartRate" | "Steps" | "StepsCadence" | "Distance" | "Height" | "Hydration" | "HeartRateVariabilityRmssd" | "SexualActivity" | "Weight" | "Nutrition" | "LeanBodyMass" | "IntermenstrualBleeding" | "Speed" | "MenstruationFlow" | "MenstruationPeriod" | "SleepSession" | "RespiratoryRate" | "WheelchairPushes" | "Vo2Max" | "OvulationTest" | "TotalCaloriesBurned" | "OxygenSaturation" | "Power";
|
|
9
|
+
anchor: string;
|
|
10
|
+
} | undefined;
|
|
7
11
|
}>;
|
|
8
12
|
export { getHealthConnectSeries };
|
|
9
13
|
//# sourceMappingURL=health-connect-series.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health-connect-series.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/health-connect-series.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,UAAU,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"health-connect-series.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/health-connect-series.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAKhG,OAAO,EAAe,UAAU,EAAkC,MAAM,iBAAiB,CAAC;AAgE1F,iFAAiF;AACjF,QAAA,MAAM,sBAAsB,GAAU,gBAAgB,UAAU,EAAE,MAAM,UAAU;;;;;;;EAgBjF,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { QuantityTypeIdentifier } from "@kingstinct/react-native-healthkit";
|
|
2
|
-
import {
|
|
2
|
+
import { SeriesPage } from "./hourly-series";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A page of finished hours, one `series` item an hour, from HealthKit's own average a minute: it follows the user's
|
|
5
|
+
* source priority where a watch and another app both recorded. Read a day at a time.
|
|
6
6
|
*/
|
|
7
|
-
declare const getHealthKitSeries: (typeIdentifier: QuantityTypeIdentifier,
|
|
8
|
-
data: SeriesHealthData[];
|
|
9
|
-
|
|
7
|
+
declare const getHealthKitSeries: (typeIdentifier: QuantityTypeIdentifier, page: SeriesPage) => Promise<{
|
|
8
|
+
data: import("../types/health-data").SeriesHealthData[];
|
|
9
|
+
hasMore: boolean;
|
|
10
|
+
anchor: {
|
|
11
|
+
typeIdentifier: QuantityTypeIdentifier;
|
|
12
|
+
anchor: string;
|
|
13
|
+
} | undefined;
|
|
10
14
|
}>;
|
|
11
15
|
export { getHealthKitSeries };
|
|
12
16
|
//# sourceMappingURL=healthkit-series.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healthkit-series.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/healthkit-series.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"healthkit-series.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/data-sync/utils/healthkit-series.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGvF,OAAO,EAAe,UAAU,EAAkC,MAAM,iBAAiB,CAAC;AAE1F;;;GAGG;AACH,QAAA,MAAM,kBAAkB,GAAU,gBAAgB,sBAAsB,EAAE,MAAM,UAAU;;;;;;;EAyBzF,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|