@d4l/collect-lib 1.2.0 → 1.3.1
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/README.md +7 -17
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,22 +8,10 @@ Build the app using `yarn build` or start development mode using `yarn start`
|
|
|
8
8
|
|
|
9
9
|
### Phoenix
|
|
10
10
|
|
|
11
|
-
For pure coding `yarn link ../collect-lib` works fine.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
yarn add ../collect-lib
|
|
16
|
-
code ./node_modules/@d4l/collect-lib
|
|
17
|
-
cd node_modules/@d4l/collect-lib
|
|
18
|
-
yarn
|
|
19
|
-
yarn start
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
React-Native does not work with `yarn link`, because of some symlink issues down the line in metro/expo/whatever.
|
|
23
|
-
To workaround we can install the dependency from local with `yarn add ../phoenix-lib`.
|
|
24
|
-
This will install the library from the local source as a full copy, allowing each `yarn` call to get the recent build.
|
|
25
|
-
From there we can cheat the system by opening the `collect-lib` from inside the `node_modules` of `phoenix` to then working in there.
|
|
26
|
-
Then run `yarn start` to watch changes in the lib and build each time, which should then be picked up by the running UA.
|
|
11
|
+
For pure coding `yarn link ../collect-lib` works fine, but execution will not work because of symlink issues.
|
|
12
|
+
Here we use the help of [yalc](https://github.com/wclr/yalc) (`npm -g install yalc`).
|
|
13
|
+
First run `yalc publish` in `collect-lib`, then `yalc link @d4l/collect-lib` in `phoenix`.
|
|
14
|
+
Then you can update the lib and then get it into the app with `yarn build && yalc push`
|
|
27
15
|
|
|
28
16
|
### Research Studio
|
|
29
17
|
|
|
@@ -31,7 +19,9 @@ Then run `yarn start` to watch changes in the lib and build each time, which sho
|
|
|
31
19
|
npm link ../collect-lib
|
|
32
20
|
```
|
|
33
21
|
|
|
34
|
-
This
|
|
22
|
+
This works for types and coding, even though it sometimes needs a reload.
|
|
23
|
+
For execution stencil does not seem to pick up the new code, so that needs a restart every time.
|
|
24
|
+
(`yalc` doesnt improve the behaviour either.)
|
|
35
25
|
|
|
36
26
|
## Types
|
|
37
27
|
|
package/dist/index.d.mts
CHANGED
|
@@ -363,9 +363,9 @@ type DEVICE_KEY_API = 'FITBIT' | 'DEXCOM' | 'dexcom_g4' | 'dexcom_g5' | 'dexcom_
|
|
|
363
363
|
type DEVICE_KEY_SDK = 'AppleHealth';
|
|
364
364
|
type DEVICE_KEY_INTERNAL = 'INTERNAL' | 'internal_accelerometer' | 'internal_gyroscope' | 'internal_magnetometer' | 'internal_beacon_sensing';
|
|
365
365
|
type DEVICE_MOVELLA_PAYLOAD_MODES = 'completeEuler' | 'customMode1' | 'rateQuantities';
|
|
366
|
-
type DEVICE_SIGNAL_TYPE = 'heartRate' | 'imu' | 'beacon' | 'beaconUWB' | 'beaconRemoteUWB' | 'rssiScan' | 'physicalActivityMonitoring' | 'customPassiveMonitoring' | 'activeSamsungSDKMonitoring' | 'passiveSamsungSDKMonitoring' | 'accelerometer' | 'gyroscope' | 'magnetometer' | 'egvs' | '
|
|
366
|
+
type DEVICE_SIGNAL_TYPE = 'heartRate' | 'imu' | 'beacon' | 'beaconUWB' | 'beaconRemoteUWB' | 'rssiScan' | 'physicalActivityMonitoring' | 'customPassiveMonitoring' | 'activeSamsungSDKMonitoring' | 'passiveSamsungSDKMonitoring' | 'accelerometer' | 'gyroscope' | 'magnetometer' | 'egvs' | 'hrv' | 'respiratoryRate' | 'steps' | 'calories' | 'sleep' | 'skinTemperature' | 'spo2' | 'stepCount' | 'walkingAndRunningDistance' | 'activeEnergy' | 'restingEnergy';
|
|
367
367
|
|
|
368
|
-
declare const RECORDING_SIGNAL_MODEL_CURRENT_VERSION = "0.0
|
|
368
|
+
declare const RECORDING_SIGNAL_MODEL_CURRENT_VERSION = "1.0.0";
|
|
369
369
|
interface RecordingSignalItem {
|
|
370
370
|
date: Date;
|
|
371
371
|
value: Uint8Array;
|
|
@@ -395,7 +395,7 @@ interface RecordingSignal {
|
|
|
395
395
|
outputRate?: number;
|
|
396
396
|
sensorDelay?: number;
|
|
397
397
|
type?: DEVICE_SIGNAL_TYPE;
|
|
398
|
-
|
|
398
|
+
data?: ArrayBuffer;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -363,9 +363,9 @@ type DEVICE_KEY_API = 'FITBIT' | 'DEXCOM' | 'dexcom_g4' | 'dexcom_g5' | 'dexcom_
|
|
|
363
363
|
type DEVICE_KEY_SDK = 'AppleHealth';
|
|
364
364
|
type DEVICE_KEY_INTERNAL = 'INTERNAL' | 'internal_accelerometer' | 'internal_gyroscope' | 'internal_magnetometer' | 'internal_beacon_sensing';
|
|
365
365
|
type DEVICE_MOVELLA_PAYLOAD_MODES = 'completeEuler' | 'customMode1' | 'rateQuantities';
|
|
366
|
-
type DEVICE_SIGNAL_TYPE = 'heartRate' | 'imu' | 'beacon' | 'beaconUWB' | 'beaconRemoteUWB' | 'rssiScan' | 'physicalActivityMonitoring' | 'customPassiveMonitoring' | 'activeSamsungSDKMonitoring' | 'passiveSamsungSDKMonitoring' | 'accelerometer' | 'gyroscope' | 'magnetometer' | 'egvs' | '
|
|
366
|
+
type DEVICE_SIGNAL_TYPE = 'heartRate' | 'imu' | 'beacon' | 'beaconUWB' | 'beaconRemoteUWB' | 'rssiScan' | 'physicalActivityMonitoring' | 'customPassiveMonitoring' | 'activeSamsungSDKMonitoring' | 'passiveSamsungSDKMonitoring' | 'accelerometer' | 'gyroscope' | 'magnetometer' | 'egvs' | 'hrv' | 'respiratoryRate' | 'steps' | 'calories' | 'sleep' | 'skinTemperature' | 'spo2' | 'stepCount' | 'walkingAndRunningDistance' | 'activeEnergy' | 'restingEnergy';
|
|
367
367
|
|
|
368
|
-
declare const RECORDING_SIGNAL_MODEL_CURRENT_VERSION = "0.0
|
|
368
|
+
declare const RECORDING_SIGNAL_MODEL_CURRENT_VERSION = "1.0.0";
|
|
369
369
|
interface RecordingSignalItem {
|
|
370
370
|
date: Date;
|
|
371
371
|
value: Uint8Array;
|
|
@@ -395,7 +395,7 @@ interface RecordingSignal {
|
|
|
395
395
|
outputRate?: number;
|
|
396
396
|
sensorDelay?: number;
|
|
397
397
|
type?: DEVICE_SIGNAL_TYPE;
|
|
398
|
-
|
|
398
|
+
data?: ArrayBuffer;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
/**
|
package/dist/index.js
CHANGED
|
@@ -256,7 +256,7 @@ var FITBIT_SIGNAL_TYPE_ANNOTATIONS = {
|
|
|
256
256
|
calories: FITBIT_CALORIES_ANNOTATION,
|
|
257
257
|
steps: FITBIT_STEPS_ANNOTATION,
|
|
258
258
|
heartRate: FITBIT_HEART_RATE_ANNOTATION,
|
|
259
|
-
|
|
259
|
+
hrv: FITBIT_HEART_RATE_VARIABILITY_ANNOTATION,
|
|
260
260
|
respiratoryRate: FITBIT_BREATHING_RATE_ANNOTATION,
|
|
261
261
|
skinTemperature: FITBIT_SKIN_TEMPERATURE_ANNOTATION,
|
|
262
262
|
sleep: FITBIT_SLEEP_ANNOTATION,
|
|
@@ -759,7 +759,7 @@ var APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS = {
|
|
|
759
759
|
var RECORDING_MODEL_CURRENT_VERSION = "0.0.6";
|
|
760
760
|
|
|
761
761
|
// src/types/recordingSignal.ts
|
|
762
|
-
var RECORDING_SIGNAL_MODEL_CURRENT_VERSION = "0.0
|
|
762
|
+
var RECORDING_SIGNAL_MODEL_CURRENT_VERSION = "1.0.0";
|
|
763
763
|
|
|
764
764
|
// src/donation/keyHandler.ts
|
|
765
765
|
var _utils = require('@noble/curves/abstract/utils'); var secpUtils = _interopRequireWildcard(_utils);
|
|
@@ -4687,17 +4687,12 @@ function toFHIRBundleEntries(signal) {
|
|
|
4687
4687
|
}
|
|
4688
4688
|
function toFHIRDocumentReference(signal, deviceUrn) {
|
|
4689
4689
|
var _a;
|
|
4690
|
-
const {
|
|
4690
|
+
const { data, annotation, type, deviceKey, deviceFullName, deviceShortName, version } = signal;
|
|
4691
4691
|
const entrySize = annotation.reduce((sum, { size }) => sum + size, 0);
|
|
4692
|
-
if (!
|
|
4693
|
-
console.error("[Recording Signal] Missing data
|
|
4692
|
+
if (!data) {
|
|
4693
|
+
console.error("[Recording Signal] Missing data for document reference");
|
|
4694
4694
|
return void 0;
|
|
4695
4695
|
}
|
|
4696
|
-
const data = items.flatMap((item) => {
|
|
4697
|
-
const dateBuffer = _2.Buffer.alloc(DEVICE_ANNOTATION_TIMESTAMP_SIZE);
|
|
4698
|
-
dateBuffer.writeUIntLE(item.date.getTime(), 0, DEVICE_ANNOTATION_TIMESTAMP_SIZE);
|
|
4699
|
-
return [...dateBuffer, ...item.value];
|
|
4700
|
-
});
|
|
4701
4696
|
return {
|
|
4702
4697
|
resourceType: "DocumentReference",
|
|
4703
4698
|
status: "current",
|