react-native-spike-sdk 4.5.23 → 4.7.13
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/android/build.gradle +1 -1
- package/android/src/main/java/com/spikesdk/SpikeMappers.kt +0 -46
- package/android/src/main/java/com/spikesdk/SpikeSdkModule.kt +50 -483
- package/ios/SpikeExceptionMapper.swift +4 -12
- package/ios/SpikeSdk.m +8 -79
- package/ios/SpikeSdk.swift +62 -419
- package/lib/commonjs/Spike.js +1 -57
- package/lib/commonjs/Spike.js.map +1 -1
- package/lib/commonjs/SpikeException.js +15 -94
- package/lib/commonjs/SpikeException.js.map +1 -1
- package/lib/commonjs/index.js +0 -71
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/v3/SpikeRNConnectionAPIv3.js +40 -17
- package/lib/commonjs/v3/SpikeRNConnectionAPIv3.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/Spike.js +1 -55
- package/lib/module/Spike.js.map +1 -1
- package/lib/module/SpikeException.js +14 -83
- package/lib/module/SpikeException.js.map +1 -1
- package/lib/module/index.js +3 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/v3/SpikeRNConnectionAPIv3.js +40 -17
- package/lib/module/v3/SpikeRNConnectionAPIv3.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/Spike.d.ts +2 -29
- package/lib/typescript/Spike.d.ts.map +1 -1
- package/lib/typescript/SpikeException.d.ts +5 -30
- package/lib/typescript/SpikeException.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +6 -25
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/v3/DataModels/BackgroundDeliveryConfig.d.ts +2 -0
- package/lib/typescript/v3/DataModels/BackgroundDeliveryConfig.d.ts.map +1 -1
- package/lib/typescript/v3/SpikeRNConnectionAPIv3.d.ts +34 -9
- package/lib/typescript/v3/SpikeRNConnectionAPIv3.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/Spike.ts +4 -89
- package/src/SpikeException.ts +13 -96
- package/src/index.ts +2 -61
- package/src/v3/DataModels/BackgroundDeliveryConfig.ts +2 -0
- package/src/v3/SpikeRNConnectionAPIv3.ts +82 -19
- package/src/version.ts +1 -1
- package/android/src/main/java/com/spikesdk/SpikeConnectionLogger.kt +0 -37
- package/ios/SpikeConnectionListener.swift +0 -17
- package/ios/SpikeConnectionLogger.swift +0 -43
- package/ios/SpikeDataTypeMapper.swift +0 -255
- package/lib/commonjs/DataModels/SpikeActivitiesStreamDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeActivitiesStreamDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeActivitiesSummaryDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeActivitiesSummaryDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeBodyDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeBodyDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeBreathingDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeBreathingDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeCaloriesDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeCaloriesDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeData.js +0 -6
- package/lib/commonjs/DataModels/SpikeData.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeDataTypes.js +0 -23
- package/lib/commonjs/DataModels/SpikeDataTypes.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeDistanceDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeDistanceDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeEcgDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeEcgDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeGlucoseDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeGlucoseDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeHeartDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeHeartDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeOxygenSaturationDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeOxygenSaturationDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeSleepDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeSleepDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeStepsDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeStepsDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeStepsIntradayDataEntry.js +0 -2
- package/lib/commonjs/DataModels/SpikeStepsIntradayDataEntry.js.map +0 -1
- package/lib/commonjs/DataModels/SpikeWebhookJob.js +0 -2
- package/lib/commonjs/DataModels/SpikeWebhookJob.js.map +0 -1
- package/lib/commonjs/DataTypes/SpikeDataType.js +0 -59
- package/lib/commonjs/DataTypes/SpikeDataType.js.map +0 -1
- package/lib/commonjs/SpikeBackgroundDeliveriesLogger.js +0 -2
- package/lib/commonjs/SpikeBackgroundDeliveriesLogger.js.map +0 -1
- package/lib/commonjs/SpikeConnection.js +0 -301
- package/lib/commonjs/SpikeConnection.js.map +0 -1
- package/lib/commonjs/SpikeConnectionTypes.js +0 -6
- package/lib/commonjs/SpikeConnectionTypes.js.map +0 -1
- package/lib/commonjs/SpikeLogger.js +0 -6
- package/lib/commonjs/SpikeLogger.js.map +0 -1
- package/lib/module/DataModels/SpikeActivitiesStreamDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeActivitiesStreamDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeActivitiesSummaryDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeActivitiesSummaryDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeBodyDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeBodyDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeBreathingDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeBreathingDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeCaloriesDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeCaloriesDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeData.js +0 -4
- package/lib/module/DataModels/SpikeData.js.map +0 -1
- package/lib/module/DataModels/SpikeDataTypes.js +0 -19
- package/lib/module/DataModels/SpikeDataTypes.js.map +0 -1
- package/lib/module/DataModels/SpikeDistanceDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeDistanceDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeEcgDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeEcgDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeGlucoseDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeGlucoseDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeHeartDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeHeartDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeOxygenSaturationDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeOxygenSaturationDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeSleepDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeSleepDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeStepsDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeStepsDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeStepsIntradayDataEntry.js +0 -2
- package/lib/module/DataModels/SpikeStepsIntradayDataEntry.js.map +0 -1
- package/lib/module/DataModels/SpikeWebhookJob.js +0 -2
- package/lib/module/DataModels/SpikeWebhookJob.js.map +0 -1
- package/lib/module/DataTypes/SpikeDataType.js +0 -42
- package/lib/module/DataTypes/SpikeDataType.js.map +0 -1
- package/lib/module/SpikeBackgroundDeliveriesLogger.js +0 -2
- package/lib/module/SpikeBackgroundDeliveriesLogger.js.map +0 -1
- package/lib/module/SpikeConnection.js +0 -296
- package/lib/module/SpikeConnection.js.map +0 -1
- package/lib/module/SpikeConnectionTypes.js +0 -4
- package/lib/module/SpikeConnectionTypes.js.map +0 -1
- package/lib/module/SpikeLogger.js +0 -4
- package/lib/module/SpikeLogger.js.map +0 -1
- package/lib/typescript/DataModels/SpikeActivitiesStreamDataEntry.d.ts +0 -66
- package/lib/typescript/DataModels/SpikeActivitiesStreamDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeActivitiesSummaryDataEntry.d.ts +0 -29
- package/lib/typescript/DataModels/SpikeActivitiesSummaryDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeBodyDataEntry.d.ts +0 -54
- package/lib/typescript/DataModels/SpikeBodyDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeBreathingDataEntry.d.ts +0 -13
- package/lib/typescript/DataModels/SpikeBreathingDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeCaloriesDataEntry.d.ts +0 -15
- package/lib/typescript/DataModels/SpikeCaloriesDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeData.d.ts +0 -27
- package/lib/typescript/DataModels/SpikeData.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeDataTypes.d.ts +0 -17
- package/lib/typescript/DataModels/SpikeDataTypes.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeDistanceDataEntry.d.ts +0 -13
- package/lib/typescript/DataModels/SpikeDistanceDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeEcgDataEntry.d.ts +0 -13
- package/lib/typescript/DataModels/SpikeEcgDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeGlucoseDataEntry.d.ts +0 -21
- package/lib/typescript/DataModels/SpikeGlucoseDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeHeartDataEntry.d.ts +0 -32
- package/lib/typescript/DataModels/SpikeHeartDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeOxygenSaturationDataEntry.d.ts +0 -15
- package/lib/typescript/DataModels/SpikeOxygenSaturationDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeSleepDataEntry.d.ts +0 -30
- package/lib/typescript/DataModels/SpikeSleepDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeStepsDataEntry.d.ts +0 -13
- package/lib/typescript/DataModels/SpikeStepsDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeStepsIntradayDataEntry.d.ts +0 -17
- package/lib/typescript/DataModels/SpikeStepsIntradayDataEntry.d.ts.map +0 -1
- package/lib/typescript/DataModels/SpikeWebhookJob.d.ts +0 -11
- package/lib/typescript/DataModels/SpikeWebhookJob.d.ts.map +0 -1
- package/lib/typescript/DataTypes/SpikeDataType.d.ts +0 -68
- package/lib/typescript/DataTypes/SpikeDataType.d.ts.map +0 -1
- package/lib/typescript/SpikeBackgroundDeliveriesLogger.d.ts +0 -4
- package/lib/typescript/SpikeBackgroundDeliveriesLogger.d.ts.map +0 -1
- package/lib/typescript/SpikeConnection.d.ts +0 -63
- package/lib/typescript/SpikeConnection.d.ts.map +0 -1
- package/lib/typescript/SpikeConnectionTypes.d.ts +0 -102
- package/lib/typescript/SpikeConnectionTypes.d.ts.map +0 -1
- package/lib/typescript/SpikeLogger.d.ts +0 -13
- package/lib/typescript/SpikeLogger.d.ts.map +0 -1
- package/src/DataModels/SpikeActivitiesStreamDataEntry.ts +0 -67
- package/src/DataModels/SpikeActivitiesSummaryDataEntry.ts +0 -28
- package/src/DataModels/SpikeBodyDataEntry.ts +0 -61
- package/src/DataModels/SpikeBreathingDataEntry.ts +0 -12
- package/src/DataModels/SpikeCaloriesDataEntry.ts +0 -13
- package/src/DataModels/SpikeData.ts +0 -38
- package/src/DataModels/SpikeDataTypes.ts +0 -31
- package/src/DataModels/SpikeDistanceDataEntry.ts +0 -12
- package/src/DataModels/SpikeEcgDataEntry.ts +0 -12
- package/src/DataModels/SpikeGlucoseDataEntry.ts +0 -20
- package/src/DataModels/SpikeHeartDataEntry.ts +0 -34
- package/src/DataModels/SpikeOxygenSaturationDataEntry.ts +0 -14
- package/src/DataModels/SpikeSleepDataEntry.ts +0 -29
- package/src/DataModels/SpikeStepsDataEntry.ts +0 -12
- package/src/DataModels/SpikeStepsIntradayDataEntry.ts +0 -16
- package/src/DataModels/SpikeWebhookJob.ts +0 -10
- package/src/DataTypes/SpikeDataType.ts +0 -93
- package/src/SpikeBackgroundDeliveriesLogger.ts +0 -3
- package/src/SpikeConnection.ts +0 -495
- package/src/SpikeConnectionTypes.ts +0 -124
- package/src/SpikeLogger.ts +0 -14
package/src/SpikeConnection.ts
DELETED
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
import { NativeEventEmitter, Platform } from 'react-native';
|
|
2
|
-
import { SpikeException, unwrapSpikeException } from './SpikeException';
|
|
3
|
-
import type { SpikeLogger } from './SpikeLogger';
|
|
4
|
-
import { SpikeSdk } from './SpikeSdk';
|
|
5
|
-
import type { SpikeData } from './DataModels/SpikeData';
|
|
6
|
-
import {
|
|
7
|
-
SpikeActivitiesStreamDataType,
|
|
8
|
-
SpikeActivitiesSummaryDataType,
|
|
9
|
-
SpikeBreathingDataType,
|
|
10
|
-
SpikeCaloriesDataType,
|
|
11
|
-
SpikeDistanceDataType,
|
|
12
|
-
SpikeGlucoseDataType,
|
|
13
|
-
SpikeHeartDataType,
|
|
14
|
-
SpikeOxygenSaturationDataType,
|
|
15
|
-
SpikeSleepDataType,
|
|
16
|
-
SpikeStepsDataType,
|
|
17
|
-
SpikeBodyDataType,
|
|
18
|
-
SpikeEcgDataType,
|
|
19
|
-
} from './DataTypes/SpikeDataType';
|
|
20
|
-
import type { SpikeWebhookJob } from './DataModels/SpikeWebhookJob';
|
|
21
|
-
import type { SpikeBackgroundDeliveriesLogger } from './SpikeBackgroundDeliveriesLogger';
|
|
22
|
-
import type { SpikeStepsDataEntry } from './DataModels/SpikeStepsDataEntry';
|
|
23
|
-
import type { SpikeSleepDataEntry } from './DataModels/SpikeSleepDataEntry';
|
|
24
|
-
import type { SpikeActivitiesSummaryDataEntry } from './DataModels/SpikeActivitiesSummaryDataEntry';
|
|
25
|
-
import type { SpikeActivitiesStreamDataEntry } from './DataModels/SpikeActivitiesStreamDataEntry';
|
|
26
|
-
import type { SpikeBreathingDataEntry } from './DataModels/SpikeBreathingDataEntry';
|
|
27
|
-
import type { SpikeCaloriesDataEntry } from './DataModels/SpikeCaloriesDataEntry';
|
|
28
|
-
import type { SpikeDistanceDataEntry } from './DataModels/SpikeDistanceDataEntry';
|
|
29
|
-
import type { SpikeGlucoseDataEntry } from './DataModels/SpikeGlucoseDataEntry';
|
|
30
|
-
import type { SpikeHeartDataEntry } from './DataModels/SpikeHeartDataEntry';
|
|
31
|
-
import type { SpikeOxygenSaturationDataEntry } from './DataModels/SpikeOxygenSaturationDataEntry';
|
|
32
|
-
import type { SpikeBodyDataEntry } from './DataModels/SpikeBodyDataEntry';
|
|
33
|
-
import type { SpikeEcgDataEntry } from './DataModels/SpikeEcgDataEntry';
|
|
34
|
-
import type {
|
|
35
|
-
SpikeDataType,
|
|
36
|
-
SpikeExtractConfigActivitiesStream,
|
|
37
|
-
SpikeExtractConfigActivitiesSummary,
|
|
38
|
-
SpikeExtractConfigBody,
|
|
39
|
-
SpikeExtractConfigBreathing,
|
|
40
|
-
SpikeExtractConfigCalories,
|
|
41
|
-
SpikeExtractConfigDistance,
|
|
42
|
-
SpikeExtractConfigEcg,
|
|
43
|
-
SpikeExtractConfigGlucose,
|
|
44
|
-
SpikeExtractConfigHeart,
|
|
45
|
-
SpikeExtractConfigOxygenSaturation,
|
|
46
|
-
SpikeExtractConfigSleep,
|
|
47
|
-
SpikeExtractConfigSteps,
|
|
48
|
-
SpikeExtractConfigVariations,
|
|
49
|
-
SpikeExtractResultVariations,
|
|
50
|
-
} from './SpikeConnectionTypes';
|
|
51
|
-
|
|
52
|
-
interface ILogEvent {
|
|
53
|
-
connectionUUID: string;
|
|
54
|
-
message: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
interface IBackgroundLog {
|
|
58
|
-
connectionUUID: string;
|
|
59
|
-
log: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type HealthConnectAvailability = 'installed' | 'notInstalled';
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated Use `SpikeRNConnectionAPIv3` instead. See https://docs.spikeapi.com/sdk-docs/react-native/usage-guide
|
|
66
|
-
*/
|
|
67
|
-
export class SpikeConnection {
|
|
68
|
-
private logEventListener: NativeEventEmitter | undefined;
|
|
69
|
-
private eventListener: NativeEventEmitter | undefined;
|
|
70
|
-
|
|
71
|
-
private backgroundLogger: SpikeBackgroundDeliveriesLogger | null = null;
|
|
72
|
-
|
|
73
|
-
protected connectionUUID: string;
|
|
74
|
-
protected logger: SpikeLogger | null = null;
|
|
75
|
-
|
|
76
|
-
toString() {
|
|
77
|
-
return 'This is wrapper class. To get connection data use `getAppId()`, `getSpikeEndUserId()`, `getCustomerEndUserId()` methods.';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
toJSON(): string {
|
|
81
|
-
return JSON.stringify({
|
|
82
|
-
warning:
|
|
83
|
-
'This is wrapper class. To get connection data use `getAppId()`, `getSpikeEndUserId()`, `getCustomerEndUserId()` methods.',
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
constructor(connectionUUID: string, logger: SpikeLogger | null = null) {
|
|
88
|
-
this.connectionUUID = connectionUUID;
|
|
89
|
-
this.setupLogger(logger);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async manageHealthConnect(): Promise<void> {
|
|
93
|
-
if (Platform.OS !== 'android') return;
|
|
94
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
return await SpikeSdk.manageHealthConnect(this.connectionUUID);
|
|
98
|
-
} catch (error) {
|
|
99
|
-
throw unwrapSpikeException(error);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
async checkPermissionsGranted(dataTypes: SpikeDataType): Promise<boolean> {
|
|
104
|
-
if (Platform.OS !== 'android') return false;
|
|
105
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
return await SpikeSdk.checkPermissionsGranted(
|
|
109
|
-
this.connectionUUID,
|
|
110
|
-
dataTypes.rawValue
|
|
111
|
-
);
|
|
112
|
-
} catch (error) {
|
|
113
|
-
throw unwrapSpikeException(error);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
async requestHealthPermissions(
|
|
118
|
-
dataTypes: SpikeDataType | SpikeDataType[]
|
|
119
|
-
): Promise<void> {
|
|
120
|
-
if (Platform.OS !== 'android') return;
|
|
121
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
122
|
-
|
|
123
|
-
if (Array.isArray(dataTypes)) {
|
|
124
|
-
try {
|
|
125
|
-
return await SpikeSdk.requestMultipleHealthPermissions(
|
|
126
|
-
this.connectionUUID,
|
|
127
|
-
dataTypes.map((type) => type.rawValue)
|
|
128
|
-
);
|
|
129
|
-
} catch (error) {
|
|
130
|
-
throw unwrapSpikeException(error);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
try {
|
|
135
|
-
return await SpikeSdk.requestHealthPermissions(
|
|
136
|
-
this.connectionUUID,
|
|
137
|
-
dataTypes.rawValue
|
|
138
|
-
);
|
|
139
|
-
} catch (error) {
|
|
140
|
-
throw unwrapSpikeException(error);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async revokeAllPermissions(): Promise<void> {
|
|
145
|
-
if (Platform.OS !== 'android') return;
|
|
146
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
147
|
-
|
|
148
|
-
try {
|
|
149
|
-
return await SpikeSdk.revokeAllPermissions(this.connectionUUID);
|
|
150
|
-
} catch (error) {
|
|
151
|
-
throw unwrapSpikeException(error);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async getHealthConnectAvailability(): Promise<HealthConnectAvailability> {
|
|
156
|
-
if (Platform.OS !== 'android') return 'notInstalled';
|
|
157
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
158
|
-
|
|
159
|
-
try {
|
|
160
|
-
return await SpikeSdk.getHealthConnectAvailability(this.connectionUUID);
|
|
161
|
-
} catch (error) {
|
|
162
|
-
throw unwrapSpikeException(error);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
async getAppId(): Promise<string> {
|
|
167
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
return await SpikeSdk.getAppId(this.connectionUUID);
|
|
171
|
-
} catch (error) {
|
|
172
|
-
throw unwrapSpikeException(error);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
async getSpikeEndUserId(): Promise<string> {
|
|
177
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
return await SpikeSdk.getSpikeEndUserId(this.connectionUUID);
|
|
181
|
-
} catch (error) {
|
|
182
|
-
throw unwrapSpikeException(error);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
async getCustomerEndUserId(): Promise<string> {
|
|
187
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
188
|
-
|
|
189
|
-
try {
|
|
190
|
-
return await SpikeSdk.getCustomerEndUserId(this.connectionUUID);
|
|
191
|
-
} catch (error) {
|
|
192
|
-
throw unwrapSpikeException(error);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
async getCallbackUrl(): Promise<string> {
|
|
197
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
198
|
-
|
|
199
|
-
try {
|
|
200
|
-
return await SpikeSdk.getCallbackUrl(this.connectionUUID);
|
|
201
|
-
} catch (error) {
|
|
202
|
-
throw unwrapSpikeException(error);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
async close(): Promise<void> {
|
|
207
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
208
|
-
|
|
209
|
-
try {
|
|
210
|
-
await SpikeSdk.close(this.connectionUUID);
|
|
211
|
-
this.removeListeners();
|
|
212
|
-
} catch (error) {
|
|
213
|
-
throw unwrapSpikeException(error);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
async extractData(
|
|
218
|
-
config: SpikeExtractConfigActivitiesSummary
|
|
219
|
-
): Promise<SpikeData<SpikeActivitiesSummaryDataEntry>>;
|
|
220
|
-
async extractData(
|
|
221
|
-
config: SpikeExtractConfigActivitiesStream
|
|
222
|
-
): Promise<SpikeData<SpikeActivitiesStreamDataEntry>>;
|
|
223
|
-
async extractData(
|
|
224
|
-
config: SpikeExtractConfigBreathing
|
|
225
|
-
): Promise<SpikeData<SpikeBreathingDataEntry>>;
|
|
226
|
-
async extractData(
|
|
227
|
-
config: SpikeExtractConfigCalories
|
|
228
|
-
): Promise<SpikeData<SpikeCaloriesDataEntry>>;
|
|
229
|
-
async extractData(
|
|
230
|
-
config: SpikeExtractConfigDistance
|
|
231
|
-
): Promise<SpikeData<SpikeDistanceDataEntry>>;
|
|
232
|
-
async extractData(
|
|
233
|
-
config: SpikeExtractConfigGlucose
|
|
234
|
-
): Promise<SpikeData<SpikeGlucoseDataEntry>>;
|
|
235
|
-
async extractData(
|
|
236
|
-
config: SpikeExtractConfigHeart
|
|
237
|
-
): Promise<SpikeData<SpikeHeartDataEntry>>;
|
|
238
|
-
async extractData(
|
|
239
|
-
config: SpikeExtractConfigOxygenSaturation
|
|
240
|
-
): Promise<SpikeData<SpikeOxygenSaturationDataEntry>>;
|
|
241
|
-
async extractData(
|
|
242
|
-
config: SpikeExtractConfigSleep
|
|
243
|
-
): Promise<SpikeData<SpikeSleepDataEntry>>;
|
|
244
|
-
async extractData(
|
|
245
|
-
config: SpikeExtractConfigSteps
|
|
246
|
-
): Promise<SpikeData<SpikeStepsDataEntry>>;
|
|
247
|
-
async extractData(
|
|
248
|
-
config: SpikeExtractConfigBody
|
|
249
|
-
): Promise<SpikeData<SpikeBodyDataEntry>>;
|
|
250
|
-
async extractData(
|
|
251
|
-
config: SpikeExtractConfigEcg
|
|
252
|
-
): Promise<SpikeData<SpikeEcgDataEntry>>;
|
|
253
|
-
async extractData(
|
|
254
|
-
config: SpikeExtractConfigVariations
|
|
255
|
-
): Promise<SpikeExtractResultVariations> {
|
|
256
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
257
|
-
|
|
258
|
-
if (Platform.OS === 'android' && config.dataType.rawValue === 'ecg') {
|
|
259
|
-
let dateFrom: Date
|
|
260
|
-
let dateTo: Date
|
|
261
|
-
let collectedAt: Date = new Date()
|
|
262
|
-
|
|
263
|
-
if ('from' in config) {
|
|
264
|
-
dateFrom = config.from
|
|
265
|
-
dateTo = config.to
|
|
266
|
-
} else {
|
|
267
|
-
dateFrom = new Date()
|
|
268
|
-
dateTo = new Date()
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
const result: SpikeData<SpikeEcgDataEntry> = {
|
|
272
|
-
dateFrom: dateFrom.toISOString(),
|
|
273
|
-
dateTo: dateTo.toISOString(),
|
|
274
|
-
collectedAt: collectedAt.toISOString(),
|
|
275
|
-
endUserId: await this.getSpikeEndUserId(),
|
|
276
|
-
sources: [{
|
|
277
|
-
name: 'android',
|
|
278
|
-
isSuccess: false,
|
|
279
|
-
message: 'No ECG data on android health connect'
|
|
280
|
-
}],
|
|
281
|
-
entries: []
|
|
282
|
-
}
|
|
283
|
-
return result
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
try {
|
|
287
|
-
let json: string = '';
|
|
288
|
-
|
|
289
|
-
if ('from' in config) {
|
|
290
|
-
json = await SpikeSdk.extractDataInRange(
|
|
291
|
-
this.connectionUUID,
|
|
292
|
-
config.dataType.rawValue,
|
|
293
|
-
config.from.getTime(),
|
|
294
|
-
config.to.getTime()
|
|
295
|
-
);
|
|
296
|
-
} else {
|
|
297
|
-
json = await SpikeSdk.extractData(
|
|
298
|
-
this.connectionUUID,
|
|
299
|
-
config.dataType.rawValue
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
const data = JSON.parse(json);
|
|
304
|
-
return data;
|
|
305
|
-
} catch (error) {
|
|
306
|
-
throw unwrapSpikeException(error);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
async extractAndPostData(
|
|
311
|
-
config: SpikeExtractConfigVariations
|
|
312
|
-
): Promise<SpikeWebhookJob> {
|
|
313
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
314
|
-
|
|
315
|
-
if (Platform.OS === 'android' && config.dataType.rawValue === 'ecg') {
|
|
316
|
-
let dateFrom: Date
|
|
317
|
-
let dateTo: Date
|
|
318
|
-
let collectedAt: Date = new Date()
|
|
319
|
-
|
|
320
|
-
if ('from' in config) {
|
|
321
|
-
dateFrom = config.from
|
|
322
|
-
dateTo = config.to
|
|
323
|
-
} else {
|
|
324
|
-
dateFrom = new Date()
|
|
325
|
-
dateTo = new Date()
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
const result: SpikeWebhookJob = {
|
|
329
|
-
dataType: config.dataType.rawValue,
|
|
330
|
-
payloadSize: 0,
|
|
331
|
-
callbackUrl: new URL(await this.getCallbackUrl()),
|
|
332
|
-
dateFrom: dateFrom,
|
|
333
|
-
dateTo: dateTo,
|
|
334
|
-
collectedAt: collectedAt
|
|
335
|
-
}
|
|
336
|
-
return result
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
try {
|
|
340
|
-
let json: string = '';
|
|
341
|
-
|
|
342
|
-
if ('from' in config) {
|
|
343
|
-
json = await SpikeSdk.extractAndPostDataInRange(
|
|
344
|
-
this.connectionUUID,
|
|
345
|
-
config.dataType.rawValue,
|
|
346
|
-
config.from.getTime(),
|
|
347
|
-
config.to.getTime()
|
|
348
|
-
);
|
|
349
|
-
} else {
|
|
350
|
-
json = await SpikeSdk.extractAndPostData(
|
|
351
|
-
this.connectionUUID,
|
|
352
|
-
config.dataType.rawValue
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
const data: SpikeWebhookJob = JSON.parse(json);
|
|
357
|
-
return data;
|
|
358
|
-
} catch (error) {
|
|
359
|
-
throw unwrapSpikeException(error);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
async enableBackgroundDelivery(dataTypes: SpikeDataType[]): Promise<void> {
|
|
364
|
-
if (Platform.OS !== 'ios') return;
|
|
365
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
366
|
-
|
|
367
|
-
try {
|
|
368
|
-
await SpikeSdk.enableBackgroundDelivery(
|
|
369
|
-
this.connectionUUID,
|
|
370
|
-
dataTypes.map((type) => type.rawValue)
|
|
371
|
-
);
|
|
372
|
-
} catch (error) {
|
|
373
|
-
throw unwrapSpikeException(error);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
async getBackgroundDeliveryDataTypes(): Promise<SpikeDataType[]> {
|
|
378
|
-
if (Platform.OS !== 'ios') return [];
|
|
379
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
380
|
-
|
|
381
|
-
const dataTypes: string[] = await SpikeSdk.getBackgroundDeliveryDataTypes(
|
|
382
|
-
this.connectionUUID
|
|
383
|
-
);
|
|
384
|
-
return dataTypes.map((type) => this.convertDataType(type));
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
async setListener(
|
|
388
|
-
listener: SpikeBackgroundDeliveriesLogger | null
|
|
389
|
-
): Promise<void> {
|
|
390
|
-
if (Platform.OS !== 'ios') return;
|
|
391
|
-
if (!SpikeSdk) throw new SpikeException();
|
|
392
|
-
|
|
393
|
-
try {
|
|
394
|
-
this.setupListener(listener);
|
|
395
|
-
await SpikeSdk.setListener(this.connectionUUID);
|
|
396
|
-
} catch (error) {
|
|
397
|
-
throw unwrapSpikeException(error);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
private setupLogger(logger: SpikeLogger | null) {
|
|
402
|
-
if (!SpikeSdk) return;
|
|
403
|
-
|
|
404
|
-
this.removeLogger();
|
|
405
|
-
|
|
406
|
-
if (!logger) return;
|
|
407
|
-
|
|
408
|
-
this.logEventListener = new NativeEventEmitter(SpikeSdk);
|
|
409
|
-
this.logger = logger;
|
|
410
|
-
|
|
411
|
-
this.logEventListener?.addListener('onDebug', (data: ILogEvent) => {
|
|
412
|
-
if (this.connectionUUID !== data.connectionUUID) return;
|
|
413
|
-
if (logger?.isDebugEnabled() === true) {
|
|
414
|
-
logger?.debug(this, data.message);
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
this.logEventListener?.addListener('onInfo', (data: ILogEvent) => {
|
|
419
|
-
if (!!logger && this.connectionUUID !== data.connectionUUID) return;
|
|
420
|
-
if (logger?.isInfoEnabled() === true) {
|
|
421
|
-
logger?.info(this, data.message);
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
this.logEventListener?.addListener('onError', (data: ILogEvent) => {
|
|
426
|
-
if (this.connectionUUID !== data.connectionUUID) return;
|
|
427
|
-
if (logger?.isErrorEnabled() === true) {
|
|
428
|
-
logger?.error(this, data.message);
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
private removeLogger() {
|
|
434
|
-
if (!this.logEventListener) return;
|
|
435
|
-
|
|
436
|
-
this.logEventListener.removeAllListeners('onDebug');
|
|
437
|
-
this.logEventListener.removeAllListeners('onInfo');
|
|
438
|
-
this.logEventListener.removeAllListeners('onError');
|
|
439
|
-
this.logEventListener = undefined;
|
|
440
|
-
this.logger = null;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
private setupListener(listener: SpikeBackgroundDeliveriesLogger | null) {
|
|
444
|
-
if (!SpikeSdk) return;
|
|
445
|
-
|
|
446
|
-
this.removeListeners();
|
|
447
|
-
|
|
448
|
-
this.eventListener = new NativeEventEmitter(SpikeSdk);
|
|
449
|
-
this.backgroundLogger = listener;
|
|
450
|
-
|
|
451
|
-
this.eventListener?.addListener(
|
|
452
|
-
'onBackgroundLog',
|
|
453
|
-
(data: IBackgroundLog) => {
|
|
454
|
-
if (this.connectionUUID !== data.connectionUUID) return;
|
|
455
|
-
this.backgroundLogger?.onBackgroundLog(data.log);
|
|
456
|
-
}
|
|
457
|
-
);
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
private removeListeners() {
|
|
461
|
-
if (!this.eventListener) return;
|
|
462
|
-
|
|
463
|
-
this.eventListener.removeAllListeners('onBackgroundLog');
|
|
464
|
-
this.eventListener = undefined;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
private convertDataType(dataType: string): SpikeDataType {
|
|
468
|
-
if (dataType === 'activities_summary') {
|
|
469
|
-
return new SpikeActivitiesSummaryDataType();
|
|
470
|
-
} else if (dataType === 'activities_stream') {
|
|
471
|
-
return new SpikeActivitiesStreamDataType();
|
|
472
|
-
} else if (dataType === 'breathing') {
|
|
473
|
-
return new SpikeBreathingDataType();
|
|
474
|
-
} else if (dataType === 'calories') {
|
|
475
|
-
return new SpikeCaloriesDataType();
|
|
476
|
-
} else if (dataType === 'distance') {
|
|
477
|
-
return new SpikeDistanceDataType();
|
|
478
|
-
} else if (dataType === 'glucose') {
|
|
479
|
-
return new SpikeGlucoseDataType();
|
|
480
|
-
} else if (dataType === 'heart') {
|
|
481
|
-
return new SpikeHeartDataType();
|
|
482
|
-
} else if (dataType === 'oxygen_saturation') {
|
|
483
|
-
return new SpikeOxygenSaturationDataType();
|
|
484
|
-
} else if (dataType === 'sleep') {
|
|
485
|
-
return new SpikeSleepDataType();
|
|
486
|
-
} else if (dataType === 'steps') {
|
|
487
|
-
return new SpikeStepsDataType();
|
|
488
|
-
} else if (dataType === 'body') {
|
|
489
|
-
return new SpikeBodyDataType();
|
|
490
|
-
} else if (dataType === 'ecg') {
|
|
491
|
-
return new SpikeEcgDataType();
|
|
492
|
-
}
|
|
493
|
-
return new SpikeStepsDataType();
|
|
494
|
-
}
|
|
495
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { SpikeActivitiesStreamDataEntry } from './DataModels/SpikeActivitiesStreamDataEntry';
|
|
2
|
-
import type { SpikeActivitiesSummaryDataEntry } from './DataModels/SpikeActivitiesSummaryDataEntry';
|
|
3
|
-
import type { SpikeBodyDataEntry } from './DataModels/SpikeBodyDataEntry';
|
|
4
|
-
import type { SpikeBreathingDataEntry } from './DataModels/SpikeBreathingDataEntry';
|
|
5
|
-
import type { SpikeCaloriesDataEntry } from './DataModels/SpikeCaloriesDataEntry';
|
|
6
|
-
import type { SpikeData } from './DataModels/SpikeData';
|
|
7
|
-
import type { SpikeDistanceDataEntry } from './DataModels/SpikeDistanceDataEntry';
|
|
8
|
-
import type { SpikeEcgDataEntry } from './DataModels/SpikeEcgDataEntry';
|
|
9
|
-
import type { SpikeGlucoseDataEntry } from './DataModels/SpikeGlucoseDataEntry';
|
|
10
|
-
import type { SpikeHeartDataEntry } from './DataModels/SpikeHeartDataEntry';
|
|
11
|
-
import type { SpikeOxygenSaturationDataEntry } from './DataModels/SpikeOxygenSaturationDataEntry';
|
|
12
|
-
import type { SpikeSleepDataEntry } from './DataModels/SpikeSleepDataEntry';
|
|
13
|
-
import type { SpikeStepsDataEntry } from './DataModels/SpikeStepsDataEntry';
|
|
14
|
-
|
|
15
|
-
import type {
|
|
16
|
-
SpikeActivitiesStreamDataType,
|
|
17
|
-
SpikeActivitiesSummaryDataType,
|
|
18
|
-
SpikeBreathingDataType,
|
|
19
|
-
SpikeCaloriesDataType,
|
|
20
|
-
SpikeDistanceDataType,
|
|
21
|
-
SpikeGlucoseDataType,
|
|
22
|
-
SpikeHeartDataType,
|
|
23
|
-
SpikeOxygenSaturationDataType,
|
|
24
|
-
SpikeSleepDataType,
|
|
25
|
-
SpikeStepsDataType,
|
|
26
|
-
SpikeBodyDataType,
|
|
27
|
-
SpikeEcgDataType,
|
|
28
|
-
SpikeStepsIntradayDataType,
|
|
29
|
-
} from './DataTypes/SpikeDataType';
|
|
30
|
-
|
|
31
|
-
export type SpikeExtractConfigActivitiesSummary =
|
|
32
|
-
| { dataType: SpikeActivitiesSummaryDataType }
|
|
33
|
-
| {
|
|
34
|
-
dataType: SpikeActivitiesSummaryDataType;
|
|
35
|
-
from: Date;
|
|
36
|
-
to: Date;
|
|
37
|
-
};
|
|
38
|
-
export type SpikeExtractConfigActivitiesStream =
|
|
39
|
-
| { dataType: SpikeActivitiesStreamDataType }
|
|
40
|
-
| {
|
|
41
|
-
dataType: SpikeActivitiesStreamDataType;
|
|
42
|
-
from: Date;
|
|
43
|
-
to: Date;
|
|
44
|
-
};
|
|
45
|
-
export type SpikeExtractConfigBreathing =
|
|
46
|
-
| { dataType: SpikeBreathingDataType }
|
|
47
|
-
| { dataType: SpikeBreathingDataType; from: Date; to: Date };
|
|
48
|
-
export type SpikeExtractConfigCalories =
|
|
49
|
-
| { dataType: SpikeCaloriesDataType }
|
|
50
|
-
| { dataType: SpikeCaloriesDataType; from: Date; to: Date };
|
|
51
|
-
export type SpikeExtractConfigDistance =
|
|
52
|
-
| { dataType: SpikeDistanceDataType }
|
|
53
|
-
| { dataType: SpikeDistanceDataType; from: Date; to: Date };
|
|
54
|
-
export type SpikeExtractConfigGlucose =
|
|
55
|
-
| { dataType: SpikeGlucoseDataType }
|
|
56
|
-
| { dataType: SpikeGlucoseDataType; from: Date; to: Date };
|
|
57
|
-
export type SpikeExtractConfigHeart =
|
|
58
|
-
| { dataType: SpikeHeartDataType }
|
|
59
|
-
| { dataType: SpikeHeartDataType; from: Date; to: Date };
|
|
60
|
-
export type SpikeExtractConfigOxygenSaturation =
|
|
61
|
-
| { dataType: SpikeOxygenSaturationDataType }
|
|
62
|
-
| {
|
|
63
|
-
dataType: SpikeOxygenSaturationDataType;
|
|
64
|
-
from: Date;
|
|
65
|
-
to: Date;
|
|
66
|
-
};
|
|
67
|
-
export type SpikeExtractConfigSleep =
|
|
68
|
-
| { dataType: SpikeSleepDataType }
|
|
69
|
-
| { dataType: SpikeSleepDataType; from: Date; to: Date };
|
|
70
|
-
export type SpikeExtractConfigSteps =
|
|
71
|
-
| { dataType: SpikeStepsDataType }
|
|
72
|
-
| { dataType: SpikeStepsDataType; from: Date; to: Date };
|
|
73
|
-
export type SpikeExtractConfigBody =
|
|
74
|
-
| { dataType: SpikeBodyDataType }
|
|
75
|
-
| { dataType: SpikeBodyDataType; from: Date; to: Date };
|
|
76
|
-
export type SpikeExtractConfigEcg =
|
|
77
|
-
| { dataType: SpikeEcgDataType }
|
|
78
|
-
| { dataType: SpikeEcgDataType; from: Date; to: Date };
|
|
79
|
-
|
|
80
|
-
export type SpikeExtractConfigVariations =
|
|
81
|
-
| SpikeExtractConfigActivitiesSummary
|
|
82
|
-
| SpikeExtractConfigActivitiesStream
|
|
83
|
-
| SpikeExtractConfigBreathing
|
|
84
|
-
| SpikeExtractConfigCalories
|
|
85
|
-
| SpikeExtractConfigDistance
|
|
86
|
-
| SpikeExtractConfigGlucose
|
|
87
|
-
| SpikeExtractConfigHeart
|
|
88
|
-
| SpikeExtractConfigOxygenSaturation
|
|
89
|
-
| SpikeExtractConfigSleep
|
|
90
|
-
| SpikeExtractConfigSteps
|
|
91
|
-
| SpikeExtractConfigBody
|
|
92
|
-
| SpikeExtractConfigEcg
|
|
93
|
-
;
|
|
94
|
-
|
|
95
|
-
export type SpikeExtractResultVariations =
|
|
96
|
-
| SpikeData<SpikeActivitiesSummaryDataEntry>
|
|
97
|
-
| SpikeData<SpikeActivitiesStreamDataEntry>
|
|
98
|
-
| SpikeData<SpikeBreathingDataEntry>
|
|
99
|
-
| SpikeData<SpikeCaloriesDataEntry>
|
|
100
|
-
| SpikeData<SpikeDistanceDataEntry>
|
|
101
|
-
| SpikeData<SpikeGlucoseDataEntry>
|
|
102
|
-
| SpikeData<SpikeHeartDataEntry>
|
|
103
|
-
| SpikeData<SpikeOxygenSaturationDataEntry>
|
|
104
|
-
| SpikeData<SpikeSleepDataEntry>
|
|
105
|
-
| SpikeData<SpikeStepsDataEntry>
|
|
106
|
-
| SpikeData<SpikeBodyDataEntry>
|
|
107
|
-
| SpikeData<SpikeEcgDataEntry>
|
|
108
|
-
;
|
|
109
|
-
|
|
110
|
-
export type SpikeDataType =
|
|
111
|
-
| SpikeActivitiesSummaryDataType
|
|
112
|
-
| SpikeActivitiesStreamDataType
|
|
113
|
-
| SpikeBreathingDataType
|
|
114
|
-
| SpikeCaloriesDataType
|
|
115
|
-
| SpikeDistanceDataType
|
|
116
|
-
| SpikeGlucoseDataType
|
|
117
|
-
| SpikeHeartDataType
|
|
118
|
-
| SpikeOxygenSaturationDataType
|
|
119
|
-
| SpikeSleepDataType
|
|
120
|
-
| SpikeStepsDataType
|
|
121
|
-
| SpikeStepsIntradayDataType
|
|
122
|
-
| SpikeBodyDataType
|
|
123
|
-
| SpikeEcgDataType
|
|
124
|
-
;
|
package/src/SpikeLogger.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SpikeConnection } from './SpikeConnection';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Deprecated. See https://docs.spikeapi.com/sdk-docs/react-native/usage-guide
|
|
5
|
-
*/
|
|
6
|
-
export interface SpikeLogger {
|
|
7
|
-
isDebugEnabled: () => boolean;
|
|
8
|
-
isInfoEnabled: () => boolean;
|
|
9
|
-
isErrorEnabled: () => boolean;
|
|
10
|
-
|
|
11
|
-
debug: (connection: SpikeConnection, message: string) => void;
|
|
12
|
-
info: (connection: SpikeConnection, message: string) => void;
|
|
13
|
-
error: (connection: SpikeConnection, message: string) => void;
|
|
14
|
-
}
|