react-native-spike-sdk 4.6.13 → 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 +1 -476
- package/ios/SpikeExceptionMapper.swift +4 -12
- package/ios/SpikeSdk.m +0 -79
- package/ios/SpikeSdk.swift +7 -417
- 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/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/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 +4 -24
- package/lib/typescript/index.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 +0 -61
- 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
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import SpikeSDK
|
|
3
|
-
|
|
4
|
-
class SpikeDataTypeMapper {
|
|
5
|
-
|
|
6
|
-
static func mapDataType(_ dataType: String) -> any SpikeDataType {
|
|
7
|
-
switch dataType {
|
|
8
|
-
case "activities_summary":
|
|
9
|
-
return SpikeDataTypes.activitiesSummary
|
|
10
|
-
case "activities_stream":
|
|
11
|
-
return SpikeDataTypes.activitiesStream
|
|
12
|
-
case "breathing":
|
|
13
|
-
return SpikeDataTypes.breathing
|
|
14
|
-
case "calories":
|
|
15
|
-
return SpikeDataTypes.calories
|
|
16
|
-
case "distance":
|
|
17
|
-
return SpikeDataTypes.distance
|
|
18
|
-
case "glucose":
|
|
19
|
-
return SpikeDataTypes.glucose
|
|
20
|
-
case "heart":
|
|
21
|
-
return SpikeDataTypes.heart
|
|
22
|
-
case "oxygen_saturation":
|
|
23
|
-
return SpikeDataTypes.oxygenSaturation
|
|
24
|
-
case "sleep":
|
|
25
|
-
return SpikeDataTypes.sleep
|
|
26
|
-
case "steps":
|
|
27
|
-
return SpikeDataTypes.steps
|
|
28
|
-
case "steps_intraday":
|
|
29
|
-
return SpikeDataTypes.stepsIntraday
|
|
30
|
-
case "body":
|
|
31
|
-
return SpikeDataTypes.body
|
|
32
|
-
case "ecg":
|
|
33
|
-
return SpikeDataTypes.ecg
|
|
34
|
-
default:
|
|
35
|
-
return SpikeDataTypes.activitiesSummary
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static func mapDataTypeToString(_ dataType: any SpikeDataType) -> String {
|
|
40
|
-
switch dataType {
|
|
41
|
-
case is SpikeActivitiesSummaryDataType:
|
|
42
|
-
return "activities_summary"
|
|
43
|
-
case is SpikeActivitiesStreamDataType:
|
|
44
|
-
return "activities_stream"
|
|
45
|
-
case is SpikeBreathingDataType:
|
|
46
|
-
return "breathing"
|
|
47
|
-
case is SpikeCaloriesDataType:
|
|
48
|
-
return "calories"
|
|
49
|
-
case is SpikeDistanceDataType:
|
|
50
|
-
return "distance"
|
|
51
|
-
case is SpikeGlucoseDataType:
|
|
52
|
-
return "glucose"
|
|
53
|
-
case is SpikeHeartDataType:
|
|
54
|
-
return "heart"
|
|
55
|
-
case is SpikeOxygenSaturationDataType:
|
|
56
|
-
return "oxygen_saturation"
|
|
57
|
-
case is SpikeSleepDataType:
|
|
58
|
-
return "sleep"
|
|
59
|
-
case is SpikeStepsDataType:
|
|
60
|
-
return "steps"
|
|
61
|
-
case is SpikeStepsIntradayDataType:
|
|
62
|
-
return "steps_intraday"
|
|
63
|
-
case is SpikeBodyDataType:
|
|
64
|
-
return "body"
|
|
65
|
-
case is SpikeECGDataType:
|
|
66
|
-
return "ecg"
|
|
67
|
-
default:
|
|
68
|
-
return "activities_summary"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
static func extractData(_ dataType: String, connection: SpikeConnection) async throws -> String? {
|
|
73
|
-
switch dataType {
|
|
74
|
-
case "activities_summary":
|
|
75
|
-
let value = try await connection.extractData(SpikeDataTypes.activitiesSummary)
|
|
76
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
77
|
-
case "activities_stream":
|
|
78
|
-
let value = try await connection.extractData(SpikeDataTypes.activitiesStream)
|
|
79
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
80
|
-
case "breathing":
|
|
81
|
-
let value = try await connection.extractData(SpikeDataTypes.breathing)
|
|
82
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
83
|
-
case "calories":
|
|
84
|
-
let value = try await connection.extractData(SpikeDataTypes.calories)
|
|
85
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
86
|
-
case "distance":
|
|
87
|
-
let value = try await connection.extractData(SpikeDataTypes.distance)
|
|
88
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
89
|
-
case "glucose":
|
|
90
|
-
let value = try await connection.extractData(SpikeDataTypes.glucose)
|
|
91
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
92
|
-
case "heart":
|
|
93
|
-
let value = try await connection.extractData(SpikeDataTypes.heart)
|
|
94
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
95
|
-
case "oxygen_saturation":
|
|
96
|
-
let value = try await connection.extractData(SpikeDataTypes.oxygenSaturation)
|
|
97
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
98
|
-
case "sleep":
|
|
99
|
-
let value = try await connection.extractData(SpikeDataTypes.sleep)
|
|
100
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
101
|
-
case "steps":
|
|
102
|
-
let value = try await connection.extractData(SpikeDataTypes.steps)
|
|
103
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
104
|
-
case "steps_intraday":
|
|
105
|
-
let value = try await connection.extractData(SpikeDataTypes.stepsIntraday)
|
|
106
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
107
|
-
case "body":
|
|
108
|
-
let value = try await connection.extractData(SpikeDataTypes.body)
|
|
109
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
110
|
-
case "ecg":
|
|
111
|
-
let value = try await connection.extractData(SpikeDataTypes.ecg)
|
|
112
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
113
|
-
default:
|
|
114
|
-
return nil
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
static func extractDataInRange(_ dataType: String, connection: SpikeConnection, from: Date, to: Date) async throws -> String? {
|
|
119
|
-
switch dataType {
|
|
120
|
-
case "activities_summary":
|
|
121
|
-
let value = try await connection.extractData(SpikeDataTypes.activitiesSummary, from: from, to: to)
|
|
122
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
123
|
-
case "activities_stream":
|
|
124
|
-
let value = try await connection.extractData(SpikeDataTypes.activitiesStream, from: from, to: to)
|
|
125
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
126
|
-
case "breathing":
|
|
127
|
-
let value = try await connection.extractData(SpikeDataTypes.breathing, from: from, to: to)
|
|
128
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
129
|
-
case "calories":
|
|
130
|
-
let value = try await connection.extractData(SpikeDataTypes.calories, from: from, to: to)
|
|
131
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
132
|
-
case "distance":
|
|
133
|
-
let value = try await connection.extractData(SpikeDataTypes.distance, from: from, to: to)
|
|
134
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
135
|
-
case "glucose":
|
|
136
|
-
let value = try await connection.extractData(SpikeDataTypes.glucose, from: from, to: to)
|
|
137
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
138
|
-
case "heart":
|
|
139
|
-
let value = try await connection.extractData(SpikeDataTypes.heart, from: from, to: to)
|
|
140
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
141
|
-
case "oxygen_saturation":
|
|
142
|
-
let value = try await connection.extractData(SpikeDataTypes.oxygenSaturation, from: from, to: to)
|
|
143
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
144
|
-
case "sleep":
|
|
145
|
-
let value = try await connection.extractData(SpikeDataTypes.sleep, from: from, to: to)
|
|
146
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
147
|
-
case "steps":
|
|
148
|
-
let value = try await connection.extractData(SpikeDataTypes.steps, from: from, to: to)
|
|
149
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
150
|
-
case "steps_intraday":
|
|
151
|
-
let value = try await connection.extractData(SpikeDataTypes.stepsIntraday, from: from, to: to)
|
|
152
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
153
|
-
case "body":
|
|
154
|
-
let value = try await connection.extractData(SpikeDataTypes.body, from: from, to: to)
|
|
155
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
156
|
-
case "ecg":
|
|
157
|
-
let value = try await connection.extractData(SpikeDataTypes.ecg, from: from, to: to)
|
|
158
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
159
|
-
default:
|
|
160
|
-
return nil
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
static func extractAndPostData(_ dataType: String, connection: SpikeConnection) async throws -> String? {
|
|
165
|
-
switch dataType {
|
|
166
|
-
case "activities_summary":
|
|
167
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.activitiesSummary)
|
|
168
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
169
|
-
case "activities_stream":
|
|
170
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.activitiesStream)
|
|
171
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
172
|
-
case "breathing":
|
|
173
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.breathing)
|
|
174
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
175
|
-
case "calories":
|
|
176
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.calories)
|
|
177
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
178
|
-
case "distance":
|
|
179
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.distance)
|
|
180
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
181
|
-
case "glucose":
|
|
182
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.glucose)
|
|
183
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
184
|
-
case "heart":
|
|
185
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.heart)
|
|
186
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
187
|
-
case "oxygen_saturation":
|
|
188
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.oxygenSaturation)
|
|
189
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
190
|
-
case "sleep":
|
|
191
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.sleep)
|
|
192
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
193
|
-
case "steps":
|
|
194
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.steps)
|
|
195
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
196
|
-
case "steps_intraday":
|
|
197
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.stepsIntraday)
|
|
198
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
199
|
-
case "body":
|
|
200
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.body)
|
|
201
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
202
|
-
case "ecg":
|
|
203
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.ecg)
|
|
204
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
205
|
-
default:
|
|
206
|
-
return nil
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
static func extractAndPostDataInRange(_ dataType: String, connection: SpikeConnection, from: Date, to: Date) async throws -> String? {
|
|
211
|
-
switch dataType {
|
|
212
|
-
case "activities_summary":
|
|
213
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.activitiesSummary, from: from, to: to)
|
|
214
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
215
|
-
case "activities_stream":
|
|
216
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.activitiesStream, from: from, to: to)
|
|
217
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
218
|
-
case "breathing":
|
|
219
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.breathing, from: from, to: to)
|
|
220
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
221
|
-
case "calories":
|
|
222
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.calories, from: from, to: to)
|
|
223
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
224
|
-
case "distance":
|
|
225
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.distance, from: from, to: to)
|
|
226
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
227
|
-
case "glucose":
|
|
228
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.glucose, from: from, to: to)
|
|
229
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
230
|
-
case "heart":
|
|
231
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.heart, from: from, to: to)
|
|
232
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
233
|
-
case "oxygen_saturation":
|
|
234
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.oxygenSaturation, from: from, to: to)
|
|
235
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
236
|
-
case "sleep":
|
|
237
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.sleep, from: from, to: to)
|
|
238
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
239
|
-
case "steps":
|
|
240
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.steps, from: from, to: to)
|
|
241
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
242
|
-
case "steps_intraday":
|
|
243
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.stepsIntraday, from: from, to: to)
|
|
244
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
245
|
-
case "body":
|
|
246
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.body, from: from, to: to)
|
|
247
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
248
|
-
case "ecg":
|
|
249
|
-
let value = try await connection.extractAndPostData(SpikeDataTypes.ecg, from: from, to: to)
|
|
250
|
-
return try? String(data: JSONEncoder().encode(value), encoding: .utf8)
|
|
251
|
-
default:
|
|
252
|
-
return nil
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeActivitiesStreamDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeActivitiesSummaryDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeBodyDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeBreathingDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeCaloriesDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeData.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SpikeDataTypes = void 0;
|
|
7
|
-
var _SpikeDataType = require("../DataTypes/SpikeDataType");
|
|
8
|
-
const SpikeDataTypes = exports.SpikeDataTypes = {
|
|
9
|
-
activitiesSummary: new _SpikeDataType.SpikeActivitiesSummaryDataType(),
|
|
10
|
-
activitiesStream: new _SpikeDataType.SpikeActivitiesStreamDataType(),
|
|
11
|
-
breathing: new _SpikeDataType.SpikeBreathingDataType(),
|
|
12
|
-
calories: new _SpikeDataType.SpikeCaloriesDataType(),
|
|
13
|
-
distance: new _SpikeDataType.SpikeDistanceDataType(),
|
|
14
|
-
glucose: new _SpikeDataType.SpikeGlucoseDataType(),
|
|
15
|
-
heart: new _SpikeDataType.SpikeHeartDataType(),
|
|
16
|
-
oxygenSaturation: new _SpikeDataType.SpikeOxygenSaturationDataType(),
|
|
17
|
-
sleep: new _SpikeDataType.SpikeSleepDataType(),
|
|
18
|
-
steps: new _SpikeDataType.SpikeStepsDataType(),
|
|
19
|
-
stepsIntraday: new _SpikeDataType.SpikeStepsIntradayDataType(),
|
|
20
|
-
body: new _SpikeDataType.SpikeBodyDataType(),
|
|
21
|
-
ecg: new _SpikeDataType.SpikeEcgDataType()
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=SpikeDataTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_SpikeDataType","require","SpikeDataTypes","exports","activitiesSummary","SpikeActivitiesSummaryDataType","activitiesStream","SpikeActivitiesStreamDataType","breathing","SpikeBreathingDataType","calories","SpikeCaloriesDataType","distance","SpikeDistanceDataType","glucose","SpikeGlucoseDataType","heart","SpikeHeartDataType","oxygenSaturation","SpikeOxygenSaturationDataType","sleep","SpikeSleepDataType","steps","SpikeStepsDataType","stepsIntraday","SpikeStepsIntradayDataType","body","SpikeBodyDataType","ecg","SpikeEcgDataType"],"sourceRoot":"../../../src","sources":["DataModels/SpikeDataTypes.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAgBO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,iBAAiB,EAAE,IAAIC,6CAA8B,CAAC,CAAC;EACvDC,gBAAgB,EAAE,IAAIC,4CAA6B,CAAC,CAAC;EACrDC,SAAS,EAAE,IAAIC,qCAAsB,CAAC,CAAC;EACvCC,QAAQ,EAAE,IAAIC,oCAAqB,CAAC,CAAC;EACrCC,QAAQ,EAAE,IAAIC,oCAAqB,CAAC,CAAC;EACrCC,OAAO,EAAE,IAAIC,mCAAoB,CAAC,CAAC;EACnCC,KAAK,EAAE,IAAIC,iCAAkB,CAAC,CAAC;EAC/BC,gBAAgB,EAAE,IAAIC,4CAA6B,CAAC,CAAC;EACrDC,KAAK,EAAE,IAAIC,iCAAkB,CAAC,CAAC;EAC/BC,KAAK,EAAE,IAAIC,iCAAkB,CAAC,CAAC;EAC/BC,aAAa,EAAE,IAAIC,yCAA0B,CAAC,CAAC;EAC/CC,IAAI,EAAE,IAAIC,gCAAiB,CAAC,CAAC;EAC7BC,GAAG,EAAE,IAAIC,+BAAgB,CAAC;AAC5B,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeDistanceDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeEcgDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeGlucoseDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeHeartDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeOxygenSaturationDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeSleepDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeStepsDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeStepsIntradayDataEntry.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeWebhookJob.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SpikeStepsIntradayDataType = exports.SpikeStepsDataType = exports.SpikeSleepDataType = exports.SpikeOxygenSaturationDataType = exports.SpikeHeartDataType = exports.SpikeGlucoseDataType = exports.SpikeEcgDataType = exports.SpikeDistanceDataType = exports.SpikeCaloriesDataType = exports.SpikeBreathingDataType = exports.SpikeBodyDataType = exports.SpikeActivitiesSummaryDataType = exports.SpikeActivitiesStreamDataType = void 0;
|
|
7
|
-
class SpikeActivitiesStreamDataType {
|
|
8
|
-
rawValue = 'activities_stream';
|
|
9
|
-
}
|
|
10
|
-
exports.SpikeActivitiesStreamDataType = SpikeActivitiesStreamDataType;
|
|
11
|
-
class SpikeActivitiesSummaryDataType {
|
|
12
|
-
rawValue = 'activities_summary';
|
|
13
|
-
}
|
|
14
|
-
exports.SpikeActivitiesSummaryDataType = SpikeActivitiesSummaryDataType;
|
|
15
|
-
class SpikeBreathingDataType {
|
|
16
|
-
rawValue = 'breathing';
|
|
17
|
-
}
|
|
18
|
-
exports.SpikeBreathingDataType = SpikeBreathingDataType;
|
|
19
|
-
class SpikeCaloriesDataType {
|
|
20
|
-
rawValue = 'calories';
|
|
21
|
-
}
|
|
22
|
-
exports.SpikeCaloriesDataType = SpikeCaloriesDataType;
|
|
23
|
-
class SpikeDistanceDataType {
|
|
24
|
-
rawValue = 'distance';
|
|
25
|
-
}
|
|
26
|
-
exports.SpikeDistanceDataType = SpikeDistanceDataType;
|
|
27
|
-
class SpikeGlucoseDataType {
|
|
28
|
-
rawValue = 'glucose';
|
|
29
|
-
}
|
|
30
|
-
exports.SpikeGlucoseDataType = SpikeGlucoseDataType;
|
|
31
|
-
class SpikeHeartDataType {
|
|
32
|
-
rawValue = 'heart';
|
|
33
|
-
}
|
|
34
|
-
exports.SpikeHeartDataType = SpikeHeartDataType;
|
|
35
|
-
class SpikeOxygenSaturationDataType {
|
|
36
|
-
rawValue = 'oxygen_saturation';
|
|
37
|
-
}
|
|
38
|
-
exports.SpikeOxygenSaturationDataType = SpikeOxygenSaturationDataType;
|
|
39
|
-
class SpikeSleepDataType {
|
|
40
|
-
rawValue = 'sleep';
|
|
41
|
-
}
|
|
42
|
-
exports.SpikeSleepDataType = SpikeSleepDataType;
|
|
43
|
-
class SpikeStepsDataType {
|
|
44
|
-
rawValue = 'steps';
|
|
45
|
-
}
|
|
46
|
-
exports.SpikeStepsDataType = SpikeStepsDataType;
|
|
47
|
-
class SpikeStepsIntradayDataType {
|
|
48
|
-
rawValue = 'steps_intraday';
|
|
49
|
-
}
|
|
50
|
-
exports.SpikeStepsIntradayDataType = SpikeStepsIntradayDataType;
|
|
51
|
-
class SpikeBodyDataType {
|
|
52
|
-
rawValue = 'body';
|
|
53
|
-
}
|
|
54
|
-
exports.SpikeBodyDataType = SpikeBodyDataType;
|
|
55
|
-
class SpikeEcgDataType {
|
|
56
|
-
rawValue = 'ecg';
|
|
57
|
-
}
|
|
58
|
-
exports.SpikeEcgDataType = SpikeEcgDataType;
|
|
59
|
-
//# sourceMappingURL=SpikeDataType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SpikeActivitiesStreamDataType","rawValue","exports","SpikeActivitiesSummaryDataType","SpikeBreathingDataType","SpikeCaloriesDataType","SpikeDistanceDataType","SpikeGlucoseDataType","SpikeHeartDataType","SpikeOxygenSaturationDataType","SpikeSleepDataType","SpikeStepsDataType","SpikeStepsIntradayDataType","SpikeBodyDataType","SpikeEcgDataType"],"sourceRoot":"../../../src","sources":["DataTypes/SpikeDataType.ts"],"mappings":";;;;;;AA6BO,MAAMA,6BAA6B,CAAC;EACzCC,QAAQ,GAAwB,mBAAmB;AAErD;AAACC,OAAA,CAAAF,6BAAA,GAAAA,6BAAA;AAEM,MAAMG,8BAA8B,CAAC;EAC1CF,QAAQ,GAAwB,oBAAoB;AAEtD;AAACC,OAAA,CAAAC,8BAAA,GAAAA,8BAAA;AAEM,MAAMC,sBAAsB,CAAC;EAClCH,QAAQ,GAAwB,WAAW;AAE7C;AAACC,OAAA,CAAAE,sBAAA,GAAAA,sBAAA;AAEM,MAAMC,qBAAqB,CAAC;EACjCJ,QAAQ,GAAwB,UAAU;AAE5C;AAACC,OAAA,CAAAG,qBAAA,GAAAA,qBAAA;AAEM,MAAMC,qBAAqB,CAAC;EACjCL,QAAQ,GAAwB,UAAU;AAE5C;AAACC,OAAA,CAAAI,qBAAA,GAAAA,qBAAA;AAEM,MAAMC,oBAAoB,CAAC;EAChCN,QAAQ,GAAwB,SAAS;AAE3C;AAACC,OAAA,CAAAK,oBAAA,GAAAA,oBAAA;AAEM,MAAMC,kBAAkB,CAAC;EAC9BP,QAAQ,GAAwB,OAAO;AAEzC;AAACC,OAAA,CAAAM,kBAAA,GAAAA,kBAAA;AAEM,MAAMC,6BAA6B,CAAC;EACzCR,QAAQ,GAAwB,mBAAmB;AAErD;AAACC,OAAA,CAAAO,6BAAA,GAAAA,6BAAA;AAEM,MAAMC,kBAAkB,CAAC;EAC9BT,QAAQ,GAAwB,OAAO;AAEzC;AAACC,OAAA,CAAAQ,kBAAA,GAAAA,kBAAA;AAEM,MAAMC,kBAAkB,CAAC;EAC9BV,QAAQ,GAAwB,OAAO;AAEzC;AAACC,OAAA,CAAAS,kBAAA,GAAAA,kBAAA;AAEM,MAAMC,0BAA0B,CAAC;EACtCX,QAAQ,GAAwB,gBAAgB;AAElD;AAACC,OAAA,CAAAU,0BAAA,GAAAA,0BAAA;AAEM,MAAMC,iBAAiB,CAAC;EAC7BZ,QAAQ,GAAwB,MAAM;AAExC;AAACC,OAAA,CAAAW,iBAAA,GAAAA,iBAAA;AAEM,MAAMC,gBAAgB,CAAC;EAC5Bb,QAAQ,GAAwB,KAAK;AAEvC;AAACC,OAAA,CAAAY,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["SpikeBackgroundDeliveriesLogger.ts"],"mappings":"","ignoreList":[]}
|