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.
Files changed (193) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/spikesdk/SpikeMappers.kt +0 -46
  3. package/android/src/main/java/com/spikesdk/SpikeSdkModule.kt +50 -483
  4. package/ios/SpikeExceptionMapper.swift +4 -12
  5. package/ios/SpikeSdk.m +8 -79
  6. package/ios/SpikeSdk.swift +62 -419
  7. package/lib/commonjs/Spike.js +1 -57
  8. package/lib/commonjs/Spike.js.map +1 -1
  9. package/lib/commonjs/SpikeException.js +15 -94
  10. package/lib/commonjs/SpikeException.js.map +1 -1
  11. package/lib/commonjs/index.js +0 -71
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/v3/SpikeRNConnectionAPIv3.js +40 -17
  14. package/lib/commonjs/v3/SpikeRNConnectionAPIv3.js.map +1 -1
  15. package/lib/commonjs/version.js +1 -1
  16. package/lib/module/Spike.js +1 -55
  17. package/lib/module/Spike.js.map +1 -1
  18. package/lib/module/SpikeException.js +14 -83
  19. package/lib/module/SpikeException.js.map +1 -1
  20. package/lib/module/index.js +3 -8
  21. package/lib/module/index.js.map +1 -1
  22. package/lib/module/v3/SpikeRNConnectionAPIv3.js +40 -17
  23. package/lib/module/v3/SpikeRNConnectionAPIv3.js.map +1 -1
  24. package/lib/module/version.js +1 -1
  25. package/lib/typescript/Spike.d.ts +2 -29
  26. package/lib/typescript/Spike.d.ts.map +1 -1
  27. package/lib/typescript/SpikeException.d.ts +5 -30
  28. package/lib/typescript/SpikeException.d.ts.map +1 -1
  29. package/lib/typescript/index.d.ts +6 -25
  30. package/lib/typescript/index.d.ts.map +1 -1
  31. package/lib/typescript/v3/DataModels/BackgroundDeliveryConfig.d.ts +2 -0
  32. package/lib/typescript/v3/DataModels/BackgroundDeliveryConfig.d.ts.map +1 -1
  33. package/lib/typescript/v3/SpikeRNConnectionAPIv3.d.ts +34 -9
  34. package/lib/typescript/v3/SpikeRNConnectionAPIv3.d.ts.map +1 -1
  35. package/lib/typescript/version.d.ts +1 -1
  36. package/package.json +2 -2
  37. package/src/Spike.ts +4 -89
  38. package/src/SpikeException.ts +13 -96
  39. package/src/index.ts +2 -61
  40. package/src/v3/DataModels/BackgroundDeliveryConfig.ts +2 -0
  41. package/src/v3/SpikeRNConnectionAPIv3.ts +82 -19
  42. package/src/version.ts +1 -1
  43. package/android/src/main/java/com/spikesdk/SpikeConnectionLogger.kt +0 -37
  44. package/ios/SpikeConnectionListener.swift +0 -17
  45. package/ios/SpikeConnectionLogger.swift +0 -43
  46. package/ios/SpikeDataTypeMapper.swift +0 -255
  47. package/lib/commonjs/DataModels/SpikeActivitiesStreamDataEntry.js +0 -2
  48. package/lib/commonjs/DataModels/SpikeActivitiesStreamDataEntry.js.map +0 -1
  49. package/lib/commonjs/DataModels/SpikeActivitiesSummaryDataEntry.js +0 -2
  50. package/lib/commonjs/DataModels/SpikeActivitiesSummaryDataEntry.js.map +0 -1
  51. package/lib/commonjs/DataModels/SpikeBodyDataEntry.js +0 -2
  52. package/lib/commonjs/DataModels/SpikeBodyDataEntry.js.map +0 -1
  53. package/lib/commonjs/DataModels/SpikeBreathingDataEntry.js +0 -2
  54. package/lib/commonjs/DataModels/SpikeBreathingDataEntry.js.map +0 -1
  55. package/lib/commonjs/DataModels/SpikeCaloriesDataEntry.js +0 -2
  56. package/lib/commonjs/DataModels/SpikeCaloriesDataEntry.js.map +0 -1
  57. package/lib/commonjs/DataModels/SpikeData.js +0 -6
  58. package/lib/commonjs/DataModels/SpikeData.js.map +0 -1
  59. package/lib/commonjs/DataModels/SpikeDataTypes.js +0 -23
  60. package/lib/commonjs/DataModels/SpikeDataTypes.js.map +0 -1
  61. package/lib/commonjs/DataModels/SpikeDistanceDataEntry.js +0 -2
  62. package/lib/commonjs/DataModels/SpikeDistanceDataEntry.js.map +0 -1
  63. package/lib/commonjs/DataModels/SpikeEcgDataEntry.js +0 -2
  64. package/lib/commonjs/DataModels/SpikeEcgDataEntry.js.map +0 -1
  65. package/lib/commonjs/DataModels/SpikeGlucoseDataEntry.js +0 -2
  66. package/lib/commonjs/DataModels/SpikeGlucoseDataEntry.js.map +0 -1
  67. package/lib/commonjs/DataModels/SpikeHeartDataEntry.js +0 -2
  68. package/lib/commonjs/DataModels/SpikeHeartDataEntry.js.map +0 -1
  69. package/lib/commonjs/DataModels/SpikeOxygenSaturationDataEntry.js +0 -2
  70. package/lib/commonjs/DataModels/SpikeOxygenSaturationDataEntry.js.map +0 -1
  71. package/lib/commonjs/DataModels/SpikeSleepDataEntry.js +0 -2
  72. package/lib/commonjs/DataModels/SpikeSleepDataEntry.js.map +0 -1
  73. package/lib/commonjs/DataModels/SpikeStepsDataEntry.js +0 -2
  74. package/lib/commonjs/DataModels/SpikeStepsDataEntry.js.map +0 -1
  75. package/lib/commonjs/DataModels/SpikeStepsIntradayDataEntry.js +0 -2
  76. package/lib/commonjs/DataModels/SpikeStepsIntradayDataEntry.js.map +0 -1
  77. package/lib/commonjs/DataModels/SpikeWebhookJob.js +0 -2
  78. package/lib/commonjs/DataModels/SpikeWebhookJob.js.map +0 -1
  79. package/lib/commonjs/DataTypes/SpikeDataType.js +0 -59
  80. package/lib/commonjs/DataTypes/SpikeDataType.js.map +0 -1
  81. package/lib/commonjs/SpikeBackgroundDeliveriesLogger.js +0 -2
  82. package/lib/commonjs/SpikeBackgroundDeliveriesLogger.js.map +0 -1
  83. package/lib/commonjs/SpikeConnection.js +0 -301
  84. package/lib/commonjs/SpikeConnection.js.map +0 -1
  85. package/lib/commonjs/SpikeConnectionTypes.js +0 -6
  86. package/lib/commonjs/SpikeConnectionTypes.js.map +0 -1
  87. package/lib/commonjs/SpikeLogger.js +0 -6
  88. package/lib/commonjs/SpikeLogger.js.map +0 -1
  89. package/lib/module/DataModels/SpikeActivitiesStreamDataEntry.js +0 -2
  90. package/lib/module/DataModels/SpikeActivitiesStreamDataEntry.js.map +0 -1
  91. package/lib/module/DataModels/SpikeActivitiesSummaryDataEntry.js +0 -2
  92. package/lib/module/DataModels/SpikeActivitiesSummaryDataEntry.js.map +0 -1
  93. package/lib/module/DataModels/SpikeBodyDataEntry.js +0 -2
  94. package/lib/module/DataModels/SpikeBodyDataEntry.js.map +0 -1
  95. package/lib/module/DataModels/SpikeBreathingDataEntry.js +0 -2
  96. package/lib/module/DataModels/SpikeBreathingDataEntry.js.map +0 -1
  97. package/lib/module/DataModels/SpikeCaloriesDataEntry.js +0 -2
  98. package/lib/module/DataModels/SpikeCaloriesDataEntry.js.map +0 -1
  99. package/lib/module/DataModels/SpikeData.js +0 -4
  100. package/lib/module/DataModels/SpikeData.js.map +0 -1
  101. package/lib/module/DataModels/SpikeDataTypes.js +0 -19
  102. package/lib/module/DataModels/SpikeDataTypes.js.map +0 -1
  103. package/lib/module/DataModels/SpikeDistanceDataEntry.js +0 -2
  104. package/lib/module/DataModels/SpikeDistanceDataEntry.js.map +0 -1
  105. package/lib/module/DataModels/SpikeEcgDataEntry.js +0 -2
  106. package/lib/module/DataModels/SpikeEcgDataEntry.js.map +0 -1
  107. package/lib/module/DataModels/SpikeGlucoseDataEntry.js +0 -2
  108. package/lib/module/DataModels/SpikeGlucoseDataEntry.js.map +0 -1
  109. package/lib/module/DataModels/SpikeHeartDataEntry.js +0 -2
  110. package/lib/module/DataModels/SpikeHeartDataEntry.js.map +0 -1
  111. package/lib/module/DataModels/SpikeOxygenSaturationDataEntry.js +0 -2
  112. package/lib/module/DataModels/SpikeOxygenSaturationDataEntry.js.map +0 -1
  113. package/lib/module/DataModels/SpikeSleepDataEntry.js +0 -2
  114. package/lib/module/DataModels/SpikeSleepDataEntry.js.map +0 -1
  115. package/lib/module/DataModels/SpikeStepsDataEntry.js +0 -2
  116. package/lib/module/DataModels/SpikeStepsDataEntry.js.map +0 -1
  117. package/lib/module/DataModels/SpikeStepsIntradayDataEntry.js +0 -2
  118. package/lib/module/DataModels/SpikeStepsIntradayDataEntry.js.map +0 -1
  119. package/lib/module/DataModels/SpikeWebhookJob.js +0 -2
  120. package/lib/module/DataModels/SpikeWebhookJob.js.map +0 -1
  121. package/lib/module/DataTypes/SpikeDataType.js +0 -42
  122. package/lib/module/DataTypes/SpikeDataType.js.map +0 -1
  123. package/lib/module/SpikeBackgroundDeliveriesLogger.js +0 -2
  124. package/lib/module/SpikeBackgroundDeliveriesLogger.js.map +0 -1
  125. package/lib/module/SpikeConnection.js +0 -296
  126. package/lib/module/SpikeConnection.js.map +0 -1
  127. package/lib/module/SpikeConnectionTypes.js +0 -4
  128. package/lib/module/SpikeConnectionTypes.js.map +0 -1
  129. package/lib/module/SpikeLogger.js +0 -4
  130. package/lib/module/SpikeLogger.js.map +0 -1
  131. package/lib/typescript/DataModels/SpikeActivitiesStreamDataEntry.d.ts +0 -66
  132. package/lib/typescript/DataModels/SpikeActivitiesStreamDataEntry.d.ts.map +0 -1
  133. package/lib/typescript/DataModels/SpikeActivitiesSummaryDataEntry.d.ts +0 -29
  134. package/lib/typescript/DataModels/SpikeActivitiesSummaryDataEntry.d.ts.map +0 -1
  135. package/lib/typescript/DataModels/SpikeBodyDataEntry.d.ts +0 -54
  136. package/lib/typescript/DataModels/SpikeBodyDataEntry.d.ts.map +0 -1
  137. package/lib/typescript/DataModels/SpikeBreathingDataEntry.d.ts +0 -13
  138. package/lib/typescript/DataModels/SpikeBreathingDataEntry.d.ts.map +0 -1
  139. package/lib/typescript/DataModels/SpikeCaloriesDataEntry.d.ts +0 -15
  140. package/lib/typescript/DataModels/SpikeCaloriesDataEntry.d.ts.map +0 -1
  141. package/lib/typescript/DataModels/SpikeData.d.ts +0 -27
  142. package/lib/typescript/DataModels/SpikeData.d.ts.map +0 -1
  143. package/lib/typescript/DataModels/SpikeDataTypes.d.ts +0 -17
  144. package/lib/typescript/DataModels/SpikeDataTypes.d.ts.map +0 -1
  145. package/lib/typescript/DataModels/SpikeDistanceDataEntry.d.ts +0 -13
  146. package/lib/typescript/DataModels/SpikeDistanceDataEntry.d.ts.map +0 -1
  147. package/lib/typescript/DataModels/SpikeEcgDataEntry.d.ts +0 -13
  148. package/lib/typescript/DataModels/SpikeEcgDataEntry.d.ts.map +0 -1
  149. package/lib/typescript/DataModels/SpikeGlucoseDataEntry.d.ts +0 -21
  150. package/lib/typescript/DataModels/SpikeGlucoseDataEntry.d.ts.map +0 -1
  151. package/lib/typescript/DataModels/SpikeHeartDataEntry.d.ts +0 -32
  152. package/lib/typescript/DataModels/SpikeHeartDataEntry.d.ts.map +0 -1
  153. package/lib/typescript/DataModels/SpikeOxygenSaturationDataEntry.d.ts +0 -15
  154. package/lib/typescript/DataModels/SpikeOxygenSaturationDataEntry.d.ts.map +0 -1
  155. package/lib/typescript/DataModels/SpikeSleepDataEntry.d.ts +0 -30
  156. package/lib/typescript/DataModels/SpikeSleepDataEntry.d.ts.map +0 -1
  157. package/lib/typescript/DataModels/SpikeStepsDataEntry.d.ts +0 -13
  158. package/lib/typescript/DataModels/SpikeStepsDataEntry.d.ts.map +0 -1
  159. package/lib/typescript/DataModels/SpikeStepsIntradayDataEntry.d.ts +0 -17
  160. package/lib/typescript/DataModels/SpikeStepsIntradayDataEntry.d.ts.map +0 -1
  161. package/lib/typescript/DataModels/SpikeWebhookJob.d.ts +0 -11
  162. package/lib/typescript/DataModels/SpikeWebhookJob.d.ts.map +0 -1
  163. package/lib/typescript/DataTypes/SpikeDataType.d.ts +0 -68
  164. package/lib/typescript/DataTypes/SpikeDataType.d.ts.map +0 -1
  165. package/lib/typescript/SpikeBackgroundDeliveriesLogger.d.ts +0 -4
  166. package/lib/typescript/SpikeBackgroundDeliveriesLogger.d.ts.map +0 -1
  167. package/lib/typescript/SpikeConnection.d.ts +0 -63
  168. package/lib/typescript/SpikeConnection.d.ts.map +0 -1
  169. package/lib/typescript/SpikeConnectionTypes.d.ts +0 -102
  170. package/lib/typescript/SpikeConnectionTypes.d.ts.map +0 -1
  171. package/lib/typescript/SpikeLogger.d.ts +0 -13
  172. package/lib/typescript/SpikeLogger.d.ts.map +0 -1
  173. package/src/DataModels/SpikeActivitiesStreamDataEntry.ts +0 -67
  174. package/src/DataModels/SpikeActivitiesSummaryDataEntry.ts +0 -28
  175. package/src/DataModels/SpikeBodyDataEntry.ts +0 -61
  176. package/src/DataModels/SpikeBreathingDataEntry.ts +0 -12
  177. package/src/DataModels/SpikeCaloriesDataEntry.ts +0 -13
  178. package/src/DataModels/SpikeData.ts +0 -38
  179. package/src/DataModels/SpikeDataTypes.ts +0 -31
  180. package/src/DataModels/SpikeDistanceDataEntry.ts +0 -12
  181. package/src/DataModels/SpikeEcgDataEntry.ts +0 -12
  182. package/src/DataModels/SpikeGlucoseDataEntry.ts +0 -20
  183. package/src/DataModels/SpikeHeartDataEntry.ts +0 -34
  184. package/src/DataModels/SpikeOxygenSaturationDataEntry.ts +0 -14
  185. package/src/DataModels/SpikeSleepDataEntry.ts +0 -29
  186. package/src/DataModels/SpikeStepsDataEntry.ts +0 -12
  187. package/src/DataModels/SpikeStepsIntradayDataEntry.ts +0 -16
  188. package/src/DataModels/SpikeWebhookJob.ts +0 -10
  189. package/src/DataTypes/SpikeDataType.ts +0 -93
  190. package/src/SpikeBackgroundDeliveriesLogger.ts +0 -3
  191. package/src/SpikeConnection.ts +0 -495
  192. package/src/SpikeConnectionTypes.ts +0 -124
  193. 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,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeActivitiesStreamDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeActivitiesStreamDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeActivitiesSummaryDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeActivitiesSummaryDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeBodyDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeBodyDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeBreathingDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeBreathingDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeCaloriesDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeCaloriesDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=SpikeData.js.map
@@ -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,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeDistanceDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeDistanceDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeEcgDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeEcgDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeGlucoseDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeGlucoseDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeHeartDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeHeartDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeOxygenSaturationDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeOxygenSaturationDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeSleepDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeSleepDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeStepsDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeStepsDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeStepsIntradayDataEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["DataModels/SpikeStepsIntradayDataEntry.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeWebhookJob.js.map
@@ -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,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=SpikeBackgroundDeliveriesLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["SpikeBackgroundDeliveriesLogger.ts"],"mappings":"","ignoreList":[]}